@infrab4a/connect 3.13.6-beta.1 → 3.13.7
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 +39 -1
- package/bundles/infrab4a-connect.umd.js.map +1 -1
- package/domain/catalog/repositories/category.repository.d.ts +2 -0
- package/esm2015/domain/catalog/repositories/category.repository.js +1 -1
- package/esm2015/domain/users/models/user.js +2 -2
- package/esm2015/infra/firebase/firestore/repositories/catalog/category-firestore.repository.js +7 -1
- package/esm2015/infra/hasura-graphql/repositories/catalog/category-hasura-graphql.repository.js +19 -1
- package/fesm2015/infrab4a-connect.js +25 -1
- package/fesm2015/infrab4a-connect.js.map +1 -1
- package/infra/firebase/firestore/repositories/catalog/category-firestore.repository.d.ts +2 -0
- package/infra/hasura-graphql/repositories/catalog/category-hasura-graphql.repository.d.ts +2 -0
- package/package.json +2 -2
|
@@ -1518,7 +1518,7 @@
|
|
|
1518
1518
|
var instance = _super.toInstance.call(this, data);
|
|
1519
1519
|
if (!lodash.isNil(data.firstName))
|
|
1520
1520
|
instance.displayName = "" + data.firstName + (!lodash.isNil(data.lastName) ? " " + data.lastName : '');
|
|
1521
|
-
return;
|
|
1521
|
+
return instance;
|
|
1522
1522
|
};
|
|
1523
1523
|
User.prototype.toPlain = function () {
|
|
1524
1524
|
var plain = _super.prototype.toPlain.call(this);
|
|
@@ -3341,6 +3341,12 @@
|
|
|
3341
3341
|
CategoryFirestoreRepository.prototype.getCategoryByShop = function (shop) {
|
|
3342
3342
|
return;
|
|
3343
3343
|
};
|
|
3344
|
+
CategoryFirestoreRepository.prototype.getChildren = function (parentId) {
|
|
3345
|
+
return;
|
|
3346
|
+
};
|
|
3347
|
+
CategoryFirestoreRepository.prototype.isChild = function (id, parentId) {
|
|
3348
|
+
return;
|
|
3349
|
+
};
|
|
3344
3350
|
return CategoryFirestoreRepository;
|
|
3345
3351
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
3346
3352
|
|
|
@@ -5149,6 +5155,38 @@
|
|
|
5149
5155
|
});
|
|
5150
5156
|
});
|
|
5151
5157
|
};
|
|
5158
|
+
CategoryHasuraGraphQLRepository.prototype.getChildren = function (parentId) {
|
|
5159
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5160
|
+
var category_tree;
|
|
5161
|
+
return __generator(this, function (_c) {
|
|
5162
|
+
switch (_c.label) {
|
|
5163
|
+
case 0: return [4 /*yield*/, this.query('category_tree', ['id', 'name', 'parent_id'], {
|
|
5164
|
+
args: {
|
|
5165
|
+
type: 'category_tree_args',
|
|
5166
|
+
value: { parentid: parentId },
|
|
5167
|
+
required: true,
|
|
5168
|
+
},
|
|
5169
|
+
})];
|
|
5170
|
+
case 1:
|
|
5171
|
+
category_tree = (_c.sent()).category_tree;
|
|
5172
|
+
return [2 /*return*/, category_tree.map(function (c) { return Category.toInstance(c); })];
|
|
5173
|
+
}
|
|
5174
|
+
});
|
|
5175
|
+
});
|
|
5176
|
+
};
|
|
5177
|
+
CategoryHasuraGraphQLRepository.prototype.isChild = function (id, parentId) {
|
|
5178
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5179
|
+
var categoryTree;
|
|
5180
|
+
return __generator(this, function (_c) {
|
|
5181
|
+
switch (_c.label) {
|
|
5182
|
+
case 0: return [4 /*yield*/, this.getChildren(parentId)];
|
|
5183
|
+
case 1:
|
|
5184
|
+
categoryTree = _c.sent();
|
|
5185
|
+
return [2 /*return*/, categoryTree.some(function (c) { return c.id == id.toString(); })];
|
|
5186
|
+
}
|
|
5187
|
+
});
|
|
5188
|
+
});
|
|
5189
|
+
};
|
|
5152
5190
|
return CategoryHasuraGraphQLRepository;
|
|
5153
5191
|
}(withCrudHasuraGraphQL(withHasuraGraphQL(Base))));
|
|
5154
5192
|
|