store-scrapper-js-common 1.0.98 → 1.0.102
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/command.d.ts +2 -0
- package/dist/classes/command.js.map +1 -1
- package/dist/dto/index.d.ts +2 -1
- package/dist/dto/index.js +3 -1
- package/dist/dto/index.js.map +1 -1
- package/dist/dto/store-config.dto.d.ts +9 -0
- package/dist/dto/store-config.dto.js +7 -0
- package/dist/dto/store-config.dto.js.map +1 -0
- package/dist/entities/index.d.ts +1 -1
- package/dist/entities/store.d.ts +8 -2
- package/dist/entities/store.js +4 -0
- package/dist/entities/store.js.map +1 -1
- package/dist/enums/telegram-queue.enum.d.ts +2 -2
- package/dist/enums/telegram-queue.enum.js +2 -2
- package/dist/enums/telegram-queue.enum.js.map +1 -1
- package/package.json +1 -1
- package/src/classes/command.ts +3 -0
- package/src/dto/index.ts +2 -1
- package/src/dto/store-config.dto.ts +11 -0
- package/src/entities/store.ts +10 -2
- package/src/enums/telegram-queue.enum.ts +2 -2
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { ObjectLiteral } from './object-literal';
|
|
2
|
+
import { StoreConfig } from '../dto/store-config.dto';
|
|
2
3
|
export declare class Command {
|
|
3
4
|
name: string;
|
|
4
5
|
metadata?: ObjectLiteral;
|
|
5
6
|
storeId?: string;
|
|
7
|
+
storeConfig?: StoreConfig;
|
|
6
8
|
nextCommand?: string;
|
|
7
9
|
}
|
|
8
10
|
export declare const getCommandsStep: (crawlerSteps: SQSCommandNames[], currentStep?: SQSCommandNames) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.js","sourceRoot":"/","sources":["classes/command.ts"],"names":[],"mappings":";;;AACA,kDAA2C;
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"/","sources":["classes/command.ts"],"names":[],"mappings":";;;AACA,kDAA2C;AAG3C,MAAa,OAAO;CAUnB;AAVD,0BAUC;AAEY,QAAA,eAAe,GAAG,CAAC,YAA+B,EAAE,WAA6B,EACzB,EAAE;IACrE,IAAI,YAAY,GAAG,CAAC,CAAC;IAErB,IAAI,WAAW,EAAE;QACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;YAC/C,IAAI,YAAY,CAAC,CAAC,CAAC,KAAK,WAAW,EAAE;gBACnC,YAAY,GAAG,CAAC,CAAC;gBACjB,MAAM;aACP;SACF;KACF;IAED,MAAM,SAAS,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;IAC7C,MAAM,QAAQ,GAAG,YAAY,CAAC,MAAM,GAAG,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAElG,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;AACjC,CAAC,CAAC;AAEW,QAAA,aAAa,GAAG,CAAC,IAAqB,EACjD,QAAwB,EACxB,OAAgB,EAChB,WAAoC,EACxB,EAAE,CAAC,CAAC;IAChB,IAAI;IACJ,QAAQ;IACR,OAAO;IACP,WAAW;CACZ,CAAC,CAAC;AAEH,IAAY,eAeX;AAfD,WAAY,eAAe;IACzB,gDAA6B,CAAA;IAC7B,wDAAqC,CAAA;IACrC,wCAAqB,CAAA;IACrB,8CAA2B,CAAA;IAC3B,4CAAyB,CAAA;IAEzB,sDAAmC,CAAA;IACnC,gEAA6C,CAAA;IAC7C,sDAAmC,CAAA;IACnC,oDAAiC,CAAA;IAEjC,gEAA6C,CAAA;IAC7C,sEAAmD,CAAA;IACnD,0DAAuC,CAAA;AACzC,CAAC,EAfW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAe1B;AAEY,QAAA,kBAAkB,GAAG,kBAAkB,CAAC;AACxC,QAAA,cAAc,GAAG,mBAAmB,CAAC;AAErC,QAAA,aAAa,GAAG,CAAC,OAAgB,EAAE,KAAc,EAAE,YAAqB,EAAW,EAAE;IAChG,MAAM,YAAY,GAAG,CAAC,iBAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,GAAG,CAAC,KAAK,IAAI,sBAAc,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACnG,MAAM,gBAAgB,GAAG,CAAC,iBAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,GAAG,CAAC,YAAY,IAAI,0BAAkB,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;IAEpI,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,YAAY,CAAC;AAC5E,CAAC,CAAC","sourcesContent":["import { ObjectLiteral } from './object-literal';\nimport { isUrl } from '../utils/url-utils';\nimport { StoreConfig } from '../dto/store-config.dto';\n\nexport class Command {\n name: string;\n\n metadata?: ObjectLiteral;\n\n storeId?: string;\n\n storeConfig?: StoreConfig;\n\n nextCommand?: string;\n}\n\nexport const getCommandsStep = (crawlerSteps: SQSCommandNames[], currentStep?: SQSCommandNames)\n : {firstStep: SQSCommandNames, nextStep: SQSCommandNames | null} => {\n let currentIndex = 0;\n\n if (currentStep) {\n for (let i = 0; i < crawlerSteps.length; i += 1) {\n if (crawlerSteps[i] === currentStep) {\n currentIndex = i;\n break;\n }\n }\n }\n\n const firstStep = crawlerSteps[currentIndex];\n const nextStep = crawlerSteps.length > (currentIndex + 1) ? crawlerSteps[currentIndex + 1] : null;\n\n return { firstStep, nextStep };\n};\n\nexport const createCommand = (name: SQSCommandNames,\n metadata?: ObjectLiteral,\n storeId?: string,\n nextCommand?: SQSCommandNames | null)\n : Command => ({\n name,\n metadata,\n storeId,\n nextCommand,\n});\n\nexport enum SQSCommandNames {\n getMenuPages = 'getMenuPages',\n getCategoryPages = 'getCategoryPages',\n getPages = 'getPages',\n getProducts = 'getProducts',\n getProduct = 'getProduct',\n\n persistCategory = 'persistCategory',\n persistCategoryPages = 'persistCategoryPages',\n persistProducts = 'persistProducts',\n persistProduct = 'persistProduct',\n\n processProductPrices = 'processProductPrices',\n processCategoryKeywords = 'processCategoryKeywords',\n processPriceStats = 'processPriceStats'\n}\n\nexport const SQSPersistenceName = 'PersistenceQueue';\nexport const SQSCommandName = 'StoreCommandQueue';\n\nexport const getNextSQSUrl = (command: Command, queue?: string, persistQueue?: string) : string => {\n const commandQueue = !isUrl(queue) ? process.env.SQSCommandUrl + (queue || SQSCommandName) : queue;\n const persistenceQueue = !isUrl(persistQueue) ? process.env.SQSPersistenceUrl + (persistQueue || SQSPersistenceName) : persistQueue;\n\n return command.name.includes('persist') ? persistenceQueue : commandQueue;\n};\n"]}
|
package/dist/dto/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { ProcessProductCategoryDto } from './process-product-category.dto';
|
|
2
|
+
import { StoreConfig } from './store-config.dto';
|
|
2
3
|
import { TelegramQueueCommandDto } from './telegram-queue-command.dto';
|
|
3
|
-
export { ProcessProductCategoryDto, TelegramQueueCommandDto };
|
|
4
|
+
export { ProcessProductCategoryDto, TelegramQueueCommandDto, StoreConfig };
|
package/dist/dto/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TelegramQueueCommandDto = exports.ProcessProductCategoryDto = void 0;
|
|
3
|
+
exports.StoreConfig = exports.TelegramQueueCommandDto = exports.ProcessProductCategoryDto = void 0;
|
|
4
4
|
const process_product_category_dto_1 = require("./process-product-category.dto");
|
|
5
5
|
Object.defineProperty(exports, "ProcessProductCategoryDto", { enumerable: true, get: function () { return process_product_category_dto_1.ProcessProductCategoryDto; } });
|
|
6
|
+
const store_config_dto_1 = require("./store-config.dto");
|
|
7
|
+
Object.defineProperty(exports, "StoreConfig", { enumerable: true, get: function () { return store_config_dto_1.StoreConfig; } });
|
|
6
8
|
const telegram_queue_command_dto_1 = require("./telegram-queue-command.dto");
|
|
7
9
|
Object.defineProperty(exports, "TelegramQueueCommandDto", { enumerable: true, get: function () { return telegram_queue_command_dto_1.TelegramQueueCommandDto; } });
|
|
8
10
|
//# sourceMappingURL=index.js.map
|
package/dist/dto/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["dto/index.ts"],"names":[],"mappings":";;;AAAA,iFAA2E;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["dto/index.ts"],"names":[],"mappings":";;;AAAA,iFAA2E;AAIlE,0GAJA,wDAAyB,OAIA;AAHlC,yDAAiD;AAGY,4FAHpD,8BAAW,OAGoD;AAFxE,6EAAuE;AAEnC,wGAF3B,oDAAuB,OAE2B","sourcesContent":["import { ProcessProductCategoryDto } from './process-product-category.dto';\nimport { StoreConfig } from './store-config.dto';\nimport { TelegramQueueCommandDto } from './telegram-queue-command.dto';\n\nexport { ProcessProductCategoryDto, TelegramQueueCommandDto, StoreConfig };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-config.dto.js","sourceRoot":"/","sources":["dto/store-config.dto.ts"],"names":[],"mappings":";;;AAAA,MAAa,WAAW;CAUvB;AAVD,kCAUC","sourcesContent":["export class StoreConfig {\n name: string;\n\n filterCategories?: string[];\n\n skipCategories?: string[];\n\n cacheMenu?: boolean;\n\n headers?: {[key: string]: any};\n}\n"]}
|
package/dist/entities/index.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ import { User } from './user';
|
|
|
8
8
|
import { AlertConditions } from './alert-conditions';
|
|
9
9
|
import { PricesStats } from './prices-stats';
|
|
10
10
|
import { CategoryEntity } from './category-entity';
|
|
11
|
-
export declare const Entities: (typeof
|
|
11
|
+
export declare const Entities: (typeof Keyword | typeof Price | typeof Product | typeof Store | typeof User)[];
|
|
12
12
|
export { Store, Product, Price, Category, CategoryEntity, AbstractBase, Keyword, CONDITION_FIELD_ENUM, CONDITION_ENUM, CATEGORY_ENUM, User, AlertConditions, StoreQueueConfig, CountryEnum, PriorityEnum, CurrencyEnum, UpdateReasonEnum, ConditionalPrice, ProductAttributes, MeasurementUnitEnum, PricesStats, };
|
package/dist/entities/store.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AbstractBase } from './abstract-base';
|
|
2
|
+
import { CATEGORY_ENUM } from './keyword';
|
|
2
3
|
import { CurrencyEnum } from './product';
|
|
3
4
|
import { ObjectLiteral } from '../classes';
|
|
4
|
-
import {
|
|
5
|
+
import { StoreConfig } from '../dto/store-config.dto';
|
|
5
6
|
export interface StoreQueueConfig {
|
|
6
7
|
name?: string;
|
|
7
8
|
concurrency?: number;
|
|
@@ -17,9 +18,13 @@ export declare enum CountryEnum {
|
|
|
17
18
|
BRAZIL = "brazil"
|
|
18
19
|
}
|
|
19
20
|
export declare enum PriorityEnum {
|
|
21
|
+
VERY_HIGH = "very_high",
|
|
20
22
|
HIGH = "high",
|
|
21
23
|
MEDIUM = "medium",
|
|
22
|
-
LOW = "low"
|
|
24
|
+
LOW = "low",
|
|
25
|
+
SHOES_HIGH = "shoes_high",
|
|
26
|
+
SHOES_MEDIUM = "shoes_medium",
|
|
27
|
+
SHOES_LOW = "shoes_low"
|
|
23
28
|
}
|
|
24
29
|
export declare class Store extends AbstractBase {
|
|
25
30
|
name: string;
|
|
@@ -35,6 +40,7 @@ export declare class Store extends AbstractBase {
|
|
|
35
40
|
storeQueueConfig?: StoreQueueConfig[];
|
|
36
41
|
country?: CountryEnum | string;
|
|
37
42
|
defaultCurrency?: CurrencyEnum | string;
|
|
43
|
+
config?: StoreConfig;
|
|
38
44
|
scraperConfig?: {
|
|
39
45
|
filterCategories?: string[];
|
|
40
46
|
skipCategories?: string[];
|
package/dist/entities/store.js
CHANGED
|
@@ -22,9 +22,13 @@ var CountryEnum;
|
|
|
22
22
|
})(CountryEnum = exports.CountryEnum || (exports.CountryEnum = {}));
|
|
23
23
|
var PriorityEnum;
|
|
24
24
|
(function (PriorityEnum) {
|
|
25
|
+
PriorityEnum["VERY_HIGH"] = "very_high";
|
|
25
26
|
PriorityEnum["HIGH"] = "high";
|
|
26
27
|
PriorityEnum["MEDIUM"] = "medium";
|
|
27
28
|
PriorityEnum["LOW"] = "low";
|
|
29
|
+
PriorityEnum["SHOES_HIGH"] = "shoes_high";
|
|
30
|
+
PriorityEnum["SHOES_MEDIUM"] = "shoes_medium";
|
|
31
|
+
PriorityEnum["SHOES_LOW"] = "shoes_low";
|
|
28
32
|
})(PriorityEnum = exports.PriorityEnum || (exports.PriorityEnum = {}));
|
|
29
33
|
let Store = class Store extends abstract_base_1.AbstractBase {
|
|
30
34
|
constructor() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"/","sources":["entities/store.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAEiB;AACjB,qDAA6C;AAC7C,mDAA+C;
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"/","sources":["entities/store.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAEiB;AACjB,qDAA6C;AAC7C,mDAA+C;AAiB/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,YASX;AATD,WAAY,YAAY;IACpB,uCAAuB,CAAA;IACvB,6BAAa,CAAA;IACb,iCAAiB,CAAA;IACjB,2BAAW,CAAA;IAEX,yCAAyB,CAAA;IACzB,6CAA6B,CAAA;IAC7B,uCAAuB,CAAA;AAC3B,CAAC,EATW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QASvB;AAID,IAAa,KAAK,GAAlB,MAAa,KAAM,SAAQ,4BAAY;IAAvC;;QA0BI,YAAO,GAAG,IAAI,CAAC;IAyBnB,CAAC;CAAA,CAAA;AA/CG;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;AAKxC;IADC,gBAAM,EAAE;;4CAKR;AAlDQ,KAAK;IAFjB,gBAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAC1B,gBAAM,CAAC,CAAC,KAAK,CAAC,CAAC;GACH,KAAK,CAmDjB;AAnDY,sBAAK","sourcesContent":["import {\n Column, Entity, Index, Unique,\n} from 'typeorm';\nimport { IsNotEmpty } from 'class-validator';\nimport { AbstractBase } from './abstract-base';\nimport { CATEGORY_ENUM } from './keyword';\nimport { CurrencyEnum } from './product';\nimport { ObjectLiteral } from '../classes';\nimport { StoreConfig } from '../dto/store-config.dto';\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 VERY_HIGH = 'very_high',\n HIGH = 'high',\n MEDIUM = 'medium',\n LOW = 'low',\n\n SHOES_HIGH = 'shoes_high',\n SHOES_MEDIUM = 'shoes_medium',\n SHOES_LOW = 'shoes_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 config?: StoreConfig;\n\n @Column()\n scraperConfig?: {\n filterCategories?: string[];\n skipCategories?: string[];\n headers?: ObjectLiteral;\n }\n}\n"]}
|
|
@@ -12,6 +12,6 @@ export declare enum TelegramQueueEnum {
|
|
|
12
12
|
TELEGRAM_CURRENT_PRICE_ALERT_PUBLIC = "telegram_current_price_alert_public",
|
|
13
13
|
TELEGRAM_RETAIL_CUSTOM_ALERT = "telegram_retail_custom_alert",
|
|
14
14
|
TELEGRAM_RETAIL_CUSTOM_ALERT_PUBLIC = "telegram_retail_custom_alert_public",
|
|
15
|
-
TELEGRAM_LOW_RANGE_ALERT = "
|
|
16
|
-
TELEGRAM_LOW_RANGE_ALERT_PUBLIC = "
|
|
15
|
+
TELEGRAM_LOW_RANGE_ALERT = "telegram_low_range_alert",
|
|
16
|
+
TELEGRAM_LOW_RANGE_ALERT_PUBLIC = "telegram_low_range_alert_public"
|
|
17
17
|
}
|
|
@@ -16,7 +16,7 @@ var TelegramQueueEnum;
|
|
|
16
16
|
TelegramQueueEnum["TELEGRAM_CURRENT_PRICE_ALERT_PUBLIC"] = "telegram_current_price_alert_public";
|
|
17
17
|
TelegramQueueEnum["TELEGRAM_RETAIL_CUSTOM_ALERT"] = "telegram_retail_custom_alert";
|
|
18
18
|
TelegramQueueEnum["TELEGRAM_RETAIL_CUSTOM_ALERT_PUBLIC"] = "telegram_retail_custom_alert_public";
|
|
19
|
-
TelegramQueueEnum["TELEGRAM_LOW_RANGE_ALERT"] = "
|
|
20
|
-
TelegramQueueEnum["TELEGRAM_LOW_RANGE_ALERT_PUBLIC"] = "
|
|
19
|
+
TelegramQueueEnum["TELEGRAM_LOW_RANGE_ALERT"] = "telegram_low_range_alert";
|
|
20
|
+
TelegramQueueEnum["TELEGRAM_LOW_RANGE_ALERT_PUBLIC"] = "telegram_low_range_alert_public";
|
|
21
21
|
})(TelegramQueueEnum = exports.TelegramQueueEnum || (exports.TelegramQueueEnum = {}));
|
|
22
22
|
//# sourceMappingURL=telegram-queue.enum.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telegram-queue.enum.js","sourceRoot":"/","sources":["enums/telegram-queue.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAgBX;AAhBD,WAAY,iBAAiB;IAC3B,sDAAiC,CAAA;IACjC,sEAAiD,CAAA;IACjD,8EAAyD,CAAA;IACzD,iFAA4D,CAAA;IAC5D,yEAAoD,CAAA;IACpD,kEAA6C,CAAA;IAC7C,gFAA2D,CAAA;IAC3D,4EAAuD,CAAA;IACvD,0FAAqE,CAAA;IACrE,kFAA6D,CAAA;IAC7D,gGAA2E,CAAA;IAC3E,kFAA6D,CAAA;IAC7D,gGAA2E,CAAA;IAC3E,
|
|
1
|
+
{"version":3,"file":"telegram-queue.enum.js","sourceRoot":"/","sources":["enums/telegram-queue.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAgBX;AAhBD,WAAY,iBAAiB;IAC3B,sDAAiC,CAAA;IACjC,sEAAiD,CAAA;IACjD,8EAAyD,CAAA;IACzD,iFAA4D,CAAA;IAC5D,yEAAoD,CAAA;IACpD,kEAA6C,CAAA;IAC7C,gFAA2D,CAAA;IAC3D,4EAAuD,CAAA;IACvD,0FAAqE,CAAA;IACrE,kFAA6D,CAAA;IAC7D,gGAA2E,CAAA;IAC3E,kFAA6D,CAAA;IAC7D,gGAA2E,CAAA;IAC3E,0EAAqD,CAAA;IACrD,wFAAmE,CAAA;AACrE,CAAC,EAhBW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAgB5B","sourcesContent":["export enum TelegramQueueEnum {\n TELEGRAM_ALERT = 'telegram_alert',\n TELEGRAM_ALERT_PUBLIC_1 = 'telegram_alert_public',\n TELEGRAM_ALERT_PUBLIC_2 = 'telegram_alert_public_non_vip',\n TELEGRAM_ALERT_PUBLIC_3 = 'telegram_alert_public_non_vip_60',\n TELEGRAM_ALERT_PUBLIC_4 = 'telegram_alert_public_60',\n TELEGRAM_STOCK_ALERT = 'telegram_stock_alert',\n TELEGRAM_STOCK_ALERT_PUBLIC = 'telegram_stock_alert_public',\n TELEGRAM_STOCK_DOWN_ALERT = 'telegram_stock_down_alert',\n TELEGRAM_STOCK_DOWN_ALERT_PUBLIC = 'telegram_stock_down_alert_public',\n TELEGRAM_CURRENT_PRICE_ALERT = 'telegram_current_price_alert',\n TELEGRAM_CURRENT_PRICE_ALERT_PUBLIC = 'telegram_current_price_alert_public',\n TELEGRAM_RETAIL_CUSTOM_ALERT = 'telegram_retail_custom_alert',\n TELEGRAM_RETAIL_CUSTOM_ALERT_PUBLIC = 'telegram_retail_custom_alert_public',\n TELEGRAM_LOW_RANGE_ALERT = 'telegram_low_range_alert',\n TELEGRAM_LOW_RANGE_ALERT_PUBLIC = 'telegram_low_range_alert_public',\n}\n"]}
|
package/package.json
CHANGED
package/src/classes/command.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ObjectLiteral } from './object-literal';
|
|
2
2
|
import { isUrl } from '../utils/url-utils';
|
|
3
|
+
import { StoreConfig } from '../dto/store-config.dto';
|
|
3
4
|
|
|
4
5
|
export class Command {
|
|
5
6
|
name: string;
|
|
@@ -8,6 +9,8 @@ export class Command {
|
|
|
8
9
|
|
|
9
10
|
storeId?: string;
|
|
10
11
|
|
|
12
|
+
storeConfig?: StoreConfig;
|
|
13
|
+
|
|
11
14
|
nextCommand?: string;
|
|
12
15
|
}
|
|
13
16
|
|
package/src/dto/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ProcessProductCategoryDto } from './process-product-category.dto';
|
|
2
|
+
import { StoreConfig } from './store-config.dto';
|
|
2
3
|
import { TelegramQueueCommandDto } from './telegram-queue-command.dto';
|
|
3
4
|
|
|
4
|
-
export { ProcessProductCategoryDto, TelegramQueueCommandDto };
|
|
5
|
+
export { ProcessProductCategoryDto, TelegramQueueCommandDto, StoreConfig };
|
package/src/entities/store.ts
CHANGED
|
@@ -3,9 +3,10 @@ import {
|
|
|
3
3
|
} from 'typeorm';
|
|
4
4
|
import { IsNotEmpty } from 'class-validator';
|
|
5
5
|
import { AbstractBase } from './abstract-base';
|
|
6
|
+
import { CATEGORY_ENUM } from './keyword';
|
|
6
7
|
import { CurrencyEnum } from './product';
|
|
7
8
|
import { ObjectLiteral } from '../classes';
|
|
8
|
-
import {
|
|
9
|
+
import { StoreConfig } from '../dto/store-config.dto';
|
|
9
10
|
|
|
10
11
|
export interface StoreQueueConfig {
|
|
11
12
|
name?: string;
|
|
@@ -26,9 +27,14 @@ export enum CountryEnum {
|
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
export enum PriorityEnum {
|
|
30
|
+
VERY_HIGH = 'very_high',
|
|
29
31
|
HIGH = 'high',
|
|
30
32
|
MEDIUM = 'medium',
|
|
31
|
-
LOW = 'low'
|
|
33
|
+
LOW = 'low',
|
|
34
|
+
|
|
35
|
+
SHOES_HIGH = 'shoes_high',
|
|
36
|
+
SHOES_MEDIUM = 'shoes_medium',
|
|
37
|
+
SHOES_LOW = 'shoes_low',
|
|
32
38
|
}
|
|
33
39
|
|
|
34
40
|
@Entity({ name: 'stores' })
|
|
@@ -76,6 +82,8 @@ export class Store extends AbstractBase {
|
|
|
76
82
|
@Column()
|
|
77
83
|
defaultCurrency?: CurrencyEnum | string;
|
|
78
84
|
|
|
85
|
+
config?: StoreConfig;
|
|
86
|
+
|
|
79
87
|
@Column()
|
|
80
88
|
scraperConfig?: {
|
|
81
89
|
filterCategories?: string[];
|
|
@@ -12,6 +12,6 @@ export enum TelegramQueueEnum {
|
|
|
12
12
|
TELEGRAM_CURRENT_PRICE_ALERT_PUBLIC = 'telegram_current_price_alert_public',
|
|
13
13
|
TELEGRAM_RETAIL_CUSTOM_ALERT = 'telegram_retail_custom_alert',
|
|
14
14
|
TELEGRAM_RETAIL_CUSTOM_ALERT_PUBLIC = 'telegram_retail_custom_alert_public',
|
|
15
|
-
TELEGRAM_LOW_RANGE_ALERT = '
|
|
16
|
-
TELEGRAM_LOW_RANGE_ALERT_PUBLIC = '
|
|
15
|
+
TELEGRAM_LOW_RANGE_ALERT = 'telegram_low_range_alert',
|
|
16
|
+
TELEGRAM_LOW_RANGE_ALERT_PUBLIC = 'telegram_low_range_alert_public',
|
|
17
17
|
}
|