@thelllabs/winehaus-sdk 0.0.4 → 0.0.7

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/dist/umd/index.ts CHANGED
@@ -16087,13 +16087,13 @@ var WinehausSDK = /** @class */ (function () {
16087
16087
  case 0:
16088
16088
  if (!(((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.status) === 401 &&
16089
16089
  this.authToken &&
16090
- this.refreshToken &&
16090
+ // ToDO: Uncomment this this.refreshToken &&
16091
16091
  !refreshTokenUsed.has(this.refreshToken))) return [3 /*break*/, 4];
16092
16092
  refreshTokenUsed.add(this.refreshToken);
16093
16093
  _c.label = 1;
16094
16094
  case 1:
16095
16095
  _c.trys.push([1, 3, , 4]);
16096
- return [4 /*yield*/, this.refreshTokens()];
16096
+ return [4 /*yield*/, this.refreshTokens({ throwError: true })];
16097
16097
  case 2:
16098
16098
  _c.sent();
16099
16099
  return [3 /*break*/, 4];
@@ -16121,10 +16121,22 @@ var WinehausSDK = /** @class */ (function () {
16121
16121
  case 0:
16122
16122
  if (!(opts === null || opts === void 0 ? void 0 : opts.avoidEvents))
16123
16123
  this.emitter.emit('connecting');
16124
+ if (!((credential === null || credential === void 0 ? void 0 : credential.email) && (credential === null || credential === void 0 ? void 0 : credential.password))) return [3 /*break*/, 2];
16124
16125
  return [4 /*yield*/, this.authenticateAsUser(credential)];
16125
16126
  case 1:
16126
16127
  _a.sent();
16127
- this.credential = credential;
16128
+ this.signInCredential = credential;
16129
+ return [3 /*break*/, 5];
16130
+ case 2:
16131
+ if (!(credential === null || credential === void 0 ? void 0 : credential.authToken)) return [3 /*break*/, 4];
16132
+ // ToDO add && (credential as any)?.refreshToken after refreshToken is ready
16133
+ return [4 /*yield*/, this.authenticateAsToken(credential)];
16134
+ case 3:
16135
+ // ToDO add && (credential as any)?.refreshToken after refreshToken is ready
16136
+ _a.sent();
16137
+ return [3 /*break*/, 5];
16138
+ case 4: throw new Error("Invalid auth credential type format");
16139
+ case 5:
16128
16140
  if (!(opts === null || opts === void 0 ? void 0 : opts.avoidEvents))
16129
16141
  this.emitter.emit('connected');
16130
16142
  this.hookTimer();
@@ -16133,14 +16145,17 @@ var WinehausSDK = /** @class */ (function () {
16133
16145
  });
16134
16146
  });
16135
16147
  };
16136
- WinehausSDK.prototype.reAuthenticate = function () {
16148
+ WinehausSDK.prototype.reAuthenticate = function (opts) {
16137
16149
  return __awaiter(this, void 0, void 0, function () {
16138
16150
  return __generator(this, function (_a) {
16139
16151
  switch (_a.label) {
16140
16152
  case 0:
16141
- if (!this.credential)
16142
- throw new Error('No credential found');
16143
- return [4 /*yield*/, this.authenticate(this.credential)];
16153
+ if (!this.signInCredential) {
16154
+ if (opts === null || opts === void 0 ? void 0 : opts.throwError)
16155
+ new Error("No SignIn set to make re-auth");
16156
+ return [2 /*return*/];
16157
+ }
16158
+ return [4 /*yield*/, this.authenticate(this.signInCredential, { avoidEvents: true })];
16144
16159
  case 1:
16145
16160
  _a.sent();
16146
16161
  return [2 /*return*/];
@@ -16169,7 +16184,8 @@ var WinehausSDK = /** @class */ (function () {
16169
16184
  return __generator(this, function (_b) {
16170
16185
  switch (_b.label) {
16171
16186
  case 0:
16172
- if (!this.authToken || !this.refreshToken) {
16187
+ //Todo: add || !this.refreshToken after implementing it here
16188
+ if (!this.authToken) {
16173
16189
  return [2 /*return*/, this.clearTokens()];
16174
16190
  }
16175
16191
  if (!((_a = this.authTokenDecoded) === null || _a === void 0 ? void 0 : _a.exp)) {
@@ -16214,14 +16230,14 @@ var WinehausSDK = /** @class */ (function () {
16214
16230
  WinehausSDK.prototype.getRefreshToken = function () {
16215
16231
  return this.refreshToken.toString();
16216
16232
  };
16217
- WinehausSDK.prototype.refreshTokens = function () {
16233
+ WinehausSDK.prototype.refreshTokens = function (opts) {
16218
16234
  return __awaiter(this, void 0, void 0, function () {
16219
16235
  return __generator(this, function (_a) {
16220
16236
  switch (_a.label) {
16221
16237
  case 0:
16222
16238
  // ToDo: Refresh token is not implemented under this version. For a while, lets just re-auth
16223
16239
  this.clearTokens();
16224
- return [4 /*yield*/, this.reAuthenticate()];
16240
+ return [4 /*yield*/, this.reAuthenticate(opts)];
16225
16241
  case 1:
16226
16242
  _a.sent();
16227
16243
  return [2 /*return*/];
@@ -16247,6 +16263,14 @@ var WinehausSDK = /** @class */ (function () {
16247
16263
  });
16248
16264
  });
16249
16265
  };
16266
+ WinehausSDK.prototype.authenticateAsToken = function (credential) {
16267
+ return __awaiter(this, void 0, void 0, function () {
16268
+ return __generator(this, function (_a) {
16269
+ this.setTokens({ token: credential.authToken, refreshToken: credential.refreshToken });
16270
+ return [2 /*return*/];
16271
+ });
16272
+ });
16273
+ };
16250
16274
  WinehausSDK.prototype.setTokens = function (data) {
16251
16275
  this.setAuthToken(data.token);
16252
16276
  this.setRefreshToken(data.refreshToken);
@@ -18386,41 +18410,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
18386
18410
  return (mod && mod.__esModule) ? mod : { "default": mod };
18387
18411
  };
18388
18412
  Object.defineProperty(exports, "__esModule", ({ value: true }));
18389
- exports.Api = exports.HttpClient = exports.ContentType = exports.TenantUserEntityDtoStatusEnum = exports.TenantUserEntityDtoRolesEnum = exports.OrderByEnum = exports.ListTenantUsersParamsStatusEnum = exports.ListTenantUsersParamsRolesEnum = exports.CreateTenantUserDtoRolesEnum = void 0;
18390
- var CreateTenantUserDtoRolesEnum;
18391
- (function (CreateTenantUserDtoRolesEnum) {
18392
- CreateTenantUserDtoRolesEnum["Operator"] = "operator";
18393
- CreateTenantUserDtoRolesEnum["Admin"] = "admin";
18394
- CreateTenantUserDtoRolesEnum["Owner"] = "owner";
18395
- })(CreateTenantUserDtoRolesEnum = exports.CreateTenantUserDtoRolesEnum || (exports.CreateTenantUserDtoRolesEnum = {}));
18396
- var ListTenantUsersParamsRolesEnum;
18397
- (function (ListTenantUsersParamsRolesEnum) {
18398
- ListTenantUsersParamsRolesEnum["Operator"] = "operator";
18399
- ListTenantUsersParamsRolesEnum["Admin"] = "admin";
18400
- ListTenantUsersParamsRolesEnum["Owner"] = "owner";
18401
- })(ListTenantUsersParamsRolesEnum = exports.ListTenantUsersParamsRolesEnum || (exports.ListTenantUsersParamsRolesEnum = {}));
18402
- var ListTenantUsersParamsStatusEnum;
18403
- (function (ListTenantUsersParamsStatusEnum) {
18404
- ListTenantUsersParamsStatusEnum["Enabled"] = "enabled";
18405
- ListTenantUsersParamsStatusEnum["Blocked"] = "blocked";
18406
- })(ListTenantUsersParamsStatusEnum = exports.ListTenantUsersParamsStatusEnum || (exports.ListTenantUsersParamsStatusEnum = {}));
18413
+ exports.Api = exports.HttpClient = exports.ContentType = exports.TenantUserStatusEnum = exports.TenantRoleEnum = exports.OrderByEnum = void 0;
18407
18414
  var OrderByEnum;
18408
18415
  (function (OrderByEnum) {
18409
18416
  OrderByEnum["ASC"] = "ASC";
18410
18417
  OrderByEnum["DESC"] = "DESC";
18411
18418
  })(OrderByEnum = exports.OrderByEnum || (exports.OrderByEnum = {}));
18412
- var TenantUserEntityDtoRolesEnum;
18413
- (function (TenantUserEntityDtoRolesEnum) {
18414
- TenantUserEntityDtoRolesEnum["Operator"] = "operator";
18415
- TenantUserEntityDtoRolesEnum["Admin"] = "admin";
18416
- TenantUserEntityDtoRolesEnum["Owner"] = "owner";
18417
- })(TenantUserEntityDtoRolesEnum = exports.TenantUserEntityDtoRolesEnum || (exports.TenantUserEntityDtoRolesEnum = {}));
18418
- /** @example "enabled" */
18419
- var TenantUserEntityDtoStatusEnum;
18420
- (function (TenantUserEntityDtoStatusEnum) {
18421
- TenantUserEntityDtoStatusEnum["Enabled"] = "enabled";
18422
- TenantUserEntityDtoStatusEnum["Blocked"] = "blocked";
18423
- })(TenantUserEntityDtoStatusEnum = exports.TenantUserEntityDtoStatusEnum || (exports.TenantUserEntityDtoStatusEnum = {}));
18419
+ var TenantRoleEnum;
18420
+ (function (TenantRoleEnum) {
18421
+ TenantRoleEnum["Operator"] = "operator";
18422
+ TenantRoleEnum["Admin"] = "admin";
18423
+ TenantRoleEnum["Owner"] = "owner";
18424
+ })(TenantRoleEnum = exports.TenantRoleEnum || (exports.TenantRoleEnum = {}));
18425
+ var TenantUserStatusEnum;
18426
+ (function (TenantUserStatusEnum) {
18427
+ TenantUserStatusEnum["Enabled"] = "enabled";
18428
+ TenantUserStatusEnum["Blocked"] = "blocked";
18429
+ })(TenantUserStatusEnum = exports.TenantUserStatusEnum || (exports.TenantUserStatusEnum = {}));
18424
18430
  var axios_1 = __importDefault(__webpack_require__(6425));
18425
18431
  var ContentType;
18426
18432
  (function (ContentType) {
@@ -18634,6 +18640,230 @@ var Api = /** @class */ (function (_super) {
18634
18640
  if (params === void 0) { params = {}; }
18635
18641
  return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/users"), method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
18636
18642
  },
18643
+ /**
18644
+ * No description
18645
+ *
18646
+ * @tags Admin Tenant Wines
18647
+ * @name CreateTenantWine
18648
+ * @request POST:/admin/tenants/{tenantId}/wines
18649
+ * @secure
18650
+ * @response `201` `WineEntityDto`
18651
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
18652
+ */
18653
+ createTenantWine: function (tenantId, data, params) {
18654
+ if (params === void 0) { params = {}; }
18655
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wines"), method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
18656
+ },
18657
+ /**
18658
+ * No description
18659
+ *
18660
+ * @tags Admin Tenant Wine Brands
18661
+ * @name CreateTenantWineBrand
18662
+ * @request POST:/admin/tenants/{tenantId}/wine-brands
18663
+ * @secure
18664
+ * @response `201` `WineBrandEntityDto`
18665
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
18666
+ */
18667
+ createTenantWineBrand: function (tenantId, data, params) {
18668
+ if (params === void 0) { params = {}; }
18669
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-brands"), method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
18670
+ },
18671
+ /**
18672
+ * No description
18673
+ *
18674
+ * @tags Admin Tenant Wine Producers
18675
+ * @name CreateTenantWineProducer
18676
+ * @request POST:/admin/tenants/{tenantId}/wine-producers
18677
+ * @secure
18678
+ * @response `201` `WineProducerEntityDto`
18679
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
18680
+ */
18681
+ createTenantWineProducer: function (tenantId, data, params) {
18682
+ if (params === void 0) { params = {}; }
18683
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-producers"), method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
18684
+ },
18685
+ /**
18686
+ * No description
18687
+ *
18688
+ * @tags Admin Tenant Wine Styles
18689
+ * @name CreateTenantWineStyle
18690
+ * @request POST:/admin/tenants/{tenantId}/wine-styles
18691
+ * @secure
18692
+ * @response `201` `WineStyleEntityDto`
18693
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
18694
+ */
18695
+ createTenantWineStyle: function (tenantId, data, params) {
18696
+ if (params === void 0) { params = {}; }
18697
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-styles"), method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
18698
+ },
18699
+ /**
18700
+ * No description
18701
+ *
18702
+ * @tags Admin Tenant Wine Types
18703
+ * @name CreateTenantWineType
18704
+ * @request POST:/admin/tenants/{tenantId}/wine-types
18705
+ * @secure
18706
+ * @response `201` `WineTypeEntityDto`
18707
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
18708
+ */
18709
+ createTenantWineType: function (tenantId, data, params) {
18710
+ if (params === void 0) { params = {}; }
18711
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-types"), method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
18712
+ },
18713
+ /**
18714
+ * No description
18715
+ *
18716
+ * @tags Admin Tenant Wine Varietals
18717
+ * @name CreateTenantWineVarietal
18718
+ * @request POST:/admin/tenants/{tenantId}/wine-varietals
18719
+ * @secure
18720
+ * @response `201` `WineVarietalEntityDto`
18721
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
18722
+ */
18723
+ createTenantWineVarietal: function (tenantId, data, params) {
18724
+ if (params === void 0) { params = {}; }
18725
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-varietals"), method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
18726
+ },
18727
+ /**
18728
+ * No description
18729
+ *
18730
+ * @tags Admin Tenant Wine Villages
18731
+ * @name CreateTenantWineVillage
18732
+ * @request POST:/admin/tenants/{tenantId}/wine-villages
18733
+ * @secure
18734
+ * @response `201` `WineVillageEntityDto`
18735
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
18736
+ */
18737
+ createTenantWineVillage: function (tenantId, data, params) {
18738
+ if (params === void 0) { params = {}; }
18739
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-villages"), method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
18740
+ },
18741
+ /**
18742
+ * No description
18743
+ *
18744
+ * @tags Admin Tenant Wine Vineyards
18745
+ * @name CreateTenantWineVineyard
18746
+ * @request POST:/admin/tenants/{tenantId}/wine-vineyards
18747
+ * @secure
18748
+ * @response `201` `WineVineyardEntityDto`
18749
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
18750
+ */
18751
+ createTenantWineVineyard: function (tenantId, data, params) {
18752
+ if (params === void 0) { params = {}; }
18753
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-vineyards"), method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
18754
+ },
18755
+ /**
18756
+ * No description
18757
+ *
18758
+ * @tags Admin Tenant Wines
18759
+ * @name DeleteTenantWine
18760
+ * @request DELETE:/admin/tenants/{tenantId}/wines/{wineId}
18761
+ * @secure
18762
+ * @response `204` `void`
18763
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
18764
+ */
18765
+ deleteTenantWine: function (tenantId, wineId, params) {
18766
+ if (params === void 0) { params = {}; }
18767
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wines/").concat(wineId), method: "DELETE", secure: true }, params));
18768
+ },
18769
+ /**
18770
+ * No description
18771
+ *
18772
+ * @tags Admin Tenant Wine Brands
18773
+ * @name DeleteTenantWineBrand
18774
+ * @request DELETE:/admin/tenants/{tenantId}/wine-brands/{brandId}
18775
+ * @secure
18776
+ * @response `204` `void`
18777
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
18778
+ */
18779
+ deleteTenantWineBrand: function (tenantId, brandId, params) {
18780
+ if (params === void 0) { params = {}; }
18781
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-brands/").concat(brandId), method: "DELETE", secure: true }, params));
18782
+ },
18783
+ /**
18784
+ * No description
18785
+ *
18786
+ * @tags Admin Tenant Wine Producers
18787
+ * @name DeleteTenantWineProducer
18788
+ * @request DELETE:/admin/tenants/{tenantId}/wine-producers/{producerId}
18789
+ * @secure
18790
+ * @response `204` `void`
18791
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
18792
+ */
18793
+ deleteTenantWineProducer: function (tenantId, producerId, params) {
18794
+ if (params === void 0) { params = {}; }
18795
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-producers/").concat(producerId), method: "DELETE", secure: true }, params));
18796
+ },
18797
+ /**
18798
+ * No description
18799
+ *
18800
+ * @tags Admin Tenant Wine Styles
18801
+ * @name DeleteTenantWineStyle
18802
+ * @request DELETE:/admin/tenants/{tenantId}/wine-styles/{styleId}
18803
+ * @secure
18804
+ * @response `204` `void`
18805
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
18806
+ */
18807
+ deleteTenantWineStyle: function (tenantId, styleId, params) {
18808
+ if (params === void 0) { params = {}; }
18809
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-styles/").concat(styleId), method: "DELETE", secure: true }, params));
18810
+ },
18811
+ /**
18812
+ * No description
18813
+ *
18814
+ * @tags Admin Tenant Wine Types
18815
+ * @name DeleteTenantWineType
18816
+ * @request DELETE:/admin/tenants/{tenantId}/wine-types/{typeId}
18817
+ * @secure
18818
+ * @response `204` `void`
18819
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
18820
+ */
18821
+ deleteTenantWineType: function (tenantId, typeId, params) {
18822
+ if (params === void 0) { params = {}; }
18823
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-types/").concat(typeId), method: "DELETE", secure: true }, params));
18824
+ },
18825
+ /**
18826
+ * No description
18827
+ *
18828
+ * @tags Admin Tenant Wine Varietals
18829
+ * @name DeleteTenantWineVarietal
18830
+ * @request DELETE:/admin/tenants/{tenantId}/wine-varietals/{varietalId}
18831
+ * @secure
18832
+ * @response `204` `void`
18833
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
18834
+ */
18835
+ deleteTenantWineVarietal: function (tenantId, varietalId, params) {
18836
+ if (params === void 0) { params = {}; }
18837
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-varietals/").concat(varietalId), method: "DELETE", secure: true }, params));
18838
+ },
18839
+ /**
18840
+ * No description
18841
+ *
18842
+ * @tags Admin Tenant Wine Villages
18843
+ * @name DeleteTenantWineVillage
18844
+ * @request DELETE:/admin/tenants/{tenantId}/wine-villages/{villageId}
18845
+ * @secure
18846
+ * @response `204` `void`
18847
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
18848
+ */
18849
+ deleteTenantWineVillage: function (tenantId, villageId, params) {
18850
+ if (params === void 0) { params = {}; }
18851
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-villages/").concat(villageId), method: "DELETE", secure: true }, params));
18852
+ },
18853
+ /**
18854
+ * No description
18855
+ *
18856
+ * @tags Admin Tenant Wine Vineyards
18857
+ * @name DeleteTenantWineVineyard
18858
+ * @request DELETE:/admin/tenants/{tenantId}/wine-vineyards/{vineyardId}
18859
+ * @secure
18860
+ * @response `204` `void`
18861
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
18862
+ */
18863
+ deleteTenantWineVineyard: function (tenantId, vineyardId, params) {
18864
+ if (params === void 0) { params = {}; }
18865
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-vineyards/").concat(vineyardId), method: "DELETE", secure: true }, params));
18866
+ },
18637
18867
  /**
18638
18868
  * No description
18639
18869
  *
@@ -18662,6 +18892,118 @@ var Api = /** @class */ (function (_super) {
18662
18892
  if (params === void 0) { params = {}; }
18663
18893
  return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/users/").concat(userId, "/enable"), method: "PATCH", secure: true }, params));
18664
18894
  },
18895
+ /**
18896
+ * No description
18897
+ *
18898
+ * @tags Admin Tenant Wine Brands
18899
+ * @name GetTenantWineBrandById
18900
+ * @request GET:/admin/tenants/{tenantId}/wine-brands/{brandId}
18901
+ * @secure
18902
+ * @response `200` `WineBrandEntityDto`
18903
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin, operator
18904
+ */
18905
+ getTenantWineBrandById: function (tenantId, brandId, params) {
18906
+ if (params === void 0) { params = {}; }
18907
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-brands/").concat(brandId), method: "GET", secure: true, format: "json" }, params));
18908
+ },
18909
+ /**
18910
+ * No description
18911
+ *
18912
+ * @tags Admin Tenant Wines
18913
+ * @name GetTenantWineById
18914
+ * @request GET:/admin/tenants/{tenantId}/wines/{wineId}
18915
+ * @secure
18916
+ * @response `200` `WineEntityDto`
18917
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin, operator
18918
+ */
18919
+ getTenantWineById: function (tenantId, wineId, params) {
18920
+ if (params === void 0) { params = {}; }
18921
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wines/").concat(wineId), method: "GET", secure: true, format: "json" }, params));
18922
+ },
18923
+ /**
18924
+ * No description
18925
+ *
18926
+ * @tags Admin Tenant Wine Producers
18927
+ * @name GetTenantWineProducerById
18928
+ * @request GET:/admin/tenants/{tenantId}/wine-producers/{producerId}
18929
+ * @secure
18930
+ * @response `200` `WineProducerEntityDto`
18931
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin, operator
18932
+ */
18933
+ getTenantWineProducerById: function (tenantId, producerId, params) {
18934
+ if (params === void 0) { params = {}; }
18935
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-producers/").concat(producerId), method: "GET", secure: true, format: "json" }, params));
18936
+ },
18937
+ /**
18938
+ * No description
18939
+ *
18940
+ * @tags Admin Tenant Wine Styles
18941
+ * @name GetTenantWineStyleById
18942
+ * @request GET:/admin/tenants/{tenantId}/wine-styles/{styleId}
18943
+ * @secure
18944
+ * @response `200` `WineStyleEntityDto`
18945
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin, operator
18946
+ */
18947
+ getTenantWineStyleById: function (tenantId, styleId, params) {
18948
+ if (params === void 0) { params = {}; }
18949
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-styles/").concat(styleId), method: "GET", secure: true, format: "json" }, params));
18950
+ },
18951
+ /**
18952
+ * No description
18953
+ *
18954
+ * @tags Admin Tenant Wine Types
18955
+ * @name GetTenantWineTypeById
18956
+ * @request GET:/admin/tenants/{tenantId}/wine-types/{typeId}
18957
+ * @secure
18958
+ * @response `200` `WineTypeEntityDto`
18959
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin, operator
18960
+ */
18961
+ getTenantWineTypeById: function (tenantId, typeId, params) {
18962
+ if (params === void 0) { params = {}; }
18963
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-types/").concat(typeId), method: "GET", secure: true, format: "json" }, params));
18964
+ },
18965
+ /**
18966
+ * No description
18967
+ *
18968
+ * @tags Admin Tenant Wine Varietals
18969
+ * @name GetTenantWineVarietalById
18970
+ * @request GET:/admin/tenants/{tenantId}/wine-varietals/{varietalId}
18971
+ * @secure
18972
+ * @response `200` `WineVarietalEntityDto`
18973
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin, operator
18974
+ */
18975
+ getTenantWineVarietalById: function (tenantId, varietalId, params) {
18976
+ if (params === void 0) { params = {}; }
18977
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-varietals/").concat(varietalId), method: "GET", secure: true, format: "json" }, params));
18978
+ },
18979
+ /**
18980
+ * No description
18981
+ *
18982
+ * @tags Admin Tenant Wine Villages
18983
+ * @name GetTenantWineVillageById
18984
+ * @request GET:/admin/tenants/{tenantId}/wine-villages/{villageId}
18985
+ * @secure
18986
+ * @response `200` `WineVillageEntityDto`
18987
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin, operator
18988
+ */
18989
+ getTenantWineVillageById: function (tenantId, villageId, params) {
18990
+ if (params === void 0) { params = {}; }
18991
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-villages/").concat(villageId), method: "GET", secure: true, format: "json" }, params));
18992
+ },
18993
+ /**
18994
+ * No description
18995
+ *
18996
+ * @tags Admin Tenant Wine Vineyards
18997
+ * @name GetTenantWineVineyardById
18998
+ * @request GET:/admin/tenants/{tenantId}/wine-vineyards/{vineyardId}
18999
+ * @secure
19000
+ * @response `200` `WineVineyardEntityDto`
19001
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin, operator
19002
+ */
19003
+ getTenantWineVineyardById: function (tenantId, vineyardId, params) {
19004
+ if (params === void 0) { params = {}; }
19005
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-vineyards/").concat(vineyardId), method: "GET", secure: true, format: "json" }, params));
19006
+ },
18665
19007
  /**
18666
19008
  * No description
18667
19009
  *
@@ -18669,13 +19011,237 @@ var Api = /** @class */ (function (_super) {
18669
19011
  * @name ListTenantUsers
18670
19012
  * @request GET:/admin/tenants/{tenantId}/users
18671
19013
  * @secure
18672
- * @response `200` `TenantUserEntityPaginationDto`
19014
+ * @response `200` `TenantUserEntityPaginatedDto`
18673
19015
  * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
18674
19016
  */
18675
19017
  listTenantUsers: function (tenantId, query, params) {
18676
19018
  if (params === void 0) { params = {}; }
18677
19019
  return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/users"), method: "GET", query: query, secure: true, format: "json" }, params));
18678
19020
  },
19021
+ /**
19022
+ * No description
19023
+ *
19024
+ * @tags Admin Tenant Wine Brands
19025
+ * @name ListTenantWineBrands
19026
+ * @request GET:/admin/tenants/{tenantId}/wine-brands
19027
+ * @secure
19028
+ * @response `200` `WineBrandEntityPaginatedDto`
19029
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin, operator
19030
+ */
19031
+ listTenantWineBrands: function (tenantId, query, params) {
19032
+ if (params === void 0) { params = {}; }
19033
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-brands"), method: "GET", query: query, secure: true, format: "json" }, params));
19034
+ },
19035
+ /**
19036
+ * No description
19037
+ *
19038
+ * @tags Admin Tenant Wine Producers
19039
+ * @name ListTenantWineProducers
19040
+ * @request GET:/admin/tenants/{tenantId}/wine-producers
19041
+ * @secure
19042
+ * @response `200` `WineProducerEntityPaginatedDto`
19043
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin, operator
19044
+ */
19045
+ listTenantWineProducers: function (tenantId, query, params) {
19046
+ if (params === void 0) { params = {}; }
19047
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-producers"), method: "GET", query: query, secure: true, format: "json" }, params));
19048
+ },
19049
+ /**
19050
+ * No description
19051
+ *
19052
+ * @tags Admin Tenant Wines
19053
+ * @name ListTenantWines
19054
+ * @request GET:/admin/tenants/{tenantId}/wines
19055
+ * @secure
19056
+ * @response `200` `WineEntityPaginatedDto`
19057
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin, operator
19058
+ */
19059
+ listTenantWines: function (tenantId, query, params) {
19060
+ if (params === void 0) { params = {}; }
19061
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wines"), method: "GET", query: query, secure: true, format: "json" }, params));
19062
+ },
19063
+ /**
19064
+ * No description
19065
+ *
19066
+ * @tags Admin Tenant Wine Styles
19067
+ * @name ListTenantWineStyles
19068
+ * @request GET:/admin/tenants/{tenantId}/wine-styles
19069
+ * @secure
19070
+ * @response `200` `WineStyleEntityPaginatedDto`
19071
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin, operator
19072
+ */
19073
+ listTenantWineStyles: function (tenantId, query, params) {
19074
+ if (params === void 0) { params = {}; }
19075
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-styles"), method: "GET", query: query, secure: true, format: "json" }, params));
19076
+ },
19077
+ /**
19078
+ * No description
19079
+ *
19080
+ * @tags Admin Tenant Wine Types
19081
+ * @name ListTenantWineTypes
19082
+ * @request GET:/admin/tenants/{tenantId}/wine-types
19083
+ * @secure
19084
+ * @response `200` `WineTypeEntityPaginatedDto`
19085
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin, operator
19086
+ */
19087
+ listTenantWineTypes: function (tenantId, query, params) {
19088
+ if (params === void 0) { params = {}; }
19089
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-types"), method: "GET", query: query, secure: true, format: "json" }, params));
19090
+ },
19091
+ /**
19092
+ * No description
19093
+ *
19094
+ * @tags Admin Tenant Wine Varietals
19095
+ * @name ListTenantWineVarietals
19096
+ * @request GET:/admin/tenants/{tenantId}/wine-varietals
19097
+ * @secure
19098
+ * @response `200` `WineVarietalEntityPaginatedDto`
19099
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin, operator
19100
+ */
19101
+ listTenantWineVarietals: function (tenantId, query, params) {
19102
+ if (params === void 0) { params = {}; }
19103
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-varietals"), method: "GET", query: query, secure: true, format: "json" }, params));
19104
+ },
19105
+ /**
19106
+ * No description
19107
+ *
19108
+ * @tags Admin Tenant Wine Villages
19109
+ * @name ListTenantWineVillages
19110
+ * @request GET:/admin/tenants/{tenantId}/wine-villages
19111
+ * @secure
19112
+ * @response `200` `WineVillageEntityPaginatedDto`
19113
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin, operator
19114
+ */
19115
+ listTenantWineVillages: function (tenantId, query, params) {
19116
+ if (params === void 0) { params = {}; }
19117
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-villages"), method: "GET", query: query, secure: true, format: "json" }, params));
19118
+ },
19119
+ /**
19120
+ * No description
19121
+ *
19122
+ * @tags Admin Tenant Wine Vineyards
19123
+ * @name ListTenantWineVineyards
19124
+ * @request GET:/admin/tenants/{tenantId}/wine-vineyards
19125
+ * @secure
19126
+ * @response `200` `WineVineyardEntityPaginatedDto`
19127
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin, operator
19128
+ */
19129
+ listTenantWineVineyards: function (tenantId, query, params) {
19130
+ if (params === void 0) { params = {}; }
19131
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-vineyards"), method: "GET", query: query, secure: true, format: "json" }, params));
19132
+ },
19133
+ /**
19134
+ * No description
19135
+ *
19136
+ * @tags Admin Tenant Wines
19137
+ * @name UpdateTenantWine
19138
+ * @request PATCH:/admin/tenants/{tenantId}/wines/{wineId}
19139
+ * @secure
19140
+ * @response `200` `WineEntityDto`
19141
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
19142
+ */
19143
+ updateTenantWine: function (tenantId, wineId, data, params) {
19144
+ if (params === void 0) { params = {}; }
19145
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wines/").concat(wineId), method: "PATCH", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
19146
+ },
19147
+ /**
19148
+ * No description
19149
+ *
19150
+ * @tags Admin Tenant Wine Brands
19151
+ * @name UpdateTenantWineBrand
19152
+ * @request PATCH:/admin/tenants/{tenantId}/wine-brands/{brandId}
19153
+ * @secure
19154
+ * @response `200` `WineBrandEntityDto`
19155
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
19156
+ */
19157
+ updateTenantWineBrand: function (tenantId, brandId, data, params) {
19158
+ if (params === void 0) { params = {}; }
19159
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-brands/").concat(brandId), method: "PATCH", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
19160
+ },
19161
+ /**
19162
+ * No description
19163
+ *
19164
+ * @tags Admin Tenant Wine Producers
19165
+ * @name UpdateTenantWineProducer
19166
+ * @request PATCH:/admin/tenants/{tenantId}/wine-producers/{producerId}
19167
+ * @secure
19168
+ * @response `200` `WineProducerEntityDto`
19169
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
19170
+ */
19171
+ updateTenantWineProducer: function (tenantId, producerId, data, params) {
19172
+ if (params === void 0) { params = {}; }
19173
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-producers/").concat(producerId), method: "PATCH", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
19174
+ },
19175
+ /**
19176
+ * No description
19177
+ *
19178
+ * @tags Admin Tenant Wine Styles
19179
+ * @name UpdateTenantWineStyle
19180
+ * @request PATCH:/admin/tenants/{tenantId}/wine-styles/{styleId}
19181
+ * @secure
19182
+ * @response `200` `WineStyleEntityDto`
19183
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
19184
+ */
19185
+ updateTenantWineStyle: function (tenantId, styleId, data, params) {
19186
+ if (params === void 0) { params = {}; }
19187
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-styles/").concat(styleId), method: "PATCH", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
19188
+ },
19189
+ /**
19190
+ * No description
19191
+ *
19192
+ * @tags Admin Tenant Wine Types
19193
+ * @name UpdateTenantWineType
19194
+ * @request PATCH:/admin/tenants/{tenantId}/wine-types/{typeId}
19195
+ * @secure
19196
+ * @response `200` `WineTypeEntityDto`
19197
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
19198
+ */
19199
+ updateTenantWineType: function (tenantId, typeId, data, params) {
19200
+ if (params === void 0) { params = {}; }
19201
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-types/").concat(typeId), method: "PATCH", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
19202
+ },
19203
+ /**
19204
+ * No description
19205
+ *
19206
+ * @tags Admin Tenant Wine Varietals
19207
+ * @name UpdateTenantWineVarietal
19208
+ * @request PATCH:/admin/tenants/{tenantId}/wine-varietals/{varietalId}
19209
+ * @secure
19210
+ * @response `200` `WineVarietalEntityDto`
19211
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
19212
+ */
19213
+ updateTenantWineVarietal: function (tenantId, varietalId, data, params) {
19214
+ if (params === void 0) { params = {}; }
19215
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-varietals/").concat(varietalId), method: "PATCH", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
19216
+ },
19217
+ /**
19218
+ * No description
19219
+ *
19220
+ * @tags Admin Tenant Wine Villages
19221
+ * @name UpdateTenantWineVillage
19222
+ * @request PATCH:/admin/tenants/{tenantId}/wine-villages/{villageId}
19223
+ * @secure
19224
+ * @response `200` `WineVillageEntityDto`
19225
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
19226
+ */
19227
+ updateTenantWineVillage: function (tenantId, villageId, data, params) {
19228
+ if (params === void 0) { params = {}; }
19229
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-villages/").concat(villageId), method: "PATCH", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
19230
+ },
19231
+ /**
19232
+ * No description
19233
+ *
19234
+ * @tags Admin Tenant Wine Vineyards
19235
+ * @name UpdateTenantWineVineyard
19236
+ * @request PATCH:/admin/tenants/{tenantId}/wine-vineyards/{vineyardId}
19237
+ * @secure
19238
+ * @response `200` `WineVineyardEntityDto`
19239
+ * @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
19240
+ */
19241
+ updateTenantWineVineyard: function (tenantId, vineyardId, data, params) {
19242
+ if (params === void 0) { params = {}; }
19243
+ return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/wine-vineyards/").concat(vineyardId), method: "PATCH", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
19244
+ },
18679
19245
  };
18680
19246
  return _this;
18681
19247
  }