store-scrapper-js-common 1.0.83 → 1.0.87

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.
@@ -1,8 +1,10 @@
1
1
  import { RequestTypeEnum } from '../enums';
2
2
  import { ObjectLiteral } from './object-literal';
3
+ import { SQSCommandNames } from './command';
3
4
  export declare class HttpRequest {
4
5
  headers?: ObjectLiteral;
5
6
  url?: string;
6
7
  type?: RequestTypeEnum;
7
8
  body?: string | ObjectLiteral;
9
+ sourceMethod?: SQSCommandNames;
8
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"http-request.js","sourceRoot":"/","sources":["classes/http-request.ts"],"names":[],"mappings":";;;AAGA,MAAa,WAAW;CAQvB;AARD,kCAQC","sourcesContent":["import { RequestTypeEnum } from '../enums';\nimport { ObjectLiteral } from './object-literal';\n\nexport class HttpRequest {\n headers?: ObjectLiteral;\n\n url?: string;\n\n type?: RequestTypeEnum;\n\n body?: string | ObjectLiteral;\n}\n"]}
1
+ {"version":3,"file":"http-request.js","sourceRoot":"/","sources":["classes/http-request.ts"],"names":[],"mappings":";;;AAIA,MAAa,WAAW;CAUvB;AAVD,kCAUC","sourcesContent":["import { RequestTypeEnum } from '../enums';\nimport { ObjectLiteral } from './object-literal';\nimport { SQSCommandNames } from './command';\n\nexport class HttpRequest {\n headers?: ObjectLiteral;\n\n url?: string;\n\n type?: RequestTypeEnum;\n\n body?: string | ObjectLiteral;\n\n sourceMethod?: SQSCommandNames;\n}\n"]}
@@ -14,5 +14,7 @@ export declare class Price extends AbstractBase {
14
14
  sourceUrl?: string;
15
15
  unitMultiplier?: number;
16
16
  measurementUnit?: MeasurementUnitEnum;
17
+ validFrom?: Date;
18
+ validTo?: Date;
17
19
  createdAt?: Date;
18
20
  }
@@ -62,6 +62,14 @@ __decorate([
62
62
  class_validator_1.IsOptional(),
63
63
  __metadata("design:type", String)
64
64
  ], Price.prototype, "measurementUnit", void 0);
