@aurigma/ng-storefront-api-client 2.2.736 → 2.2.836
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/aurigma-ng-storefront-api-client.metadata.json +1 -1
- package/bundles/aurigma-ng-storefront-api-client.umd.js +615 -3
- package/bundles/aurigma-ng-storefront-api-client.umd.js.map +1 -1
- package/bundles/aurigma-ng-storefront-api-client.umd.min.js +1 -1
- package/bundles/aurigma-ng-storefront-api-client.umd.min.js.map +1 -1
- package/esm2015/aurigma-ng-storefront-api-client.js +1 -1
- package/esm2015/lib/storefront-api-client.js +531 -1
- package/esm2015/lib/storefront.module.js +1 -1
- package/esm2015/public-api.js +1 -1
- package/fesm2015/aurigma-ng-storefront-api-client.js +531 -1
- package/fesm2015/aurigma-ng-storefront-api-client.js.map +1 -1
- package/lib/storefront-api-client.d.ts +169 -0
- package/package.json +1 -1
|
@@ -32,4 +32,4 @@ StorefrontModule.decorators = [
|
|
|
32
32
|
exports: []
|
|
33
33
|
},] }
|
|
34
34
|
];
|
|
35
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
35
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvcmVmcm9udC5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiL2hvbWUvYXVyaWdtYS9hZ2VudHMvMDMvX3dvcmsvMS9zL0JhY2tlbmQvc3JjL0JhY2tPZmZpY2UuV2ViLlB1YmxpY0FwaS5UeXBlU2NyaXB0QXBpQ2xpZW50L0FuZ3VsYXIvYXBpLWNsaWVudC9zdG9yZWZyb250LWNsaWVudC9wcm9qZWN0cy9jbGllbnQvc3JjLyIsInNvdXJjZXMiOlsibGliL3N0b3JlZnJvbnQubW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBc0IsUUFBUSxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBQzVELE9BQU8sS0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ICB1c2VWYWx1ZTogYXBpVXJsXG4gICAgICAgIH0sXG4gICAgICAgIHtcbiAgICAgICAgICBwcm92aWRlOiBTdG9yZWZyb250QXBpQ2xpZW50LkFwaUNsaWVudENvbmZpZ3VyYXRpb24sXG4gICAgICAgICAgdXNlRmFjdG9yeTogQ3JlYXRlQXBpQ2xpZW50Q29uZmlndXJhdGlvbi5iaW5kKHRoaXMsIHRva2VuICwgYXBpVXJsLCBhcGlLZXkpXG4gICAgICAgIH0sXG4gICAgICBdXG4gICAgfTtcbiAgfVxufVxuIl19
|
package/esm2015/public-api.js
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export * from './lib/storefront.module';
|
|
5
5
|
export * from './lib/storefront-api-client';
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIvaG9tZS9hdXJpZ21hL2FnZW50cy8wMy9fd29yay8xL3MvQmFja2VuZC9zcmMvQmFja09mZmljZS5XZWIuUHVibGljQXBpLlR5cGVTY3JpcHRBcGlDbGllbnQvQW5ndWxhci9hcGktY2xpZW50L3N0b3JlZnJvbnQtY2xpZW50L3Byb2plY3RzL2NsaWVudC9zcmMvIiwic291cmNlcyI6WyJwdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLDZCQUE2QixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLypcbiAqIFB1YmxpYyBBUEkgU3VyZmFjZSBvZiBjbGllbnRcbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2xpYi9zdG9yZWZyb250Lm1vZHVsZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9zdG9yZWZyb250LWFwaS1jbGllbnQnO1xuIl19
|
|
@@ -2137,6 +2137,465 @@ StorefrontsApiClient.ctorParameters = () => [
|
|
|
2137
2137
|
{ type: HttpClient, decorators: [{ type: Inject, args: [HttpClient,] }] },
|
|
2138
2138
|
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [API_BASE_URL,] }] }
|
|
2139
2139
|
];
|
|
2140
|
+
class StorefrontUsersApiClient extends ApiClientBase {
|
|
2141
|
+
constructor(configuration, http, baseUrl) {
|
|
2142
|
+
super(configuration);
|
|
2143
|
+
this.jsonParseReviver = undefined;
|
|
2144
|
+
this.http = http;
|
|
2145
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
2146
|
+
}
|
|
2147
|
+
/**
|
|
2148
|
+
* Gets all storefront users relevant to specified query parameters
|
|
2149
|
+
* @param storefrontId Storefront identifier
|
|
2150
|
+
* @param storefrontUserId (optional) Storefront user identifier
|
|
2151
|
+
* @param skip (optional) Defines page start offset from beginning of sorted result list
|
|
2152
|
+
* @param take (optional) Defines page length (how much consequent items of sorted result list should be taken)
|
|
2153
|
+
* @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC"
|
|
2154
|
+
* @param search (optional) Search string for partial match
|
|
2155
|
+
* @param tenantId (optional) Tenant identifier
|
|
2156
|
+
* @param userId (optional) User identifier
|
|
2157
|
+
* @return Success
|
|
2158
|
+
*/
|
|
2159
|
+
getAll(storefrontId, storefrontUserId, skip, take, sorting, search, tenantId, userId) {
|
|
2160
|
+
let url_ = this.baseUrl + "/api/storefront/v1/storefront-users?";
|
|
2161
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
2162
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
2163
|
+
else
|
|
2164
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
2165
|
+
if (storefrontUserId !== undefined && storefrontUserId !== null)
|
|
2166
|
+
url_ += "storefrontUserId=" + encodeURIComponent("" + storefrontUserId) + "&";
|
|
2167
|
+
if (skip !== undefined && skip !== null)
|
|
2168
|
+
url_ += "skip=" + encodeURIComponent("" + skip) + "&";
|
|
2169
|
+
if (take !== undefined && take !== null)
|
|
2170
|
+
url_ += "take=" + encodeURIComponent("" + take) + "&";
|
|
2171
|
+
if (sorting !== undefined && sorting !== null)
|
|
2172
|
+
url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
|
|
2173
|
+
if (search !== undefined && search !== null)
|
|
2174
|
+
url_ += "search=" + encodeURIComponent("" + search) + "&";
|
|
2175
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2176
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2177
|
+
if (userId !== undefined && userId !== null)
|
|
2178
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
2179
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2180
|
+
let options_ = {
|
|
2181
|
+
observe: "response",
|
|
2182
|
+
responseType: "blob",
|
|
2183
|
+
headers: new HttpHeaders({
|
|
2184
|
+
"Accept": "text/plain"
|
|
2185
|
+
})
|
|
2186
|
+
};
|
|
2187
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2188
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
2189
|
+
})).pipe(mergeMap((response_) => {
|
|
2190
|
+
return this.transformResult(url_, response_, (r) => this.processGetAll(r));
|
|
2191
|
+
})).pipe(catchError((response_) => {
|
|
2192
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2193
|
+
try {
|
|
2194
|
+
return this.transformResult(url_, response_, (r) => this.processGetAll(r));
|
|
2195
|
+
}
|
|
2196
|
+
catch (e) {
|
|
2197
|
+
return throwError(e);
|
|
2198
|
+
}
|
|
2199
|
+
}
|
|
2200
|
+
else
|
|
2201
|
+
return throwError(response_);
|
|
2202
|
+
}));
|
|
2203
|
+
}
|
|
2204
|
+
processGetAll(response) {
|
|
2205
|
+
const status = response.status;
|
|
2206
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2207
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2208
|
+
let _headers = {};
|
|
2209
|
+
if (response.headers) {
|
|
2210
|
+
for (let key of response.headers.keys()) {
|
|
2211
|
+
_headers[key] = response.headers.get(key);
|
|
2212
|
+
}
|
|
2213
|
+
}
|
|
2214
|
+
if (status === 200) {
|
|
2215
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2216
|
+
let result200 = null;
|
|
2217
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2218
|
+
return of(result200);
|
|
2219
|
+
}));
|
|
2220
|
+
}
|
|
2221
|
+
else if (status === 401) {
|
|
2222
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2223
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2224
|
+
}));
|
|
2225
|
+
}
|
|
2226
|
+
else if (status === 403) {
|
|
2227
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2228
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2229
|
+
}));
|
|
2230
|
+
}
|
|
2231
|
+
else if (status !== 200 && status !== 204) {
|
|
2232
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2233
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2234
|
+
}));
|
|
2235
|
+
}
|
|
2236
|
+
return of(null);
|
|
2237
|
+
}
|
|
2238
|
+
/**
|
|
2239
|
+
* Creates new storefront user
|
|
2240
|
+
* @param storefrontId Storefront identifier
|
|
2241
|
+
* @param tenantId (optional) Tenant identifier
|
|
2242
|
+
* @param userId (optional) User identifier
|
|
2243
|
+
* @param body (optional) Create operation parameters
|
|
2244
|
+
* @return Success
|
|
2245
|
+
*/
|
|
2246
|
+
create(storefrontId, tenantId, userId, body) {
|
|
2247
|
+
let url_ = this.baseUrl + "/api/storefront/v1/storefront-users?";
|
|
2248
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
2249
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
2250
|
+
else
|
|
2251
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
2252
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2253
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2254
|
+
if (userId !== undefined && userId !== null)
|
|
2255
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
2256
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2257
|
+
const content_ = JSON.stringify(body);
|
|
2258
|
+
let options_ = {
|
|
2259
|
+
body: content_,
|
|
2260
|
+
observe: "response",
|
|
2261
|
+
responseType: "blob",
|
|
2262
|
+
headers: new HttpHeaders({
|
|
2263
|
+
"Content-Type": "application/json-patch+json",
|
|
2264
|
+
"Accept": "text/plain"
|
|
2265
|
+
})
|
|
2266
|
+
};
|
|
2267
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2268
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
2269
|
+
})).pipe(mergeMap((response_) => {
|
|
2270
|
+
return this.transformResult(url_, response_, (r) => this.processCreate(r));
|
|
2271
|
+
})).pipe(catchError((response_) => {
|
|
2272
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2273
|
+
try {
|
|
2274
|
+
return this.transformResult(url_, response_, (r) => this.processCreate(r));
|
|
2275
|
+
}
|
|
2276
|
+
catch (e) {
|
|
2277
|
+
return throwError(e);
|
|
2278
|
+
}
|
|
2279
|
+
}
|
|
2280
|
+
else
|
|
2281
|
+
return throwError(response_);
|
|
2282
|
+
}));
|
|
2283
|
+
}
|
|
2284
|
+
processCreate(response) {
|
|
2285
|
+
const status = response.status;
|
|
2286
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2287
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2288
|
+
let _headers = {};
|
|
2289
|
+
if (response.headers) {
|
|
2290
|
+
for (let key of response.headers.keys()) {
|
|
2291
|
+
_headers[key] = response.headers.get(key);
|
|
2292
|
+
}
|
|
2293
|
+
}
|
|
2294
|
+
if (status === 201) {
|
|
2295
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2296
|
+
let result201 = null;
|
|
2297
|
+
result201 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2298
|
+
return of(result201);
|
|
2299
|
+
}));
|
|
2300
|
+
}
|
|
2301
|
+
else if (status === 401) {
|
|
2302
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2303
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2304
|
+
}));
|
|
2305
|
+
}
|
|
2306
|
+
else if (status === 403) {
|
|
2307
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2308
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2309
|
+
}));
|
|
2310
|
+
}
|
|
2311
|
+
else if (status !== 200 && status !== 204) {
|
|
2312
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2313
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2314
|
+
}));
|
|
2315
|
+
}
|
|
2316
|
+
return of(null);
|
|
2317
|
+
}
|
|
2318
|
+
/**
|
|
2319
|
+
* Gets storefront user by id
|
|
2320
|
+
* @param id Storefront user identifier
|
|
2321
|
+
* @param storefrontId Storefront identifier
|
|
2322
|
+
* @param tenantId (optional) Tenant identifier
|
|
2323
|
+
* @param userId (optional) User identifier
|
|
2324
|
+
* @return Success
|
|
2325
|
+
*/
|
|
2326
|
+
get(id, storefrontId, tenantId, userId) {
|
|
2327
|
+
let url_ = this.baseUrl + "/api/storefront/v1/storefront-users/{id}?";
|
|
2328
|
+
if (id === undefined || id === null)
|
|
2329
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2330
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2331
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
2332
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
2333
|
+
else
|
|
2334
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
2335
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2336
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2337
|
+
if (userId !== undefined && userId !== null)
|
|
2338
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
2339
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2340
|
+
let options_ = {
|
|
2341
|
+
observe: "response",
|
|
2342
|
+
responseType: "blob",
|
|
2343
|
+
headers: new HttpHeaders({
|
|
2344
|
+
"Accept": "text/plain"
|
|
2345
|
+
})
|
|
2346
|
+
};
|
|
2347
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2348
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
2349
|
+
})).pipe(mergeMap((response_) => {
|
|
2350
|
+
return this.transformResult(url_, response_, (r) => this.processGet(r));
|
|
2351
|
+
})).pipe(catchError((response_) => {
|
|
2352
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2353
|
+
try {
|
|
2354
|
+
return this.transformResult(url_, response_, (r) => this.processGet(r));
|
|
2355
|
+
}
|
|
2356
|
+
catch (e) {
|
|
2357
|
+
return throwError(e);
|
|
2358
|
+
}
|
|
2359
|
+
}
|
|
2360
|
+
else
|
|
2361
|
+
return throwError(response_);
|
|
2362
|
+
}));
|
|
2363
|
+
}
|
|
2364
|
+
processGet(response) {
|
|
2365
|
+
const status = response.status;
|
|
2366
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2367
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2368
|
+
let _headers = {};
|
|
2369
|
+
if (response.headers) {
|
|
2370
|
+
for (let key of response.headers.keys()) {
|
|
2371
|
+
_headers[key] = response.headers.get(key);
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
if (status === 200) {
|
|
2375
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2376
|
+
let result200 = null;
|
|
2377
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2378
|
+
return of(result200);
|
|
2379
|
+
}));
|
|
2380
|
+
}
|
|
2381
|
+
else if (status === 404) {
|
|
2382
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2383
|
+
let result404 = null;
|
|
2384
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2385
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2386
|
+
}));
|
|
2387
|
+
}
|
|
2388
|
+
else if (status === 401) {
|
|
2389
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2390
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2391
|
+
}));
|
|
2392
|
+
}
|
|
2393
|
+
else if (status === 403) {
|
|
2394
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2395
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2396
|
+
}));
|
|
2397
|
+
}
|
|
2398
|
+
else if (status !== 200 && status !== 204) {
|
|
2399
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2400
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2401
|
+
}));
|
|
2402
|
+
}
|
|
2403
|
+
return of(null);
|
|
2404
|
+
}
|
|
2405
|
+
/**
|
|
2406
|
+
* Merges anonymous storefront user data to regular storefront user account
|
|
2407
|
+
* @param storefrontId Storefront identifier
|
|
2408
|
+
* @param tenantId (optional) Tenant identifier
|
|
2409
|
+
* @param userId (optional) User identifier
|
|
2410
|
+
* @param body (optional) Merge operation parameters
|
|
2411
|
+
* @return Success
|
|
2412
|
+
*/
|
|
2413
|
+
mergeAnonymous(storefrontId, tenantId, userId, body) {
|
|
2414
|
+
let url_ = this.baseUrl + "/api/storefront/v1/storefront-users/merge-anonymous?";
|
|
2415
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
2416
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
2417
|
+
else
|
|
2418
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
2419
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2420
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2421
|
+
if (userId !== undefined && userId !== null)
|
|
2422
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
2423
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2424
|
+
const content_ = JSON.stringify(body);
|
|
2425
|
+
let options_ = {
|
|
2426
|
+
body: content_,
|
|
2427
|
+
observe: "response",
|
|
2428
|
+
responseType: "blob",
|
|
2429
|
+
headers: new HttpHeaders({
|
|
2430
|
+
"Content-Type": "application/json-patch+json",
|
|
2431
|
+
})
|
|
2432
|
+
};
|
|
2433
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2434
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
2435
|
+
})).pipe(mergeMap((response_) => {
|
|
2436
|
+
return this.transformResult(url_, response_, (r) => this.processMergeAnonymous(r));
|
|
2437
|
+
})).pipe(catchError((response_) => {
|
|
2438
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2439
|
+
try {
|
|
2440
|
+
return this.transformResult(url_, response_, (r) => this.processMergeAnonymous(r));
|
|
2441
|
+
}
|
|
2442
|
+
catch (e) {
|
|
2443
|
+
return throwError(e);
|
|
2444
|
+
}
|
|
2445
|
+
}
|
|
2446
|
+
else
|
|
2447
|
+
return throwError(response_);
|
|
2448
|
+
}));
|
|
2449
|
+
}
|
|
2450
|
+
processMergeAnonymous(response) {
|
|
2451
|
+
const status = response.status;
|
|
2452
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2453
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2454
|
+
let _headers = {};
|
|
2455
|
+
if (response.headers) {
|
|
2456
|
+
for (let key of response.headers.keys()) {
|
|
2457
|
+
_headers[key] = response.headers.get(key);
|
|
2458
|
+
}
|
|
2459
|
+
}
|
|
2460
|
+
if (status === 200) {
|
|
2461
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2462
|
+
return of(null);
|
|
2463
|
+
}));
|
|
2464
|
+
}
|
|
2465
|
+
else if (status === 404) {
|
|
2466
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2467
|
+
let result404 = null;
|
|
2468
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2469
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2470
|
+
}));
|
|
2471
|
+
}
|
|
2472
|
+
else if (status === 409) {
|
|
2473
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2474
|
+
let result409 = null;
|
|
2475
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2476
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2477
|
+
}));
|
|
2478
|
+
}
|
|
2479
|
+
else if (status === 401) {
|
|
2480
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2481
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2482
|
+
}));
|
|
2483
|
+
}
|
|
2484
|
+
else if (status === 403) {
|
|
2485
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2486
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2487
|
+
}));
|
|
2488
|
+
}
|
|
2489
|
+
else if (status !== 200 && status !== 204) {
|
|
2490
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2491
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2492
|
+
}));
|
|
2493
|
+
}
|
|
2494
|
+
return of(null);
|
|
2495
|
+
}
|
|
2496
|
+
/**
|
|
2497
|
+
* Gets storefront user token
|
|
2498
|
+
* @param storefrontUserId Storefront user identifier
|
|
2499
|
+
* @param storefrontId Storefront identifier
|
|
2500
|
+
* @param tenantId (optional) Tenant identifier
|
|
2501
|
+
* @param userId (optional) User identifier
|
|
2502
|
+
* @return Success
|
|
2503
|
+
*/
|
|
2504
|
+
getToken(storefrontUserId, storefrontId, tenantId, userId) {
|
|
2505
|
+
let url_ = this.baseUrl + "/api/storefront/v1/storefront-users/token?";
|
|
2506
|
+
if (storefrontUserId === undefined || storefrontUserId === null)
|
|
2507
|
+
throw new Error("The parameter 'storefrontUserId' must be defined and cannot be null.");
|
|
2508
|
+
else
|
|
2509
|
+
url_ += "storefrontUserId=" + encodeURIComponent("" + storefrontUserId) + "&";
|
|
2510
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
2511
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
2512
|
+
else
|
|
2513
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
2514
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2515
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2516
|
+
if (userId !== undefined && userId !== null)
|
|
2517
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
2518
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2519
|
+
let options_ = {
|
|
2520
|
+
observe: "response",
|
|
2521
|
+
responseType: "blob",
|
|
2522
|
+
headers: new HttpHeaders({})
|
|
2523
|
+
};
|
|
2524
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2525
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
2526
|
+
})).pipe(mergeMap((response_) => {
|
|
2527
|
+
return this.transformResult(url_, response_, (r) => this.processGetToken(r));
|
|
2528
|
+
})).pipe(catchError((response_) => {
|
|
2529
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2530
|
+
try {
|
|
2531
|
+
return this.transformResult(url_, response_, (r) => this.processGetToken(r));
|
|
2532
|
+
}
|
|
2533
|
+
catch (e) {
|
|
2534
|
+
return throwError(e);
|
|
2535
|
+
}
|
|
2536
|
+
}
|
|
2537
|
+
else
|
|
2538
|
+
return throwError(response_);
|
|
2539
|
+
}));
|
|
2540
|
+
}
|
|
2541
|
+
processGetToken(response) {
|
|
2542
|
+
const status = response.status;
|
|
2543
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2544
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2545
|
+
let _headers = {};
|
|
2546
|
+
if (response.headers) {
|
|
2547
|
+
for (let key of response.headers.keys()) {
|
|
2548
|
+
_headers[key] = response.headers.get(key);
|
|
2549
|
+
}
|
|
2550
|
+
}
|
|
2551
|
+
if (status === 201) {
|
|
2552
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2553
|
+
return of(null);
|
|
2554
|
+
}));
|
|
2555
|
+
}
|
|
2556
|
+
else if (status === 404) {
|
|
2557
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2558
|
+
let result404 = null;
|
|
2559
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2560
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2561
|
+
}));
|
|
2562
|
+
}
|
|
2563
|
+
else if (status === 409) {
|
|
2564
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2565
|
+
let result409 = null;
|
|
2566
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2567
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2568
|
+
}));
|
|
2569
|
+
}
|
|
2570
|
+
else if (status === 401) {
|
|
2571
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2572
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2573
|
+
}));
|
|
2574
|
+
}
|
|
2575
|
+
else if (status === 403) {
|
|
2576
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2577
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2578
|
+
}));
|
|
2579
|
+
}
|
|
2580
|
+
else if (status !== 200 && status !== 204) {
|
|
2581
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2582
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2583
|
+
}));
|
|
2584
|
+
}
|
|
2585
|
+
return of(null);
|
|
2586
|
+
}
|
|
2587
|
+
}
|
|
2588
|
+
StorefrontUsersApiClient.ɵprov = ɵɵdefineInjectable({ factory: function StorefrontUsersApiClient_Factory() { return new StorefrontUsersApiClient(ɵɵinject(ApiClientConfiguration), ɵɵinject(HttpClient), ɵɵinject(API_BASE_URL, 8)); }, token: StorefrontUsersApiClient, providedIn: "root" });
|
|
2589
|
+
StorefrontUsersApiClient.decorators = [
|
|
2590
|
+
{ type: Injectable, args: [{
|
|
2591
|
+
providedIn: 'root'
|
|
2592
|
+
},] }
|
|
2593
|
+
];
|
|
2594
|
+
StorefrontUsersApiClient.ctorParameters = () => [
|
|
2595
|
+
{ type: ApiClientConfiguration, decorators: [{ type: Inject, args: [ApiClientConfiguration,] }] },
|
|
2596
|
+
{ type: HttpClient, decorators: [{ type: Inject, args: [HttpClient,] }] },
|
|
2597
|
+
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [API_BASE_URL,] }] }
|
|
2598
|
+
];
|
|
2140
2599
|
class TenantInfoApiClient extends ApiClientBase {
|
|
2141
2600
|
constructor(configuration, http, baseUrl) {
|
|
2142
2601
|
super(configuration);
|
|
@@ -2215,6 +2674,77 @@ class TenantInfoApiClient extends ApiClientBase {
|
|
|
2215
2674
|
}
|
|
2216
2675
|
return of(null);
|
|
2217
2676
|
}
|
|
2677
|
+
/**
|
|
2678
|
+
* Gets information about tenant
|
|
2679
|
+
* @param tenantId (optional) Tenant identifier
|
|
2680
|
+
* @param userId (optional) User identifier
|
|
2681
|
+
* @return Success
|
|
2682
|
+
*/
|
|
2683
|
+
getInfo(tenantId, userId) {
|
|
2684
|
+
let url_ = this.baseUrl + "/api/storefront/v1/tenant-info?";
|
|
2685
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2686
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2687
|
+
if (userId !== undefined && userId !== null)
|
|
2688
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
2689
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2690
|
+
let options_ = {
|
|
2691
|
+
observe: "response",
|
|
2692
|
+
responseType: "blob",
|
|
2693
|
+
headers: new HttpHeaders({
|
|
2694
|
+
"Accept": "text/plain"
|
|
2695
|
+
})
|
|
2696
|
+
};
|
|
2697
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2698
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
2699
|
+
})).pipe(mergeMap((response_) => {
|
|
2700
|
+
return this.transformResult(url_, response_, (r) => this.processGetInfo(r));
|
|
2701
|
+
})).pipe(catchError((response_) => {
|
|
2702
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2703
|
+
try {
|
|
2704
|
+
return this.transformResult(url_, response_, (r) => this.processGetInfo(r));
|
|
2705
|
+
}
|
|
2706
|
+
catch (e) {
|
|
2707
|
+
return throwError(e);
|
|
2708
|
+
}
|
|
2709
|
+
}
|
|
2710
|
+
else
|
|
2711
|
+
return throwError(response_);
|
|
2712
|
+
}));
|
|
2713
|
+
}
|
|
2714
|
+
processGetInfo(response) {
|
|
2715
|
+
const status = response.status;
|
|
2716
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2717
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2718
|
+
let _headers = {};
|
|
2719
|
+
if (response.headers) {
|
|
2720
|
+
for (let key of response.headers.keys()) {
|
|
2721
|
+
_headers[key] = response.headers.get(key);
|
|
2722
|
+
}
|
|
2723
|
+
}
|
|
2724
|
+
if (status === 200) {
|
|
2725
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2726
|
+
let result200 = null;
|
|
2727
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2728
|
+
return of(result200);
|
|
2729
|
+
}));
|
|
2730
|
+
}
|
|
2731
|
+
else if (status === 401) {
|
|
2732
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2733
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2734
|
+
}));
|
|
2735
|
+
}
|
|
2736
|
+
else if (status === 403) {
|
|
2737
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2738
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2739
|
+
}));
|
|
2740
|
+
}
|
|
2741
|
+
else if (status !== 200 && status !== 204) {
|
|
2742
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2743
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2744
|
+
}));
|
|
2745
|
+
}
|
|
2746
|
+
return of(null);
|
|
2747
|
+
}
|
|
2218
2748
|
}
|
|
2219
2749
|
TenantInfoApiClient.ɵprov = ɵɵdefineInjectable({ factory: function TenantInfoApiClient_Factory() { return new TenantInfoApiClient(ɵɵinject(ApiClientConfiguration), ɵɵinject(HttpClient), ɵɵinject(API_BASE_URL, 8)); }, token: TenantInfoApiClient, providedIn: "root" });
|
|
2220
2750
|
TenantInfoApiClient.decorators = [
|
|
@@ -2321,5 +2851,5 @@ StorefrontModule.decorators = [
|
|
|
2321
2851
|
* Generated bundle index. Do not edit.
|
|
2322
2852
|
*/
|
|
2323
2853
|
|
|
2324
|
-
export { API_BASE_URL, ApiClientBase, ApiClientConfiguration, ApiException, BuildInfoApiClient, CreateApiClientConfiguration, DatePeriod, ProductReferencesApiClient, ProductSpecificationsApiClient, ProjectsApiClient, StorefrontModule, StorefrontType, StorefrontsApiClient, TenantInfoApiClient };
|
|
2854
|
+
export { API_BASE_URL, ApiClientBase, ApiClientConfiguration, ApiException, BuildInfoApiClient, CreateApiClientConfiguration, DatePeriod, ProductReferencesApiClient, ProductSpecificationsApiClient, ProjectsApiClient, StorefrontModule, StorefrontType, StorefrontUsersApiClient, StorefrontsApiClient, TenantInfoApiClient };
|
|
2325
2855
|
//# sourceMappingURL=aurigma-ng-storefront-api-client.js.map
|