store-scrapper-js-common 1.0.72 → 1.0.73
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/index.d.ts +2 -2
- package/dist/entities/index.js +2 -1
- package/dist/entities/index.js.map +1 -1
- package/dist/entities/price.d.ts +9 -0
- package/dist/entities/price.js +19 -1
- package/dist/entities/price.js.map +1 -1
- package/package.json +1 -1
- package/src/entities/index.ts +2 -2
- package/src/entities/price.ts +16 -0
package/dist/entities/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { StoreQueueConfig, Store, CountryEnum, PriorityEnum } from './store';
|
|
2
2
|
import { Product, UpdateReasonEnum, CurrencyEnum, ProductAttributes, ConditionalPrice } from './product';
|
|
3
|
-
import { Price } from './price';
|
|
3
|
+
import { Price, MeasurementUnitEnum } from './price';
|
|
4
4
|
import { Category } from './category';
|
|
5
5
|
import { AbstractBase } from './abstract-base';
|
|
6
6
|
import { Keyword, CATEGORY_ENUM, CONDITION_ENUM, CONDITION_FIELD_ENUM } from './keyword';
|
|
7
7
|
import { User } from './user';
|
|
8
8
|
import { AlertConditions } from './alert-conditions';
|
|
9
9
|
export declare const Entities: (typeof Price | typeof Keyword | typeof Product | typeof Store | typeof User)[];
|
|
10
|
-
export { Store, Product, Price, Category, AbstractBase, Keyword, CONDITION_FIELD_ENUM, CONDITION_ENUM, CATEGORY_ENUM, User, AlertConditions, StoreQueueConfig, CountryEnum, PriorityEnum, CurrencyEnum, UpdateReasonEnum, ConditionalPrice, ProductAttributes, };
|
|
10
|
+
export { Store, Product, Price, Category, AbstractBase, Keyword, CONDITION_FIELD_ENUM, CONDITION_ENUM, CATEGORY_ENUM, User, AlertConditions, StoreQueueConfig, CountryEnum, PriorityEnum, CurrencyEnum, UpdateReasonEnum, ConditionalPrice, ProductAttributes, MeasurementUnitEnum, };
|
package/dist/entities/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UpdateReasonEnum = exports.CurrencyEnum = exports.PriorityEnum = exports.CountryEnum = exports.AlertConditions = exports.User = exports.CATEGORY_ENUM = exports.CONDITION_ENUM = exports.CONDITION_FIELD_ENUM = exports.Keyword = exports.AbstractBase = exports.Category = exports.Price = exports.Product = exports.Store = exports.Entities = void 0;
|
|
3
|
+
exports.MeasurementUnitEnum = exports.UpdateReasonEnum = exports.CurrencyEnum = exports.PriorityEnum = exports.CountryEnum = exports.AlertConditions = exports.User = exports.CATEGORY_ENUM = exports.CONDITION_ENUM = exports.CONDITION_FIELD_ENUM = exports.Keyword = exports.AbstractBase = exports.Category = exports.Price = exports.Product = exports.Store = exports.Entities = void 0;
|
|
4
4
|
const store_1 = require("./store");
|
|
5
5
|
Object.defineProperty(exports, "Store", { enumerable: true, get: function () { return store_1.Store; } });
|
|
6
6
|
Object.defineProperty(exports, "CountryEnum", { enumerable: true, get: function () { return store_1.CountryEnum; } });
|
|
@@ -11,6 +11,7 @@ Object.defineProperty(exports, "UpdateReasonEnum", { enumerable: true, get: func
|
|
|
11
11
|
Object.defineProperty(exports, "CurrencyEnum", { enumerable: true, get: function () { return product_1.CurrencyEnum; } });
|
|
12
12
|
const price_1 = require("./price");
|
|
13
13
|
Object.defineProperty(exports, "Price", { enumerable: true, get: function () { return price_1.Price; } });
|
|
14
|
+
Object.defineProperty(exports, "MeasurementUnitEnum", { enumerable: true, get: function () { return price_1.MeasurementUnitEnum; } });
|
|
14
15
|
const category_1 = require("./category");
|
|
15
16
|
Object.defineProperty(exports, "Category", { enumerable: true, get: function () { return category_1.Category; } });
|
|
16
17
|
const abstract_base_1 = require("./abstract-base");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["entities/index.ts"],"names":[],"mappings":";;;AAAA,mCAEiB;AAkBf,sFAnBkB,aAAK,OAmBlB;AACmE,4FApB/C,mBAAW,OAoB+C;AAAE,6FApB/C,oBAAY,OAoB+C;AAlBnG,uCAEmB;AAeV,wFAhBP,iBAAO,OAgBO;AAEA,iGAlBL,0BAAgB,OAkBK;AAA9B,6FAlB2B,sBAAY,OAkB3B;AAhBd,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["entities/index.ts"],"names":[],"mappings":";;;AAAA,mCAEiB;AAkBf,sFAnBkB,aAAK,OAmBlB;AACmE,4FApB/C,mBAAW,OAoB+C;AAAE,6FApB/C,oBAAY,OAoB+C;AAlBnG,uCAEmB;AAeV,wFAhBP,iBAAO,OAgBO;AAEA,iGAlBL,0BAAgB,OAkBK;AAA9B,6FAlB2B,sBAAY,OAkB3B;AAhBd,mCAAqD;AAcnC,sFAdT,aAAK,OAcS;AAEgD,oGAhBvD,2BAAmB,OAgBuD;AAf1F,yCAAsC;AAab,yFAbhB,mBAAQ,OAagB;AAZjC,mDAA+C;AAYZ,6FAZ1B,4BAAY,OAY0B;AAX/C,uCAEmB;AAS8B,wFAV/C,iBAAO,OAU+C;AACtC,8FAXP,uBAAa,OAWO;AAA7B,+FAXwB,wBAAc,OAWxB;AAD0C,qGAVhB,8BAAoB,OAUgB;AAR9E,iCAA8B;AASG,qFATxB,WAAI,OASwB;AARrC,yDAAqD;AAQd,gGAR9B,kCAAe,OAQ8B;AANzC,QAAA,QAAQ,GAAG;IACtB,aAAK,EAAE,iBAAO,EAAE,aAAK,EAAE,iBAAO,EAAE,WAAI;CACrC,CAAC","sourcesContent":["import {\n StoreQueueConfig, Store, CountryEnum, PriorityEnum,\n} from './store';\nimport {\n Product, UpdateReasonEnum, CurrencyEnum, ProductAttributes, ConditionalPrice,\n} from './product';\nimport { Price, MeasurementUnitEnum } from './price';\nimport { Category } from './category';\nimport { AbstractBase } from './abstract-base';\nimport {\n Keyword, CATEGORY_ENUM, CONDITION_ENUM, CONDITION_FIELD_ENUM,\n} from './keyword';\nimport { User } from './user';\nimport { AlertConditions } from './alert-conditions';\n\nexport const Entities = [\n Store, Product, Price, Keyword, User,\n];\n\nexport {\n Store, Product, Price, Category, AbstractBase, Keyword, CONDITION_FIELD_ENUM,\n CONDITION_ENUM, CATEGORY_ENUM, User, AlertConditions, StoreQueueConfig, CountryEnum, PriorityEnum,\n CurrencyEnum, UpdateReasonEnum, ConditionalPrice, ProductAttributes, MeasurementUnitEnum,\n};\n"]}
|
package/dist/entities/price.d.ts
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { AbstractBase } from './abstract-base';
|
|
2
|
+
export declare enum MeasurementUnitEnum {
|
|
3
|
+
KG = "kg",
|
|
4
|
+
G = "g",
|
|
5
|
+
L = "l",
|
|
6
|
+
ML = "ml",
|
|
7
|
+
UNIT = "unit"
|
|
8
|
+
}
|
|
2
9
|
export declare class Price extends AbstractBase {
|
|
3
10
|
productRef: string;
|
|
4
11
|
normalPrice?: number;
|
|
5
12
|
offerPrice?: number;
|
|
6
13
|
cardPrice?: number;
|
|
7
14
|
sourceUrl?: string;
|
|
15
|
+
unitMultiplier?: number;
|
|
16
|
+
measurementUnit?: MeasurementUnitEnum;
|
|
8
17
|
createdAt?: Date;
|
|
9
18
|
}
|
package/dist/entities/price.js
CHANGED
|
@@ -9,10 +9,18 @@ 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.Price = void 0;
|
|
12
|
+
exports.Price = exports.MeasurementUnitEnum = 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");
|
|
16
|
+
var MeasurementUnitEnum;
|
|
17
|
+
(function (MeasurementUnitEnum) {
|
|
18
|
+
MeasurementUnitEnum["KG"] = "kg";
|
|
19
|
+
MeasurementUnitEnum["G"] = "g";
|
|
20
|
+
MeasurementUnitEnum["L"] = "l";
|
|
21
|
+
MeasurementUnitEnum["ML"] = "ml";
|
|
22
|
+
MeasurementUnitEnum["UNIT"] = "unit";
|
|
23
|
+
})(MeasurementUnitEnum = exports.MeasurementUnitEnum || (exports.MeasurementUnitEnum = {}));
|
|
16
24
|
let Price = class Price extends abstract_base_1.AbstractBase {
|
|
17
25
|
};
|
|
18
26
|
__decorate([
|
|
@@ -44,6 +52,16 @@ __decorate([
|
|
|
44
52
|
class_validator_1.IsOptional(),
|
|
45
53
|
__metadata("design:type", String)
|
|
46
54
|
], Price.prototype, "sourceUrl", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
typeorm_1.Column(),
|
|
57
|
+
class_validator_1.IsOptional(),
|
|
58
|
+
__metadata("design:type", Number)
|
|
59
|
+
], Price.prototype, "unitMultiplier", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
typeorm_1.Column(),
|
|
62
|
+
class_validator_1.IsOptional(),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], Price.prototype, "measurementUnit", void 0);
|
|
47
65
|
__decorate([
|
|
48
66
|
typeorm_1.CreateDateColumn(),
|
|
49
67
|
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;
|
|
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"]}
|
package/package.json
CHANGED
package/src/entities/index.ts
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
Product, UpdateReasonEnum, CurrencyEnum, ProductAttributes, ConditionalPrice,
|
|
6
6
|
} from './product';
|
|
7
|
-
import { Price } from './price';
|
|
7
|
+
import { Price, MeasurementUnitEnum } from './price';
|
|
8
8
|
import { Category } from './category';
|
|
9
9
|
import { AbstractBase } from './abstract-base';
|
|
10
10
|
import {
|
|
@@ -20,5 +20,5 @@ export const Entities = [
|
|
|
20
20
|
export {
|
|
21
21
|
Store, Product, Price, Category, AbstractBase, Keyword, CONDITION_FIELD_ENUM,
|
|
22
22
|
CONDITION_ENUM, CATEGORY_ENUM, User, AlertConditions, StoreQueueConfig, CountryEnum, PriorityEnum,
|
|
23
|
-
CurrencyEnum, UpdateReasonEnum, ConditionalPrice, ProductAttributes,
|
|
23
|
+
CurrencyEnum, UpdateReasonEnum, ConditionalPrice, ProductAttributes, MeasurementUnitEnum,
|
|
24
24
|
};
|
package/src/entities/price.ts
CHANGED
|
@@ -4,6 +4,14 @@ import {
|
|
|
4
4
|
import { IsNotEmpty, IsNumber, IsOptional } from 'class-validator';
|
|
5
5
|
import { AbstractBase } from './abstract-base';
|
|
6
6
|
|
|
7
|
+
export enum MeasurementUnitEnum {
|
|
8
|
+
KG = 'kg',
|
|
9
|
+
G = 'g',
|
|
10
|
+
L = 'l',
|
|
11
|
+
ML = 'ml',
|
|
12
|
+
UNIT = 'unit'
|
|
13
|
+
}
|
|
14
|
+
|
|
7
15
|
@Entity({ name: 'prices' })
|
|
8
16
|
export class Price extends AbstractBase {
|
|
9
17
|
@Column()
|
|
@@ -30,6 +38,14 @@ export class Price extends AbstractBase {
|
|
|
30
38
|
@IsOptional()
|
|
31
39
|
sourceUrl?: string;
|
|
32
40
|
|
|
41
|
+
@Column()
|
|
42
|
+
@IsOptional()
|
|
43
|
+
unitMultiplier?: number;
|
|
44
|
+
|
|
45
|
+
@Column()
|
|
46
|
+
@IsOptional()
|
|
47
|
+
measurementUnit?: MeasurementUnitEnum;
|
|
48
|
+
|
|
33
49
|
@CreateDateColumn()
|
|
34
50
|
@Index()
|
|
35
51
|
createdAt?: Date;
|