@infrab4a/connect 4.28.2 → 4.29.0-beta.0
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/index.cjs.js +14 -0
- package/index.esm.js +14 -0
- package/package.json +1 -1
- package/src/domain/catalog/repositories/category-filter.repository.d.ts +1 -0
- package/src/infra/firebase/firestore/mixins/with-helpers.mixin.d.ts +1 -1
- package/src/infra/hasura-graphql/repositories/catalog/category-filter-hasura-graphql.repository.d.ts +1 -0
package/index.cjs.js
CHANGED
|
@@ -5520,6 +5520,20 @@ class CategoryFilterHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHa
|
|
|
5520
5520
|
cache,
|
|
5521
5521
|
});
|
|
5522
5522
|
}
|
|
5523
|
+
async addFiltersToCategory(categoryId, filterIds) {
|
|
5524
|
+
await this.mutation('insert_category_filter', ['affected_rows'], {
|
|
5525
|
+
objects: {
|
|
5526
|
+
type: '[category_filter_insert_input!]',
|
|
5527
|
+
required: true,
|
|
5528
|
+
value: filterIds.map((filterId) => ({ category_id: categoryId, filter_id: filterId })),
|
|
5529
|
+
},
|
|
5530
|
+
on_conflict: {
|
|
5531
|
+
type: 'category_filter_on_conflict',
|
|
5532
|
+
required: true,
|
|
5533
|
+
value: { constraint: 'category_filter_category_id_filter_id_key' },
|
|
5534
|
+
},
|
|
5535
|
+
});
|
|
5536
|
+
}
|
|
5523
5537
|
deleteByCategory(categoryId) {
|
|
5524
5538
|
return this.mutation('delete_category_filter', ['affected_rows'], {
|
|
5525
5539
|
where: {
|
package/index.esm.js
CHANGED
|
@@ -5495,6 +5495,20 @@ class CategoryFilterHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHa
|
|
|
5495
5495
|
cache,
|
|
5496
5496
|
});
|
|
5497
5497
|
}
|
|
5498
|
+
async addFiltersToCategory(categoryId, filterIds) {
|
|
5499
|
+
await this.mutation('insert_category_filter', ['affected_rows'], {
|
|
5500
|
+
objects: {
|
|
5501
|
+
type: '[category_filter_insert_input!]',
|
|
5502
|
+
required: true,
|
|
5503
|
+
value: filterIds.map((filterId) => ({ category_id: categoryId, filter_id: filterId })),
|
|
5504
|
+
},
|
|
5505
|
+
on_conflict: {
|
|
5506
|
+
type: 'category_filter_on_conflict',
|
|
5507
|
+
required: true,
|
|
5508
|
+
value: { constraint: 'category_filter_category_id_filter_id_key' },
|
|
5509
|
+
},
|
|
5510
|
+
});
|
|
5511
|
+
}
|
|
5498
5512
|
deleteByCategory(categoryId) {
|
|
5499
5513
|
return this.mutation('delete_category_filter', ['affected_rows'], {
|
|
5500
5514
|
where: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CrudRepository } from '../../generic/repository/crud.repository';
|
|
2
2
|
import { CategoryFilter } from '../models';
|
|
3
3
|
export interface CategoryFilterRepository extends CrudRepository<CategoryFilter> {
|
|
4
|
+
addFiltersToCategory(categoryId: number, filterIds: number[]): Promise<void>;
|
|
4
5
|
deleteByCategoryAndFilter(categoryId: number, filterId: number): Promise<any>;
|
|
5
6
|
deleteByCategory(categoryId: number): Promise<any>;
|
|
6
7
|
}
|
|
@@ -5,7 +5,7 @@ import { FirestoreRepository, FirestoreSubRepository } from '../types';
|
|
|
5
5
|
export declare const withHelpers: <TMixinBase extends MixinCtor<any, any[]> = MixinCtor<any, any[]>>(MixinBase: MixinCtor<any, any[]> & TMixinBase) => {
|
|
6
6
|
new (...args: any[]): {
|
|
7
7
|
[x: string]: any;
|
|
8
|
-
toArray<T extends ModelBaseStructure<T, T["identifiersFields"][number]>>(snapShot: QuerySnapshot<T
|
|
8
|
+
toArray<T extends ModelBaseStructure<T, T["identifiersFields"][number]>>(snapShot: QuerySnapshot<T> | QueryDocumentSnapshot<T>[]): T[];
|
|
9
9
|
isSubCollection<T_1 extends ModelBaseStructure<T_1, T_1["identifiersFields"][number]>, E extends ModelBaseStructure<E, E["identifiersFields"][number]>>(repository: FirestoreRepository<T_1> | FirestoreSubRepository<T_1, E>): repository is FirestoreSubRepository<T_1, E>;
|
|
10
10
|
};
|
|
11
11
|
} & TMixinBase;
|
package/src/infra/hasura-graphql/repositories/catalog/category-filter-hasura-graphql.repository.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ declare const CategoryFilterHasuraGraphQLRepository_base: import("../../../../ut
|
|
|
6
6
|
}, [HasuraConstructorParams<CategoryFilter> & import("../../mixins").CreateConstructorParams & import("../../mixins").DeleteConstructorParams & import("../../mixins").GetConstructorParams & import("../../mixins").UpdateConstructorParams, ...any[]]>;
|
|
7
7
|
export declare class CategoryFilterHasuraGraphQLRepository extends CategoryFilterHasuraGraphQLRepository_base implements CategoryFilterRepository {
|
|
8
8
|
constructor({ endpoint, authOptions, interceptors, cache, }: Pick<HasuraConstructorParams<CategoryFilter>, 'endpoint' | 'authOptions' | 'interceptors' | 'cache'>);
|
|
9
|
+
addFiltersToCategory(categoryId: number, filterIds: number[]): Promise<void>;
|
|
9
10
|
deleteByCategory(categoryId: number): Promise<any>;
|
|
10
11
|
deleteByCategoryAndFilter(categoryId: number, filterId: number): Promise<any>;
|
|
11
12
|
}
|