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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zavadil-ts-common",
3
- "version": "1.2.65",
3
+ "version": "1.2.66",
4
4
  "description": "Common types and components for Typescript UI apps.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -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, null, o));
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, null, o);
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, null, o);
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, null, o));
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, null, o));
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, null, o));
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, null, o));
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
  }