@saritasa/renewaire-frontend-sdk 0.1.0-dev.101
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 +31 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/README.md +5 -0
- package/api/api.ts +7 -0
- package/api/auth-api.service.ts +299 -0
- package/api/auth-api.serviceInterface.ts +51 -0
- package/api/users-api.service.ts +387 -0
- package/api/users-api.serviceInterface.ts +66 -0
- package/api.base.service.ts +109 -0
- package/api.module.ts +42 -0
- package/configuration.ts +219 -0
- package/encoder.ts +20 -0
- package/git_push.sh +57 -0
- package/index.ts +7 -0
- package/model/email-confirmation-token-dto.dto.ts +23 -0
- package/model/int32-id-dto.dto.ts +16 -0
- package/model/login-user-command.dto.ts +27 -0
- package/model/models.ts +10 -0
- package/model/physical-address-dto.dto.ts +33 -0
- package/model/refresh-token-command.dto.ts +19 -0
- package/model/token-model.dto.ts +23 -0
- package/model/user-email-dto.dto.ts +19 -0
- package/model/user-preferences-dto.dto.ts +16 -0
- package/model/user-profile-dto.dto.ts +31 -0
- package/model/user-registration-dto.dto.ts +39 -0
- package/ng-package.json +6 -0
- package/package.json +38 -0
- package/param.ts +66 -0
- package/provide-api.ts +17 -0
- package/tsconfig.json +21 -0
- package/variables.ts +9 -0
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RenewAire CORES API
|
|
3
|
+
*
|
|
4
|
+
* Contact: renewaire@saritasa.com
|
|
5
|
+
*
|
|
6
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
7
|
+
* https://openapi-generator.tech
|
|
8
|
+
* Do not edit the class manually.
|
|
9
|
+
*/
|
|
10
|
+
/* tslint:disable:no-unused-variable member-ordering */
|
|
11
|
+
|
|
12
|
+
import { Inject, Injectable, Optional } from "@angular/core";
|
|
13
|
+
import {
|
|
14
|
+
HttpClient,
|
|
15
|
+
HttpHeaders,
|
|
16
|
+
HttpParams,
|
|
17
|
+
HttpResponse,
|
|
18
|
+
HttpEvent,
|
|
19
|
+
HttpParameterCodec,
|
|
20
|
+
HttpContext,
|
|
21
|
+
} from "@angular/common/http";
|
|
22
|
+
import { CustomHttpParameterCodec } from "../encoder";
|
|
23
|
+
import { Observable } from "rxjs";
|
|
24
|
+
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
import { EmailConfirmationTokenDtoDto } from "../model/email-confirmation-token-dto.dto";
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
import { Int32IdDtoDto } from "../model/int32-id-dto.dto";
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
import { UserEmailDtoDto } from "../model/user-email-dto.dto";
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
import { UserRegistrationDtoDto } from "../model/user-registration-dto.dto";
|
|
33
|
+
|
|
34
|
+
// @ts-ignore
|
|
35
|
+
import { BASE_PATH, COLLECTION_FORMATS } from "../variables";
|
|
36
|
+
import { Configuration } from "../configuration";
|
|
37
|
+
import { BaseService } from "../api.base.service";
|
|
38
|
+
import {
|
|
39
|
+
UsersApiServiceInterface,
|
|
40
|
+
UsersConfirmEmailRequestParams,
|
|
41
|
+
UsersRegisterUserRequestParams,
|
|
42
|
+
UsersRequestConfirmEmailRequestParams,
|
|
43
|
+
} from "./users-api.serviceInterface";
|
|
44
|
+
|
|
45
|
+
@Injectable({
|
|
46
|
+
providedIn: "root",
|
|
47
|
+
})
|
|
48
|
+
export class UsersApiService
|
|
49
|
+
extends BaseService
|
|
50
|
+
implements UsersApiServiceInterface
|
|
51
|
+
{
|
|
52
|
+
constructor(
|
|
53
|
+
protected httpClient: HttpClient,
|
|
54
|
+
@Optional() @Inject(BASE_PATH) basePath: string | string[],
|
|
55
|
+
@Optional() configuration?: Configuration,
|
|
56
|
+
) {
|
|
57
|
+
super(basePath, configuration);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Confirm email address using the verification code from email and continue registration.
|
|
62
|
+
* @param requestParameters
|
|
63
|
+
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
|
64
|
+
* @param reportProgress flag to report request and response progress.
|
|
65
|
+
*/
|
|
66
|
+
public usersConfirmEmail(
|
|
67
|
+
requestParameters?: UsersConfirmEmailRequestParams,
|
|
68
|
+
observe?: "body",
|
|
69
|
+
reportProgress?: boolean,
|
|
70
|
+
options?: {
|
|
71
|
+
httpHeaderAccept?: undefined;
|
|
72
|
+
context?: HttpContext;
|
|
73
|
+
transferCache?: boolean;
|
|
74
|
+
},
|
|
75
|
+
): Observable<any>;
|
|
76
|
+
public usersConfirmEmail(
|
|
77
|
+
requestParameters?: UsersConfirmEmailRequestParams,
|
|
78
|
+
observe?: "response",
|
|
79
|
+
reportProgress?: boolean,
|
|
80
|
+
options?: {
|
|
81
|
+
httpHeaderAccept?: undefined;
|
|
82
|
+
context?: HttpContext;
|
|
83
|
+
transferCache?: boolean;
|
|
84
|
+
},
|
|
85
|
+
): Observable<HttpResponse<any>>;
|
|
86
|
+
public usersConfirmEmail(
|
|
87
|
+
requestParameters?: UsersConfirmEmailRequestParams,
|
|
88
|
+
observe?: "events",
|
|
89
|
+
reportProgress?: boolean,
|
|
90
|
+
options?: {
|
|
91
|
+
httpHeaderAccept?: undefined;
|
|
92
|
+
context?: HttpContext;
|
|
93
|
+
transferCache?: boolean;
|
|
94
|
+
},
|
|
95
|
+
): Observable<HttpEvent<any>>;
|
|
96
|
+
public usersConfirmEmail(
|
|
97
|
+
requestParameters?: UsersConfirmEmailRequestParams,
|
|
98
|
+
observe: any = "body",
|
|
99
|
+
reportProgress: boolean = false,
|
|
100
|
+
options?: {
|
|
101
|
+
httpHeaderAccept?: undefined;
|
|
102
|
+
context?: HttpContext;
|
|
103
|
+
transferCache?: boolean;
|
|
104
|
+
},
|
|
105
|
+
): Observable<any> {
|
|
106
|
+
const emailConfirmationTokenDtoDto =
|
|
107
|
+
requestParameters?.emailConfirmationTokenDtoDto;
|
|
108
|
+
|
|
109
|
+
let localVarHeaders = this.defaultHeaders;
|
|
110
|
+
|
|
111
|
+
const localVarHttpHeaderAcceptSelected: string | undefined =
|
|
112
|
+
options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]);
|
|
113
|
+
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
114
|
+
localVarHeaders = localVarHeaders.set(
|
|
115
|
+
"Accept",
|
|
116
|
+
localVarHttpHeaderAcceptSelected,
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const localVarHttpContext: HttpContext =
|
|
121
|
+
options?.context ?? new HttpContext();
|
|
122
|
+
|
|
123
|
+
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
|
124
|
+
|
|
125
|
+
// to determine the Content-Type header
|
|
126
|
+
const consumes: string[] = [
|
|
127
|
+
"application/json",
|
|
128
|
+
"text/json",
|
|
129
|
+
"application/*+json",
|
|
130
|
+
];
|
|
131
|
+
const httpContentTypeSelected: string | undefined =
|
|
132
|
+
this.configuration.selectHeaderContentType(consumes);
|
|
133
|
+
if (httpContentTypeSelected !== undefined) {
|
|
134
|
+
localVarHeaders = localVarHeaders.set(
|
|
135
|
+
"Content-Type",
|
|
136
|
+
httpContentTypeSelected,
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
let responseType_: "text" | "json" | "blob" = "json";
|
|
141
|
+
if (localVarHttpHeaderAcceptSelected) {
|
|
142
|
+
if (localVarHttpHeaderAcceptSelected.startsWith("text")) {
|
|
143
|
+
responseType_ = "text";
|
|
144
|
+
} else if (
|
|
145
|
+
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
|
|
146
|
+
) {
|
|
147
|
+
responseType_ = "json";
|
|
148
|
+
} else {
|
|
149
|
+
responseType_ = "blob";
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
let localVarPath = `/api/users/confirm-email`;
|
|
154
|
+
const { basePath, withCredentials } = this.configuration;
|
|
155
|
+
return this.httpClient.request<any>("post", `${basePath}${localVarPath}`, {
|
|
156
|
+
context: localVarHttpContext,
|
|
157
|
+
body: emailConfirmationTokenDtoDto,
|
|
158
|
+
responseType: <any>responseType_,
|
|
159
|
+
...(withCredentials ? { withCredentials } : {}),
|
|
160
|
+
headers: localVarHeaders,
|
|
161
|
+
observe: observe,
|
|
162
|
+
transferCache: localVarTransferCache,
|
|
163
|
+
reportProgress: reportProgress,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Register user.
|
|
169
|
+
* @param requestParameters
|
|
170
|
+
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
|
171
|
+
* @param reportProgress flag to report request and response progress.
|
|
172
|
+
*/
|
|
173
|
+
public usersRegisterUser(
|
|
174
|
+
requestParameters?: UsersRegisterUserRequestParams,
|
|
175
|
+
observe?: "body",
|
|
176
|
+
reportProgress?: boolean,
|
|
177
|
+
options?: {
|
|
178
|
+
httpHeaderAccept?: "text/plain" | "application/json" | "text/json";
|
|
179
|
+
context?: HttpContext;
|
|
180
|
+
transferCache?: boolean;
|
|
181
|
+
},
|
|
182
|
+
): Observable<Int32IdDtoDto>;
|
|
183
|
+
public usersRegisterUser(
|
|
184
|
+
requestParameters?: UsersRegisterUserRequestParams,
|
|
185
|
+
observe?: "response",
|
|
186
|
+
reportProgress?: boolean,
|
|
187
|
+
options?: {
|
|
188
|
+
httpHeaderAccept?: "text/plain" | "application/json" | "text/json";
|
|
189
|
+
context?: HttpContext;
|
|
190
|
+
transferCache?: boolean;
|
|
191
|
+
},
|
|
192
|
+
): Observable<HttpResponse<Int32IdDtoDto>>;
|
|
193
|
+
public usersRegisterUser(
|
|
194
|
+
requestParameters?: UsersRegisterUserRequestParams,
|
|
195
|
+
observe?: "events",
|
|
196
|
+
reportProgress?: boolean,
|
|
197
|
+
options?: {
|
|
198
|
+
httpHeaderAccept?: "text/plain" | "application/json" | "text/json";
|
|
199
|
+
context?: HttpContext;
|
|
200
|
+
transferCache?: boolean;
|
|
201
|
+
},
|
|
202
|
+
): Observable<HttpEvent<Int32IdDtoDto>>;
|
|
203
|
+
public usersRegisterUser(
|
|
204
|
+
requestParameters?: UsersRegisterUserRequestParams,
|
|
205
|
+
observe: any = "body",
|
|
206
|
+
reportProgress: boolean = false,
|
|
207
|
+
options?: {
|
|
208
|
+
httpHeaderAccept?: "text/plain" | "application/json" | "text/json";
|
|
209
|
+
context?: HttpContext;
|
|
210
|
+
transferCache?: boolean;
|
|
211
|
+
},
|
|
212
|
+
): Observable<any> {
|
|
213
|
+
const userRegistrationDtoDto = requestParameters?.userRegistrationDtoDto;
|
|
214
|
+
|
|
215
|
+
let localVarHeaders = this.defaultHeaders;
|
|
216
|
+
|
|
217
|
+
const localVarHttpHeaderAcceptSelected: string | undefined =
|
|
218
|
+
options?.httpHeaderAccept ??
|
|
219
|
+
this.configuration.selectHeaderAccept([
|
|
220
|
+
"text/plain",
|
|
221
|
+
"application/json",
|
|
222
|
+
"text/json",
|
|
223
|
+
]);
|
|
224
|
+
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
225
|
+
localVarHeaders = localVarHeaders.set(
|
|
226
|
+
"Accept",
|
|
227
|
+
localVarHttpHeaderAcceptSelected,
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
const localVarHttpContext: HttpContext =
|
|
232
|
+
options?.context ?? new HttpContext();
|
|
233
|
+
|
|
234
|
+
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
|
235
|
+
|
|
236
|
+
// to determine the Content-Type header
|
|
237
|
+
const consumes: string[] = [
|
|
238
|
+
"application/json",
|
|
239
|
+
"text/json",
|
|
240
|
+
"application/*+json",
|
|
241
|
+
];
|
|
242
|
+
const httpContentTypeSelected: string | undefined =
|
|
243
|
+
this.configuration.selectHeaderContentType(consumes);
|
|
244
|
+
if (httpContentTypeSelected !== undefined) {
|
|
245
|
+
localVarHeaders = localVarHeaders.set(
|
|
246
|
+
"Content-Type",
|
|
247
|
+
httpContentTypeSelected,
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
let responseType_: "text" | "json" | "blob" = "json";
|
|
252
|
+
if (localVarHttpHeaderAcceptSelected) {
|
|
253
|
+
if (localVarHttpHeaderAcceptSelected.startsWith("text")) {
|
|
254
|
+
responseType_ = "text";
|
|
255
|
+
} else if (
|
|
256
|
+
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
|
|
257
|
+
) {
|
|
258
|
+
responseType_ = "json";
|
|
259
|
+
} else {
|
|
260
|
+
responseType_ = "blob";
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
let localVarPath = `/api/users`;
|
|
265
|
+
const { basePath, withCredentials } = this.configuration;
|
|
266
|
+
return this.httpClient.request<Int32IdDtoDto>(
|
|
267
|
+
"post",
|
|
268
|
+
`${basePath}${localVarPath}`,
|
|
269
|
+
{
|
|
270
|
+
context: localVarHttpContext,
|
|
271
|
+
body: userRegistrationDtoDto,
|
|
272
|
+
responseType: <any>responseType_,
|
|
273
|
+
...(withCredentials ? { withCredentials } : {}),
|
|
274
|
+
headers: localVarHeaders,
|
|
275
|
+
observe: observe,
|
|
276
|
+
transferCache: localVarTransferCache,
|
|
277
|
+
reportProgress: reportProgress,
|
|
278
|
+
},
|
|
279
|
+
);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Request email confirmation and begin registration. This endpoint sends verification email to a given address.
|
|
284
|
+
* @param requestParameters
|
|
285
|
+
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
|
286
|
+
* @param reportProgress flag to report request and response progress.
|
|
287
|
+
*/
|
|
288
|
+
public usersRequestConfirmEmail(
|
|
289
|
+
requestParameters?: UsersRequestConfirmEmailRequestParams,
|
|
290
|
+
observe?: "body",
|
|
291
|
+
reportProgress?: boolean,
|
|
292
|
+
options?: {
|
|
293
|
+
httpHeaderAccept?: undefined;
|
|
294
|
+
context?: HttpContext;
|
|
295
|
+
transferCache?: boolean;
|
|
296
|
+
},
|
|
297
|
+
): Observable<any>;
|
|
298
|
+
public usersRequestConfirmEmail(
|
|
299
|
+
requestParameters?: UsersRequestConfirmEmailRequestParams,
|
|
300
|
+
observe?: "response",
|
|
301
|
+
reportProgress?: boolean,
|
|
302
|
+
options?: {
|
|
303
|
+
httpHeaderAccept?: undefined;
|
|
304
|
+
context?: HttpContext;
|
|
305
|
+
transferCache?: boolean;
|
|
306
|
+
},
|
|
307
|
+
): Observable<HttpResponse<any>>;
|
|
308
|
+
public usersRequestConfirmEmail(
|
|
309
|
+
requestParameters?: UsersRequestConfirmEmailRequestParams,
|
|
310
|
+
observe?: "events",
|
|
311
|
+
reportProgress?: boolean,
|
|
312
|
+
options?: {
|
|
313
|
+
httpHeaderAccept?: undefined;
|
|
314
|
+
context?: HttpContext;
|
|
315
|
+
transferCache?: boolean;
|
|
316
|
+
},
|
|
317
|
+
): Observable<HttpEvent<any>>;
|
|
318
|
+
public usersRequestConfirmEmail(
|
|
319
|
+
requestParameters?: UsersRequestConfirmEmailRequestParams,
|
|
320
|
+
observe: any = "body",
|
|
321
|
+
reportProgress: boolean = false,
|
|
322
|
+
options?: {
|
|
323
|
+
httpHeaderAccept?: undefined;
|
|
324
|
+
context?: HttpContext;
|
|
325
|
+
transferCache?: boolean;
|
|
326
|
+
},
|
|
327
|
+
): Observable<any> {
|
|
328
|
+
const userEmailDtoDto = requestParameters?.userEmailDtoDto;
|
|
329
|
+
|
|
330
|
+
let localVarHeaders = this.defaultHeaders;
|
|
331
|
+
|
|
332
|
+
const localVarHttpHeaderAcceptSelected: string | undefined =
|
|
333
|
+
options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]);
|
|
334
|
+
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
335
|
+
localVarHeaders = localVarHeaders.set(
|
|
336
|
+
"Accept",
|
|
337
|
+
localVarHttpHeaderAcceptSelected,
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
const localVarHttpContext: HttpContext =
|
|
342
|
+
options?.context ?? new HttpContext();
|
|
343
|
+
|
|
344
|
+
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
|
345
|
+
|
|
346
|
+
// to determine the Content-Type header
|
|
347
|
+
const consumes: string[] = [
|
|
348
|
+
"application/json",
|
|
349
|
+
"text/json",
|
|
350
|
+
"application/*+json",
|
|
351
|
+
];
|
|
352
|
+
const httpContentTypeSelected: string | undefined =
|
|
353
|
+
this.configuration.selectHeaderContentType(consumes);
|
|
354
|
+
if (httpContentTypeSelected !== undefined) {
|
|
355
|
+
localVarHeaders = localVarHeaders.set(
|
|
356
|
+
"Content-Type",
|
|
357
|
+
httpContentTypeSelected,
|
|
358
|
+
);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
let responseType_: "text" | "json" | "blob" = "json";
|
|
362
|
+
if (localVarHttpHeaderAcceptSelected) {
|
|
363
|
+
if (localVarHttpHeaderAcceptSelected.startsWith("text")) {
|
|
364
|
+
responseType_ = "text";
|
|
365
|
+
} else if (
|
|
366
|
+
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
|
|
367
|
+
) {
|
|
368
|
+
responseType_ = "json";
|
|
369
|
+
} else {
|
|
370
|
+
responseType_ = "blob";
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
let localVarPath = `/api/users/request-email`;
|
|
375
|
+
const { basePath, withCredentials } = this.configuration;
|
|
376
|
+
return this.httpClient.request<any>("put", `${basePath}${localVarPath}`, {
|
|
377
|
+
context: localVarHttpContext,
|
|
378
|
+
body: userEmailDtoDto,
|
|
379
|
+
responseType: <any>responseType_,
|
|
380
|
+
...(withCredentials ? { withCredentials } : {}),
|
|
381
|
+
headers: localVarHeaders,
|
|
382
|
+
observe: observe,
|
|
383
|
+
transferCache: localVarTransferCache,
|
|
384
|
+
reportProgress: reportProgress,
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RenewAire CORES API
|
|
3
|
+
*
|
|
4
|
+
* Contact: renewaire@saritasa.com
|
|
5
|
+
*
|
|
6
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
7
|
+
* https://openapi-generator.tech
|
|
8
|
+
* Do not edit the class manually.
|
|
9
|
+
*/
|
|
10
|
+
import { HttpHeaders } from "@angular/common/http";
|
|
11
|
+
|
|
12
|
+
import { Observable } from "rxjs";
|
|
13
|
+
|
|
14
|
+
import { EmailConfirmationTokenDtoDto } from "../model/models";
|
|
15
|
+
import { Int32IdDtoDto } from "../model/models";
|
|
16
|
+
import { UserEmailDtoDto } from "../model/models";
|
|
17
|
+
import { UserRegistrationDtoDto } from "../model/models";
|
|
18
|
+
|
|
19
|
+
import { Configuration } from "../configuration";
|
|
20
|
+
|
|
21
|
+
export interface UsersConfirmEmailRequestParams {
|
|
22
|
+
emailConfirmationTokenDtoDto?: EmailConfirmationTokenDtoDto;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface UsersRegisterUserRequestParams {
|
|
26
|
+
userRegistrationDtoDto?: UserRegistrationDtoDto;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface UsersRequestConfirmEmailRequestParams {
|
|
30
|
+
userEmailDtoDto?: UserEmailDtoDto;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface UsersApiServiceInterface {
|
|
34
|
+
defaultHeaders: HttpHeaders;
|
|
35
|
+
configuration: Configuration;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Confirm email address using the verification code from email and continue registration.
|
|
39
|
+
*
|
|
40
|
+
* @param requestParameters
|
|
41
|
+
*/
|
|
42
|
+
usersConfirmEmail(
|
|
43
|
+
requestParameters: UsersConfirmEmailRequestParams,
|
|
44
|
+
extraHttpRequestParams?: any,
|
|
45
|
+
): Observable<{}>;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Register user.
|
|
49
|
+
*
|
|
50
|
+
* @param requestParameters
|
|
51
|
+
*/
|
|
52
|
+
usersRegisterUser(
|
|
53
|
+
requestParameters: UsersRegisterUserRequestParams,
|
|
54
|
+
extraHttpRequestParams?: any,
|
|
55
|
+
): Observable<Int32IdDtoDto>;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Request email confirmation and begin registration. This endpoint sends verification email to a given address.
|
|
59
|
+
*
|
|
60
|
+
* @param requestParameters
|
|
61
|
+
*/
|
|
62
|
+
usersRequestConfirmEmail(
|
|
63
|
+
requestParameters: UsersRequestConfirmEmailRequestParams,
|
|
64
|
+
extraHttpRequestParams?: any,
|
|
65
|
+
): Observable<{}>;
|
|
66
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RenewAire CORES API
|
|
3
|
+
*
|
|
4
|
+
* Contact: renewaire@saritasa.com
|
|
5
|
+
*
|
|
6
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
7
|
+
* https://openapi-generator.tech
|
|
8
|
+
* Do not edit the class manually.
|
|
9
|
+
*/
|
|
10
|
+
import {
|
|
11
|
+
HttpHeaders,
|
|
12
|
+
HttpParams,
|
|
13
|
+
HttpParameterCodec,
|
|
14
|
+
} from "@angular/common/http";
|
|
15
|
+
import { CustomHttpParameterCodec } from "./encoder";
|
|
16
|
+
import { Configuration } from "./configuration";
|
|
17
|
+
|
|
18
|
+
export class BaseService {
|
|
19
|
+
protected basePath = "http://localhost";
|
|
20
|
+
public defaultHeaders = new HttpHeaders();
|
|
21
|
+
public configuration: Configuration;
|
|
22
|
+
public encoder: HttpParameterCodec;
|
|
23
|
+
|
|
24
|
+
constructor(basePath?: string | string[], configuration?: Configuration) {
|
|
25
|
+
this.configuration = configuration || new Configuration();
|
|
26
|
+
if (typeof this.configuration.basePath !== "string") {
|
|
27
|
+
const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined;
|
|
28
|
+
if (firstBasePath != undefined) {
|
|
29
|
+
basePath = firstBasePath;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (typeof basePath !== "string") {
|
|
33
|
+
basePath = this.basePath;
|
|
34
|
+
}
|
|
35
|
+
this.configuration.basePath = basePath;
|
|
36
|
+
}
|
|
37
|
+
this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
protected canConsumeForm(consumes: string[]): boolean {
|
|
41
|
+
return consumes.indexOf("multipart/form-data") !== -1;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
protected addToHttpParams(
|
|
45
|
+
httpParams: HttpParams,
|
|
46
|
+
value: any,
|
|
47
|
+
key?: string,
|
|
48
|
+
isDeep: boolean = false,
|
|
49
|
+
): HttpParams {
|
|
50
|
+
// If the value is an object (but not a Date), recursively add its keys.
|
|
51
|
+
if (typeof value === "object" && !(value instanceof Date)) {
|
|
52
|
+
return this.addToHttpParamsRecursive(
|
|
53
|
+
httpParams,
|
|
54
|
+
value,
|
|
55
|
+
isDeep ? key : undefined,
|
|
56
|
+
isDeep,
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
return this.addToHttpParamsRecursive(httpParams, value, key);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
protected addToHttpParamsRecursive(
|
|
63
|
+
httpParams: HttpParams,
|
|
64
|
+
value?: any,
|
|
65
|
+
key?: string,
|
|
66
|
+
isDeep: boolean = false,
|
|
67
|
+
): HttpParams {
|
|
68
|
+
if (value === null || value === undefined) {
|
|
69
|
+
return httpParams;
|
|
70
|
+
}
|
|
71
|
+
if (typeof value === "object") {
|
|
72
|
+
// If JSON format is preferred, key must be provided.
|
|
73
|
+
if (key != null) {
|
|
74
|
+
return isDeep
|
|
75
|
+
? Object.keys(value as Record<string, any>).reduce(
|
|
76
|
+
(hp, k) => hp.append(`${key}[${k}]`, value[k]),
|
|
77
|
+
httpParams,
|
|
78
|
+
)
|
|
79
|
+
: httpParams.append(key, JSON.stringify(value));
|
|
80
|
+
}
|
|
81
|
+
// Otherwise, if it's an array, add each element.
|
|
82
|
+
if (Array.isArray(value)) {
|
|
83
|
+
value.forEach(
|
|
84
|
+
(elem) =>
|
|
85
|
+
(httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)),
|
|
86
|
+
);
|
|
87
|
+
} else if (value instanceof Date) {
|
|
88
|
+
if (key != null) {
|
|
89
|
+
httpParams = httpParams.append(key, value.toISOString());
|
|
90
|
+
} else {
|
|
91
|
+
throw Error("key may not be null if value is Date");
|
|
92
|
+
}
|
|
93
|
+
} else {
|
|
94
|
+
Object.keys(value).forEach((k) => {
|
|
95
|
+
const paramKey = key ? `${key}.${k}` : k;
|
|
96
|
+
httpParams = this.addToHttpParamsRecursive(
|
|
97
|
+
httpParams,
|
|
98
|
+
value[k],
|
|
99
|
+
paramKey,
|
|
100
|
+
);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
return httpParams;
|
|
104
|
+
} else if (key != null) {
|
|
105
|
+
return httpParams.append(key, value);
|
|
106
|
+
}
|
|
107
|
+
throw Error("key may not be null if value is not object or array");
|
|
108
|
+
}
|
|
109
|
+
}
|
package/api.module.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NgModule,
|
|
3
|
+
ModuleWithProviders,
|
|
4
|
+
SkipSelf,
|
|
5
|
+
Optional,
|
|
6
|
+
} from "@angular/core";
|
|
7
|
+
import { Configuration } from "./configuration";
|
|
8
|
+
import { HttpClient } from "@angular/common/http";
|
|
9
|
+
|
|
10
|
+
@NgModule({
|
|
11
|
+
imports: [],
|
|
12
|
+
declarations: [],
|
|
13
|
+
exports: [],
|
|
14
|
+
providers: [],
|
|
15
|
+
})
|
|
16
|
+
export class ApiModule {
|
|
17
|
+
public static forRoot(
|
|
18
|
+
configurationFactory: () => Configuration,
|
|
19
|
+
): ModuleWithProviders<ApiModule> {
|
|
20
|
+
return {
|
|
21
|
+
ngModule: ApiModule,
|
|
22
|
+
providers: [{ provide: Configuration, useFactory: configurationFactory }],
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
constructor(
|
|
27
|
+
@Optional() @SkipSelf() parentModule: ApiModule,
|
|
28
|
+
@Optional() http: HttpClient,
|
|
29
|
+
) {
|
|
30
|
+
if (parentModule) {
|
|
31
|
+
throw new Error(
|
|
32
|
+
"ApiModule is already loaded. Import in your base AppModule only.",
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
if (!http) {
|
|
36
|
+
throw new Error(
|
|
37
|
+
"You need to import the HttpClientModule in your AppModule! \n" +
|
|
38
|
+
"See also https://github.com/angular/angular/issues/20575",
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|