@aurigma/ng-storefront-api-client 2.2.53
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/README.md +79 -0
- package/aurigma-ng-storefront-api-client.d.ts +4 -0
- package/aurigma-ng-storefront-api-client.metadata.json +1 -0
- package/bundles/aurigma-ng-storefront-api-client.umd.js +3627 -0
- package/bundles/aurigma-ng-storefront-api-client.umd.js.map +1 -0
- package/bundles/aurigma-ng-storefront-api-client.umd.min.js +16 -0
- package/bundles/aurigma-ng-storefront-api-client.umd.min.js.map +1 -0
- package/esm2015/aurigma-ng-storefront-api-client.js +5 -0
- package/esm2015/lib/storefront-api-client.js +2827 -0
- package/esm2015/lib/storefront.module.js +35 -0
- package/esm2015/public-api.js +6 -0
- package/fesm2015/aurigma-ng-storefront-api-client.js +2861 -0
- package/fesm2015/aurigma-ng-storefront-api-client.js.map +1 -0
- package/lib/storefront-api-client.d.ts +975 -0
- package/lib/storefront.module.d.ts +6 -0
- package/package.json +31 -0
- package/public-api.d.ts +2 -0
|
@@ -0,0 +1,3627 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs/operators'), require('rxjs'), require('@angular/common/http')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@aurigma/ng-storefront-api-client', ['exports', '@angular/core', 'rxjs/operators', 'rxjs', '@angular/common/http'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.aurigma = global.aurigma || {}, global.aurigma['ng-storefront-api-client'] = {}), global.ng.core, global.rxjs.operators, global.rxjs, global.ng.common.http));
|
|
5
|
+
}(this, (function (exports, i0, operators, rxjs, i1) { 'use strict';
|
|
6
|
+
|
|
7
|
+
/*! *****************************************************************************
|
|
8
|
+
Copyright (c) Microsoft Corporation.
|
|
9
|
+
|
|
10
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
11
|
+
purpose with or without fee is hereby granted.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
14
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
15
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
16
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
17
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
18
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
19
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
20
|
+
***************************************************************************** */
|
|
21
|
+
/* global Reflect, Promise */
|
|
22
|
+
var extendStatics = function (d, b) {
|
|
23
|
+
extendStatics = Object.setPrototypeOf ||
|
|
24
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
25
|
+
function (d, b) { for (var p in b)
|
|
26
|
+
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
27
|
+
d[p] = b[p]; };
|
|
28
|
+
return extendStatics(d, b);
|
|
29
|
+
};
|
|
30
|
+
function __extends(d, b) {
|
|
31
|
+
if (typeof b !== "function" && b !== null)
|
|
32
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
33
|
+
extendStatics(d, b);
|
|
34
|
+
function __() { this.constructor = d; }
|
|
35
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
36
|
+
}
|
|
37
|
+
var __assign = function () {
|
|
38
|
+
__assign = Object.assign || function __assign(t) {
|
|
39
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
40
|
+
s = arguments[i];
|
|
41
|
+
for (var p in s)
|
|
42
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
43
|
+
t[p] = s[p];
|
|
44
|
+
}
|
|
45
|
+
return t;
|
|
46
|
+
};
|
|
47
|
+
return __assign.apply(this, arguments);
|
|
48
|
+
};
|
|
49
|
+
function __rest(s, e) {
|
|
50
|
+
var t = {};
|
|
51
|
+
for (var p in s)
|
|
52
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
53
|
+
t[p] = s[p];
|
|
54
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
55
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
56
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
57
|
+
t[p[i]] = s[p[i]];
|
|
58
|
+
}
|
|
59
|
+
return t;
|
|
60
|
+
}
|
|
61
|
+
function __decorate(decorators, target, key, desc) {
|
|
62
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
63
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
64
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
65
|
+
else
|
|
66
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
67
|
+
if (d = decorators[i])
|
|
68
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
69
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
70
|
+
}
|
|
71
|
+
function __param(paramIndex, decorator) {
|
|
72
|
+
return function (target, key) { decorator(target, key, paramIndex); };
|
|
73
|
+
}
|
|
74
|
+
function __metadata(metadataKey, metadataValue) {
|
|
75
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
76
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
77
|
+
}
|
|
78
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
79
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
80
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
81
|
+
function fulfilled(value) { try {
|
|
82
|
+
step(generator.next(value));
|
|
83
|
+
}
|
|
84
|
+
catch (e) {
|
|
85
|
+
reject(e);
|
|
86
|
+
} }
|
|
87
|
+
function rejected(value) { try {
|
|
88
|
+
step(generator["throw"](value));
|
|
89
|
+
}
|
|
90
|
+
catch (e) {
|
|
91
|
+
reject(e);
|
|
92
|
+
} }
|
|
93
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
94
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function __generator(thisArg, body) {
|
|
98
|
+
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
99
|
+
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
100
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
101
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
102
|
+
function step(op) {
|
|
103
|
+
if (f)
|
|
104
|
+
throw new TypeError("Generator is already executing.");
|
|
105
|
+
while (_)
|
|
106
|
+
try {
|
|
107
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
108
|
+
return t;
|
|
109
|
+
if (y = 0, t)
|
|
110
|
+
op = [op[0] & 2, t.value];
|
|
111
|
+
switch (op[0]) {
|
|
112
|
+
case 0:
|
|
113
|
+
case 1:
|
|
114
|
+
t = op;
|
|
115
|
+
break;
|
|
116
|
+
case 4:
|
|
117
|
+
_.label++;
|
|
118
|
+
return { value: op[1], done: false };
|
|
119
|
+
case 5:
|
|
120
|
+
_.label++;
|
|
121
|
+
y = op[1];
|
|
122
|
+
op = [0];
|
|
123
|
+
continue;
|
|
124
|
+
case 7:
|
|
125
|
+
op = _.ops.pop();
|
|
126
|
+
_.trys.pop();
|
|
127
|
+
continue;
|
|
128
|
+
default:
|
|
129
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
130
|
+
_ = 0;
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
134
|
+
_.label = op[1];
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
138
|
+
_.label = t[1];
|
|
139
|
+
t = op;
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
if (t && _.label < t[2]) {
|
|
143
|
+
_.label = t[2];
|
|
144
|
+
_.ops.push(op);
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
if (t[2])
|
|
148
|
+
_.ops.pop();
|
|
149
|
+
_.trys.pop();
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
op = body.call(thisArg, _);
|
|
153
|
+
}
|
|
154
|
+
catch (e) {
|
|
155
|
+
op = [6, e];
|
|
156
|
+
y = 0;
|
|
157
|
+
}
|
|
158
|
+
finally {
|
|
159
|
+
f = t = 0;
|
|
160
|
+
}
|
|
161
|
+
if (op[0] & 5)
|
|
162
|
+
throw op[1];
|
|
163
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
167
|
+
if (k2 === undefined)
|
|
168
|
+
k2 = k;
|
|
169
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
170
|
+
}) : (function (o, m, k, k2) {
|
|
171
|
+
if (k2 === undefined)
|
|
172
|
+
k2 = k;
|
|
173
|
+
o[k2] = m[k];
|
|
174
|
+
});
|
|
175
|
+
function __exportStar(m, o) {
|
|
176
|
+
for (var p in m)
|
|
177
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
178
|
+
__createBinding(o, m, p);
|
|
179
|
+
}
|
|
180
|
+
function __values(o) {
|
|
181
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
182
|
+
if (m)
|
|
183
|
+
return m.call(o);
|
|
184
|
+
if (o && typeof o.length === "number")
|
|
185
|
+
return {
|
|
186
|
+
next: function () {
|
|
187
|
+
if (o && i >= o.length)
|
|
188
|
+
o = void 0;
|
|
189
|
+
return { value: o && o[i++], done: !o };
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
193
|
+
}
|
|
194
|
+
function __read(o, n) {
|
|
195
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
196
|
+
if (!m)
|
|
197
|
+
return o;
|
|
198
|
+
var i = m.call(o), r, ar = [], e;
|
|
199
|
+
try {
|
|
200
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
201
|
+
ar.push(r.value);
|
|
202
|
+
}
|
|
203
|
+
catch (error) {
|
|
204
|
+
e = { error: error };
|
|
205
|
+
}
|
|
206
|
+
finally {
|
|
207
|
+
try {
|
|
208
|
+
if (r && !r.done && (m = i["return"]))
|
|
209
|
+
m.call(i);
|
|
210
|
+
}
|
|
211
|
+
finally {
|
|
212
|
+
if (e)
|
|
213
|
+
throw e.error;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return ar;
|
|
217
|
+
}
|
|
218
|
+
/** @deprecated */
|
|
219
|
+
function __spread() {
|
|
220
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
221
|
+
ar = ar.concat(__read(arguments[i]));
|
|
222
|
+
return ar;
|
|
223
|
+
}
|
|
224
|
+
/** @deprecated */
|
|
225
|
+
function __spreadArrays() {
|
|
226
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
227
|
+
s += arguments[i].length;
|
|
228
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
229
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
230
|
+
r[k] = a[j];
|
|
231
|
+
return r;
|
|
232
|
+
}
|
|
233
|
+
function __spreadArray(to, from) {
|
|
234
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
235
|
+
to[j] = from[i];
|
|
236
|
+
return to;
|
|
237
|
+
}
|
|
238
|
+
function __await(v) {
|
|
239
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
240
|
+
}
|
|
241
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
242
|
+
if (!Symbol.asyncIterator)
|
|
243
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
244
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
245
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
246
|
+
function verb(n) { if (g[n])
|
|
247
|
+
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
248
|
+
function resume(n, v) { try {
|
|
249
|
+
step(g[n](v));
|
|
250
|
+
}
|
|
251
|
+
catch (e) {
|
|
252
|
+
settle(q[0][3], e);
|
|
253
|
+
} }
|
|
254
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
255
|
+
function fulfill(value) { resume("next", value); }
|
|
256
|
+
function reject(value) { resume("throw", value); }
|
|
257
|
+
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
258
|
+
resume(q[0][0], q[0][1]); }
|
|
259
|
+
}
|
|
260
|
+
function __asyncDelegator(o) {
|
|
261
|
+
var i, p;
|
|
262
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
263
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
264
|
+
}
|
|
265
|
+
function __asyncValues(o) {
|
|
266
|
+
if (!Symbol.asyncIterator)
|
|
267
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
268
|
+
var m = o[Symbol.asyncIterator], i;
|
|
269
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
270
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
271
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
272
|
+
}
|
|
273
|
+
function __makeTemplateObject(cooked, raw) {
|
|
274
|
+
if (Object.defineProperty) {
|
|
275
|
+
Object.defineProperty(cooked, "raw", { value: raw });
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
cooked.raw = raw;
|
|
279
|
+
}
|
|
280
|
+
return cooked;
|
|
281
|
+
}
|
|
282
|
+
;
|
|
283
|
+
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
284
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
285
|
+
}) : function (o, v) {
|
|
286
|
+
o["default"] = v;
|
|
287
|
+
};
|
|
288
|
+
function __importStar(mod) {
|
|
289
|
+
if (mod && mod.__esModule)
|
|
290
|
+
return mod;
|
|
291
|
+
var result = {};
|
|
292
|
+
if (mod != null)
|
|
293
|
+
for (var k in mod)
|
|
294
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
295
|
+
__createBinding(result, mod, k);
|
|
296
|
+
__setModuleDefault(result, mod);
|
|
297
|
+
return result;
|
|
298
|
+
}
|
|
299
|
+
function __importDefault(mod) {
|
|
300
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
301
|
+
}
|
|
302
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
303
|
+
if (kind === "a" && !f)
|
|
304
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
305
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
306
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
307
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
308
|
+
}
|
|
309
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
310
|
+
if (kind === "m")
|
|
311
|
+
throw new TypeError("Private method is not writable");
|
|
312
|
+
if (kind === "a" && !f)
|
|
313
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
314
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
315
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
316
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
var API_BASE_URL = new i0.InjectionToken('API_BASE_URL');
|
|
320
|
+
var ApiClientConfiguration = /** @class */ (function () {
|
|
321
|
+
function ApiClientConfiguration() {
|
|
322
|
+
this.apiKey = 'ApiKey';
|
|
323
|
+
this.authorizationToken = null;
|
|
324
|
+
}
|
|
325
|
+
ApiClientConfiguration.prototype.getAuthorizationToken = function () {
|
|
326
|
+
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
327
|
+
return [2 /*return*/, this.authorizationToken];
|
|
328
|
+
}); });
|
|
329
|
+
};
|
|
330
|
+
;
|
|
331
|
+
ApiClientConfiguration.prototype.setAuthorizationToken = function (token) { this.authorizationToken = token; };
|
|
332
|
+
;
|
|
333
|
+
return ApiClientConfiguration;
|
|
334
|
+
}());
|
|
335
|
+
var ApiClientBase = /** @class */ (function () {
|
|
336
|
+
function ApiClientBase(configuration) {
|
|
337
|
+
this.configuration = configuration;
|
|
338
|
+
}
|
|
339
|
+
ApiClientBase.prototype.transformOptions = function (options) {
|
|
340
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
341
|
+
var token;
|
|
342
|
+
return __generator(this, function (_a) {
|
|
343
|
+
switch (_a.label) {
|
|
344
|
+
case 0: return [4 /*yield*/, this.configuration.getAuthorizationToken()];
|
|
345
|
+
case 1:
|
|
346
|
+
token = _a.sent();
|
|
347
|
+
if (token != null) {
|
|
348
|
+
options.headers = options.headers.append("authorization", "Bearer " + token);
|
|
349
|
+
}
|
|
350
|
+
else {
|
|
351
|
+
options.headers = options.headers.append("X-API-Key", this.configuration.apiKey);
|
|
352
|
+
}
|
|
353
|
+
//options = { ...options, transformResponse: (res) => res, responseType: 'json' };
|
|
354
|
+
return [2 /*return*/, options];
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
});
|
|
358
|
+
};
|
|
359
|
+
ApiClientBase.prototype.getBaseUrl = function (defultUrl) {
|
|
360
|
+
return this.configuration.apiUrl;
|
|
361
|
+
};
|
|
362
|
+
ApiClientBase.prototype.transformResult = function (url, res, cb) {
|
|
363
|
+
return cb(res);
|
|
364
|
+
};
|
|
365
|
+
return ApiClientBase;
|
|
366
|
+
}());
|
|
367
|
+
var BuildInfoApiClient = /** @class */ (function (_super) {
|
|
368
|
+
__extends(BuildInfoApiClient, _super);
|
|
369
|
+
function BuildInfoApiClient(configuration, http, baseUrl) {
|
|
370
|
+
var _this = _super.call(this, configuration) || this;
|
|
371
|
+
_this.jsonParseReviver = undefined;
|
|
372
|
+
_this.http = http;
|
|
373
|
+
_this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : _this.getBaseUrl("");
|
|
374
|
+
return _this;
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Gets assembly build info
|
|
378
|
+
* @return Success
|
|
379
|
+
*/
|
|
380
|
+
BuildInfoApiClient.prototype.headInfo = function () {
|
|
381
|
+
var _this = this;
|
|
382
|
+
var url_ = this.baseUrl + "/api/storefront/v1/info";
|
|
383
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
384
|
+
var options_ = {
|
|
385
|
+
observe: "response",
|
|
386
|
+
responseType: "blob",
|
|
387
|
+
headers: new i1.HttpHeaders({})
|
|
388
|
+
};
|
|
389
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
390
|
+
return _this.http.request("head", url_, transformedOptions_);
|
|
391
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
392
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processHeadInfo(r); });
|
|
393
|
+
})).pipe(operators.catchError(function (response_) {
|
|
394
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
395
|
+
try {
|
|
396
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processHeadInfo(r); });
|
|
397
|
+
}
|
|
398
|
+
catch (e) {
|
|
399
|
+
return rxjs.throwError(e);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
else
|
|
403
|
+
return rxjs.throwError(response_);
|
|
404
|
+
}));
|
|
405
|
+
};
|
|
406
|
+
BuildInfoApiClient.prototype.processHeadInfo = function (response) {
|
|
407
|
+
var e_1, _a;
|
|
408
|
+
var status = response.status;
|
|
409
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
410
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
411
|
+
var _headers = {};
|
|
412
|
+
if (response.headers) {
|
|
413
|
+
try {
|
|
414
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
415
|
+
var key = _c.value;
|
|
416
|
+
_headers[key] = response.headers.get(key);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
420
|
+
finally {
|
|
421
|
+
try {
|
|
422
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
423
|
+
}
|
|
424
|
+
finally { if (e_1) throw e_1.error; }
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
if (status === 200) {
|
|
428
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
429
|
+
return rxjs.of(null);
|
|
430
|
+
}));
|
|
431
|
+
}
|
|
432
|
+
else if (status !== 200 && status !== 204) {
|
|
433
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
434
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
435
|
+
}));
|
|
436
|
+
}
|
|
437
|
+
return rxjs.of(null);
|
|
438
|
+
};
|
|
439
|
+
/**
|
|
440
|
+
* Gets assembly build info
|
|
441
|
+
* @return Success
|
|
442
|
+
*/
|
|
443
|
+
BuildInfoApiClient.prototype.getInfo = function () {
|
|
444
|
+
var _this = this;
|
|
445
|
+
var url_ = this.baseUrl + "/api/storefront/v1/info";
|
|
446
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
447
|
+
var options_ = {
|
|
448
|
+
observe: "response",
|
|
449
|
+
responseType: "blob",
|
|
450
|
+
headers: new i1.HttpHeaders({
|
|
451
|
+
"Accept": "text/plain"
|
|
452
|
+
})
|
|
453
|
+
};
|
|
454
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
455
|
+
return _this.http.request("get", url_, transformedOptions_);
|
|
456
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
457
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetInfo(r); });
|
|
458
|
+
})).pipe(operators.catchError(function (response_) {
|
|
459
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
460
|
+
try {
|
|
461
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetInfo(r); });
|
|
462
|
+
}
|
|
463
|
+
catch (e) {
|
|
464
|
+
return rxjs.throwError(e);
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
else
|
|
468
|
+
return rxjs.throwError(response_);
|
|
469
|
+
}));
|
|
470
|
+
};
|
|
471
|
+
BuildInfoApiClient.prototype.processGetInfo = function (response) {
|
|
472
|
+
var e_2, _a;
|
|
473
|
+
var _this = this;
|
|
474
|
+
var status = response.status;
|
|
475
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
476
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
477
|
+
var _headers = {};
|
|
478
|
+
if (response.headers) {
|
|
479
|
+
try {
|
|
480
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
481
|
+
var key = _c.value;
|
|
482
|
+
_headers[key] = response.headers.get(key);
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
486
|
+
finally {
|
|
487
|
+
try {
|
|
488
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
489
|
+
}
|
|
490
|
+
finally { if (e_2) throw e_2.error; }
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
if (status === 200) {
|
|
494
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
495
|
+
var result200 = null;
|
|
496
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
497
|
+
return rxjs.of(result200);
|
|
498
|
+
}));
|
|
499
|
+
}
|
|
500
|
+
else if (status !== 200 && status !== 204) {
|
|
501
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
502
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
503
|
+
}));
|
|
504
|
+
}
|
|
505
|
+
return rxjs.of(null);
|
|
506
|
+
};
|
|
507
|
+
return BuildInfoApiClient;
|
|
508
|
+
}(ApiClientBase));
|
|
509
|
+
BuildInfoApiClient.ɵprov = i0.ɵɵdefineInjectable({ factory: function BuildInfoApiClient_Factory() { return new BuildInfoApiClient(i0.ɵɵinject(ApiClientConfiguration), i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(API_BASE_URL, 8)); }, token: BuildInfoApiClient, providedIn: "root" });
|
|
510
|
+
BuildInfoApiClient.decorators = [
|
|
511
|
+
{ type: i0.Injectable, args: [{
|
|
512
|
+
providedIn: 'root'
|
|
513
|
+
},] }
|
|
514
|
+
];
|
|
515
|
+
BuildInfoApiClient.ctorParameters = function () { return [
|
|
516
|
+
{ type: ApiClientConfiguration, decorators: [{ type: i0.Inject, args: [ApiClientConfiguration,] }] },
|
|
517
|
+
{ type: i1.HttpClient, decorators: [{ type: i0.Inject, args: [i1.HttpClient,] }] },
|
|
518
|
+
{ type: String, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [API_BASE_URL,] }] }
|
|
519
|
+
]; };
|
|
520
|
+
var ProductReferencesApiClient = /** @class */ (function (_super) {
|
|
521
|
+
__extends(ProductReferencesApiClient, _super);
|
|
522
|
+
function ProductReferencesApiClient(configuration, http, baseUrl) {
|
|
523
|
+
var _this = _super.call(this, configuration) || this;
|
|
524
|
+
_this.jsonParseReviver = undefined;
|
|
525
|
+
_this.http = http;
|
|
526
|
+
_this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : _this.getBaseUrl("");
|
|
527
|
+
return _this;
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* Gets all storefront product references relevant to specified query parameters
|
|
531
|
+
* @param storefrontId Storefront identifier
|
|
532
|
+
* @param productReference (optional) Product reference filter. Product reference is an external reference to Customer's Canvas product specification, e.g online store product identifier
|
|
533
|
+
* @param productSpecificationId (optional) Cusomer's Canvas product specification filter
|
|
534
|
+
* @param skip (optional) Defines page start offset from beginning of sorted result list
|
|
535
|
+
* @param take (optional) Defines page length (how much consequent items of sorted result list should be taken)
|
|
536
|
+
* @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC"
|
|
537
|
+
* @param search (optional) Search string for partial match
|
|
538
|
+
* @param tenantId (optional) Tenant identifier
|
|
539
|
+
* @param userId (optional) User identifier
|
|
540
|
+
* @return Success
|
|
541
|
+
*/
|
|
542
|
+
ProductReferencesApiClient.prototype.getAll = function (storefrontId, productReference, productSpecificationId, skip, take, sorting, search, tenantId, userId) {
|
|
543
|
+
var _this = this;
|
|
544
|
+
var url_ = this.baseUrl + "/api/storefront/v1/product-references?";
|
|
545
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
546
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
547
|
+
else
|
|
548
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
549
|
+
if (productReference !== undefined && productReference !== null)
|
|
550
|
+
url_ += "productReference=" + encodeURIComponent("" + productReference) + "&";
|
|
551
|
+
if (productSpecificationId !== undefined && productSpecificationId !== null)
|
|
552
|
+
url_ += "productSpecificationId=" + encodeURIComponent("" + productSpecificationId) + "&";
|
|
553
|
+
if (skip !== undefined && skip !== null)
|
|
554
|
+
url_ += "skip=" + encodeURIComponent("" + skip) + "&";
|
|
555
|
+
if (take !== undefined && take !== null)
|
|
556
|
+
url_ += "take=" + encodeURIComponent("" + take) + "&";
|
|
557
|
+
if (sorting !== undefined && sorting !== null)
|
|
558
|
+
url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
|
|
559
|
+
if (search !== undefined && search !== null)
|
|
560
|
+
url_ += "search=" + encodeURIComponent("" + search) + "&";
|
|
561
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
562
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
563
|
+
if (userId !== undefined && userId !== null)
|
|
564
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
565
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
566
|
+
var options_ = {
|
|
567
|
+
observe: "response",
|
|
568
|
+
responseType: "blob",
|
|
569
|
+
headers: new i1.HttpHeaders({
|
|
570
|
+
"Accept": "text/plain"
|
|
571
|
+
})
|
|
572
|
+
};
|
|
573
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
574
|
+
return _this.http.request("get", url_, transformedOptions_);
|
|
575
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
576
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetAll(r); });
|
|
577
|
+
})).pipe(operators.catchError(function (response_) {
|
|
578
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
579
|
+
try {
|
|
580
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetAll(r); });
|
|
581
|
+
}
|
|
582
|
+
catch (e) {
|
|
583
|
+
return rxjs.throwError(e);
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
else
|
|
587
|
+
return rxjs.throwError(response_);
|
|
588
|
+
}));
|
|
589
|
+
};
|
|
590
|
+
ProductReferencesApiClient.prototype.processGetAll = function (response) {
|
|
591
|
+
var e_3, _a;
|
|
592
|
+
var _this = this;
|
|
593
|
+
var status = response.status;
|
|
594
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
595
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
596
|
+
var _headers = {};
|
|
597
|
+
if (response.headers) {
|
|
598
|
+
try {
|
|
599
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
600
|
+
var key = _c.value;
|
|
601
|
+
_headers[key] = response.headers.get(key);
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
605
|
+
finally {
|
|
606
|
+
try {
|
|
607
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
608
|
+
}
|
|
609
|
+
finally { if (e_3) throw e_3.error; }
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
if (status === 200) {
|
|
613
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
614
|
+
var result200 = null;
|
|
615
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
616
|
+
return rxjs.of(result200);
|
|
617
|
+
}));
|
|
618
|
+
}
|
|
619
|
+
else if (status === 401) {
|
|
620
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
621
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
622
|
+
}));
|
|
623
|
+
}
|
|
624
|
+
else if (status === 403) {
|
|
625
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
626
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
627
|
+
}));
|
|
628
|
+
}
|
|
629
|
+
else if (status !== 200 && status !== 204) {
|
|
630
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
631
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
632
|
+
}));
|
|
633
|
+
}
|
|
634
|
+
return rxjs.of(null);
|
|
635
|
+
};
|
|
636
|
+
/**
|
|
637
|
+
* Creates new storefront product reference
|
|
638
|
+
* @param storefrontId Storefront identifier
|
|
639
|
+
* @param tenantId (optional) Tenant identifier
|
|
640
|
+
* @param userId (optional) User identifier
|
|
641
|
+
* @param body (optional) Create operation parameters
|
|
642
|
+
* @return Success
|
|
643
|
+
*/
|
|
644
|
+
ProductReferencesApiClient.prototype.create = function (storefrontId, tenantId, userId, body) {
|
|
645
|
+
var _this = this;
|
|
646
|
+
var url_ = this.baseUrl + "/api/storefront/v1/product-references?";
|
|
647
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
648
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
649
|
+
else
|
|
650
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
651
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
652
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
653
|
+
if (userId !== undefined && userId !== null)
|
|
654
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
655
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
656
|
+
var content_ = JSON.stringify(body);
|
|
657
|
+
var options_ = {
|
|
658
|
+
body: content_,
|
|
659
|
+
observe: "response",
|
|
660
|
+
responseType: "blob",
|
|
661
|
+
headers: new i1.HttpHeaders({
|
|
662
|
+
"Content-Type": "application/json-patch+json",
|
|
663
|
+
"Accept": "text/plain"
|
|
664
|
+
})
|
|
665
|
+
};
|
|
666
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
667
|
+
return _this.http.request("post", url_, transformedOptions_);
|
|
668
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
669
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processCreate(r); });
|
|
670
|
+
})).pipe(operators.catchError(function (response_) {
|
|
671
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
672
|
+
try {
|
|
673
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processCreate(r); });
|
|
674
|
+
}
|
|
675
|
+
catch (e) {
|
|
676
|
+
return rxjs.throwError(e);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
else
|
|
680
|
+
return rxjs.throwError(response_);
|
|
681
|
+
}));
|
|
682
|
+
};
|
|
683
|
+
ProductReferencesApiClient.prototype.processCreate = function (response) {
|
|
684
|
+
var e_4, _a;
|
|
685
|
+
var _this = this;
|
|
686
|
+
var status = response.status;
|
|
687
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
688
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
689
|
+
var _headers = {};
|
|
690
|
+
if (response.headers) {
|
|
691
|
+
try {
|
|
692
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
693
|
+
var key = _c.value;
|
|
694
|
+
_headers[key] = response.headers.get(key);
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
698
|
+
finally {
|
|
699
|
+
try {
|
|
700
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
701
|
+
}
|
|
702
|
+
finally { if (e_4) throw e_4.error; }
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
if (status === 201) {
|
|
706
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
707
|
+
var result201 = null;
|
|
708
|
+
result201 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
709
|
+
return rxjs.of(result201);
|
|
710
|
+
}));
|
|
711
|
+
}
|
|
712
|
+
else if (status === 404) {
|
|
713
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
714
|
+
var result404 = null;
|
|
715
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
716
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
717
|
+
}));
|
|
718
|
+
}
|
|
719
|
+
else if (status === 401) {
|
|
720
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
721
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
722
|
+
}));
|
|
723
|
+
}
|
|
724
|
+
else if (status === 403) {
|
|
725
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
726
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
727
|
+
}));
|
|
728
|
+
}
|
|
729
|
+
else if (status !== 200 && status !== 204) {
|
|
730
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
731
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
732
|
+
}));
|
|
733
|
+
}
|
|
734
|
+
return rxjs.of(null);
|
|
735
|
+
};
|
|
736
|
+
/**
|
|
737
|
+
* Gets storefront product reference
|
|
738
|
+
* @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier
|
|
739
|
+
* @param storefrontId Storefront identifier
|
|
740
|
+
* @param tenantId (optional) Tenant identifier
|
|
741
|
+
* @param userId (optional) User identifier
|
|
742
|
+
* @return Success
|
|
743
|
+
*/
|
|
744
|
+
ProductReferencesApiClient.prototype.get = function (reference, storefrontId, tenantId, userId) {
|
|
745
|
+
var _this = this;
|
|
746
|
+
var url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}?";
|
|
747
|
+
if (reference === undefined || reference === null)
|
|
748
|
+
throw new Error("The parameter 'reference' must be defined.");
|
|
749
|
+
url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
|
|
750
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
751
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
752
|
+
else
|
|
753
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
754
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
755
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
756
|
+
if (userId !== undefined && userId !== null)
|
|
757
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
758
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
759
|
+
var options_ = {
|
|
760
|
+
observe: "response",
|
|
761
|
+
responseType: "blob",
|
|
762
|
+
headers: new i1.HttpHeaders({
|
|
763
|
+
"Accept": "text/plain"
|
|
764
|
+
})
|
|
765
|
+
};
|
|
766
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
767
|
+
return _this.http.request("get", url_, transformedOptions_);
|
|
768
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
769
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGet(r); });
|
|
770
|
+
})).pipe(operators.catchError(function (response_) {
|
|
771
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
772
|
+
try {
|
|
773
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGet(r); });
|
|
774
|
+
}
|
|
775
|
+
catch (e) {
|
|
776
|
+
return rxjs.throwError(e);
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
else
|
|
780
|
+
return rxjs.throwError(response_);
|
|
781
|
+
}));
|
|
782
|
+
};
|
|
783
|
+
ProductReferencesApiClient.prototype.processGet = function (response) {
|
|
784
|
+
var e_5, _a;
|
|
785
|
+
var _this = this;
|
|
786
|
+
var status = response.status;
|
|
787
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
788
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
789
|
+
var _headers = {};
|
|
790
|
+
if (response.headers) {
|
|
791
|
+
try {
|
|
792
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
793
|
+
var key = _c.value;
|
|
794
|
+
_headers[key] = response.headers.get(key);
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
798
|
+
finally {
|
|
799
|
+
try {
|
|
800
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
801
|
+
}
|
|
802
|
+
finally { if (e_5) throw e_5.error; }
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
if (status === 200) {
|
|
806
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
807
|
+
var result200 = null;
|
|
808
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
809
|
+
return rxjs.of(result200);
|
|
810
|
+
}));
|
|
811
|
+
}
|
|
812
|
+
else if (status === 404) {
|
|
813
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
814
|
+
var result404 = null;
|
|
815
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
816
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
817
|
+
}));
|
|
818
|
+
}
|
|
819
|
+
else if (status === 401) {
|
|
820
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
821
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
822
|
+
}));
|
|
823
|
+
}
|
|
824
|
+
else if (status === 403) {
|
|
825
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
826
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
827
|
+
}));
|
|
828
|
+
}
|
|
829
|
+
else if (status !== 200 && status !== 204) {
|
|
830
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
831
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
832
|
+
}));
|
|
833
|
+
}
|
|
834
|
+
return rxjs.of(null);
|
|
835
|
+
};
|
|
836
|
+
/**
|
|
837
|
+
* Deletes storefront product reference
|
|
838
|
+
* @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier
|
|
839
|
+
* @param storefrontId Storefront identifier
|
|
840
|
+
* @param tenantId (optional) Tenant identifier
|
|
841
|
+
* @param userId (optional) User identifier
|
|
842
|
+
* @return Success
|
|
843
|
+
*/
|
|
844
|
+
ProductReferencesApiClient.prototype.delete = function (reference, storefrontId, tenantId, userId) {
|
|
845
|
+
var _this = this;
|
|
846
|
+
var url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}?";
|
|
847
|
+
if (reference === undefined || reference === null)
|
|
848
|
+
throw new Error("The parameter 'reference' must be defined.");
|
|
849
|
+
url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
|
|
850
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
851
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
852
|
+
else
|
|
853
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
854
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
855
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
856
|
+
if (userId !== undefined && userId !== null)
|
|
857
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
858
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
859
|
+
var options_ = {
|
|
860
|
+
observe: "response",
|
|
861
|
+
responseType: "blob",
|
|
862
|
+
headers: new i1.HttpHeaders({
|
|
863
|
+
"Accept": "text/plain"
|
|
864
|
+
})
|
|
865
|
+
};
|
|
866
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
867
|
+
return _this.http.request("delete", url_, transformedOptions_);
|
|
868
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
869
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processDelete(r); });
|
|
870
|
+
})).pipe(operators.catchError(function (response_) {
|
|
871
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
872
|
+
try {
|
|
873
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processDelete(r); });
|
|
874
|
+
}
|
|
875
|
+
catch (e) {
|
|
876
|
+
return rxjs.throwError(e);
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
else
|
|
880
|
+
return rxjs.throwError(response_);
|
|
881
|
+
}));
|
|
882
|
+
};
|
|
883
|
+
ProductReferencesApiClient.prototype.processDelete = function (response) {
|
|
884
|
+
var e_6, _a;
|
|
885
|
+
var _this = this;
|
|
886
|
+
var status = response.status;
|
|
887
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
888
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
889
|
+
var _headers = {};
|
|
890
|
+
if (response.headers) {
|
|
891
|
+
try {
|
|
892
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
893
|
+
var key = _c.value;
|
|
894
|
+
_headers[key] = response.headers.get(key);
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
898
|
+
finally {
|
|
899
|
+
try {
|
|
900
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
901
|
+
}
|
|
902
|
+
finally { if (e_6) throw e_6.error; }
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
if (status === 200) {
|
|
906
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
907
|
+
var result200 = null;
|
|
908
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
909
|
+
return rxjs.of(result200);
|
|
910
|
+
}));
|
|
911
|
+
}
|
|
912
|
+
else if (status === 404) {
|
|
913
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
914
|
+
var result404 = null;
|
|
915
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
916
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
917
|
+
}));
|
|
918
|
+
}
|
|
919
|
+
else if (status === 401) {
|
|
920
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
921
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
922
|
+
}));
|
|
923
|
+
}
|
|
924
|
+
else if (status === 403) {
|
|
925
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
926
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
927
|
+
}));
|
|
928
|
+
}
|
|
929
|
+
else if (status !== 200 && status !== 204) {
|
|
930
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
931
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
932
|
+
}));
|
|
933
|
+
}
|
|
934
|
+
return rxjs.of(null);
|
|
935
|
+
};
|
|
936
|
+
/**
|
|
937
|
+
* Gets product specification by storefront product reference
|
|
938
|
+
* @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier
|
|
939
|
+
* @param storefrontId Storefront identifier
|
|
940
|
+
* @param tenantId (optional) Tenant identifier
|
|
941
|
+
* @param userId (optional) User identifier
|
|
942
|
+
* @return Success
|
|
943
|
+
*/
|
|
944
|
+
ProductReferencesApiClient.prototype.getProductSpecification = function (reference, storefrontId, tenantId, userId) {
|
|
945
|
+
var _this = this;
|
|
946
|
+
var url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-specification?";
|
|
947
|
+
if (reference === undefined || reference === null)
|
|
948
|
+
throw new Error("The parameter 'reference' must be defined.");
|
|
949
|
+
url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
|
|
950
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
951
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
952
|
+
else
|
|
953
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
954
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
955
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
956
|
+
if (userId !== undefined && userId !== null)
|
|
957
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
958
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
959
|
+
var options_ = {
|
|
960
|
+
observe: "response",
|
|
961
|
+
responseType: "blob",
|
|
962
|
+
headers: new i1.HttpHeaders({
|
|
963
|
+
"Accept": "text/plain"
|
|
964
|
+
})
|
|
965
|
+
};
|
|
966
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
967
|
+
return _this.http.request("get", url_, transformedOptions_);
|
|
968
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
969
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetProductSpecification(r); });
|
|
970
|
+
})).pipe(operators.catchError(function (response_) {
|
|
971
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
972
|
+
try {
|
|
973
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetProductSpecification(r); });
|
|
974
|
+
}
|
|
975
|
+
catch (e) {
|
|
976
|
+
return rxjs.throwError(e);
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
else
|
|
980
|
+
return rxjs.throwError(response_);
|
|
981
|
+
}));
|
|
982
|
+
};
|
|
983
|
+
ProductReferencesApiClient.prototype.processGetProductSpecification = function (response) {
|
|
984
|
+
var e_7, _a;
|
|
985
|
+
var _this = this;
|
|
986
|
+
var status = response.status;
|
|
987
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
988
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
989
|
+
var _headers = {};
|
|
990
|
+
if (response.headers) {
|
|
991
|
+
try {
|
|
992
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
993
|
+
var key = _c.value;
|
|
994
|
+
_headers[key] = response.headers.get(key);
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
998
|
+
finally {
|
|
999
|
+
try {
|
|
1000
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1001
|
+
}
|
|
1002
|
+
finally { if (e_7) throw e_7.error; }
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
if (status === 200) {
|
|
1006
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1007
|
+
var result200 = null;
|
|
1008
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1009
|
+
return rxjs.of(result200);
|
|
1010
|
+
}));
|
|
1011
|
+
}
|
|
1012
|
+
else if (status === 404) {
|
|
1013
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1014
|
+
var result404 = null;
|
|
1015
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1016
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1017
|
+
}));
|
|
1018
|
+
}
|
|
1019
|
+
else if (status === 401) {
|
|
1020
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1021
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1022
|
+
}));
|
|
1023
|
+
}
|
|
1024
|
+
else if (status === 403) {
|
|
1025
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1026
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1027
|
+
}));
|
|
1028
|
+
}
|
|
1029
|
+
else if (status !== 200 && status !== 204) {
|
|
1030
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1031
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1032
|
+
}));
|
|
1033
|
+
}
|
|
1034
|
+
return rxjs.of(null);
|
|
1035
|
+
};
|
|
1036
|
+
/**
|
|
1037
|
+
* Gets product configuration information by storefront product reference
|
|
1038
|
+
* @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier
|
|
1039
|
+
* @param storefrontId Storefront identifier
|
|
1040
|
+
* @param tenantId (optional) Tenant identifier
|
|
1041
|
+
* @param userId (optional) User identifier
|
|
1042
|
+
* @return Success
|
|
1043
|
+
*/
|
|
1044
|
+
ProductReferencesApiClient.prototype.getProductConfig = function (reference, storefrontId, tenantId, userId) {
|
|
1045
|
+
var _this = this;
|
|
1046
|
+
var url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-config?";
|
|
1047
|
+
if (reference === undefined || reference === null)
|
|
1048
|
+
throw new Error("The parameter 'reference' must be defined.");
|
|
1049
|
+
url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
|
|
1050
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
1051
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
1052
|
+
else
|
|
1053
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
1054
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1055
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1056
|
+
if (userId !== undefined && userId !== null)
|
|
1057
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
1058
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1059
|
+
var options_ = {
|
|
1060
|
+
observe: "response",
|
|
1061
|
+
responseType: "blob",
|
|
1062
|
+
headers: new i1.HttpHeaders({
|
|
1063
|
+
"Accept": "text/plain"
|
|
1064
|
+
})
|
|
1065
|
+
};
|
|
1066
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
1067
|
+
return _this.http.request("get", url_, transformedOptions_);
|
|
1068
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
1069
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetProductConfig(r); });
|
|
1070
|
+
})).pipe(operators.catchError(function (response_) {
|
|
1071
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
1072
|
+
try {
|
|
1073
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetProductConfig(r); });
|
|
1074
|
+
}
|
|
1075
|
+
catch (e) {
|
|
1076
|
+
return rxjs.throwError(e);
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
else
|
|
1080
|
+
return rxjs.throwError(response_);
|
|
1081
|
+
}));
|
|
1082
|
+
};
|
|
1083
|
+
ProductReferencesApiClient.prototype.processGetProductConfig = function (response) {
|
|
1084
|
+
var e_8, _a;
|
|
1085
|
+
var _this = this;
|
|
1086
|
+
var status = response.status;
|
|
1087
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
1088
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
1089
|
+
var _headers = {};
|
|
1090
|
+
if (response.headers) {
|
|
1091
|
+
try {
|
|
1092
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1093
|
+
var key = _c.value;
|
|
1094
|
+
_headers[key] = response.headers.get(key);
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
1098
|
+
finally {
|
|
1099
|
+
try {
|
|
1100
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1101
|
+
}
|
|
1102
|
+
finally { if (e_8) throw e_8.error; }
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
if (status === 200) {
|
|
1106
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1107
|
+
var result200 = null;
|
|
1108
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1109
|
+
return rxjs.of(result200);
|
|
1110
|
+
}));
|
|
1111
|
+
}
|
|
1112
|
+
else if (status === 404) {
|
|
1113
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1114
|
+
var result404 = null;
|
|
1115
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1116
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1117
|
+
}));
|
|
1118
|
+
}
|
|
1119
|
+
else if (status === 401) {
|
|
1120
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1121
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1122
|
+
}));
|
|
1123
|
+
}
|
|
1124
|
+
else if (status === 403) {
|
|
1125
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1126
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1127
|
+
}));
|
|
1128
|
+
}
|
|
1129
|
+
else if (status !== 200 && status !== 204) {
|
|
1130
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1131
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1132
|
+
}));
|
|
1133
|
+
}
|
|
1134
|
+
return rxjs.of(null);
|
|
1135
|
+
};
|
|
1136
|
+
return ProductReferencesApiClient;
|
|
1137
|
+
}(ApiClientBase));
|
|
1138
|
+
ProductReferencesApiClient.ɵprov = i0.ɵɵdefineInjectable({ factory: function ProductReferencesApiClient_Factory() { return new ProductReferencesApiClient(i0.ɵɵinject(ApiClientConfiguration), i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(API_BASE_URL, 8)); }, token: ProductReferencesApiClient, providedIn: "root" });
|
|
1139
|
+
ProductReferencesApiClient.decorators = [
|
|
1140
|
+
{ type: i0.Injectable, args: [{
|
|
1141
|
+
providedIn: 'root'
|
|
1142
|
+
},] }
|
|
1143
|
+
];
|
|
1144
|
+
ProductReferencesApiClient.ctorParameters = function () { return [
|
|
1145
|
+
{ type: ApiClientConfiguration, decorators: [{ type: i0.Inject, args: [ApiClientConfiguration,] }] },
|
|
1146
|
+
{ type: i1.HttpClient, decorators: [{ type: i0.Inject, args: [i1.HttpClient,] }] },
|
|
1147
|
+
{ type: String, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [API_BASE_URL,] }] }
|
|
1148
|
+
]; };
|
|
1149
|
+
var ProductSpecificationsApiClient = /** @class */ (function (_super) {
|
|
1150
|
+
__extends(ProductSpecificationsApiClient, _super);
|
|
1151
|
+
function ProductSpecificationsApiClient(configuration, http, baseUrl) {
|
|
1152
|
+
var _this = _super.call(this, configuration) || this;
|
|
1153
|
+
_this.jsonParseReviver = undefined;
|
|
1154
|
+
_this.http = http;
|
|
1155
|
+
_this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : _this.getBaseUrl("");
|
|
1156
|
+
return _this;
|
|
1157
|
+
}
|
|
1158
|
+
/**
|
|
1159
|
+
* Gets all product specifications relevant to specified query parameters
|
|
1160
|
+
* @param skip (optional) Defines page start offset from beginning of sorted result list
|
|
1161
|
+
* @param take (optional) Defines page length (how much consequent items of sorted result list should be taken)
|
|
1162
|
+
* @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC"
|
|
1163
|
+
* @param search (optional) Search string for partial match
|
|
1164
|
+
* @param tenantId (optional) Tenant identifier
|
|
1165
|
+
* @param userId (optional) User identifier
|
|
1166
|
+
* @return Success
|
|
1167
|
+
*/
|
|
1168
|
+
ProductSpecificationsApiClient.prototype.getAll = function (skip, take, sorting, search, tenantId, userId) {
|
|
1169
|
+
var _this = this;
|
|
1170
|
+
var url_ = this.baseUrl + "/api/storefront/v1/product-specifications?";
|
|
1171
|
+
if (skip !== undefined && skip !== null)
|
|
1172
|
+
url_ += "skip=" + encodeURIComponent("" + skip) + "&";
|
|
1173
|
+
if (take !== undefined && take !== null)
|
|
1174
|
+
url_ += "take=" + encodeURIComponent("" + take) + "&";
|
|
1175
|
+
if (sorting !== undefined && sorting !== null)
|
|
1176
|
+
url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
|
|
1177
|
+
if (search !== undefined && search !== null)
|
|
1178
|
+
url_ += "search=" + encodeURIComponent("" + search) + "&";
|
|
1179
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1180
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1181
|
+
if (userId !== undefined && userId !== null)
|
|
1182
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
1183
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1184
|
+
var options_ = {
|
|
1185
|
+
observe: "response",
|
|
1186
|
+
responseType: "blob",
|
|
1187
|
+
headers: new i1.HttpHeaders({
|
|
1188
|
+
"Accept": "text/plain"
|
|
1189
|
+
})
|
|
1190
|
+
};
|
|
1191
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
1192
|
+
return _this.http.request("get", url_, transformedOptions_);
|
|
1193
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
1194
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetAll(r); });
|
|
1195
|
+
})).pipe(operators.catchError(function (response_) {
|
|
1196
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
1197
|
+
try {
|
|
1198
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetAll(r); });
|
|
1199
|
+
}
|
|
1200
|
+
catch (e) {
|
|
1201
|
+
return rxjs.throwError(e);
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
else
|
|
1205
|
+
return rxjs.throwError(response_);
|
|
1206
|
+
}));
|
|
1207
|
+
};
|
|
1208
|
+
ProductSpecificationsApiClient.prototype.processGetAll = function (response) {
|
|
1209
|
+
var e_9, _a;
|
|
1210
|
+
var _this = this;
|
|
1211
|
+
var status = response.status;
|
|
1212
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
1213
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
1214
|
+
var _headers = {};
|
|
1215
|
+
if (response.headers) {
|
|
1216
|
+
try {
|
|
1217
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1218
|
+
var key = _c.value;
|
|
1219
|
+
_headers[key] = response.headers.get(key);
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
1223
|
+
finally {
|
|
1224
|
+
try {
|
|
1225
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1226
|
+
}
|
|
1227
|
+
finally { if (e_9) throw e_9.error; }
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
if (status === 200) {
|
|
1231
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1232
|
+
var result200 = null;
|
|
1233
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1234
|
+
return rxjs.of(result200);
|
|
1235
|
+
}));
|
|
1236
|
+
}
|
|
1237
|
+
else if (status === 401) {
|
|
1238
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1239
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1240
|
+
}));
|
|
1241
|
+
}
|
|
1242
|
+
else if (status === 403) {
|
|
1243
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1244
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1245
|
+
}));
|
|
1246
|
+
}
|
|
1247
|
+
else if (status !== 200 && status !== 204) {
|
|
1248
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1249
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1250
|
+
}));
|
|
1251
|
+
}
|
|
1252
|
+
return rxjs.of(null);
|
|
1253
|
+
};
|
|
1254
|
+
/**
|
|
1255
|
+
* Gets product specification by id
|
|
1256
|
+
* @param id Product specification identifier
|
|
1257
|
+
* @param tenantId (optional) Tenant identifier
|
|
1258
|
+
* @param userId (optional) User identifier
|
|
1259
|
+
* @return Success
|
|
1260
|
+
*/
|
|
1261
|
+
ProductSpecificationsApiClient.prototype.get = function (id, tenantId, userId) {
|
|
1262
|
+
var _this = this;
|
|
1263
|
+
var url_ = this.baseUrl + "/api/storefront/v1/product-specifications/{id}?";
|
|
1264
|
+
if (id === undefined || id === null)
|
|
1265
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1266
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1267
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1268
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1269
|
+
if (userId !== undefined && userId !== null)
|
|
1270
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
1271
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1272
|
+
var options_ = {
|
|
1273
|
+
observe: "response",
|
|
1274
|
+
responseType: "blob",
|
|
1275
|
+
headers: new i1.HttpHeaders({
|
|
1276
|
+
"Accept": "text/plain"
|
|
1277
|
+
})
|
|
1278
|
+
};
|
|
1279
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
1280
|
+
return _this.http.request("get", url_, transformedOptions_);
|
|
1281
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
1282
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGet(r); });
|
|
1283
|
+
})).pipe(operators.catchError(function (response_) {
|
|
1284
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
1285
|
+
try {
|
|
1286
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGet(r); });
|
|
1287
|
+
}
|
|
1288
|
+
catch (e) {
|
|
1289
|
+
return rxjs.throwError(e);
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1292
|
+
else
|
|
1293
|
+
return rxjs.throwError(response_);
|
|
1294
|
+
}));
|
|
1295
|
+
};
|
|
1296
|
+
ProductSpecificationsApiClient.prototype.processGet = function (response) {
|
|
1297
|
+
var e_10, _a;
|
|
1298
|
+
var _this = this;
|
|
1299
|
+
var status = response.status;
|
|
1300
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
1301
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
1302
|
+
var _headers = {};
|
|
1303
|
+
if (response.headers) {
|
|
1304
|
+
try {
|
|
1305
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1306
|
+
var key = _c.value;
|
|
1307
|
+
_headers[key] = response.headers.get(key);
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
1311
|
+
finally {
|
|
1312
|
+
try {
|
|
1313
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1314
|
+
}
|
|
1315
|
+
finally { if (e_10) throw e_10.error; }
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
if (status === 200) {
|
|
1319
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1320
|
+
var result200 = null;
|
|
1321
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1322
|
+
return rxjs.of(result200);
|
|
1323
|
+
}));
|
|
1324
|
+
}
|
|
1325
|
+
else if (status === 404) {
|
|
1326
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1327
|
+
var result404 = null;
|
|
1328
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1329
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1330
|
+
}));
|
|
1331
|
+
}
|
|
1332
|
+
else if (status === 401) {
|
|
1333
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1334
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1335
|
+
}));
|
|
1336
|
+
}
|
|
1337
|
+
else if (status === 403) {
|
|
1338
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1339
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1340
|
+
}));
|
|
1341
|
+
}
|
|
1342
|
+
else if (status !== 200 && status !== 204) {
|
|
1343
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1344
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1345
|
+
}));
|
|
1346
|
+
}
|
|
1347
|
+
return rxjs.of(null);
|
|
1348
|
+
};
|
|
1349
|
+
/**
|
|
1350
|
+
* Gets product configuration description by product specification id
|
|
1351
|
+
* @param id Product specification identifier
|
|
1352
|
+
* @param tenantId (optional) Tenant identifier
|
|
1353
|
+
* @param userId (optional) User identifier
|
|
1354
|
+
* @return Success
|
|
1355
|
+
*/
|
|
1356
|
+
ProductSpecificationsApiClient.prototype.getConfiguration = function (id, tenantId, userId) {
|
|
1357
|
+
var _this = this;
|
|
1358
|
+
var url_ = this.baseUrl + "/api/storefront/v1/product-specifications/{id}/config?";
|
|
1359
|
+
if (id === undefined || id === null)
|
|
1360
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1361
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1362
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1363
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1364
|
+
if (userId !== undefined && userId !== null)
|
|
1365
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
1366
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1367
|
+
var options_ = {
|
|
1368
|
+
observe: "response",
|
|
1369
|
+
responseType: "blob",
|
|
1370
|
+
headers: new i1.HttpHeaders({
|
|
1371
|
+
"Accept": "text/plain"
|
|
1372
|
+
})
|
|
1373
|
+
};
|
|
1374
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
1375
|
+
return _this.http.request("get", url_, transformedOptions_);
|
|
1376
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
1377
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetConfiguration(r); });
|
|
1378
|
+
})).pipe(operators.catchError(function (response_) {
|
|
1379
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
1380
|
+
try {
|
|
1381
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetConfiguration(r); });
|
|
1382
|
+
}
|
|
1383
|
+
catch (e) {
|
|
1384
|
+
return rxjs.throwError(e);
|
|
1385
|
+
}
|
|
1386
|
+
}
|
|
1387
|
+
else
|
|
1388
|
+
return rxjs.throwError(response_);
|
|
1389
|
+
}));
|
|
1390
|
+
};
|
|
1391
|
+
ProductSpecificationsApiClient.prototype.processGetConfiguration = function (response) {
|
|
1392
|
+
var e_11, _a;
|
|
1393
|
+
var _this = this;
|
|
1394
|
+
var status = response.status;
|
|
1395
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
1396
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
1397
|
+
var _headers = {};
|
|
1398
|
+
if (response.headers) {
|
|
1399
|
+
try {
|
|
1400
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1401
|
+
var key = _c.value;
|
|
1402
|
+
_headers[key] = response.headers.get(key);
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
catch (e_11_1) { e_11 = { error: e_11_1 }; }
|
|
1406
|
+
finally {
|
|
1407
|
+
try {
|
|
1408
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1409
|
+
}
|
|
1410
|
+
finally { if (e_11) throw e_11.error; }
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1413
|
+
if (status === 200) {
|
|
1414
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1415
|
+
var result200 = null;
|
|
1416
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1417
|
+
return rxjs.of(result200);
|
|
1418
|
+
}));
|
|
1419
|
+
}
|
|
1420
|
+
else if (status === 404) {
|
|
1421
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1422
|
+
var result404 = null;
|
|
1423
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1424
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1425
|
+
}));
|
|
1426
|
+
}
|
|
1427
|
+
else if (status === 401) {
|
|
1428
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1429
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1430
|
+
}));
|
|
1431
|
+
}
|
|
1432
|
+
else if (status === 403) {
|
|
1433
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1434
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1435
|
+
}));
|
|
1436
|
+
}
|
|
1437
|
+
else if (status !== 200 && status !== 204) {
|
|
1438
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1439
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1440
|
+
}));
|
|
1441
|
+
}
|
|
1442
|
+
return rxjs.of(null);
|
|
1443
|
+
};
|
|
1444
|
+
return ProductSpecificationsApiClient;
|
|
1445
|
+
}(ApiClientBase));
|
|
1446
|
+
ProductSpecificationsApiClient.ɵprov = i0.ɵɵdefineInjectable({ factory: function ProductSpecificationsApiClient_Factory() { return new ProductSpecificationsApiClient(i0.ɵɵinject(ApiClientConfiguration), i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(API_BASE_URL, 8)); }, token: ProductSpecificationsApiClient, providedIn: "root" });
|
|
1447
|
+
ProductSpecificationsApiClient.decorators = [
|
|
1448
|
+
{ type: i0.Injectable, args: [{
|
|
1449
|
+
providedIn: 'root'
|
|
1450
|
+
},] }
|
|
1451
|
+
];
|
|
1452
|
+
ProductSpecificationsApiClient.ctorParameters = function () { return [
|
|
1453
|
+
{ type: ApiClientConfiguration, decorators: [{ type: i0.Inject, args: [ApiClientConfiguration,] }] },
|
|
1454
|
+
{ type: i1.HttpClient, decorators: [{ type: i0.Inject, args: [i1.HttpClient,] }] },
|
|
1455
|
+
{ type: String, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [API_BASE_URL,] }] }
|
|
1456
|
+
]; };
|
|
1457
|
+
var ProjectsApiClient = /** @class */ (function (_super) {
|
|
1458
|
+
__extends(ProjectsApiClient, _super);
|
|
1459
|
+
function ProjectsApiClient(configuration, http, baseUrl) {
|
|
1460
|
+
var _this = _super.call(this, configuration) || this;
|
|
1461
|
+
_this.jsonParseReviver = undefined;
|
|
1462
|
+
_this.http = http;
|
|
1463
|
+
_this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : _this.getBaseUrl("");
|
|
1464
|
+
return _this;
|
|
1465
|
+
}
|
|
1466
|
+
/**
|
|
1467
|
+
* Gets all projects relevant to specified query parameters
|
|
1468
|
+
* @param storefrontId Storefront identifier
|
|
1469
|
+
* @param ownerId (optional) Project owner (storefront user id) filter
|
|
1470
|
+
* @param productReference (optional) Product reference filter
|
|
1471
|
+
* @param status (optional) Project status filter
|
|
1472
|
+
* @param datePeriod (optional) Project date period filter
|
|
1473
|
+
* @param skip (optional) Defines page start offset from beginning of sorted result list
|
|
1474
|
+
* @param take (optional) Defines page length (how much consequent items of sorted result list should be taken)
|
|
1475
|
+
* @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC"
|
|
1476
|
+
* @param search (optional) Search string for partial match
|
|
1477
|
+
* @param tenantId (optional) Tenant identifier
|
|
1478
|
+
* @param userId (optional) User identifier
|
|
1479
|
+
* @return Success
|
|
1480
|
+
*/
|
|
1481
|
+
ProjectsApiClient.prototype.getAll = function (storefrontId, ownerId, productReference, status, datePeriod, skip, take, sorting, search, tenantId, userId) {
|
|
1482
|
+
var _this = this;
|
|
1483
|
+
var url_ = this.baseUrl + "/api/storefront/v1/projects?";
|
|
1484
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
1485
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
1486
|
+
else
|
|
1487
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
1488
|
+
if (ownerId !== undefined && ownerId !== null)
|
|
1489
|
+
url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
|
|
1490
|
+
if (productReference !== undefined && productReference !== null)
|
|
1491
|
+
url_ += "productReference=" + encodeURIComponent("" + productReference) + "&";
|
|
1492
|
+
if (status !== undefined && status !== null)
|
|
1493
|
+
url_ += "status=" + encodeURIComponent("" + status) + "&";
|
|
1494
|
+
if (datePeriod === null)
|
|
1495
|
+
throw new Error("The parameter 'datePeriod' cannot be null.");
|
|
1496
|
+
else if (datePeriod !== undefined)
|
|
1497
|
+
url_ += "datePeriod=" + encodeURIComponent("" + datePeriod) + "&";
|
|
1498
|
+
if (skip !== undefined && skip !== null)
|
|
1499
|
+
url_ += "skip=" + encodeURIComponent("" + skip) + "&";
|
|
1500
|
+
if (take !== undefined && take !== null)
|
|
1501
|
+
url_ += "take=" + encodeURIComponent("" + take) + "&";
|
|
1502
|
+
if (sorting !== undefined && sorting !== null)
|
|
1503
|
+
url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
|
|
1504
|
+
if (search !== undefined && search !== null)
|
|
1505
|
+
url_ += "search=" + encodeURIComponent("" + search) + "&";
|
|
1506
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1507
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1508
|
+
if (userId !== undefined && userId !== null)
|
|
1509
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
1510
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1511
|
+
var options_ = {
|
|
1512
|
+
observe: "response",
|
|
1513
|
+
responseType: "blob",
|
|
1514
|
+
headers: new i1.HttpHeaders({
|
|
1515
|
+
"Accept": "text/plain"
|
|
1516
|
+
})
|
|
1517
|
+
};
|
|
1518
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
1519
|
+
return _this.http.request("get", url_, transformedOptions_);
|
|
1520
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
1521
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetAll(r); });
|
|
1522
|
+
})).pipe(operators.catchError(function (response_) {
|
|
1523
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
1524
|
+
try {
|
|
1525
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetAll(r); });
|
|
1526
|
+
}
|
|
1527
|
+
catch (e) {
|
|
1528
|
+
return rxjs.throwError(e);
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1531
|
+
else
|
|
1532
|
+
return rxjs.throwError(response_);
|
|
1533
|
+
}));
|
|
1534
|
+
};
|
|
1535
|
+
ProjectsApiClient.prototype.processGetAll = function (response) {
|
|
1536
|
+
var e_12, _a;
|
|
1537
|
+
var _this = this;
|
|
1538
|
+
var status = response.status;
|
|
1539
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
1540
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
1541
|
+
var _headers = {};
|
|
1542
|
+
if (response.headers) {
|
|
1543
|
+
try {
|
|
1544
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1545
|
+
var key = _c.value;
|
|
1546
|
+
_headers[key] = response.headers.get(key);
|
|
1547
|
+
}
|
|
1548
|
+
}
|
|
1549
|
+
catch (e_12_1) { e_12 = { error: e_12_1 }; }
|
|
1550
|
+
finally {
|
|
1551
|
+
try {
|
|
1552
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1553
|
+
}
|
|
1554
|
+
finally { if (e_12) throw e_12.error; }
|
|
1555
|
+
}
|
|
1556
|
+
}
|
|
1557
|
+
if (status === 200) {
|
|
1558
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1559
|
+
var result200 = null;
|
|
1560
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1561
|
+
return rxjs.of(result200);
|
|
1562
|
+
}));
|
|
1563
|
+
}
|
|
1564
|
+
else if (status === 401) {
|
|
1565
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1566
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1567
|
+
}));
|
|
1568
|
+
}
|
|
1569
|
+
else if (status === 403) {
|
|
1570
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1571
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1572
|
+
}));
|
|
1573
|
+
}
|
|
1574
|
+
else if (status !== 200 && status !== 204) {
|
|
1575
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1576
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1577
|
+
}));
|
|
1578
|
+
}
|
|
1579
|
+
return rxjs.of(null);
|
|
1580
|
+
};
|
|
1581
|
+
/**
|
|
1582
|
+
* Creates new project
|
|
1583
|
+
* @param storefrontId Storefront identifier
|
|
1584
|
+
* @param tenantId (optional) Tenant identifier
|
|
1585
|
+
* @param userId (optional) User identifier
|
|
1586
|
+
* @param body (optional) Create operation parameters
|
|
1587
|
+
* @return Success
|
|
1588
|
+
*/
|
|
1589
|
+
ProjectsApiClient.prototype.create = function (storefrontId, tenantId, userId, body) {
|
|
1590
|
+
var _this = this;
|
|
1591
|
+
var url_ = this.baseUrl + "/api/storefront/v1/projects?";
|
|
1592
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
1593
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
1594
|
+
else
|
|
1595
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
1596
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1597
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1598
|
+
if (userId !== undefined && userId !== null)
|
|
1599
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
1600
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1601
|
+
var content_ = JSON.stringify(body);
|
|
1602
|
+
var options_ = {
|
|
1603
|
+
body: content_,
|
|
1604
|
+
observe: "response",
|
|
1605
|
+
responseType: "blob",
|
|
1606
|
+
headers: new i1.HttpHeaders({
|
|
1607
|
+
"Content-Type": "application/json-patch+json",
|
|
1608
|
+
"Accept": "text/plain"
|
|
1609
|
+
})
|
|
1610
|
+
};
|
|
1611
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
1612
|
+
return _this.http.request("post", url_, transformedOptions_);
|
|
1613
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
1614
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processCreate(r); });
|
|
1615
|
+
})).pipe(operators.catchError(function (response_) {
|
|
1616
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
1617
|
+
try {
|
|
1618
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processCreate(r); });
|
|
1619
|
+
}
|
|
1620
|
+
catch (e) {
|
|
1621
|
+
return rxjs.throwError(e);
|
|
1622
|
+
}
|
|
1623
|
+
}
|
|
1624
|
+
else
|
|
1625
|
+
return rxjs.throwError(response_);
|
|
1626
|
+
}));
|
|
1627
|
+
};
|
|
1628
|
+
ProjectsApiClient.prototype.processCreate = function (response) {
|
|
1629
|
+
var e_13, _a;
|
|
1630
|
+
var _this = this;
|
|
1631
|
+
var status = response.status;
|
|
1632
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
1633
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
1634
|
+
var _headers = {};
|
|
1635
|
+
if (response.headers) {
|
|
1636
|
+
try {
|
|
1637
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1638
|
+
var key = _c.value;
|
|
1639
|
+
_headers[key] = response.headers.get(key);
|
|
1640
|
+
}
|
|
1641
|
+
}
|
|
1642
|
+
catch (e_13_1) { e_13 = { error: e_13_1 }; }
|
|
1643
|
+
finally {
|
|
1644
|
+
try {
|
|
1645
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1646
|
+
}
|
|
1647
|
+
finally { if (e_13) throw e_13.error; }
|
|
1648
|
+
}
|
|
1649
|
+
}
|
|
1650
|
+
if (status === 201) {
|
|
1651
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1652
|
+
var result201 = null;
|
|
1653
|
+
result201 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1654
|
+
return rxjs.of(result201);
|
|
1655
|
+
}));
|
|
1656
|
+
}
|
|
1657
|
+
else if (status === 409) {
|
|
1658
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1659
|
+
var result409 = null;
|
|
1660
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1661
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1662
|
+
}));
|
|
1663
|
+
}
|
|
1664
|
+
else if (status === 401) {
|
|
1665
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1666
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1667
|
+
}));
|
|
1668
|
+
}
|
|
1669
|
+
else if (status === 403) {
|
|
1670
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1671
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1672
|
+
}));
|
|
1673
|
+
}
|
|
1674
|
+
else if (status !== 200 && status !== 204) {
|
|
1675
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1676
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1677
|
+
}));
|
|
1678
|
+
}
|
|
1679
|
+
return rxjs.of(null);
|
|
1680
|
+
};
|
|
1681
|
+
/**
|
|
1682
|
+
* Gets project by id
|
|
1683
|
+
* @param id Project identifier
|
|
1684
|
+
* @param tenantId (optional) Tenant identifier
|
|
1685
|
+
* @param userId (optional) User identifier
|
|
1686
|
+
* @return Success
|
|
1687
|
+
*/
|
|
1688
|
+
ProjectsApiClient.prototype.get = function (id, tenantId, userId) {
|
|
1689
|
+
var _this = this;
|
|
1690
|
+
var url_ = this.baseUrl + "/api/storefront/v1/projects/{id}?";
|
|
1691
|
+
if (id === undefined || id === null)
|
|
1692
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1693
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1694
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1695
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1696
|
+
if (userId !== undefined && userId !== null)
|
|
1697
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
1698
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1699
|
+
var options_ = {
|
|
1700
|
+
observe: "response",
|
|
1701
|
+
responseType: "blob",
|
|
1702
|
+
headers: new i1.HttpHeaders({
|
|
1703
|
+
"Accept": "text/plain"
|
|
1704
|
+
})
|
|
1705
|
+
};
|
|
1706
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
1707
|
+
return _this.http.request("get", url_, transformedOptions_);
|
|
1708
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
1709
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGet(r); });
|
|
1710
|
+
})).pipe(operators.catchError(function (response_) {
|
|
1711
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
1712
|
+
try {
|
|
1713
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGet(r); });
|
|
1714
|
+
}
|
|
1715
|
+
catch (e) {
|
|
1716
|
+
return rxjs.throwError(e);
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
else
|
|
1720
|
+
return rxjs.throwError(response_);
|
|
1721
|
+
}));
|
|
1722
|
+
};
|
|
1723
|
+
ProjectsApiClient.prototype.processGet = function (response) {
|
|
1724
|
+
var e_14, _a;
|
|
1725
|
+
var _this = this;
|
|
1726
|
+
var status = response.status;
|
|
1727
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
1728
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
1729
|
+
var _headers = {};
|
|
1730
|
+
if (response.headers) {
|
|
1731
|
+
try {
|
|
1732
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1733
|
+
var key = _c.value;
|
|
1734
|
+
_headers[key] = response.headers.get(key);
|
|
1735
|
+
}
|
|
1736
|
+
}
|
|
1737
|
+
catch (e_14_1) { e_14 = { error: e_14_1 }; }
|
|
1738
|
+
finally {
|
|
1739
|
+
try {
|
|
1740
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1741
|
+
}
|
|
1742
|
+
finally { if (e_14) throw e_14.error; }
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
if (status === 200) {
|
|
1746
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1747
|
+
var result200 = null;
|
|
1748
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1749
|
+
return rxjs.of(result200);
|
|
1750
|
+
}));
|
|
1751
|
+
}
|
|
1752
|
+
else if (status === 404) {
|
|
1753
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1754
|
+
var result404 = null;
|
|
1755
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1756
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1757
|
+
}));
|
|
1758
|
+
}
|
|
1759
|
+
else if (status === 401) {
|
|
1760
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1761
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1762
|
+
}));
|
|
1763
|
+
}
|
|
1764
|
+
else if (status === 403) {
|
|
1765
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1766
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1767
|
+
}));
|
|
1768
|
+
}
|
|
1769
|
+
else if (status !== 200 && status !== 204) {
|
|
1770
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1771
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1772
|
+
}));
|
|
1773
|
+
}
|
|
1774
|
+
return rxjs.of(null);
|
|
1775
|
+
};
|
|
1776
|
+
/**
|
|
1777
|
+
* Gets available project transitions
|
|
1778
|
+
* @param id Project identifier
|
|
1779
|
+
* @param tenantId (optional) Tenant identifier
|
|
1780
|
+
* @param userId (optional) User identifier
|
|
1781
|
+
* @return Success
|
|
1782
|
+
*/
|
|
1783
|
+
ProjectsApiClient.prototype.getAvailableTransitions = function (id, tenantId, userId) {
|
|
1784
|
+
var _this = this;
|
|
1785
|
+
var url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/transitions?";
|
|
1786
|
+
if (id === undefined || id === null)
|
|
1787
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1788
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1789
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1790
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1791
|
+
if (userId !== undefined && userId !== null)
|
|
1792
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
1793
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1794
|
+
var options_ = {
|
|
1795
|
+
observe: "response",
|
|
1796
|
+
responseType: "blob",
|
|
1797
|
+
headers: new i1.HttpHeaders({
|
|
1798
|
+
"Accept": "text/plain"
|
|
1799
|
+
})
|
|
1800
|
+
};
|
|
1801
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
1802
|
+
return _this.http.request("get", url_, transformedOptions_);
|
|
1803
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
1804
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetAvailableTransitions(r); });
|
|
1805
|
+
})).pipe(operators.catchError(function (response_) {
|
|
1806
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
1807
|
+
try {
|
|
1808
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetAvailableTransitions(r); });
|
|
1809
|
+
}
|
|
1810
|
+
catch (e) {
|
|
1811
|
+
return rxjs.throwError(e);
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
else
|
|
1815
|
+
return rxjs.throwError(response_);
|
|
1816
|
+
}));
|
|
1817
|
+
};
|
|
1818
|
+
ProjectsApiClient.prototype.processGetAvailableTransitions = function (response) {
|
|
1819
|
+
var e_15, _a;
|
|
1820
|
+
var _this = this;
|
|
1821
|
+
var status = response.status;
|
|
1822
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
1823
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
1824
|
+
var _headers = {};
|
|
1825
|
+
if (response.headers) {
|
|
1826
|
+
try {
|
|
1827
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1828
|
+
var key = _c.value;
|
|
1829
|
+
_headers[key] = response.headers.get(key);
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
1832
|
+
catch (e_15_1) { e_15 = { error: e_15_1 }; }
|
|
1833
|
+
finally {
|
|
1834
|
+
try {
|
|
1835
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1836
|
+
}
|
|
1837
|
+
finally { if (e_15) throw e_15.error; }
|
|
1838
|
+
}
|
|
1839
|
+
}
|
|
1840
|
+
if (status === 200) {
|
|
1841
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1842
|
+
var result200 = null;
|
|
1843
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1844
|
+
return rxjs.of(result200);
|
|
1845
|
+
}));
|
|
1846
|
+
}
|
|
1847
|
+
else if (status === 400) {
|
|
1848
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1849
|
+
var result400 = null;
|
|
1850
|
+
result400 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1851
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
1852
|
+
}));
|
|
1853
|
+
}
|
|
1854
|
+
else if (status === 404) {
|
|
1855
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1856
|
+
var result404 = null;
|
|
1857
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1858
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1859
|
+
}));
|
|
1860
|
+
}
|
|
1861
|
+
else if (status === 409) {
|
|
1862
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1863
|
+
var result409 = null;
|
|
1864
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1865
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1866
|
+
}));
|
|
1867
|
+
}
|
|
1868
|
+
else if (status === 401) {
|
|
1869
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1870
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1871
|
+
}));
|
|
1872
|
+
}
|
|
1873
|
+
else if (status === 403) {
|
|
1874
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1875
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1876
|
+
}));
|
|
1877
|
+
}
|
|
1878
|
+
else if (status !== 200 && status !== 204) {
|
|
1879
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1880
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1881
|
+
}));
|
|
1882
|
+
}
|
|
1883
|
+
return rxjs.of(null);
|
|
1884
|
+
};
|
|
1885
|
+
/**
|
|
1886
|
+
* Changes project status
|
|
1887
|
+
* @param id Project identifier
|
|
1888
|
+
* @param transition Transition identifying name
|
|
1889
|
+
* @param tenantId (optional) Tenant identifier
|
|
1890
|
+
* @param userId (optional) User identifier
|
|
1891
|
+
* @return Success
|
|
1892
|
+
*/
|
|
1893
|
+
ProjectsApiClient.prototype.changeStatus = function (id, transition, tenantId, userId) {
|
|
1894
|
+
var _this = this;
|
|
1895
|
+
var url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/transitions/{transition}?";
|
|
1896
|
+
if (id === undefined || id === null)
|
|
1897
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1898
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1899
|
+
if (transition === undefined || transition === null)
|
|
1900
|
+
throw new Error("The parameter 'transition' must be defined.");
|
|
1901
|
+
url_ = url_.replace("{transition}", encodeURIComponent("" + transition));
|
|
1902
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1903
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1904
|
+
if (userId !== undefined && userId !== null)
|
|
1905
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
1906
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1907
|
+
var options_ = {
|
|
1908
|
+
observe: "response",
|
|
1909
|
+
responseType: "blob",
|
|
1910
|
+
headers: new i1.HttpHeaders({
|
|
1911
|
+
"Accept": "text/plain"
|
|
1912
|
+
})
|
|
1913
|
+
};
|
|
1914
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
1915
|
+
return _this.http.request("post", url_, transformedOptions_);
|
|
1916
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
1917
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processChangeStatus(r); });
|
|
1918
|
+
})).pipe(operators.catchError(function (response_) {
|
|
1919
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
1920
|
+
try {
|
|
1921
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processChangeStatus(r); });
|
|
1922
|
+
}
|
|
1923
|
+
catch (e) {
|
|
1924
|
+
return rxjs.throwError(e);
|
|
1925
|
+
}
|
|
1926
|
+
}
|
|
1927
|
+
else
|
|
1928
|
+
return rxjs.throwError(response_);
|
|
1929
|
+
}));
|
|
1930
|
+
};
|
|
1931
|
+
ProjectsApiClient.prototype.processChangeStatus = function (response) {
|
|
1932
|
+
var e_16, _a;
|
|
1933
|
+
var _this = this;
|
|
1934
|
+
var status = response.status;
|
|
1935
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
1936
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
1937
|
+
var _headers = {};
|
|
1938
|
+
if (response.headers) {
|
|
1939
|
+
try {
|
|
1940
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1941
|
+
var key = _c.value;
|
|
1942
|
+
_headers[key] = response.headers.get(key);
|
|
1943
|
+
}
|
|
1944
|
+
}
|
|
1945
|
+
catch (e_16_1) { e_16 = { error: e_16_1 }; }
|
|
1946
|
+
finally {
|
|
1947
|
+
try {
|
|
1948
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1949
|
+
}
|
|
1950
|
+
finally { if (e_16) throw e_16.error; }
|
|
1951
|
+
}
|
|
1952
|
+
}
|
|
1953
|
+
if (status === 200) {
|
|
1954
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1955
|
+
var result200 = null;
|
|
1956
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1957
|
+
return rxjs.of(result200);
|
|
1958
|
+
}));
|
|
1959
|
+
}
|
|
1960
|
+
else if (status === 400) {
|
|
1961
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1962
|
+
var result400 = null;
|
|
1963
|
+
result400 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1964
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
1965
|
+
}));
|
|
1966
|
+
}
|
|
1967
|
+
else if (status === 404) {
|
|
1968
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1969
|
+
var result404 = null;
|
|
1970
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1971
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1972
|
+
}));
|
|
1973
|
+
}
|
|
1974
|
+
else if (status === 409) {
|
|
1975
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1976
|
+
var result409 = null;
|
|
1977
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1978
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1979
|
+
}));
|
|
1980
|
+
}
|
|
1981
|
+
else if (status === 401) {
|
|
1982
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1983
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1984
|
+
}));
|
|
1985
|
+
}
|
|
1986
|
+
else if (status === 403) {
|
|
1987
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1988
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1989
|
+
}));
|
|
1990
|
+
}
|
|
1991
|
+
else if (status !== 200 && status !== 204) {
|
|
1992
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
1993
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1994
|
+
}));
|
|
1995
|
+
}
|
|
1996
|
+
return rxjs.of(null);
|
|
1997
|
+
};
|
|
1998
|
+
/**
|
|
1999
|
+
* Force changes project status
|
|
2000
|
+
* @param id Project identifier
|
|
2001
|
+
* @param status Project status code
|
|
2002
|
+
* @param tenantId (optional) Tenant identifier
|
|
2003
|
+
* @param userId (optional) User identifier
|
|
2004
|
+
* @return Success
|
|
2005
|
+
*/
|
|
2006
|
+
ProjectsApiClient.prototype.forceStatus = function (id, status, tenantId, userId) {
|
|
2007
|
+
var _this = this;
|
|
2008
|
+
var url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/statuses/{status}?";
|
|
2009
|
+
if (id === undefined || id === null)
|
|
2010
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2011
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2012
|
+
if (status === undefined || status === null)
|
|
2013
|
+
throw new Error("The parameter 'status' must be defined.");
|
|
2014
|
+
url_ = url_.replace("{status}", encodeURIComponent("" + status));
|
|
2015
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2016
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2017
|
+
if (userId !== undefined && userId !== null)
|
|
2018
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
2019
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2020
|
+
var options_ = {
|
|
2021
|
+
observe: "response",
|
|
2022
|
+
responseType: "blob",
|
|
2023
|
+
headers: new i1.HttpHeaders({
|
|
2024
|
+
"Accept": "text/plain"
|
|
2025
|
+
})
|
|
2026
|
+
};
|
|
2027
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
2028
|
+
return _this.http.request("post", url_, transformedOptions_);
|
|
2029
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
2030
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processForceStatus(r); });
|
|
2031
|
+
})).pipe(operators.catchError(function (response_) {
|
|
2032
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
2033
|
+
try {
|
|
2034
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processForceStatus(r); });
|
|
2035
|
+
}
|
|
2036
|
+
catch (e) {
|
|
2037
|
+
return rxjs.throwError(e);
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
else
|
|
2041
|
+
return rxjs.throwError(response_);
|
|
2042
|
+
}));
|
|
2043
|
+
};
|
|
2044
|
+
ProjectsApiClient.prototype.processForceStatus = function (response) {
|
|
2045
|
+
var e_17, _a;
|
|
2046
|
+
var _this = this;
|
|
2047
|
+
var status = response.status;
|
|
2048
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
2049
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2050
|
+
var _headers = {};
|
|
2051
|
+
if (response.headers) {
|
|
2052
|
+
try {
|
|
2053
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
2054
|
+
var key = _c.value;
|
|
2055
|
+
_headers[key] = response.headers.get(key);
|
|
2056
|
+
}
|
|
2057
|
+
}
|
|
2058
|
+
catch (e_17_1) { e_17 = { error: e_17_1 }; }
|
|
2059
|
+
finally {
|
|
2060
|
+
try {
|
|
2061
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2062
|
+
}
|
|
2063
|
+
finally { if (e_17) throw e_17.error; }
|
|
2064
|
+
}
|
|
2065
|
+
}
|
|
2066
|
+
if (status === 200) {
|
|
2067
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2068
|
+
var result200 = null;
|
|
2069
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
2070
|
+
return rxjs.of(result200);
|
|
2071
|
+
}));
|
|
2072
|
+
}
|
|
2073
|
+
else if (status === 400) {
|
|
2074
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2075
|
+
var result400 = null;
|
|
2076
|
+
result400 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
2077
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
2078
|
+
}));
|
|
2079
|
+
}
|
|
2080
|
+
else if (status === 404) {
|
|
2081
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2082
|
+
var result404 = null;
|
|
2083
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
2084
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2085
|
+
}));
|
|
2086
|
+
}
|
|
2087
|
+
else if (status === 401) {
|
|
2088
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2089
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2090
|
+
}));
|
|
2091
|
+
}
|
|
2092
|
+
else if (status === 403) {
|
|
2093
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2094
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2095
|
+
}));
|
|
2096
|
+
}
|
|
2097
|
+
else if (status !== 200 && status !== 204) {
|
|
2098
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2099
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2100
|
+
}));
|
|
2101
|
+
}
|
|
2102
|
+
return rxjs.of(null);
|
|
2103
|
+
};
|
|
2104
|
+
/**
|
|
2105
|
+
* Gets all project statuses
|
|
2106
|
+
* @param tenantId (optional) Tenant identifier
|
|
2107
|
+
* @param userId (optional) User identifier
|
|
2108
|
+
* @return Success
|
|
2109
|
+
*/
|
|
2110
|
+
ProjectsApiClient.prototype.getAllStatuses = function (tenantId, userId) {
|
|
2111
|
+
var _this = this;
|
|
2112
|
+
var url_ = this.baseUrl + "/api/storefront/v1/projects/statuses?";
|
|
2113
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2114
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2115
|
+
if (userId !== undefined && userId !== null)
|
|
2116
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
2117
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2118
|
+
var options_ = {
|
|
2119
|
+
observe: "response",
|
|
2120
|
+
responseType: "blob",
|
|
2121
|
+
headers: new i1.HttpHeaders({
|
|
2122
|
+
"Accept": "text/plain"
|
|
2123
|
+
})
|
|
2124
|
+
};
|
|
2125
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
2126
|
+
return _this.http.request("get", url_, transformedOptions_);
|
|
2127
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
2128
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetAllStatuses(r); });
|
|
2129
|
+
})).pipe(operators.catchError(function (response_) {
|
|
2130
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
2131
|
+
try {
|
|
2132
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetAllStatuses(r); });
|
|
2133
|
+
}
|
|
2134
|
+
catch (e) {
|
|
2135
|
+
return rxjs.throwError(e);
|
|
2136
|
+
}
|
|
2137
|
+
}
|
|
2138
|
+
else
|
|
2139
|
+
return rxjs.throwError(response_);
|
|
2140
|
+
}));
|
|
2141
|
+
};
|
|
2142
|
+
ProjectsApiClient.prototype.processGetAllStatuses = function (response) {
|
|
2143
|
+
var e_18, _a;
|
|
2144
|
+
var _this = this;
|
|
2145
|
+
var status = response.status;
|
|
2146
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
2147
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2148
|
+
var _headers = {};
|
|
2149
|
+
if (response.headers) {
|
|
2150
|
+
try {
|
|
2151
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
2152
|
+
var key = _c.value;
|
|
2153
|
+
_headers[key] = response.headers.get(key);
|
|
2154
|
+
}
|
|
2155
|
+
}
|
|
2156
|
+
catch (e_18_1) { e_18 = { error: e_18_1 }; }
|
|
2157
|
+
finally {
|
|
2158
|
+
try {
|
|
2159
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2160
|
+
}
|
|
2161
|
+
finally { if (e_18) throw e_18.error; }
|
|
2162
|
+
}
|
|
2163
|
+
}
|
|
2164
|
+
if (status === 200) {
|
|
2165
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2166
|
+
var result200 = null;
|
|
2167
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
2168
|
+
return rxjs.of(result200);
|
|
2169
|
+
}));
|
|
2170
|
+
}
|
|
2171
|
+
else if (status === 401) {
|
|
2172
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2173
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2174
|
+
}));
|
|
2175
|
+
}
|
|
2176
|
+
else if (status === 403) {
|
|
2177
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2178
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2179
|
+
}));
|
|
2180
|
+
}
|
|
2181
|
+
else if (status !== 200 && status !== 204) {
|
|
2182
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2183
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2184
|
+
}));
|
|
2185
|
+
}
|
|
2186
|
+
return rxjs.of(null);
|
|
2187
|
+
};
|
|
2188
|
+
/**
|
|
2189
|
+
* Gets all project transitions
|
|
2190
|
+
* @param tenantId (optional) Tenant identifier
|
|
2191
|
+
* @param userId (optional) User identifier
|
|
2192
|
+
* @return Success
|
|
2193
|
+
*/
|
|
2194
|
+
ProjectsApiClient.prototype.getAllTransitions = function (tenantId, userId) {
|
|
2195
|
+
var _this = this;
|
|
2196
|
+
var url_ = this.baseUrl + "/api/storefront/v1/projects/transitions?";
|
|
2197
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2198
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2199
|
+
if (userId !== undefined && userId !== null)
|
|
2200
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
2201
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2202
|
+
var options_ = {
|
|
2203
|
+
observe: "response",
|
|
2204
|
+
responseType: "blob",
|
|
2205
|
+
headers: new i1.HttpHeaders({
|
|
2206
|
+
"Accept": "text/plain"
|
|
2207
|
+
})
|
|
2208
|
+
};
|
|
2209
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
2210
|
+
return _this.http.request("get", url_, transformedOptions_);
|
|
2211
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
2212
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetAllTransitions(r); });
|
|
2213
|
+
})).pipe(operators.catchError(function (response_) {
|
|
2214
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
2215
|
+
try {
|
|
2216
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetAllTransitions(r); });
|
|
2217
|
+
}
|
|
2218
|
+
catch (e) {
|
|
2219
|
+
return rxjs.throwError(e);
|
|
2220
|
+
}
|
|
2221
|
+
}
|
|
2222
|
+
else
|
|
2223
|
+
return rxjs.throwError(response_);
|
|
2224
|
+
}));
|
|
2225
|
+
};
|
|
2226
|
+
ProjectsApiClient.prototype.processGetAllTransitions = function (response) {
|
|
2227
|
+
var e_19, _a;
|
|
2228
|
+
var _this = this;
|
|
2229
|
+
var status = response.status;
|
|
2230
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
2231
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2232
|
+
var _headers = {};
|
|
2233
|
+
if (response.headers) {
|
|
2234
|
+
try {
|
|
2235
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
2236
|
+
var key = _c.value;
|
|
2237
|
+
_headers[key] = response.headers.get(key);
|
|
2238
|
+
}
|
|
2239
|
+
}
|
|
2240
|
+
catch (e_19_1) { e_19 = { error: e_19_1 }; }
|
|
2241
|
+
finally {
|
|
2242
|
+
try {
|
|
2243
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2244
|
+
}
|
|
2245
|
+
finally { if (e_19) throw e_19.error; }
|
|
2246
|
+
}
|
|
2247
|
+
}
|
|
2248
|
+
if (status === 200) {
|
|
2249
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2250
|
+
var result200 = null;
|
|
2251
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
2252
|
+
return rxjs.of(result200);
|
|
2253
|
+
}));
|
|
2254
|
+
}
|
|
2255
|
+
else if (status === 401) {
|
|
2256
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2257
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2258
|
+
}));
|
|
2259
|
+
}
|
|
2260
|
+
else if (status === 403) {
|
|
2261
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2262
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2263
|
+
}));
|
|
2264
|
+
}
|
|
2265
|
+
else if (status !== 200 && status !== 204) {
|
|
2266
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2267
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2268
|
+
}));
|
|
2269
|
+
}
|
|
2270
|
+
return rxjs.of(null);
|
|
2271
|
+
};
|
|
2272
|
+
/**
|
|
2273
|
+
* Gets project pdf url
|
|
2274
|
+
* @param id Project unique identifier
|
|
2275
|
+
* @param designUserId User identifier
|
|
2276
|
+
* @param designId Design identifier
|
|
2277
|
+
* @param tenantId (optional) Tenant identifier
|
|
2278
|
+
* @param userId (optional) User identifier
|
|
2279
|
+
* @return Success
|
|
2280
|
+
*/
|
|
2281
|
+
ProjectsApiClient.prototype.getProjectPdfUrl = function (id, designUserId, designId, tenantId, userId) {
|
|
2282
|
+
var _this = this;
|
|
2283
|
+
var url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/project-pdf?";
|
|
2284
|
+
if (id === undefined || id === null)
|
|
2285
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2286
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2287
|
+
if (designUserId === undefined || designUserId === null)
|
|
2288
|
+
throw new Error("The parameter 'designUserId' must be defined and cannot be null.");
|
|
2289
|
+
else
|
|
2290
|
+
url_ += "designUserId=" + encodeURIComponent("" + designUserId) + "&";
|
|
2291
|
+
if (designId === undefined || designId === null)
|
|
2292
|
+
throw new Error("The parameter 'designId' must be defined and cannot be null.");
|
|
2293
|
+
else
|
|
2294
|
+
url_ += "designId=" + encodeURIComponent("" + designId) + "&";
|
|
2295
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2296
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2297
|
+
if (userId !== undefined && userId !== null)
|
|
2298
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
2299
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2300
|
+
var options_ = {
|
|
2301
|
+
observe: "response",
|
|
2302
|
+
responseType: "blob",
|
|
2303
|
+
headers: new i1.HttpHeaders({
|
|
2304
|
+
"Accept": "text/plain"
|
|
2305
|
+
})
|
|
2306
|
+
};
|
|
2307
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
2308
|
+
return _this.http.request("get", url_, transformedOptions_);
|
|
2309
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
2310
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetProjectPdfUrl(r); });
|
|
2311
|
+
})).pipe(operators.catchError(function (response_) {
|
|
2312
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
2313
|
+
try {
|
|
2314
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetProjectPdfUrl(r); });
|
|
2315
|
+
}
|
|
2316
|
+
catch (e) {
|
|
2317
|
+
return rxjs.throwError(e);
|
|
2318
|
+
}
|
|
2319
|
+
}
|
|
2320
|
+
else
|
|
2321
|
+
return rxjs.throwError(response_);
|
|
2322
|
+
}));
|
|
2323
|
+
};
|
|
2324
|
+
ProjectsApiClient.prototype.processGetProjectPdfUrl = function (response) {
|
|
2325
|
+
var e_20, _a;
|
|
2326
|
+
var _this = this;
|
|
2327
|
+
var status = response.status;
|
|
2328
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
2329
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2330
|
+
var _headers = {};
|
|
2331
|
+
if (response.headers) {
|
|
2332
|
+
try {
|
|
2333
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
2334
|
+
var key = _c.value;
|
|
2335
|
+
_headers[key] = response.headers.get(key);
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
catch (e_20_1) { e_20 = { error: e_20_1 }; }
|
|
2339
|
+
finally {
|
|
2340
|
+
try {
|
|
2341
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2342
|
+
}
|
|
2343
|
+
finally { if (e_20) throw e_20.error; }
|
|
2344
|
+
}
|
|
2345
|
+
}
|
|
2346
|
+
if (status === 200) {
|
|
2347
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2348
|
+
var result200 = null;
|
|
2349
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
2350
|
+
return rxjs.of(result200);
|
|
2351
|
+
}));
|
|
2352
|
+
}
|
|
2353
|
+
else if (status === 401) {
|
|
2354
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2355
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2356
|
+
}));
|
|
2357
|
+
}
|
|
2358
|
+
else if (status === 403) {
|
|
2359
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2360
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2361
|
+
}));
|
|
2362
|
+
}
|
|
2363
|
+
else if (status !== 200 && status !== 204) {
|
|
2364
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2365
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2366
|
+
}));
|
|
2367
|
+
}
|
|
2368
|
+
return rxjs.of(null);
|
|
2369
|
+
};
|
|
2370
|
+
/**
|
|
2371
|
+
* Gets project pdf files in zip archive
|
|
2372
|
+
* @param id Project unique identifier
|
|
2373
|
+
* @param designUserId User identifier
|
|
2374
|
+
* @param designId Design identifier
|
|
2375
|
+
* @param attachment (optional) If set to 'true', file will be provided as an attachment with proper filename supplied (default value is 'false')
|
|
2376
|
+
* @param tenantId (optional) Tenant identifier
|
|
2377
|
+
* @param userId (optional) User identifier
|
|
2378
|
+
* @return Success
|
|
2379
|
+
*/
|
|
2380
|
+
ProjectsApiClient.prototype.getProjectPdfZip = function (id, designUserId, designId, attachment, tenantId, userId) {
|
|
2381
|
+
var _this = this;
|
|
2382
|
+
var url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/project-pdf-zip?";
|
|
2383
|
+
if (id === undefined || id === null)
|
|
2384
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2385
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2386
|
+
if (designUserId === undefined || designUserId === null)
|
|
2387
|
+
throw new Error("The parameter 'designUserId' must be defined and cannot be null.");
|
|
2388
|
+
else
|
|
2389
|
+
url_ += "designUserId=" + encodeURIComponent("" + designUserId) + "&";
|
|
2390
|
+
if (designId === undefined || designId === null)
|
|
2391
|
+
throw new Error("The parameter 'designId' must be defined and cannot be null.");
|
|
2392
|
+
else
|
|
2393
|
+
url_ += "designId=" + encodeURIComponent("" + designId) + "&";
|
|
2394
|
+
if (attachment !== undefined && attachment !== null)
|
|
2395
|
+
url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
|
|
2396
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2397
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2398
|
+
if (userId !== undefined && userId !== null)
|
|
2399
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
2400
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2401
|
+
var options_ = {
|
|
2402
|
+
observe: "response",
|
|
2403
|
+
responseType: "blob",
|
|
2404
|
+
headers: new i1.HttpHeaders({
|
|
2405
|
+
"Accept": "application/octet-stream"
|
|
2406
|
+
})
|
|
2407
|
+
};
|
|
2408
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
2409
|
+
return _this.http.request("get", url_, transformedOptions_);
|
|
2410
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
2411
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetProjectPdfZip(r); });
|
|
2412
|
+
})).pipe(operators.catchError(function (response_) {
|
|
2413
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
2414
|
+
try {
|
|
2415
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetProjectPdfZip(r); });
|
|
2416
|
+
}
|
|
2417
|
+
catch (e) {
|
|
2418
|
+
return rxjs.throwError(e);
|
|
2419
|
+
}
|
|
2420
|
+
}
|
|
2421
|
+
else
|
|
2422
|
+
return rxjs.throwError(response_);
|
|
2423
|
+
}));
|
|
2424
|
+
};
|
|
2425
|
+
ProjectsApiClient.prototype.processGetProjectPdfZip = function (response) {
|
|
2426
|
+
var e_21, _a;
|
|
2427
|
+
var _this = this;
|
|
2428
|
+
var status = response.status;
|
|
2429
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
2430
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2431
|
+
var _headers = {};
|
|
2432
|
+
if (response.headers) {
|
|
2433
|
+
try {
|
|
2434
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
2435
|
+
var key = _c.value;
|
|
2436
|
+
_headers[key] = response.headers.get(key);
|
|
2437
|
+
}
|
|
2438
|
+
}
|
|
2439
|
+
catch (e_21_1) { e_21 = { error: e_21_1 }; }
|
|
2440
|
+
finally {
|
|
2441
|
+
try {
|
|
2442
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2443
|
+
}
|
|
2444
|
+
finally { if (e_21) throw e_21.error; }
|
|
2445
|
+
}
|
|
2446
|
+
}
|
|
2447
|
+
if (status === 200 || status === 206) {
|
|
2448
|
+
var contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
|
|
2449
|
+
var fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
2450
|
+
var fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
2451
|
+
return rxjs.of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
|
|
2452
|
+
}
|
|
2453
|
+
else if (status === 404) {
|
|
2454
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2455
|
+
var result404 = null;
|
|
2456
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
2457
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2458
|
+
}));
|
|
2459
|
+
}
|
|
2460
|
+
else if (status === 401) {
|
|
2461
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2462
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2463
|
+
}));
|
|
2464
|
+
}
|
|
2465
|
+
else if (status === 403) {
|
|
2466
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2467
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2468
|
+
}));
|
|
2469
|
+
}
|
|
2470
|
+
else if (status !== 200 && status !== 204) {
|
|
2471
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2472
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2473
|
+
}));
|
|
2474
|
+
}
|
|
2475
|
+
return rxjs.of(null);
|
|
2476
|
+
};
|
|
2477
|
+
/**
|
|
2478
|
+
* Gets project order data from ecommerce system
|
|
2479
|
+
* @param id Project identifier
|
|
2480
|
+
* @return Success
|
|
2481
|
+
*/
|
|
2482
|
+
ProjectsApiClient.prototype.getProjectOrder = function (id) {
|
|
2483
|
+
var _this = this;
|
|
2484
|
+
var url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/order";
|
|
2485
|
+
if (id === undefined || id === null)
|
|
2486
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2487
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2488
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2489
|
+
var options_ = {
|
|
2490
|
+
observe: "response",
|
|
2491
|
+
responseType: "blob",
|
|
2492
|
+
headers: new i1.HttpHeaders({
|
|
2493
|
+
"Accept": "application/json"
|
|
2494
|
+
})
|
|
2495
|
+
};
|
|
2496
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
2497
|
+
return _this.http.request("get", url_, transformedOptions_);
|
|
2498
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
2499
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetProjectOrder(r); });
|
|
2500
|
+
})).pipe(operators.catchError(function (response_) {
|
|
2501
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
2502
|
+
try {
|
|
2503
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetProjectOrder(r); });
|
|
2504
|
+
}
|
|
2505
|
+
catch (e) {
|
|
2506
|
+
return rxjs.throwError(e);
|
|
2507
|
+
}
|
|
2508
|
+
}
|
|
2509
|
+
else
|
|
2510
|
+
return rxjs.throwError(response_);
|
|
2511
|
+
}));
|
|
2512
|
+
};
|
|
2513
|
+
ProjectsApiClient.prototype.processGetProjectOrder = function (response) {
|
|
2514
|
+
var e_22, _a;
|
|
2515
|
+
var _this = this;
|
|
2516
|
+
var status = response.status;
|
|
2517
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
2518
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2519
|
+
var _headers = {};
|
|
2520
|
+
if (response.headers) {
|
|
2521
|
+
try {
|
|
2522
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
2523
|
+
var key = _c.value;
|
|
2524
|
+
_headers[key] = response.headers.get(key);
|
|
2525
|
+
}
|
|
2526
|
+
}
|
|
2527
|
+
catch (e_22_1) { e_22 = { error: e_22_1 }; }
|
|
2528
|
+
finally {
|
|
2529
|
+
try {
|
|
2530
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2531
|
+
}
|
|
2532
|
+
finally { if (e_22) throw e_22.error; }
|
|
2533
|
+
}
|
|
2534
|
+
}
|
|
2535
|
+
if (status === 200) {
|
|
2536
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2537
|
+
var result200 = null;
|
|
2538
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
2539
|
+
return rxjs.of(result200);
|
|
2540
|
+
}));
|
|
2541
|
+
}
|
|
2542
|
+
else if (status === 404) {
|
|
2543
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2544
|
+
var result404 = null;
|
|
2545
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
2546
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2547
|
+
}));
|
|
2548
|
+
}
|
|
2549
|
+
else if (status === 401) {
|
|
2550
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2551
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2552
|
+
}));
|
|
2553
|
+
}
|
|
2554
|
+
else if (status === 403) {
|
|
2555
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2556
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2557
|
+
}));
|
|
2558
|
+
}
|
|
2559
|
+
else if (status !== 200 && status !== 204) {
|
|
2560
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2561
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2562
|
+
}));
|
|
2563
|
+
}
|
|
2564
|
+
return rxjs.of(null);
|
|
2565
|
+
};
|
|
2566
|
+
return ProjectsApiClient;
|
|
2567
|
+
}(ApiClientBase));
|
|
2568
|
+
ProjectsApiClient.ɵprov = i0.ɵɵdefineInjectable({ factory: function ProjectsApiClient_Factory() { return new ProjectsApiClient(i0.ɵɵinject(ApiClientConfiguration), i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(API_BASE_URL, 8)); }, token: ProjectsApiClient, providedIn: "root" });
|
|
2569
|
+
ProjectsApiClient.decorators = [
|
|
2570
|
+
{ type: i0.Injectable, args: [{
|
|
2571
|
+
providedIn: 'root'
|
|
2572
|
+
},] }
|
|
2573
|
+
];
|
|
2574
|
+
ProjectsApiClient.ctorParameters = function () { return [
|
|
2575
|
+
{ type: ApiClientConfiguration, decorators: [{ type: i0.Inject, args: [ApiClientConfiguration,] }] },
|
|
2576
|
+
{ type: i1.HttpClient, decorators: [{ type: i0.Inject, args: [i1.HttpClient,] }] },
|
|
2577
|
+
{ type: String, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [API_BASE_URL,] }] }
|
|
2578
|
+
]; };
|
|
2579
|
+
var StorefrontsApiClient = /** @class */ (function (_super) {
|
|
2580
|
+
__extends(StorefrontsApiClient, _super);
|
|
2581
|
+
function StorefrontsApiClient(configuration, http, baseUrl) {
|
|
2582
|
+
var _this = _super.call(this, configuration) || this;
|
|
2583
|
+
_this.jsonParseReviver = undefined;
|
|
2584
|
+
_this.http = http;
|
|
2585
|
+
_this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : _this.getBaseUrl("");
|
|
2586
|
+
return _this;
|
|
2587
|
+
}
|
|
2588
|
+
/**
|
|
2589
|
+
* Gets all storefronts relevant to specified query parameters
|
|
2590
|
+
* @param types (optional) Storefront type filter
|
|
2591
|
+
* @param skip (optional) Defines page start offset from beginning of sorted result list
|
|
2592
|
+
* @param take (optional) Defines page length (how much consequent items of sorted result list should be taken)
|
|
2593
|
+
* @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC"
|
|
2594
|
+
* @param search (optional) Search string for partial match
|
|
2595
|
+
* @param tenantId (optional) Tenant identifier
|
|
2596
|
+
* @param userId (optional) User identifier
|
|
2597
|
+
* @return Success
|
|
2598
|
+
*/
|
|
2599
|
+
StorefrontsApiClient.prototype.getAll = function (types, skip, take, sorting, search, tenantId, userId) {
|
|
2600
|
+
var _this = this;
|
|
2601
|
+
var url_ = this.baseUrl + "/api/storefront/v1/storefronts?";
|
|
2602
|
+
if (types !== undefined && types !== null)
|
|
2603
|
+
types && types.forEach(function (item) { url_ += "types=" + encodeURIComponent("" + item) + "&"; });
|
|
2604
|
+
if (skip !== undefined && skip !== null)
|
|
2605
|
+
url_ += "skip=" + encodeURIComponent("" + skip) + "&";
|
|
2606
|
+
if (take !== undefined && take !== null)
|
|
2607
|
+
url_ += "take=" + encodeURIComponent("" + take) + "&";
|
|
2608
|
+
if (sorting !== undefined && sorting !== null)
|
|
2609
|
+
url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
|
|
2610
|
+
if (search !== undefined && search !== null)
|
|
2611
|
+
url_ += "search=" + encodeURIComponent("" + search) + "&";
|
|
2612
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2613
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2614
|
+
if (userId !== undefined && userId !== null)
|
|
2615
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
2616
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2617
|
+
var options_ = {
|
|
2618
|
+
observe: "response",
|
|
2619
|
+
responseType: "blob",
|
|
2620
|
+
headers: new i1.HttpHeaders({
|
|
2621
|
+
"Accept": "text/plain"
|
|
2622
|
+
})
|
|
2623
|
+
};
|
|
2624
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
2625
|
+
return _this.http.request("get", url_, transformedOptions_);
|
|
2626
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
2627
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetAll(r); });
|
|
2628
|
+
})).pipe(operators.catchError(function (response_) {
|
|
2629
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
2630
|
+
try {
|
|
2631
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetAll(r); });
|
|
2632
|
+
}
|
|
2633
|
+
catch (e) {
|
|
2634
|
+
return rxjs.throwError(e);
|
|
2635
|
+
}
|
|
2636
|
+
}
|
|
2637
|
+
else
|
|
2638
|
+
return rxjs.throwError(response_);
|
|
2639
|
+
}));
|
|
2640
|
+
};
|
|
2641
|
+
StorefrontsApiClient.prototype.processGetAll = function (response) {
|
|
2642
|
+
var e_23, _a;
|
|
2643
|
+
var _this = this;
|
|
2644
|
+
var status = response.status;
|
|
2645
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
2646
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2647
|
+
var _headers = {};
|
|
2648
|
+
if (response.headers) {
|
|
2649
|
+
try {
|
|
2650
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
2651
|
+
var key = _c.value;
|
|
2652
|
+
_headers[key] = response.headers.get(key);
|
|
2653
|
+
}
|
|
2654
|
+
}
|
|
2655
|
+
catch (e_23_1) { e_23 = { error: e_23_1 }; }
|
|
2656
|
+
finally {
|
|
2657
|
+
try {
|
|
2658
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2659
|
+
}
|
|
2660
|
+
finally { if (e_23) throw e_23.error; }
|
|
2661
|
+
}
|
|
2662
|
+
}
|
|
2663
|
+
if (status === 200) {
|
|
2664
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2665
|
+
var result200 = null;
|
|
2666
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
2667
|
+
return rxjs.of(result200);
|
|
2668
|
+
}));
|
|
2669
|
+
}
|
|
2670
|
+
else if (status === 401) {
|
|
2671
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2672
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2673
|
+
}));
|
|
2674
|
+
}
|
|
2675
|
+
else if (status === 403) {
|
|
2676
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2677
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2678
|
+
}));
|
|
2679
|
+
}
|
|
2680
|
+
else if (status !== 200 && status !== 204) {
|
|
2681
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2682
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2683
|
+
}));
|
|
2684
|
+
}
|
|
2685
|
+
return rxjs.of(null);
|
|
2686
|
+
};
|
|
2687
|
+
/**
|
|
2688
|
+
* Gets storefront
|
|
2689
|
+
* @param id Storefront identifier
|
|
2690
|
+
* @param tenantId (optional) Tenant identifier
|
|
2691
|
+
* @param userId (optional) User identifier
|
|
2692
|
+
* @return Success
|
|
2693
|
+
*/
|
|
2694
|
+
StorefrontsApiClient.prototype.get = function (id, tenantId, userId) {
|
|
2695
|
+
var _this = this;
|
|
2696
|
+
var url_ = this.baseUrl + "/api/storefront/v1/storefronts/{id}?";
|
|
2697
|
+
if (id === undefined || id === null)
|
|
2698
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2699
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2700
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2701
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2702
|
+
if (userId !== undefined && userId !== null)
|
|
2703
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
2704
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2705
|
+
var options_ = {
|
|
2706
|
+
observe: "response",
|
|
2707
|
+
responseType: "blob",
|
|
2708
|
+
headers: new i1.HttpHeaders({
|
|
2709
|
+
"Accept": "text/plain"
|
|
2710
|
+
})
|
|
2711
|
+
};
|
|
2712
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
2713
|
+
return _this.http.request("get", url_, transformedOptions_);
|
|
2714
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
2715
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGet(r); });
|
|
2716
|
+
})).pipe(operators.catchError(function (response_) {
|
|
2717
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
2718
|
+
try {
|
|
2719
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGet(r); });
|
|
2720
|
+
}
|
|
2721
|
+
catch (e) {
|
|
2722
|
+
return rxjs.throwError(e);
|
|
2723
|
+
}
|
|
2724
|
+
}
|
|
2725
|
+
else
|
|
2726
|
+
return rxjs.throwError(response_);
|
|
2727
|
+
}));
|
|
2728
|
+
};
|
|
2729
|
+
StorefrontsApiClient.prototype.processGet = function (response) {
|
|
2730
|
+
var e_24, _a;
|
|
2731
|
+
var _this = this;
|
|
2732
|
+
var status = response.status;
|
|
2733
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
2734
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2735
|
+
var _headers = {};
|
|
2736
|
+
if (response.headers) {
|
|
2737
|
+
try {
|
|
2738
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
2739
|
+
var key = _c.value;
|
|
2740
|
+
_headers[key] = response.headers.get(key);
|
|
2741
|
+
}
|
|
2742
|
+
}
|
|
2743
|
+
catch (e_24_1) { e_24 = { error: e_24_1 }; }
|
|
2744
|
+
finally {
|
|
2745
|
+
try {
|
|
2746
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2747
|
+
}
|
|
2748
|
+
finally { if (e_24) throw e_24.error; }
|
|
2749
|
+
}
|
|
2750
|
+
}
|
|
2751
|
+
if (status === 200) {
|
|
2752
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2753
|
+
var result200 = null;
|
|
2754
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
2755
|
+
return rxjs.of(result200);
|
|
2756
|
+
}));
|
|
2757
|
+
}
|
|
2758
|
+
else if (status === 404) {
|
|
2759
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2760
|
+
var result404 = null;
|
|
2761
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
2762
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2763
|
+
}));
|
|
2764
|
+
}
|
|
2765
|
+
else if (status === 401) {
|
|
2766
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2767
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2768
|
+
}));
|
|
2769
|
+
}
|
|
2770
|
+
else if (status === 403) {
|
|
2771
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2772
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2773
|
+
}));
|
|
2774
|
+
}
|
|
2775
|
+
else if (status !== 200 && status !== 204) {
|
|
2776
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2777
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2778
|
+
}));
|
|
2779
|
+
}
|
|
2780
|
+
return rxjs.of(null);
|
|
2781
|
+
};
|
|
2782
|
+
return StorefrontsApiClient;
|
|
2783
|
+
}(ApiClientBase));
|
|
2784
|
+
StorefrontsApiClient.ɵprov = i0.ɵɵdefineInjectable({ factory: function StorefrontsApiClient_Factory() { return new StorefrontsApiClient(i0.ɵɵinject(ApiClientConfiguration), i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(API_BASE_URL, 8)); }, token: StorefrontsApiClient, providedIn: "root" });
|
|
2785
|
+
StorefrontsApiClient.decorators = [
|
|
2786
|
+
{ type: i0.Injectable, args: [{
|
|
2787
|
+
providedIn: 'root'
|
|
2788
|
+
},] }
|
|
2789
|
+
];
|
|
2790
|
+
StorefrontsApiClient.ctorParameters = function () { return [
|
|
2791
|
+
{ type: ApiClientConfiguration, decorators: [{ type: i0.Inject, args: [ApiClientConfiguration,] }] },
|
|
2792
|
+
{ type: i1.HttpClient, decorators: [{ type: i0.Inject, args: [i1.HttpClient,] }] },
|
|
2793
|
+
{ type: String, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [API_BASE_URL,] }] }
|
|
2794
|
+
]; };
|
|
2795
|
+
var StorefrontUsersApiClient = /** @class */ (function (_super) {
|
|
2796
|
+
__extends(StorefrontUsersApiClient, _super);
|
|
2797
|
+
function StorefrontUsersApiClient(configuration, http, baseUrl) {
|
|
2798
|
+
var _this = _super.call(this, configuration) || this;
|
|
2799
|
+
_this.jsonParseReviver = undefined;
|
|
2800
|
+
_this.http = http;
|
|
2801
|
+
_this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : _this.getBaseUrl("");
|
|
2802
|
+
return _this;
|
|
2803
|
+
}
|
|
2804
|
+
/**
|
|
2805
|
+
* Gets all storefront users relevant to specified query parameters
|
|
2806
|
+
* @param storefrontId Storefront identifier
|
|
2807
|
+
* @param storefrontUserId (optional) Storefront user identifier
|
|
2808
|
+
* @param skip (optional) Defines page start offset from beginning of sorted result list
|
|
2809
|
+
* @param take (optional) Defines page length (how much consequent items of sorted result list should be taken)
|
|
2810
|
+
* @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC"
|
|
2811
|
+
* @param search (optional) Search string for partial match
|
|
2812
|
+
* @param tenantId (optional) Tenant identifier
|
|
2813
|
+
* @param userId (optional) User identifier
|
|
2814
|
+
* @return Success
|
|
2815
|
+
*/
|
|
2816
|
+
StorefrontUsersApiClient.prototype.getAll = function (storefrontId, storefrontUserId, skip, take, sorting, search, tenantId, userId) {
|
|
2817
|
+
var _this = this;
|
|
2818
|
+
var url_ = this.baseUrl + "/api/storefront/v1/storefront-users?";
|
|
2819
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
2820
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
2821
|
+
else
|
|
2822
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
2823
|
+
if (storefrontUserId !== undefined && storefrontUserId !== null)
|
|
2824
|
+
url_ += "storefrontUserId=" + encodeURIComponent("" + storefrontUserId) + "&";
|
|
2825
|
+
if (skip !== undefined && skip !== null)
|
|
2826
|
+
url_ += "skip=" + encodeURIComponent("" + skip) + "&";
|
|
2827
|
+
if (take !== undefined && take !== null)
|
|
2828
|
+
url_ += "take=" + encodeURIComponent("" + take) + "&";
|
|
2829
|
+
if (sorting !== undefined && sorting !== null)
|
|
2830
|
+
url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
|
|
2831
|
+
if (search !== undefined && search !== null)
|
|
2832
|
+
url_ += "search=" + encodeURIComponent("" + search) + "&";
|
|
2833
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2834
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2835
|
+
if (userId !== undefined && userId !== null)
|
|
2836
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
2837
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2838
|
+
var options_ = {
|
|
2839
|
+
observe: "response",
|
|
2840
|
+
responseType: "blob",
|
|
2841
|
+
headers: new i1.HttpHeaders({
|
|
2842
|
+
"Accept": "text/plain"
|
|
2843
|
+
})
|
|
2844
|
+
};
|
|
2845
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
2846
|
+
return _this.http.request("get", url_, transformedOptions_);
|
|
2847
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
2848
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetAll(r); });
|
|
2849
|
+
})).pipe(operators.catchError(function (response_) {
|
|
2850
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
2851
|
+
try {
|
|
2852
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetAll(r); });
|
|
2853
|
+
}
|
|
2854
|
+
catch (e) {
|
|
2855
|
+
return rxjs.throwError(e);
|
|
2856
|
+
}
|
|
2857
|
+
}
|
|
2858
|
+
else
|
|
2859
|
+
return rxjs.throwError(response_);
|
|
2860
|
+
}));
|
|
2861
|
+
};
|
|
2862
|
+
StorefrontUsersApiClient.prototype.processGetAll = function (response) {
|
|
2863
|
+
var e_25, _a;
|
|
2864
|
+
var _this = this;
|
|
2865
|
+
var status = response.status;
|
|
2866
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
2867
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2868
|
+
var _headers = {};
|
|
2869
|
+
if (response.headers) {
|
|
2870
|
+
try {
|
|
2871
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
2872
|
+
var key = _c.value;
|
|
2873
|
+
_headers[key] = response.headers.get(key);
|
|
2874
|
+
}
|
|
2875
|
+
}
|
|
2876
|
+
catch (e_25_1) { e_25 = { error: e_25_1 }; }
|
|
2877
|
+
finally {
|
|
2878
|
+
try {
|
|
2879
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2880
|
+
}
|
|
2881
|
+
finally { if (e_25) throw e_25.error; }
|
|
2882
|
+
}
|
|
2883
|
+
}
|
|
2884
|
+
if (status === 200) {
|
|
2885
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2886
|
+
var result200 = null;
|
|
2887
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
2888
|
+
return rxjs.of(result200);
|
|
2889
|
+
}));
|
|
2890
|
+
}
|
|
2891
|
+
else if (status === 401) {
|
|
2892
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2893
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2894
|
+
}));
|
|
2895
|
+
}
|
|
2896
|
+
else if (status === 403) {
|
|
2897
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2898
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2899
|
+
}));
|
|
2900
|
+
}
|
|
2901
|
+
else if (status !== 200 && status !== 204) {
|
|
2902
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2903
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2904
|
+
}));
|
|
2905
|
+
}
|
|
2906
|
+
return rxjs.of(null);
|
|
2907
|
+
};
|
|
2908
|
+
/**
|
|
2909
|
+
* Creates new storefront user
|
|
2910
|
+
* @param storefrontId Storefront identifier
|
|
2911
|
+
* @param tenantId (optional) Tenant identifier
|
|
2912
|
+
* @param userId (optional) User identifier
|
|
2913
|
+
* @param body (optional) Create operation parameters
|
|
2914
|
+
* @return Success
|
|
2915
|
+
*/
|
|
2916
|
+
StorefrontUsersApiClient.prototype.create = function (storefrontId, tenantId, userId, body) {
|
|
2917
|
+
var _this = this;
|
|
2918
|
+
var url_ = this.baseUrl + "/api/storefront/v1/storefront-users?";
|
|
2919
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
2920
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
2921
|
+
else
|
|
2922
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
2923
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2924
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2925
|
+
if (userId !== undefined && userId !== null)
|
|
2926
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
2927
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2928
|
+
var content_ = JSON.stringify(body);
|
|
2929
|
+
var options_ = {
|
|
2930
|
+
body: content_,
|
|
2931
|
+
observe: "response",
|
|
2932
|
+
responseType: "blob",
|
|
2933
|
+
headers: new i1.HttpHeaders({
|
|
2934
|
+
"Content-Type": "application/json-patch+json",
|
|
2935
|
+
"Accept": "text/plain"
|
|
2936
|
+
})
|
|
2937
|
+
};
|
|
2938
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
2939
|
+
return _this.http.request("post", url_, transformedOptions_);
|
|
2940
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
2941
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processCreate(r); });
|
|
2942
|
+
})).pipe(operators.catchError(function (response_) {
|
|
2943
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
2944
|
+
try {
|
|
2945
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processCreate(r); });
|
|
2946
|
+
}
|
|
2947
|
+
catch (e) {
|
|
2948
|
+
return rxjs.throwError(e);
|
|
2949
|
+
}
|
|
2950
|
+
}
|
|
2951
|
+
else
|
|
2952
|
+
return rxjs.throwError(response_);
|
|
2953
|
+
}));
|
|
2954
|
+
};
|
|
2955
|
+
StorefrontUsersApiClient.prototype.processCreate = function (response) {
|
|
2956
|
+
var e_26, _a;
|
|
2957
|
+
var _this = this;
|
|
2958
|
+
var status = response.status;
|
|
2959
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
2960
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2961
|
+
var _headers = {};
|
|
2962
|
+
if (response.headers) {
|
|
2963
|
+
try {
|
|
2964
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
2965
|
+
var key = _c.value;
|
|
2966
|
+
_headers[key] = response.headers.get(key);
|
|
2967
|
+
}
|
|
2968
|
+
}
|
|
2969
|
+
catch (e_26_1) { e_26 = { error: e_26_1 }; }
|
|
2970
|
+
finally {
|
|
2971
|
+
try {
|
|
2972
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2973
|
+
}
|
|
2974
|
+
finally { if (e_26) throw e_26.error; }
|
|
2975
|
+
}
|
|
2976
|
+
}
|
|
2977
|
+
if (status === 201) {
|
|
2978
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2979
|
+
var result201 = null;
|
|
2980
|
+
result201 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
2981
|
+
return rxjs.of(result201);
|
|
2982
|
+
}));
|
|
2983
|
+
}
|
|
2984
|
+
else if (status === 401) {
|
|
2985
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2986
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2987
|
+
}));
|
|
2988
|
+
}
|
|
2989
|
+
else if (status === 403) {
|
|
2990
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2991
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2992
|
+
}));
|
|
2993
|
+
}
|
|
2994
|
+
else if (status !== 200 && status !== 204) {
|
|
2995
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
2996
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2997
|
+
}));
|
|
2998
|
+
}
|
|
2999
|
+
return rxjs.of(null);
|
|
3000
|
+
};
|
|
3001
|
+
/**
|
|
3002
|
+
* Gets storefront user by id
|
|
3003
|
+
* @param id Storefront user identifier
|
|
3004
|
+
* @param storefrontId Storefront identifier
|
|
3005
|
+
* @param tenantId (optional) Tenant identifier
|
|
3006
|
+
* @param userId (optional) User identifier
|
|
3007
|
+
* @return Success
|
|
3008
|
+
*/
|
|
3009
|
+
StorefrontUsersApiClient.prototype.get = function (id, storefrontId, tenantId, userId) {
|
|
3010
|
+
var _this = this;
|
|
3011
|
+
var url_ = this.baseUrl + "/api/storefront/v1/storefront-users/{id}?";
|
|
3012
|
+
if (id === undefined || id === null)
|
|
3013
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3014
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3015
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
3016
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
3017
|
+
else
|
|
3018
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
3019
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3020
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3021
|
+
if (userId !== undefined && userId !== null)
|
|
3022
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
3023
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3024
|
+
var options_ = {
|
|
3025
|
+
observe: "response",
|
|
3026
|
+
responseType: "blob",
|
|
3027
|
+
headers: new i1.HttpHeaders({
|
|
3028
|
+
"Accept": "text/plain"
|
|
3029
|
+
})
|
|
3030
|
+
};
|
|
3031
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
3032
|
+
return _this.http.request("get", url_, transformedOptions_);
|
|
3033
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
3034
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGet(r); });
|
|
3035
|
+
})).pipe(operators.catchError(function (response_) {
|
|
3036
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
3037
|
+
try {
|
|
3038
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGet(r); });
|
|
3039
|
+
}
|
|
3040
|
+
catch (e) {
|
|
3041
|
+
return rxjs.throwError(e);
|
|
3042
|
+
}
|
|
3043
|
+
}
|
|
3044
|
+
else
|
|
3045
|
+
return rxjs.throwError(response_);
|
|
3046
|
+
}));
|
|
3047
|
+
};
|
|
3048
|
+
StorefrontUsersApiClient.prototype.processGet = function (response) {
|
|
3049
|
+
var e_27, _a;
|
|
3050
|
+
var _this = this;
|
|
3051
|
+
var status = response.status;
|
|
3052
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
3053
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
3054
|
+
var _headers = {};
|
|
3055
|
+
if (response.headers) {
|
|
3056
|
+
try {
|
|
3057
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
3058
|
+
var key = _c.value;
|
|
3059
|
+
_headers[key] = response.headers.get(key);
|
|
3060
|
+
}
|
|
3061
|
+
}
|
|
3062
|
+
catch (e_27_1) { e_27 = { error: e_27_1 }; }
|
|
3063
|
+
finally {
|
|
3064
|
+
try {
|
|
3065
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
3066
|
+
}
|
|
3067
|
+
finally { if (e_27) throw e_27.error; }
|
|
3068
|
+
}
|
|
3069
|
+
}
|
|
3070
|
+
if (status === 200) {
|
|
3071
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3072
|
+
var result200 = null;
|
|
3073
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
3074
|
+
return rxjs.of(result200);
|
|
3075
|
+
}));
|
|
3076
|
+
}
|
|
3077
|
+
else if (status === 404) {
|
|
3078
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3079
|
+
var result404 = null;
|
|
3080
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
3081
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3082
|
+
}));
|
|
3083
|
+
}
|
|
3084
|
+
else if (status === 401) {
|
|
3085
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3086
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3087
|
+
}));
|
|
3088
|
+
}
|
|
3089
|
+
else if (status === 403) {
|
|
3090
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3091
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3092
|
+
}));
|
|
3093
|
+
}
|
|
3094
|
+
else if (status !== 200 && status !== 204) {
|
|
3095
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3096
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3097
|
+
}));
|
|
3098
|
+
}
|
|
3099
|
+
return rxjs.of(null);
|
|
3100
|
+
};
|
|
3101
|
+
/**
|
|
3102
|
+
* Merges anonymous storefront user data to regular storefront user account
|
|
3103
|
+
* @param storefrontId Storefront identifier
|
|
3104
|
+
* @param tenantId (optional) Tenant identifier
|
|
3105
|
+
* @param userId (optional) User identifier
|
|
3106
|
+
* @param body (optional) Merge operation parameters
|
|
3107
|
+
* @return Success
|
|
3108
|
+
*/
|
|
3109
|
+
StorefrontUsersApiClient.prototype.mergeAnonymous = function (storefrontId, tenantId, userId, body) {
|
|
3110
|
+
var _this = this;
|
|
3111
|
+
var url_ = this.baseUrl + "/api/storefront/v1/storefront-users/merge-anonymous?";
|
|
3112
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
3113
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
3114
|
+
else
|
|
3115
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
3116
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3117
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3118
|
+
if (userId !== undefined && userId !== null)
|
|
3119
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
3120
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3121
|
+
var content_ = JSON.stringify(body);
|
|
3122
|
+
var options_ = {
|
|
3123
|
+
body: content_,
|
|
3124
|
+
observe: "response",
|
|
3125
|
+
responseType: "blob",
|
|
3126
|
+
headers: new i1.HttpHeaders({
|
|
3127
|
+
"Content-Type": "application/json-patch+json",
|
|
3128
|
+
})
|
|
3129
|
+
};
|
|
3130
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
3131
|
+
return _this.http.request("post", url_, transformedOptions_);
|
|
3132
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
3133
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processMergeAnonymous(r); });
|
|
3134
|
+
})).pipe(operators.catchError(function (response_) {
|
|
3135
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
3136
|
+
try {
|
|
3137
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processMergeAnonymous(r); });
|
|
3138
|
+
}
|
|
3139
|
+
catch (e) {
|
|
3140
|
+
return rxjs.throwError(e);
|
|
3141
|
+
}
|
|
3142
|
+
}
|
|
3143
|
+
else
|
|
3144
|
+
return rxjs.throwError(response_);
|
|
3145
|
+
}));
|
|
3146
|
+
};
|
|
3147
|
+
StorefrontUsersApiClient.prototype.processMergeAnonymous = function (response) {
|
|
3148
|
+
var e_28, _a;
|
|
3149
|
+
var _this = this;
|
|
3150
|
+
var status = response.status;
|
|
3151
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
3152
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
3153
|
+
var _headers = {};
|
|
3154
|
+
if (response.headers) {
|
|
3155
|
+
try {
|
|
3156
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
3157
|
+
var key = _c.value;
|
|
3158
|
+
_headers[key] = response.headers.get(key);
|
|
3159
|
+
}
|
|
3160
|
+
}
|
|
3161
|
+
catch (e_28_1) { e_28 = { error: e_28_1 }; }
|
|
3162
|
+
finally {
|
|
3163
|
+
try {
|
|
3164
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
3165
|
+
}
|
|
3166
|
+
finally { if (e_28) throw e_28.error; }
|
|
3167
|
+
}
|
|
3168
|
+
}
|
|
3169
|
+
if (status === 200) {
|
|
3170
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3171
|
+
return rxjs.of(null);
|
|
3172
|
+
}));
|
|
3173
|
+
}
|
|
3174
|
+
else if (status === 404) {
|
|
3175
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3176
|
+
var result404 = null;
|
|
3177
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
3178
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3179
|
+
}));
|
|
3180
|
+
}
|
|
3181
|
+
else if (status === 409) {
|
|
3182
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3183
|
+
var result409 = null;
|
|
3184
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
3185
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3186
|
+
}));
|
|
3187
|
+
}
|
|
3188
|
+
else if (status === 401) {
|
|
3189
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3190
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3191
|
+
}));
|
|
3192
|
+
}
|
|
3193
|
+
else if (status === 403) {
|
|
3194
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3195
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3196
|
+
}));
|
|
3197
|
+
}
|
|
3198
|
+
else if (status !== 200 && status !== 204) {
|
|
3199
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3200
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3201
|
+
}));
|
|
3202
|
+
}
|
|
3203
|
+
return rxjs.of(null);
|
|
3204
|
+
};
|
|
3205
|
+
/**
|
|
3206
|
+
* Gets storefront user token
|
|
3207
|
+
* @param storefrontUserId Storefront user identifier
|
|
3208
|
+
* @param storefrontId Storefront identifier
|
|
3209
|
+
* @param tenantId (optional) Tenant identifier
|
|
3210
|
+
* @param userId (optional) User identifier
|
|
3211
|
+
* @return Success
|
|
3212
|
+
*/
|
|
3213
|
+
StorefrontUsersApiClient.prototype.getToken = function (storefrontUserId, storefrontId, tenantId, userId) {
|
|
3214
|
+
var _this = this;
|
|
3215
|
+
var url_ = this.baseUrl + "/api/storefront/v1/storefront-users/token?";
|
|
3216
|
+
if (storefrontUserId === undefined || storefrontUserId === null)
|
|
3217
|
+
throw new Error("The parameter 'storefrontUserId' must be defined and cannot be null.");
|
|
3218
|
+
else
|
|
3219
|
+
url_ += "storefrontUserId=" + encodeURIComponent("" + storefrontUserId) + "&";
|
|
3220
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
3221
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
3222
|
+
else
|
|
3223
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
3224
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3225
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3226
|
+
if (userId !== undefined && userId !== null)
|
|
3227
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
3228
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3229
|
+
var options_ = {
|
|
3230
|
+
observe: "response",
|
|
3231
|
+
responseType: "blob",
|
|
3232
|
+
headers: new i1.HttpHeaders({})
|
|
3233
|
+
};
|
|
3234
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
3235
|
+
return _this.http.request("get", url_, transformedOptions_);
|
|
3236
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
3237
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetToken(r); });
|
|
3238
|
+
})).pipe(operators.catchError(function (response_) {
|
|
3239
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
3240
|
+
try {
|
|
3241
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetToken(r); });
|
|
3242
|
+
}
|
|
3243
|
+
catch (e) {
|
|
3244
|
+
return rxjs.throwError(e);
|
|
3245
|
+
}
|
|
3246
|
+
}
|
|
3247
|
+
else
|
|
3248
|
+
return rxjs.throwError(response_);
|
|
3249
|
+
}));
|
|
3250
|
+
};
|
|
3251
|
+
StorefrontUsersApiClient.prototype.processGetToken = function (response) {
|
|
3252
|
+
var e_29, _a;
|
|
3253
|
+
var _this = this;
|
|
3254
|
+
var status = response.status;
|
|
3255
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
3256
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
3257
|
+
var _headers = {};
|
|
3258
|
+
if (response.headers) {
|
|
3259
|
+
try {
|
|
3260
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
3261
|
+
var key = _c.value;
|
|
3262
|
+
_headers[key] = response.headers.get(key);
|
|
3263
|
+
}
|
|
3264
|
+
}
|
|
3265
|
+
catch (e_29_1) { e_29 = { error: e_29_1 }; }
|
|
3266
|
+
finally {
|
|
3267
|
+
try {
|
|
3268
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
3269
|
+
}
|
|
3270
|
+
finally { if (e_29) throw e_29.error; }
|
|
3271
|
+
}
|
|
3272
|
+
}
|
|
3273
|
+
if (status === 201) {
|
|
3274
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3275
|
+
return rxjs.of(null);
|
|
3276
|
+
}));
|
|
3277
|
+
}
|
|
3278
|
+
else if (status === 404) {
|
|
3279
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3280
|
+
var result404 = null;
|
|
3281
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
3282
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3283
|
+
}));
|
|
3284
|
+
}
|
|
3285
|
+
else if (status === 409) {
|
|
3286
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3287
|
+
var result409 = null;
|
|
3288
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
3289
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3290
|
+
}));
|
|
3291
|
+
}
|
|
3292
|
+
else if (status === 401) {
|
|
3293
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3294
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3295
|
+
}));
|
|
3296
|
+
}
|
|
3297
|
+
else if (status === 403) {
|
|
3298
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3299
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3300
|
+
}));
|
|
3301
|
+
}
|
|
3302
|
+
else if (status !== 200 && status !== 204) {
|
|
3303
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3304
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3305
|
+
}));
|
|
3306
|
+
}
|
|
3307
|
+
return rxjs.of(null);
|
|
3308
|
+
};
|
|
3309
|
+
return StorefrontUsersApiClient;
|
|
3310
|
+
}(ApiClientBase));
|
|
3311
|
+
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" });
|
|
3312
|
+
StorefrontUsersApiClient.decorators = [
|
|
3313
|
+
{ type: i0.Injectable, args: [{
|
|
3314
|
+
providedIn: 'root'
|
|
3315
|
+
},] }
|
|
3316
|
+
];
|
|
3317
|
+
StorefrontUsersApiClient.ctorParameters = function () { return [
|
|
3318
|
+
{ type: ApiClientConfiguration, decorators: [{ type: i0.Inject, args: [ApiClientConfiguration,] }] },
|
|
3319
|
+
{ type: i1.HttpClient, decorators: [{ type: i0.Inject, args: [i1.HttpClient,] }] },
|
|
3320
|
+
{ type: String, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [API_BASE_URL,] }] }
|
|
3321
|
+
]; };
|
|
3322
|
+
var TenantInfoApiClient = /** @class */ (function (_super) {
|
|
3323
|
+
__extends(TenantInfoApiClient, _super);
|
|
3324
|
+
function TenantInfoApiClient(configuration, http, baseUrl) {
|
|
3325
|
+
var _this = _super.call(this, configuration) || this;
|
|
3326
|
+
_this.jsonParseReviver = undefined;
|
|
3327
|
+
_this.http = http;
|
|
3328
|
+
_this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : _this.getBaseUrl("");
|
|
3329
|
+
return _this;
|
|
3330
|
+
}
|
|
3331
|
+
/**
|
|
3332
|
+
* Gets information about tenant applications
|
|
3333
|
+
* @param tenantId (optional) Tenant identifier
|
|
3334
|
+
* @param userId (optional) User identifier
|
|
3335
|
+
* @return Success
|
|
3336
|
+
*/
|
|
3337
|
+
TenantInfoApiClient.prototype.getApplicationsInfo = function (tenantId, userId) {
|
|
3338
|
+
var _this = this;
|
|
3339
|
+
var url_ = this.baseUrl + "/api/storefront/v1/tenant-info/applications?";
|
|
3340
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3341
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3342
|
+
if (userId !== undefined && userId !== null)
|
|
3343
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
3344
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3345
|
+
var options_ = {
|
|
3346
|
+
observe: "response",
|
|
3347
|
+
responseType: "blob",
|
|
3348
|
+
headers: new i1.HttpHeaders({
|
|
3349
|
+
"Accept": "text/plain"
|
|
3350
|
+
})
|
|
3351
|
+
};
|
|
3352
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
3353
|
+
return _this.http.request("get", url_, transformedOptions_);
|
|
3354
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
3355
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetApplicationsInfo(r); });
|
|
3356
|
+
})).pipe(operators.catchError(function (response_) {
|
|
3357
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
3358
|
+
try {
|
|
3359
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetApplicationsInfo(r); });
|
|
3360
|
+
}
|
|
3361
|
+
catch (e) {
|
|
3362
|
+
return rxjs.throwError(e);
|
|
3363
|
+
}
|
|
3364
|
+
}
|
|
3365
|
+
else
|
|
3366
|
+
return rxjs.throwError(response_);
|
|
3367
|
+
}));
|
|
3368
|
+
};
|
|
3369
|
+
TenantInfoApiClient.prototype.processGetApplicationsInfo = function (response) {
|
|
3370
|
+
var e_30, _a;
|
|
3371
|
+
var _this = this;
|
|
3372
|
+
var status = response.status;
|
|
3373
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
3374
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
3375
|
+
var _headers = {};
|
|
3376
|
+
if (response.headers) {
|
|
3377
|
+
try {
|
|
3378
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
3379
|
+
var key = _c.value;
|
|
3380
|
+
_headers[key] = response.headers.get(key);
|
|
3381
|
+
}
|
|
3382
|
+
}
|
|
3383
|
+
catch (e_30_1) { e_30 = { error: e_30_1 }; }
|
|
3384
|
+
finally {
|
|
3385
|
+
try {
|
|
3386
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
3387
|
+
}
|
|
3388
|
+
finally { if (e_30) throw e_30.error; }
|
|
3389
|
+
}
|
|
3390
|
+
}
|
|
3391
|
+
if (status === 200) {
|
|
3392
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3393
|
+
var result200 = null;
|
|
3394
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
3395
|
+
return rxjs.of(result200);
|
|
3396
|
+
}));
|
|
3397
|
+
}
|
|
3398
|
+
else if (status === 401) {
|
|
3399
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3400
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3401
|
+
}));
|
|
3402
|
+
}
|
|
3403
|
+
else if (status === 403) {
|
|
3404
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3405
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3406
|
+
}));
|
|
3407
|
+
}
|
|
3408
|
+
else if (status !== 200 && status !== 204) {
|
|
3409
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3410
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3411
|
+
}));
|
|
3412
|
+
}
|
|
3413
|
+
return rxjs.of(null);
|
|
3414
|
+
};
|
|
3415
|
+
/**
|
|
3416
|
+
* Gets information about tenant
|
|
3417
|
+
* @param tenantId (optional) Tenant identifier
|
|
3418
|
+
* @param userId (optional) User identifier
|
|
3419
|
+
* @return Success
|
|
3420
|
+
*/
|
|
3421
|
+
TenantInfoApiClient.prototype.getInfo = function (tenantId, userId) {
|
|
3422
|
+
var _this = this;
|
|
3423
|
+
var url_ = this.baseUrl + "/api/storefront/v1/tenant-info?";
|
|
3424
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3425
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3426
|
+
if (userId !== undefined && userId !== null)
|
|
3427
|
+
url_ += "userId=" + encodeURIComponent("" + userId) + "&";
|
|
3428
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3429
|
+
var options_ = {
|
|
3430
|
+
observe: "response",
|
|
3431
|
+
responseType: "blob",
|
|
3432
|
+
headers: new i1.HttpHeaders({
|
|
3433
|
+
"Accept": "text/plain"
|
|
3434
|
+
})
|
|
3435
|
+
};
|
|
3436
|
+
return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
|
|
3437
|
+
return _this.http.request("get", url_, transformedOptions_);
|
|
3438
|
+
})).pipe(operators.mergeMap(function (response_) {
|
|
3439
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetInfo(r); });
|
|
3440
|
+
})).pipe(operators.catchError(function (response_) {
|
|
3441
|
+
if (response_ instanceof i1.HttpResponseBase) {
|
|
3442
|
+
try {
|
|
3443
|
+
return _this.transformResult(url_, response_, function (r) { return _this.processGetInfo(r); });
|
|
3444
|
+
}
|
|
3445
|
+
catch (e) {
|
|
3446
|
+
return rxjs.throwError(e);
|
|
3447
|
+
}
|
|
3448
|
+
}
|
|
3449
|
+
else
|
|
3450
|
+
return rxjs.throwError(response_);
|
|
3451
|
+
}));
|
|
3452
|
+
};
|
|
3453
|
+
TenantInfoApiClient.prototype.processGetInfo = function (response) {
|
|
3454
|
+
var e_31, _a;
|
|
3455
|
+
var _this = this;
|
|
3456
|
+
var status = response.status;
|
|
3457
|
+
var responseBlob = response instanceof i1.HttpResponse ? response.body :
|
|
3458
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
3459
|
+
var _headers = {};
|
|
3460
|
+
if (response.headers) {
|
|
3461
|
+
try {
|
|
3462
|
+
for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
3463
|
+
var key = _c.value;
|
|
3464
|
+
_headers[key] = response.headers.get(key);
|
|
3465
|
+
}
|
|
3466
|
+
}
|
|
3467
|
+
catch (e_31_1) { e_31 = { error: e_31_1 }; }
|
|
3468
|
+
finally {
|
|
3469
|
+
try {
|
|
3470
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
3471
|
+
}
|
|
3472
|
+
finally { if (e_31) throw e_31.error; }
|
|
3473
|
+
}
|
|
3474
|
+
}
|
|
3475
|
+
if (status === 200) {
|
|
3476
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3477
|
+
var result200 = null;
|
|
3478
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
3479
|
+
return rxjs.of(result200);
|
|
3480
|
+
}));
|
|
3481
|
+
}
|
|
3482
|
+
else if (status === 401) {
|
|
3483
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3484
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3485
|
+
}));
|
|
3486
|
+
}
|
|
3487
|
+
else if (status === 403) {
|
|
3488
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3489
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3490
|
+
}));
|
|
3491
|
+
}
|
|
3492
|
+
else if (status !== 200 && status !== 204) {
|
|
3493
|
+
return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
|
|
3494
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3495
|
+
}));
|
|
3496
|
+
}
|
|
3497
|
+
return rxjs.of(null);
|
|
3498
|
+
};
|
|
3499
|
+
return TenantInfoApiClient;
|
|
3500
|
+
}(ApiClientBase));
|
|
3501
|
+
TenantInfoApiClient.ɵprov = i0.ɵɵdefineInjectable({ factory: function TenantInfoApiClient_Factory() { return new TenantInfoApiClient(i0.ɵɵinject(ApiClientConfiguration), i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(API_BASE_URL, 8)); }, token: TenantInfoApiClient, providedIn: "root" });
|
|
3502
|
+
TenantInfoApiClient.decorators = [
|
|
3503
|
+
{ type: i0.Injectable, args: [{
|
|
3504
|
+
providedIn: 'root'
|
|
3505
|
+
},] }
|
|
3506
|
+
];
|
|
3507
|
+
TenantInfoApiClient.ctorParameters = function () { return [
|
|
3508
|
+
{ type: ApiClientConfiguration, decorators: [{ type: i0.Inject, args: [ApiClientConfiguration,] }] },
|
|
3509
|
+
{ type: i1.HttpClient, decorators: [{ type: i0.Inject, args: [i1.HttpClient,] }] },
|
|
3510
|
+
{ type: String, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [API_BASE_URL,] }] }
|
|
3511
|
+
]; };
|
|
3512
|
+
(function (DatePeriod) {
|
|
3513
|
+
DatePeriod["All"] = "All";
|
|
3514
|
+
DatePeriod["Today"] = "Today";
|
|
3515
|
+
DatePeriod["Last7Days"] = "Last7Days";
|
|
3516
|
+
DatePeriod["Last30Days"] = "Last30Days";
|
|
3517
|
+
})(exports.DatePeriod || (exports.DatePeriod = {}));
|
|
3518
|
+
(function (StorefrontType) {
|
|
3519
|
+
StorefrontType["Custom"] = "Custom";
|
|
3520
|
+
StorefrontType["Shopify"] = "Shopify";
|
|
3521
|
+
StorefrontType["DocketManager"] = "DocketManager";
|
|
3522
|
+
StorefrontType["Auth0Saml"] = "Auth0Saml";
|
|
3523
|
+
})(exports.StorefrontType || (exports.StorefrontType = {}));
|
|
3524
|
+
var ApiException = /** @class */ (function (_super) {
|
|
3525
|
+
__extends(ApiException, _super);
|
|
3526
|
+
function ApiException(message, status, response, headers, result) {
|
|
3527
|
+
var _this = _super.call(this) || this;
|
|
3528
|
+
_this.isApiException = true;
|
|
3529
|
+
_this.message = message;
|
|
3530
|
+
_this.status = status;
|
|
3531
|
+
_this.response = response;
|
|
3532
|
+
_this.headers = headers;
|
|
3533
|
+
_this.result = result;
|
|
3534
|
+
return _this;
|
|
3535
|
+
}
|
|
3536
|
+
ApiException.isApiException = function (obj) {
|
|
3537
|
+
return obj.isApiException === true;
|
|
3538
|
+
};
|
|
3539
|
+
return ApiException;
|
|
3540
|
+
}(Error));
|
|
3541
|
+
function throwException(message, status, response, headers, result) {
|
|
3542
|
+
if (result !== null && result !== undefined)
|
|
3543
|
+
return rxjs.throwError(result);
|
|
3544
|
+
else
|
|
3545
|
+
return rxjs.throwError(new ApiException(message, status, response, headers, null));
|
|
3546
|
+
}
|
|
3547
|
+
function blobToText(blob) {
|
|
3548
|
+
return new rxjs.Observable(function (observer) {
|
|
3549
|
+
if (!blob) {
|
|
3550
|
+
observer.next("");
|
|
3551
|
+
observer.complete();
|
|
3552
|
+
}
|
|
3553
|
+
else {
|
|
3554
|
+
var reader = new FileReader();
|
|
3555
|
+
reader.onload = function (event) {
|
|
3556
|
+
observer.next(event.target.result);
|
|
3557
|
+
observer.complete();
|
|
3558
|
+
};
|
|
3559
|
+
reader.readAsText(blob);
|
|
3560
|
+
}
|
|
3561
|
+
});
|
|
3562
|
+
}
|
|
3563
|
+
|
|
3564
|
+
// @dynamic
|
|
3565
|
+
function CreateApiClientConfiguration(token, apiUrl, apiKey) {
|
|
3566
|
+
if (apiKey === void 0) { apiKey = 'ApiKey'; }
|
|
3567
|
+
var apiConf = new ApiClientConfiguration();
|
|
3568
|
+
apiConf.apiKey = apiKey;
|
|
3569
|
+
apiConf.apiUrl = apiUrl;
|
|
3570
|
+
apiConf.setAuthorizationToken(token);
|
|
3571
|
+
return apiConf;
|
|
3572
|
+
}
|
|
3573
|
+
var StorefrontModule = /** @class */ (function () {
|
|
3574
|
+
function StorefrontModule() {
|
|
3575
|
+
}
|
|
3576
|
+
StorefrontModule.forRoot = function (token, apiUrl, apiKey) {
|
|
3577
|
+
if (apiKey === void 0) { apiKey = 'ApiKey'; }
|
|
3578
|
+
return {
|
|
3579
|
+
ngModule: StorefrontModule,
|
|
3580
|
+
providers: [
|
|
3581
|
+
{
|
|
3582
|
+
provide: API_BASE_URL,
|
|
3583
|
+
useValue: apiUrl
|
|
3584
|
+
},
|
|
3585
|
+
{
|
|
3586
|
+
provide: ApiClientConfiguration,
|
|
3587
|
+
useFactory: CreateApiClientConfiguration.bind(this, token, apiUrl, apiKey)
|
|
3588
|
+
},
|
|
3589
|
+
]
|
|
3590
|
+
};
|
|
3591
|
+
};
|
|
3592
|
+
return StorefrontModule;
|
|
3593
|
+
}());
|
|
3594
|
+
StorefrontModule.decorators = [
|
|
3595
|
+
{ type: i0.NgModule, args: [{
|
|
3596
|
+
declarations: [],
|
|
3597
|
+
imports: [],
|
|
3598
|
+
exports: []
|
|
3599
|
+
},] }
|
|
3600
|
+
];
|
|
3601
|
+
|
|
3602
|
+
/*
|
|
3603
|
+
* Public API Surface of client
|
|
3604
|
+
*/
|
|
3605
|
+
|
|
3606
|
+
/**
|
|
3607
|
+
* Generated bundle index. Do not edit.
|
|
3608
|
+
*/
|
|
3609
|
+
|
|
3610
|
+
exports.API_BASE_URL = API_BASE_URL;
|
|
3611
|
+
exports.ApiClientBase = ApiClientBase;
|
|
3612
|
+
exports.ApiClientConfiguration = ApiClientConfiguration;
|
|
3613
|
+
exports.ApiException = ApiException;
|
|
3614
|
+
exports.BuildInfoApiClient = BuildInfoApiClient;
|
|
3615
|
+
exports.CreateApiClientConfiguration = CreateApiClientConfiguration;
|
|
3616
|
+
exports.ProductReferencesApiClient = ProductReferencesApiClient;
|
|
3617
|
+
exports.ProductSpecificationsApiClient = ProductSpecificationsApiClient;
|
|
3618
|
+
exports.ProjectsApiClient = ProjectsApiClient;
|
|
3619
|
+
exports.StorefrontModule = StorefrontModule;
|
|
3620
|
+
exports.StorefrontUsersApiClient = StorefrontUsersApiClient;
|
|
3621
|
+
exports.StorefrontsApiClient = StorefrontsApiClient;
|
|
3622
|
+
exports.TenantInfoApiClient = TenantInfoApiClient;
|
|
3623
|
+
|
|
3624
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3625
|
+
|
|
3626
|
+
})));
|
|
3627
|
+
//# sourceMappingURL=aurigma-ng-storefront-api-client.umd.js.map
|