nextemos 3.4.1 → 3.5.0

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,79 @@
1
+ /**
2
+ * The Product API Flags
3
+ */
4
+ export declare enum ProductApiFlags {
5
+ /**
6
+ * The no flag status
7
+ */
8
+ None = 1,
9
+ /**
10
+ * If price is 0 then removes it
11
+ */
12
+ PriceIsNotZero = 2,
13
+ /**
14
+ * Lists ready items for sale with scope type:
15
+ * Commercial, Set, Custom, Combine
16
+ */
17
+ OffTheShelf = 4,
18
+ /**
19
+ * Combines `PriceIsNotZero` and `OffTheShelf`.
20
+ * If price is 0, then removes it, and lists ready items for sale.
21
+ */
22
+ Default = 6,
23
+ /**
24
+ * The group variations
25
+ */
26
+ GroupVariations = 8,
27
+ /**
28
+ * Ignore approval
29
+ */
30
+ IgnoreApproval = 16,
31
+ /**
32
+ * Show products where stock is available
33
+ */
34
+ InStock = 32,
35
+ /**
36
+ * Show out of stock items
37
+ */
38
+ OutOfStock = 64,
39
+ /**
40
+ * Gets items with discount rate > 0
41
+ */
42
+ Discounted = 128,
43
+ /**
44
+ * Check sales quantity
45
+ */
46
+ Sold = 256,
47
+ /**
48
+ * Service computes stocks from the database
49
+ */
50
+ ComputePhysicalStocks = 512,
51
+ /**
52
+ * Recomputes the product
53
+ */
54
+ TransientRequest = 1024,
55
+ /**
56
+ * The just selected culture
57
+ */
58
+ JustSelectedCulture = 2048,
59
+ /**
60
+ * The just default category
61
+ */
62
+ JustDefaultCategory = 4096,
63
+ /**
64
+ * The just default image document
65
+ */
66
+ JustDefaultImageDocument = 8192,
67
+ /**
68
+ * The just default video document
69
+ */
70
+ JustDefaultVideoDocument = 16384,
71
+ /**
72
+ * Flag to show item on the list page
73
+ */
74
+ IsShowedListPage = 32768,
75
+ /**
76
+ * Flag to show item on the detail page
77
+ */
78
+ IsShowedDetailPage = 65536
79
+ }
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProductApiFlags = void 0;
4
+ /**
5
+ * The Product API Flags
6
+ */
7
+ var ProductApiFlags;
8
+ (function (ProductApiFlags) {
9
+ /**
10
+ * The no flag status
11
+ */
12
+ ProductApiFlags[ProductApiFlags["None"] = 1] = "None";
13
+ /**
14
+ * If price is 0 then removes it
15
+ */
16
+ ProductApiFlags[ProductApiFlags["PriceIsNotZero"] = 2] = "PriceIsNotZero";
17
+ /**
18
+ * Lists ready items for sale with scope type:
19
+ * Commercial, Set, Custom, Combine
20
+ */
21
+ ProductApiFlags[ProductApiFlags["OffTheShelf"] = 4] = "OffTheShelf";
22
+ /**
23
+ * Combines `PriceIsNotZero` and `OffTheShelf`.
24
+ * If price is 0, then removes it, and lists ready items for sale.
25
+ */
26
+ ProductApiFlags[ProductApiFlags["Default"] = 6] = "Default";
27
+ /**
28
+ * The group variations
29
+ */
30
+ ProductApiFlags[ProductApiFlags["GroupVariations"] = 8] = "GroupVariations";
31
+ /**
32
+ * Ignore approval
33
+ */
34
+ ProductApiFlags[ProductApiFlags["IgnoreApproval"] = 16] = "IgnoreApproval";
35
+ /**
36
+ * Show products where stock is available
37
+ */
38
+ ProductApiFlags[ProductApiFlags["InStock"] = 32] = "InStock";
39
+ /**
40
+ * Show out of stock items
41
+ */
42
+ ProductApiFlags[ProductApiFlags["OutOfStock"] = 64] = "OutOfStock";
43
+ /**
44
+ * Gets items with discount rate > 0
45
+ */
46
+ ProductApiFlags[ProductApiFlags["Discounted"] = 128] = "Discounted";
47
+ /**
48
+ * Check sales quantity
49
+ */
50
+ ProductApiFlags[ProductApiFlags["Sold"] = 256] = "Sold";
51
+ /**
52
+ * Service computes stocks from the database
53
+ */
54
+ ProductApiFlags[ProductApiFlags["ComputePhysicalStocks"] = 512] = "ComputePhysicalStocks";
55
+ /**
56
+ * Recomputes the product
57
+ */
58
+ ProductApiFlags[ProductApiFlags["TransientRequest"] = 1024] = "TransientRequest";
59
+ /**
60
+ * The just selected culture
61
+ */
62
+ ProductApiFlags[ProductApiFlags["JustSelectedCulture"] = 2048] = "JustSelectedCulture";
63
+ /**
64
+ * The just default category
65
+ */
66
+ ProductApiFlags[ProductApiFlags["JustDefaultCategory"] = 4096] = "JustDefaultCategory";
67
+ /**
68
+ * The just default image document
69
+ */
70
+ ProductApiFlags[ProductApiFlags["JustDefaultImageDocument"] = 8192] = "JustDefaultImageDocument";
71
+ /**
72
+ * The just default video document
73
+ */
74
+ ProductApiFlags[ProductApiFlags["JustDefaultVideoDocument"] = 16384] = "JustDefaultVideoDocument";
75
+ /**
76
+ * Flag to show item on the list page
77
+ */
78
+ ProductApiFlags[ProductApiFlags["IsShowedListPage"] = 32768] = "IsShowedListPage";
79
+ /**
80
+ * Flag to show item on the detail page
81
+ */
82
+ ProductApiFlags[ProductApiFlags["IsShowedDetailPage"] = 65536] = "IsShowedDetailPage";
83
+ })(ProductApiFlags || (exports.ProductApiFlags = ProductApiFlags = {}));
@@ -0,0 +1,240 @@
1
+ import { IResponse } from "./response";
2
+ export interface IProductResponse extends IResponse {
3
+ product: Product;
4
+ }
5
+ export interface Product {
6
+ id: number;
7
+ productUrl: string;
8
+ routePath: string;
9
+ routeTitle: string;
10
+ routeLocalizations: RouteLocalization[];
11
+ routeDescription: string;
12
+ parameterName: string;
13
+ templateId: number;
14
+ barcode: string;
15
+ name: string;
16
+ deci: number;
17
+ shortName: string;
18
+ description: string;
19
+ sku: string;
20
+ className: string;
21
+ code: string;
22
+ isApproved: any;
23
+ isCompleted: any;
24
+ scopeTypeId: number;
25
+ isAssembleRequired: boolean;
26
+ year: number;
27
+ rptDate: string;
28
+ seasonCode: string;
29
+ orderRate: number;
30
+ salesCount: number;
31
+ isGiftCard: any;
32
+ integrationCode: string;
33
+ rates: Rate[];
34
+ extensionData: any;
35
+ stocksByBarcode: StocksByBarcode;
36
+ stocksByWarehouse: StocksByWarehouse;
37
+ basePrice: number;
38
+ discountPrice: number;
39
+ salesPrice: number;
40
+ discountRate: number;
41
+ brand: Brand;
42
+ unitOfMeasure: UnitOfMeasure;
43
+ displayType: DisplayType;
44
+ categories: Category[];
45
+ variations: number[];
46
+ channelProperties: ChannelProperty[];
47
+ types: Type[];
48
+ barcodes: Barcode[];
49
+ documents: Document[];
50
+ vendors: Vendor[];
51
+ attributeGroupMappings: AttributeGroupMapping[];
52
+ }
53
+ export interface RouteLocalization {
54
+ id: number;
55
+ culture: string;
56
+ parameterName: string;
57
+ routeDescription: string;
58
+ routePath: string;
59
+ routeTitle: string;
60
+ }
61
+ export interface Rate {
62
+ id: number;
63
+ name: string;
64
+ code: string;
65
+ iconUrl: string;
66
+ rate: number;
67
+ isDefault: boolean;
68
+ totalComments: number;
69
+ totalRatings: number;
70
+ }
71
+ export interface StocksByBarcode {
72
+ [barcode: string]: number;
73
+ }
74
+ export interface StocksByWarehouse {
75
+ [storeId: string]: StocksByBarcode;
76
+ }
77
+ export interface Brand {
78
+ id: number;
79
+ order: number;
80
+ name: string;
81
+ filePath: string;
82
+ thumbnailUrl: string;
83
+ className: string;
84
+ routePath: string;
85
+ routeTitle: string;
86
+ routeDescription: string;
87
+ parameterName: string;
88
+ integrationCode: string;
89
+ extensionData: any;
90
+ }
91
+ export interface UnitOfMeasure {
92
+ id: number;
93
+ name: string;
94
+ extensionData: ExtensionData3;
95
+ }
96
+ export interface ExtensionData3 {
97
+ additionalProp1: string[];
98
+ additionalProp2: string[];
99
+ additionalProp3: string[];
100
+ }
101
+ export interface DisplayType {
102
+ id: number;
103
+ name: string;
104
+ extensionData: any;
105
+ }
106
+ export interface Category {
107
+ id: number;
108
+ name: string;
109
+ description: string;
110
+ sort: number;
111
+ parentId: number;
112
+ catalogId: number;
113
+ integrationCode: string;
114
+ className: string;
115
+ isDefault: boolean;
116
+ routePath: string;
117
+ routeTitle: string;
118
+ routeDescription: string;
119
+ parameterName: string;
120
+ hierarchy: number[];
121
+ extensionData: any;
122
+ }
123
+ export interface ChannelProperty {
124
+ channelId: number;
125
+ taxTypeId: number;
126
+ note: string;
127
+ stockStatusId: number;
128
+ stockStatus: string;
129
+ isStockNeeded: boolean;
130
+ minSalesQuantity: number;
131
+ maxSalesQuantity: number;
132
+ isShowedListPage: boolean;
133
+ isShowedDetailPage: boolean;
134
+ }
135
+ export interface Type {
136
+ id: number;
137
+ name: string;
138
+ key: string;
139
+ integrationCode: string;
140
+ isShowedOnPage: boolean;
141
+ parameterName: string;
142
+ routePath: string;
143
+ routeTitle: string;
144
+ routeDescription: string;
145
+ isAggregated: boolean;
146
+ extensionData: any;
147
+ }
148
+ export interface Barcode {
149
+ id: number;
150
+ barcode: string;
151
+ maxSalesQuantity: number;
152
+ stockTypes: StockType[];
153
+ stockTypeValues: StockTypeValue[];
154
+ }
155
+ export interface StockType {
156
+ id: number;
157
+ externalId: number;
158
+ }
159
+ export interface StockTypeValue {
160
+ id: number;
161
+ externalId: number;
162
+ }
163
+ export interface Document {
164
+ id: number;
165
+ name: string;
166
+ filePath: string;
167
+ thumbnailUrl: string;
168
+ documentType: string;
169
+ isDefault: boolean;
170
+ order: number;
171
+ templateId: number;
172
+ productDocumentGroup: ProductDocumentGroup;
173
+ thumbnails: Thumbnails;
174
+ extensionData: any;
175
+ integrationCode: string;
176
+ className: string;
177
+ }
178
+ export interface Thumbnails {
179
+ [thumbKey: string]: string;
180
+ }
181
+ export interface ProductDocumentGroup {
182
+ id: number;
183
+ name: string;
184
+ }
185
+ export interface Vendor {
186
+ id: number;
187
+ currenyId: number;
188
+ purchasePrice: number;
189
+ isFundingCalculation: boolean;
190
+ }
191
+ export interface AttributeGroupMapping {
192
+ attributeGroup: AttributeGroup;
193
+ attributeValueMappings: AttributeValueMapping[];
194
+ }
195
+ export interface AttributeGroup {
196
+ id: number;
197
+ name: string;
198
+ hierarchy: number[];
199
+ hierarchyField: string;
200
+ integrationCode: string;
201
+ parentId: number;
202
+ sort: number;
203
+ tenantId: string;
204
+ hierarchyIds: number[];
205
+ extensionData: any;
206
+ }
207
+ export interface AttributeValueMapping {
208
+ attribute: Attribute;
209
+ attributeValues: AttributeValue[];
210
+ attributeValueTexts: string[];
211
+ }
212
+ export interface Attribute {
213
+ id: number;
214
+ name: string;
215
+ attributeTypeId: number;
216
+ attributeGroupIds: number[];
217
+ integrationCode: string;
218
+ className: string;
219
+ order: number;
220
+ isExistOnList: boolean;
221
+ isAggregated: boolean;
222
+ parameterName: string;
223
+ routePath: string;
224
+ routeTitle: string;
225
+ routeDescription: string;
226
+ extensionData: any;
227
+ }
228
+ export interface AttributeValue {
229
+ id: number;
230
+ value: string;
231
+ attributeId: number;
232
+ routePath: string;
233
+ routeTitle: string;
234
+ routeDescription: string;
235
+ parameterName: string;
236
+ integrationCode: string;
237
+ className: string;
238
+ sort: number;
239
+ extensionData: any;
240
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ import { IProductService } from './product.types';
2
+ /**
3
+ * Product servisi, Product, Product Category, Channel ve Price Type verilerini alır.
4
+ * @description
5
+ * Microservice Kubernates içerisinden doğrudan iletişim sağlanabilmesi için aşağıdaki adresi kullanmalıdır.
6
+ * <service-name>.<namespace>.svc.cluster.local:<service-port>
7
+ * http://product.emosv2service.svc.cluster.local
8
+ */
9
+ export declare const ProductService: IProductService;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.ProductService = void 0;
16
+ const urls_1 = __importDefault(require("../urls"));
17
+ const __1 = require("../..");
18
+ /**
19
+ * Product servisi, Product, Product Category, Channel ve Price Type verilerini alır.
20
+ * @description
21
+ * Microservice Kubernates içerisinden doğrudan iletişim sağlanabilmesi için aşağıdaki adresi kullanmalıdır.
22
+ * <service-name>.<namespace>.svc.cluster.local:<service-port>
23
+ * http://product.emosv2service.svc.cluster.local
24
+ */
25
+ exports.ProductService = {
26
+ /**
27
+ * Bu servise ait local adres
28
+ */
29
+ ServiceUrl: "http://product.emosv2service.svc.cluster.local",
30
+ GetURL: function ({ isClient = false, language = process.env.DEFAULT_LANGUAGE || "tr", methodName }) {
31
+ let url = this.ServiceUrl;
32
+ if (process.env.API_URL && (process.env.USE_API_URL === 'true' || isClient))
33
+ url = `${process.env.API_URL}/api/product`;
34
+ return (url + methodName).replace(/{language}/g, language);
35
+ },
36
+ /**
37
+ * ID'ye göre product al.
38
+ * @param data İstek verilerini içeren nesne (varsayılan boş nesne)
39
+ * @param options İstek seçeneklerini içeren nesne
40
+ * @returns Product içeren cevap nesnesi
41
+ */
42
+ Product: function (data, options) {
43
+ return __awaiter(this, void 0, void 0, function* () {
44
+ return yield (0, __1.fetchRequest)().get(this.GetURL({
45
+ isClient: options === null || options === void 0 ? void 0 : options.useClient,
46
+ language: data === null || data === void 0 ? void 0 : data.language,
47
+ methodName: urls_1.default.Product.Product,
48
+ }), Object.assign(Object.assign({}, options), { params: data }));
49
+ });
50
+ },
51
+ };
@@ -0,0 +1,31 @@
1
+ import { IProductResponse } from 'nextemos/interfaces/product';
2
+ import { IApiResponse, IRequestInit } from '../..';
3
+ /**
4
+ * Product ID'sine göre Product alma isteği arayüzü.
5
+ */
6
+ interface IProductRequest {
7
+ id: number;
8
+ flags?: number;
9
+ includes?: string[];
10
+ tags?: string[];
11
+ language?: string;
12
+ }
13
+ /**
14
+ * Product hizmetleri arayüzü.
15
+ */
16
+ export interface IProductService {
17
+ /**
18
+ * Service URL'i
19
+ */
20
+ ServiceUrl: string;
21
+ GetURL: ({ isClient, language, methodName }: {
22
+ isClient?: boolean;
23
+ language?: string;
24
+ methodName: string;
25
+ }) => string;
26
+ /**
27
+ * Product ID'sine göre Product al.
28
+ */
29
+ Product: (data: IProductRequest, options?: IRequestInit) => Promise<IApiResponse<IProductResponse>>;
30
+ }
31
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -19,5 +19,16 @@ declare const _default: {
19
19
  Route: {
20
20
  GetRouteInfo: string;
21
21
  };
22
+ Product: {
23
+ Product: string;
24
+ SearchProductsRequest: string;
25
+ GetAllProductsRequest: string;
26
+ SearchProductsRequestWithWorkflow: string;
27
+ };
28
+ ProductCategory: {
29
+ All: string;
30
+ ProductCategory: string;
31
+ CategoryTree: string;
32
+ };
22
33
  };
23
34
  export default _default;
@@ -24,4 +24,15 @@ exports.default = {
24
24
  Route: {
25
25
  GetRouteInfo: '/{language}/Route/v1/GetRouteInfo',
26
26
  },
27
+ Product: {
28
+ Product: '/{language}/Product/v1/Product',
29
+ SearchProductsRequest: '/{language}/Product/v1/SearchProductsRequest',
30
+ GetAllProductsRequest: '/{language}/Product/v1/GetAllProductsRequest',
31
+ SearchProductsRequestWithWorkflow: '/{language}/Product/v1/SearchProductsRequestWithWorkflow',
32
+ },
33
+ ProductCategory: {
34
+ All: '/{language}/ProductCategory/v1/All',
35
+ ProductCategory: '/{language}/ProductCategory/v1/ProductCategory',
36
+ CategoryTree: '/{language}/ProductCategory/v1/CategoryTree',
37
+ }
27
38
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextemos",
3
- "version": "3.4.1",
3
+ "version": "3.5.0",
4
4
  "description": "For helpers and hooks used in NextJS projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",