synunu-libs 1.0.22 → 1.0.24

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.
@@ -1,18 +1,24 @@
1
- import { TranslationInput } from "./translation.input";
2
- import { UserType } from "../enum";
3
1
  import { DateRangeInput } from "./date-range.input";
2
+ import { CreateVariantInput } from "./variant.dto";
3
+ export declare class ProductOptionInput {
4
+ name: string;
5
+ values: string[];
6
+ }
4
7
  export declare class CreateProductInput {
5
- key: string;
6
- label: TranslationInput;
7
- icon?: string;
8
- rootPath?: string;
9
- path?: TranslationInput;
10
- userType?: UserType;
11
- order?: number;
12
- visible?: boolean;
13
- permissions?: string[];
14
- parent?: string | null;
15
- isActive?: boolean;
8
+ name: string;
9
+ alias?: string;
10
+ vendor?: string;
11
+ productType?: string;
12
+ metaTitle?: string;
13
+ metaDescription?: string;
14
+ publishedOn?: Date;
15
+ templateLayout?: string;
16
+ content?: string;
17
+ tags?: string[];
18
+ images?: string[];
19
+ variants: CreateVariantInput[];
20
+ options: ProductOptionInput[];
21
+ defaultVariantUnit?: string;
16
22
  }
17
23
  export declare class ProductFilterInput {
18
24
  createdAt?: DateRangeInput;
@@ -1 +1 @@
1
- {"version":3,"file":"product.dto.d.ts","sourceRoot":"","sources":["../../src/dto/product.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,qBACa,kBAAkB;IAE/B,GAAG,EAAE,MAAM,CAAC;IAGZ,KAAK,EAAE,gBAAgB,CAAC;IAGxB,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,IAAI,CAAC,EAAE,gBAAgB,CAAC;IAGxB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAGpB,KAAK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B;;AAED,qBACa,kBAAmB,SAAQ,uBAA+B;IAErE,GAAG,EAAE,MAAM,CAAC;CACb"}
@@ -9,58 +9,83 @@ 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.UpdateProductInput = exports.ProductFilterInput = exports.CreateProductInput = void 0;
12
+ exports.UpdateProductInput = exports.ProductFilterInput = exports.CreateProductInput = exports.ProductOptionInput = void 0;
13
13
  const graphql_1 = require("@nestjs/graphql");
14
- const translation_input_1 = require("./translation.input");
15
- const enum_1 = require("../enum");
16
14
  const date_range_input_1 = require("./date-range.input");
15
+ const variant_dto_1 = require("./variant.dto");
16
+ let ProductOptionInput = class ProductOptionInput {
17
+ };
18
+ exports.ProductOptionInput = ProductOptionInput;
19
+ __decorate([
20
+ (0, graphql_1.Field)(),
21
+ __metadata("design:type", String)
22
+ ], ProductOptionInput.prototype, "name", void 0);
23
+ __decorate([
24
+ (0, graphql_1.Field)(() => [String]),
25
+ __metadata("design:type", Array)
26
+ ], ProductOptionInput.prototype, "values", void 0);
27
+ exports.ProductOptionInput = ProductOptionInput = __decorate([
28
+ (0, graphql_1.InputType)()
29
+ ], ProductOptionInput);
17
30
  let CreateProductInput = class CreateProductInput {
18
31
  };
19
32
  exports.CreateProductInput = CreateProductInput;
20
33
  __decorate([
21
34
  (0, graphql_1.Field)(),
22
35
  __metadata("design:type", String)
23
- ], CreateProductInput.prototype, "key", void 0);
36
+ ], CreateProductInput.prototype, "name", void 0);
24
37
  __decorate([
25
- (0, graphql_1.Field)(() => translation_input_1.TranslationInput),
26
- __metadata("design:type", translation_input_1.TranslationInput)
27
- ], CreateProductInput.prototype, "label", void 0);
38
+ (0, graphql_1.Field)({ nullable: true }),
39
+ __metadata("design:type", String)
40
+ ], CreateProductInput.prototype, "alias", void 0);
28
41
  __decorate([
29
42
  (0, graphql_1.Field)({ nullable: true }),
30
43
  __metadata("design:type", String)
31
- ], CreateProductInput.prototype, "icon", void 0);
44
+ ], CreateProductInput.prototype, "vendor", void 0);
32
45
  __decorate([
33
46
  (0, graphql_1.Field)({ nullable: true }),
34
47
  __metadata("design:type", String)
35
- ], CreateProductInput.prototype, "rootPath", void 0);
48
+ ], CreateProductInput.prototype, "productType", void 0);
36
49
  __decorate([
37
- (0, graphql_1.Field)(() => translation_input_1.TranslationInput, { nullable: true }),
38
- __metadata("design:type", translation_input_1.TranslationInput)
39
- ], CreateProductInput.prototype, "path", void 0);
50
+ (0, graphql_1.Field)({ nullable: true }),
51
+ __metadata("design:type", String)
52
+ ], CreateProductInput.prototype, "metaTitle", void 0);
40
53
  __decorate([
41
- (0, graphql_1.Field)(() => enum_1.UserType, { nullable: true, defaultValue: enum_1.UserType.ADMIN }),
54
+ (0, graphql_1.Field)({ nullable: true }),
42
55
  __metadata("design:type", String)
43
- ], CreateProductInput.prototype, "userType", void 0);
56
+ ], CreateProductInput.prototype, "metaDescription", void 0);
44
57
  __decorate([
45
- (0, graphql_1.Field)({ nullable: true, defaultValue: 0 }),
46
- __metadata("design:type", Number)
47
- ], CreateProductInput.prototype, "order", void 0);
58
+ (0, graphql_1.Field)({ nullable: true }),
59
+ __metadata("design:type", Date)
60
+ ], CreateProductInput.prototype, "publishedOn", void 0);
48
61
  __decorate([
49
- (0, graphql_1.Field)({ nullable: true, defaultValue: true }),
50
- __metadata("design:type", Boolean)
51
- ], CreateProductInput.prototype, "visible", void 0);
62
+ (0, graphql_1.Field)({ nullable: true }),
63
+ __metadata("design:type", String)
64
+ ], CreateProductInput.prototype, "templateLayout", void 0);
65
+ __decorate([
66
+ (0, graphql_1.Field)({ nullable: true }),
67
+ __metadata("design:type", String)
68
+ ], CreateProductInput.prototype, "content", void 0);
69
+ __decorate([
70
+ (0, graphql_1.Field)(() => [String], { nullable: true }),
71
+ __metadata("design:type", Array)
72
+ ], CreateProductInput.prototype, "tags", void 0);
73
+ __decorate([
74
+ (0, graphql_1.Field)(() => [String], { nullable: true }),
75
+ __metadata("design:type", Array)
76
+ ], CreateProductInput.prototype, "images", void 0);
52
77
  __decorate([
53
- (0, graphql_1.Field)(() => [String], { nullable: true, defaultValue: [] }),
78
+ (0, graphql_1.Field)(() => [variant_dto_1.CreateVariantInput]),
54
79
  __metadata("design:type", Array)
55
- ], CreateProductInput.prototype, "permissions", void 0);
80
+ ], CreateProductInput.prototype, "variants", void 0);
56
81
  __decorate([
57
- (0, graphql_1.Field)(() => String, { nullable: true }),
58
- __metadata("design:type", Object)
59
- ], CreateProductInput.prototype, "parent", void 0);
82
+ (0, graphql_1.Field)(() => [ProductOptionInput]),
83
+ __metadata("design:type", Array)
84
+ ], CreateProductInput.prototype, "options", void 0);
60
85
  __decorate([
61
- (0, graphql_1.Field)({ nullable: true, defaultValue: true }),
62
- __metadata("design:type", Boolean)
63
- ], CreateProductInput.prototype, "isActive", void 0);
86
+ (0, graphql_1.Field)({ nullable: true }),
87
+ __metadata("design:type", String)
88
+ ], CreateProductInput.prototype, "defaultVariantUnit", void 0);
64
89
  exports.CreateProductInput = CreateProductInput = __decorate([
65
90
  (0, graphql_1.InputType)()
66
91
  ], CreateProductInput);
