store-scrapper-js-common 1.0.81 → 1.0.85
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/classes/http-request.d.ts +10 -0
- package/dist/classes/http-request.js +7 -0
- package/dist/classes/http-request.js.map +1 -0
- package/dist/entities/product.d.ts +3 -2
- package/dist/entities/product.js +7 -3
- package/dist/entities/product.js.map +1 -1
- package/package.json +1 -1
- package/src/classes/http-request.ts +15 -0
- package/src/entities/product.ts +5 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RequestTypeEnum } from '../enums';
|
|
2
|
+
import { ObjectLiteral } from './object-literal';
|
|
3
|
+
import { SQSCommandNames } from './command';
|
|
4
|
+
export declare class HttpRequest {
|
|
5
|
+
headers?: ObjectLiteral;
|
|
6
|
+
url?: string;
|
|
7
|
+
type?: RequestTypeEnum;
|
|
8
|
+
body?: string | ObjectLiteral;
|
|
9
|
+
sourceMethod?: SQSCommandNames;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
@@ -2,7 +2,7 @@ import { AbstractBase } from './abstract-base';
|
|
|
2
2
|
import { Price } from './price';
|
|
3
3
|
import { PricesStats } from './prices-stats';
|
|
4
4
|
import { Keyword } from './keyword';
|
|
5
|
-
import {
|
|
5
|
+
import { HttpRequest } from '../classes/http-request';
|
|
6
6
|
export declare enum CurrencyEnum {
|
|
7
7
|
CLP = "clp",
|
|
8
8
|
CMR_PTS = "cmr_pts",
|
|
@@ -42,6 +42,7 @@ export declare class Product extends AbstractBase {
|
|
|
42
42
|
modelName?: string;
|
|
43
43
|
sku: string;
|
|
44
44
|
internalId?: string;
|
|
45
|
+
ean?: string;
|
|
45
46
|
url: string;
|
|
46
47
|
storeRef: string;
|
|
47
48
|
storeName?: string;
|
|
@@ -63,7 +64,7 @@ export declare class Product extends AbstractBase {
|
|
|
63
64
|
fastDelivery?: boolean;
|
|
64
65
|
enabled?: boolean;
|
|
65
66
|
sourceUrl?: string;
|
|
66
|
-
|
|
67
|
+
request?: HttpRequest;
|
|
67
68
|
updatedAt?: Date;
|
|
68
69
|
categoryKeywordNames?: string[];
|
|
69
70
|
categoryKeywords?: Keyword[];
|
package/dist/entities/product.js
CHANGED
|
@@ -15,7 +15,7 @@ const class_validator_1 = require("class-validator");
|
|
|
15
15
|
const abstract_base_1 = require("./abstract-base");
|
|
16
16
|
const price_1 = require("./price");
|
|
17
17
|
const prices_stats_1 = require("./prices-stats");
|
|
18
|
-
const
|
|
18
|
+
const http_request_1 = require("../classes/http-request");
|
|
19
19
|
var CurrencyEnum;
|
|
20
20
|
(function (CurrencyEnum) {
|
|
21
21
|
CurrencyEnum["CLP"] = "clp";
|
|
@@ -63,6 +63,10 @@ __decorate([
|
|
|
63
63
|
typeorm_1.Column(),
|
|
64
64
|
__metadata("design:type", String)
|
|
65
65
|
], Product.prototype, "internalId", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
typeorm_1.Column(),
|
|
68
|
+
__metadata("design:type", String)
|
|
69
|
+
], Product.prototype, "ean", void 0);
|
|
66
70
|
__decorate([
|
|
67
71
|
typeorm_1.Column(),
|
|
68
72
|
class_validator_1.IsNotEmpty(),
|
|
@@ -153,8 +157,8 @@ __decorate([
|
|
|
153
157
|
], Product.prototype, "sourceUrl", void 0);
|
|
154
158
|
__decorate([
|
|
155
159
|
typeorm_1.Column(),
|
|
156
|
-
__metadata("design:type",
|
|
157
|
-
], Product.prototype, "
|
|
160
|
+
__metadata("design:type", http_request_1.HttpRequest)
|
|
161
|
+
], Product.prototype, "request", void 0);
|
|
158
162
|
__decorate([
|
|
159
163
|
typeorm_1.Column(),
|
|
160
164
|
typeorm_1.Index(),
|
|
@@ -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,
|
|
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;CA8HxC,CAAA;AA5HG;IADC,gBAAM,EAAE;;qCACI;AAGb;IADC,gBAAM,EAAE;;0CACU;AAGnB;IADC,gBAAM,EAAE;;0CACU;AAKnB;IAHC,gBAAM,EAAE;IACR,4BAAU,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B;IADC,gBAAM,EAAE;;6CACuB;AAGhC;IADC,gBAAM,EAAE;;4CAIL;AAGJ;IADC,gBAAM,EAAE;;mDACmB;AAG5B;IADC,gBAAM,EAAE;;oDACoB;AA7HpB,OAAO;IAFnB,gBAAM,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IAC5B,gBAAM,CAAC,eAAe,EAAE,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;GAChC,OAAO,CA8HnB;AA9HY,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 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 @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"]}
|
package/package.json
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RequestTypeEnum } from '../enums';
|
|
2
|
+
import { ObjectLiteral } from './object-literal';
|
|
3
|
+
import { SQSCommandNames } from './command';
|
|
4
|
+
|
|
5
|
+
export class HttpRequest {
|
|
6
|
+
headers?: ObjectLiteral;
|
|
7
|
+
|
|
8
|
+
url?: string;
|
|
9
|
+
|
|
10
|
+
type?: RequestTypeEnum;
|
|
11
|
+
|
|
12
|
+
body?: string | ObjectLiteral;
|
|
13
|
+
|
|
14
|
+
sourceMethod?: SQSCommandNames;
|
|
15
|
+
}
|
package/src/entities/product.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { AbstractBase } from './abstract-base';
|
|
|
7
7
|
import { Price } from './price';
|
|
8
8
|
import { PricesStats } from './prices-stats';
|
|
9
9
|
import { Keyword } from './keyword';
|
|
10
|
-
import {
|
|
10
|
+
import { HttpRequest } from '../classes/http-request';
|
|
11
11
|
|
|
12
12
|
export enum CurrencyEnum {
|
|
13
13
|
CLP = 'clp',
|
|
@@ -71,6 +71,9 @@ export class Product extends AbstractBase {
|
|
|
71
71
|
@Column()
|
|
72
72
|
internalId?: string;
|
|
73
73
|
|
|
74
|
+
@Column()
|
|
75
|
+
ean?: string;
|
|
76
|
+
|
|
74
77
|
@Column()
|
|
75
78
|
@IsNotEmpty()
|
|
76
79
|
url: string;
|
|
@@ -139,7 +142,7 @@ export class Product extends AbstractBase {
|
|
|
139
142
|
sourceUrl?: string;
|
|
140
143
|
|
|
141
144
|
@Column()
|
|
142
|
-
|
|
145
|
+
request? : HttpRequest;
|
|
143
146
|
|
|
144
147
|
@Column()
|
|
145
148
|
@Index()
|