store-scrapper-js-common 1.0.69 → 1.0.73
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/index.d.ts +3 -3
- package/dist/entities/index.js +3 -1
- package/dist/entities/index.js.map +1 -1
- package/dist/entities/price.d.ts +9 -0
- package/dist/entities/price.js +19 -1
- package/dist/entities/price.js.map +1 -1
- package/dist/entities/product.d.ts +3 -0
- package/dist/entities/product.js +2 -0
- package/dist/entities/product.js.map +1 -1
- package/dist/entities/store.d.ts +8 -2
- package/dist/entities/store.js +12 -2
- package/dist/entities/store.js.map +1 -1
- package/package.json +1 -1
- package/src/entities/index.ts +6 -4
- package/src/entities/price.ts +16 -0
- package/src/entities/product.ts +4 -1
- package/src/entities/store.ts +11 -2
package/dist/entities/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { StoreQueueConfig, Store, CountryEnum } from './store';
|
|
1
|
+
import { StoreQueueConfig, Store, CountryEnum, PriorityEnum } from './store';
|
|
2
2
|
import { Product, UpdateReasonEnum, CurrencyEnum, ProductAttributes, ConditionalPrice } from './product';
|
|
3
|
-
import { Price } from './price';
|
|
3
|
+
import { Price, MeasurementUnitEnum } from './price';
|
|
4
4
|
import { Category } from './category';
|
|
5
5
|
import { AbstractBase } from './abstract-base';
|
|
6
6
|
import { Keyword, CATEGORY_ENUM, CONDITION_ENUM, CONDITION_FIELD_ENUM } from './keyword';
|
|
7
7
|
import { User } from './user';
|
|
8
8
|
import { AlertConditions } from './alert-conditions';
|
|
9
9
|
export declare const Entities: (typeof Price | typeof Keyword | typeof Product | typeof Store | typeof User)[];
|
|
10
|
-
export { Store, Product, Price, Category, AbstractBase, Keyword, CONDITION_FIELD_ENUM, CONDITION_ENUM, CATEGORY_ENUM, User, AlertConditions, StoreQueueConfig, CountryEnum, CurrencyEnum, UpdateReasonEnum, ConditionalPrice, ProductAttributes, };
|
|
10
|
+
export { Store, Product, Price, Category, AbstractBase, Keyword, CONDITION_FIELD_ENUM, CONDITION_ENUM, CATEGORY_ENUM, User, AlertConditions, StoreQueueConfig, CountryEnum, PriorityEnum, CurrencyEnum, UpdateReasonEnum, ConditionalPrice, ProductAttributes, MeasurementUnitEnum, };
|
package/dist/entities/index.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UpdateReasonEnum = exports.CurrencyEnum = exports.CountryEnum = exports.AlertConditions = exports.User = exports.CATEGORY_ENUM = exports.CONDITION_ENUM = exports.CONDITION_FIELD_ENUM = exports.Keyword = exports.AbstractBase = exports.Category = exports.Price = exports.Product = exports.Store = exports.Entities = void 0;
|
|
3
|
+
exports.MeasurementUnitEnum = exports.UpdateReasonEnum = exports.CurrencyEnum = exports.PriorityEnum = exports.CountryEnum = exports.AlertConditions = exports.User = exports.CATEGORY_ENUM = exports.CONDITION_ENUM = exports.CONDITION_FIELD_ENUM = exports.Keyword = exports.AbstractBase = exports.Category = exports.Price = exports.Product = exports.Store = exports.Entities = void 0;
|
|
4
4
|
const store_1 = require("./store");
|
|
5
5
|
Object.defineProperty(exports, "Store", { enumerable: true, get: function () { return store_1.Store; } });
|
|
6
6
|
Object.defineProperty(exports, "CountryEnum", { enumerable: true, get: function () { return store_1.CountryEnum; } });
|
|
7
|
+
Object.defineProperty(exports, "PriorityEnum", { enumerable: true, get: function () { return store_1.PriorityEnum; } });
|
|
7
8
|
const product_1 = require("./product");
|
|
8
9
|
Object.defineProperty(exports, "Product", { enumerable: true, get: function () { return product_1.Product; } });
|
|
9
10
|
Object.defineProperty(exports, "UpdateReasonEnum", { enumerable: true, get: function () { return product_1.UpdateReasonEnum; } });
|
|
10
11
|
Object.defineProperty(exports, "CurrencyEnum", { enumerable: true, get: function () { return product_1.CurrencyEnum; } });
|
|
11
12
|
const price_1 = require("./price");
|
|
12
13
|
Object.defineProperty(exports, "Price", { enumerable: true, get: function () { return price_1.Price; } });
|
|
14
|
+
Object.defineProperty(exports, "MeasurementUnitEnum", { enumerable: true, get: function () { return price_1.MeasurementUnitEnum; } });
|
|
13
15
|
const category_1 = require("./category");
|
|
14
16
|
Object.defineProperty(exports, "Category", { enumerable: true, get: function () { return category_1.Category; } });
|
|
15
17
|
const abstract_base_1 = require("./abstract-base");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["entities/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["entities/index.ts"],"names":[],"mappings":";;;AAAA,mCAEiB;AAkBf,sFAnBkB,aAAK,OAmBlB;AACmE,4FApB/C,mBAAW,OAoB+C;AAAE,6FApB/C,oBAAY,OAoB+C;AAlBnG,uCAEmB;AAeV,wFAhBP,iBAAO,OAgBO;AAEA,iGAlBL,0BAAgB,OAkBK;AAA9B,6FAlB2B,sBAAY,OAkB3B;AAhBd,mCAAqD;AAcnC,sFAdT,aAAK,OAcS;AAEgD,oGAhBvD,2BAAmB,OAgBuD;AAf1F,yCAAsC;AAab,yFAbhB,mBAAQ,OAagB;AAZjC,mDAA+C;AAYZ,6FAZ1B,4BAAY,OAY0B;AAX/C,uCAEmB;AAS8B,wFAV/C,iBAAO,OAU+C;AACtC,8FAXP,uBAAa,OAWO;AAA7B,+FAXwB,wBAAc,OAWxB;AAD0C,qGAVhB,8BAAoB,OAUgB;AAR9E,iCAA8B;AASG,qFATxB,WAAI,OASwB;AARrC,yDAAqD;AAQd,gGAR9B,kCAAe,OAQ8B;AANzC,QAAA,QAAQ,GAAG;IACtB,aAAK,EAAE,iBAAO,EAAE,aAAK,EAAE,iBAAO,EAAE,WAAI;CACrC,CAAC","sourcesContent":["import {\n StoreQueueConfig, Store, CountryEnum, PriorityEnum,\n} from './store';\nimport {\n Product, UpdateReasonEnum, CurrencyEnum, ProductAttributes, ConditionalPrice,\n} from './product';\nimport { Price, MeasurementUnitEnum } from './price';\nimport { Category } from './category';\nimport { AbstractBase } from './abstract-base';\nimport {\n Keyword, CATEGORY_ENUM, CONDITION_ENUM, CONDITION_FIELD_ENUM,\n} from './keyword';\nimport { User } from './user';\nimport { AlertConditions } from './alert-conditions';\n\nexport const Entities = [\n Store, Product, Price, Keyword, User,\n];\n\nexport {\n Store, Product, Price, Category, AbstractBase, Keyword, CONDITION_FIELD_ENUM,\n CONDITION_ENUM, CATEGORY_ENUM, User, AlertConditions, StoreQueueConfig, CountryEnum, PriorityEnum,\n CurrencyEnum, UpdateReasonEnum, ConditionalPrice, ProductAttributes, MeasurementUnitEnum,\n};\n"]}
|
package/dist/entities/price.d.ts
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { AbstractBase } from './abstract-base';
|
|
2
|
+
export declare enum MeasurementUnitEnum {
|
|
3
|
+
KG = "kg",
|
|
4
|
+
G = "g",
|
|
5
|
+
L = "l",
|
|
6
|
+
ML = "ml",
|
|
7
|
+
UNIT = "unit"
|
|
8
|
+
}
|
|
2
9
|
export declare class Price extends AbstractBase {
|
|
3
10
|
productRef: string;
|
|
4
11
|
normalPrice?: number;
|
|
5
12
|
offerPrice?: number;
|
|
6
13
|
cardPrice?: number;
|
|
7
14
|
sourceUrl?: string;
|
|
15
|
+
unitMultiplier?: number;
|
|
16
|
+
measurementUnit?: MeasurementUnitEnum;
|
|
8
17
|
createdAt?: Date;
|
|
9
18
|
}
|
package/dist/entities/price.js
CHANGED
|
@@ -9,10 +9,18 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Price = void 0;
|
|
12
|
+
exports.Price = exports.MeasurementUnitEnum = void 0;
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
15
|
const abstract_base_1 = require("./abstract-base");
|
|
16
|
+
var MeasurementUnitEnum;
|
|
17
|
+
(function (MeasurementUnitEnum) {
|
|
18
|
+
MeasurementUnitEnum["KG"] = "kg";
|
|
19
|
+
MeasurementUnitEnum["G"] = "g";
|
|
20
|
+
MeasurementUnitEnum["L"] = "l";
|
|
21
|
+
MeasurementUnitEnum["ML"] = "ml";
|
|
22
|
+
MeasurementUnitEnum["UNIT"] = "unit";
|
|
23
|
+
})(MeasurementUnitEnum = exports.MeasurementUnitEnum || (exports.MeasurementUnitEnum = {}));
|
|
16
24
|
let Price = class Price extends abstract_base_1.AbstractBase {
|
|
17
25
|
};
|
|
18
26
|
__decorate([
|
|
@@ -44,6 +52,16 @@ __decorate([
|
|
|
44
52
|
class_validator_1.IsOptional(),
|
|
45
53
|
__metadata("design:type", String)
|
|
46
54
|
], Price.prototype, "sourceUrl", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
typeorm_1.Column(),
|
|
57
|
+
class_validator_1.IsOptional(),
|
|
58
|
+
__metadata("design:type", Number)
|
|
59
|
+
], Price.prototype, "unitMultiplier", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
typeorm_1.Column(),
|
|
62
|
+
class_validator_1.IsOptional(),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], Price.prototype, "measurementUnit", void 0);
|
|
47
65
|
__decorate([
|
|
48
66
|
typeorm_1.CreateDateColumn(),
|
|
49
67
|
typeorm_1.Index(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"price.js","sourceRoot":"/","sources":["entities/price.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAEiB;AACjB,qDAAmE;AACnE,mDAA+C;
|
|
1
|
+
{"version":3,"file":"price.js","sourceRoot":"/","sources":["entities/price.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAEiB;AACjB,qDAAmE;AACnE,mDAA+C;AAE/C,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC3B,gCAAS,CAAA;IACT,8BAAO,CAAA;IACP,8BAAO,CAAA;IACP,gCAAS,CAAA;IACT,oCAAa,CAAA;AACjB,CAAC,EANW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAM9B;AAGD,IAAa,KAAK,GAAlB,MAAa,KAAM,SAAQ,4BAAY;CAoCtC,CAAA;AAhCG;IAHC,gBAAM,EAAE;IACR,4BAAU,EAAE;IACZ,eAAK,EAAE;;yCACW;AAKnB;IAHC,gBAAM,EAAE;IACR,0BAAQ,EAAE;IACV,4BAAU,EAAE;;0CACQ;AAKrB;IAHC,gBAAM,EAAE;IACR,0BAAQ,EAAE;IACV,4BAAU,EAAE;;yCACO;AAKpB;IAHC,gBAAM,EAAE;IACR,0BAAQ,EAAE;IACV,4BAAU,EAAE;;wCACM;AAInB;IAFC,gBAAM,EAAE;IACR,4BAAU,EAAE;;wCACM;AAInB;IAFC,gBAAM,EAAE;IACR,4BAAU,EAAE;;6CACW;AAIxB;IAFC,gBAAM,EAAE;IACR,4BAAU,EAAE;;8CACyB;AAItC;IAFC,0BAAgB,EAAE;IAClB,eAAK,EAAE;8BACI,IAAI;wCAAC;AAnCR,KAAK;IADjB,gBAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;GACd,KAAK,CAoCjB;AApCY,sBAAK","sourcesContent":["import {\n Column, CreateDateColumn, Entity, Index,\n} from 'typeorm';\nimport { IsNotEmpty, IsNumber, IsOptional } from 'class-validator';\nimport { AbstractBase } from './abstract-base';\n\nexport enum MeasurementUnitEnum {\n KG = 'kg',\n G = 'g',\n L = 'l',\n ML = 'ml',\n UNIT = 'unit'\n}\n\n@Entity({ name: 'prices' })\nexport class Price extends AbstractBase {\n @Column()\n @IsNotEmpty()\n @Index()\n productRef: string;\n\n @Column()\n @IsNumber()\n @IsOptional()\n normalPrice?: number;\n\n @Column()\n @IsNumber()\n @IsOptional()\n offerPrice?: number;\n\n @Column()\n @IsNumber()\n @IsOptional()\n cardPrice?: number;\n\n @Column()\n @IsOptional()\n sourceUrl?: string;\n\n @Column()\n @IsOptional()\n unitMultiplier?: number;\n\n @Column()\n @IsOptional()\n measurementUnit?: MeasurementUnitEnum;\n\n @CreateDateColumn()\n @Index()\n createdAt?: Date;\n}\n"]}
|
|
@@ -7,6 +7,7 @@ export declare enum CurrencyEnum {
|
|
|
7
7
|
CMR_PTS = "cmr_pts",
|
|
8
8
|
PARIS_PTS = "paris_pts",
|
|
9
9
|
RIPLEY_PTS = "ripley_pts",
|
|
10
|
+
GENERAL_POINTS = "general_pts",
|
|
10
11
|
BRL = "brl",
|
|
11
12
|
PEN = "PEN",
|
|
12
13
|
ARS = "ars",
|
|
@@ -15,6 +16,7 @@ export declare enum CurrencyEnum {
|
|
|
15
16
|
export declare enum UpdateReasonEnum {
|
|
16
17
|
TIME = "time",
|
|
17
18
|
NEW_PRICE = "new_price",
|
|
19
|
+
NEW_CONDITIONAL_PRICE = "new_conditional_price",
|
|
18
20
|
NEW_NAME = "new_name",
|
|
19
21
|
NEW_LISTING = "new_listing",
|
|
20
22
|
MISSING_DATA = "missing_data",
|
|
@@ -30,6 +32,7 @@ export interface ConditionalPrice {
|
|
|
30
32
|
minAmount?: number;
|
|
31
33
|
price?: number;
|
|
32
34
|
cardRequired?: boolean;
|
|
35
|
+
createdAt?: Date;
|
|
33
36
|
}
|
|
34
37
|
export declare class Product extends AbstractBase {
|
|
35
38
|
name: string;
|
package/dist/entities/product.js
CHANGED
|
@@ -21,6 +21,7 @@ var CurrencyEnum;
|
|
|
21
21
|
CurrencyEnum["CMR_PTS"] = "cmr_pts";
|
|
22
22
|
CurrencyEnum["PARIS_PTS"] = "paris_pts";
|
|
23
23
|
CurrencyEnum["RIPLEY_PTS"] = "ripley_pts";
|
|
24
|
+
CurrencyEnum["GENERAL_POINTS"] = "general_pts";
|
|
24
25
|
CurrencyEnum["BRL"] = "brl";
|
|
25
26
|
CurrencyEnum["PEN"] = "PEN";
|
|
26
27
|
CurrencyEnum["ARS"] = "ars";
|
|
@@ -30,6 +31,7 @@ var UpdateReasonEnum;
|
|
|
30
31
|
(function (UpdateReasonEnum) {
|
|
31
32
|
UpdateReasonEnum["TIME"] = "time";
|
|
32
33
|
UpdateReasonEnum["NEW_PRICE"] = "new_price";
|
|
34
|
+
UpdateReasonEnum["NEW_CONDITIONAL_PRICE"] = "new_conditional_price";
|
|
33
35
|
UpdateReasonEnum["NEW_NAME"] = "new_name";
|
|
34
36
|
UpdateReasonEnum["NEW_LISTING"] = "new_listing";
|
|
35
37
|
UpdateReasonEnum["MISSING_DATA"] = "missing_data";
|
|
@@ -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;AAG7C,IAAY,
|
|
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;AAG7C,IAAY,YAUX;AAVD,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;AACf,CAAC,EAVW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAUvB;AAED,IAAY,gBAQX;AARD,WAAY,gBAAgB;IACxB,iCAAa,CAAA;IACb,2CAAuB,CAAA;IACvB,mEAA+C,CAAA;IAC/C,yCAAqB,CAAA;IACrB,+CAA2B,CAAA;IAC3B,iDAA6B,CAAA;IAC7B,yCAAqB,CAAA;AACzB,CAAC,EARW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAQ3B;AAuBD,IAAa,OAAO,GAApB,MAAa,OAAQ,SAAQ,4BAAY;CA+GxC,CAAA;AA7GG;IADC,gBAAM,EAAE;;qCACI;AAGb;IADC,gBAAM,EAAE;;0CACU;AAGnB;IADC,gBAAM,EAAE;;0CACU;AAKnB;IAHC,gBAAM,EAAE;IACR,4BAAU,EAAE;IACZ,eAAK,EAAE;;oCACI;AAGZ;IADC,gBAAM,EAAE;;2CACW;AAIpB;IAFC,gBAAM,EAAE;IACR,4BAAU,EAAE;;oCACD;AAKZ;IAHC,gBAAM,EAAE;IACR,4BAAU,EAAE;IACZ,eAAK,EAAE;;yCACS;AAGjB;IADC,gBAAM,EAAE;;0CACU;AAGnB;IADC,gBAAM,EAAE;;2CACW;AAIpB;IAFC,gBAAM,EAAE;IACR,4BAAU,EAAE;8BACL,aAAK;sCAAC;AAGd;IADC,gBAAM,EAAE;;iDAC2B;AAGpC;IADC,gBAAM,EAAE;8BACO,aAAK;8CAAC;AAGtB;IADC,gBAAM,EAAE;8BACG,aAAK;0CAAC;AAGlB;IADC,gBAAM,EAAE;8BACI,0BAAW;2CAAC;AAGzB;IADC,gBAAM,EAAE;;6CACc;AAGvB;IADC,gBAAM,EAAE;;qCACK;AAGd;IADC,gBAAM,EAAE;;sCACM;AAGf;IADC,gBAAM,EAAE;;yCACS;AAGlB;IADC,gBAAM,EAAE;;6CACa;AAGtB;IADC,gBAAM,EAAE;;2CACsB;AAG/B;IADC,gBAAM,EAAE;;qDACsB;AAG/B;IADC,gBAAM,EAAE;;wDACyB;AAGlC;IADC,gBAAM,EAAE;;wCACS;AAGlB;IADC,gBAAM,EAAE;;0CACU;AAInB;IAFC,gBAAM,EAAE;IACR,eAAK,EAAE;8BACI,IAAI;0CAAC;AAIjB;IAFC,gBAAM,EAAE;IACR,eAAK,EAAE;;qDACwB;AAGhC;IADC,gBAAM,EAAE;;iDACoB;AAI7B;IAFC,gBAAM,EAAE;IACR,eAAK,EAAE;8BACY,IAAI;kDAAC;AAGzB;IADC,gBAAM,EAAE;;yCACe;AAGxB;IADC,gBAAM,EAAE;;6CACuB;AAGhC;IADC,gBAAM,EAAE;;4CAIL;AAGJ;IADC,gBAAM,EAAE;;mDACmB;AAG5B;IADC,gBAAM,EAAE;;oDACoB;AA9GpB,OAAO;IAFnB,gBAAM,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IAC5B,gBAAM,CAAC,eAAe,EAAE,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;GAChC,OAAO,CA+GnB;AA/GY,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';\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}\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 MISSING_DATA = 'missing_data',\n FIX_DATA = 'fix_data',\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 modelName?: string;\n\n @Column()\n @IsNotEmpty()\n @Index()\n sku: string;\n\n @Column()\n internalId?: 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 sellerName?: 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 category?: string;\n\n @Column()\n categoryPath?: string;\n\n @Column()\n attributes?: ProductAttributes;\n\n @Column()\n homeDeliveryShipping?: boolean;\n\n @Column()\n pickUpFromStoreShipping?: boolean;\n\n @Column()\n enabled?: boolean;\n\n @Column()\n sourceUrl?: string;\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 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"]}
|
package/dist/entities/store.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AbstractBase } from './abstract-base';
|
|
2
2
|
import { CurrencyEnum } from './product';
|
|
3
3
|
import { ObjectLiteral } from '../classes';
|
|
4
|
-
import {
|
|
4
|
+
import { CATEGORY_ENUM } from './keyword';
|
|
5
5
|
export interface StoreQueueConfig {
|
|
6
6
|
name?: string;
|
|
7
7
|
concurrency?: number;
|
|
@@ -16,11 +16,17 @@ export declare enum CountryEnum {
|
|
|
16
16
|
PERU = "peru",
|
|
17
17
|
BRAZIL = "brazil"
|
|
18
18
|
}
|
|
19
|
+
export declare enum PriorityEnum {
|
|
20
|
+
HIGH = "high",
|
|
21
|
+
MEDIUM = "medium",
|
|
22
|
+
LOW = "low"
|
|
23
|
+
}
|
|
19
24
|
export declare class Store extends AbstractBase {
|
|
20
25
|
name: string;
|
|
21
26
|
displayName?: string;
|
|
22
27
|
url: string;
|
|
23
|
-
|
|
28
|
+
categories?: CATEGORY_ENUM[];
|
|
29
|
+
priority?: PriorityEnum;
|
|
24
30
|
type: string;
|
|
25
31
|
parentStoreRef?: string;
|
|
26
32
|
enabled: boolean;
|
package/dist/entities/store.js
CHANGED
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Store = exports.CountryEnum = void 0;
|
|
12
|
+
exports.Store = exports.PriorityEnum = exports.CountryEnum = void 0;
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
15
|
const abstract_base_1 = require("./abstract-base");
|
|
@@ -20,6 +20,12 @@ var CountryEnum;
|
|
|
20
20
|
CountryEnum["PERU"] = "peru";
|
|
21
21
|
CountryEnum["BRAZIL"] = "brazil";
|
|
22
22
|
})(CountryEnum = exports.CountryEnum || (exports.CountryEnum = {}));
|
|
23
|
+
var PriorityEnum;
|
|
24
|
+
(function (PriorityEnum) {
|
|
25
|
+
PriorityEnum["HIGH"] = "high";
|
|
26
|
+
PriorityEnum["MEDIUM"] = "medium";
|
|
27
|
+
PriorityEnum["LOW"] = "low";
|
|
28
|
+
})(PriorityEnum = exports.PriorityEnum || (exports.PriorityEnum = {}));
|
|
23
29
|
let Store = class Store extends abstract_base_1.AbstractBase {
|
|
24
30
|
constructor() {
|
|
25
31
|
super(...arguments);
|
|
@@ -44,7 +50,11 @@ __decorate([
|
|
|
44
50
|
__decorate([
|
|
45
51
|
typeorm_1.Column(),
|
|
46
52
|
__metadata("design:type", Array)
|
|
47
|
-
], Store.prototype, "
|
|
53
|
+
], Store.prototype, "categories", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
typeorm_1.Column(),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], Store.prototype, "priority", void 0);
|
|
48
58
|
__decorate([
|
|
49
59
|
typeorm_1.Column(),
|
|
50
60
|
__metadata("design:type", String)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"/","sources":["entities/store.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAEiB;AACjB,qDAA6C;AAC7C,mDAA+C;AAgB/C,IAAY,WAKX;AALD,WAAY,WAAW;IACnB,8BAAe,CAAA;IACf,sCAAuB,CAAA;IACvB,4BAAa,CAAA;IACb,gCAAiB,CAAA;AACrB,CAAC,EALW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAKtB;AAID,IAAa,KAAK,GAAlB,MAAa,KAAM,SAAQ,4BAAY;IAAvC;;
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"/","sources":["entities/store.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAEiB;AACjB,qDAA6C;AAC7C,mDAA+C;AAgB/C,IAAY,WAKX;AALD,WAAY,WAAW;IACnB,8BAAe,CAAA;IACf,sCAAuB,CAAA;IACvB,4BAAa,CAAA;IACb,gCAAiB,CAAA;AACrB,CAAC,EALW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAKtB;AAED,IAAY,YAIX;AAJD,WAAY,YAAY;IACpB,6BAAa,CAAA;IACb,iCAAiB,CAAA;IACjB,2BAAW,CAAA;AACf,CAAC,EAJW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAIvB;AAID,IAAa,KAAK,GAAlB,MAAa,KAAM,SAAQ,4BAAY;IAAvC;;QA0BI,YAAO,GAAG,IAAI,CAAC;IAuBnB,CAAC;CAAA,CAAA;AA7CG;IAHC,gBAAM,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC3B,eAAK,EAAE;IACP,4BAAU,EAAE;;mCACA;AAGb;IADC,gBAAM,EAAE;;0CACY;AAIrB;IAFC,gBAAM,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC3B,4BAAU,EAAE;;kCACD;AAGZ;IADC,gBAAM,EAAE;;yCACoB;AAG7B;IADC,gBAAM,EAAE;;uCACe;AAGxB;IADC,gBAAM,EAAE;;mCACI;AAGb;IADC,gBAAM,EAAE;;6CACe;AAGxB;IADC,gBAAM,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;sCAC5B;AAGf;IADC,gBAAM,EAAE;;oCACK;AAGd;IADC,gBAAM,EAAE;;2CACY;AAGrB;IADC,gBAAM,EAAE;;+CAC6B;AAGtC;IADC,gBAAM,EAAE;;sCACsB;AAG/B;IADC,gBAAM,EAAE;;8CAC+B;AAGxC;IADC,gBAAM,EAAE;;4CAKR;AAhDQ,KAAK;IAFjB,gBAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAC1B,gBAAM,CAAC,CAAC,KAAK,CAAC,CAAC;GACH,KAAK,CAiDjB;AAjDY,sBAAK","sourcesContent":["import {\n Column, Entity, Index, Unique,\n} from 'typeorm';\nimport { IsNotEmpty } from 'class-validator';\nimport { AbstractBase } from './abstract-base';\nimport { CurrencyEnum } from './product';\nimport { ObjectLiteral } from '../classes';\nimport { CATEGORY_ENUM } from './keyword';\n\nexport interface StoreQueueConfig {\n name?: string;\n concurrency?: number;\n rateLimiter?: {\n /** Max numbers of jobs processed */\n max: number,\n /** Per duration in milliseconds */\n duration: number\n }\n}\n\nexport enum CountryEnum {\n CHILE = 'chile',\n ARGENTINA = 'argentina',\n PERU = 'peru',\n BRAZIL = 'brazil'\n}\n\nexport enum PriorityEnum {\n HIGH = 'high',\n MEDIUM = 'medium',\n LOW = 'low'\n}\n\n@Entity({ name: 'stores' })\n@Unique(['url'])\nexport class Store extends AbstractBase {\n @Column({ nullable: false })\n @Index()\n @IsNotEmpty()\n name: string;\n\n @Column()\n displayName?: string;\n\n @Column({ nullable: false })\n @IsNotEmpty()\n url: string;\n\n @Column()\n categories?: CATEGORY_ENUM[];\n\n @Column()\n priority?: PriorityEnum;\n\n @Column()\n type: string;\n\n @Column()\n parentStoreRef?: string;\n\n @Column({ default: true, type: 'boolean' })\n enabled = true;\n\n @Column()\n queue: string;\n\n @Column()\n persistQueue: string;\n\n @Column()\n storeQueueConfig?: StoreQueueConfig[];\n\n @Column()\n country?: CountryEnum | string;\n\n @Column()\n defaultCurrency?: CurrencyEnum | string;\n\n @Column()\n scraperConfig?: {\n filterCategories?: string[];\n skipCategories?: string[];\n headers?: ObjectLiteral;\n }\n}\n"]}
|
package/package.json
CHANGED
package/src/entities/index.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
StoreQueueConfig, Store, CountryEnum, PriorityEnum,
|
|
3
|
+
} from './store';
|
|
2
4
|
import {
|
|
3
5
|
Product, UpdateReasonEnum, CurrencyEnum, ProductAttributes, ConditionalPrice,
|
|
4
6
|
} from './product';
|
|
5
|
-
import { Price } from './price';
|
|
7
|
+
import { Price, MeasurementUnitEnum } from './price';
|
|
6
8
|
import { Category } from './category';
|
|
7
9
|
import { AbstractBase } from './abstract-base';
|
|
8
10
|
import {
|
|
@@ -17,6 +19,6 @@ export const Entities = [
|
|
|
17
19
|
|
|
18
20
|
export {
|
|
19
21
|
Store, Product, Price, Category, AbstractBase, Keyword, CONDITION_FIELD_ENUM,
|
|
20
|
-
CONDITION_ENUM, CATEGORY_ENUM, User, AlertConditions, StoreQueueConfig, CountryEnum,
|
|
21
|
-
CurrencyEnum, UpdateReasonEnum, ConditionalPrice, ProductAttributes,
|
|
22
|
+
CONDITION_ENUM, CATEGORY_ENUM, User, AlertConditions, StoreQueueConfig, CountryEnum, PriorityEnum,
|
|
23
|
+
CurrencyEnum, UpdateReasonEnum, ConditionalPrice, ProductAttributes, MeasurementUnitEnum,
|
|
22
24
|
};
|
package/src/entities/price.ts
CHANGED
|
@@ -4,6 +4,14 @@ import {
|
|
|
4
4
|
import { IsNotEmpty, IsNumber, IsOptional } from 'class-validator';
|
|
5
5
|
import { AbstractBase } from './abstract-base';
|
|
6
6
|
|
|
7
|
+
export enum MeasurementUnitEnum {
|
|
8
|
+
KG = 'kg',
|
|
9
|
+
G = 'g',
|
|
10
|
+
L = 'l',
|
|
11
|
+
ML = 'ml',
|
|
12
|
+
UNIT = 'unit'
|
|
13
|
+
}
|
|
14
|
+
|
|
7
15
|
@Entity({ name: 'prices' })
|
|
8
16
|
export class Price extends AbstractBase {
|
|
9
17
|
@Column()
|
|
@@ -30,6 +38,14 @@ export class Price extends AbstractBase {
|
|
|
30
38
|
@IsOptional()
|
|
31
39
|
sourceUrl?: string;
|
|
32
40
|
|
|
41
|
+
@Column()
|
|
42
|
+
@IsOptional()
|
|
43
|
+
unitMultiplier?: number;
|
|
44
|
+
|
|
45
|
+
@Column()
|
|
46
|
+
@IsOptional()
|
|
47
|
+
measurementUnit?: MeasurementUnitEnum;
|
|
48
|
+
|
|
33
49
|
@CreateDateColumn()
|
|
34
50
|
@Index()
|
|
35
51
|
createdAt?: Date;
|
package/src/entities/product.ts
CHANGED
|
@@ -13,6 +13,7 @@ export enum CurrencyEnum {
|
|
|
13
13
|
CMR_PTS = 'cmr_pts',
|
|
14
14
|
PARIS_PTS = 'paris_pts',
|
|
15
15
|
RIPLEY_PTS = 'ripley_pts',
|
|
16
|
+
GENERAL_POINTS = 'general_pts',
|
|
16
17
|
BRL = 'brl',
|
|
17
18
|
PEN = 'PEN',
|
|
18
19
|
ARS = 'ars',
|
|
@@ -22,6 +23,7 @@ export enum CurrencyEnum {
|
|
|
22
23
|
export enum UpdateReasonEnum {
|
|
23
24
|
TIME = 'time',
|
|
24
25
|
NEW_PRICE = 'new_price',
|
|
26
|
+
NEW_CONDITIONAL_PRICE = 'new_conditional_price',
|
|
25
27
|
NEW_NAME = 'new_name',
|
|
26
28
|
NEW_LISTING = 'new_listing',
|
|
27
29
|
MISSING_DATA = 'missing_data',
|
|
@@ -42,8 +44,9 @@ export interface ProductAttributes {
|
|
|
42
44
|
|
|
43
45
|
export interface ConditionalPrice {
|
|
44
46
|
minAmount?: number;
|
|
45
|
-
price?:
|
|
47
|
+
price?:number;
|
|
46
48
|
cardRequired?: boolean;
|
|
49
|
+
createdAt?: Date;
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
@Entity({ name: 'products' })
|
package/src/entities/store.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { IsNotEmpty } from 'class-validator';
|
|
|
5
5
|
import { AbstractBase } from './abstract-base';
|
|
6
6
|
import { CurrencyEnum } from './product';
|
|
7
7
|
import { ObjectLiteral } from '../classes';
|
|
8
|
-
import {
|
|
8
|
+
import { CATEGORY_ENUM } from './keyword';
|
|
9
9
|
|
|
10
10
|
export interface StoreQueueConfig {
|
|
11
11
|
name?: string;
|
|
@@ -25,6 +25,12 @@ export enum CountryEnum {
|
|
|
25
25
|
BRAZIL = 'brazil'
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
export enum PriorityEnum {
|
|
29
|
+
HIGH = 'high',
|
|
30
|
+
MEDIUM = 'medium',
|
|
31
|
+
LOW = 'low'
|
|
32
|
+
}
|
|
33
|
+
|
|
28
34
|
@Entity({ name: 'stores' })
|
|
29
35
|
@Unique(['url'])
|
|
30
36
|
export class Store extends AbstractBase {
|
|
@@ -41,7 +47,10 @@ export class Store extends AbstractBase {
|
|
|
41
47
|
url: string;
|
|
42
48
|
|
|
43
49
|
@Column()
|
|
44
|
-
|
|
50
|
+
categories?: CATEGORY_ENUM[];
|
|
51
|
+
|
|
52
|
+
@Column()
|
|
53
|
+
priority?: PriorityEnum;
|
|
45
54
|
|
|
46
55
|
@Column()
|
|
47
56
|
type: string;
|