@infrab4a/connect 3.14.0-beta.0 → 3.14.0-beta.1
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 +38 -0
- 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/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 +24 -0
- 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 +1 -1
|
@@ -3340,6 +3340,12 @@
|
|
|
3340
3340
|
CategoryFirestoreRepository.prototype.getCategoryByShop = function (shop) {
|
|
3341
3341
|
return;
|
|
3342
3342
|
};
|
|
3343
|
+
CategoryFirestoreRepository.prototype.getChildren = function (parentId) {
|
|
3344
|
+
return;
|
|
3345
|
+
};
|
|
3346
|
+
CategoryFirestoreRepository.prototype.isChild = function (id, parentId) {
|
|
3347
|
+
return;
|
|
3348
|
+
};
|
|
3343
3349
|
return CategoryFirestoreRepository;
|
|
3344
3350
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
3345
3351
|
|
|
@@ -5148,6 +5154,38 @@
|
|
|
5148
5154
|
});
|
|
5149
5155
|
});
|
|
5150
5156
|
};
|
|
5157
|
+
CategoryHasuraGraphQLRepository.prototype.getChildren = function (parentId) {
|
|
5158
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5159
|
+
var category_tree;
|
|
5160
|
+
return __generator(this, function (_c) {
|
|
5161
|
+
switch (_c.label) {
|
|
5162
|
+
case 0: return [4 /*yield*/, this.query('category_tree', ['id', 'name', 'parent_id'], {
|
|
5163
|
+
args: {
|
|
5164
|
+
type: 'category_tree_args',
|
|
5165
|
+
value: { parentid: parentId },
|
|
5166
|
+
required: true,
|
|
5167
|
+
},
|
|
5168
|
+
})];
|
|
5169
|
+
case 1:
|
|
5170
|
+
category_tree = (_c.sent()).category_tree;
|
|
5171
|
+
return [2 /*return*/, category_tree.map(function (c) { return Category.toInstance(c); })];
|
|
5172
|
+
}
|
|
5173
|
+
});
|
|
5174
|
+
});
|
|
5175
|
+
};
|
|
5176
|
+
CategoryHasuraGraphQLRepository.prototype.isChild = function (id, parentId) {
|
|
5177
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5178
|
+
var categoryTree;
|
|
5179
|
+
return __generator(this, function (_c) {
|
|
5180
|
+
switch (_c.label) {
|
|
5181
|
+
case 0: return [4 /*yield*/, this.getChildren(parentId)];
|
|
5182
|
+
case 1:
|
|
5183
|
+
categoryTree = _c.sent();
|
|
5184
|
+
return [2 /*return*/, categoryTree.some(function (c) { return c.id == id.toString(); })];
|
|
5185
|
+
}
|
|
5186
|
+
});
|
|
5187
|
+
});
|
|
5188
|
+
};
|
|
5151
5189
|
return CategoryHasuraGraphQLRepository;
|
|
5152
5190
|
}(withCrudHasuraGraphQL(withHasuraGraphQL(Base))));
|
|
5153
5191
|
|