store-scrapper-js-common 1.0.147 → 1.0.150
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/dto/scraper-method-config.dto.d.ts +9 -0
- package/dist/dto/scraper-method-config.dto.js +7 -0
- package/dist/dto/scraper-method-config.dto.js.map +1 -0
- package/dist/dto/store-config.dto.d.ts +2 -0
- package/dist/dto/store-config.dto.js.map +1 -1
- package/dist/entities/store.d.ts +1 -0
- package/dist/entities/store.js +5 -0
- package/dist/entities/store.js.map +1 -1
- package/dist/enums/fetch-type.enum.d.ts +9 -0
- package/dist/enums/fetch-type.enum.js +14 -0
- package/dist/enums/fetch-type.enum.js.map +1 -0
- package/dist/enums/index.d.ts +2 -1
- package/dist/enums/index.js +3 -1
- package/dist/enums/index.js.map +1 -1
- package/dist/enums/request-type.enum.d.ts +1 -1
- package/dist/enums/request-type.enum.js +1 -1
- package/dist/enums/request-type.enum.js.map +1 -1
- package/package.json +1 -1
- package/src/dto/scraper-method-config.dto.ts +14 -0
- package/src/dto/store-config.dto.ts +3 -0
- package/src/entities/store.ts +4 -0
- package/src/enums/fetch-type.enum.ts +10 -0
- package/src/enums/index.ts +2 -1
- package/src/enums/request-type.enum.ts +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ObjectLiteral } from 'typeorm';
|
|
2
|
+
import { FetchTypeEnum } from '../enums';
|
|
3
|
+
import { ProxyConfigDto } from './proxy-config.dto';
|
|
4
|
+
export declare class ScraperMethodConfigDto {
|
|
5
|
+
name?: string;
|
|
6
|
+
fetchType?: FetchTypeEnum;
|
|
7
|
+
proxy?: ProxyConfigDto;
|
|
8
|
+
headers?: ObjectLiteral;
|
|
9
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ScraperMethodConfigDto = void 0;
|
|
4
|
+
class ScraperMethodConfigDto {
|
|
5
|
+
}
|
|
6
|
+
exports.ScraperMethodConfigDto = ScraperMethodConfigDto;
|
|
7
|
+
//# sourceMappingURL=scraper-method-config.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scraper-method-config.dto.js","sourceRoot":"/","sources":["dto/scraper-method-config.dto.ts"],"names":[],"mappings":";;;AAIA,MAAa,sBAAsB;CASlC;AATD,wDASC","sourcesContent":["import { ObjectLiteral } from 'typeorm';\nimport { FetchTypeEnum } from '../enums';\nimport { ProxyConfigDto } from './proxy-config.dto';\n\nexport class ScraperMethodConfigDto {\n // getPages, getProduct, etc\n name?: string;\n\n fetchType?: FetchTypeEnum;\n\n proxy?: ProxyConfigDto;\n\n headers?: ObjectLiteral;\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ProxyConfigDto } from './proxy-config.dto';
|
|
2
2
|
import { QueueConfigDto } from './queue-config.dto';
|
|
3
3
|
import { CacheStrategyEnum } from '../enums';
|
|
4
|
+
import { ScraperMethodConfigDto } from './scraper-method-config.dto';
|
|
4
5
|
export declare class StoreConfig {
|
|
5
6
|
name: string;
|
|
6
7
|
filterCategories?: string[];
|
|
@@ -17,5 +18,6 @@ export declare class StoreConfig {
|
|
|
17
18
|
persistQueue?: string;
|
|
18
19
|
proxy?: ProxyConfigDto;
|
|
19
20
|
queueConfig?: QueueConfigDto;
|
|
21
|
+
methodsConfig?: ScraperMethodConfigDto[];
|
|
20
22
|
[key: string]: any;
|
|
21
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-config.dto.js","sourceRoot":"/","sources":["dto/store-config.dto.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"store-config.dto.js","sourceRoot":"/","sources":["dto/store-config.dto.ts"],"names":[],"mappings":";;;AAKA,MAAa,WAAW;CA8BvB;AA9BD,kCA8BC","sourcesContent":["import { ProxyConfigDto } from './proxy-config.dto';\nimport { QueueConfigDto } from './queue-config.dto';\nimport { CacheStrategyEnum } from '../enums';\nimport { ScraperMethodConfigDto } from './scraper-method-config.dto';\n\nexport class StoreConfig {\n name: string;\n\n filterCategories?: string[];\n\n skipCategories?: string[];\n\n cacheMenu?: boolean;\n\n cacheKey?: string;\n\n cacheTTL?: number;\n\n cacheStrategy?: CacheStrategyEnum;\n\n headers?: {[key: string]: any};\n\n includeProductsWithoutStock?: boolean;\n\n queue?: string;\n\n persistQueue?: string;\n\n proxy?: ProxyConfigDto;\n\n queueConfig?: QueueConfigDto;\n\n methodsConfig?: ScraperMethodConfigDto[];\n\n [key: string]: any\n}\n"]}
|
package/dist/entities/store.d.ts
CHANGED
package/dist/entities/store.js
CHANGED
|
@@ -115,6 +115,11 @@ __decorate([
|
|
|
115
115
|
typeorm_1.Column(),
|
|
116
116
|
__metadata("design:type", Array)
|
|
117
117
|
], Store.prototype, "configs", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
typeorm_1.Column(),
|
|
120
|
+
typeorm_1.Index(),
|
|
121
|
+
__metadata("design:type", Array)
|
|
122
|
+
], Store.prototype, "tags", void 0);
|
|
118
123
|
__decorate([
|
|
119
124
|
typeorm_1.Column(),
|
|
120
125
|
__metadata("design:type", Array)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"/","sources":["entities/store.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAEiB;AACjB,qDAA6C;AAC7C,mDAA+C;AAM/C,IAAY,YASX;AATD,WAAY,YAAY;IACpB,6BAAa,CAAA;IACb,2CAA2B,CAAA;IAC3B,qCAAqB,CAAA;IACrB,qCAAqB,CAAA;IACrB,yCAAyB,CAAA;IACzB,mCAAmB,CAAA;IACnB,mCAAmB,CAAA;IACnB,mCAAmB,CAAA;AACvB,CAAC,EATW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QASvB;AAED,IAAY,WAQX;AARD,WAAY,WAAW;IACnB,8BAAe,CAAA;IACf,sCAAuB,CA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K;IAFjB,gBAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAC1B,gBAAM,CAAC,CAAC,KAAK,CAAC,CAAC;GACH,KAAK,CAoDjB;AApDY,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 { QueueConfigDto } from '../dto/queue-config.dto';\nimport { StoreConfig } from '../dto';\nimport { CurrencyEnum } from './product';\n\nexport enum PlatformEnum {\n VTEX = 'vtex',\n CUSTOM_VTEX = 'custom_vtex',\n COMMERCE = 'commerce',\n MYBCAPPS = 'mybcapps',\n JUMPSELLER = 'jumpseller',\n MAGENTO = 'magento',\n SHOPIFY = 'shopify',\n ALGOLIA = 'algolia',\n}\n\nexport enum CountryEnum {\n CHILE = 'chile',\n ARGENTINA = 'argentina',\n URUGUAY = 'uruguay',\n PERU = 'peru',\n BRAZIL = 'brazil',\n USA = 'usa',\n SPAIN = 'spain',\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 TECNO_HIGH = 'tecno_high',\n TECNO_MEDIUM = 'tecno_medium',\n TECNO_LOW = 'tecno_low',\n\n ELECTRO_HIGH = 'electro_high',\n ELECTRO_MEDIUM = 'electro_medium',\n ELECTRO_LOW = 'electro_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 | string;\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?: QueueConfigDto[];\n\n @Column()\n country?: CountryEnum | string;\n\n @Column()\n defaultCurrency?: CurrencyEnum | string;\n\n @Column()\n configs?: StoreConfig[];\n\n @Column()\n @Index()\n tags?: string[];\n\n @Column()\n platforms?: PlatformEnum[];\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare enum FetchTypeEnum {
|
|
2
|
+
AXIOS = "axios",
|
|
3
|
+
CF_BYPASS = "cf_bypass",
|
|
4
|
+
PUPPETEER = "puppeteer",
|
|
5
|
+
PUPPETEER_AS_JSON = "puppeteer_as_json",
|
|
6
|
+
PUPPETEER_EXTERNAL_HOST = "puppeteer_external_host",
|
|
7
|
+
PUPPETEER_EXTERNAL_HOST_AS_JSON = "puppeteer_external_host_as_json",
|
|
8
|
+
EXTERNAL_HTTP_SERVICE = "external_http_service"
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FetchTypeEnum = void 0;
|
|
4
|
+
var FetchTypeEnum;
|
|
5
|
+
(function (FetchTypeEnum) {
|
|
6
|
+
FetchTypeEnum["AXIOS"] = "axios";
|
|
7
|
+
FetchTypeEnum["CF_BYPASS"] = "cf_bypass";
|
|
8
|
+
FetchTypeEnum["PUPPETEER"] = "puppeteer";
|
|
9
|
+
FetchTypeEnum["PUPPETEER_AS_JSON"] = "puppeteer_as_json";
|
|
10
|
+
FetchTypeEnum["PUPPETEER_EXTERNAL_HOST"] = "puppeteer_external_host";
|
|
11
|
+
FetchTypeEnum["PUPPETEER_EXTERNAL_HOST_AS_JSON"] = "puppeteer_external_host_as_json";
|
|
12
|
+
FetchTypeEnum["EXTERNAL_HTTP_SERVICE"] = "external_http_service";
|
|
13
|
+
})(FetchTypeEnum = exports.FetchTypeEnum || (exports.FetchTypeEnum = {}));
|
|
14
|
+
//# sourceMappingURL=fetch-type.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch-type.enum.js","sourceRoot":"/","sources":["enums/fetch-type.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,aASX;AATD,WAAY,aAAa;IACrB,gCAAe,CAAA;IACf,wCAAuB,CAAA;IACvB,wCAAuB,CAAA;IACvB,wDAAuC,CAAA;IACvC,oEAAmD,CAAA;IACnD,oFAAmE,CAAA;IAEnE,gEAA+C,CAAA;AACnD,CAAC,EATW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QASxB","sourcesContent":["export enum FetchTypeEnum {\n AXIOS = 'axios',\n CF_BYPASS = 'cf_bypass',\n PUPPETEER = 'puppeteer',\n PUPPETEER_AS_JSON = 'puppeteer_as_json',\n PUPPETEER_EXTERNAL_HOST = 'puppeteer_external_host',\n PUPPETEER_EXTERNAL_HOST_AS_JSON = 'puppeteer_external_host_as_json',\n\n EXTERNAL_HTTP_SERVICE = 'external_http_service',\n}\n"]}
|
package/dist/enums/index.d.ts
CHANGED
|
@@ -4,4 +4,5 @@ import { TelegramMessageType } from './telegram-message-type';
|
|
|
4
4
|
import { TelegramQueueCommandEnum } from './telegram-queue-command.enum';
|
|
5
5
|
import { TelegramQueueEnum } from './telegram-queue.enum';
|
|
6
6
|
import { CacheStrategyEnum } from './cache-strategy.enum';
|
|
7
|
-
|
|
7
|
+
import { FetchTypeEnum } from './fetch-type.enum';
|
|
8
|
+
export { RequestTypeEnum, TelegramClientEnum, TelegramQueueEnum, TelegramQueueCommandEnum, TelegramMessageType, CacheStrategyEnum, FetchTypeEnum, };
|
package/dist/enums/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CacheStrategyEnum = exports.TelegramMessageType = exports.TelegramQueueCommandEnum = exports.TelegramQueueEnum = exports.TelegramClientEnum = exports.RequestTypeEnum = void 0;
|
|
3
|
+
exports.FetchTypeEnum = exports.CacheStrategyEnum = exports.TelegramMessageType = exports.TelegramQueueCommandEnum = exports.TelegramQueueEnum = exports.TelegramClientEnum = exports.RequestTypeEnum = void 0;
|
|
4
4
|
const request_type_enum_1 = require("./request-type.enum");
|
|
5
5
|
Object.defineProperty(exports, "RequestTypeEnum", { enumerable: true, get: function () { return request_type_enum_1.RequestTypeEnum; } });
|
|
6
6
|
const telegram_client_enum_1 = require("./telegram-client.enum");
|
|
@@ -13,4 +13,6 @@ const telegram_queue_enum_1 = require("./telegram-queue.enum");
|
|
|
13
13
|
Object.defineProperty(exports, "TelegramQueueEnum", { enumerable: true, get: function () { return telegram_queue_enum_1.TelegramQueueEnum; } });
|
|
14
14
|
const cache_strategy_enum_1 = require("./cache-strategy.enum");
|
|
15
15
|
Object.defineProperty(exports, "CacheStrategyEnum", { enumerable: true, get: function () { return cache_strategy_enum_1.CacheStrategyEnum; } });
|
|
16
|
+
const fetch_type_enum_1 = require("./fetch-type.enum");
|
|
17
|
+
Object.defineProperty(exports, "FetchTypeEnum", { enumerable: true, get: function () { return fetch_type_enum_1.FetchTypeEnum; } });
|
|
16
18
|
//# sourceMappingURL=index.js.map
|
package/dist/enums/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["enums/index.ts"],"names":[],"mappings":";;;AAAA,2DAAsD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["enums/index.ts"],"names":[],"mappings":";;;AAAA,2DAAsD;AASpD,gGATO,mCAAe,OASP;AARjB,iEAA4D;AAQzC,mGARV,yCAAkB,OAQU;AAPrC,mEAA8D;AAOsB,oGAP3E,2CAAmB,OAO2E;AANvG,+EAAyE;AAMf,yGANjD,sDAAwB,OAMiD;AALlF,+DAA0D;AAKnB,kGAL9B,uCAAiB,OAK8B;AAJxD,+DAA0D;AAI+C,kGAJhG,uCAAiB,OAIgG;AAH1H,uDAAkD;AAG0E,8FAHnH,+BAAa,OAGmH","sourcesContent":["import { RequestTypeEnum } from './request-type.enum';\nimport { TelegramClientEnum } from './telegram-client.enum';\nimport { TelegramMessageType } from './telegram-message-type';\nimport { TelegramQueueCommandEnum } from './telegram-queue-command.enum';\nimport { TelegramQueueEnum } from './telegram-queue.enum';\nimport { CacheStrategyEnum } from './cache-strategy.enum';\nimport { FetchTypeEnum } from './fetch-type.enum';\n\nexport {\n RequestTypeEnum, TelegramClientEnum, TelegramQueueEnum, TelegramQueueCommandEnum, TelegramMessageType, CacheStrategyEnum, FetchTypeEnum,\n};\n"]}
|
|
@@ -7,6 +7,6 @@ var RequestTypeEnum;
|
|
|
7
7
|
RequestTypeEnum["POST"] = "post";
|
|
8
8
|
RequestTypeEnum["PUT"] = "put";
|
|
9
9
|
RequestTypeEnum["DELETE"] = "delete";
|
|
10
|
-
RequestTypeEnum["
|
|
10
|
+
RequestTypeEnum["PATCH"] = "patch";
|
|
11
11
|
})(RequestTypeEnum = exports.RequestTypeEnum || (exports.RequestTypeEnum = {}));
|
|
12
12
|
//# sourceMappingURL=request-type.enum.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-type.enum.js","sourceRoot":"/","sources":["enums/request-type.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,eAMX;AAND,WAAY,eAAe;IACzB,8BAAW,CAAA;IACX,gCAAa,CAAA;IACb,8BAAW,CAAA;IACX,oCAAiB,CAAA;IACjB,
|
|
1
|
+
{"version":3,"file":"request-type.enum.js","sourceRoot":"/","sources":["enums/request-type.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,eAMX;AAND,WAAY,eAAe;IACzB,8BAAW,CAAA;IACX,gCAAa,CAAA;IACb,8BAAW,CAAA;IACX,oCAAiB,CAAA;IACjB,kCAAe,CAAA;AACjB,CAAC,EANW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAM1B","sourcesContent":["export enum RequestTypeEnum {\n GET = 'get',\n POST = 'post',\n PUT = 'put',\n DELETE = 'delete',\n PATCH = 'patch',\n}\n"]}
|
package/package.json
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ObjectLiteral } from 'typeorm';
|
|
2
|
+
import { FetchTypeEnum } from '../enums';
|
|
3
|
+
import { ProxyConfigDto } from './proxy-config.dto';
|
|
4
|
+
|
|
5
|
+
export class ScraperMethodConfigDto {
|
|
6
|
+
// getPages, getProduct, etc
|
|
7
|
+
name?: string;
|
|
8
|
+
|
|
9
|
+
fetchType?: FetchTypeEnum;
|
|
10
|
+
|
|
11
|
+
proxy?: ProxyConfigDto;
|
|
12
|
+
|
|
13
|
+
headers?: ObjectLiteral;
|
|
14
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ProxyConfigDto } from './proxy-config.dto';
|
|
2
2
|
import { QueueConfigDto } from './queue-config.dto';
|
|
3
3
|
import { CacheStrategyEnum } from '../enums';
|
|
4
|
+
import { ScraperMethodConfigDto } from './scraper-method-config.dto';
|
|
4
5
|
|
|
5
6
|
export class StoreConfig {
|
|
6
7
|
name: string;
|
|
@@ -29,5 +30,7 @@ export class StoreConfig {
|
|
|
29
30
|
|
|
30
31
|
queueConfig?: QueueConfigDto;
|
|
31
32
|
|
|
33
|
+
methodsConfig?: ScraperMethodConfigDto[];
|
|
34
|
+
|
|
32
35
|
[key: string]: any
|
|
33
36
|
}
|
package/src/entities/store.ts
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export enum FetchTypeEnum {
|
|
2
|
+
AXIOS = 'axios',
|
|
3
|
+
CF_BYPASS = 'cf_bypass',
|
|
4
|
+
PUPPETEER = 'puppeteer',
|
|
5
|
+
PUPPETEER_AS_JSON = 'puppeteer_as_json',
|
|
6
|
+
PUPPETEER_EXTERNAL_HOST = 'puppeteer_external_host',
|
|
7
|
+
PUPPETEER_EXTERNAL_HOST_AS_JSON = 'puppeteer_external_host_as_json',
|
|
8
|
+
|
|
9
|
+
EXTERNAL_HTTP_SERVICE = 'external_http_service',
|
|
10
|
+
}
|
package/src/enums/index.ts
CHANGED
|
@@ -4,7 +4,8 @@ import { TelegramMessageType } from './telegram-message-type';
|
|
|
4
4
|
import { TelegramQueueCommandEnum } from './telegram-queue-command.enum';
|
|
5
5
|
import { TelegramQueueEnum } from './telegram-queue.enum';
|
|
6
6
|
import { CacheStrategyEnum } from './cache-strategy.enum';
|
|
7
|
+
import { FetchTypeEnum } from './fetch-type.enum';
|
|
7
8
|
|
|
8
9
|
export {
|
|
9
|
-
RequestTypeEnum, TelegramClientEnum, TelegramQueueEnum, TelegramQueueCommandEnum, TelegramMessageType, CacheStrategyEnum,
|
|
10
|
+
RequestTypeEnum, TelegramClientEnum, TelegramQueueEnum, TelegramQueueCommandEnum, TelegramMessageType, CacheStrategyEnum, FetchTypeEnum,
|
|
10
11
|
};
|