@@ -1 +1 @@
1
- {"version":3,"file":"product.dto.js","sourceRoot":"","sources":["../../src/dto/product.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAgE;AAChE,2DAAuD;AACvD,kCAAmC;AACnC,yDAAoD;AAG7C,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAiC9B,CAAA;AAjCY,gDAAkB;AAE/B;IADC,IAAA,eAAK,GAAE;;+CACI;AAGZ;IADC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,oCAAgB,CAAC;8BACvB,oCAAgB;iDAAC;AAGxB;IADC,IAAA,eAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACZ;AAGd;IADC,IAAA,eAAK,EAAC,EAAE,QAAQ,EAAE,IAAI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AAE,IAAI,EAAE,CAAC;;mDACT;AAGjB;IADC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDAC1B;AAGhB;IADC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACxB;AAGlB;IADC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,CAAC,gCAAkB,CAAC,CAAC;;oDACH;AAG/B;IADC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,CAAC,kBAAkB,CAAC,CAAC;;mDACJ;AAG9B;IADC,IAAA,eAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8DACE;6BAzCjB,kBAAkB;IAD9B,IAAA,mBAAS,GAAE;GACC,kBAAkB,CA0C9B;AAGM,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAG9B,CAAA;AAHY,gDAAkB;AAE7B;IADC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,iCAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACpC,iCAAc;qDAAC;6BAFhB,kBAAkB;IAD9B,IAAA,mBAAS,GAAE;GACC,kBAAkB,CAG9B;AAGM,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,IAAA,qBAAW,EAAC,kBAAkB,CAAC;CAGtE,CAAA;AAHY,gDAAkB;AAE7B;IADC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;+CACR;6BAFD,kBAAkB;IAD9B,IAAA,mBAAS,GAAE;GACC,kBAAkB,CAG9B"}
@@ -1,18 +1,32 @@
1
- import { TranslationInput } from "./translation.input";
2
- import { UserType } from "../enum";
3
1
  import { DateRangeInput } from "./date-range.input";
2
+ export declare class InventoryQuantityInput {
3
+ locationId: number;
4
+ onHand: number;
5
+ available: number;
6
+ storageLocation?: string;
7
+ }
4
8
  export declare class CreateVariantInput {
5
- key: string;
6
- label: TranslationInput;
7
- icon?: string;
8
- rootPath?: string;
9
- path?: TranslationInput;
10
- userType?: UserType;
11
- order?: number;
12
- visible?: boolean;
13
- permissions?: string[];
14
- parent?: string | null;
15
- isActive?: boolean;
9
+ barcode?: string;
10
+ sku: string;
11
+ price: number;
12
+ compareAtPrice?: number;
13
+ costPrice?: number;
14
+ option1?: string;
15
+ option2?: string;
16
+ option3?: string;
17
+ taxable: boolean;
18
+ inventoryManagement?: string;
19
+ inventoryPolicy?: string;
20
+ lotManagement?: boolean;
21
+ alertBeforeExpiredInDay?: number;
22
+ requiresShipping?: boolean;
23
+ weightUnit?: string;
24
+ weight?: number;
25
+ unit?: string;
26
+ inventoryQuantities: InventoryQuantityInput[];
27
+ localStatus?: string;
28
+ type?: string;
29
+ uuid: string;
16
30
  }
17
31
  export declare class VariantFilterInput {
18
32
  createdAt?: DateRangeInput;
@@ -1 +1 @@
1
- {"version":3,"file":"variant.dto.d.ts","sourceRoot":"","sources":["../../src/dto/variant.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,qBACa,kBAAkB;IAE/B,GAAG,EAAE,MAAM,CAAC;IAGZ,KAAK,EAAE,gBAAgB,CAAC;IAGxB,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,IAAI,CAAC,EAAE,gBAAgB,CAAC;IAGxB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAGpB,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,OAAO,CAAC,EAAE,OAAO,CAAC;IAGlB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IAGvB,MAAM,CAAC,EAAE,MAAM,GA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MAAM,CAAC;IAGd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBACa,kBAAkB;IAE7B,SAAS,CAAC,EAAE,cAAc,CAAC;CAC5B;;AAED,qBACa,kBAAmB,SAAQ,uBAA+B;IAErE,GAAG,EAAE,MAAM,CAAC;CACb"}
@@ -9,58 +9,118 @@ 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.UpdateVariantInput = exports.VariantFilterInput = exports.CreateVariantInput = void 0;
12
+ exports.UpdateVariantInput = exports.VariantFilterInput = exports.CreateVariantInput = exports.InventoryQuantityInput = void 0;
13
13
  const graphql_1 = require("@nestjs/graphql");
14
- const translation_input_1 = require("./translation.input");
15
- const enum_1 = require("../enum");
16
14
  const date_range_input_1 = require("./date-range.input");
15
+ let InventoryQuantityInput = class InventoryQuantityInput {
16
+ };
17
+ exports.InventoryQuantityInput = InventoryQuantityInput;
18
+ __decorate([
19
+ (0, graphql_1.Field)(() => graphql_1.Float),
20
+ __metadata("design:type", Number)
21
+ ], InventoryQuantityInput.prototype, "locationId", void 0);
22
+ __decorate([
23
+ (0, graphql_1.Field)(() => graphql_1.Float),
24
+ __metadata("design:type", Number)
25
+ ], InventoryQuantityInput.prototype, "onHand", void 0);
26
+ __decorate([
27
+ (0, graphql_1.Field)(() => graphql_1.Float),
28
+ __metadata("design:type", Number)
29
+ ], InventoryQuantityInput.prototype, "available", void 0);
30
+ __decorate([
31
+ (0, graphql_1.Field)({ nullable: true }),
32
+ __metadata("design:type", String)
33
+ ], InventoryQuantityInput.prototype, "storageLocation", void 0);
34
+ exports.InventoryQuantityInput = InventoryQuantityInput = __decorate([
35
+ (0, graphql_1.InputType)()
36
+ ], InventoryQuantityInput);
17
37
  let CreateVariantInput = class CreateVariantInput {
18
38
  };
19
39
  exports.CreateVariantInput = CreateVariantInput;
40
+ __decorate([
41
+ (0, graphql_1.Field)({ nullable: true }),
42
+ __metadata("design:type", String)
43
+ ], CreateVariantInput.prototype, "barcode", void 0);
20
44
  __decorate([
21
45
  (0, graphql_1.Field)(),
22
46
  __metadata("design:type", String)
23
- ], CreateVariantInput.prototype, "key", void 0);
47
+ ], CreateVariantInput.prototype, "sku", void 0);
48
+ __decorate([
49
+ (0, graphql_1.Field)(() => graphql_1.Float),
50
+ __metadata("design:type", Number)
51
+ ], CreateVariantInput.prototype, "price", void 0);
52
+ __decorate([
53
+ (0, graphql_1.Field)(() => graphql_1.Float, { nullable: true }),
54
+ __metadata("design:type", Number)
55
+ ], CreateVariantInput.prototype, "compareAtPrice", void 0);
24
56
  __decorate([
25
- (0, graphql_1.Field)(() => translation_input_1.TranslationInput),
26
- __metadata("design:type", translation_input_1.TranslationInput)
27
- ], CreateVariantInput.prototype, "label", void 0);
57
+ (0, graphql_1.Field)(() => graphql_1.Float, { nullable: true }),
58
+ __metadata("design:type", Number)
59
+ ], CreateVariantInput.prototype, "costPrice", void 0);
60
+ __decorate([
61
+ (0, graphql_1.Field)({ nullable: true }),
62
+ __metadata("design:type", String)
63
+ ], CreateVariantInput.prototype, "option1", void 0);
28
64
  __decorate([
29
65
  (0, graphql_1.Field)({ nullable: true }),
30
66
  __metadata("design:type", String)
31
- ], CreateVariantInput.prototype, "icon", void 0);
67
+ ], CreateVariantInput.prototype, "option2", void 0);
32
68
  __decorate([
33
69
  (0, graphql_1.Field)({ nullable: true }),
34
70
  __metadata("design:type", String)
35
- ], CreateVariantInput.prototype, "rootPath", void 0);
71
+ ], CreateVariantInput.prototype, "option3", void 0);
72
+ __decorate([
73
+ (0, graphql_1.Field)(),
74
+ __metadata("design:type", Boolean)
75
+ ], CreateVariantInput.prototype, "taxable", void 0);
36
76
  __decorate([
37
- (0, graphql_1.Field)(() => translation_input_1.TranslationInput, { nullable: true }),
38
- __metadata("design:type", translation_input_1.TranslationInput)
39
- ], CreateVariantInput.prototype, "path", void 0);
77
+ (0, graphql_1.Field)({ nullable: true }),
78
+ __metadata("design:type", String)
79
+ ], CreateVariantInput.prototype, "inventoryManagement", void 0);
40
80
  __decorate([
41
- (0, graphql_1.Field)(() => enum_1.UserType, { nullable: true, defaultValue: enum_1.UserType.ADMIN }),
81
+ (0, graphql_1.Field)({ nullable: true }),
42
82
  __metadata("design:type", String)
43
- ], CreateVariantInput.prototype, "userType", void 0);
83
+ ], CreateVariantInput.prototype, "inventoryPolicy", void 0);
84
+ __decorate([
85
+ (0, graphql_1.Field)({ nullable: true }),
86
+ __metadata("design:type", Boolean)
87
+ ], CreateVariantInput.prototype, "lotManagement", void 0);
44
88
  __decorate([
45
- (0, graphql_1.Field)({ nullable: true, defaultValue: 0 }),
89
+ (0, graphql_1.Field)(() => graphql_1.Float, { nullable: true }),
46
90
  __metadata("design:type", Number)
47
- ], CreateVariantInput.prototype, "order", void 0);
91
+ ], CreateVariantInput.prototype, "alertBeforeExpiredInDay", void 0);
48
92
  __decorate([
49
- (0, graphql_1.Field)({ nullable: true, defaultValue: true }),
93
+ (0, graphql_1.Field)({ nullable: true }),
50
94
  __metadata("design:type", Boolean)
51
- ], CreateVariantInput.prototype, "visible", void 0);
95
+ ], CreateVariantInput.prototype, "requiresShipping", void 0);
96
+ __decorate([
97
+ (0, graphql_1.Field)({ nullable: true }),
98
+ __metadata("design:type", String)
99
+ ], CreateVariantInput.prototype, "weightUnit", void 0);
100
+ __decorate([
101
+ (0, graphql_1.Field)(() => graphql_1.Float, { nullable: true }),
102
+ __metadata("design:type", Number)
103
+ ], CreateVariantInput.prototype, "weight", void 0);
104
+ __decorate([
105
+ (0, graphql_1.Field)({ nullable: true }),
106
+ __metadata("design:type", String)
107
+ ], CreateVariantInput.prototype, "unit", void 0);
52
108
  __decorate([
53
- (0, graphql_1.Field)(() => [String], { nullable: true, defaultValue: [] }),
109
+ (0, graphql_1.Field)(() => [InventoryQuantityInput]),
54
110
  __metadata("design:type", Array)
55
- ], CreateVariantInput.prototype, "permissions", void 0);
111
+ ], CreateVariantInput.prototype, "inventoryQuantities", void 0);
112
+ __decorate([
113
+ (0, graphql_1.Field)({ nullable: true }),
114
+ __metadata("design:type", String)
115
+ ], CreateVariantInput.prototype, "localStatus", void 0);
56
116
  __decorate([
57
- (0, graphql_1.Field)(() => String, { nullable: true }),
58
- __metadata("design:type", Object)
59
- ], CreateVariantInput.prototype, "parent", void 0);
117
+ (0, graphql_1.Field)({ nullable: true }),
118
+ __metadata("design:type", String)
119
+ ], CreateVariantInput.prototype, "type", void 0);
60
120
  __decorate([
61
- (0, graphql_1.Field)({ nullable: true, defaultValue: true }),
62
- __metadata("design:type", Boolean)
63
- ], CreateVariantInput.prototype, "isActive", void 0);
121
+ (0, graphql_1.Field)(),
122
+ __metadata("design:type", String)
123
+ ], CreateVariantInput.prototype, "uuid", void 0);
64
124
  exports.CreateVariantInput = CreateVariantInput = __decorate([
65
125
  (0, graphql_1.InputType)()
66
126
  ], CreateVariantInput);
