@emilgroup/document-sdk 1.1.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +4 -0
- package/README.md +5 -22
- package/api/document-templates-api.ts +29 -19
- package/api/documents-api.ts +1 -5
- package/api/layouts-api.ts +1 -5
- package/api/product-documents-api.ts +113 -5
- package/api/search-keywords-api.ts +1 -5
- package/api/searchable-document-owners-api.ts +1 -5
- package/api/searchable-documents-api.ts +21 -11
- package/api.ts +1 -5
- package/base.ts +60 -94
- package/common.ts +2 -3
- package/configuration.ts +1 -9
- package/dist/api/document-templates-api.d.ts +21 -12
- package/dist/api/document-templates-api.js +24 -22
- package/dist/api/documents-api.d.ts +1 -1
- package/dist/api/documents-api.js +8 -12
- package/dist/api/layouts-api.d.ts +1 -1
- package/dist/api/layouts-api.js +6 -10
- package/dist/api/product-documents-api.d.ts +62 -1
- package/dist/api/product-documents-api.js +99 -9
- package/dist/api/search-keywords-api.d.ts +1 -1
- package/dist/api/search-keywords-api.js +2 -6
- package/dist/api/searchable-document-owners-api.d.ts +1 -1
- package/dist/api/searchable-document-owners-api.js +2 -6
- package/dist/api/searchable-documents-api.d.ts +13 -4
- package/dist/api/searchable-documents-api.js +14 -12
- package/dist/api.d.ts +1 -1
- package/dist/api.js +1 -1
- package/dist/base.d.ts +6 -10
- package/dist/base.js +41 -137
- package/dist/common.d.ts +2 -3
- package/dist/common.js +2 -3
- package/dist/configuration.d.ts +1 -8
- package/dist/configuration.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/models/create-doc-template-request-dto.d.ts +7 -1
- package/dist/models/create-doc-template-request-dto.js +1 -1
- package/dist/models/create-doc-template-response-class.d.ts +1 -1
- package/dist/models/create-doc-template-response-class.js +1 -1
- package/dist/models/create-document-request-dto.d.ts +1 -1
- package/dist/models/create-document-request-dto.js +1 -1
- package/dist/models/create-document-sync-response-class.d.ts +1 -1
- package/dist/models/create-document-sync-response-class.js +1 -1
- package/dist/models/create-html-template-dto.d.ts +1 -1
- package/dist/models/create-html-template-dto.js +1 -1
- package/dist/models/create-layout-request-dto.d.ts +1 -1
- package/dist/models/create-layout-request-dto.js +1 -1
- package/dist/models/create-layout-response-class.d.ts +1 -1
- package/dist/models/create-layout-response-class.js +1 -1
- package/dist/models/create-presigned-post-request-dto.d.ts +1 -1
- package/dist/models/create-presigned-post-request-dto.js +1 -1
- package/dist/models/create-presigned-post-response-class.d.ts +1 -1
- package/dist/models/create-presigned-post-response-class.js +1 -1
- package/dist/models/delete-layout-request-dto.d.ts +1 -1
- package/dist/models/delete-layout-request-dto.js +1 -1
- package/dist/models/delete-product-document-request-dto.d.ts +1 -1
- package/dist/models/delete-product-document-request-dto.js +1 -1
- package/dist/models/delete-request-dto.d.ts +1 -1
- package/dist/models/delete-request-dto.js +1 -1
- package/dist/models/delete-response-class.d.ts +1 -1
- package/dist/models/delete-response-class.js +1 -1
- package/dist/models/doc-template-class.d.ts +7 -1
- package/dist/models/doc-template-class.js +1 -1
- package/dist/models/document-class.d.ts +1 -1
- package/dist/models/document-class.js +1 -1
- package/dist/models/download-document-request-dto.d.ts +1 -1
- package/dist/models/download-document-request-dto.js +1 -1
- package/dist/models/get-doc-template-request-dto.d.ts +1 -1
- package/dist/models/get-doc-template-request-dto.js +1 -1
- package/dist/models/get-doc-template-response-class.d.ts +1 -1
- package/dist/models/get-doc-template-response-class.js +1 -1
- package/dist/models/get-document-download-url-response-class.d.ts +1 -1
- package/dist/models/get-document-download-url-response-class.js +1 -1
- package/dist/models/get-layout-request-dto.d.ts +1 -1
- package/dist/models/get-layout-request-dto.js +1 -1
- package/dist/models/get-layout-response-class.d.ts +1 -1
- package/dist/models/get-layout-response-class.js +1 -1
- package/dist/models/get-product-document-download-url-response-class.d.ts +24 -0
- package/dist/models/get-product-document-download-url-response-class.js +15 -0
- package/dist/models/get-product-document-response-class.d.ts +1 -1
- package/dist/models/get-product-document-response-class.js +1 -1
- package/dist/models/get-signed-s3-key-url-response-class.d.ts +1 -1
- package/dist/models/get-signed-s3-key-url-response-class.js +1 -1
- package/dist/models/grpc-create-doc-template-request-dto.d.ts +55 -0
- package/dist/models/grpc-create-doc-template-request-dto.js +15 -0
- package/dist/models/grpc-update-doc-template-request-dto.d.ts +61 -0
- package/dist/models/grpc-update-doc-template-request-dto.js +15 -0
- package/dist/models/html-template-class.d.ts +1 -1
- package/dist/models/html-template-class.js +1 -1
- package/dist/models/index.d.ts +4 -0
- package/dist/models/index.js +4 -0
- package/dist/models/layout-class.d.ts +1 -1
- package/dist/models/layout-class.js +1 -1
- package/dist/models/list-doc-template-request-dto.d.ts +7 -1
- package/dist/models/list-doc-template-request-dto.js +1 -1
- package/dist/models/list-doc-templates-response-class.d.ts +1 -1
- package/dist/models/list-doc-templates-response-class.js +1 -1
- package/dist/models/list-documents-response-class.d.ts +1 -1
- package/dist/models/list-documents-response-class.js +1 -1
- package/dist/models/list-layouts-response-class.d.ts +1 -1
- package/dist/models/list-layouts-response-class.js +1 -1
- package/dist/models/list-product-documents-response-class.d.ts +1 -1
- package/dist/models/list-product-documents-response-class.js +1 -1
- package/dist/models/list-request-dto.d.ts +1 -1
- package/dist/models/list-request-dto.js +1 -1
- package/dist/models/list-search-keywords-request-dto.d.ts +1 -1
- package/dist/models/list-search-keywords-request-dto.js +1 -1
- package/dist/models/list-search-keywords-response-class.d.ts +1 -1
- package/dist/models/list-search-keywords-response-class.js +1 -1
- package/dist/models/list-searchable-document-owners-request-dto.d.ts +31 -0
- package/dist/models/list-searchable-document-owners-request-dto.js +22 -0
- package/dist/models/list-searchable-document-owners-response-class.d.ts +1 -1
- package/dist/models/list-searchable-document-owners-response-class.js +1 -1
- package/dist/models/list-searchable-documents-request-dto.d.ts +14 -1
- package/dist/models/list-searchable-documents-request-dto.js +8 -1
- package/dist/models/list-searchable-documents-response-class.d.ts +1 -1
- package/dist/models/list-searchable-documents-response-class.js +1 -1
- package/dist/models/product-document-class.d.ts +18 -1
- package/dist/models/product-document-class.js +12 -2
- package/dist/models/searchable-document-class.d.ts +1 -1
- package/dist/models/searchable-document-class.js +1 -1
- package/dist/models/searchable-document-owner-class.d.ts +1 -1
- package/dist/models/searchable-document-owner-class.js +1 -1
- package/dist/models/update-doc-template-request-dto.d.ts +7 -1
- package/dist/models/update-doc-template-request-dto.js +1 -1
- package/dist/models/update-doc-template-response-class.d.ts +1 -1
- package/dist/models/update-doc-template-response-class.js +1 -1
- package/dist/models/update-document-request-dto.d.ts +1 -1
- package/dist/models/update-document-request-dto.js +1 -1
- package/dist/models/update-document-response-class.d.ts +1 -1
- package/dist/models/update-document-response-class.js +1 -1
- package/dist/models/update-html-template-dto.d.ts +1 -1
- package/dist/models/update-html-template-dto.js +1 -1
- package/dist/models/update-layout-request-dto.d.ts +1 -1
- package/dist/models/update-layout-request-dto.js +1 -1
- package/dist/models/update-layout-response-class.d.ts +1 -1
- package/dist/models/update-layout-response-class.js +1 -1
- package/dist/models/upload-product-document-request-dto.d.ts +7 -1
- package/dist/models/upload-product-document-request-dto.js +1 -1
- package/index.ts +1 -1
- package/models/create-doc-template-request-dto.ts +7 -1
- package/models/create-doc-template-response-class.ts +1 -1
- package/models/create-document-request-dto.ts +1 -1
- package/models/create-document-sync-response-class.ts +1 -1
- package/models/create-html-template-dto.ts +1 -1
- package/models/create-layout-request-dto.ts +1 -1
- package/models/create-layout-response-class.ts +1 -1
- package/models/create-presigned-post-request-dto.ts +1 -1
- package/models/create-presigned-post-response-class.ts +1 -1
- package/models/delete-layout-request-dto.ts +1 -1
- package/models/delete-product-document-request-dto.ts +1 -1
- package/models/delete-request-dto.ts +1 -1
- package/models/delete-response-class.ts +1 -1
- package/models/doc-template-class.ts +7 -1
- package/models/document-class.ts +1 -1
- package/models/download-document-request-dto.ts +1 -1
- package/models/get-doc-template-request-dto.ts +1 -1
- package/models/get-doc-template-response-class.ts +1 -1
- package/models/get-document-download-url-response-class.ts +1 -1
- package/models/get-layout-request-dto.ts +1 -1
- package/models/get-layout-response-class.ts +1 -1
- package/models/get-product-document-download-url-response-class.ts +30 -0
- package/models/get-product-document-response-class.ts +1 -1
- package/models/get-signed-s3-key-url-response-class.ts +1 -1
- package/models/grpc-create-doc-template-request-dto.ts +61 -0
- package/models/grpc-update-doc-template-request-dto.ts +67 -0
- package/models/html-template-class.ts +1 -1
- package/models/index.ts +4 -0
- package/models/layout-class.ts +1 -1
- package/models/list-doc-template-request-dto.ts +7 -1
- package/models/list-doc-templates-response-class.ts +1 -1
- package/models/list-documents-response-class.ts +1 -1
- package/models/list-layouts-response-class.ts +1 -1
- package/models/list-product-documents-response-class.ts +1 -1
- package/models/list-request-dto.ts +1 -1
- package/models/list-search-keywords-request-dto.ts +1 -1
- package/models/list-search-keywords-response-class.ts +1 -1
- package/models/list-searchable-document-owners-request-dto.ts +40 -0
- package/models/list-searchable-document-owners-response-class.ts +1 -1
- package/models/list-searchable-documents-request-dto.ts +17 -1
- package/models/list-searchable-documents-response-class.ts +1 -1
- package/models/product-document-class.ts +19 -1
- package/models/searchable-document-class.ts +1 -1
- package/models/searchable-document-owner-class.ts +1 -1
- package/models/update-doc-template-request-dto.ts +7 -1
- package/models/update-doc-template-response-class.ts +1 -1
- package/models/update-document-request-dto.ts +1 -1
- package/models/update-document-response-class.ts +1 -1
- package/models/update-html-template-dto.ts +1 -1
- package/models/update-layout-request-dto.ts +1 -1
- package/models/update-layout-response-class.ts +1 -1
- package/models/upload-product-document-request-dto.ts +7 -1
- package/package.json +2 -5
package/base.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* The EMIL DocumentService API description
|
|
6
6
|
*
|
|
7
7
|
* The version of the OpenAPI document: 1.0
|
|
8
|
-
*
|
|
8
|
+
* Contact: kontakt@emil.de
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
11
|
* https://openapi-generator.tech
|
|
@@ -14,20 +14,13 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
import { Configuration } from "./configuration";
|
|
17
|
+
import { defaultStorage } from "./common";
|
|
17
18
|
// Some imports not used depending on template conditions
|
|
18
19
|
// @ts-ignore
|
|
19
20
|
import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
20
|
-
import * as fs from 'fs';
|
|
21
|
-
import * as path from 'path';
|
|
22
|
-
import * as os from 'os';
|
|
23
21
|
|
|
24
|
-
export const BASE_PATH = "https://apiv2.emil.de".replace(/\/+$/, "");
|
|
25
|
-
const CONFIG_DIRECTORY = '.emil';
|
|
26
|
-
const CONFIG_FILENAME = 'credentials';
|
|
27
|
-
const KEY_USERNAME = 'emil_username';
|
|
28
|
-
const KEY_PASSWORD = 'emil_password';
|
|
29
22
|
|
|
30
|
-
const
|
|
23
|
+
export const BASE_PATH = "https://apiv2.emil.de".replace(/\/+$/, "");
|
|
31
24
|
/**
|
|
32
25
|
*
|
|
33
26
|
* @export
|
|
@@ -67,7 +60,13 @@ export interface RequestArgs {
|
|
|
67
60
|
options: AxiosRequestConfig;
|
|
68
61
|
}
|
|
69
62
|
|
|
63
|
+
interface TokenData {
|
|
64
|
+
accessToken?: string;
|
|
65
|
+
username?: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
70
68
|
const NETWORK_ERROR_MESSAGE = "Network Error";
|
|
69
|
+
const TOKEN_DATA = 'APP_TOKEN';
|
|
71
70
|
|
|
72
71
|
/**
|
|
73
72
|
*
|
|
@@ -75,75 +74,31 @@ const NETWORK_ERROR_MESSAGE = "Network Error";
|
|
|
75
74
|
* @class BaseAPI
|
|
76
75
|
*/
|
|
77
76
|
export class BaseAPI {
|
|
78
|
-
protected configuration: Configuration;
|
|
79
|
-
private
|
|
80
|
-
|
|
77
|
+
protected configuration: Configuration | undefined;
|
|
78
|
+
private tokenData?: TokenData;
|
|
79
|
+
|
|
80
|
+
constructor(configuration?: Configuration,
|
|
81
|
+
protected basePath: string = BASE_PATH,
|
|
82
|
+
protected axios: AxiosInstance = globalAxios) {
|
|
83
|
+
|
|
84
|
+
this.loadTokenData();
|
|
81
85
|
|
|
82
|
-
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
|
|
83
86
|
if (configuration) {
|
|
84
87
|
this.configuration = configuration;
|
|
85
88
|
this.basePath = configuration.basePath || this.basePath;
|
|
86
89
|
} else {
|
|
90
|
+
const { accessToken, username } = this.tokenData;
|
|
91
|
+
|
|
87
92
|
this.configuration = new Configuration({
|
|
88
93
|
basePath: this.basePath,
|
|
94
|
+
accessToken: accessToken ? `Bearer ${accessToken}` : '',
|
|
95
|
+
username,
|
|
89
96
|
});
|
|
90
97
|
}
|
|
91
98
|
|
|
92
99
|
this.attachInterceptor(axios);
|
|
93
100
|
}
|
|
94
101
|
|
|
95
|
-
async initialize(env: Environment = Environment.Production) {
|
|
96
|
-
this.configuration.basePath = env;
|
|
97
|
-
|
|
98
|
-
await this.loadCredentials();
|
|
99
|
-
|
|
100
|
-
if (this.username) {
|
|
101
|
-
await this.authorize(this.username, this.password);
|
|
102
|
-
this.password = null; // to avoid keeping password loaded in memory.
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
private async loadCredentials() {
|
|
107
|
-
try {
|
|
108
|
-
await this.readConfigFile();
|
|
109
|
-
} catch (error) {
|
|
110
|
-
console.warn(`No credentials file found. Check that ${filePath} exists.`);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
this.readEnvVariables();
|
|
114
|
-
|
|
115
|
-
if (!this.username) {
|
|
116
|
-
console.info(`No credentials found in credentials file or environment variables. Either provide some or use
|
|
117
|
-
authorize() function.`);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
private async readConfigFile() {
|
|
122
|
-
const file = await fs.promises.readFile(filePath, 'utf-8');
|
|
123
|
-
|
|
124
|
-
const lines = file.split(os.EOL)
|
|
125
|
-
.filter(Boolean);
|
|
126
|
-
|
|
127
|
-
lines.forEach((line: string) => {
|
|
128
|
-
if (line.startsWith(KEY_USERNAME)) {
|
|
129
|
-
this.username = line.length > KEY_USERNAME.length + 1 ? line.substring(KEY_USERNAME.length + 1) : '';
|
|
130
|
-
} else if (line.startsWith(KEY_PASSWORD)) {
|
|
131
|
-
this.password = line.length > KEY_PASSWORD.length + 1 ? line.substring(KEY_PASSWORD.length + 1) : '';
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
private readEnvVariables(): boolean {
|
|
137
|
-
if (process.env.EMIL_USERNAME) {
|
|
138
|
-
this.username = process.env.EMIL_USERNAME;
|
|
139
|
-
this.password = process.env.EMIL_PASSWORD || '';
|
|
140
|
-
|
|
141
|
-
return true;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
return false;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
102
|
selectEnvironment(env: Environment) {
|
|
148
103
|
this.configuration.basePath = env;
|
|
149
104
|
}
|
|
@@ -163,18 +118,21 @@ export class BaseAPI {
|
|
|
163
118
|
const response = await globalAxios.request<LoginClass>(options);
|
|
164
119
|
|
|
165
120
|
const { data: { accessToken } } = response;
|
|
121
|
+
|
|
166
122
|
this.configuration.username = username;
|
|
167
123
|
this.configuration.accessToken = `Bearer ${accessToken}`;
|
|
124
|
+
this.tokenData.username = username;
|
|
125
|
+
this.tokenData.accessToken = accessToken;
|
|
168
126
|
|
|
169
|
-
|
|
170
|
-
|
|
127
|
+
this.storeTokenData({
|
|
128
|
+
...this.tokenData
|
|
129
|
+
});
|
|
171
130
|
}
|
|
172
131
|
|
|
173
132
|
async refreshTokenInternal(): Promise<string> {
|
|
174
|
-
const { username
|
|
175
|
-
|
|
133
|
+
const { username } = this.configuration;
|
|
176
134
|
|
|
177
|
-
if (!username
|
|
135
|
+
if (!username) {
|
|
178
136
|
return '';
|
|
179
137
|
}
|
|
180
138
|
|
|
@@ -183,7 +141,6 @@ export class BaseAPI {
|
|
|
183
141
|
url: `${this.configuration.basePath}/authservice/v1/refresh-token`,
|
|
184
142
|
headers: {
|
|
185
143
|
'Content-Type': 'application/json',
|
|
186
|
-
Cookie: refreshToken,
|
|
187
144
|
},
|
|
188
145
|
data: { username: username },
|
|
189
146
|
withCredentials: true,
|
|
@@ -194,18 +151,22 @@ export class BaseAPI {
|
|
|
194
151
|
return accessToken;
|
|
195
152
|
}
|
|
196
153
|
|
|
197
|
-
private
|
|
198
|
-
if (
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
return `${response.headers['set-cookie'][0].split(';')[0]};`;
|
|
154
|
+
private storeTokenData(tokenData?: TokenData) {
|
|
155
|
+
if (typeof window !== 'undefined') {
|
|
156
|
+
defaultStorage().set<TokenData>(TOKEN_DATA, tokenData);
|
|
202
157
|
}
|
|
158
|
+
}
|
|
203
159
|
|
|
204
|
-
|
|
160
|
+
public loadTokenData() {
|
|
161
|
+
if (typeof window !== 'undefined') {
|
|
162
|
+
this.tokenData = defaultStorage().get<TokenData>(TOKEN_DATA) || {};
|
|
163
|
+
} else {
|
|
164
|
+
this.tokenData = {};
|
|
165
|
+
}
|
|
205
166
|
}
|
|
206
167
|
|
|
207
|
-
|
|
208
|
-
|
|
168
|
+
public cleanTokenData() {
|
|
169
|
+
this.storeTokenData(null);
|
|
209
170
|
}
|
|
210
171
|
|
|
211
172
|
private attachInterceptor(axios: AxiosInstance) {
|
|
@@ -215,19 +176,25 @@ export class BaseAPI {
|
|
|
215
176
|
},
|
|
216
177
|
async (err) => {
|
|
217
178
|
let originalConfig = err.config;
|
|
218
|
-
if (err.response) {
|
|
179
|
+
if (err.response && !(err.response instanceof XMLHttpRequest)) { // sometimes buggy and is of type request
|
|
219
180
|
// Access Token was expired
|
|
220
|
-
if (err.response.status === 401
|
|
181
|
+
if ((err.response.status === 401 || err.response.status === 403)
|
|
182
|
+
&& !originalConfig._retry) {
|
|
221
183
|
originalConfig._retry = true;
|
|
222
184
|
try {
|
|
223
|
-
|
|
185
|
+
let tokenString = await this.refreshTokenInternal();
|
|
224
186
|
const accessToken = `Bearer ${tokenString}`;
|
|
225
187
|
|
|
226
|
-
originalConfig.headers['Authorization']
|
|
188
|
+
delete originalConfig.headers['Authorization']
|
|
189
|
+
|
|
190
|
+
originalConfig.headers['Authorization'] = accessToken;
|
|
227
191
|
|
|
228
192
|
this.configuration.accessToken = accessToken;
|
|
193
|
+
this.tokenData.accessToken = tokenString;
|
|
194
|
+
|
|
195
|
+
this.storeTokenData(this.tokenData);
|
|
229
196
|
|
|
230
|
-
return axios
|
|
197
|
+
return axios(originalConfig);
|
|
231
198
|
} catch (_error) {
|
|
232
199
|
if (_error.response && _error.response.data) {
|
|
233
200
|
return Promise.reject(_error.response.data);
|
|
@@ -235,23 +202,22 @@ export class BaseAPI {
|
|
|
235
202
|
return Promise.reject(_error);
|
|
236
203
|
}
|
|
237
204
|
}
|
|
238
|
-
|
|
239
|
-
return Promise.reject(err.response.data);
|
|
240
|
-
}
|
|
241
|
-
} else if(err.message === NETWORK_ERROR_MESSAGE
|
|
242
|
-
&& err.isAxiosError
|
|
205
|
+
} else if (err.message === NETWORK_ERROR_MESSAGE
|
|
243
206
|
&& originalConfig.headers.hasOwnProperty('Authorization')
|
|
244
207
|
&& _retry_count < 4
|
|
245
|
-
){
|
|
208
|
+
) {
|
|
246
209
|
_retry_count++;
|
|
247
210
|
try {
|
|
248
|
-
|
|
211
|
+
let tokenString = await this.refreshTokenInternal();
|
|
249
212
|
const accessToken = `Bearer ${tokenString}`;
|
|
250
213
|
|
|
251
214
|
_retry = true;
|
|
252
|
-
originalConfig.headers['Authorization'] = accessToken;
|
|
215
|
+
originalConfig.headers['Authorization'] = accessToken;
|
|
253
216
|
|
|
254
217
|
this.configuration.accessToken = accessToken;
|
|
218
|
+
this.tokenData.accessToken = tokenString;
|
|
219
|
+
|
|
220
|
+
this.storeTokenData(this.tokenData);
|
|
255
221
|
|
|
256
222
|
return axios.request({
|
|
257
223
|
...originalConfig,
|
|
@@ -261,7 +227,7 @@ export class BaseAPI {
|
|
|
261
227
|
return Promise.reject(_error.response.data);
|
|
262
228
|
}
|
|
263
229
|
return Promise.reject(_error);
|
|
264
|
-
}
|
|
230
|
+
}
|
|
265
231
|
}
|
|
266
232
|
return Promise.reject(err);
|
|
267
233
|
}
|
package/common.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* The EMIL DocumentService API description
|
|
6
6
|
*
|
|
7
7
|
* The version of the OpenAPI document: 1.0
|
|
8
|
-
*
|
|
8
|
+
* Contact: kontakt@emil.de
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
11
|
* https://openapi-generator.tech
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
import { Configuration } from "./configuration";
|
|
17
17
|
import { RequiredError, RequestArgs } from "./base";
|
|
18
18
|
import { AxiosInstance, AxiosResponse } from 'axios';
|
|
19
|
-
import { URL, URLSearchParams } from 'url';
|
|
20
19
|
/**
|
|
21
20
|
*
|
|
22
21
|
* @export
|
|
@@ -144,7 +143,7 @@ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxi
|
|
|
144
143
|
* The EMIL DocumentService API description
|
|
145
144
|
*
|
|
146
145
|
* The version of the OpenAPI document: 1.0
|
|
147
|
-
*
|
|
146
|
+
* Contact: kontakt@emil.de
|
|
148
147
|
*
|
|
149
148
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
150
149
|
* https://openapi-generator.tech
|
package/configuration.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* The EMIL DocumentService API description
|
|
6
6
|
*
|
|
7
7
|
* The version of the OpenAPI document: 1.0
|
|
8
|
-
*
|
|
8
|
+
* Contact: kontakt@emil.de
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
11
|
* https://openapi-generator.tech
|
|
@@ -74,14 +74,6 @@ export class Configuration {
|
|
|
74
74
|
*/
|
|
75
75
|
formDataCtor?: new () => any;
|
|
76
76
|
|
|
77
|
-
/**
|
|
78
|
-
* parameter for automatically refreshing access token for oauth2 security
|
|
79
|
-
*
|
|
80
|
-
* @type {string}
|
|
81
|
-
* @memberof Configuration
|
|
82
|
-
*/
|
|
83
|
-
refreshToken?: string;
|
|
84
|
-
|
|
85
77
|
constructor(param: ConfigurationParameters = {}) {
|
|
86
78
|
this.apiKey = param.apiKey;
|
|
87
79
|
this.username = param.username;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* The EMIL DocumentService API description
|
|
4
4
|
*
|
|
5
5
|
* The version of the OpenAPI document: 1.0
|
|
6
|
-
*
|
|
6
|
+
* Contact: kontakt@emil.de
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
9
|
* https://openapi-generator.tech
|
|
@@ -47,7 +47,7 @@ export declare const DocumentTemplatesApiAxiosParamCreator: (configuration?: Con
|
|
|
47
47
|
* @summary Retrieve the document template
|
|
48
48
|
* @param {number} id
|
|
49
49
|
* @param {string} [authorization] Bearer Token
|
|
50
|
-
* @param {string} [expand] Use this parameter to fetch additional information about the list items.
|
|
50
|
+
* @param {string} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
|
|
51
51
|
* @param {*} [options] Override http request option.
|
|
52
52
|
* @throws {RequiredError}
|
|
53
53
|
*/
|
|
@@ -57,14 +57,15 @@ export declare const DocumentTemplatesApiAxiosParamCreator: (configuration?: Con
|
|
|
57
57
|
* @summary List document templates
|
|
58
58
|
* @param {string} [authorization] Bearer Token
|
|
59
59
|
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
|
|
60
|
-
* @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list.
|
|
60
|
+
* @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
|
|
61
61
|
* @param {string} [filter] Filter response by productSlug, slug and name.
|
|
62
|
+
* @param {string} [search] Search document templates by name | slug
|
|
62
63
|
* @param {string} [order] Order response by createdAt.
|
|
63
64
|
* @param {string} [expand] Expand response by bodyTemplate.
|
|
64
65
|
* @param {*} [options] Override http request option.
|
|
65
66
|
* @throws {RequiredError}
|
|
66
67
|
*/
|
|
67
|
-
listDocTemplates: (authorization?: string, pageSize?: number, pageToken?: string, filter?: string, order?: string, expand?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
68
|
+
listDocTemplates: (authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
68
69
|
/**
|
|
69
70
|
* Updates the specified document template by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
|
70
71
|
* @summary Update the document template
|
|
@@ -104,7 +105,7 @@ export declare const DocumentTemplatesApiFp: (configuration?: Configuration) =>
|
|
|
104
105
|
* @summary Retrieve the document template
|
|
105
106
|
* @param {number} id
|
|
106
107
|
* @param {string} [authorization] Bearer Token
|
|
107
|
-
* @param {string} [expand] Use this parameter to fetch additional information about the list items.
|
|
108
|
+
* @param {string} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
|
|
108
109
|
* @param {*} [options] Override http request option.
|
|
109
110
|
* @throws {RequiredError}
|
|
110
111
|
*/
|
|
@@ -114,14 +115,15 @@ export declare const DocumentTemplatesApiFp: (configuration?: Configuration) =>
|
|
|
114
115
|
* @summary List document templates
|
|
115
116
|
* @param {string} [authorization] Bearer Token
|
|
116
117
|
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
|
|
117
|
-
* @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list.
|
|
118
|
+
* @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
|
|
118
119
|
* @param {string} [filter] Filter response by productSlug, slug and name.
|
|
120
|
+
* @param {string} [search] Search document templates by name | slug
|
|
119
121
|
* @param {string} [order] Order response by createdAt.
|
|
120
122
|
* @param {string} [expand] Expand response by bodyTemplate.
|
|
121
123
|
* @param {*} [options] Override http request option.
|
|
122
124
|
* @throws {RequiredError}
|
|
123
125
|
*/
|
|
124
|
-
listDocTemplates(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, order?: string, expand?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListDocTemplatesResponseClass>>;
|
|
126
|
+
listDocTemplates(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListDocTemplatesResponseClass>>;
|
|
125
127
|
/**
|
|
126
128
|
* Updates the specified document template by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
|
127
129
|
* @summary Update the document template
|
|
@@ -161,7 +163,7 @@ export declare const DocumentTemplatesApiFactory: (configuration?: Configuration
|
|
|
161
163
|
* @summary Retrieve the document template
|
|
162
164
|
* @param {number} id
|
|
163
165
|
* @param {string} [authorization] Bearer Token
|
|
164
|
-
* @param {string} [expand] Use this parameter to fetch additional information about the list items.
|
|
166
|
+
* @param {string} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
|
|
165
167
|
* @param {*} [options] Override http request option.
|
|
166
168
|
* @throws {RequiredError}
|
|
167
169
|
*/
|
|
@@ -171,14 +173,15 @@ export declare const DocumentTemplatesApiFactory: (configuration?: Configuration
|
|
|
171
173
|
* @summary List document templates
|
|
172
174
|
* @param {string} [authorization] Bearer Token
|
|
173
175
|
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
|
|
174
|
-
* @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list.
|
|
176
|
+
* @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
|
|
175
177
|
* @param {string} [filter] Filter response by productSlug, slug and name.
|
|
178
|
+
* @param {string} [search] Search document templates by name | slug
|
|
176
179
|
* @param {string} [order] Order response by createdAt.
|
|
177
180
|
* @param {string} [expand] Expand response by bodyTemplate.
|
|
178
181
|
* @param {*} [options] Override http request option.
|
|
179
182
|
* @throws {RequiredError}
|
|
180
183
|
*/
|
|
181
|
-
listDocTemplates(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, order?: string, expand?: string, options?: any): AxiosPromise<ListDocTemplatesResponseClass>;
|
|
184
|
+
listDocTemplates(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, options?: any): AxiosPromise<ListDocTemplatesResponseClass>;
|
|
182
185
|
/**
|
|
183
186
|
* Updates the specified document template by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
|
184
187
|
* @summary Update the document template
|
|
@@ -247,7 +250,7 @@ export interface DocumentTemplatesApiGetDocTemplateRequest {
|
|
|
247
250
|
*/
|
|
248
251
|
readonly authorization?: string;
|
|
249
252
|
/**
|
|
250
|
-
* Use this parameter to fetch additional information about the list items.
|
|
253
|
+
* Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
|
|
251
254
|
* @type {string}
|
|
252
255
|
* @memberof DocumentTemplatesApiGetDocTemplate
|
|
253
256
|
*/
|
|
@@ -272,7 +275,7 @@ export interface DocumentTemplatesApiListDocTemplatesRequest {
|
|
|
272
275
|
*/
|
|
273
276
|
readonly pageSize?: number;
|
|
274
277
|
/**
|
|
275
|
-
* A cursor for use in pagination. pageToken is an ID that defines your place in the list.
|
|
278
|
+
* A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
|
|
276
279
|
* @type {string}
|
|
277
280
|
* @memberof DocumentTemplatesApiListDocTemplates
|
|
278
281
|
*/
|
|
@@ -283,6 +286,12 @@ export interface DocumentTemplatesApiListDocTemplatesRequest {
|
|
|
283
286
|
* @memberof DocumentTemplatesApiListDocTemplates
|
|
284
287
|
*/
|
|
285
288
|
readonly filter?: string;
|
|
289
|
+
/**
|
|
290
|
+
* Search document templates by name | slug
|
|
291
|
+
* @type {string}
|
|
292
|
+
* @memberof DocumentTemplatesApiListDocTemplates
|
|
293
|
+
*/
|
|
294
|
+
readonly search?: string;
|
|
286
295
|
/**
|
|
287
296
|
* Order response by createdAt.
|
|
288
297
|
* @type {string}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* The EMIL DocumentService API description
|
|
7
7
|
*
|
|
8
8
|
* The version of the OpenAPI document: 1.0
|
|
9
|
-
*
|
|
9
|
+
* Contact: kontakt@emil.de
|
|
10
10
|
*
|
|
11
11
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
12
|
* https://openapi-generator.tech
|
|
@@ -85,10 +85,6 @@ var axios_1 = __importDefault(require("axios"));
|
|
|
85
85
|
var common_1 = require("../common");
|
|
86
86
|
// @ts-ignore
|
|
87
87
|
var base_1 = require("../base");
|
|
88
|
-
// URLSearchParams not necessarily used
|
|
89
|
-
// @ts-ignore
|
|
90
|
-
var url_1 = require("url");
|
|
91
|
-
var FormData = require('form-data');
|
|
92
88
|
/**
|
|
93
89
|
* DocumentTemplatesApi - axios parameter creator
|
|
94
90
|
* @export
|
|
@@ -114,7 +110,7 @@ var DocumentTemplatesApiAxiosParamCreator = function (configuration) {
|
|
|
114
110
|
// verify required parameter 'createDocTemplateRequestDto' is not null or undefined
|
|
115
111
|
(0, common_1.assertParamExists)('createDocTemplate', 'createDocTemplateRequestDto', createDocTemplateRequestDto);
|
|
116
112
|
localVarPath = "/documentservice/v1/doc-templates";
|
|
117
|
-
localVarUrlObj = new
|
|
113
|
+
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
118
114
|
if (configuration) {
|
|
119
115
|
baseOptions = configuration.baseOptions;
|
|
120
116
|
baseAccessToken = configuration.accessToken;
|
|
@@ -164,7 +160,7 @@ var DocumentTemplatesApiAxiosParamCreator = function (configuration) {
|
|
|
164
160
|
(0, common_1.assertParamExists)('deleteDocTemplate', 'id', id);
|
|
165
161
|
localVarPath = "/documentservice/v1/doc-templates/{id}"
|
|
166
162
|
.replace("{".concat("id", "}"), encodeURIComponent(String(id)));
|
|
167
|
-
localVarUrlObj = new
|
|
163
|
+
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
168
164
|
if (configuration) {
|
|
169
165
|
baseOptions = configuration.baseOptions;
|
|
170
166
|
baseAccessToken = configuration.accessToken;
|
|
@@ -198,7 +194,7 @@ var DocumentTemplatesApiAxiosParamCreator = function (configuration) {
|
|
|
198
194
|
* @summary Retrieve the document template
|
|
199
195
|
* @param {number} id
|
|
200
196
|
* @param {string} [authorization] Bearer Token
|
|
201
|
-
* @param {string} [expand] Use this parameter to fetch additional information about the list items.
|
|
197
|
+
* @param {string} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
|
|
202
198
|
* @param {*} [options] Override http request option.
|
|
203
199
|
* @throws {RequiredError}
|
|
204
200
|
*/
|
|
@@ -213,7 +209,7 @@ var DocumentTemplatesApiAxiosParamCreator = function (configuration) {
|
|
|
213
209
|
(0, common_1.assertParamExists)('getDocTemplate', 'id', id);
|
|
214
210
|
localVarPath = "/documentservice/v1/doc-templates/{id}"
|
|
215
211
|
.replace("{".concat("id", "}"), encodeURIComponent(String(id)));
|
|
216
|
-
localVarUrlObj = new
|
|
212
|
+
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
217
213
|
if (configuration) {
|
|
218
214
|
baseOptions = configuration.baseOptions;
|
|
219
215
|
baseAccessToken = configuration.accessToken;
|
|
@@ -250,14 +246,15 @@ var DocumentTemplatesApiAxiosParamCreator = function (configuration) {
|
|
|
250
246
|
* @summary List document templates
|
|
251
247
|
* @param {string} [authorization] Bearer Token
|
|
252
248
|
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
|
|
253
|
-
* @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list.
|
|
249
|
+
* @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
|
|
254
250
|
* @param {string} [filter] Filter response by productSlug, slug and name.
|
|
251
|
+
* @param {string} [search] Search document templates by name | slug
|
|
255
252
|
* @param {string} [order] Order response by createdAt.
|
|
256
253
|
* @param {string} [expand] Expand response by bodyTemplate.
|
|
257
254
|
* @param {*} [options] Override http request option.
|
|
258
255
|
* @throws {RequiredError}
|
|
259
256
|
*/
|
|
260
|
-
listDocTemplates: function (authorization, pageSize, pageToken, filter, order, expand, options) {
|
|
257
|
+
listDocTemplates: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
|
|
261
258
|
if (options === void 0) { options = {}; }
|
|
262
259
|
return __awaiter(_this, void 0, void 0, function () {
|
|
263
260
|
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
@@ -265,7 +262,7 @@ var DocumentTemplatesApiAxiosParamCreator = function (configuration) {
|
|
|
265
262
|
switch (_a.label) {
|
|
266
263
|
case 0:
|
|
267
264
|
localVarPath = "/documentservice/v1/doc-templates";
|
|
268
|
-
localVarUrlObj = new
|
|
265
|
+
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
269
266
|
if (configuration) {
|
|
270
267
|
baseOptions = configuration.baseOptions;
|
|
271
268
|
baseAccessToken = configuration.accessToken;
|
|
@@ -289,6 +286,9 @@ var DocumentTemplatesApiAxiosParamCreator = function (configuration) {
|
|
|
289
286
|
if (filter !== undefined) {
|
|
290
287
|
localVarQueryParameter['filter'] = filter;
|
|
291
288
|
}
|
|
289
|
+
if (search !== undefined) {
|
|
290
|
+
localVarQueryParameter['search'] = search;
|
|
291
|
+
}
|
|
292
292
|
if (order !== undefined) {
|
|
293
293
|
localVarQueryParameter['order'] = order;
|
|
294
294
|
}
|
|
@@ -331,7 +331,7 @@ var DocumentTemplatesApiAxiosParamCreator = function (configuration) {
|
|
|
331
331
|
(0, common_1.assertParamExists)('updateDocTemplate', 'updateDocTemplateRequestDto', updateDocTemplateRequestDto);
|
|
332
332
|
localVarPath = "/documentservice/v1/doc-templates/{id}"
|
|
333
333
|
.replace("{".concat("id", "}"), encodeURIComponent(String(id)));
|
|
334
|
-
localVarUrlObj = new
|
|
334
|
+
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
335
335
|
if (configuration) {
|
|
336
336
|
baseOptions = configuration.baseOptions;
|
|
337
337
|
baseAccessToken = configuration.accessToken;
|
|
@@ -419,7 +419,7 @@ var DocumentTemplatesApiFp = function (configuration) {
|
|
|
419
419
|
* @summary Retrieve the document template
|
|
420
420
|
* @param {number} id
|
|
421
421
|
* @param {string} [authorization] Bearer Token
|
|
422
|
-
* @param {string} [expand] Use this parameter to fetch additional information about the list items.
|
|
422
|
+
* @param {string} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
|
|
423
423
|
* @param {*} [options] Override http request option.
|
|
424
424
|
* @throws {RequiredError}
|
|
425
425
|
*/
|
|
@@ -441,19 +441,20 @@ var DocumentTemplatesApiFp = function (configuration) {
|
|
|
441
441
|
* @summary List document templates
|
|
442
442
|
* @param {string} [authorization] Bearer Token
|
|
443
443
|
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
|
|
444
|
-
* @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list.
|
|
444
|
+
* @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
|
|
445
445
|
* @param {string} [filter] Filter response by productSlug, slug and name.
|
|
446
|
+
* @param {string} [search] Search document templates by name | slug
|
|
446
447
|
* @param {string} [order] Order response by createdAt.
|
|
447
448
|
* @param {string} [expand] Expand response by bodyTemplate.
|
|
448
449
|
* @param {*} [options] Override http request option.
|
|
449
450
|
* @throws {RequiredError}
|
|
450
451
|
*/
|
|
451
|
-
listDocTemplates: function (authorization, pageSize, pageToken, filter, order, expand, options) {
|
|
452
|
+
listDocTemplates: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
|
|
452
453
|
return __awaiter(this, void 0, void 0, function () {
|
|
453
454
|
var localVarAxiosArgs;
|
|
454
455
|
return __generator(this, function (_a) {
|
|
455
456
|
switch (_a.label) {
|
|
456
|
-
case 0: return [4 /*yield*/, localVarAxiosParamCreator.listDocTemplates(authorization, pageSize, pageToken, filter, order, expand, options)];
|
|
457
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.listDocTemplates(authorization, pageSize, pageToken, filter, search, order, expand, options)];
|
|
457
458
|
case 1:
|
|
458
459
|
localVarAxiosArgs = _a.sent();
|
|
459
460
|
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
@@ -520,7 +521,7 @@ var DocumentTemplatesApiFactory = function (configuration, basePath, axios) {
|
|
|
520
521
|
* @summary Retrieve the document template
|
|
521
522
|
* @param {number} id
|
|
522
523
|
* @param {string} [authorization] Bearer Token
|
|
523
|
-
* @param {string} [expand] Use this parameter to fetch additional information about the list items.
|
|
524
|
+
* @param {string} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
|
|
524
525
|
* @param {*} [options] Override http request option.
|
|
525
526
|
* @throws {RequiredError}
|
|
526
527
|
*/
|
|
@@ -532,15 +533,16 @@ var DocumentTemplatesApiFactory = function (configuration, basePath, axios) {
|
|
|
532
533
|
* @summary List document templates
|
|
533
534
|
* @param {string} [authorization] Bearer Token
|
|
534
535
|
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
|
|
535
|
-
* @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list.
|
|
536
|
+
* @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
|
|
536
537
|
* @param {string} [filter] Filter response by productSlug, slug and name.
|
|
538
|
+
* @param {string} [search] Search document templates by name | slug
|
|
537
539
|
* @param {string} [order] Order response by createdAt.
|
|
538
540
|
* @param {string} [expand] Expand response by bodyTemplate.
|
|
539
541
|
* @param {*} [options] Override http request option.
|
|
540
542
|
* @throws {RequiredError}
|
|
541
543
|
*/
|
|
542
|
-
listDocTemplates: function (authorization, pageSize, pageToken, filter, order, expand, options) {
|
|
543
|
-
return localVarFp.listDocTemplates(authorization, pageSize, pageToken, filter, order, expand, options).then(function (request) { return request(axios, basePath); });
|
|
544
|
+
listDocTemplates: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
|
|
545
|
+
return localVarFp.listDocTemplates(authorization, pageSize, pageToken, filter, search, order, expand, options).then(function (request) { return request(axios, basePath); });
|
|
544
546
|
},
|
|
545
547
|
/**
|
|
546
548
|
* Updates the specified document template by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
|
@@ -615,7 +617,7 @@ var DocumentTemplatesApi = /** @class */ (function (_super) {
|
|
|
615
617
|
DocumentTemplatesApi.prototype.listDocTemplates = function (requestParameters, options) {
|
|
616
618
|
var _this = this;
|
|
617
619
|
if (requestParameters === void 0) { requestParameters = {}; }
|
|
618
|
-
return (0, exports.DocumentTemplatesApiFp)(this.configuration).listDocTemplates(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.order, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
620
|
+
return (0, exports.DocumentTemplatesApiFp)(this.configuration).listDocTemplates(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
619
621
|
};
|
|
620
622
|
/**
|
|
621
623
|
* Updates the specified document template by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|