store-scrapper-js-common 1.0.107 → 1.0.108
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/entities/product.d.ts +7 -0
- package/dist/entities/product.js +12 -0
- package/dist/entities/product.js.map +1 -1
- package/dist/enums/image-type.enum.d.ts +5 -0
- package/dist/enums/image-type.enum.js +10 -0
- package/dist/enums/image-type.enum.js.map +1 -0
- package/dist/enums/index.js +3 -1
- package/dist/enums/index.js.map +1 -1
- package/dist/enums/telegram-message-type.d.ts +1 -1
- package/dist/enums/telegram-message-type.js +6 -0
- package/dist/enums/telegram-message-type.js.map +1 -1
- package/package.json +1 -1
- package/src/entities/product.ts +10 -0
- package/src/enums/image-type.enum.ts +5 -0
- package/src/enums/telegram-message-type.ts +1 -1
|
@@ -3,6 +3,7 @@ import { Price } from './price';
|
|
|
3
3
|
import { PricesStats } from './prices-stats';
|
|
4
4
|
import { Keyword } from './keyword';
|
|
5
5
|
import { HttpRequest } from '../classes/http-request';
|
|
6
|
+
import { ImageTypeEnum } from '../enums/image-type.enum';
|
|
6
7
|
export declare enum CurrencyEnum {
|
|
7
8
|
CLP = "clp",
|
|
8
9
|
CMR_PTS = "cmr_pts",
|
|
@@ -68,8 +69,14 @@ export declare class Product extends AbstractBase {
|
|
|
68
69
|
priceHistory?: Price[];
|
|
69
70
|
rank?: number;
|
|
70
71
|
image?: string;
|
|
72
|
+
images?: {
|
|
73
|
+
type: ImageTypeEnum;
|
|
74
|
+
url: string;
|
|
75
|
+
}[];
|
|
71
76
|
category?: string;
|
|
72
77
|
categoryPath?: string;
|
|
78
|
+
page?: number;
|
|
79
|
+
userRank?: number;
|
|
73
80
|
attributes?: ProductAttributes;
|
|
74
81
|
stockHistory?: {
|
|
75
82
|
stock: number;
|
package/dist/entities/product.js
CHANGED
|
@@ -141,6 +141,10 @@ __decorate([
|
|
|
141
141
|
typeorm_1.Column(),
|
|
142
142
|
__metadata("design:type", String)
|
|
143
143
|
], Product.prototype, "image", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
typeorm_1.Column(),
|
|
146
|
+
__metadata("design:type", Array)
|
|
147
|
+
], Product.prototype, "images", void 0);
|
|
144
148
|
__decorate([
|
|
145
149
|
typeorm_1.Column(),
|
|
146
150
|
__metadata("design:type", String)
|
|
@@ -149,6 +153,14 @@ __decorate([
|
|
|
149
153
|
typeorm_1.Column(),
|
|
150
154
|
__metadata("design:type", String)
|
|
151
155
|
], Product.prototype, "categoryPath", void 0);
|
|
156
|
+
__decorate([
|
|
157
|
+
typeorm_1.Column(),
|
|
158
|
+
__metadata("design:type", Number)
|
|
159
|
+
], Product.prototype, "page", void 0);
|
|
160
|
+
__decorate([
|
|
161
|
+
typeorm_1.Column(),
|
|
162
|
+
__metadata("design:type", Number)
|
|
163
|
+
], Product.prototype, "userRank", void 0);
|
|
152
164
|
__decorate([
|
|
153
165
|
typeorm_1.Column(),
|
|
154
166
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product.js","sourceRoot":"/","sources":["entities/product.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAGiB;AACjB,qDAA6C;AAC7C,mDAA+C;AAC/C,mCAAgC;AAChC,iDAA6C;AAE7C,0DAAsD;
|
|
1
|
+
{"version":3,"file":"product.js","sourceRoot":"/","sources":["entities/product.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAGiB;AACjB,qDAA6C;AAC7C,mDAA+C;AAC/C,mCAAgC;AAChC,iDAA6C;AAE7C,0DAAsD;AAGtD,IAAY,YAWX;AAXD,WAAY,YAAY;IACpB,2BAAW,CAAA;IACX,mCAAmB,CAAA;IACnB,uCAAuB,CAAA;IACvB,yCAAyB,CAAA;IACzB,8CAA8B,CAAA;IAC9B,2BAAW,CAAA;IACX,2BAAW,CAAA;IACX,2BAAW,CAAA;IACX,2BAAW,CAAA;IACX,2BAAW,CAAA;AACf,CAAC,EAXW,YAAY,GAA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C,OAAO,CAyJnB;AAzJY,0BAAO","sourcesContent":["import {\n Column,\n Entity, Index, Unique,\n} from 'typeorm';\nimport { IsNotEmpty } from 'class-validator';\nimport { AbstractBase } from './abstract-base';\nimport { Price } from './price';\nimport { PricesStats } from './prices-stats';\nimport { Keyword } from './keyword';\nimport { HttpRequest } from '../classes/http-request';\nimport { ImageTypeEnum } from '../enums/image-type.enum';\n\nexport enum CurrencyEnum {\n CLP = 'clp',\n CMR_PTS = 'cmr_pts',\n PARIS_PTS = 'paris_pts',\n RIPLEY_PTS = 'ripley_pts',\n GENERAL_POINTS = 'general_pts',\n BRL = 'brl',\n PEN = 'PEN',\n ARS = 'ars',\n EUR = 'eur',\n USD = 'usd',\n}\n\nexport enum UpdateReasonEnum {\n TIME = 'time',\n NEW_PRICE = 'new_price',\n NEW_CONDITIONAL_PRICE = 'new_conditional_price',\n NEW_NAME = 'new_name',\n NEW_LISTING = 'new_listing',\n NEW_STOCK = 'new_stock',\n MISSING_DATA = 'missing_data',\n FIX_DATA = 'fix_data',\n RE_LISTING = 're_listing',\n\n CHILDREN_NEW_PRICE = 'children_new_price',\n CHILDREN_NEW_CONDITIONAL_PRICE = 'children_conditional_new_price',\n CHILDREN_NEW_NAME = 'children_new_name',\n CHILDREN_NEW_LISTING = 'children_new_listing',\n CHILDREN_NEW_STOCK = 'children_new_stock',\n CHILDREN_MISSING_DATA = 'children_missing_data',\n CHILDREN_FIX_DATA = 'children_fix_data',\n CHILDREN_RE_LISTING = 'children_re_listing',\n}\n\nexport interface ProductAttributes {\n stock?: number;\n\n // TODO: Add enum\n color?: string;\n\n // TODO: Add enum\n size?: string;\n\n [key: string]: any;\n}\n\nexport interface ConditionalPrice {\n minAmount?: number;\n price?:number;\n cardRequired?: boolean;\n createdAt?: Date;\n}\n\n@Entity({ name: 'products' })\n@Unique('store_ref_sku', ['storeRef', 'sku'])\nexport class Product extends AbstractBase {\n @Column()\n name: string;\n\n @Column()\n brandName?: string;\n\n @Column()\n normalizedBrandName?: string;\n\n @Column()\n modelName?: string;\n\n @Column()\n @IsNotEmpty()\n @Index()\n sku: string;\n\n @Column()\n internalId?: string;\n\n @Column()\n ean?: string;\n\n @Column()\n @IsNotEmpty()\n url: string;\n\n @Column()\n @IsNotEmpty()\n @Index()\n storeRef: string;\n\n @Column()\n storeName?: string;\n\n @Column()\n branchStoreName?: string;\n\n @Column()\n sellerName?: string;\n\n @Column()\n normalizedSellerName?: string;\n\n @Column()\n @IsNotEmpty()\n price?: Price;\n\n @Column()\n conditionalPrice?: ConditionalPrice;\n\n @Column()\n previousPrice?: Price;\n\n @Column()\n bestPrice?: Price;\n\n @Column()\n priceStats?: PricesStats;\n\n @Column()\n priceHistory?: Price[];\n\n @Column()\n rank?: number;\n\n @Column()\n image?: string;\n\n @Column()\n images?: { type: ImageTypeEnum, url: string }[]\n\n @Column()\n category?: string;\n\n @Column()\n categoryPath?: string;\n\n @Column()\n page?: number;\n\n @Column()\n userRank?: number;\n\n @Column()\n attributes?: ProductAttributes;\n\n @Column()\n stockHistory?: {\n stock: number,\n updatedAt: string,\n }[];\n\n @Column()\n homeDeliveryShipping?: boolean;\n\n @Column()\n pickUpFromStoreShipping?: boolean;\n\n @Column()\n fastDelivery?: boolean;\n\n @Column()\n enabled?: boolean;\n\n @Column()\n sourceUrl?: string;\n\n @Column()\n request? : HttpRequest;\n\n @Column()\n @Index()\n updatedAt?: Date;\n\n @Column()\n @Index()\n categoryKeywordNames?: string[];\n\n @Column()\n categoryKeywords?: Keyword[];\n\n @Column()\n @Index()\n processedPricesAt?: Date;\n\n @Column()\n isMarketplace?: boolean;\n\n @Column()\n addToCartLink?: string;\n\n @Column()\n currency?: CurrencyEnum;\n\n @Column()\n updateReason?: UpdateReasonEnum[];\n\n @Column()\n nameHistory?: {\n name: string,\n updatedAt: string,\n }[];\n\n @Column()\n parentProductIdRef?: string;\n\n @Column()\n parentProductSkuRef?: string;\n\n @Column()\n children?: Product[]\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ImageTypeEnum = void 0;
|
|
4
|
+
var ImageTypeEnum;
|
|
5
|
+
(function (ImageTypeEnum) {
|
|
6
|
+
ImageTypeEnum["DEFAULT"] = "default";
|
|
7
|
+
ImageTypeEnum["FULL"] = "full";
|
|
8
|
+
ImageTypeEnum["THUMBNAIL"] = "thumbnail";
|
|
9
|
+
})(ImageTypeEnum = exports.ImageTypeEnum || (exports.ImageTypeEnum = {}));
|
|
10
|
+
//# sourceMappingURL=image-type.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-type.enum.js","sourceRoot":"/","sources":["enums/image-type.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,8BAAa,CAAA;IACb,wCAAuB,CAAA;AACzB,CAAC,EAJW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAIxB","sourcesContent":["export enum ImageTypeEnum {\n DEFAULT = 'default',\n FULL = 'full',\n THUMBNAIL = 'thumbnail',\n}\n"]}
|
package/dist/enums/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TelegramQueueCommandEnum = exports.TelegramQueueEnum = exports.TelegramClientEnum = exports.RequestTypeEnum = void 0;
|
|
3
|
+
exports.TelegramMessageType = exports.TelegramQueueCommandEnum = exports.TelegramQueueEnum = exports.TelegramClientEnum = exports.RequestTypeEnum = void 0;
|
|
4
4
|
const request_type_enum_1 = require("./request-type.enum");
|
|
5
5
|
Object.defineProperty(exports, "RequestTypeEnum", { enumerable: true, get: function () { return request_type_enum_1.RequestTypeEnum; } });
|
|
6
6
|
const telegram_client_enum_1 = require("./telegram-client.enum");
|
|
7
7
|
Object.defineProperty(exports, "TelegramClientEnum", { enumerable: true, get: function () { return telegram_client_enum_1.TelegramClientEnum; } });
|
|
8
|
+
const telegram_message_type_1 = require("./telegram-message-type");
|
|
9
|
+
Object.defineProperty(exports, "TelegramMessageType", { enumerable: true, get: function () { return telegram_message_type_1.TelegramMessageType; } });
|
|
8
10
|
const telegram_queue_command_enum_1 = require("./telegram-queue-command.enum");
|
|
9
11
|
Object.defineProperty(exports, "TelegramQueueCommandEnum", { enumerable: true, get: function () { return telegram_queue_command_enum_1.TelegramQueueCommandEnum; } });
|
|
10
12
|
const telegram_queue_enum_1 = require("./telegram-queue.enum");
|
package/dist/enums/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["enums/index.ts"],"names":[],"mappings":";;;AAAA,2DAAsD;AAOpD,gGAPO,mCAAe,OAOP;AANjB,iEAA4D;AAMzC,mGANV,yCAAkB,OAMU;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["enums/index.ts"],"names":[],"mappings":";;;AAAA,2DAAsD;AAOpD,gGAPO,mCAAe,OAOP;AANjB,iEAA4D;AAMzC,mGANV,yCAAkB,OAMU;AALrC,mEAA8D;AAKsB,oGAL3E,2CAAmB,OAK2E;AAJvG,+EAAyE;AAIf,yGAJjD,sDAAwB,OAIiD;AAHlF,+DAA0D;AAGnB,kGAH9B,uCAAiB,OAG8B","sourcesContent":["import { RequestTypeEnum } from './request-type.enum';\nimport { TelegramClientEnum } from './telegram-client.enum';\nimport { TelegramMessageType } from './telegram-message-type';\nimport { TelegramQueueCommandEnum } from './telegram-queue-command.enum';\nimport { TelegramQueueEnum } from './telegram-queue.enum';\n\nexport {\n RequestTypeEnum, TelegramClientEnum, TelegramQueueEnum, TelegramQueueCommandEnum, TelegramMessageType,\n};\n"]}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TelegramMessageType = void 0;
|
|
4
|
+
var TelegramMessageType;
|
|
5
|
+
(function (TelegramMessageType) {
|
|
6
|
+
TelegramMessageType["MESSAGE"] = "message";
|
|
7
|
+
TelegramMessageType["IMAGE"] = "image";
|
|
8
|
+
})(TelegramMessageType = exports.TelegramMessageType || (exports.TelegramMessageType = {}));
|
|
3
9
|
//# sourceMappingURL=telegram-message-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telegram-message-type.js","sourceRoot":"/","sources":["enums/telegram-message-type.ts"],"names":[],"mappings":"","sourcesContent":["export
|
|
1
|
+
{"version":3,"file":"telegram-message-type.js","sourceRoot":"/","sources":["enums/telegram-message-type.ts"],"names":[],"mappings":";;;AAAA,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,sCAAe,CAAA;AACjB,CAAC,EAHW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAG9B","sourcesContent":["export enum TelegramMessageType {\n MESSAGE = 'message',\n IMAGE = 'image',\n}\n"]}
|
package/package.json
CHANGED
package/src/entities/product.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { Price } from './price';
|
|
|
8
8
|
import { PricesStats } from './prices-stats';
|
|
9
9
|
import { Keyword } from './keyword';
|
|
10
10
|
import { HttpRequest } from '../classes/http-request';
|
|
11
|
+
import { ImageTypeEnum } from '../enums/image-type.enum';
|
|
11
12
|
|
|
12
13
|
export enum CurrencyEnum {
|
|
13
14
|
CLP = 'clp',
|
|
@@ -134,12 +135,21 @@ export class Product extends AbstractBase {
|
|
|
134
135
|
@Column()
|
|
135
136
|
image?: string;
|
|
136
137
|
|
|
138
|
+
@Column()
|
|
139
|
+
images?: { type: ImageTypeEnum, url: string }[]
|
|
140
|
+
|
|
137
141
|
@Column()
|
|
138
142
|
category?: string;
|
|
139
143
|
|
|
140
144
|
@Column()
|
|
141
145
|
categoryPath?: string;
|
|
142
146
|
|
|
147
|
+
@Column()
|
|
148
|
+
page?: number;
|
|
149
|
+
|
|
150
|
+
@Column()
|
|
151
|
+
userRank?: number;
|
|
152
|
+
|
|
143
153
|
@Column()
|
|
144
154
|
attributes?: ProductAttributes;
|
|
145
155
|
|