@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
|
@@ -2786,6 +2786,533 @@
|
|
|
2786
2786
|
{ type: i1.HttpClient, decorators: [{ type: i0.Inject, args: [i1.HttpClient,] }] },
|
|
2787
2787
|
{ type: String, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [API_BASE_URL,] }] }
|
|
2788
2788
|
]; };
|
|
2789
|
+
var StorefrontUsersApiClient = /** @class */ (function (_super) {
|
|
2790
|
+
__extends(StorefrontUsersApiClient, _super);
|
|
2791
|
+
function StorefrontUsersApiClient(configuration, http, baseUrl) {
|
|
2792
|
+
var _this = _super.call(this, configuration) || this;
|
|
2793
|
+
_this.jsonParseReviver = undefined;
|
|
2794
|
+
_this.http = http;
|
|
2795
|
+
_this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : _this.getBaseUrl("");
|
|
2796
|
+
return _this;
|
|
2797
|
+
}
|
|
2798
|
+
/**
|
|
2799
|
+
* Gets all storefront users relevant to specified query parameters
|
|
2800
|
+
* @param storefrontId Storefront identifier
|
|
2801
|
+
* @param storefrontUserId (optional) Storefront user identifier
|
|
2802
|
+
* @param skip (optional) Defines page start offset from beginning of sorted result list
|
|
2803
|
+
* @param take (optional) Defines page length (how much consequent items of sorted result list should be taken)
|
|
2804
|
+
* @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC"
|
|
2805
|
+
* @param search (optional) Search string for partial match
|
|
2806
|
+
* @param tenantId (optional) Tenant identifier
|
|
2807
|
+
* @param userId (optional) User identifier
|
|
2808
|
+
* @return Success
|
|
2809
|
+
*/
|
|
2810
|
+
StorefrontUsersApiClient.prototype.getAll = function (storefrontId, storefrontUserId, skip, take, sorting, search, tenantId, userId) {
|
|
2811
|
+
var _this = this;
|
|
2812
|
+
var url_ = this.baseUrl + "/api/storefront/v1/storefront-users?";
|
|
2813
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
2814
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
2815
|
+
else
|
|
2816
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
2817
|
+
if (storefrontUserId !== undefined && storefrontUserId !== null)
|
|
2818
|
+
url_ += "storefrontUserId=" + encodeURIComponent("" + storefrontUserId) + "&";
|
|
2819
|
+
if (skip !== undefined && skip !== null)
|
|
2820
|
+
url_ += "skip=" + encodeURIComponent("" + skip) + "&";
|
|
2821
|
+
if (take !== undefined && take !== null)
|
|
2822
|
+
url_ += "take=" + encodeURIComponent("" + take) + "&";
|
|
2823
|
+
if (sorting !== undefined && sorting !== null)
|
|
2824
|
+
url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
|
|
2825
|
+
if (search !== undefined && search !== null)
|
|
2826
|
+
url_ += "search=" + encodeURIComponent("" + search) + "&";
|
|
2827
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2828
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2829
|
+
if (userId !== undefined && userId !== null)
|
|
2830
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
2831
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2832
|
+
var options_ = {
|
|
2833
|
+
observe: "response",
|
|
2834
|
+
responseType: "blob",
|
|
2835
|
+
headers: new i1.HttpHeaders({
|
|
2836
|
+
"Accept": "text/plain"
|
|
2837
|
+
})
|
|
2838
|
+
};
|
|
2839
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
2840
|
+
return _this.http.request("get", url_, transformedOptions_);
|
|
2841
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
2842
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetAll(r); });
|
|
2843
|
+
})).pipe(operators.catchError(function (response_) {
|
|
2844
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
2845
|
+
try {
|
|
2846
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetAll(r); });
|
|
2847
|
+
}
|
|
2848
|
+
catch (e) {
|
|
2849
|
+
return rxjs.throwError(e);
|
|
2850
|
+
}
|
|
2851
|
+
}
|
|
2852
|
+
else
|
|
2853
|
+
return rxjs.throwError(response_);
|
|
2854
|
+
}));
|
|
2855
|
+
};
|
|
2856
|
+
StorefrontUsersApiClient.prototype.processGetAll = function (response) {
|
|
2857
|
+
var e_25, _a;
|
|
2858
|
+
var _this = this;
|
|
2859
|
+
var status = response.status;
|
|
2860
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
2861
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2862
|
+
var _headers = {};
|
|
2863
|
+
if (response.headers) {
|
|
2864
|
+
try {
|
|
2865
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
2866
|
+
var key = _c.value;
|
|
2867
|
+
_headers[key] = response.headers.get(key);
|
|
2868
|
+
}
|
|
2869
|
+
}
|
|
2870
|
+
catch (e_25_1) { e_25 = { error: e_25_1 }; }
|
|
2871
|
+
finally {
|
|
2872
|
+
try {
|
|
2873
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2874
|
+
}
|
|
2875
|
+
finally { if (e_25) throw e_25.error; }
|
|
2876
|
+
}
|
|
2877
|
+
}
|
|
2878
|
+
if (status === 200) {
|
|
2879
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2880
|
+
var result200 = null;
|
|
2881
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
2882
|
+
return rxjs.of(result200);
|
|
2883
|
+
}));
|
|
2884
|
+
}
|
|
2885
|
+
else if (status === 401) {
|
|
2886
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2887
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2888
|
+
}));
|
|
2889
|
+
}
|
|
2890
|
+
else if (status === 403) {
|
|
2891
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2892
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2893
|
+
}));
|
|
2894
|
+
}
|
|
2895
|
+
else if (status !== 200 && status !== 204) {
|
|
2896
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2897
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2898
|
+
}));
|
|
2899
|
+
}
|
|
2900
|
+
return rxjs.of(null);
|
|
2901
|
+
};
|
|
2902
|
+
/**
|
|
2903
|
+
* Creates new storefront user
|
|
2904
|
+
* @param storefrontId Storefront identifier
|
|
2905
|
+
* @param tenantId (optional) Tenant identifier
|
|
2906
|
+
* @param userId (optional) User identifier
|
|
2907
|
+
* @param body (optional) Create operation parameters
|
|
2908
|
+
* @return Success
|
|
2909
|
+
*/
|
|
2910
|
+
StorefrontUsersApiClient.prototype.create = function (storefrontId, tenantId, userId, body) {
|
|
2911
|
+
var _this = this;
|
|
2912
|
+
var url_ = this.baseUrl + "/api/storefront/v1/storefront-users?";
|
|
2913
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
2914
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
2915
|
+
else
|
|
2916
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
2917
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2918
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2919
|
+
if (userId !== undefined && userId !== null)
|
|
2920
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
2921
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2922
|
+
var content_ = JSON.stringify(body);
|
|
2923
|
+
var options_ = {
|
|
2924
|
+
body: content_,
|
|
2925
|
+
observe: "response",
|
|
2926
|
+
responseType: "blob",
|
|
2927
|
+
headers: new i1.HttpHeaders({
|
|
2928
|
+
"Content-Type": "application/json-patch+json",
|
|
2929
|
+
"Accept": "text/plain"
|
|
2930
|
+
})
|
|
2931
|
+
};
|
|
2932
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
2933
|
+
return _this.http.request("post", url_, transformedOptions_);
|
|
2934
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
2935
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processCreate(r); });
|
|
2936
|
+
})).pipe(operators.catchError(function (response_) {
|
|
2937
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
2938
|
+
try {
|
|
2939
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processCreate(r); });
|
|
2940
|
+
}
|
|
2941
|
+
catch (e) {
|
|
2942
|
+
return rxjs.throwError(e);
|
|
2943
|
+
}
|
|
2944
|
+
}
|
|
2945
|
+
else
|
|
2946
|
+
return rxjs.throwError(response_);
|
|
2947
|
+
}));
|
|
2948
|
+
};
|
|
2949
|
+
StorefrontUsersApiClient.prototype.processCreate = function (response) {
|
|
2950
|
+
var e_26, _a;
|
|
2951
|
+
var _this = this;
|
|
2952
|
+
var status = response.status;
|
|
2953
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
2954
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2955
|
+
var _headers = {};
|
|
2956
|
+
if (response.headers) {
|
|
2957
|
+
try {
|
|
2958
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
2959
|
+
var key = _c.value;
|
|
2960
|
+
_headers[key] = response.headers.get(key);
|
|
2961
|
+
}
|
|
2962
|
+
}
|
|
2963
|
+
catch (e_26_1) { e_26 = { error: e_26_1 }; }
|
|
2964
|
+
finally {
|
|
2965
|
+
try {
|
|
2966
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2967
|
+
}
|
|
2968
|
+
finally { if (e_26) throw e_26.error; }
|
|
2969
|
+
}
|
|
2970
|
+
}
|
|
2971
|
+
if (status === 201) {
|
|
2972
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2973
|
+
var result201 = null;
|
|
2974
|
+
result201 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
2975
|
+
return rxjs.of(result201);
|
|
2976
|
+
}));
|
|
2977
|
+
}
|
|
2978
|
+
else if (status === 401) {
|
|
2979
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2980
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2981
|
+
}));
|
|
2982
|
+
}
|
|
2983
|
+
else if (status === 403) {
|
|
2984
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2985
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2986
|
+
}));
|
|
2987
|
+
}
|
|
2988
|
+
else if (status !== 200 && status !== 204) {
|
|
2989
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2990
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2991
|
+
}));
|
|
2992
|
+
}
|
|
2993
|
+
return rxjs.of(null);
|
|
2994
|
+
};
|
|
2995
|
+
/**
|
|
2996
|
+
* Gets storefront user by id
|
|
2997
|
+
* @param id Storefront user identifier
|
|
2998
|
+
* @param storefrontId Storefront identifier
|
|
2999
|
+
* @param tenantId (optional) Tenant identifier
|
|
3000
|
+
* @param userId (optional) User identifier
|
|
3001
|
+
* @return Success
|
|
3002
|
+
*/
|
|
3003
|
+
StorefrontUsersApiClient.prototype.get = function (id, storefrontId, tenantId, userId) {
|
|
3004
|
+
var _this = this;
|
|
3005
|
+
var url_ = this.baseUrl + "/api/storefront/v1/storefront-users/{id}?";
|
|
3006
|
+
if (id === undefined || id === null)
|
|
3007
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3008
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3009
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
3010
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
3011
|
+
else
|
|
3012
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
3013
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3014
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3015
|
+
if (userId !== undefined && userId !== null)
|
|
3016
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
3017
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3018
|
+
var options_ = {
|
|
3019
|
+
observe: "response",
|
|
3020
|
+
responseType: "blob",
|
|
3021
|
+
headers: new i1.HttpHeaders({
|
|
3022
|
+
"Accept": "text/plain"
|
|
3023
|
+
})
|
|
3024
|
+
};
|
|
3025
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
3026
|
+
return _this.http.request("get", url_, transformedOptions_);
|
|
3027
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
3028
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGet(r); });
|
|
3029
|
+
})).pipe(operators.catchError(function (response_) {
|
|
3030
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
3031
|
+
try {
|
|
3032
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGet(r); });
|
|
3033
|
+
}
|
|
3034
|
+
catch (e) {
|
|
3035
|
+
return rxjs.throwError(e);
|
|
3036
|
+
}
|
|
3037
|
+
}
|
|
3038
|
+
else
|
|
3039
|
+
return rxjs.throwError(response_);
|
|
3040
|
+
}));
|
|
3041
|
+
};
|
|
3042
|
+
StorefrontUsersApiClient.prototype.processGet = function (response) {
|
|
3043
|
+
var e_27, _a;
|
|
3044
|
+
var _this = this;
|
|
3045
|
+
var status = response.status;
|
|
3046
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
3047
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
3048
|
+
var _headers = {};
|
|
3049
|
+
if (response.headers) {
|
|
3050
|
+
try {
|
|
3051
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
3052
|
+
var key = _c.value;
|
|
3053
|
+
_headers[key] = response.headers.get(key);
|
|
3054
|
+
}
|
|
3055
|
+
}
|
|
3056
|
+
catch (e_27_1) { e_27 = { error: e_27_1 }; }
|
|
3057
|
+
finally {
|
|
3058
|
+
try {
|
|
3059
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
3060
|
+
}
|
|
3061
|
+
finally { if (e_27) throw e_27.error; }
|
|
3062
|
+
}
|
|
3063
|
+
}
|
|
3064
|
+
if (status === 200) {
|
|
3065
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3066
|
+
var result200 = null;
|
|
3067
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
3068
|
+
return rxjs.of(result200);
|
|
3069
|
+
}));
|
|
3070
|
+
}
|
|
3071
|
+
else if (status === 404) {
|
|
3072
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3073
|
+
var result404 = null;
|
|
3074
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
3075
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3076
|
+
}));
|
|
3077
|
+
}
|
|
3078
|
+
else if (status === 401) {
|
|
3079
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3080
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3081
|
+
}));
|
|
3082
|
+
}
|
|
3083
|
+
else if (status === 403) {
|
|
3084
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3085
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3086
|
+
}));
|
|
3087
|
+
}
|
|
3088
|
+
else if (status !== 200 && status !== 204) {
|
|
3089
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3090
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3091
|
+
}));
|
|
3092
|
+
}
|
|
3093
|
+
return rxjs.of(null);
|
|
3094
|
+
};
|
|
3095
|
+
/**
|
|
3096
|
+
* Merges anonymous storefront user data to regular storefront user account
|
|
3097
|
+
* @param storefrontId Storefront identifier
|
|
3098
|
+
* @param tenantId (optional) Tenant identifier
|
|
3099
|
+
* @param userId (optional) User identifier
|
|
3100
|
+
* @param body (optional) Merge operation parameters
|
|
3101
|
+
* @return Success
|
|
3102
|
+
*/
|
|
3103
|
+
StorefrontUsersApiClient.prototype.mergeAnonymous = function (storefrontId, tenantId, userId, body) {
|
|
3104
|
+
var _this = this;
|
|
3105
|
+
var url_ = this.baseUrl + "/api/storefront/v1/storefront-users/merge-anonymous?";
|
|
3106
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
3107
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
3108
|
+
else
|
|
3109
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
3110
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3111
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3112
|
+
if (userId !== undefined && userId !== null)
|
|
3113
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
3114
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3115
|
+
var content_ = JSON.stringify(body);
|
|
3116
|
+
var options_ = {
|
|
3117
|
+
body: content_,
|
|
3118
|
+
observe: "response",
|
|
3119
|
+
responseType: "blob",
|
|
3120
|
+
headers: new i1.HttpHeaders({
|
|
3121
|
+
"Content-Type": "application/json-patch+json",
|
|
3122
|
+
})
|
|
3123
|
+
};
|
|
3124
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
3125
|
+
return _this.http.request("post", url_, transformedOptions_);
|
|
3126
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
3127
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processMergeAnonymous(r); });
|
|
3128
|
+
})).pipe(operators.catchError(function (response_) {
|
|
3129
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
3130
|
+
try {
|
|
3131
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processMergeAnonymous(r); });
|
|
3132
|
+
}
|
|
3133
|
+
catch (e) {
|
|
3134
|
+
return rxjs.throwError(e);
|
|
3135
|
+
}
|
|
3136
|
+
}
|
|
3137
|
+
else
|
|
3138
|
+
return rxjs.throwError(response_);
|
|
3139
|
+
}));
|
|
3140
|
+
};
|
|
3141
|
+
StorefrontUsersApiClient.prototype.processMergeAnonymous = function (response) {
|
|
3142
|
+
var e_28, _a;
|
|
3143
|
+
var _this = this;
|
|
3144
|
+
var status = response.status;
|
|
3145
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
3146
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
3147
|
+
var _headers = {};
|
|
3148
|
+
if (response.headers) {
|
|
3149
|
+
try {
|
|
3150
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
3151
|
+
var key = _c.value;
|
|
3152
|
+
_headers[key] = response.headers.get(key);
|
|
3153
|
+
}
|
|
3154
|
+
}
|
|
3155
|
+
catch (e_28_1) { e_28 = { error: e_28_1 }; }
|
|
3156
|
+
finally {
|
|
3157
|
+
try {
|
|
3158
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
3159
|
+
}
|
|
3160
|
+
finally { if (e_28) throw e_28.error; }
|
|
3161
|
+
}
|
|
3162
|
+
}
|
|
3163
|
+
if (status === 200) {
|
|
3164
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3165
|
+
return rxjs.of(null);
|
|
3166
|
+
}));
|
|
3167
|
+
}
|
|
3168
|
+
else if (status === 404) {
|
|
3169
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3170
|
+
var result404 = null;
|
|
3171
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
3172
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3173
|
+
}));
|
|
3174
|
+
}
|
|
3175
|
+
else if (status === 409) {
|
|
3176
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3177
|
+
var result409 = null;
|
|
3178
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
3179
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3180
|
+
}));
|
|
3181
|
+
}
|
|
3182
|
+
else if (status === 401) {
|
|
3183
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3184
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3185
|
+
}));
|
|
3186
|
+
}
|
|
3187
|
+
else if (status === 403) {
|
|
3188
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3189
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3190
|
+
}));
|
|
3191
|
+
}
|
|
3192
|
+
else if (status !== 200 && status !== 204) {
|
|
3193
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3194
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3195
|
+
}));
|
|
3196
|
+
}
|
|
3197
|
+
return rxjs.of(null);
|
|
3198
|
+
};
|
|
3199
|
+
/**
|
|
3200
|
+
* Gets storefront user token
|
|
3201
|
+
* @param storefrontUserId Storefront user identifier
|
|
3202
|
+
* @param storefrontId Storefront identifier
|
|
3203
|
+
* @param tenantId (optional) Tenant identifier
|
|
3204
|
+
* @param userId (optional) User identifier
|
|
3205
|
+
* @return Success
|
|
3206
|
+
*/
|
|
3207
|
+
StorefrontUsersApiClient.prototype.getToken = function (storefrontUserId, storefrontId, tenantId, userId) {
|
|
3208
|
+
var _this = this;
|
|
3209
|
+
var url_ = this.baseUrl + "/api/storefront/v1/storefront-users/token?";
|
|
3210
|
+
if (storefrontUserId === undefined || storefrontUserId === null)
|
|
3211
|
+
throw new Error("The parameter 'storefrontUserId' must be defined and cannot be null.");
|
|
3212
|
+
else
|
|
3213
|
+
url_ += "storefrontUserId=" + encodeURIComponent("" + storefrontUserId) + "&";
|
|
3214
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
3215
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
3216
|
+
else
|
|
3217
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
3218
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3219
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3220
|
+
if (userId !== undefined && userId !== null)
|
|
3221
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
3222
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3223
|
+
var options_ = {
|
|
3224
|
+
observe: "response",
|
|
3225
|
+
responseType: "blob",
|
|
3226
|
+
headers: new i1.HttpHeaders({})
|
|
3227
|
+
};
|
|
3228
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
3229
|
+
return _this.http.request("get", url_, transformedOptions_);
|
|
3230
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
3231
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetToken(r); });
|
|
3232
|
+
})).pipe(operators.catchError(function (response_) {
|
|
3233
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
3234
|
+
try {
|
|
3235
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetToken(r); });
|
|
3236
|
+
}
|
|
3237
|
+
catch (e) {
|
|
3238
|
+
return rxjs.throwError(e);
|
|
3239
|
+
}
|
|
3240
|
+
}
|
|
3241
|
+
else
|
|
3242
|
+
return rxjs.throwError(response_);
|
|
3243
|
+
}));
|
|
3244
|
+
};
|
|
3245
|
+
StorefrontUsersApiClient.prototype.processGetToken = function (response) {
|
|
3246
|
+
var e_29, _a;
|
|
3247
|
+
var _this = this;
|
|
3248
|
+
var status = response.status;
|
|
3249
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
3250
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
3251
|
+
var _headers = {};
|
|
3252
|
+
if (response.headers) {
|
|
3253
|
+
try {
|
|
3254
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
3255
|
+
var key = _c.value;
|
|
3256
|
+
_headers[key] = response.headers.get(key);
|
|
3257
|
+
}
|
|
3258
|
+
}
|
|
3259
|
+
catch (e_29_1) { e_29 = { error: e_29_1 }; }
|
|
3260
|
+
finally {
|
|
3261
|
+
try {
|
|
3262
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
3263
|
+
}
|
|
3264
|
+
finally { if (e_29) throw e_29.error; }
|
|
3265
|
+
}
|
|
3266
|
+
}
|
|
3267
|
+
if (status === 201) {
|
|
3268
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3269
|
+
return rxjs.of(null);
|
|
3270
|
+
}));
|
|
3271
|
+
}
|
|
3272
|
+
else if (status === 404) {
|
|
3273
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3274
|
+
var result404 = null;
|
|
3275
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
3276
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3277
|
+
}));
|
|
3278
|
+
}
|
|
3279
|
+
else if (status === 409) {
|
|
3280
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3281
|
+
var result409 = null;
|
|
3282
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
3283
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3284
|
+
}));
|
|
3285
|
+
}
|
|
3286
|
+
else if (status === 401) {
|
|
3287
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3288
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3289
|
+
}));
|
|
3290
|
+
}
|
|
3291
|
+
else if (status === 403) {
|
|
3292
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3293
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3294
|
+
}));
|
|
3295
|
+
}
|
|
3296
|
+
else if (status !== 200 && status !== 204) {
|
|
3297
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3298
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3299
|
+
}));
|
|
3300
|
+
}
|
|
3301
|
+
return rxjs.of(null);
|
|
3302
|
+
};
|
|
3303
|
+
return StorefrontUsersApiClient;
|
|
3304
|
+
}(ApiClientBase));
|
|
3305
|
+
StorefrontUsersApiClient.ɵprov = i0.ɵɵdefineInjectable({ factory: function StorefrontUsersApiClient_Factory() { return new StorefrontUsersApiClient(i0.ɵɵinject(ApiClientConfiguration), i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(API_BASE_URL, 8)); }, token: StorefrontUsersApiClient, providedIn: "root" });
|
|
3306
|
+
StorefrontUsersApiClient.decorators = [
|
|
3307
|
+
{ type: i0.Injectable, args: [{
|
|
3308
|
+
providedIn: 'root'
|
|
3309
|
+
},] }
|
|
3310
|
+
];
|
|
3311
|
+
StorefrontUsersApiClient.ctorParameters = function () { return [
|
|
3312
|
+
{ type: ApiClientConfiguration, decorators: [{ type: i0.Inject, args: [ApiClientConfiguration,] }] },
|
|
3313
|
+
{ type: i1.HttpClient, decorators: [{ type: i0.Inject, args: [i1.HttpClient,] }] },
|
|
3314
|
+
{ type: String, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [API_BASE_URL,] }] }
|
|
3315
|
+
]; };
|
|
2789
3316
|
var TenantInfoApiClient = /** @class */ (function (_super) {
|
|
2790
3317
|
__extends(TenantInfoApiClient, _super);
|
|
2791
3318
|
function TenantInfoApiClient(configuration, http, baseUrl) {
|
|
@@ -2834,7 +3361,7 @@
|
|
|
2834
3361
|
}));
|
|
2835
3362
|
};
|
|
2836
3363
|
TenantInfoApiClient.prototype.processGetApplicationsInfo = function (response) {
|
|
2837
|
-
var
|
|
3364
|
+
var e_30, _a;
|
|
2838
3365
|
var _this = this;
|
|
2839
3366
|
var status = response.status;
|
|
2840
3367
|
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
@@ -2847,12 +3374,96 @@
|
|
|
2847
3374
|
_headers[key] = response.headers.get(key);
|
|
2848
3375
|
}
|
|
2849
3376
|
}
|
|
2850
|
-
catch (
|
|
3377
|
+
catch (e_30_1) { e_30 = { error: e_30_1 }; }
|
|
2851
3378
|
finally {
|
|
2852
3379
|
try {
|
|
2853
3380
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2854
3381
|
}
|
|
2855
|
-
finally { if (
|
|
3382
|
+
finally { if (e_30) throw e_30.error; }
|
|
3383
|
+
}
|
|
3384
|
+
}
|
|
3385
|
+
if (status === 200) {
|
|
3386
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3387
|
+
var result200 = null;
|
|
3388
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
3389
|
+
return rxjs.of(result200);
|
|
3390
|
+
}));
|
|
3391
|
+
}
|
|
3392
|
+
else if (status === 401) {
|
|
3393
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3394
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3395
|
+
}));
|
|
3396
|
+
}
|
|
3397
|
+
else if (status === 403) {
|
|
3398
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3399
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3400
|
+
}));
|
|
3401
|
+
}
|
|
3402
|
+
else if (status !== 200 && status !== 204) {
|
|
3403
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3404
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3405
|
+
}));
|
|
3406
|
+
}
|
|
3407
|
+
return rxjs.of(null);
|
|
3408
|
+
};
|
|
3409
|
+
/**
|
|
3410
|
+
* Gets information about tenant
|
|
3411
|
+
* @param tenantId (optional) Tenant identifier
|
|
3412
|
+
* @param userId (optional) User identifier
|
|
3413
|
+
* @return Success
|
|
3414
|
+
*/
|
|
3415
|
+
TenantInfoApiClient.prototype.getInfo = function (tenantId, userId) {
|
|
3416
|
+
var _this = this;
|
|
3417
|
+
var url_ = this.baseUrl + "/api/storefront/v1/tenant-info?";
|
|
3418
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3419
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3420
|
+
if (userId !== undefined && userId !== null)
|
|
3421
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
3422
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3423
|
+
var options_ = {
|
|
3424
|
+
observe: "response",
|
|
3425
|
+
responseType: "blob",
|
|
3426
|
+
headers: new i1.HttpHeaders({
|
|
3427
|
+
"Accept": "text/plain"
|
|
3428
|
+
})
|
|
3429
|
+
};
|
|
3430
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
3431
|
+
return _this.http.request("get", url_, transformedOptions_);
|
|
3432
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
3433
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetInfo(r); });
|
|
3434
|
+
})).pipe(operators.catchError(function (response_) {
|
|
3435
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
3436
|
+
try {
|
|
3437
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetInfo(r); });
|
|
3438
|
+
}
|
|
3439
|
+
catch (e) {
|
|
3440
|
+
return rxjs.throwError(e);
|
|
3441
|
+
}
|
|
3442
|
+
}
|
|
3443
|
+
else
|
|
3444
|
+
return rxjs.throwError(response_);
|
|
3445
|
+
}));
|
|
3446
|
+
};
|
|
3447
|
+
TenantInfoApiClient.prototype.processGetInfo = function (response) {
|
|
3448
|
+
var e_31, _a;
|
|
3449
|
+
var _this = this;
|
|
3450
|
+
var status = response.status;
|
|
3451
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
3452
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
3453
|
+
var _headers = {};
|
|
3454
|
+
if (response.headers) {
|
|
3455
|
+
try {
|
|
3456
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
3457
|
+
var key = _c.value;
|
|
3458
|
+
_headers[key] = response.headers.get(key);
|
|
3459
|
+
}
|
|
3460
|
+
}
|
|
3461
|
+
catch (e_31_1) { e_31 = { error: e_31_1 }; }
|
|
3462
|
+
finally {
|
|
3463
|
+
try {
|
|
3464
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
3465
|
+
}
|
|
3466
|
+
finally { if (e_31) throw e_31.error; }
|
|
2856
3467
|
}
|
|
2857
3468
|
}
|
|
2858
3469
|
if (status === 200) {
|
|
@@ -3000,6 +3611,7 @@
|
|
|
3000
3611
|
exports.ProductSpecificationsApiClient = ProductSpecificationsApiClient;
|
|
3001
3612
|
exports.ProjectsApiClient = ProjectsApiClient;
|
|
3002
3613
|
exports.StorefrontModule = StorefrontModule;
|
|
3614
|
+
exports.StorefrontUsersApiClient = StorefrontUsersApiClient;
|
|
3003
3615
|
exports.StorefrontsApiClient = StorefrontsApiClient;
|
|
3004
3616
|
exports.TenantInfoApiClient = TenantInfoApiClient;
|
|
3005
3617
|
|