nextemos 3.9.2 → 3.9.3

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.
@@ -2,15 +2,19 @@ export * from './elements';
2
2
  export * from './response';
3
3
  export * from './banner';
4
4
  export * from './blog';
5
- export * from './route';
6
5
  export * from './product';
6
+ export * from './route';
7
7
  export * from './stock';
8
8
  export * from './member';
9
9
  export * from './address';
10
10
  export * from './prediction';
11
+ export * from './localization';
11
12
  export * from '../services/banner/banner.types';
12
13
  export * from '../services/blog/blog.types';
13
14
  export * from '../services/product/product.types';
14
15
  export * from '../services/route/route.types';
16
+ export * from '../services/stock/stock.types';
15
17
  export * from '../services/member/member.types';
16
18
  export * from '../services/address/address.types';
19
+ export * from '../services/prediction/prediction.types';
20
+ export * from '../services/localization/localization.types';
@@ -19,16 +19,20 @@ __exportStar(require("./elements"), exports);
19
19
  __exportStar(require("./response"), exports);
20
20
  __exportStar(require("./banner"), exports);
21
21
  __exportStar(require("./blog"), exports);
22
- __exportStar(require("./route"), exports);
23
22
  __exportStar(require("./product"), exports);
23
+ __exportStar(require("./route"), exports);
24
24
  __exportStar(require("./stock"), exports);
25
25
  __exportStar(require("./member"), exports);
26
26
  __exportStar(require("./address"), exports);
27
27
  __exportStar(require("./prediction"), exports);
28
+ __exportStar(require("./localization"), exports);
28
29
  /// service types
29
30
  __exportStar(require("../services/banner/banner.types"), exports);
30
31
  __exportStar(require("../services/blog/blog.types"), exports);
31
32
  __exportStar(require("../services/product/product.types"), exports);
32
33
  __exportStar(require("../services/route/route.types"), exports);
34
+ __exportStar(require("../services/stock/stock.types"), exports);
33
35
  __exportStar(require("../services/member/member.types"), exports);
34
36
  __exportStar(require("../services/address/address.types"), exports);
