@infrab4a/connect 3.0.0-beta.1 → 3.0.0-beta.3
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 +287 -149
- package/bundles/infrab4a-connect.umd.js.map +1 -1
- package/domain/generic/repository/enums/where.enum.d.ts +1 -0
- package/esm2015/domain/catalog/repositories/product.repository.js +1 -1
- package/esm2015/domain/generic/repository/enums/where.enum.js +2 -1
- package/esm2015/domain/shop-settings/models/home.js +1 -1
- package/esm2015/infra/elasticsearch/indexes/products-index.js +2 -2
- package/esm2015/infra/firebase/firestore/repositories/users/index.js +6 -7
- package/esm2015/infra/firebase/firestore/repositories/users/user-firestore.repository.js +4 -6
- package/esm2015/infra/hasura-graphql/repositories/catalog/category-hasura-graphql.repository.js +59 -3
- package/esm2015/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.js +56 -9
- package/esm2015/infra/hasura-graphql/types/hasura-graphql-fields.type.js +1 -1
- package/fesm2015/infrab4a-connect.js +161 -73
- package/fesm2015/infrab4a-connect.js.map +1 -1
- package/infra/firebase/firestore/repositories/users/index.d.ts +5 -6
- package/infra/firebase/firestore/repositories/users/user-firestore.repository.d.ts +1 -3
- package/infra/hasura-graphql/repositories/catalog/category-hasura-graphql.repository.d.ts +4 -1
- package/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.d.ts +2 -1
- package/infra/hasura-graphql/types/hasura-graphql-fields.type.d.ts +1 -1
- package/package.json +1 -1
- package/esm2015/infra/firebase/firestore/models/user-search.js +0 -7
- package/esm2015/infra/firebase/firestore/repositories/users/user-search-firestore.repository.js +0 -12
- package/infra/firebase/firestore/models/user-search.d.ts +0 -9
- package/infra/firebase/firestore/repositories/users/user-search-firestore.repository.d.ts +0 -9
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './user-firestore.repository';
|
|
1
|
+
export * from './lead-firestore.repository';
|
|
3
2
|
export * from './subscription-edition-firestore.repository';
|
|
4
|
-
export * from './
|
|
3
|
+
export * from './subscription-firestore.repository';
|
|
4
|
+
export * from './subscription-payment-firestore.repository';
|
|
5
5
|
export * from './user-address-firestore.repository';
|
|
6
|
+
export * from './user-beauty-profile-firestore.repository';
|
|
7
|
+
export * from './user-firestore.repository';
|
|
6
8
|
export * from './user-payment-method-firestore.repository';
|
|
7
|
-
export * from './subscription-payment-firestore.repository';
|
|
8
|
-
export * from './lead-firestore.repository';
|
|
9
|
-
export * from './user-search-firestore.repository';
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { DocumentData, FirebaseFirestore, QueryDocumentSnapshot } from '@firebase/firestore-types';
|
|
2
2
|
import { User, UserRepository } from '../../../../../domain';
|
|
3
|
-
import { UserSearchFirestoreRepository } from './user-search-firestore.repository';
|
|
4
3
|
declare const UserFirestoreRepository_base: import("../../../../../utils").MixinCtor<import("@infrab4a/connect").FirestoreRepository<User> & import("../../../../../domain").CrudRepository<User, import("../../../../../domain").CrudParams<User>> & import("@infrab4a/connect").FirestoreHelpers, never>;
|
|
5
4
|
export declare class UserFirestoreRepository extends UserFirestoreRepository_base implements UserRepository {
|
|
6
5
|
readonly firestore: FirebaseFirestore;
|
|
7
|
-
|
|
8
|
-
constructor(firestore: FirebaseFirestore, userSearchFirestoreRepository?: UserSearchFirestoreRepository);
|
|
6
|
+
constructor(firestore: FirebaseFirestore);
|
|
9
7
|
get(identifiers: Partial<User>): Promise<User>;
|
|
10
8
|
checkIfExistsByField(field: string, value: string): Promise<boolean>;
|
|
11
9
|
buildModelInstance(): {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Category, CategoryRepository, GetRepositoryParams, Product, Shops } from '../../../../domain';
|
|
1
|
+
import { Category, CategoryRepository, GetRepositoryParams, Product, Shops, UpdateRepositoryParams } from '../../../../domain';
|
|
2
2
|
import { CategoryHasuraGraphQL } from '../../models';
|
|
3
3
|
import { HasuraGraphQLAuthOptions } from '../../types';
|
|
4
4
|
import { ProductHasuraGraphQLRepository } from './product-hasura-graphql.repository';
|
|
@@ -9,6 +9,7 @@ export declare class CategoryHasuraGraphQLRepository extends CategoryHasuraGraph
|
|
|
9
9
|
private readonly productRepository;
|
|
10
10
|
constructor(endpoint: string, authOptions: HasuraGraphQLAuthOptions, productRepository: ProductHasuraGraphQLRepository);
|
|
11
11
|
get(identifiers: GetRepositoryParams<CategoryHasuraGraphQL>): Promise<CategoryHasuraGraphQL>;
|
|
12
|
+
update(params: UpdateRepositoryParams<CategoryHasuraGraphQL>): Promise<CategoryHasuraGraphQL>;
|
|
12
13
|
getCategoryBySlug(slug: string, shop: Shops): Promise<Category>;
|
|
13
14
|
getCategoriesForHome(categoryIds: string[], limit?: number): Promise<{
|
|
14
15
|
category: Category;
|
|
@@ -18,5 +19,7 @@ export declare class CategoryHasuraGraphQLRepository extends CategoryHasuraGraph
|
|
|
18
19
|
limit?: number;
|
|
19
20
|
hasStock?: boolean;
|
|
20
21
|
}): Promise<Product[]>;
|
|
22
|
+
private getId;
|
|
23
|
+
private updateProducts;
|
|
21
24
|
}
|
|
22
25
|
export {};
|
|
@@ -7,7 +7,7 @@ declare const ProductHasuraGraphQLRepository_base: import("../../../../utils").M
|
|
|
7
7
|
export declare class ProductHasuraGraphQLRepository extends ProductHasuraGraphQLRepository_base implements ProductRepository {
|
|
8
8
|
private get reviewsFields();
|
|
9
9
|
constructor(endpoint: string, authOptions: HasuraGraphQLAuthOptions);
|
|
10
|
-
create(
|
|
10
|
+
create(params: CreateRepositoryParams<ProductHasuraGraphQL>): Promise<ProductHasuraGraphQL>;
|
|
11
11
|
get(identifiers: GetRepositoryParams<ProductHasuraGraphQL>): Promise<ProductHasuraGraphQL>;
|
|
12
12
|
find(params?: FindRepositoryParams<ProductHasuraGraphQL>): Promise<RepositoryFindResult<ProductHasuraGraphQL>>;
|
|
13
13
|
getBySlug(slug: string): Promise<ProductHasuraGraphQL>;
|
|
@@ -16,6 +16,7 @@ export declare class ProductHasuraGraphQLRepository extends ProductHasuraGraphQL
|
|
|
16
16
|
private updateCategories;
|
|
17
17
|
private updateKitProducts;
|
|
18
18
|
private updateReviews;
|
|
19
|
+
private updateMetadata;
|
|
19
20
|
private getId;
|
|
20
21
|
private findReviewsByProduct;
|
|
21
22
|
private findReview;
|
|
@@ -5,7 +5,7 @@ export declare type ColumnOptions<FieldType, Model, ValueFrom = any> = {
|
|
|
5
5
|
type?: HasuraGraphQLColumnType;
|
|
6
6
|
columnName?: string;
|
|
7
7
|
fields?: HasuraGraphQLFields<FieldType extends any[] ? FieldType[number] : FieldType>;
|
|
8
|
-
foreignKeyColumn?: Partial<Record<NonFunctionAndIdentifierPropertyNames<FieldType extends any[] ? FieldType[number] : FieldType>, NonFunctionAndIdentifierPropertyNames<Model> | string
|
|
8
|
+
foreignKeyColumn?: Partial<Record<NonFunctionAndIdentifierPropertyNames<FieldType extends any[] ? FieldType[number] : FieldType>, NonFunctionAndIdentifierPropertyNames<Model> | (string & {})>> | {};
|
|
9
9
|
from?: (value: ValueFrom | ValueFrom[], data?: any) => FieldType;
|
|
10
10
|
to?: (value: FieldType, instance?: Model) => ValueFrom;
|
|
11
11
|
bindFindFilter?: (sentence: RepositoryFindField<Model, keyof Model>) => Record<string, RepositoryFindField<any, any> | ValueFrom> | RepositoryFindField<any, any> | ValueFrom;
|
package/package.json
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { BaseModel } from '../../../../domain/generic';
|
|
2
|
-
export class UserSearch extends BaseModel {
|
|
3
|
-
static get identifiersFields() {
|
|
4
|
-
return ['id'];
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlci1zZWFyY2guanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jb25uZWN0L3NyYy9pbmZyYS9maXJlYmFzZS9maXJlc3RvcmUvbW9kZWxzL3VzZXItc2VhcmNoLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQXFCLE1BQU0sNEJBQTRCLENBQUE7QUFFekUsTUFBTSxPQUFPLFVBQVcsU0FBUSxTQUFxQjtJQU9uRCxNQUFNLEtBQUssaUJBQWlCO1FBQzFCLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQTtJQUNmLENBQUM7Q0FDRiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEJhc2VNb2RlbCwgR2VuZXJpY0lkZW50aWZpZXIgfSBmcm9tICcuLi8uLi8uLi8uLi9kb21haW4vZ2VuZXJpYydcblxuZXhwb3J0IGNsYXNzIFVzZXJTZWFyY2ggZXh0ZW5kcyBCYXNlTW9kZWw8VXNlclNlYXJjaD4ge1xuICBpZDogc3RyaW5nXG4gIGNwZj86IHN0cmluZ1xuICBlbWFpbD86IHN0cmluZ1xuICBjcmVhdGVkQXQ6IERhdGVcbiAgY29waWVkQXQ6IERhdGVcblxuICBzdGF0aWMgZ2V0IGlkZW50aWZpZXJzRmllbGRzKCk6IEdlbmVyaWNJZGVudGlmaWVyW10ge1xuICAgIHJldHVybiBbJ2lkJ11cbiAgfVxufVxuIl19
|
package/esm2015/infra/firebase/firestore/repositories/users/user-search-firestore.repository.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Base } from '../../../../../utils';
|
|
2
|
-
import { UserSearch } from '../../models/user-search';
|
|
3
|
-
import { withCrudFirestore, withFirestore, withHelpers } from '../../mixins';
|
|
4
|
-
export class UserSearchFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
5
|
-
constructor(firestore) {
|
|
6
|
-
super();
|
|
7
|
-
this.firestore = firestore;
|
|
8
|
-
this.collectionName = 'userSearch';
|
|
9
|
-
this.model = UserSearch;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
//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IGZyb20gJy4uLy4uLy4uLy4uLy4uL2RvbWFpbidcbmltcG9ydCB7IFVzZXJTZWFyY2ggfSBmcm9tICcuLi8uLi9tb2RlbHMvdXNlci1zZWFyY2gnXG5pbXBvcnQgeyB3aXRoQ3J1ZEZpcmVzdG9yZSwgd2l0aEZpcmVzdG9yZSwgd2l0aEhlbHBlcnMgfSBmcm9tICcuLi8uLi9taXhpbnMnXG5cbmV4cG9ydCBjbGFzcyBVc2VyU2VhcmNoRmlyZXN0b3JlUmVwb3NpdG9yeVxuICBleHRlbmRzIHdpdGhDcnVkRmlyZXN0b3JlKHdpdGhIZWxwZXJzKHdpdGhGaXJlc3RvcmU8VXNlclNlYXJjaD4oQmFzZSkpKVxuICBpbXBsZW1lbnRzIENydWRSZXBvc2l0b3J5PFVzZXJTZWFyY2g+XG57XG4gIGNvbnN0cnVjdG9yKHJlYWRvbmx5IGZpcmVzdG9yZTogRmlyZWJhc2VGaXJlc3RvcmUpIHtcbiAgICBzdXBlcigpXG4gICAgdGhpcy5jb2xsZWN0aW9uTmFtZSA9ICd1c2VyU2VhcmNoJ1xuICAgIHRoaXMubW9kZWwgPSBVc2VyU2VhcmNoXG4gIH1cbn1cbiJdfQ==
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { BaseModel, GenericIdentifier } from '../../../../domain/generic';
|
|
2
|
-
export declare class UserSearch extends BaseModel<UserSearch> {
|
|
3
|
-
id: string;
|
|
4
|
-
cpf?: string;
|
|
5
|
-
email?: string;
|
|
6
|
-
createdAt: Date;
|
|
7
|
-
copiedAt: Date;
|
|
8
|
-
static get identifiersFields(): GenericIdentifier[];
|
|
9
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { FirebaseFirestore } from '@firebase/firestore-types';
|
|
2
|
-
import { CrudRepository } from '../../../../../domain';
|
|
3
|
-
import { UserSearch } from '../../models/user-search';
|
|
4
|
-
declare const UserSearchFirestoreRepository_base: import("../../../../../utils").MixinCtor<import("@infrab4a/connect").FirestoreRepository<UserSearch> & CrudRepository<UserSearch, import("../../../../../domain").CrudParams<UserSearch>> & import("@infrab4a/connect").FirestoreHelpers, never>;
|
|
5
|
-
export declare class UserSearchFirestoreRepository extends UserSearchFirestoreRepository_base implements CrudRepository<UserSearch> {
|
|
6
|
-
readonly firestore: FirebaseFirestore;
|
|
7
|
-
constructor(firestore: FirebaseFirestore);
|
|
8
|
-
}
|
|
9
|
-
export {};
|