@hmxlabs/dax-client 1.0.6

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.
@@ -0,0 +1,824 @@
1
+ /******************************************************************************
2
+ Copyright (c) Microsoft Corporation.
3
+
4
+ Permission to use, copy, modify, and/or distribute this software for any
5
+ purpose with or without fee is hereby granted.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
+ PERFORMANCE OF THIS SOFTWARE.
14
+ ***************************************************************************** */
15
+ /* global Reflect, Promise, SuppressedError, Symbol */
16
+
17
+ var extendStatics = function(d, b) {
18
+ extendStatics = Object.setPrototypeOf ||
19
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
20
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
21
+ return extendStatics(d, b);
22
+ };
23
+
24
+ function __extends(d, b) {
25
+ if (typeof b !== "function" && b !== null)
26
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
27
+ extendStatics(d, b);
28
+ function __() { this.constructor = d; }
29
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
30
+ }
31
+
32
+ var __assign = function() {
33
+ __assign = Object.assign || function __assign(t) {
34
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
35
+ s = arguments[i];
36
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
37
+ }
38
+ return t;
39
+ };
40
+ return __assign.apply(this, arguments);
41
+ };
42
+
43
+ function __rest(s, e) {
44
+ var t = {};
45
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
46
+ t[p] = s[p];
47
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
48
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
49
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
50
+ t[p[i]] = s[p[i]];
51
+ }
52
+ return t;
53
+ }
54
+
55
+ function __awaiter(thisArg, _arguments, P, generator) {
56
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
57
+ return new (P || (P = Promise))(function (resolve, reject) {
58
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
59
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
60
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
61
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
62
+ });
63
+ }
64
+
65
+ function __generator(thisArg, body) {
66
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
67
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
68
+ function verb(n) { return function (v) { return step([n, v]); }; }
69
+ function step(op) {
70
+ if (f) throw new TypeError("Generator is already executing.");
71
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
72
+ 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) return t;
73
+ if (y = 0, t) op = [op[0] & 2, t.value];
74
+ switch (op[0]) {
75
+ case 0: case 1: t = op; break;
76
+ case 4: _.label++; return { value: op[1], done: false };
77
+ case 5: _.label++; y = op[1]; op = [0]; continue;
78
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
79
+ default:
80
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
81
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
82
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
83
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
84
+ if (t[2]) _.ops.pop();
85
+ _.trys.pop(); continue;
86
+ }
87
+ op = body.call(thisArg, _);
88
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
89
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
90
+ }
91
+ }
92
+
93
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
94
+ var e = new Error(message);
95
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
96
+ };
97
+
98
+ /* eslint-disable */
99
+ /** @class */ ((function (_super) {
100
+ __extends(SwaggerMessageError, _super);
101
+ function SwaggerMessageError(message, url, response) {
102
+ var _this = _super.call(this, message) || this;
103
+ _this.url = url;
104
+ _this.response = response;
105
+ _this.name = "SwaggerMessageError";
106
+ return _this;
107
+ }
108
+ return SwaggerMessageError;
109
+ })(Error));
110
+ var HttpClientHttpResponseError = /** @class */ (function (_super) {
111
+ __extends(HttpClientHttpResponseError, _super);
112
+ function HttpClientHttpResponseError(message, httpResponse) {
113
+ var _this = _super.call(this, message) || this;
114
+ _this.httpResponse = httpResponse;
115
+ return _this;
116
+ }
117
+ return HttpClientHttpResponseError;
118
+ }(Error));
119
+ var ContentType;
120
+ (function (ContentType) {
121
+ ContentType["Json"] = "application/json";
122
+ ContentType["FormData"] = "multipart/form-data";
123
+ ContentType["UrlEncoded"] = "application/x-www-form-urlencoded";
124
+ ContentType["Text"] = "text/plain";
125
+ })(ContentType || (ContentType = {}));
126
+ var HttpClient = /** @class */ (function () {
127
+ function HttpClient(apiConfig) {
128
+ var _a;
129
+ if (apiConfig === void 0) { apiConfig = {}; }
130
+ var _this = this;
131
+ this.baseUrl = "https://localhost:44488";
132
+ this.securityData = null;
133
+ this.abortControllers = new Map();
134
+ this.customFetch = function () {
135
+ var fetchParams = [];
136
+ for (var _i = 0; _i < arguments.length; _i++) {
137
+ fetchParams[_i] = arguments[_i];
138
+ }
139
+ return fetch.apply(void 0, fetchParams);
140
+ };
141
+ this.baseApiParams = {
142
+ credentials: "same-origin",
143
+ headers: {},
144
+ redirect: "follow",
145
+ referrerPolicy: "no-referrer",
146
+ };
147
+ this.setSecurityData = function (data) {
148
+ _this.securityData = data;
149
+ };
150
+ this.contentFormatters = (_a = {},
151
+ _a[ContentType.Json] = function (input) {
152
+ return input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input;
153
+ },
154
+ _a[ContentType.Text] = function (input) { return (input !== null && typeof input !== "string" ? JSON.stringify(input) : input); },
155
+ _a[ContentType.FormData] = function (input) {
156
+ return Object.keys(input || {}).reduce(function (formData, key) {
157
+ var property = input[key];
158
+ formData.append(key, property instanceof Blob
159
+ ? property
160
+ : typeof property === "object" && property !== null
161
+ ? JSON.stringify(property)
162
+ : "".concat(property));
163
+ return formData;
164
+ }, new FormData());
165
+ },
166
+ _a[ContentType.UrlEncoded] = function (input) { return _this.toQueryString(input); },
167
+ _a);
168
+ this.createAbortSignal = function (cancelToken) {
169
+ if (_this.abortControllers.has(cancelToken)) {
170
+ var abortController_1 = _this.abortControllers.get(cancelToken);
171
+ if (abortController_1) {
172
+ return abortController_1.signal;
173
+ }
174
+ return void 0;
175
+ }
176
+ var abortController = new AbortController();
177
+ _this.abortControllers.set(cancelToken, abortController);
178
+ return abortController.signal;
179
+ };
180
+ this.abortRequest = function (cancelToken) {
181
+ var abortController = _this.abortControllers.get(cancelToken);
182
+ if (abortController) {
183
+ abortController.abort();
184
+ _this.abortControllers.delete(cancelToken);
185
+ }
186
+ };
187
+ this.request = function (_a) { return __awaiter(_this, void 0, void 0, function () {
188
+ var secureParams, _b, requestParams, queryString, payloadFormatter, responseFormat, signal;
189
+ var _this = this;
190
+ var _c;
191
+ var body = _a.body, secure = _a.secure, path = _a.path, type = _a.type, query = _a.query, format = _a.format, baseUrl = _a.baseUrl, cancelToken = _a.cancelToken, params = __rest(_a, ["body", "secure", "path", "type", "query", "format", "baseUrl", "cancelToken"]);
192
+ return __generator(this, function (_d) {
193
+ switch (_d.label) {
194
+ case 0:
195
+ _b = (typeof secure === "boolean" ? secure : this.baseApiParams.secure) &&
196
+ this.securityWorker;
197
+ if (!_b) return [3 /*break*/, 2];
198
+ return [4 /*yield*/, this.securityWorker(this.securityData)];
199
+ case 1:
200
+ _b = (_d.sent());
201
+ _d.label = 2;
202
+ case 2:
203
+ secureParams = (_b) ||
204
+ {};
205
+ requestParams = this.mergeRequestParams(params, secureParams);
206
+ queryString = query && this.toQueryString(query);
207
+ payloadFormatter = this.contentFormatters[type || ContentType.Json];
208
+ responseFormat = format || requestParams.format;
209
+ signal = (_c = requestParams.signal) !== null && _c !== void 0 ? _c : this.abortPreviousRequestAndCreateSignal(cancelToken !== null && cancelToken !== void 0 ? cancelToken : path);
210
+ return [2 /*return*/, this.customFetch("".concat(baseUrl || this.baseUrl || "").concat(path).concat(queryString ? "?".concat(queryString) : ""), __assign(__assign({}, requestParams), { headers: __assign(__assign({}, (requestParams.headers || {})), (type && type !== ContentType.FormData ? { "Content-Type": type } : {})), signal: signal, body: typeof body === "undefined" || body === null ? null : payloadFormatter(body) })).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
211
+ var r, data, _a;
212
+ return __generator(this, function (_b) {
213
+ switch (_b.label) {
214
+ case 0:
215
+ r = response;
216
+ r.data = null;
217
+ r.error = null;
218
+ if (!!responseFormat) return [3 /*break*/, 1];
219
+ _a = r;
220
+ return [3 /*break*/, 3];
221
+ case 1: return [4 /*yield*/, response[responseFormat]()
222
+ .then(function (data) {
223
+ if (r.ok) {
224
+ r.data = data;
225
+ }
226
+ else {
227
+ r.error = data;
228
+ }
229
+ return r;
230
+ })
231
+ .catch(function (e) {
232
+ r.error = e;
233
+ return r;
234
+ })];
235
+ case 2:
236
+ _a = _b.sent();
237
+ _b.label = 3;
238
+ case 3:
239
+ data = _a;
240
+ if (cancelToken) {
241
+ this.abortControllers.delete(cancelToken);
242
+ }
243
+ if (!response.ok) {
244
+ throw new HttpClientHttpResponseError("HttpClient response error", data);
245
+ }
246
+ return [2 /*return*/, data.data];
247
+ }
248
+ });
249
+ }); })];
250
+ }
251
+ });
252
+ }); };
253
+ Object.assign(this, apiConfig);
254
+ }
255
+ HttpClient.prototype.encodeQueryParam = function (key, value) {
256
+ var encodedKey = encodeURIComponent(key);
257
+ return "".concat(encodedKey, "=").concat(encodeURIComponent(typeof value === "number" ? value : "".concat(value)));
258
+ };
259
+ HttpClient.prototype.addQueryParam = function (query, key) {
260
+ return this.encodeQueryParam(key, query[key]);
261
+ };
262
+ HttpClient.prototype.addArrayQueryParam = function (query, key) {
263
+ var _this = this;
264
+ var value = query[key];
265
+ return value.map(function (v) { return _this.encodeQueryParam(key, v); }).join("&");
266
+ };
267
+ HttpClient.prototype.toQueryString = function (rawQuery) {
268
+ var _this = this;
269
+ var query = rawQuery || {};
270
+ var keys = Object.keys(query).filter(function (key) { return "undefined" !== typeof query[key]; });
271
+ return keys
272
+ .map(function (key) { return (Array.isArray(query[key]) ? _this.addArrayQueryParam(query, key) : _this.addQueryParam(query, key)); })
273
+ .join("&");
274
+ };
275
+ HttpClient.prototype.addQueryParams = function (rawQuery) {
276
+ var queryString = this.toQueryString(rawQuery);
277
+ return queryString ? "?".concat(queryString) : "";
278
+ };
279
+ HttpClient.prototype.mergeRequestParams = function (params1, params2) {
280
+ return __assign(__assign(__assign(__assign({}, this.baseApiParams), params1), (params2 || {})), { headers: __assign(__assign(__assign({}, (this.baseApiParams.headers || {})), (params1.headers || {})), ((params2 && params2.headers) || {})) });
281
+ };
282
+ HttpClient.prototype.abortPreviousRequestAndCreateSignal = function (cancelToken) {
283
+ this.abortRequest(cancelToken);
284
+ return this.createAbortSignal(cancelToken);
285
+ };
286
+ return HttpClient;
287
+ }());
288
+
289
+ /* eslint-disable */
290
+ var Api = /** @class */ (function (_super) {
291
+ __extends(Api, _super);
292
+ function Api() {
293
+ var _this = _super !== null && _super.apply(this, arguments) || this;
294
+ /**
295
+ * No description
296
+ *
297
+ * @tags Authentication
298
+ * @name AuthenticationRegister
299
+ * @summary Register a new user
300
+ * @request POST:/api/v1/auth/register
301
+ * @response `200` `object`
302
+ */
303
+ _this.authenticationRegister = function (data, params) {
304
+ if (params === void 0) { params = {}; }
305
+ return _this.request(__assign({ path: "/api/v1/auth/register", method: "POST", body: data, type: ContentType.Json, format: "json" }, params));
306
+ };
307
+ /**
308
+ * No description
309
+ *
310
+ * @tags Authentication
311
+ * @name AuthenticationLogin
312
+ * @summary Login
313
+ * @request POST:/api/v1/auth/login
314
+ * @response `200` `object`
315
+ */
316
+ _this.authenticationLogin = function (data, params) {
317
+ if (params === void 0) { params = {}; }
318
+ return _this.request(__assign({ path: "/api/v1/auth/login", method: "POST", body: data, type: ContentType.Json, format: "json" }, params));
319
+ };
320
+ /**
321
+ * No description
322
+ *
323
+ * @tags Bid
324
+ * @name BidFindAll
325
+ * @request GET:/api/v1/tenant/{tenantId}/auction/{listingId}/bid
326
+ * @response `200` `object`
327
+ */
328
+ _this.bidFindAll = function (tenantId, listingId, query, params) {
329
+ if (params === void 0) { params = {}; }
330
+ return _this.request(__assign({ path: "/api/v1/tenant/".concat(tenantId, "/auction/").concat(listingId, "/bid"), method: "GET", query: query, format: "json" }, params));
331
+ };
332
+ /**
333
+ * No description
334
+ *
335
+ * @tags Bid
336
+ * @name BidCreate
337
+ * @request POST:/api/v1/tenant/{tenantId}/auction/{listingId}/bid
338
+ * @secure
339
+ * @response `200` `object`
340
+ */
341
+ _this.bidCreate = function (tenantId, listingId, data, params) {
342
+ if (params === void 0) { params = {}; }
343
+ return _this.request(__assign({ path: "/api/v1/tenant/".concat(tenantId, "/auction/").concat(listingId, "/bid"), method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
344
+ };
345
+ /**
346
+ * No description
347
+ *
348
+ * @tags Bid
349
+ * @name BidGetById
350
+ * @request GET:/api/v1/tenant/{tenantId}/auction/{listingId}/bid/{id}
351
+ * @secure
352
+ * @response `200` `object`
353
+ */
354
+ _this.bidGetById = function (tenantId, listingId, id, params) {
355
+ if (params === void 0) { params = {}; }
356
+ return _this.request(__assign({ path: "/api/v1/tenant/".concat(tenantId, "/auction/").concat(listingId, "/bid/").concat(id), method: "GET", secure: true, format: "json" }, params));
357
+ };
358
+ /**
359
+ * No description
360
+ *
361
+ * @tags Bid
362
+ * @name BidDelete
363
+ * @request DELETE:/api/v1/tenant/{tenantId}/auction/{listingId}/bid/{id}
364
+ * @secure
365
+ * @response `200` `File`
366
+ */
367
+ _this.bidDelete = function (tenantId, listingId, id, data, params) {
368
+ if (params === void 0) { params = {}; }
369
+ return _this.request(__assign({ path: "/api/v1/tenant/".concat(tenantId, "/auction/").concat(listingId, "/bid/").concat(id), method: "DELETE", body: data, secure: true, type: ContentType.Json }, params));
370
+ };
371
+ /**
372
+ * No description
373
+ *
374
+ * @tags Comment
375
+ * @name CommentFindAll
376
+ * @summary Get all comments and responses for a listing
377
+ * @request GET:/api/v1/tenant/{tenantId}/listings/{listingId}/comments
378
+ * @secure
379
+ * @response `200` `object`
380
+ */
381
+ _this.commentFindAll = function (tenantId, listingId, query, params) {
382
+ if (params === void 0) { params = {}; }
383
+ return _this.request(__assign({ path: "/api/v1/tenant/".concat(tenantId, "/listings/").concat(listingId, "/comments"), method: "GET", query: query, secure: true, format: "json" }, params));
384
+ };
385
+ /**
386
+ * No description
387
+ *
388
+ * @tags Comment
389
+ * @name CommentCreate
390
+ * @request POST:/api/v1/tenant/{tenantId}/listings/{listingId}/comments
391
+ * @secure
392
+ * @response `200` `object`
393
+ */
394
+ _this.commentCreate = function (tenantId, listingId, data, params) {
395
+ if (params === void 0) { params = {}; }
396
+ return _this.request(__assign({ path: "/api/v1/tenant/".concat(tenantId, "/listings/").concat(listingId, "/comments"), method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
397
+ };
398
+ /**
399
+ * No description
400
+ *
401
+ * @tags Comment
402
+ * @name CommentDelete
403
+ * @request DELETE:/api/v1/tenant/{tenantId}/listings/{listingId}/comments/{id}
404
+ * @secure
405
+ * @response `200` `File`
406
+ */
407
+ _this.commentDelete = function (tenantId, listingId, id, params) {
408
+ if (params === void 0) { params = {}; }
409
+ return _this.request(__assign({ path: "/api/v1/tenant/".concat(tenantId, "/listings/").concat(listingId, "/comments/").concat(id), method: "DELETE", secure: true }, params));
410
+ };
411
+ /**
412
+ * No description
413
+ *
414
+ * @tags Currency
415
+ * @name CurrencyGetByCode
416
+ * @summary Get currency details
417
+ * @request GET:/api/v1/currency/{code}
418
+ * @response `200` `object`
419
+ */
420
+ _this.currencyGetByCode = function (code, query, params) {
421
+ if (params === void 0) { params = {}; }
422
+ return _this.request(__assign({ path: "/api/v1/currency/".concat(code), method: "GET", query: query, format: "json" }, params));
423
+ };
424
+ /**
425
+ * No description
426
+ *
427
+ * @tags Currency
428
+ * @name CurrencyFindAll
429
+ * @summary Get all the currencies
430
+ * @request GET:/api/v1/currency
431
+ * @response `200` `object`
432
+ */
433
+ _this.currencyFindAll = function (query, params) {
434
+ if (params === void 0) { params = {}; }
435
+ return _this.request(__assign({ path: "/api/v1/currency", method: "GET", query: query, format: "json" }, params));
436
+ };
437
+ /**
438
+ * No description
439
+ *
440
+ * @tags Fee
441
+ * @name FeeGetById
442
+ * @summary Get fee details
443
+ * @request GET:/api/v1/tenant/{tenantId}/fee/{id}
444
+ * @secure
445
+ * @response `200` `object`
446
+ */
447
+ _this.feeGetById = function (tenantId, id, query, params) {
448
+ if (params === void 0) { params = {}; }
449
+ return _this.request(__assign({ path: "/api/v1/tenant/".concat(tenantId, "/fee/").concat(id), method: "GET", query: query, secure: true, format: "json" }, params));
450
+ };
451
+ /**
452
+ * No description
453
+ *
454
+ * @tags Fee
455
+ * @name FeeUpdate
456
+ * @summary Update an existing active fee
457
+ * @request PUT:/api/v1/tenant/{tenantId}/fee/{id}
458
+ * @secure
459
+ * @response `200` `FeeResponse` Success
460
+ */
461
+ _this.feeUpdate = function (tenantId, id, data, params) {
462
+ if (params === void 0) { params = {}; }
463
+ return _this.request(__assign({ path: "/api/v1/tenant/".concat(tenantId, "/fee/").concat(id), method: "PUT", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
464
+ };
465
+ /**
466
+ * No description
467
+ *
468
+ * @tags Fee
469
+ * @name FeeDelete
470
+ * @summary Delete an existing active fee for a tenant
471
+ * @request DELETE:/api/v1/tenant/{tenantId}/fee/{id}
472
+ * @secure
473
+ * @response `200` `File` Success
474
+ */
475
+ _this.feeDelete = function (tenantId, id, params) {
476
+ if (params === void 0) { params = {}; }
477
+ return _this.request(__assign({ path: "/api/v1/tenant/".concat(tenantId, "/fee/").concat(id), method: "DELETE", secure: true }, params));
478
+ };
479
+ /**
480
+ * No description
481
+ *
482
+ * @tags Fee
483
+ * @name FeeFindAll
484
+ * @summary Get all the fees for a tenant
485
+ * @request GET:/api/v1/tenant/{tenantId}/fee
486
+ * @secure
487
+ * @response `200` `object`
488
+ */
489
+ _this.feeFindAll = function (tenantId, query, params) {
490
+ if (params === void 0) { params = {}; }
491
+ return _this.request(__assign({ path: "/api/v1/tenant/".concat(tenantId, "/fee"), method: "GET", query: query, secure: true, format: "json" }, params));
492
+ };
493
+ /**
494
+ * No description
495
+ *
496
+ * @tags Fee
497
+ * @name FeeCreate
498
+ * @summary Create a new fee for a tenant
499
+ * @request POST:/api/v1/tenant/{tenantId}/fee
500
+ * @secure
501
+ * @response `200` `object`
502
+ */
503
+ _this.feeCreate = function (tenantId, data, params) {
504
+ if (params === void 0) { params = {}; }
505
+ return _this.request(__assign({ path: "/api/v1/tenant/".concat(tenantId, "/fee"), method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
506
+ };
507
+ /**
508
+ * No description
509
+ *
510
+ * @tags Item
511
+ * @name ItemGetById
512
+ * @summary Get item for tenant
513
+ * @request GET:/api/v1/tenant/{tenantId}/item/{itemId}
514
+ * @secure
515
+ * @response `200` `object`
516
+ */
517
+ _this.itemGetById = function (tenantId, itemId, query, params) {
518
+ if (params === void 0) { params = {}; }
519
+ return _this.request(__assign({ path: "/api/v1/tenant/".concat(tenantId, "/item/").concat(itemId), method: "GET", query: query, secure: true, format: "json" }, params));
520
+ };
521
+ /**
522
+ * No description
523
+ *
524
+ * @tags Item
525
+ * @name ItemDelete
526
+ * @summary Remove an existing item
527
+ * @request DELETE:/api/v1/tenant/{tenantId}/item/{itemId}
528
+ * @secure
529
+ * @response `200` `File` Success
530
+ */
531
+ _this.itemDelete = function (tenantId, itemId, params) {
532
+ if (params === void 0) { params = {}; }
533
+ return _this.request(__assign({ path: "/api/v1/tenant/".concat(tenantId, "/item/").concat(itemId), method: "DELETE", secure: true }, params));
534
+ };
535
+ /**
536
+ * No description
537
+ *
538
+ * @tags Item
539
+ * @name ItemUpdate
540
+ * @request PUT:/api/v1/tenant/{tenantId}/item/{itemId}
541
+ * @secure
542
+ * @response `200` `File`
543
+ */
544
+ _this.itemUpdate = function (tenantId, itemId, data, params) {
545
+ if (params === void 0) { params = {}; }
546
+ return _this.request(__assign({ path: "/api/v1/tenant/".concat(tenantId, "/item/").concat(itemId), method: "PUT", body: data, secure: true, type: ContentType.Json }, params));
547
+ };
548
+ /**
549
+ * No description
550
+ *
551
+ * @tags Item
552
+ * @name ItemFindAll
553
+ * @summary Get a list of all the product items
554
+ * @request GET:/api/v1/tenant/{tenantId}/item
555
+ * @secure
556
+ * @response `200` `object`
557
+ */
558
+ _this.itemFindAll = function (tenantId, query, params) {
559
+ if (params === void 0) { params = {}; }
560
+ return _this.request(__assign({ path: "/api/v1/tenant/".concat(tenantId, "/item"), method: "GET", query: query, secure: true, format: "json" }, params));
561
+ };
562
+ /**
563
+ * No description
564
+ *
565
+ * @tags Item
566
+ * @name ItemCreate
567
+ * @summary Create a new item
568
+ * @request POST:/api/v1/tenant/{tenantId}/item
569
+ * @secure
570
+ * @response `200` `object`
571
+ */
572
+ _this.itemCreate = function (tenantId, data, params) {
573
+ if (params === void 0) { params = {}; }
574
+ return _this.request(__assign({ path: "/api/v1/tenant/".concat(tenantId, "/item"), method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
575
+ };
576
+ /**
577
+ * No description
578
+ *
579
+ * @tags Listing
580
+ * @name ListingGetById
581
+ * @summary Get listing details
582
+ * @request GET:/api/v1/tenant/{tenantId}/listing/{id}
583
+ * @response `200` `object`
584
+ */
585
+ _this.listingGetById = function (tenantId, id, params) {
586
+ if (params === void 0) { params = {}; }
587
+ return _this.request(__assign({ path: "/api/v1/tenant/".concat(tenantId, "/listing/").concat(id), method: "GET", format: "json" }, params));
588
+ };
589
+ /**
590
+ * No description
591
+ *
592
+ * @tags Listing
593
+ * @name ListingFindAllByTenantId
594
+ * @summary Get all the listings for the specified tenant
595
+ * @request GET:/api/v1/tenant/{tenantId}/listing
596
+ * @response `200` `object`
597
+ */
598
+ _this.listingFindAllByTenantId = function (tenantId, query, params) {
599
+ if (params === void 0) { params = {}; }
600
+ return _this.request(__assign({ path: "/api/v1/tenant/".concat(tenantId, "/listing"), method: "GET", query: query, format: "json" }, params));
601
+ };
602
+ /**
603
+ * No description
604
+ *
605
+ * @tags ListingDetail
606
+ * @name ListingDetailGetById
607
+ * @summary Get listing details, including product and item information
608
+ * @request GET:/api/v1/tenant/{tenantId}/listing-detail/{id}
609
+ * @response `200` `object`
610
+ */
611
+ _this.listingDetailGetById = function (tenantId, id, params) {
612
+ if (params === void 0) { params = {}; }
613
+ return _this.request(__assign({ path: "/api/v1/tenant/".concat(tenantId, "/listing-detail/").concat(id), method: "GET", format: "json" }, params));
614
+ };
615
+ /**
616
+ * No description
617
+ *
618
+ * @tags ListingDetail
619
+ * @name ListingDetailFindAllByTenantId
620
+ * @summary Get all the listing details for the specified tenant, including product and item information
621
+ * @request GET:/api/v1/tenant/{tenantId}/listing-detail
622
+ * @response `200` `object`
623
+ */
624
+ _this.listingDetailFindAllByTenantId = function (tenantId, query, params) {
625
+ if (params === void 0) { params = {}; }
626
+ return _this.request(__assign({ path: "/api/v1/tenant/".concat(tenantId, "/listing-detail"), method: "GET", query: query, format: "json" }, params));
627
+ };
628
+ /**
629
+ * No description
630
+ *
631
+ * @tags ListingStatusCount
632
+ * @name ListingStatusCountFindAllByTenantId
633
+ * @summary Get the count for all the listings for a tenant grouped by the listing status
634
+ * @request GET:/api/v1/tenant/{tenantId}/listing-status-count
635
+ * @response `200` `object`
636
+ */
637
+ _this.listingStatusCountFindAllByTenantId = function (tenantId, query, params) {
638
+ if (params === void 0) { params = {}; }
639
+ return _this.request(__assign({ path: "/api/v1/tenant/".concat(tenantId, "/listing-status-count"), method: "GET", query: query, format: "json" }, params));
640
+ };
641
+ /**
642
+ * No description
643
+ *
644
+ * @tags ProductClass
645
+ * @name ProductClassFindProductClasses
646
+ * @summary Only for Dax Admin. Get all product classes
647
+ * @request GET:/api/v1/admin/product-class
648
+ * @secure
649
+ * @response `200` `object`
650
+ */
651
+ _this.productClassFindProductClasses = function (query, params) {
652
+ if (params === void 0) { params = {}; }
653
+ return _this.request(__assign({ path: "/api/v1/admin/product-class", method: "GET", query: query, secure: true, format: "json" }, params));
654
+ };
655
+ /**
656
+ * No description
657
+ *
658
+ * @tags ProductClass
659
+ * @name ProductClassAddProductClass
660
+ * @summary Only for Dax Admin. Create a new product class
661
+ * @request POST:/api/v1/admin/product-class
662
+ * @secure
663
+ * @response `200` `object`
664
+ */
665
+ _this.productClassAddProductClass = function (data, params) {
666
+ if (params === void 0) { params = {}; }
667
+ return _this.request(__assign({ path: "/api/v1/admin/product-class", method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
668
+ };
669
+ /**
670
+ * No description
671
+ *
672
+ * @tags ProductClass
673
+ * @name ProductClassGetProductClassWithAssignedTenants
674
+ * @summary Only for Dax Admin. Get product class for specified id with all tenants assigned to it
675
+ * @request GET:/api/v1/admin/product-class/{id}
676
+ * @secure
677
+ * @response `200` `object`
678
+ */
679
+ _this.productClassGetProductClassWithAssignedTenants = function (id, query, params) {
680
+ if (params === void 0) { params = {}; }
681
+ return _this.request(__assign({ path: "/api/v1/admin/product-class/".concat(id), method: "GET", query: query, secure: true, format: "json" }, params));
682
+ };
683
+ /**
684
+ * No description
685
+ *
686
+ * @tags ProductClass
687
+ * @name ProductClassUpdateProductClass
688
+ * @summary Only for Dax Admin. Update an existing active product class.
689
+ * @request PUT:/api/v1/admin/product-class/{id}
690
+ * @secure
691
+ * @response `204` `void` Success
692
+ * @response `400` `ProblemDetails`
693
+ * @response `404` `ProblemDetails`
694
+ * @response `default` `ProblemDetails`
695
+ */
696
+ _this.productClassUpdateProductClass = function (id, data, params) {
697
+ if (params === void 0) { params = {}; }
698
+ return _this.request(__assign({ path: "/api/v1/admin/product-class/".concat(id), method: "PUT", body: data, secure: true, type: ContentType.Json }, params));
699
+ };
700
+ /**
701
+ * No description
702
+ *
703
+ * @tags ProductClass
704
+ * @name ProductClassDeleteProductClass
705
+ * @summary Only for Dax Admin. Delete an existing active product class
706
+ * @request DELETE:/api/v1/admin/product-class/{id}
707
+ * @secure
708
+ * @response `200` `void` Success
709
+ * @response `400` `ProblemDetails`
710
+ * @response `404` `ProblemDetails`
711
+ * @response `default` `ProblemDetails`
712
+ */
713
+ _this.productClassDeleteProductClass = function (id, params) {
714
+ if (params === void 0) { params = {}; }
715
+ return _this.request(__assign({ path: "/api/v1/admin/product-class/".concat(id), method: "DELETE", secure: true }, params));
716
+ };
717
+ /**
718
+ * No description
719
+ *
720
+ * @tags ProductClass
721
+ * @name ProductClassFindProductClassesByTenantId
722
+ * @summary Get Product Classes for a Tenant
723
+ * @request GET:/api/v1/tenant/{tenantId}/product-class
724
+ * @response `200` `object`
725
+ */
726
+ _this.productClassFindProductClassesByTenantId = function (tenantId, query, params) {
727
+ if (params === void 0) { params = {}; }
728
+ return _this.request(__assign({ path: "/api/v1/tenant/".concat(tenantId, "/product-class"), method: "GET", query: query, format: "json" }, params));
729
+ };
730
+ /**
731
+ * No description
732
+ *
733
+ * @tags ProductClass
734
+ * @name ProductClassAssignProductClassToTenant
735
+ * @summary Only for Dax Admin. Assign product classes for specified tenant
736
+ * @request PUT:/api/v1/admin/tenant/{tenantId}/product-class/{id}
737
+ * @secure
738
+ * @response `200` `File` Success
739
+ */
740
+ _this.productClassAssignProductClassToTenant = function (tenantId, id, params) {
741
+ if (params === void 0) { params = {}; }
742
+ return _this.request(__assign({ path: "/api/v1/admin/tenant/".concat(tenantId, "/product-class/").concat(id), method: "PUT", secure: true }, params));
743
+ };
744
+ /**
745
+ * No description
746
+ *
747
+ * @tags ProductClass
748
+ * @name ProductClassRemoveProductClassFromTenant
749
+ * @summary Only for Dax Admin. Remove product classes from specified tenant
750
+ * @request DELETE:/api/v1/admin/tenant/{tenantId}/product-class/{id}
751
+ * @secure
752
+ * @response `200` `File` Success
753
+ */
754
+ _this.productClassRemoveProductClassFromTenant = function (tenantId, id, params) {
755
+ if (params === void 0) { params = {}; }
756
+ return _this.request(__assign({ path: "/api/v1/admin/tenant/".concat(tenantId, "/product-class/").concat(id), method: "DELETE", secure: true }, params));
757
+ };
758
+ /**
759
+ * No description
760
+ *
761
+ * @tags Product
762
+ * @name ProductGetById
763
+ * @request GET:/api/v1/tenant/{tenantId}/product/{id}
764
+ * @response `200` `object`
765
+ */
766
+ _this.productGetById = function (tenantId, id, params) {
767
+ if (params === void 0) { params = {}; }
768
+ return _this.request(__assign({ path: "/api/v1/tenant/".concat(tenantId, "/product/").concat(id), method: "GET", format: "json" }, params));
769
+ };
770
+ /**
771
+ * No description
772
+ *
773
+ * @tags Product
774
+ * @name ProductFindAllByTenantId
775
+ * @request GET:/api/v1/tenant/{tenantId}/product
776
+ * @response `200` `object`
777
+ */
778
+ _this.productFindAllByTenantId = function (tenantId, params) {
779
+ if (params === void 0) { params = {}; }
780
+ return _this.request(__assign({ path: "/api/v1/tenant/".concat(tenantId, "/product"), method: "GET", format: "json" }, params));
781
+ };
782
+ /**
783
+ * No description
784
+ *
785
+ * @tags Tenant
786
+ * @name TenantGetById
787
+ * @request GET:/api/v1/tenant/{tenantId}
788
+ * @response `200` `object`
789
+ */
790
+ _this.tenantGetById = function (tenantId, params) {
791
+ if (params === void 0) { params = {}; }
792
+ return _this.request(__assign({ path: "/api/v1/tenant/".concat(tenantId), method: "GET", format: "json" }, params));
793
+ };
794
+ return _this;
795
+ }
796
+ return Api;
797
+ }(HttpClient));
798
+
799
+ var _a;
800
+ var apiConfig = {
801
+ baseUrl: '/dax-api'
802
+ };
803
+ var TenantId = (_a = process.env.REACT_APP_TENANT_ID) !== null && _a !== void 0 ? _a : '';
804
+ var daxApi = new Api(apiConfig);
805
+ var checkTentantIdSpecified = function () {
806
+ if (!TenantId) {
807
+ throw new Error('Tenant Id not specified. Use the REACT_APP_TENANT_ID environment variable to set it.');
808
+ }
809
+ };
810
+ var listingDetailFindAll = function (listingType, listingStatus) {
811
+ checkTentantIdSpecified();
812
+ return daxApi.listingDetailFindAllByTenantId(TenantId, __assign(__assign({}, (listingType ? { listingType: listingType } : {})), (listingStatus ? { listingStatus: listingStatus } : {})));
813
+ };
814
+ var listingDetailById = function (id) {
815
+ checkTentantIdSpecified();
816
+ return daxApi.listingDetailGetById(TenantId, id);
817
+ };
818
+ var listingStatusCountFindAll = function (listingType, listingStatus) {
819
+ checkTentantIdSpecified();
820
+ return daxApi.listingStatusCountFindAllByTenantId(TenantId, __assign(__assign({}, (listingType ? { listingType: listingType } : {})), (listingStatus ? { listingStatus: listingStatus } : {})));
821
+ };
822
+
823
+ export { daxApi, listingDetailById, listingDetailFindAll, listingStatusCountFindAll };
824
+ //# sourceMappingURL=index.esm.js.map