@medusajs/medusa 1.2.0 → 1.2.2-dev.53
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/CHANGELOG.md +26 -0
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +1 -0
- package/dist/api/index.js.map +1 -1
- package/dist/api/middlewares/error-handler.js +6 -0
- package/dist/api/middlewares/error-handler.js.map +1 -1
- package/dist/api/routes/admin/customer-groups/add-customers-batch.d.ts +27 -0
- package/dist/{db-subscribers/region.js → api/routes/admin/customer-groups/add-customers-batch.js} +60 -38
- package/dist/api/routes/admin/customer-groups/add-customers-batch.js.map +1 -0
- package/dist/api/routes/admin/customer-groups/get-customer-group-customers.d.ts +20 -0
- package/dist/{subscribers/region.js → api/routes/admin/customer-groups/get-customer-group-customers.js} +38 -27
- package/dist/api/routes/admin/customer-groups/get-customer-group-customers.js.map +1 -0
- package/dist/api/routes/admin/customer-groups/get-customer-group.d.ts +1 -1
- package/dist/api/routes/admin/customer-groups/get-customer-group.js +1 -1
- package/dist/api/routes/admin/customer-groups/index.d.ts +5 -0
- package/dist/api/routes/admin/customer-groups/index.js +8 -0
- package/dist/api/routes/admin/customer-groups/index.js.map +1 -1
- package/dist/api/routes/admin/customer-groups/list-customer-groups.d.ts +38 -0
- package/dist/api/routes/admin/customer-groups/list-customer-groups.js +200 -0
- package/dist/api/routes/admin/customer-groups/list-customer-groups.js.map +1 -0
- package/dist/api/routes/admin/customers/index.js +1 -1
- package/dist/api/routes/admin/customers/index.js.map +1 -1
- package/dist/api/routes/admin/customers/list-customers.js +12 -46
- package/dist/api/routes/admin/customers/list-customers.js.map +1 -1
- package/dist/api/routes/admin/discounts/update-discount.d.ts +2 -2
- package/dist/api/routes/admin/discounts/update-discount.js +3 -3
- package/dist/api/routes/admin/discounts/update-discount.js.map +1 -1
- package/dist/api/routes/admin/products/index.js +6 -0
- package/dist/api/routes/admin/products/index.js.map +1 -1
- package/dist/api/routes/store/auth/exists.js +4 -2
- package/dist/api/routes/store/auth/exists.js.map +1 -1
- package/dist/api/routes/store/products/list-products.d.ts +3 -1
- package/dist/api/routes/store/products/list-products.js +39 -4
- package/dist/api/routes/store/products/list-products.js.map +1 -1
- package/dist/api/routes/store/variants/list-variants.d.ts +4 -0
- package/dist/api/routes/store/variants/list-variants.js +33 -9
- package/dist/api/routes/store/variants/list-variants.js.map +1 -1
- package/dist/controllers/customers/index.d.ts +4 -0
- package/dist/controllers/customers/index.js +8 -0
- package/dist/controllers/customers/index.js.map +1 -0
- package/dist/controllers/customers/list-customers.d.ts +3 -0
- package/dist/controllers/customers/list-customers.js +96 -0
- package/dist/controllers/customers/list-customers.js.map +1 -0
- package/dist/models/customer.js +3 -1
- package/dist/models/customer.js.map +1 -1
- package/dist/repositories/customer-group.d.ts +1 -0
- package/dist/repositories/customer-group.js +24 -0
- package/dist/repositories/customer-group.js.map +1 -1
- package/dist/repositories/customer.d.ts +1 -0
- package/dist/repositories/customer.js +65 -0
- package/dist/repositories/customer.js.map +1 -1
- package/dist/repositories/product.d.ts +1 -0
- package/dist/repositories/product.js +6 -2
- package/dist/repositories/product.js.map +1 -1
- package/dist/services/customer-group.d.ts +24 -1
- package/dist/services/customer-group.js +95 -2
- package/dist/services/customer-group.js.map +1 -1
- package/dist/services/customer.d.ts +1 -3
- package/dist/services/customer.js +40 -44
- package/dist/services/customer.js.map +1 -1
- package/dist/services/discount.js +17 -9
- package/dist/services/discount.js.map +1 -1
- package/dist/services/product-collection.js +29 -8
- package/dist/services/product-collection.js.map +1 -1
- package/dist/services/product.js +38 -26
- package/dist/services/product.js.map +1 -1
- package/dist/services/region.js +1 -0
- package/dist/services/region.js.map +1 -1
- package/dist/types/customer-groups.d.ts +5 -1
- package/dist/types/customer-groups.js +25 -0
- package/dist/types/customer-groups.js.map +1 -1
- package/dist/types/customers.d.ts +1 -0
- package/dist/types/customers.js +5 -0
- package/dist/types/customers.js.map +1 -1
- package/dist/types/product-variant.d.ts +2 -2
- package/dist/types/product-variant.js +4 -4
- package/dist/types/product-variant.js.map +1 -1
- package/dist/utils/exception-formatter.d.ts +5 -0
- package/dist/utils/exception-formatter.js +29 -0
- package/dist/utils/exception-formatter.js.map +1 -0
- package/package.json +7 -7
- package/yarn-error.log +79 -5
- package/dist/api/routes/admin/orders/receive-swap.d.ts +0 -46
- package/dist/api/routes/admin/orders/receive-swap.js +0 -159
- package/dist/api/routes/admin/orders/receive-swap.js.map +0 -1
- package/dist/db-subscribers/region.d.ts +0 -6
- package/dist/db-subscribers/region.js.map +0 -1
- package/dist/entity-subscribers/region.d.ts +0 -6
- package/dist/entity-subscribers/region.js +0 -27
- package/dist/entity-subscribers/region.js.map +0 -1
- package/dist/loaders/db-subscribers.d.ts +0 -6
- package/dist/loaders/db-subscribers.js +0 -53
- package/dist/loaders/db-subscribers.js.map +0 -1
- package/dist/subscribers/region.d.ts +0 -14
- package/dist/subscribers/region.js.map +0 -1
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
declare const _default: (req: any, res: any) => Promise<void>;
|
|
2
|
-
/**
|
|
3
|
-
* @oas [post] /orders/{id}/swaps/{swap_id}/receive
|
|
4
|
-
* operationId: "PostOrdersOrderSwapsSwapReceive"
|
|
5
|
-
* summary: "Receive a Swap"
|
|
6
|
-
* description: "Registers a Swap as received."
|
|
7
|
-
* x-authenticated: true
|
|
8
|
-
* parameters:
|
|
9
|
-
* - (path) id=* {string} The id of the Order.
|
|
10
|
-
* - (path) swap_id=* {string} The id of the Swap.
|
|
11
|
-
* requestBody:
|
|
12
|
-
* content:
|
|
13
|
-
* application/json:
|
|
14
|
-
* schema:
|
|
15
|
-
* properties:
|
|
16
|
-
* items:
|
|
17
|
-
* description: The Line Items that have been received.
|
|
18
|
-
* type: array
|
|
19
|
-
* items:
|
|
20
|
-
* properties:
|
|
21
|
-
* item_id:
|
|
22
|
-
* description: The id of the Line Item.
|
|
23
|
-
* type: string
|
|
24
|
-
* quantity:
|
|
25
|
-
* description: The quantity of the Line Item.
|
|
26
|
-
* type: integer
|
|
27
|
-
* tags:
|
|
28
|
-
* - Order
|
|
29
|
-
* responses:
|
|
30
|
-
* 200:
|
|
31
|
-
* description: OK
|
|
32
|
-
* content:
|
|
33
|
-
* application/json:
|
|
34
|
-
* schema:
|
|
35
|
-
* properties:
|
|
36
|
-
* order:
|
|
37
|
-
* $ref: "#/components/schemas/order"
|
|
38
|
-
*/
|
|
39
|
-
export default _default;
|
|
40
|
-
export declare class AdminPostOrdersOrderSwapsSwapReceiveReq {
|
|
41
|
-
items: Item[];
|
|
42
|
-
}
|
|
43
|
-
declare class Item {
|
|
44
|
-
item_id: string;
|
|
45
|
-
quantity: number;
|
|
46
|
-
}
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
13
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
14
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
15
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
16
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
17
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
21
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
22
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
23
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
24
|
-
function step(op) {
|
|
25
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
26
|
-
while (_) try {
|
|
27
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
28
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
29
|
-
switch (op[0]) {
|
|
30
|
-
case 0: case 1: t = op; break;
|
|
31
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
32
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
33
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
34
|
-
default:
|
|
35
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
36
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
37
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
38
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
39
|
-
if (t[2]) _.ops.pop();
|
|
40
|
-
_.trys.pop(); continue;
|
|
41
|
-
}
|
|
42
|
-
op = body.call(thisArg, _);
|
|
43
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
44
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
-
exports.AdminPostOrdersOrderSwapsSwapReceiveReq = void 0;
|
|
49
|
-
var class_transformer_1 = require("class-transformer");
|
|
50
|
-
var class_validator_1 = require("class-validator");
|
|
51
|
-
var _1 = require(".");
|
|
52
|
-
var validator_1 = require("../../../../utils/validator");
|
|
53
|
-
/**
|
|
54
|
-
* @oas [post] /orders/{id}/swaps/{swap_id}/receive
|
|
55
|
-
* operationId: "PostOrdersOrderSwapsSwapReceive"
|
|
56
|
-
* summary: "Receive a Swap"
|
|
57
|
-
* description: "Registers a Swap as received."
|
|
58
|
-
* x-authenticated: true
|
|
59
|
-
* parameters:
|
|
60
|
-
* - (path) id=* {string} The id of the Order.
|
|
61
|
-
* - (path) swap_id=* {string} The id of the Swap.
|
|
62
|
-
* requestBody:
|
|
63
|
-
* content:
|
|
64
|
-
* application/json:
|
|
65
|
-
* schema:
|
|
66
|
-
* properties:
|
|
67
|
-
* items:
|
|
68
|
-
* description: The Line Items that have been received.
|
|
69
|
-
* type: array
|
|
70
|
-
* items:
|
|
71
|
-
* properties:
|
|
72
|
-
* item_id:
|
|
73
|
-
* description: The id of the Line Item.
|
|
74
|
-
* type: string
|
|
75
|
-
* quantity:
|
|
76
|
-
* description: The quantity of the Line Item.
|
|
77
|
-
* type: integer
|
|
78
|
-
* tags:
|
|
79
|
-
* - Order
|
|
80
|
-
* responses:
|
|
81
|
-
* 200:
|
|
82
|
-
* description: OK
|
|
83
|
-
* content:
|
|
84
|
-
* application/json:
|
|
85
|
-
* schema:
|
|
86
|
-
* properties:
|
|
87
|
-
* order:
|
|
88
|
-
* $ref: "#/components/schemas/order"
|
|
89
|
-
*/
|
|
90
|
-
exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
|
|
91
|
-
var _a, id, swap_id, validated, orderService, swapService, entityManager, order;
|
|
92
|
-
return __generator(this, function (_b) {
|
|
93
|
-
switch (_b.label) {
|
|
94
|
-
case 0:
|
|
95
|
-
_a = req.params, id = _a.id, swap_id = _a.swap_id;
|
|
96
|
-
return [4 /*yield*/, (0, validator_1.validator)(AdminPostOrdersOrderSwapsSwapReceiveReq, req.body)];
|
|
97
|
-
case 1:
|
|
98
|
-
validated = _b.sent();
|
|
99
|
-
orderService = req.scope.resolve("orderService");
|
|
100
|
-
swapService = req.scope.resolve("swapService");
|
|
101
|
-
entityManager = req.scope.resolve("manager");
|
|
102
|
-
return [4 /*yield*/, entityManager.transaction(function (manager) { return __awaiter(void 0, void 0, void 0, function () {
|
|
103
|
-
return __generator(this, function (_a) {
|
|
104
|
-
switch (_a.label) {
|
|
105
|
-
case 0: return [4 /*yield*/, swapService
|
|
106
|
-
.withTransaction(manager)
|
|
107
|
-
.receiveReturn(swap_id, validated.items)];
|
|
108
|
-
case 1:
|
|
109
|
-
_a.sent();
|
|
110
|
-
return [4 /*yield*/, orderService
|
|
111
|
-
.withTransaction(manager)
|
|
112
|
-
.registerSwapReceived(id, swap_id)];
|
|
113
|
-
case 2:
|
|
114
|
-
_a.sent();
|
|
115
|
-
return [2 /*return*/];
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
}); })];
|
|
119
|
-
case 2:
|
|
120
|
-
_b.sent();
|
|
121
|
-
return [4 /*yield*/, orderService.retrieve(id, {
|
|
122
|
-
select: _1.defaultAdminOrdersFields,
|
|
123
|
-
relations: _1.defaultAdminOrdersRelations,
|
|
124
|
-
})];
|
|
125
|
-
case 3:
|
|
126
|
-
order = _b.sent();
|
|
127
|
-
res.status(200).json({ order: order });
|
|
128
|
-
return [2 /*return*/];
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
}); });
|
|
132
|
-
var AdminPostOrdersOrderSwapsSwapReceiveReq = /** @class */ (function () {
|
|
133
|
-
function AdminPostOrdersOrderSwapsSwapReceiveReq() {
|
|
134
|
-
}
|
|
135
|
-
__decorate([
|
|
136
|
-
(0, class_validator_1.IsArray)(),
|
|
137
|
-
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
138
|
-
(0, class_transformer_1.Type)(function () { return Item; }),
|
|
139
|
-
__metadata("design:type", Array)
|
|
140
|
-
], AdminPostOrdersOrderSwapsSwapReceiveReq.prototype, "items", void 0);
|
|
141
|
-
return AdminPostOrdersOrderSwapsSwapReceiveReq;
|
|
142
|
-
}());
|
|
143
|
-
exports.AdminPostOrdersOrderSwapsSwapReceiveReq = AdminPostOrdersOrderSwapsSwapReceiveReq;
|
|
144
|
-
var Item = /** @class */ (function () {
|
|
145
|
-
function Item() {
|
|
146
|
-
}
|
|
147
|
-
__decorate([
|
|
148
|
-
(0, class_validator_1.IsString)(),
|
|
149
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
150
|
-
__metadata("design:type", String)
|
|
151
|
-
], Item.prototype, "item_id", void 0);
|
|
152
|
-
__decorate([
|
|
153
|
-
(0, class_validator_1.IsInt)(),
|
|
154
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
155
|
-
__metadata("design:type", Number)
|
|
156
|
-
], Item.prototype, "quantity", void 0);
|
|
157
|
-
return Item;
|
|
158
|
-
}());
|
|
159
|
-
//# sourceMappingURL=receive-swap.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"receive-swap.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/orders/receive-swap.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAwC;AACxC,mDAMwB;AAExB,sBAAyE;AAEzE,yDAAuD;AACvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;gBACtB,KAAkB,GAAG,CAAC,MAAM,EAA1B,EAAE,QAAA,EAAE,OAAO,aAAA,CAAe;gBAEhB,qBAAM,IAAA,qBAAS,EAC/B,uCAAuC,EACvC,GAAG,CAAC,IAAI,CACT,EAAA;;gBAHK,SAAS,GAAG,SAGjB;gBAEK,YAAY,GAAiB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,CAAA;gBAC9D,WAAW,GAAgB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;gBAC3D,aAAa,GAAkB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;gBAEjE,qBAAM,aAAa,CAAC,WAAW,CAAC,UAAO,OAAO;;;wCAC5C,qBAAM,WAAW;yCACd,eAAe,CAAC,OAAO,CAAC;yCACxB,aAAa,CAAC,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,EAAA;;oCAF1C,SAE0C,CAAA;oCAE1C,qBAAM,YAAY;6CACf,eAAe,CAAC,OAAO,CAAC;6CACxB,oBAAoB,CAAC,EAAE,EAAE,OAAO,CAAC,EAAA;;oCAFpC,SAEoC,CAAA;;;;yBACrC,CAAC,EAAA;;gBARF,SAQE,CAAA;gBAEY,qBAAM,YAAY,CAAC,QAAQ,CAAC,EAAE,EAAE;wBAC5C,MAAM,EAAE,2BAAwB;wBAChC,SAAS,EAAE,8BAA2B;qBACvC,CAAC,EAAA;;gBAHI,KAAK,GAAG,SAGZ;gBAEF,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,OAAA,EAAE,CAAC,CAAA;;;;KAChC,EAAA;AAED;IAAA;IAKA,CAAC;IADC;QAHC,IAAA,yBAAO,GAAE;QACT,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QAC9B,IAAA,wBAAI,EAAC,cAAM,OAAA,IAAI,EAAJ,CAAI,CAAC;;0EACJ;IACf,8CAAC;CAAA,AALD,IAKC;AALY,0FAAuC;AAOpD;IAAA;IAQA,CAAC;IALC;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;yCACE;IAIf;QAFC,IAAA,uBAAK,GAAE;QACP,IAAA,4BAAU,GAAE;;0CACG;IAClB,WAAC;CAAA,AARD,IAQC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { EntitySubscriberInterface, UpdateEvent } from "typeorm";
|
|
2
|
-
import { Region } from "..";
|
|
3
|
-
export declare class RegionSubscriber implements EntitySubscriberInterface<Region> {
|
|
4
|
-
listenTo(): typeof Region;
|
|
5
|
-
afterUpdate(event: UpdateEvent<Region>): Promise<void>;
|
|
6
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"region.js","sourceRoot":"","sources":["../../src/db-subscribers/region.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAKgB;AAChB,wBAA2B;AAC3B,6CAA2C;AAG3C;IAAA;IA0BA,CAAC;IAzBC,mCAAQ,GAAR;QACE,OAAO,UAAM,CAAA;IACf,CAAC;IAEK,sCAAW,GAAjB,UAAkB,KAA0B;;;;;4BACpB,qBAAM,KAAK,CAAC,OAAO,CAAC,OAAO,CAC/C,UAAM,EACN,KAAK,CAAC,cAAc,CAAC,EAAE,EACvB,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,WAAW,CAAC,EAAE,CAChD,EAAA;;wBAJK,aAAa,GAAG,SAIrB;6BAEG,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,SAAS,CAAC,MAAM,CAAA,EAA/B,wBAA+B;wBAC3B,UAAU,GAAG,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,EAAE,EAAJ,CAAI,CAAC,CAAA;wBAE3D,qBAAM,KAAK,CAAC,OAAO,CAAC,MAAM,CACxB,iBAAO,EACP;gCACE,EAAE,EAAE,IAAA,YAAE,EAAC,UAAU,CAAC;6BACnB,EACD;gCACE,SAAS,EAAE,SAAS;6BACrB,CACF,EAAA;;wBARD,SAQC,CAAA;;;;;;KAEJ;IAzBU,gBAAgB;QAD5B,IAAA,yBAAe,GAAE;OACL,gBAAgB,CA0B5B;IAAD,uBAAC;CAAA,AA1BD,IA0BC;AA1BY,4CAAgB"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.RegionSubscriber = void 0;
|
|
10
|
-
var typeorm_1 = require("typeorm");
|
|
11
|
-
var __1 = require("..");
|
|
12
|
-
var RegionSubscriber = /** @class */ (function () {
|
|
13
|
-
function RegionSubscriber() {
|
|
14
|
-
}
|
|
15
|
-
RegionSubscriber.prototype.listenTo = function () {
|
|
16
|
-
return __1.Region;
|
|
17
|
-
};
|
|
18
|
-
RegionSubscriber.prototype.afterUpdate = function (event) {
|
|
19
|
-
console.log(event.updatedColumns);
|
|
20
|
-
};
|
|
21
|
-
RegionSubscriber = __decorate([
|
|
22
|
-
(0, typeorm_1.EventSubscriber)()
|
|
23
|
-
], RegionSubscriber);
|
|
24
|
-
return RegionSubscriber;
|
|
25
|
-
}());
|
|
26
|
-
exports.RegionSubscriber = RegionSubscriber;
|
|
27
|
-
//# sourceMappingURL=region.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"region.js","sourceRoot":"","sources":["../../src/entity-subscribers/region.ts"],"names":[],"mappings":";;;;;;;;;AAAA,mCAIgB;AAChB,wBAA2B;AAG3B;IAAA;IAQA,CAAC;IAPC,mCAAQ,GAAR;QACE,OAAO,UAAM,CAAA;IACf,CAAC;IAED,sCAAW,GAAX,UAAY,KAA0B;QACpC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;IACnC,CAAC;IAPU,gBAAgB;QAD5B,IAAA,yBAAe,GAAE;OACL,gBAAgB,CAQ5B;IAAD,uBAAC;CAAA,AARD,IAQC;AARY,4CAAgB"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
-
if (!m) return o;
|
|
5
|
-
var i = m.call(o), r, ar = [], e;
|
|
6
|
-
try {
|
|
7
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
-
}
|
|
9
|
-
catch (error) { e = { error: error }; }
|
|
10
|
-
finally {
|
|
11
|
-
try {
|
|
12
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
-
}
|
|
14
|
-
finally { if (e) throw e.error; }
|
|
15
|
-
}
|
|
16
|
-
return ar;
|
|
17
|
-
};
|
|
18
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
19
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
20
|
-
};
|
|
21
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
var awilix_1 = require("awilix");
|
|
23
|
-
var glob_1 = __importDefault(require("glob"));
|
|
24
|
-
var path_1 = __importDefault(require("path"));
|
|
25
|
-
var typeorm_1 = require("typeorm");
|
|
26
|
-
var format_registration_name_1 = __importDefault(require("../utils/format-registration-name"));
|
|
27
|
-
exports.default = (function (_a, config) {
|
|
28
|
-
var container = _a.container;
|
|
29
|
-
if (config === void 0) { config = { register: true }; }
|
|
30
|
-
var corePath = "../db-subscribers/*.js";
|
|
31
|
-
var coreFull = path_1.default.join(__dirname, corePath);
|
|
32
|
-
var toReturn = [];
|
|
33
|
-
var core = glob_1.default.sync(coreFull, { cwd: __dirname });
|
|
34
|
-
core.forEach(function (fn) {
|
|
35
|
-
var loaded = require(fn);
|
|
36
|
-
Object.entries(loaded).map(function (_a) {
|
|
37
|
-
var _b;
|
|
38
|
-
var _c = __read(_a, 2), key = _c[0], val = _c[1];
|
|
39
|
-
if (typeof val === "function" || val instanceof typeorm_1.EventSubscriber) {
|
|
40
|
-
if (config.register) {
|
|
41
|
-
var name = (0, format_registration_name_1.default)(fn);
|
|
42
|
-
container.register((_b = {},
|
|
43
|
-
_b[name] = (0, awilix_1.asClass)(val),
|
|
44
|
-
_b));
|
|
45
|
-
container.registerAdd("db_subscribers", (0, awilix_1.asValue)(val));
|
|
46
|
-
}
|
|
47
|
-
toReturn.push(val);
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
return toReturn;
|
|
52
|
-
});
|
|
53
|
-
//# sourceMappingURL=db-subscribers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"db-subscribers.js","sourceRoot":"","sources":["../../src/loaders/db-subscribers.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,iCAAyC;AACzC,8CAAuB;AACvB,8CAAuB;AACvB,mCAAyC;AACzC,+FAAsE;AAEtE,mBAAe,UAAC,EAAa,EAAE,MAA2B;QAAxC,SAAS,eAAA;IAAI,uBAAA,EAAA,WAAW,QAAQ,EAAE,IAAI,EAAE;IACxD,IAAM,QAAQ,GAAG,wBAAwB,CAAA;IACzC,IAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;IAE/C,IAAM,QAAQ,GAAG,EAAE,CAAA;IAEnB,IAAM,IAAI,GAAG,cAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAA;IACpD,IAAI,CAAC,OAAO,CAAC,UAAC,EAAE;QACd,IAAM,MAAM,GAAG,OAAO,CAAC,EAAE,CAAC,CAAA;QAE1B,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,UAAC,EAAU;;gBAAV,KAAA,aAAU,EAAT,GAAG,QAAA,EAAE,GAAG,QAAA;YACnC,IAAI,OAAO,GAAG,KAAK,UAAU,IAAI,GAAG,YAAY,yBAAe,EAAE;gBAC/D,IAAI,MAAM,CAAC,QAAQ,EAAE;oBACnB,IAAM,IAAI,GAAG,IAAA,kCAAsB,EAAC,EAAE,CAAC,CAAA;oBACvC,SAAS,CAAC,QAAQ;wBAChB,GAAC,IAAI,IAAG,IAAA,gBAAO,EAAC,GAAG,CAAC;4BACpB,CAAA;oBAEF,SAAS,CAAC,WAAW,CAAC,gBAAgB,EAAE,IAAA,gBAAO,EAAC,GAAG,CAAC,CAAC,CAAA;iBACtD;gBAED,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;aACnB;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAA;AACjB,CAAC,EAAA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export default RegionSubscriber;
|
|
2
|
-
declare class RegionSubscriber {
|
|
3
|
-
constructor({ manager, countryRepository, regionRepository, eventBusService, }: {
|
|
4
|
-
manager: any;
|
|
5
|
-
countryRepository: any;
|
|
6
|
-
regionRepository: any;
|
|
7
|
-
eventBusService: any;
|
|
8
|
-
});
|
|
9
|
-
manager_: any;
|
|
10
|
-
countryRepository_: any;
|
|
11
|
-
regionRepository_: any;
|
|
12
|
-
eventBus_: any;
|
|
13
|
-
removeRegionFromCountries: (data: any) => Promise<void>;
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"region.js","sourceRoot":"","sources":["../../src/subscribers/region.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;IACE,0BAAY,EAKX;QALD,iBAeC;YAdC,OAAO,aAAA,EACP,iBAAiB,uBAAA,EACjB,gBAAgB,sBAAA,EAChB,eAAe,qBAAA;QAajB,8BAAyB,GAAG,UAAO,IAAI;;;;;wBAC/B,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CACnD,IAAI,CAAC,kBAAkB,CACxB,CAAA;wBAED,qBAAM,WAAW,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAA;;wBAArE,SAAqE,CAAA;;;;aACtE,CAAA;QAjBC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QAEvB,IAAI,CAAC,kBAAkB,GAAG,iBAAiB,CAAA;QAE3C,IAAI,CAAC,iBAAiB,GAAG,gBAAgB,CAAA;QAEzC,IAAI,CAAC,SAAS,GAAG,eAAe,CAAA;QAEhC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,gBAAgB,EAAE,IAAI,CAAC,yBAAyB,CAAC,CAAA;IAC5E,CAAC;IASH,uBAAC;AAAD,CAAC,AAzBD,IAyBC;AAED,kBAAe,gBAAgB,CAAA"}
|