store-scrapper-js-common 1.0.69 → 1.0.70
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/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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AC;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/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;
|