@things-factory/product-base 5.0.1 → 5.0.11
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-server/constants/index.js +2 -15
- package/dist-server/constants/index.js.map +1 -1
- package/dist-server/constants/product.js.map +1 -1
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/index.js +3 -16
- package/dist-server/index.js.map +1 -1
- package/dist-server/middlewares/index.js.map +1 -1
- package/dist-server/migrations/index.js.map +1 -1
- package/dist-server/service/index.js +17 -30
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/product/index.js.map +1 -1
- package/dist-server/service/product/product-mutation.js +61 -73
- package/dist-server/service/product/product-mutation.js.map +1 -1
- package/dist-server/service/product/product-query.js +78 -89
- package/dist-server/service/product/product-query.js.map +1 -1
- package/dist-server/service/product/product-types.js +261 -272
- package/dist-server/service/product/product-types.js.map +1 -1
- package/dist-server/service/product/product.js +179 -187
- package/dist-server/service/product/product.js.map +1 -1
- package/dist-server/service/product/validate-product.js +2 -4
- package/dist-server/service/product/validate-product.js.map +1 -1
- package/dist-server/service/product-bundle/index.js.map +1 -1
- package/dist-server/service/product-bundle/product-bundle-mutation.js +33 -44
- package/dist-server/service/product-bundle/product-bundle-mutation.js.map +1 -1
- package/dist-server/service/product-bundle/product-bundle-query.js +35 -46
- package/dist-server/service/product-bundle/product-bundle-query.js.map +1 -1
- package/dist-server/service/product-bundle/product-bundle-types.js +30 -38
- package/dist-server/service/product-bundle/product-bundle-types.js.map +1 -1
- package/dist-server/service/product-bundle/product-bundle.js +40 -48
- package/dist-server/service/product-bundle/product-bundle.js.map +1 -1
- package/dist-server/service/product-bundle-setting/index.js.map +1 -1
- package/dist-server/service/product-bundle-setting/product-bundle-setting-mutation.js +27 -38
- package/dist-server/service/product-bundle-setting/product-bundle-setting-mutation.js.map +1 -1
- package/dist-server/service/product-bundle-setting/product-bundle-setting-query.js +14 -25
- package/dist-server/service/product-bundle-setting/product-bundle-setting-query.js.map +1 -1
- package/dist-server/service/product-bundle-setting/product-bundle-setting-types.js +23 -31
- package/dist-server/service/product-bundle-setting/product-bundle-setting-types.js.map +1 -1
- package/dist-server/service/product-bundle-setting/product-bundle-setting.js +16 -24
- package/dist-server/service/product-bundle-setting/product-bundle-setting.js.map +1 -1
- package/dist-server/service/product-combination/index.js.map +1 -1
- package/dist-server/service/product-combination/product-combination-mutation.js +34 -45
- package/dist-server/service/product-combination/product-combination-mutation.js.map +1 -1
- package/dist-server/service/product-combination/product-combination-query.js +29 -40
- package/dist-server/service/product-combination/product-combination-query.js.map +1 -1
- package/dist-server/service/product-combination/product-combination-type.js +28 -36
- package/dist-server/service/product-combination/product-combination-type.js.map +1 -1
- package/dist-server/service/product-combination/product-combination.js +42 -50
- package/dist-server/service/product-combination/product-combination.js.map +1 -1
- package/dist-server/service/product-combination-setting/index.js.map +1 -1
- package/dist-server/service/product-combination-setting/product-combination-setting-mutation.js +40 -51
- package/dist-server/service/product-combination-setting/product-combination-setting-mutation.js.map +1 -1
- package/dist-server/service/product-combination-setting/product-combination-setting-query.js +35 -46
- package/dist-server/service/product-combination-setting/product-combination-setting-query.js.map +1 -1
- package/dist-server/service/product-combination-setting/product-combination-setting-type.js +24 -32
- package/dist-server/service/product-combination-setting/product-combination-setting-type.js.map +1 -1
- package/dist-server/service/product-combination-setting/product-combination-setting.js +36 -44
- package/dist-server/service/product-combination-setting/product-combination-setting.js.map +1 -1
- package/dist-server/service/product-detail/index.js.map +1 -1
- package/dist-server/service/product-detail/product-detail-mutation.js +30 -51
- package/dist-server/service/product-detail/product-detail-mutation.js.map +1 -1
- package/dist-server/service/product-detail/product-detail-query.js +33 -44
- package/dist-server/service/product-detail/product-detail-query.js.map +1 -1
- package/dist-server/service/product-detail/product-detail-types.js +180 -188
- package/dist-server/service/product-detail/product-detail-types.js.map +1 -1
- package/dist-server/service/product-detail/product-detail.js +127 -135
- package/dist-server/service/product-detail/product-detail.js.map +1 -1
- package/dist-server/service/product-detail-bizplace-setting/index.js.map +1 -1
- package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-mutation.js +28 -39
- package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-mutation.js.map +1 -1
- package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-query.js +29 -40
- package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-query.js.map +1 -1
- package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-types.js +36 -44
- package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-types.js.map +1 -1
- package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting.js +32 -40
- package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting.js.map +1 -1
- package/dist-server/service/product-set/index.js.map +1 -1
- package/dist-server/service/product-set/product-set-mutation.js +33 -44
- package/dist-server/service/product-set/product-set-mutation.js.map +1 -1
- package/dist-server/service/product-set/product-set-query.js +35 -46
- package/dist-server/service/product-set/product-set-query.js.map +1 -1
- package/dist-server/service/product-set/product-set-types.js +26 -34
- package/dist-server/service/product-set/product-set-types.js.map +1 -1
- package/dist-server/service/product-set/product-set.js +34 -42
- package/dist-server/service/product-set/product-set.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/dist-server/utils/index.js +2 -15
- package/dist-server/utils/index.js.map +1 -1
- package/dist-server/utils/product-util.js.map +1 -1
- package/package.json +4 -4
- package/server/service/product/product-mutation.ts +2 -0
- package/server/service/product/product-query.ts +1 -1
- package/server/service/product/product.ts +2 -2
|
@@ -1,19 +1,8 @@
|
|
|
1
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 __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
2
|
var _a, _b, _c, _d;
|
|
15
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
4
|
exports.ProductQuery = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
17
6
|
const type_graphql_1 = require("type-graphql");
|
|
18
7
|
const typeorm_1 = require("typeorm");
|
|
19
8
|
const attachment_base_1 = require("@things-factory/attachment-base");
|
|
@@ -52,7 +41,7 @@ let ProductQuery = class ProductQuery {
|
|
|
52
41
|
async products(params, context) {
|
|
53
42
|
var _a;
|
|
54
43
|
const { domain, user } = context.state;
|
|
55
|
-
const { domains } = user;
|
|
44
|
+
const { domains } = user; /* TODO clarify this */
|
|
56
45
|
let bizplaces;
|
|
57
46
|
if (!params.filters.find((filter) => filter.name === 'bizplace_id')) {
|
|
58
47
|
const warehouseDomain = domain;
|
|
@@ -220,115 +209,115 @@ let ProductQuery = class ProductQuery {
|
|
|
220
209
|
return items[0].warehouseId || null;
|
|
221
210
|
}
|
|
222
211
|
};
|
|
223
|
-
__decorate([
|
|
212
|
+
tslib_1.__decorate([
|
|
224
213
|
(0, type_graphql_1.Directive)('@privilege(category: "order", privilege: "query")'),
|
|
225
214
|
(0, type_graphql_1.Query)(returns => product_1.Product),
|
|
226
|
-
__param(0, (0, type_graphql_1.Arg)('sku')),
|
|
227
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
228
|
-
__metadata("design:type", Function),
|
|
229
|
-
__metadata("design:paramtypes", [String, Object]),
|
|
230
|
-
__metadata("design:returntype", Promise)
|
|
215
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('sku')),
|
|
216
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
217
|
+
tslib_1.__metadata("design:type", Function),
|
|
218
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
219
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
231
220
|
], ProductQuery.prototype, "product", null);
|
|
232
|
-
__decorate([
|
|
221
|
+
tslib_1.__decorate([
|
|
233
222
|
(0, type_graphql_1.Directive)('@privilege(category: "order", privilege: "query")'),
|
|
234
223
|
(0, type_graphql_1.Query)(returns => product_types_1.ProductList),
|
|
235
|
-
__param(0, (0, type_graphql_1.Args)()),
|
|
236
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
237
|
-
__metadata("design:type", Function),
|
|
238
|
-
__metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
|
|
239
|
-
__metadata("design:returntype", Promise)
|
|
224
|
+
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
|
225
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
226
|
+
tslib_1.__metadata("design:type", Function),
|
|
227
|
+
tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
|
|
228
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
240
229
|
], ProductQuery.prototype, "products", null);
|
|
241
|
-
__decorate([
|
|
230
|
+
tslib_1.__decorate([
|
|
242
231
|
(0, type_graphql_1.Directive)('@privilege(category: "order", privilege: "query")'),
|
|
243
232
|
(0, type_graphql_1.Query)(returns => product_types_1.ProductList),
|
|
244
|
-
__param(0, (0, type_graphql_1.Args)()),
|
|
245
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
246
|
-
__metadata("design:type", Function),
|
|
247
|
-
__metadata("design:paramtypes", [typeof (_b = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _b : Object, Object]),
|
|
248
|
-
__metadata("design:returntype", Promise)
|
|
233
|
+
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
|
234
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
235
|
+
tslib_1.__metadata("design:type", Function),
|
|
236
|
+
tslib_1.__metadata("design:paramtypes", [typeof (_b = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _b : Object, Object]),
|
|
237
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
249
238
|
], ProductQuery.prototype, "myBizplaceProducts", null);
|
|
250
|
-
__decorate([
|
|
239
|
+
tslib_1.__decorate([
|
|
251
240
|
(0, type_graphql_1.Directive)('@privilege(category: "order", privilege: "query")'),
|
|
252
241
|
(0, type_graphql_1.Query)(returns => product_types_1.ProductList),
|
|
253
|
-
__param(0, (0, type_graphql_1.Args)()),
|
|
254
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
255
|
-
__metadata("design:type", Function),
|
|
256
|
-
__metadata("design:paramtypes", [typeof (_c = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _c : Object, Object]),
|
|
257
|
-
__metadata("design:returntype", Promise)
|
|
242
|
+
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
|
243
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
244
|
+
tslib_1.__metadata("design:type", Function),
|
|
245
|
+
tslib_1.__metadata("design:paramtypes", [typeof (_c = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _c : Object, Object]),
|
|
246
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
258
247
|
], ProductQuery.prototype, "productsByBizplace", null);
|
|
259
|
-
__decorate([
|
|
248
|
+
tslib_1.__decorate([
|
|
260
249
|
(0, type_graphql_1.Directive)('@privilege(category: "order", privilege: "query")'),
|
|
261
250
|
(0, type_graphql_1.Query)(returns => product_types_1.ProductList),
|
|
262
|
-
__param(0, (0, type_graphql_1.Args)()),
|
|
263
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
264
|
-
__metadata("design:type", Function),
|
|
265
|
-
__metadata("design:paramtypes", [typeof (_d = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _d : Object, Object]),
|
|
266
|
-
__metadata("design:returntype", Promise)
|
|
251
|
+
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
|
252
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
253
|
+
tslib_1.__metadata("design:type", Function),
|
|
254
|
+
tslib_1.__metadata("design:paramtypes", [typeof (_d = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _d : Object, Object]),
|
|
255
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
267
256
|
], ProductQuery.prototype, "pureProductsByBizplace", null);
|
|
268
|
-
__decorate([
|
|
257
|
+
tslib_1.__decorate([
|
|
269
258
|
(0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
|
|
270
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
271
|
-
__metadata("design:type", Function),
|
|
272
|
-
__metadata("design:paramtypes", [product_1.Product]),
|
|
273
|
-
__metadata("design:returntype", Promise)
|
|
259
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
260
|
+
tslib_1.__metadata("design:type", Function),
|
|
261
|
+
tslib_1.__metadata("design:paramtypes", [product_1.Product]),
|
|
262
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
274
263
|
], ProductQuery.prototype, "domain", null);
|
|
275
|
-
__decorate([
|
|
264
|
+
tslib_1.__decorate([
|
|
276
265
|
(0, type_graphql_1.FieldResolver)(type => biz_base_1.Bizplace),
|
|
277
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
278
|
-
__metadata("design:type", Function),
|
|
279
|
-
__metadata("design:paramtypes", [product_1.Product]),
|
|
280
|
-
__metadata("design:returntype", Promise)
|
|
266
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
267
|
+
tslib_1.__metadata("design:type", Function),
|
|
268
|
+
tslib_1.__metadata("design:paramtypes", [product_1.Product]),
|
|
269
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
281
270
|
], ProductQuery.prototype, "bizplace", null);
|
|
282
|
-
__decorate([
|
|
271
|
+
tslib_1.__decorate([
|
|
283
272
|
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
284
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
285
|
-
__metadata("design:type", Function),
|
|
286
|
-
__metadata("design:paramtypes", [product_1.Product]),
|
|
287
|
-
__metadata("design:returntype", Promise)
|
|
273
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
274
|
+
tslib_1.__metadata("design:type", Function),
|
|
275
|
+
tslib_1.__metadata("design:paramtypes", [product_1.Product]),
|
|
276
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
288
277
|
], ProductQuery.prototype, "creator", null);
|
|
289
|
-
__decorate([
|
|
278
|
+
tslib_1.__decorate([
|
|
290
279
|
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
291
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
292
|
-
__metadata("design:type", Function),
|
|
293
|
-
__metadata("design:paramtypes", [product_1.Product]),
|
|
294
|
-
__metadata("design:returntype", Promise)
|
|
280
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
281
|
+
tslib_1.__metadata("design:type", Function),
|
|
282
|
+
tslib_1.__metadata("design:paramtypes", [product_1.Product]),
|
|
283
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
295
284
|
], ProductQuery.prototype, "updater", null);
|
|
296
|
-
__decorate([
|
|
285
|
+
tslib_1.__decorate([
|
|
297
286
|
(0, type_graphql_1.FieldResolver)(type => product_1.Product),
|
|
298
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
299
|
-
__metadata("design:type", Function),
|
|
300
|
-
__metadata("design:paramtypes", [product_1.Product]),
|
|
301
|
-
__metadata("design:returntype", Promise)
|
|
287
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
288
|
+
tslib_1.__metadata("design:type", Function),
|
|
289
|
+
tslib_1.__metadata("design:paramtypes", [product_1.Product]),
|
|
290
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
302
291
|
], ProductQuery.prototype, "parentProductRef", null);
|
|
303
|
-
__decorate([
|
|
292
|
+
tslib_1.__decorate([
|
|
304
293
|
(0, type_graphql_1.FieldResolver)(type => product_1.Product),
|
|
305
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
306
|
-
__metadata("design:type", Function),
|
|
307
|
-
__metadata("design:paramtypes", [product_1.Product]),
|
|
308
|
-
__metadata("design:returntype", Promise)
|
|
294
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
295
|
+
tslib_1.__metadata("design:type", Function),
|
|
296
|
+
tslib_1.__metadata("design:paramtypes", [product_1.Product]),
|
|
297
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
309
298
|
], ProductQuery.prototype, "productRef", null);
|
|
310
|
-
__decorate([
|
|
299
|
+
tslib_1.__decorate([
|
|
311
300
|
(0, type_graphql_1.FieldResolver)(type => String),
|
|
312
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
313
|
-
__metadata("design:type", Function),
|
|
314
|
-
__metadata("design:paramtypes", [product_1.Product]),
|
|
315
|
-
__metadata("design:returntype", Promise)
|
|
301
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
302
|
+
tslib_1.__metadata("design:type", Function),
|
|
303
|
+
tslib_1.__metadata("design:paramtypes", [product_1.Product]),
|
|
304
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
316
305
|
], ProductQuery.prototype, "thumbnail", null);
|
|
317
|
-
__decorate([
|
|
306
|
+
tslib_1.__decorate([
|
|
318
307
|
(0, type_graphql_1.FieldResolver)(type => String),
|
|
319
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
320
|
-
__metadata("design:type", Function),
|
|
321
|
-
__metadata("design:paramtypes", [product_1.Product]),
|
|
322
|
-
__metadata("design:returntype", String)
|
|
308
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
309
|
+
tslib_1.__metadata("design:type", Function),
|
|
310
|
+
tslib_1.__metadata("design:paramtypes", [product_1.Product]),
|
|
311
|
+
tslib_1.__metadata("design:returntype", String)
|
|
323
312
|
], ProductQuery.prototype, "productInformation", null);
|
|
324
|
-
__decorate([
|
|
313
|
+
tslib_1.__decorate([
|
|
325
314
|
(0, type_graphql_1.FieldResolver)(type => String, { nullable: true }),
|
|
326
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
327
|
-
__metadata("design:type", Function),
|
|
328
|
-
__metadata("design:paramtypes", [product_1.Product]),
|
|
329
|
-
__metadata("design:returntype", Promise)
|
|
315
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
316
|
+
tslib_1.__metadata("design:type", Function),
|
|
317
|
+
tslib_1.__metadata("design:paramtypes", [product_1.Product]),
|
|
318
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
330
319
|
], ProductQuery.prototype, "warehouseId", null);
|
|
331
|
-
ProductQuery = __decorate([
|
|
320
|
+
ProductQuery = tslib_1.__decorate([
|
|
332
321
|
(0, type_graphql_1.Resolver)(product_1.Product)
|
|
333
322
|
], ProductQuery);
|
|
334
323
|
exports.ProductQuery = ProductQuery;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-query.js","sourceRoot":"","sources":["../../../server/service/product/product-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA8F;AAC9F,qCAAyE;AAEzE,qEAA4D;AAC5D,yDAAgD;AAChD,uDAOiC;AACjC,iDAAqF;AAErF,qEAAgE;AAChE,uCAAmC;AACn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AC,EAAE,CAAC,CAAA;IACnF,IAAI,cAAc,EAAE;QAClB,EAAE,CAAC,QAAQ,CACT,IAAI,kBAAQ,CAAC,GAAG,CAAC,EAAE;YACjB,oBAAoB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;gBACpC,MAAM,SAAS,GAAG,IAAA,sBAAc,EAC9B,EAAE,CAAC,KAAK,EACR,MAAM,EACN,cAAc,CAAC,QAAQ,EACvB,cAAc,CAAC,KAAK,EACpB,cAAc,CAAC,QAAQ,EACvB,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC,CAAC,MAAM,CACvC,CAAA;gBAED,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,UAAU,CAAC,CAAA;YACrD,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CACH,CAAA;KACF;IAED,OAAO,EAAE,CAAA;AACX,CAAC"}
|
|
1
|
+
{"version":3,"file":"product-query.js","sourceRoot":"","sources":["../../../server/service/product/product-query.ts"],"names":[],"mappings":";;;;;AAAA,+CAA8F;AAC9F,qCAAyE;AAEzE,qEAA4D;AAC5D,yDAAgD;AAChD,uDAOiC;AACjC,iDAAqF;AAErF,qEAAgE;AAChE,uCAAmC;AACnC,mDAA6C;AAE7C,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,qCAAqC,CAAC,CAAA;AAGrE,IAAa,YAAY,GAAzB,MAAa,YAAY;IAGvB,KAAK,CAAC,OAAO,CAAa,GAAW,EAAS,OAAY;;QACxD,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAmC,OAAO,CAAC,KAAK,CAAA;QAEtE,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,0CAAE,QAAQ,EAAE;YAC5B,OAAO,MAAM,IAAA,uBAAa,EAAC,iBAAO,CAAC,CAAC,OAAO,CAAC;gBAC1C,KAAK,EAAE;oBACL,MAAM,EAAE,MAAM;oB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AC,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,UAAU,CAAC,CAAA;YACrD,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CACH,CAAA;KACF;IAED,OAAO,EAAE,CAAA;AACX,CAAC","sourcesContent":["import { Arg, Args, Ctx, Directive, FieldResolver, Query, Resolver, Root } from 'type-graphql'\nimport { Brackets, getRepository, In, SelectQueryBuilder } from 'typeorm'\n\nimport { Attachment } from '@things-factory/attachment-base'\nimport { User } from '@things-factory/auth-base'\nimport {\n Bizplace,\n getCompaniesBizplaces,\n getCompanyBizplace,\n getMyBizplace,\n getPartnersCompanyBizplaces,\n getPermittedBizplaceIds\n} from '@things-factory/biz-base'\nimport { buildCondition, buildQuery, Domain, ListParam } from '@things-factory/shell'\n\nimport { ProductDetail } from '../product-detail/product-detail'\nimport { Product } from './product'\nimport { ProductList } from './product-types'\n\nconst debug = require('debug')('things-factory:product-base:product')\n\n@Resolver(Product)\nexport class ProductQuery {\n @Directive('@privilege(category: \"order\", privilege: \"query\")')\n @Query(returns => Product)\n async product(@Arg('sku') sku: string, @Ctx() context: any): Promise<Product> {\n const { domain, user }: { domain: Domain; user: User } = context.state\n\n if (context?.state?.bizplace) {\n return await getRepository(Product).findOne({\n where: {\n domain: domain,\n sku,\n bizplace: context.state.bizplace\n },\n relations: ['domain', 'bizplace', 'productRef', 'creator', 'updater']\n })\n } else {\n return await getRepository(Product).findOne({\n where: {\n domain: domain,\n sku,\n bizplace: In(await getPermittedBizplaceIds(domain, user))\n },\n relations: ['domain', 'bizplace', 'productRef', 'creator', 'updater']\n })\n }\n }\n\n @Directive('@privilege(category: \"order\", privilege: \"query\")')\n @Query(returns => ProductList)\n async products(@Args() params: ListParam, @Ctx() context: any): Promise<ProductList> {\n const { domain, user }: { domain: Domain; user: User } = context.state\n const { domains }: { domains: Domain[] } = user as any /* TODO clarify this */\n let bizplaces: Bizplace[]\n\n if (!params.filters.find((filter: any) => filter.name === 'bizplace_id')) {\n const warehouseDomain: Domain = domain\n const companiesBizplaces: Bizplace[] = await getCompaniesBizplaces(domains, warehouseDomain)\n const partnersCompanyBizplaces: Bizplace[] = await getPartnersCompanyBizplaces(domain, user)\n\n bizplaces = [...companiesBizplaces, ...partnersCompanyBizplaces]\n } else {\n const bizplaceId: string[] = params.filters.filter(param => param.name == 'bizplace_id').map(item => item.value)\n\n const foundBizplace: Bizplace = await getRepository(Bizplace).findOne({\n where: { id: bizplaceId[0] },\n relations: ['company', 'company.domain']\n })\n\n if (foundBizplace) {\n const companyDomain: Domain = foundBizplace.company?.domain\n const companyBizplace: Bizplace = await getRepository(Bizplace).findOne({ where: { domain: companyDomain } })\n\n bizplaces = [companyBizplace, foundBizplace]\n }\n }\n\n const qb: SelectQueryBuilder<Product> = buildCustomConditions(params, context, bizplaces)\n\n let [items, total] = await qb\n .leftJoinAndSelect('Product.productDetails', 'ProductDetails')\n .leftJoinAndSelect('ProductDetails.childProductDetail', 'ChildProductDetail')\n .getManyAndCount()\n\n return { items, total }\n }\n\n @Directive('@privilege(category: \"order\", privilege: \"query\")')\n @Query(returns => ProductList)\n async myBizplaceProducts(@Args() params: ListParam, @Ctx() context: any): Promise<ProductList> {\n const { domain, user }: { domain: Domain; user: User } = context.state\n const bizplaceFilter = params.filters.find(filter => filter.name === 'bizplace_id')\n\n let bizplaces: Bizplace[] = []\n if (!bizplaceFilter) {\n bizplaces.push(await getRepository(Bizplace).findOne({ where: { domain } }))\n }\n\n const qb: SelectQueryBuilder<Product> = buildCustomConditions(params, context, bizplaces)\n\n let [items, total] = await qb\n .leftJoinAndSelect('Product.productDetails', 'ProductDetails')\n .leftJoinAndSelect('Product.routing', 'Routing')\n .getManyAndCount()\n\n items = items.map(itm => {\n let defaultProductDetail = itm.productDetails.find(itm => itm.isDefault)\n return {\n ...itm,\n ...new ProductDetail(defaultProductDetail, true)\n }\n })\n\n return { items, total }\n }\n\n @Directive('@privilege(category: \"order\", privilege: \"query\")')\n @Query(returns => ProductList)\n async productsByBizplace(@Args() params: ListParam, @Ctx() context: any): Promise<ProductList> {\n const { domain, user }: { domain: Domain; user: User } = context.state\n const bizplaceFilter = params.filters.find(x => x.name == 'bizplace')\n\n try {\n let bizplaces: Bizplace[]\n if (!bizplaceFilter || bizplaceFilter.value == '') {\n bizplaces = [await getMyBizplace(domain, user), await getCompanyBizplace(domain, user)]\n } else {\n let myBizplace: Bizplace = await getRepository(Bizplace).findOne(bizplaceFilter.value, {\n relations: ['company', 'company.domain']\n })\n\n bizplaces = [\n myBizplace,\n await getRepository(Bizplace).findOne({\n where: { domain: myBizplace.company.domain }\n })\n ]\n }\n\n const qb: SelectQueryBuilder<Product> = buildCustomConditions(params, context, bizplaces)\n\n let [items, total] = await qb.leftJoinAndSelect('Product.productDetails', 'ProductDetails').getManyAndCount()\n\n items = items.map(itm => {\n let defaultProductDetail = itm.productDetails?.find(itm => itm.isDefault)\n return {\n ...itm,\n ...new ProductDetail(defaultProductDetail, true)\n }\n })\n\n return { items, total }\n } catch (error) {\n throw error\n }\n }\n\n /**\n * @description this resolver was specially made to return huge products data\n * without dropping off performance due to typegraphql limitations\n * @returns pure product data only. there will be no other table joined to avoid\n * ORM lagging issue (converting to object extremely withdraws the performance)\n * */\n @Directive('@privilege(category: \"order\", privilege: \"query\")')\n @Query(returns => ProductList)\n async pureProductsByBizplace(@Args() params: ListParam, @Ctx() context: any): Promise<ProductList> {\n const { domain, user }: { domain: Domain; user: User } = context.state\n const bizplaceFilter = params.filters.find(x => x.name == 'bizplace')\n\n try {\n let bizplaces: Bizplace[]\n if (!bizplaceFilter || bizplaceFilter.value == '') {\n bizplaces = [await getMyBizplace(domain, user), await getCompanyBizplace(domain, user)]\n } else {\n let myBizplace: Bizplace = await getRepository(Bizplace).findOne(bizplaceFilter.value, {\n relations: ['company', 'company.domain']\n })\n\n bizplaces = [\n myBizplace,\n await getRepository(Bizplace).findOne({\n where: { domain: myBizplace.company.domain }\n })\n ]\n }\n\n const qb: SelectQueryBuilder<Product> = buildCustomConditions(params, context, bizplaces)\n let items = await qb.getRawMany()\n let total = await qb.getCount()\n\n return { items: items.map(item => new Product(item)), total }\n } catch (error) {\n throw error\n }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() product: Product): Promise<Domain> {\n if (product.domainId) return await getRepository(Domain).findOne(product.domainId)\n else return null\n }\n\n @FieldResolver(type => Bizplace)\n async bizplace(@Root() product: Product): Promise<Bizplace> {\n if (product.bizplaceId) return await getRepository(Bizplace).findOne(product.bizplaceId)\n else return null\n }\n\n @FieldResolver(type => User)\n async creator(@Root() product: Product): Promise<User> {\n if (product.creatorId) return await getRepository(User).findOne(product.creatorId)\n else return null\n }\n\n @FieldResolver(type => User)\n async updater(@Root() product: Product): Promise<User> {\n if (product.updaterId) return await getRepository(User).findOne(product.updaterId)\n else return null\n }\n\n @FieldResolver(type => Product)\n async parentProductRef(@Root() product: Product): Promise<Product> {\n if (product.parentProductRefId) return await getRepository(Product).findOne(product.parentProductRefId)\n else return null\n }\n\n @FieldResolver(type => Product)\n async productRef(@Root() product: Product): Promise<Product> {\n if (product.productRefId) return await getRepository(Product).findOne(product.productRefId)\n else return null\n }\n\n @FieldResolver(type => String)\n async thumbnail(@Root() product: Product): Promise<string | undefined> {\n const attachment: Attachment = await getRepository(Attachment).findOne({\n where: {\n domain: product.domainId,\n refBy: product.id\n }\n })\n\n return attachment?.fullpath\n }\n\n @FieldResolver(type => String)\n productInformation(@Root() product: Product): String {\n return `[${product.sku}] ${product.name}${product.description ? ` - ${product.description}` : ''}`\n }\n\n @FieldResolver(type => String, { nullable: true })\n async warehouseId(@Root() product: Product): Promise<String | undefined> {\n if (!product.warehouseName) return null\n\n const items = await getRepository(Product).query(`\n SELECT w.id as \"warehouseId\" FROM products p LEFT JOIN warehouses w ON p.warehouse_name = w.name and w.domain_id = p.domain_id WHERE p.id = '${product.id}'\n `)\n\n return items[0].warehouseId || null\n }\n}\n\nfunction buildCustomConditions(params, context, bizplaces): SelectQueryBuilder<Product> {\n const deletedFilter = params.filters.find(x => x.name == 'deleted')\n const productFilters = params.filters.find(x => x.name == 'product_info')\n const productFilterColumns = ['sku', 'brandSku', 'name', 'description', 'brand', 'subBrand']\n\n try {\n params.filters = [\n ...params.filters.filter(x => ['product_info', 'bizplace', 'bizplace_id', 'deleted'].indexOf(x.name) == -1),\n { name: 'deletedAt', operator: deletedFilter?.value ? 'is_not_null' : 'is_null' },\n { name: 'bizplace_id', operator: 'in', value: bizplaces.map(bizplace => bizplace.id) }\n ]\n } catch (err) {\n // error with no bizplace.\n debug('[WARN] params.filters', err.message)\n }\n\n const qb: SelectQueryBuilder<Product> = getRepository(Product).createQueryBuilder()\n\n buildQuery(qb, params, context, { domainRef: false, searchables: ['sku', 'name'] })\n if (productFilters) {\n qb.andWhere(\n new Brackets(qb2 => {\n productFilterColumns.forEach(filter => {\n const condition = buildCondition(\n qb.alias,\n filter,\n productFilters.operator,\n productFilters.value,\n productFilters.relation,\n Object.keys(qb.getParameters()).length\n )\n\n qb2.orWhere(condition.clause, condition.parameters)\n })\n })\n )\n }\n\n return qb\n}\n"]}
|