@infrab4a/connect 1.0.0-beta.17 → 1.0.0-beta.19
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/bundles/infrab4a-connect.umd.js +76 -115
- package/bundles/infrab4a-connect.umd.js.map +1 -1
- package/esm2015/infra/firebase/auth/authentication-firebase-auth.service.js +2 -2
- package/esm2015/infra/firebase/auth/register-firebase-auth.service.js +1 -1
- package/esm2015/infra/hasura-graphql/mixins/helpers/graphql-field.helper.js +4 -6
- package/esm2015/infra/hasura-graphql/mixins/with-create-hasura-graphql.mixin.js +16 -2
- package/esm2015/infra/hasura-graphql/mixins/with-get-hasura-graphql.mixin.js +4 -3
- package/esm2015/infra/hasura-graphql/mixins/with-update-hasura-graphql.mixin.js +3 -3
- package/esm2015/infra/hasura-graphql/repositories/catalog/category-hasura-graphql.repository.js +4 -3
- package/esm2015/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.js +10 -8
- package/esm2015/infra/index.js +1 -2
- package/fesm2015/infrab4a-connect.js +36 -58
- package/fesm2015/infrab4a-connect.js.map +1 -1
- package/infra/firebase/auth/authentication-firebase-auth.service.d.ts +1 -1
- package/infra/firebase/auth/register-firebase-auth.service.d.ts +1 -1
- package/infra/hasura-graphql/mixins/with-get-hasura-graphql.mixin.d.ts +2 -2
- package/infra/index.d.ts +0 -1
- package/package.json +1 -1
- package/esm2015/infra/millenium/index.js +0 -2
- package/esm2015/infra/millenium/millenium.js +0 -42
- package/infra/millenium/index.d.ts +0 -1
- package/infra/millenium/millenium.d.ts +0 -25
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('reflect-metadata'), require('class-transformer'), require('date-fns'), require('lodash'), require('ts-md5'), require('axios'), require('firebase'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@infrab4a/connect', ['exports', 'reflect-metadata', 'class-transformer', 'date-fns', 'lodash', 'ts-md5', 'axios', 'firebase', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.infrab4a = global.infrab4a || {}, global.infrab4a.connect = {}), null, global["class-transformer"], global["date-fns"], global.lodash, global
|
|
5
|
-
})(this, (function (exports, reflectMetadata, classTransformer, dateFns, lodash, tsMd5, axios, firebase,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('reflect-metadata'), require('class-transformer'), require('date-fns'), require('lodash'), require('ts-md5'), require('axios'), require('firebase'), require('gql-query-builder'), require('node-fetch')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@infrab4a/connect', ['exports', 'reflect-metadata', 'class-transformer', 'date-fns', 'lodash', 'ts-md5', 'axios', 'firebase', 'gql-query-builder', 'node-fetch'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.infrab4a = global.infrab4a || {}, global.infrab4a.connect = {}), null, global["class-transformer"], global["date-fns"], global.lodash, global["ts-md5"], global.axios, global.firebase, global["gql-query-builder"], global["node-fetch"]));
|
|
5
|
+
})(this, (function (exports, reflectMetadata, classTransformer, dateFns, lodash, tsMd5, axios, firebase, gqlQueryBuilder, fetch) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
9
9
|
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
10
10
|
var firebase__default = /*#__PURE__*/_interopDefaultLegacy(firebase);
|
|
11
|
-
var firebase__default$1 = /*#__PURE__*/_interopDefaultLegacy(firebase$1);
|
|
12
11
|
var fetch__default = /*#__PURE__*/_interopDefaultLegacy(fetch);
|
|
13
12
|
|
|
14
13
|
var BaseModel = /** @class */ (function () {
|
|
@@ -2707,7 +2706,7 @@
|
|
|
2707
2706
|
var credentials, user;
|
|
2708
2707
|
return __generator(this, function (_a) {
|
|
2709
2708
|
switch (_a.label) {
|
|
2710
|
-
case 0: return [4 /*yield*/, this.firebaseAuth.signInWithPopup(new firebase__default
|
|
2709
|
+
case 0: return [4 /*yield*/, this.firebaseAuth.signInWithPopup(new firebase__default["default"].auth.GoogleAuthProvider())];
|
|
2711
2710
|
case 1:
|
|
2712
2711
|
credentials = _a.sent();
|
|
2713
2712
|
user = credentials.user;
|
|
@@ -2864,9 +2863,7 @@
|
|
|
2864
2863
|
if (update === void 0) { update = false; }
|
|
2865
2864
|
var _a;
|
|
2866
2865
|
var data = ((_a = instance.toPlain) === null || _a === void 0 ? void 0 : _a.call(instance)) || instance;
|
|
2867
|
-
return Object.keys(data)
|
|
2868
|
-
.filter(function (key) { return !lodash.isNil(data[key]); })
|
|
2869
|
-
.reduce(function (result, attributeName) {
|
|
2866
|
+
return Object.keys(data).reduce(function (result, attributeName) {
|
|
2870
2867
|
var _b, _c, _d;
|
|
2871
2868
|
var _e = AttributeOptionHelper.FindByAttribute(attributeName, fields), columnName = _e.columnName, attributeFields = _e.fields, foreignKeyColumn = _e.foreignKeyColumn, to = _e.to, bindPersistData = _e.bindPersistData;
|
|
2872
2869
|
if (bindPersistData)
|
|
@@ -2875,10 +2872,11 @@
|
|
|
2875
2872
|
return result;
|
|
2876
2873
|
if (!!foreignKeyColumn &&
|
|
2877
2874
|
!lodash.isEmpty(foreignKeyColumn) &&
|
|
2878
|
-
!Object.keys(foreignKeyColumn).filter(function (key) { return !data[attributeName][key]; }).length)
|
|
2875
|
+
!Object.keys(foreignKeyColumn).filter(function (key) { var _a; return !((_a = data[attributeName]) === null || _a === void 0 ? void 0 : _a[key]); }).length)
|
|
2879
2876
|
return Object.keys(foreignKeyColumn).reduce(function (object, current) {
|
|
2880
2877
|
var _b;
|
|
2881
|
-
|
|
2878
|
+
var _a;
|
|
2879
|
+
return (Object.assign(Object.assign({}, object), (_b = {}, _b[foreignKeyColumn[current]] = (_a = data[attributeName]) === null || _a === void 0 ? void 0 : _a[current], _b)));
|
|
2882
2880
|
}, Object.assign({}, result));
|
|
2883
2881
|
if (update && lodash.isObject(data[attributeName]) && !lodash.isNil(attributeFields) && !lodash.isDate(data[attributeName]))
|
|
2884
2882
|
return result;
|
|
@@ -2948,13 +2946,28 @@
|
|
|
2948
2946
|
};
|
|
2949
2947
|
CreateHasuraGraphQLMixin.prototype.save = function (data) {
|
|
2950
2948
|
return __awaiter(this, void 0, void 0, function () {
|
|
2951
|
-
var result;
|
|
2949
|
+
var primaryKeyColumns, foreignKeyColumns, result;
|
|
2952
2950
|
var _this = this;
|
|
2953
2951
|
return __generator(this, function (_a) {
|
|
2954
2952
|
switch (_a.label) {
|
|
2955
|
-
case 0:
|
|
2956
|
-
|
|
2957
|
-
|
|
2953
|
+
case 0:
|
|
2954
|
+
primaryKeyColumns = this.model.identifiersFields.map(function (field) { return AttributeOptionHelper.FindByAttribute(field, _this.fields).columnName; });
|
|
2955
|
+
foreignKeyColumns = this.fields
|
|
2956
|
+
.map(function (field) {
|
|
2957
|
+
var _a;
|
|
2958
|
+
var columnOptions = Object.values(field).shift();
|
|
2959
|
+
return (AttributeOptionHelper.CheckIsColumnOption(columnOptions) &&
|
|
2960
|
+
columnOptions.foreignKeyColumn && __spreadArray(__spreadArray([], __read(Object.values(columnOptions.foreignKeyColumn))), [
|
|
2961
|
+
(_a = {},
|
|
2962
|
+
_a[columnOptions.columnName] = Object.keys(columnOptions.foreignKeyColumn),
|
|
2963
|
+
_a),
|
|
2964
|
+
]));
|
|
2965
|
+
})
|
|
2966
|
+
.filter(Boolean)
|
|
2967
|
+
.reduce(function (keys, current) { return __spreadArray(__spreadArray([], __read(keys)), __read(current)); }, []);
|
|
2968
|
+
return [4 /*yield*/, this.mutation(this.insertGraphQLOperation, __spreadArray(__spreadArray([], __read(primaryKeyColumns)), __read(foreignKeyColumns)), {
|
|
2969
|
+
object: { type: this.insertGraphQLObjectType, required: true, value: this.convertDataToHasura(data) },
|
|
2970
|
+
})];
|
|
2958
2971
|
case 1:
|
|
2959
2972
|
result = _a.sent();
|
|
2960
2973
|
return [2 /*return*/, Object.assign(Object.assign({}, data.toPlain()), this.convertDataFromHasura(result[this.insertGraphQLOperation]).toPlain())];
|
|
@@ -3135,7 +3148,7 @@
|
|
|
3135
3148
|
return options.toPlain();
|
|
3136
3149
|
if (lodash.isNil(options.action))
|
|
3137
3150
|
return options;
|
|
3138
|
-
if (
|
|
3151
|
+
if ([exports.UpdateOptionActions.REMOVE_FIELD.toString(), exports.UpdateOptionActions.NULL.toString()].includes(options.action))
|
|
3139
3152
|
return null;
|
|
3140
3153
|
return options.value;
|
|
3141
3154
|
};
|
|
@@ -3183,7 +3196,7 @@
|
|
|
3183
3196
|
return params.toPlain();
|
|
3184
3197
|
return Object.keys(params).reduce(function (data, currentKey) {
|
|
3185
3198
|
var _b;
|
|
3186
|
-
return (Object.assign(Object.assign({}, data), (params[currentKey] && (_b = {}, _b[currentKey] = getValueByAction(params[currentKey]), _b))));
|
|
3199
|
+
return (Object.assign(Object.assign({}, data), (params[currentKey] !== undefined && (_b = {}, _b[currentKey] = getValueByAction(params[currentKey]), _b))));
|
|
3187
3200
|
}, {});
|
|
3188
3201
|
};
|
|
3189
3202
|
UpdateHasuraGraphQLMixin.prototype.getUpdateModelKeys = function (data) {
|
|
@@ -3221,24 +3234,25 @@
|
|
|
3221
3234
|
return __awaiter(this, void 0, void 0, function () {
|
|
3222
3235
|
var instance, result, data;
|
|
3223
3236
|
var _this = this;
|
|
3224
|
-
return __generator(this, function (
|
|
3225
|
-
switch (
|
|
3237
|
+
return __generator(this, function (_b) {
|
|
3238
|
+
switch (_b.label) {
|
|
3226
3239
|
case 0:
|
|
3227
3240
|
instance = this.model.toInstance(identifiers);
|
|
3228
3241
|
return [4 /*yield*/, this.query(this.getGraphQLOperation, this.fields, this.model.identifiersFields.reduce(function (ids, identifier) {
|
|
3242
|
+
var _b;
|
|
3229
3243
|
var _a;
|
|
3230
3244
|
if (lodash.isNil(instance[identifier]))
|
|
3231
3245
|
return ids;
|
|
3232
3246
|
var columnOption = AttributeOptionHelper.FindByAttribute(identifier, _this.fields);
|
|
3233
|
-
var value = columnOption.to(identifiers[identifier.toString()], instance);
|
|
3234
|
-
return Object.assign(Object.assign({}, ids), (
|
|
3247
|
+
var value = ((_a = columnOption === null || columnOption === void 0 ? void 0 : columnOption.to) === null || _a === void 0 ? void 0 : _a.call(columnOption, identifiers[identifier.toString()], instance)) || identifiers[identifier.toString()];
|
|
3248
|
+
return Object.assign(Object.assign({}, ids), (_b = {}, _b[columnOption.columnName] = {
|
|
3235
3249
|
type: _this.getAttributeGraphQLTypeOf(columnOption.type || value),
|
|
3236
3250
|
value: value,
|
|
3237
3251
|
required: true,
|
|
3238
|
-
},
|
|
3252
|
+
}, _b));
|
|
3239
3253
|
}, {}))];
|
|
3240
3254
|
case 1:
|
|
3241
|
-
result =
|
|
3255
|
+
result = _b.sent();
|
|
3242
3256
|
data = result[this.getGraphQLOperation];
|
|
3243
3257
|
if (lodash.isNil(data))
|
|
3244
3258
|
throw new NotFoundError(instance.constructor.name + " not found");
|
|
@@ -3464,11 +3478,12 @@
|
|
|
3464
3478
|
conditions: {
|
|
3465
3479
|
columnName: 'tag_condition',
|
|
3466
3480
|
type: HasuraGraphQLColumnType.Jsonb,
|
|
3467
|
-
from: function (tags, row) { return ({ brand: row.brand_condition, tags: tags }); },
|
|
3481
|
+
from: function (tags, row) { return ({ brand: row.brand_condition, tags: Array.isArray(tags) ? tags : [] }); },
|
|
3468
3482
|
bindPersistData: function (value) {
|
|
3483
|
+
var _a, _b;
|
|
3469
3484
|
return {
|
|
3470
3485
|
brand_condition: value.brand,
|
|
3471
|
-
tag_condition: "{\"" + value.tags.join('","') + "\"}",
|
|
3486
|
+
tag_condition: "{\"" + (((_b = (_a = value === null || value === void 0 ? void 0 : value.tags) === null || _a === void 0 ? void 0 : _a.join) === null || _b === void 0 ? void 0 : _b.call(_a, '","')) || '') + "\"}",
|
|
3472
3487
|
};
|
|
3473
3488
|
},
|
|
3474
3489
|
bindFindFilter: function (sentence) {
|
|
@@ -3500,34 +3515,34 @@
|
|
|
3500
3515
|
});
|
|
3501
3516
|
var _a;
|
|
3502
3517
|
return __awaiter(this, void 0, void 0, function () {
|
|
3503
|
-
var
|
|
3504
|
-
return __generator(this, function (
|
|
3505
|
-
switch (
|
|
3518
|
+
var _c;
|
|
3519
|
+
return __generator(this, function (_d) {
|
|
3520
|
+
switch (_d.label) {
|
|
3506
3521
|
case 0:
|
|
3507
3522
|
if (!Number.isNaN(+identifiers.id)) return [3 /*break*/, 2];
|
|
3508
3523
|
return [4 /*yield*/, this.find({ filters: { firestoreId: identifiers.id } })];
|
|
3509
3524
|
case 1:
|
|
3510
|
-
|
|
3525
|
+
_c = (_a = (_d.sent()).data) === null || _a === void 0 ? void 0 : _a[0];
|
|
3511
3526
|
return [3 /*break*/, 3];
|
|
3512
3527
|
case 2:
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
case 3: return [2 /*return*/,
|
|
3528
|
+
_c = _super.get.call(this, identifiers);
|
|
3529
|
+
_d.label = 3;
|
|
3530
|
+
case 3: return [2 /*return*/, _c];
|
|
3516
3531
|
}
|
|
3517
3532
|
});
|
|
3518
3533
|
});
|
|
3519
3534
|
};
|
|
3520
3535
|
CategoryHasuraGraphQLRepository.prototype.getCategoryBySlug = function (slug, shop) {
|
|
3521
3536
|
return __awaiter(this, void 0, void 0, function () {
|
|
3522
|
-
var
|
|
3523
|
-
return __generator(this, function (
|
|
3524
|
-
switch (
|
|
3537
|
+
var _c, data, count;
|
|
3538
|
+
return __generator(this, function (_d) {
|
|
3539
|
+
switch (_d.label) {
|
|
3525
3540
|
case 0:
|
|
3526
3541
|
if (!slug)
|
|
3527
3542
|
return [2 /*return*/];
|
|
3528
3543
|
return [4 /*yield*/, this.find({ filters: { slug: slug, shop: shop, published: true } })];
|
|
3529
3544
|
case 1:
|
|
3530
|
-
|
|
3545
|
+
_c = _d.sent(), data = _c.data, count = _c.count;
|
|
3531
3546
|
if (count > 1)
|
|
3532
3547
|
throw new DuplicatedResultsError('Query returned duplicated values');
|
|
3533
3548
|
if (!count)
|
|
@@ -3540,33 +3555,33 @@
|
|
|
3540
3555
|
CategoryHasuraGraphQLRepository.prototype.getCategoriesForHome = function (categoryIds, limit) {
|
|
3541
3556
|
if (limit === void 0) { limit = 4; }
|
|
3542
3557
|
return __awaiter(this, void 0, void 0, function () {
|
|
3543
|
-
var
|
|
3558
|
+
var _c, categories, count, homeSections;
|
|
3544
3559
|
var _this = this;
|
|
3545
|
-
return __generator(this, function (
|
|
3546
|
-
switch (
|
|
3560
|
+
return __generator(this, function (_d) {
|
|
3561
|
+
switch (_d.label) {
|
|
3547
3562
|
case 0: return [4 /*yield*/, this.find({
|
|
3548
3563
|
filters: { firestoreId: { operator: exports.Where.IN, value: categoryIds.filter(Boolean) }, published: true },
|
|
3549
3564
|
})];
|
|
3550
3565
|
case 1:
|
|
3551
|
-
|
|
3566
|
+
_c = _d.sent(), categories = _c.data, count = _c.count;
|
|
3552
3567
|
if (!count)
|
|
3553
3568
|
throw new NotFoundError('Categories not found');
|
|
3554
3569
|
return [4 /*yield*/, Promise.all(categories.map(function (category) { return __awaiter(_this, void 0, void 0, function () {
|
|
3555
|
-
var
|
|
3556
|
-
return __generator(this, function (
|
|
3557
|
-
switch (
|
|
3570
|
+
var _c;
|
|
3571
|
+
return __generator(this, function (_d) {
|
|
3572
|
+
switch (_d.label) {
|
|
3558
3573
|
case 0:
|
|
3559
|
-
|
|
3574
|
+
_c = {
|
|
3560
3575
|
category: category
|
|
3561
3576
|
};
|
|
3562
3577
|
return [4 /*yield*/, this.mountCategory(category, { limit: limit, hasStock: true })];
|
|
3563
|
-
case 1: return [2 /*return*/, (
|
|
3564
|
-
|
|
3578
|
+
case 1: return [2 /*return*/, (_c.products = _d.sent(),
|
|
3579
|
+
_c)];
|
|
3565
3580
|
}
|
|
3566
3581
|
});
|
|
3567
3582
|
}); }))];
|
|
3568
3583
|
case 2:
|
|
3569
|
-
homeSections =
|
|
3584
|
+
homeSections = _d.sent();
|
|
3570
3585
|
return [2 /*return*/, homeSections];
|
|
3571
3586
|
}
|
|
3572
3587
|
});
|
|
@@ -3575,17 +3590,17 @@
|
|
|
3575
3590
|
CategoryHasuraGraphQLRepository.prototype.mountCategory = function (category, options) {
|
|
3576
3591
|
return __awaiter(this, void 0, void 0, function () {
|
|
3577
3592
|
var products, publishedField, productsData;
|
|
3578
|
-
var
|
|
3579
|
-
return __generator(this, function (
|
|
3580
|
-
switch (
|
|
3593
|
+
var _c;
|
|
3594
|
+
return __generator(this, function (_d) {
|
|
3595
|
+
switch (_d.label) {
|
|
3581
3596
|
case 0:
|
|
3582
3597
|
if (!category.products)
|
|
3583
3598
|
throw new RequiredArgumentError(['Category products is empty']);
|
|
3584
3599
|
products = [];
|
|
3585
3600
|
publishedField = category.shop === exports.Shops.GLAMSHOP ? 'publishedGlam' : 'published';
|
|
3586
|
-
return [4 /*yield*/, this.productRepository.find(Object.assign({ filters: Object.assign((
|
|
3601
|
+
return [4 /*yield*/, this.productRepository.find(Object.assign({ filters: Object.assign((_c = { id: { operator: exports.Where.IN, value: category.products } }, _c[publishedField] = true, _c), ((options === null || options === void 0 ? void 0 : options.hasStock) ? { stock: { quantity: { operator: exports.Where.GT, value: 0 } } } : {})) }, ((options === null || options === void 0 ? void 0 : options.limit) ? { limits: { limit: options === null || options === void 0 ? void 0 : options.limit } } : {})))];
|
|
3587
3602
|
case 1:
|
|
3588
|
-
productsData = (
|
|
3603
|
+
productsData = (_d.sent()).data;
|
|
3589
3604
|
products.push.apply(products, __spreadArray([], __read(productsData)));
|
|
3590
3605
|
return [2 /*return*/, products];
|
|
3591
3606
|
}
|
|
@@ -3618,8 +3633,8 @@
|
|
|
3618
3633
|
},
|
|
3619
3634
|
},
|
|
3620
3635
|
{ hasVariants: { columnName: 'has_variants' } },
|
|
3621
|
-
{ images: { columnName: 'images', to: function (value) { return "{\"" + value.join("\",\"") + "\"}"; } } },
|
|
3622
|
-
{ miniatures: { columnName: 'miniatures', to: function (value) { return "{\"" + value.join("\",\"") + "\"}"; } } },
|
|
3636
|
+
{ images: { columnName: 'images', to: function (value) { var _a; return "{\"" + (((_a = value === null || value === void 0 ? void 0 : value.join) === null || _a === void 0 ? void 0 : _a.call(value, "\",\"")) || '') + "\"}"; } } },
|
|
3637
|
+
{ miniatures: { columnName: 'miniatures', to: function (value) { var _a; return "{\"" + (((_a = value === null || value === void 0 ? void 0 : value.join) === null || _a === void 0 ? void 0 : _a.call(value, "\",\"")) || '') + "\"}"; } } },
|
|
3623
3638
|
'name',
|
|
3624
3639
|
{
|
|
3625
3640
|
price: {
|
|
@@ -3635,15 +3650,17 @@
|
|
|
3635
3650
|
}, {}); },
|
|
3636
3651
|
bindFindFilter: function (sentence) {
|
|
3637
3652
|
var filters = Object.values(sentence).shift();
|
|
3638
|
-
return Object.assign(Object.assign(Object.assign(Object.assign({}, ((filters === null || filters === void 0 ? void 0 : filters.price) && { price: filters.price })), (filters.fullPrice && { full_price: filters.fullPrice })), (filters.subscriberDiscountPercentage && {
|
|
3653
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({}, (((filters === null || filters === void 0 ? void 0 : filters.price) || (filters === null || filters === void 0 ? void 0 : filters.price) === 0) && { price: filters.price })), ((filters.fullPrice || filters.fullPrice === 0) && { full_price: filters.fullPrice })), ((filters.subscriberDiscountPercentage || filters.subscriberDiscountPercentage === 0) && {
|
|
3639
3654
|
subscriber_discount_percentage: filters.subscriberDiscountPercentage,
|
|
3640
|
-
})), (filters.subscriberPrice
|
|
3655
|
+
})), ((filters.subscriberPrice || filters.subscriberPrice === 0) && {
|
|
3656
|
+
subscriber_price: filters.subscriberPrice,
|
|
3657
|
+
}));
|
|
3641
3658
|
},
|
|
3642
3659
|
bindPersistData: function (value) {
|
|
3643
3660
|
var priceData = Object.values(value).shift();
|
|
3644
|
-
return Object.assign(Object.assign(Object.assign(Object.assign({}, ((priceData === null || priceData === void 0 ? void 0 : priceData.price) && { price: priceData.price })), (priceData.fullPrice && { full_price: priceData.fullPrice })), (priceData.subscriberDiscountPercentage && {
|
|
3661
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({}, ((priceData === null || priceData === void 0 ? void 0 : priceData.price) >= 0 && { price: priceData.price })), (priceData.fullPrice >= 0 && { full_price: priceData.fullPrice })), (priceData.subscriberDiscountPercentage >= 0 && {
|
|
3645
3662
|
subscriber_discount_percentage: priceData.subscriberDiscountPercentage,
|
|
3646
|
-
})), (priceData.subscriberPrice && { subscriber_price: priceData.subscriberPrice }));
|
|
3663
|
+
})), (priceData.subscriberPrice >= 0 && { subscriber_price: priceData.subscriberPrice }));
|
|
3647
3664
|
},
|
|
3648
3665
|
},
|
|
3649
3666
|
},
|
|
@@ -3845,7 +3862,7 @@
|
|
|
3845
3862
|
type: '[product_kit_insert_input!]',
|
|
3846
3863
|
required: true,
|
|
3847
3864
|
value: plainData.kitProducts.map(function (kitProduct) { return ({
|
|
3848
|
-
kit_product_id: kitProduct.
|
|
3865
|
+
kit_product_id: kitProduct.productId || kitProduct.product.id,
|
|
3849
3866
|
product_id: productId,
|
|
3850
3867
|
quantity: kitProduct.quantity,
|
|
3851
3868
|
}); }),
|
|
@@ -4007,59 +4024,6 @@
|
|
|
4007
4024
|
return VariantHasuraGraphQLRepository;
|
|
4008
4025
|
}(withCrudHasuraGraphQL(withHasuraGraphQL(Base))));
|
|
4009
4026
|
|
|
4010
|
-
var MilleniumProduct = /** @class */ (function (_super) {
|
|
4011
|
-
__extends(MilleniumProduct, _super);
|
|
4012
|
-
function MilleniumProduct() {
|
|
4013
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
4014
|
-
}
|
|
4015
|
-
Object.defineProperty(MilleniumProduct, "identifiersFields", {
|
|
4016
|
-
get: function () {
|
|
4017
|
-
return ['id'];
|
|
4018
|
-
},
|
|
4019
|
-
enumerable: false,
|
|
4020
|
-
configurable: true
|
|
4021
|
-
});
|
|
4022
|
-
return MilleniumProduct;
|
|
4023
|
-
}(BaseModel));
|
|
4024
|
-
__decorate([
|
|
4025
|
-
classTransformer.Type(function () { return Product; }),
|
|
4026
|
-
__metadata("design:type", Product)
|
|
4027
|
-
], MilleniumProduct.prototype, "product", void 0);
|
|
4028
|
-
var MilleniumProductHasuraGraphQL = /** @class */ (function (_super) {
|
|
4029
|
-
__extends(MilleniumProductHasuraGraphQL, _super);
|
|
4030
|
-
function MilleniumProductHasuraGraphQL() {
|
|
4031
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
4032
|
-
}
|
|
4033
|
-
return MilleniumProductHasuraGraphQL;
|
|
4034
|
-
}(MilleniumProduct));
|
|
4035
|
-
__decorate([
|
|
4036
|
-
classTransformer.Type(function () { return ProductHasuraGraphQL; }),
|
|
4037
|
-
__metadata("design:type", ProductHasuraGraphQL)
|
|
4038
|
-
], MilleniumProductHasuraGraphQL.prototype, "product", void 0);
|
|
4039
|
-
var MilleniumProductHasuraGraphQLRepository = /** @class */ (function (_super) {
|
|
4040
|
-
__extends(MilleniumProductHasuraGraphQLRepository, _super);
|
|
4041
|
-
function MilleniumProductHasuraGraphQLRepository(endpoint, authOptions, productRepository) {
|
|
4042
|
-
return _super.call(this, {
|
|
4043
|
-
endpoint: endpoint,
|
|
4044
|
-
authOptions: authOptions,
|
|
4045
|
-
model: MilleniumProduct,
|
|
4046
|
-
tableName: 'product_milleniun',
|
|
4047
|
-
fields: [
|
|
4048
|
-
'id',
|
|
4049
|
-
{ productId: { columnName: 'product_id' } },
|
|
4050
|
-
{ codProduct: { columnName: 'cod_product' } },
|
|
4051
|
-
{ internalId: { columnName: 'internal_id' } },
|
|
4052
|
-
{ createdAt: { columnName: 'created_at' } },
|
|
4053
|
-
{ updatedAt: { columnName: 'updated_at' } },
|
|
4054
|
-
{
|
|
4055
|
-
product: { columnName: 'product', foreignKeyColumn: { id: 'product_id' }, fields: productRepository.fields },
|
|
4056
|
-
},
|
|
4057
|
-
],
|
|
4058
|
-
}) || this;
|
|
4059
|
-
}
|
|
4060
|
-
return MilleniumProductHasuraGraphQLRepository;
|
|
4061
|
-
}(withCrudHasuraGraphQL(withHasuraGraphQL(Base))));
|
|
4062
|
-
|
|
4063
4027
|
/**
|
|
4064
4028
|
* Generated bundle index. Do not edit.
|
|
4065
4029
|
*/
|
|
@@ -4196,9 +4160,6 @@
|
|
|
4196
4160
|
exports.LeadFirestoreRepository = LeadFirestoreRepository;
|
|
4197
4161
|
exports.LegacyOrderFirestoreRepository = LegacyOrderFirestoreRepository;
|
|
4198
4162
|
exports.LineItem = LineItem;
|
|
4199
|
-
exports.MilleniumProduct = MilleniumProduct;
|
|
4200
|
-
exports.MilleniumProductHasuraGraphQL = MilleniumProductHasuraGraphQL;
|
|
4201
|
-
exports.MilleniumProductHasuraGraphQLRepository = MilleniumProductHasuraGraphQLRepository;
|
|
4202
4163
|
exports.NotFoundError = NotFoundError;
|
|
4203
4164
|
exports.Order = Order;
|
|
4204
4165
|
exports.OrderFirestoreRepository = OrderFirestoreRepository;
|