nextemos 5.9.10 → 5.10.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.
- package/dist/helpers/getConfigs.d.ts +1 -0
- package/dist/helpers/getConfigs.js +1 -0
- package/dist/interfaces/comment.d.ts +61 -0
- package/dist/interfaces/comment.js +2 -0
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/interfaces/index.js +1 -0
- package/dist/interfaces/shoppingcart.d.ts +1 -0
- package/dist/services/comment/comment.types.d.ts +32 -0
- package/dist/services/comment/comment.types.js +2 -0
- package/dist/services/comment/index.d.ts +2 -0
- package/dist/services/comment/index.js +67 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.js +2 -0
- package/dist/services/urls.d.ts +6 -0
- package/dist/services/urls.js +6 -0
- package/package.json +1 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { IResponse } from "./response";
|
|
2
|
+
export interface ICommentRatingOptionsResponse extends IResponse {
|
|
3
|
+
data: ICommentRatingOption[];
|
|
4
|
+
}
|
|
5
|
+
export interface ICommentRatingOption {
|
|
6
|
+
id: number;
|
|
7
|
+
orderNo: number;
|
|
8
|
+
isDefault: boolean;
|
|
9
|
+
isApproved: boolean;
|
|
10
|
+
commentRatingOptionLocalizations: ICommentRatingOptionLocalization[];
|
|
11
|
+
}
|
|
12
|
+
export interface ICommentRatingOptionLocalization {
|
|
13
|
+
id: number;
|
|
14
|
+
name: string;
|
|
15
|
+
culture: string;
|
|
16
|
+
commentRatingOptionId: number;
|
|
17
|
+
isApproved: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface ICommentSummariesResponse extends IResponse {
|
|
20
|
+
data: ICommentSummary[];
|
|
21
|
+
}
|
|
22
|
+
export interface ICommentSummary {
|
|
23
|
+
contentTypeId: number;
|
|
24
|
+
contentItemId: number;
|
|
25
|
+
externalId: number;
|
|
26
|
+
totalComments: number;
|
|
27
|
+
totalRates: number;
|
|
28
|
+
averageRate: number;
|
|
29
|
+
commentRatingOptionId: number;
|
|
30
|
+
}
|
|
31
|
+
export interface ICommentListResponse extends IResponse {
|
|
32
|
+
data: IComment[];
|
|
33
|
+
}
|
|
34
|
+
export interface IComment {
|
|
35
|
+
id: number;
|
|
36
|
+
contentTypeId: number;
|
|
37
|
+
contentItemId: number;
|
|
38
|
+
externalId: number;
|
|
39
|
+
memberId: number;
|
|
40
|
+
title: string;
|
|
41
|
+
description: string;
|
|
42
|
+
answer: string;
|
|
43
|
+
positiveFlag: number;
|
|
44
|
+
negativeFlag: number;
|
|
45
|
+
status: number;
|
|
46
|
+
commentStatusType: string;
|
|
47
|
+
createdAt: string;
|
|
48
|
+
createdIPAdress: string;
|
|
49
|
+
culture: string;
|
|
50
|
+
orderNo: number;
|
|
51
|
+
integrationCode: string;
|
|
52
|
+
commentRates: ICommentRate[];
|
|
53
|
+
}
|
|
54
|
+
export interface ICommentRate {
|
|
55
|
+
id: number;
|
|
56
|
+
commentId: number;
|
|
57
|
+
rate: number;
|
|
58
|
+
description: string;
|
|
59
|
+
commentRatingOptionId: number;
|
|
60
|
+
commentRateType: string;
|
|
61
|
+
}
|
|
@@ -19,6 +19,7 @@ export * from "./payment";
|
|
|
19
19
|
export * from "./campaign";
|
|
20
20
|
export * from "./core";
|
|
21
21
|
export * from "./coupon";
|
|
22
|
+
export * from "./comment";
|
|
22
23
|
export * from "../services/banner/banner.types";
|
|
23
24
|
export * from "../services/blog/blog.types";
|
|
24
25
|
export * from "../services/product/product.types";
|
package/dist/interfaces/index.js
CHANGED
|
@@ -36,6 +36,7 @@ __exportStar(require("./payment"), exports);
|
|
|
36
36
|
__exportStar(require("./campaign"), exports);
|
|
37
37
|
__exportStar(require("./core"), exports);
|
|
38
38
|
__exportStar(require("./coupon"), exports);
|
|
39
|
+
__exportStar(require("./comment"), exports);
|
|
39
40
|
/// service types
|
|
40
41
|
__exportStar(require("../services/banner/banner.types"), exports);
|
|
41
42
|
__exportStar(require("../services/blog/blog.types"), exports);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { IApiResponse, ICommentListResponse, ICommentRatingOptionsResponse, ICommentSummariesResponse, IRequestBase, IRequestInit, IResponse, IService } from "../..";
|
|
2
|
+
export interface ICommentSummariesRequest extends IRequestBase {
|
|
3
|
+
contentTypeId: number;
|
|
4
|
+
externalId: number;
|
|
5
|
+
}
|
|
6
|
+
export interface ICommentListRequest extends IRequestBase {
|
|
7
|
+
externalId: number;
|
|
8
|
+
contentTypeId: number;
|
|
9
|
+
currentPage: number;
|
|
10
|
+
taked?: number;
|
|
11
|
+
pageSize?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface ICommentAddRequest extends IRequestBase {
|
|
14
|
+
contentTypeId: number;
|
|
15
|
+
contentItemId?: number;
|
|
16
|
+
externalId: number;
|
|
17
|
+
title?: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
ipAddress?: string;
|
|
20
|
+
culture?: string;
|
|
21
|
+
rates?: {
|
|
22
|
+
commentRatingOptionId: number;
|
|
23
|
+
rate: number;
|
|
24
|
+
description: string;
|
|
25
|
+
}[];
|
|
26
|
+
}
|
|
27
|
+
export interface ICommentService extends IService {
|
|
28
|
+
RatingOptions: (data: IRequestBase, options?: IRequestInit) => Promise<IApiResponse<ICommentRatingOptionsResponse>>;
|
|
29
|
+
Summaries: (data: IRequestBase, options?: IRequestInit) => Promise<IApiResponse<ICommentSummariesResponse>>;
|
|
30
|
+
List: (data: ICommentListRequest, options?: IRequestInit) => Promise<IApiResponse<ICommentListResponse>>;
|
|
31
|
+
AddComment: (data: ICommentAddRequest, options?: IRequestInit) => Promise<IApiResponse<IResponse>>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.CommentService = void 0;
|
|
39
|
+
const urls_1 = __importStar(require("../urls"));
|
|
40
|
+
const __1 = require("../..");
|
|
41
|
+
const getConfigs_1 = __importDefault(require("../../helpers/getConfigs"));
|
|
42
|
+
const { K8S_NAMESPACE, K8S_SERVICE_NAMES } = getConfigs_1.default;
|
|
43
|
+
// Address Servisi
|
|
44
|
+
exports.CommentService = {
|
|
45
|
+
Namespace: K8S_NAMESPACE,
|
|
46
|
+
ServiceUrl: () => `http://${K8S_SERVICE_NAMES.COMMENT}.${exports.CommentService.Namespace}.svc.cluster.local`,
|
|
47
|
+
Prefix: "/api/address",
|
|
48
|
+
Url: (methodName, options, language) => (0, urls_1.getUrl)({
|
|
49
|
+
serviceUrl: exports.CommentService.ServiceUrl(),
|
|
50
|
+
prefix: exports.CommentService.Prefix,
|
|
51
|
+
isClient: options === null || options === void 0 ? void 0 : options.useClient,
|
|
52
|
+
language,
|
|
53
|
+
methodName,
|
|
54
|
+
}),
|
|
55
|
+
RatingOptions: (data, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
56
|
+
return (0, __1.fetchRequest)().get(exports.CommentService.Url(urls_1.default.Comment.CommentRatingOptions, options, data === null || data === void 0 ? void 0 : data.language), Object.assign(Object.assign({}, options), { params: data }));
|
|
57
|
+
}),
|
|
58
|
+
Summaries: (data, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
59
|
+
return (0, __1.fetchRequest)().get(exports.CommentService.Url(urls_1.default.Comment.CommentSummaries, options, data === null || data === void 0 ? void 0 : data.language), Object.assign(Object.assign({}, options), { params: data }));
|
|
60
|
+
}),
|
|
61
|
+
List: (data, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
62
|
+
return (0, __1.fetchRequest)().post(exports.CommentService.Url(urls_1.default.Comment.CommentList, options, data === null || data === void 0 ? void 0 : data.language), Object.assign(Object.assign({}, options), { body: JSON.stringify(data) }));
|
|
63
|
+
}),
|
|
64
|
+
AddComment: (data, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
65
|
+
return (0, __1.fetchRequest)().post(exports.CommentService.Url(urls_1.default.Comment.AddComment, options, data === null || data === void 0 ? void 0 : data.language), Object.assign(Object.assign({}, options), { body: JSON.stringify(data) }));
|
|
66
|
+
}),
|
|
67
|
+
};
|
package/dist/services/index.d.ts
CHANGED
package/dist/services/index.js
CHANGED
|
@@ -20,6 +20,7 @@ const stock_1 = require("./stock");
|
|
|
20
20
|
const campaign_1 = require("./campaign");
|
|
21
21
|
const core_1 = require("./core");
|
|
22
22
|
const coupon_1 = require("./coupon");
|
|
23
|
+
const comment_1 = require("./comment");
|
|
23
24
|
exports.Service = {
|
|
24
25
|
Address: address_1.AddressService,
|
|
25
26
|
Banner: banner_1.BannerService,
|
|
@@ -39,4 +40,5 @@ exports.Service = {
|
|
|
39
40
|
Campaign: campaign_1.CampaignService,
|
|
40
41
|
Core: core_1.CoreService,
|
|
41
42
|
Coupon: coupon_1.CouponService,
|
|
43
|
+
Comment: comment_1.CommentService,
|
|
42
44
|
};
|
package/dist/services/urls.d.ts
CHANGED
package/dist/services/urls.js
CHANGED
|
@@ -7,6 +7,12 @@ exports.getUrl = void 0;
|
|
|
7
7
|
const getConfigs_1 = __importDefault(require("../helpers/getConfigs"));
|
|
8
8
|
const { API_URL, USE_API_URL, DEFAULT_LANGUAGE } = getConfigs_1.default;
|
|
9
9
|
exports.default = {
|
|
10
|
+
Comment: {
|
|
11
|
+
CommentRatingOptions: "/{language}/CommentRatingOptions/v1/All",
|
|
12
|
+
CommentSummaries: "/{language}/CommentSummaries/v1/ByExternalId",
|
|
13
|
+
CommentList: "/{language}/Comments/v1/Paged",
|
|
14
|
+
AddComment: "/{language}/Comments/v1/Comments",
|
|
15
|
+
},
|
|
10
16
|
Banner: {
|
|
11
17
|
GetBannerById: "/{language}/Banner/v1/GetBannerById",
|
|
12
18
|
GetBannerByName: "/{language}/Banner/v1/GetBannerByName",
|