nextemos 5.1.18 → 5.1.20

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.
@@ -52,3 +52,19 @@ export interface IWorkingDayMapping {
52
52
  weekDaysType?: string;
53
53
  workingHoursId?: number;
54
54
  }
55
+ export interface IStockTypeValue {
56
+ id: number;
57
+ name: string;
58
+ }
59
+ export interface IStockAvailability {
60
+ stockBarcodeId: number;
61
+ isAvailable: boolean;
62
+ stockTypeValueIds: number[];
63
+ }
64
+ export interface IStockAvailabilityResponse extends IResponse {
65
+ data: {
66
+ productId: number;
67
+ stockAvailabilities: IStockAvailability[];
68
+ stockTypeValues: IStockTypeValue[];
69
+ };
70
+ }
@@ -1,7 +1,7 @@
1
- import { IEnvironmentParameters, IInitEnvironmentResponse, IReadEnvironmentResponse, IService, IUpdateEnvironmentResponse } from '../../';
2
- import { IApiResponse, IRequestInit } from '../..';
1
+ import { IEnvironmentParameters, IInitEnvironmentResponse, IReadEnvironmentResponse, IService, IUpdateEnvironmentResponse } from "../../";
2
+ import { IApiResponse, IRequestInit } from "../..";
3
3
  export interface IInitEnvironmentRequest {
4
- platform: 'desktop' | 'mobile';
4
+ platform: "desktop" | "mobile";
5
5
  countryCode: string;
6
6
  language?: string;
7
7
  }
@@ -14,8 +14,12 @@ export interface IUpdateEnvironmentRequest {
14
14
  parameters: IEnvironmentParameters;
15
15
  language?: string;
16
16
  }
17
+ export interface IRefreshEnvironmentRequest extends IInitEnvironmentRequest {
18
+ environment: string;
19
+ }
17
20
  export interface IEnvironmentService extends IService {
18
21
  Init: (data: IInitEnvironmentRequest, options?: IRequestInit) => Promise<IApiResponse<IInitEnvironmentResponse>>;
19
22
  Read: (data: IReadEnvironmentRequest, options?: IRequestInit) => Promise<IApiResponse<IReadEnvironmentResponse>>;
20
23
  Update: (data: IUpdateEnvironmentRequest, options?: IRequestInit) => Promise<IApiResponse<IUpdateEnvironmentResponse>>;
24
+ Refresh: (data: IRefreshEnvironmentRequest, options?: IRequestInit) => Promise<IApiResponse<IInitEnvironmentResponse>>;
21
25
  }
@@ -60,4 +60,7 @@ exports.EnvironmentService = {
60
60
  Update: (data, options) => __awaiter(void 0, void 0, void 0, function* () {
61
61
  return (0, __1.fetchRequest)().post(exports.EnvironmentService.Url(urls_1.default.Environment.Update, options, data === null || data === void 0 ? void 0 : data.language), Object.assign(Object.assign({}, options), { body: JSON.stringify(data) }));
62
62
  }),
63
+ Refresh: (data, options) => __awaiter(void 0, void 0, void 0, function* () {
64
+ return (0, __1.fetchRequest)().post(exports.EnvironmentService.Url(urls_1.default.Environment.Refresh, options, data === null || data === void 0 ? void 0 : data.language), Object.assign(Object.assign({}, options), { body: JSON.stringify(data) }));
65
+ }),
63
66
  };
@@ -57,4 +57,7 @@ exports.StockService = {
57
57
  Warehouse: (data, options) => __awaiter(void 0, void 0, void 0, function* () {
58
58
  return (0, __1.fetchRequest)().get(exports.StockService.Url(urls_1.default.Warehouse.Warehouse, options, data === null || data === void 0 ? void 0 : data.language), Object.assign(Object.assign({}, options), { params: data }));
59
59
  }),
60
+ StockAvailabilitiesByProductId: (data, options) => __awaiter(void 0, void 0, void 0, function* () {
61
+ return (0, __1.fetchRequest)().get(exports.StockService.Url(urls_1.default.Stocks.StockAvailabilitiesByProductId, options, data === null || data === void 0 ? void 0 : data.language), Object.assign(Object.assign({}, options), { params: data }));
62
+ }),
60
63
  };
@@ -1,4 +1,4 @@
1
- import { IApiResponse, IRequestBase, IRequestInit, IService, IWarehouseResponse, IWarehousesResponse } from '../..';
1
+ import { IApiResponse, IRequestBase, IRequestInit, IService, IStockAvailabilityResponse, IWarehouseResponse, IWarehousesResponse } from "../..";
2
2
  export interface IWarehousesRequest extends IRequestBase {
3
3
  warehouseIds?: number[];
4
4
  WarehouseTypeIds?: number[];
@@ -9,7 +9,17 @@ export interface IWarehousesRequest extends IRequestBase {
9
9
  export interface IWarehouseRequest extends IRequestBase {
10
10
  id: number;
11
11
  }
12
+ export interface IStockAvailabilitiesByProductIdRequest extends IRequestBase {
13
+ productId: number;
14
+ channelId?: number;
15
+ warehouseId?: number;
16
+ criteriaIds?: number[];
17
+ checkOverall?: boolean;
18
+ OnlyInStoreWarehouses?: boolean;
19
+ IsStockManagement?: boolean;
20
+ }
12
21
  export interface IStockService extends IService {
13
22
  Warehouses: (data?: IWarehousesRequest, options?: IRequestInit) => Promise<IApiResponse<IWarehousesResponse>>;
14
23
  Warehouse: (data: IWarehouseRequest, options?: IRequestInit) => Promise<IApiResponse<IWarehouseResponse>>;
24
+ StockAvailabilitiesByProductId: (data: IStockAvailabilitiesByProductIdRequest, options?: IRequestInit) => Promise<IApiResponse<IStockAvailabilityResponse>>;
15
25
  }
@@ -43,6 +43,9 @@ declare const _default: {
43
43
  All: string;
44
44
  ProductType: string;
45
45
  };
46
+ Stocks: {
47
+ StockAvailabilitiesByProductId: string;
48
+ };
46
49
  Warehouse: {
47
50
  All: string;
48
51
  Warehouse: string;
@@ -100,6 +103,7 @@ declare const _default: {
100
103
  Init: string;
101
104
  Read: string;
102
105
  Update: string;
106
+ Refresh: string;
103
107
  };
104
108
  Notification: {
105
109
  RenderTemplate: string;
@@ -54,6 +54,9 @@ exports.default = {
54
54
  All: "/live/{language}/ProductType/v1/All",
55
55
  ProductType: "/live/{language}/ProductType/v1/{id}",
56
56
  },
57
+ Stocks: {
58
+ StockAvailabilitiesByProductId: "/{language}/Stocks/v1/StockAvailabilitiesByProductId",
59
+ },
57
60
  Warehouse: {
58
61
  All: "/{language}/Warehouses/v1/All",
59
62
  Warehouse: "/{language}/Warehouses/v1/GetById",
@@ -111,6 +114,7 @@ exports.default = {
111
114
  Init: "/{language}/Environment/v1/Init",
112
115
  Read: "/{language}/Environment/v1/Read",
113
116
  Update: "/{language}/Environment/v1/Update",
117
+ Refresh: "/{language}/Environment/v1/Refresh",
114
118
  },
115
119
  Notification: {
116
120
  RenderTemplate: "/{language}/Template/v1/RenderTemplate",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextemos",
3
- "version": "5.1.18",
3
+ "version": "5.1.20",
4
4
  "description": "For helpers and hooks used in NextJS projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",