zavadil-ts-common 1.2.65 → 1.2.66
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/dist/client/RestClient.d.ts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/client/RestClient.ts +14 -14
package/package.json
CHANGED
package/src/client/RestClient.ts
CHANGED
@@ -133,44 +133,44 @@ export class RestClient {
|
|
133
133
|
return this.getRequestOptions(url).then(o => this.processRequestJson(url, params, o));
|
134
134
|
}
|
135
135
|
|
136
|
-
postJson(url: string, data: object | null = null): Promise<any> {
|
137
|
-
return this.getRequestOptions(url, 'POST', data).then(o => this.processRequestJson(url,
|
136
|
+
postJson(url: string, data: object | null = null, params?: any): Promise<any> {
|
137
|
+
return this.getRequestOptions(url, 'POST', data).then(o => this.processRequestJson(url, params, o));
|
138
138
|
}
|
139
139
|
|
140
|
-
postForm(url: string, data: FormData): Promise<Response> {
|
140
|
+
postForm(url: string, data: FormData, params?: any): Promise<Response> {
|
141
141
|
return this.getRequestOptions(url, 'POST', data)
|
142
142
|
.then(o => {
|
143
143
|
o.headers.delete('Content-Type'); // content type with boundary value will be auto-generated
|
144
|
-
return this.processRequest(url,
|
144
|
+
return this.processRequest(url, params, o);
|
145
145
|
});
|
146
146
|
}
|
147
147
|
|
148
|
-
postFormJson(url: string, data: FormData): Promise<any> {
|
148
|
+
postFormJson(url: string, data: FormData, params?: any): Promise<any> {
|
149
149
|
return this.getRequestOptions(url, 'POST', data)
|
150
150
|
.then(o => {
|
151
151
|
o.headers.delete('Content-Type'); // content type with boundary value will be auto-generated
|
152
|
-
return this.processRequestJson(url,
|
152
|
+
return this.processRequestJson(url, params, o);
|
153
153
|
});
|
154
154
|
}
|
155
155
|
|
156
|
-
putJson(url: string, data: object | null = null): Promise<any> {
|
157
|
-
return this.getRequestOptions(url, 'PUT', data).then(o => this.processRequestJson(url,
|
156
|
+
putJson(url: string, data: object | null = null, params?: any): Promise<any> {
|
157
|
+
return this.getRequestOptions(url, 'PUT', data).then(o => this.processRequestJson(url, params, o));
|
158
158
|
}
|
159
159
|
|
160
160
|
get(endpoint: string, params?: any): Promise<Response> {
|
161
161
|
return this.getRequestOptions(endpoint).then(o => this.processRequest(endpoint, params, o));
|
162
162
|
}
|
163
163
|
|
164
|
-
del(url: string): Promise<Response> {
|
165
|
-
return this.getRequestOptions(url, 'DELETE').then(o => this.processRequest(url,
|
164
|
+
del(url: string, params?: any): Promise<Response> {
|
165
|
+
return this.getRequestOptions(url, 'DELETE').then(o => this.processRequest(url, params, o));
|
166
166
|
}
|
167
167
|
|
168
|
-
post(url: string, data: object | null = null): Promise<Response> {
|
169
|
-
return this.getRequestOptions(url, 'POST', data).then(o => this.processRequest(url,
|
168
|
+
post(url: string, data: object | null = null, params?: any): Promise<Response> {
|
169
|
+
return this.getRequestOptions(url, 'POST', data).then(o => this.processRequest(url, params, o));
|
170
170
|
}
|
171
171
|
|
172
|
-
put(url: string, data: object | null = null): Promise<Response> {
|
173
|
-
return this.getRequestOptions(url, 'PUT', data).then(o => this.processRequest(url,
|
172
|
+
put(url: string, data: object | null = null, params?: any): Promise<Response> {
|
173
|
+
return this.getRequestOptions(url, 'PUT', data).then(o => this.processRequest(url, params, o));
|
174
174
|
}
|
175
175
|
|
176
176
|
}
|