37
+ __exportStar(require("../services/prediction/prediction.types"), exports);
38
+ __exportStar(require("../services/localization/localization.types"), exports);
@@ -0,0 +1,13 @@
1
+ import { IResponse } from "./response";
2
+ export interface ILocalizationAllResponse extends IResponse {
3
+ data?: ILocalizedText[];
4
+ }
5
+ export interface ILocalizedTextResponse extends IResponse {
6
+ data?: string;
7
+ }
8
+ export interface ILocalizedText {
9
+ id: number;
10
+ culture: string;
11
+ text: string;
12
+ hint: string;
13
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -4,7 +4,8 @@ export declare const Service: {
4
4
  Blog: import("..").IBlogService;
5
5
  Route: import("..").IRouteService;
6
6
  Product: import("..").IProductService;
7
- Stock: import("./stock/stock.types").IStockService;
7
+ Stock: import("..").IStockService;
8
8
  Member: import("..").IMemberService;
9
- Prediction: import("./prediction/prediction.types").IPredictionService;
9
+ Prediction: import("..").IPredictionService;
10
+ Localization: import("..").ILocalizationService;
10
11
  };
@@ -5,6 +5,7 @@ exports.Service = void 0;
5
5
  const address_1 = require("./address");
6
6
  const banner_1 = require("./banner");
7
7
  const blog_1 = require("./blog");
8
+ const localization_1 = require("./localization");
8
9
  const member_1 = require("./member");
9
10
  const prediction_1 = require("./prediction");
10
11
  const product_1 = require("./product");
@@ -18,5 +19,6 @@ exports.Service = {
18
19
  Product: product_1.ProductService,
19
20
  Stock: stock_1.StockService,
20
21
  Member: member_1.MemberService,
21
- Prediction: prediction_1.PredictionService
22
+ Prediction: prediction_1.PredictionService,
23
+ Localization: localization_1.LocalizationService
22
24
  };
@@ -0,0 +1,2 @@
1
+ import { ILocalizationService } from './localization.types';
2
+ export declare const LocalizationService: ILocalizationService;
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
+ return new (P || (P = Promise))(function (resolve, reject) {
28
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+ });
33
+ };
34
+ Object.defineProperty(exports, "__esModule", { value: true });
35
+ exports.LocalizationService = void 0;
36
+ const urls_1 = __importStar(require("../urls"));
37
+ const __1 = require("../..");
38
+ // Route servisi, Common page, redirects, rewrite ve content pageler ile ilgili servis.
39
+ exports.LocalizationService = {
40
+ ServiceUrl: "http://localization.emosv2service.svc.cluster.local",
41
+ Prefix: '/api/localization',
42
+ All: function () {
43
+ return __awaiter(this, arguments, void 0, function* (data = {}, options) {
44
+ return yield (0, __1.fetchRequest)().get((0, urls_1.getUrl)({
45
+ serviceUrl: this.ServiceUrl,
46
+ prefix: this.Prefix,
47
+ isClient: options === null || options === void 0 ? void 0 : options.useClient,
48
+ language: data === null || data === void 0 ? void 0 : data.language,
49
+ methodName: urls_1.default.Localization.All,
50
+ }), Object.assign(Object.assign({}, options), { params: data }));
51
+ });
52
+ },
53
+ AllByLanguage: function (data, options) {
54
+ return __awaiter(this, void 0, void 0, function* () {
55
+ return yield (0, __1.fetchRequest)().get((0, urls_1.getUrl)({
56
+ serviceUrl: this.ServiceUrl,
57
+ prefix: this.Prefix,
58
+ isClient: options === null || options === void 0 ? void 0 : options.useClient,
59
+ language: data === null || data === void 0 ? void 0 : data.language,
60
+ methodName: urls_1.default.Localization.AllByLanguage,
61
+ }), Object.assign(Object.assign({}, options), { params: data }));
62
+ });
63
+ },
64
+ AllByTagId: function (data, options) {
65
+ return __awaiter(this, void 0, void 0, function* () {
66
+ return yield (0, __1.fetchRequest)().get((0, urls_1.getUrl)({
67
+ serviceUrl: this.ServiceUrl,
68
+ prefix: this.Prefix,
69
+ isClient: options === null || options === void 0 ? void 0 : options.useClient,
70
+ language: data === null || data === void 0 ? void 0 : data.language,
71
+ methodName: urls_1.default.Localization.AllByTagId,
72
+ }), Object.assign(Object.assign({}, options), { params: data }));
73
+ });
74
+ },
75
+ AllByTagIdByLanguage: function (data, options) {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ return yield (0, __1.fetchRequest)().get((0, urls_1.getUrl)({
78
+ serviceUrl: this.ServiceUrl,
79
+ prefix: this.Prefix,
80
+ isClient: options === null || options === void 0 ? void 0 : options.useClient,
81
+ language: data === null || data === void 0 ? void 0 : data.language,
82
+ methodName: urls_1.default.Localization.AllByTagIdByLanguage,
83
+ }), Object.assign(Object.assign({}, options), { params: data }));
84
+ });
85
+ },
86
+ LocalizedText: function (data, options) {
87
+ return __awaiter(this, void 0, void 0, function* () {
88
+ return yield (0, __1.fetchRequest)().get((0, urls_1.getUrl)({
89
+ serviceUrl: this.ServiceUrl,
90
+ prefix: this.Prefix,
91
+ isClient: options === null || options === void 0 ? void 0 : options.useClient,
92
+ language: data === null || data === void 0 ? void 0 : data.language,
93
+ methodName: urls_1.default.Localization.LocalizedText,
94
+ }), Object.assign(Object.assign({}, options), { params: data }));
95
+ });
96
+ },
97
+ };
@@ -0,0 +1,30 @@
1
+ import { IApiResponse, ILocalizationAllResponse, ILocalizedTextResponse, IRequestInit } from '../..';
2
+ export interface IAllByTagIdRequest {
3
+ tagId: number;
4
+ language?: string;
5
+ tags?: string[];
6
+ }
7
+ export interface ILocalizedTextRequest {
8
+ text: string;
9
+ language?: string;
10
+ tags?: string[];
11
+ }
12
+ export interface IAllByLanguageRequest {
13
+ language: string;
14
+ tags?: string[];
15
+ }
16
+ export interface IAllByTagIdByLanguageRequest extends IAllByLanguageRequest {
17
+ tagId: number;
18
+ }
19
+ export interface ILocalizationService {
20
+ ServiceUrl: string;
21
+ Prefix: string;
22
+ AllByTagId: (data: IAllByTagIdRequest, options?: IRequestInit) => Promise<IApiResponse<ILocalizationAllResponse>>;
23
+ AllByTagIdByLanguage: (data: IAllByTagIdByLanguageRequest, options?: IRequestInit) => Promise<IApiResponse<ILocalizationAllResponse>>;
24
+ All: (data?: {
25
+ tags?: string[];
26
+ language?: string;
27
+ }, options?: IRequestInit) => Promise<IApiResponse<ILocalizationAllResponse>>;
28
+ AllByLanguage: (data: IAllByLanguageRequest, options?: IRequestInit) => Promise<IApiResponse<ILocalizationAllResponse>>;
29
+ LocalizedText: (data: ILocalizedTextRequest, options?: IRequestInit) => Promise<IApiResponse<ILocalizedTextResponse>>;
30
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -50,6 +50,13 @@ declare const _default: {
50
50
  All: string;
51
51
  };
52
52
  };
53
+ Localization: {
54
+ AllByTagId: string;
55
+ AllByTagIdByLanguage: string;
56
+ All: string;
57
+ AllByLanguage: string;
58
+ LocalizedText: string;
59
+ };
53
60
  };
54
61
  export default _default;
55
62
  export declare const getUrl: ({ isClient, language, methodName, serviceUrl, prefix, id }: {
@@ -56,6 +56,13 @@ exports.default = {
56
56
  All: '/api/AddressSourceData/All',
57
57
  }
58
58
  },
59
+ Localization: {
60
+ AllByTagId: '/LocalizedText/v1/all/bytagid',
61
+ AllByTagIdByLanguage: '/LocalizedText/v1/{language}/all/bytagid',
62
+ All: '/LocalizedText/v1/all',
63
+ AllByLanguage: '/LocalizedText/v1/{language}/all',
64
+ LocalizedText: '/LocalizedText/v1/{language}',
65
+ },
59
66
  };
60
67
  const getUrl = ({ isClient = false, language = process.env.DEFAULT_LANGUAGE || "tr", methodName, serviceUrl, prefix, id = '' }) => {
61
68
  let url = serviceUrl;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextemos",
3
- "version": "3.9.2",
3
+ "version": "3.9.3",
4
4
  "description": "For helpers and hooks used in NextJS projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",