@@ -1 +1 @@
1
- {"version":3,"file":"variant.dto.js","sourceRoot":"","sources":["../../src/dto/variant.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAgE;AAChE,2DAAuD;AACvD,kCAAmC;AACnC,yDAAoD;AAG7C,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAiC9B,CAAA;AAjCY,gDAAkB;AAE/B;IADC,IAAA,eAAK,GAAE;;+CACI;AAGZ;IADC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,oCAAgB,CAAC;8BACvB,oCAAgB;iDAAC;AAGxB;IADC,IAAA,eAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACZ;AAGd;IADC,IAAA,eAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACR;AAGlB;IADC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,oCAAgB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BAC3C,oCAAgB;gDAAC;AAGxB;IAD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AD9B,IAAA,mBAAS,GAAE;GACC,kBAAkB,CAG9B;AAGM,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,IAAA,qBAAW,EAAC,kBAAkB,CAAC;CAGtE,CAAA;AAHY,gDAAkB;AAE7B;IADC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;+CACR;6BAFD,kBAAkB;IAD9B,IAAA,mBAAS,GAAE;GACC,kBAAkB,CAG9B"}
@@ -1,2 +1,3 @@
1
1
  export * from "./time.util";
2
+ export * from "./transaction.util";
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC"}
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./time.util"), exports);
18
+ __exportStar(require("./transaction.util"), exports);
18
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,qDAAmC"}
@@ -0,0 +1,3 @@
1
+ import { Connection, ClientSession } from "mongoose";
2
+ export declare function withTransaction<T>(connection: Connection, session: ClientSession | undefined, handler: (s: ClientSession) => Promise<T>): Promise<T>;
3
+ //# sourceMappingURL=transaction.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction.util.d.ts","sourceRoot":"","sources":["../../src/utils/transaction.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAErD,wBAAsB,eAAe,CAAC,CAAC,EACrC,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,aAAa,GAAG,SAAS,EAClC,OAAO,EAAE,CAAC,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,CAAC,CAAC,GACxC,OAAO,CAAC,CAAC,CAAC,CAeZ"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.withTransaction = withTransaction;
4
+ async function withTransaction(connection, session, handler) {
5
+ const ownSession = !session;
6
+ const s = session ?? (await connection.startSession());
7
+ if (ownSession)
8
+ s.startTransaction();
9
+ try {
10
+ const result = await handler(s);
11
+ if (ownSession)
12
+ await s.commitTransaction();
13
+ return result;
14
+ }
15
+ catch (err) {
16
+ if (ownSession)
17
+ await s.abortTransaction();
18
+ throw err;
19
+ }
20
+ finally {
21
+ if (ownSession)
22
+ s.endSession();
23
+ }
24
+ }
25
+ //# sourceMappingURL=transaction.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction.util.js","sourceRoot":"","sources":["../../src/utils/transaction.util.ts"],"names":[],"mappings":";;AAEA,0CAmBC;AAnBM,KAAK,UAAU,eAAe,CACnC,UAAsB,EACtB,OAAkC,EAClC,OAAyC;IAEzC,MAAM,UAAU,GAAG,CAAC,OAAO,CAAC;IAC5B,MAAM,CAAC,GAAG,OAAO,IAAI,CAAC,MAAM,UAAU,CAAC,YAAY,EAAE,CAAC,CAAC;IACvD,IAAI,UAAU;QAAE,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAErC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC;QAChC,IAAI,UAAU;YAAE,MAAM,CAAC,CAAC,iBAAiB,EAAE,CAAC;QAC5C,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,UAAU;YAAE,MAAM,CAAC,CAAC,gBAAgB,EAAE,CAAC;QAC3C,MAAM,GAAG,CAAC;IACZ,CAAC;YAAS,CAAC;QACT,IAAI,UAAU;YAAE,CAAC,CAAC,UAAU,EAAE,CAAC;IACjC,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "synunu-libs",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "description": "Shared DTOs, constants, and utilities for Synunu microservices",
@@ -19,6 +19,7 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "class-validator": "^0.14.2",
22
+ "mongoose": "^8.19.3",
22
23
  "reflect-metadata": "^0.2.2"
23
24
  },
24
25
  "peerDependencies": {