65
+ __decorate([
66
+ typeorm_1.Column(),
67
+ __metadata("design:type", Date)
68
+ ], Price.prototype, "validFrom", void 0);
69
+ __decorate([
70
+ typeorm_1.Column(),
71
+ __metadata("design:type", Date)
72
+ ], Price.prototype, "validTo", void 0);
65
73
  __decorate([
66
74
  typeorm_1.CreateDateColumn(),
67
75
  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;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"]}
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;CA0CtC,CAAA;AAtCG;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;AAGtC;IADC,gBAAM,EAAE;8BACG,IAAI;wCAAC;AAGjB;IADC,gBAAM,EAAE;8BACC,IAAI;sCAAC;AAIf;IAFC,0BAAgB,EAAE;IAClB,eAAK,EAAE;8BACI,IAAI;wCAAC;AAzCR,KAAK;IADjB,gBAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;GACd,KAAK,CA0CjB;AA1CY,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 @Column()\n validFrom?: Date;\n\n @Column()\n validTo?: Date;\n\n @CreateDateColumn()\n @Index()\n createdAt?: Date;\n}\n"]}
@@ -39,14 +39,17 @@ export interface ConditionalPrice {
39
39
  export declare class Product extends AbstractBase {
40
40
  name: string;
41
41
  brandName?: string;
42
+ normalizedBrandName?: string;
42
43
  modelName?: string;
43
44
  sku: string;
44
45
  internalId?: string;
46
+ ean?: string;
45
47
  url: string;
46
48
  storeRef: string;
47
49
  storeName?: string;
48
50
  branchStoreName?: string;
49
51
  sellerName?: string;
52
+ normalizedSellerName?: string;
50
53
  price?: Price;
51
54
  conditionalPrice?: ConditionalPrice;
52
55
  previousPrice?: Price;
@@ -69,6 +72,7 @@ export declare class Product extends AbstractBase {
69
72
  categoryKeywords?: Keyword[];
70
73
  processedPricesAt?: Date;
71
74
  isMarketplace?: boolean;
75
+ addToCartLink?: string;
72
76
  currency?: CurrencyEnum;
73
77
  updateReason?: UpdateReasonEnum;
74
78
  nameHistory?: {
@@ -49,6 +49,10 @@ __decorate([
49
49
  typeorm_1.Column(),
50
50
  __metadata("design:type", String)
51
51
  ], Product.prototype, "brandName", void 0);
52
+ __decorate([
53
+ typeorm_1.Column(),
54
+ __metadata("design:type", String)
55
+ ], Product.prototype, "normalizedBrandName", void 0);
52
56
  __decorate([
53
57
  typeorm_1.Column(),
54
58
  __metadata("design:type", String)
@@ -63,6 +67,10 @@ __decorate([
63
67
  typeorm_1.Column(),
64
68
  __metadata("design:type", String)
65
69
  ], Product.prototype, "internalId", void 0);
70
+ __decorate([
71
+ typeorm_1.Column(),
72
+ __metadata("design:type", String)
73
+ ], Product.prototype, "ean", void 0);
66
74
  __decorate([
67
75
  typeorm_1.Column(),
68
76
  class_validator_1.IsNotEmpty(),
@@ -86,6 +94,10 @@ __decorate([
86
94
  typeorm_1.Column(),
87
95
  __metadata("design:type", String)
88
96
  ], Product.prototype, "sellerName", void 0);
97
+ __decorate([
98
+ typeorm_1.Column(),
99
+ __metadata("design:type", String)
100
+ ], Product.prototype, "normalizedSellerName", void 0);
89
101
  __decorate([
90
102
  typeorm_1.Column(),
91
103
  class_validator_1.IsNotEmpty(),
@@ -178,6 +190,10 @@ __decorate([
178
190
  typeorm_1.Column(),
179
191
  __metadata("design:type", Boolean)
180
192
  ], Product.prototype, "isMarketplace", void 0);
193
+ __decorate([
194
+ typeorm_1.Column(),
195
+ __metadata("design:type", String)
196
+ ], Product.prototype, "addToCartLink", void 0);
181
197
  __decorate([
182
198
  typeorm_1.Column(),
183
199
  __metadata("design:type", String)
@@ -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;AAEtD,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,GAAZ,oBAAY,KAAZ,oBAAY,QAWvB;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;CA2HxC,CAAA;AAzHG;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;;gDACgB;AAGzB;IADC,gBAAM,EAAE;;2CACW;AAIpB;I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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';\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 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 branchStoreName?: 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 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 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"]}
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;AAEtD,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,GAAZ,oBAAY,KAAZ,oBAAY,QAWvB;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,G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EAAE;8BACE,0BAAW;wCAAC;AAIvB;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;;8CACe;AAGxB;IADC,gBAAM,EAAE;;8CACc;AAGvB;IADC,gBAAM,EAAE;;yCACe;AAGxB;IADC,gBAAM,EAAE;;6CACuB;AAGhC;IADC,gBAAM,EAAE;;4CAIL;AAGJ;IADC,gBAAM,EAAE;;mDACmB;AAG5B;IADC,gBAAM,EAAE;;oDACoB;AAtIpB,OAAO;IAFnB,gBAAM,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IAC5B,gBAAM,CAAC,eAAe,EAAE,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;GAChC,OAAO,CAuInB;AAvIY,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';\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 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 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 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 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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "store-scrapper-js-common",
3
- "version": "1.0.83",
3
+ "version": "1.0.87",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,5 +1,6 @@
1
1
  import { RequestTypeEnum } from '../enums';
2
2
  import { ObjectLiteral } from './object-literal';
3
+ import { SQSCommandNames } from './command';
3
4
 
4
5
  export class HttpRequest {
5
6
  headers?: ObjectLiteral;
@@ -9,4 +10,6 @@ export class HttpRequest {
9
10
  type?: RequestTypeEnum;
10
11
 
11
12
  body?: string | ObjectLiteral;
13
+
14
+ sourceMethod?: SQSCommandNames;
12
15
  }
@@ -46,6 +46,12 @@ export class Price extends AbstractBase {
46
46
  @IsOptional()
47
47
  measurementUnit?: MeasurementUnitEnum;
48
48
 
49
+ @Column()
50
+ validFrom?: Date;
51
+
52
+ @Column()
53
+ validTo?: Date;
54
+
49
55
  @CreateDateColumn()
50
56
  @Index()
51
57
  createdAt?: Date;
@@ -60,6 +60,9 @@ export class Product extends AbstractBase {
60
60
  @Column()
61
61
  brandName?: string;
62
62
 
63
+ @Column()
64
+ normalizedBrandName?: string;
65
+
63
66
  @Column()
64
67
  modelName?: string;
65
68
 
@@ -71,6 +74,9 @@ export class Product extends AbstractBase {
71
74
  @Column()
72
75
  internalId?: string;
73
76
 
77
+ @Column()
78
+ ean?: string;
79
+
74
80
  @Column()
75
81
  @IsNotEmpty()
76
82
  url: string;
@@ -89,6 +95,9 @@ export class Product extends AbstractBase {
89
95
  @Column()
90
96
  sellerName?: string;
91
97
 
98
+ @Column()
99
+ normalizedSellerName?: string;
100
+
92
101
  @Column()
93
102
  @IsNotEmpty()
94
103
  price?: Price;
@@ -159,6 +168,9 @@ export class Product extends AbstractBase {
159
168
  @Column()
160
169
  isMarketplace?: boolean;
161
170
 
171
+ @Column()
172
+ addToCartLink?: string;
173
+
162
174
  @Column()
163
175
  currency?: CurrencyEnum;
164
176