@infrab4a/connect 4.0.2-beta.10 → 4.0.2-beta.11
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 +8264 -0
- package/package.json +3 -4
- package/src/domain/catalog/models/category-collection-children.d.ts +1 -1
- package/src/domain/catalog/models/category-filter.d.ts +1 -1
- package/src/domain/catalog/models/kit-product.d.ts +1 -1
- package/src/domain/catalog/models/types/category-condition.type.d.ts +1 -1
- package/src/domain/catalog/models/types/category-metadata.type.d.ts +1 -1
- package/src/domain/catalog/models/types/category-product.d.ts +1 -1
- package/src/domain/catalog/models/types/product-evaluation.type.d.ts +1 -1
- package/src/domain/catalog/models/types/product-gender.type.d.ts +1 -1
- package/src/domain/catalog/models/types/product-metadata.type.d.ts +1 -1
- package/src/domain/catalog/models/types/product-review.type.d.ts +1 -1
- package/src/domain/catalog/models/types/shop-description.type.d.ts +1 -1
- package/src/domain/catalog/models/types/shop-price.type.d.ts +1 -1
- package/src/domain/catalog/models/types/stock.type.d.ts +1 -1
- package/src/domain/catalog/models/types/variant-grade.type.d.ts +1 -1
- package/src/domain/catalog/models/variant.d.ts +1 -1
- package/src/domain/catalog/repositories/product.repository.d.ts +2 -2
- package/src/domain/generic/model/base.model.d.ts +1 -1
- package/src/domain/generic/model/types/identifier-model.type.d.ts +3 -3
- package/src/domain/generic/model/types/model-base-structure.type.d.ts +2 -2
- package/src/domain/generic/model/types/non-function-properties.type.d.ts +6 -6
- package/src/domain/generic/model/types/non-function-property-name.type.d.ts +5 -5
- package/src/domain/generic/repository/create.repository.d.ts +1 -1
- package/src/domain/generic/repository/crud.repository.d.ts +2 -2
- package/src/domain/generic/repository/delete.repository.d.ts +1 -1
- package/src/domain/generic/repository/find.repository.d.ts +1 -1
- package/src/domain/generic/repository/get.repository.d.ts +1 -1
- package/src/domain/generic/repository/read.repository.d.ts +2 -2
- package/src/domain/generic/repository/types/repository-find-filters.type.d.ts +4 -4
- package/src/domain/generic/repository/types/repository-find-result.type.d.ts +2 -2
- package/src/domain/generic/repository/types/repository-limit-options.type.d.ts +1 -1
- package/src/domain/generic/repository/types/repository-order-by-list.type.d.ts +2 -2
- package/src/domain/generic/repository/types/repository-update-params.type.d.ts +3 -3
- package/src/domain/generic/repository/types/where-options.type.d.ts +1 -1
- package/src/domain/generic/repository/update.repository.d.ts +1 -1
- package/src/domain/location/models/types/location-bound.type.d.ts +1 -1
- package/src/domain/location/models/types/location-geometry.type.d.ts +1 -1
- package/src/domain/location/models/types/location-lat-lng.type.d.ts +1 -1
- package/src/domain/shop-settings/helpers/beauty-questions.helper.d.ts +1 -1
- package/src/domain/shop-settings/models/types/banner.type.d.ts +1 -1
- package/src/domain/shop-settings/models/types/benefit.type.d.ts +1 -1
- package/src/domain/shop-settings/models/types/home-data.type.d.ts +3 -3
- package/src/domain/shop-settings/models/types/menu-nav.type.d.ts +1 -1
- package/src/domain/shop-settings/models/types/shop-section.type.d.ts +1 -1
- package/src/domain/shop-settings/models/types/sub-menu.type.d.ts +2 -2
- package/src/domain/shopping/models/types/payment-address.type.d.ts +1 -1
- package/src/domain/shopping/models/types/payment-billing.type.d.ts +1 -1
- package/src/domain/shopping/models/types/payment-card.type.d.ts +1 -1
- package/src/domain/shopping/models/types/payment-customer.type.d.ts +1 -1
- package/src/domain/shopping/models/types/payment-document.type.d.ts +1 -1
- package/src/domain/shopping/models/types/payment-item.type.d.ts +1 -1
- package/src/domain/shopping/models/types/payment-shipping.type.d.ts +1 -1
- package/src/domain/users/models/beauty-profile.d.ts +1 -1
- package/src/domain/users/models/subscription/edition.d.ts +1 -1
- package/src/domain/users/models/subscription/payment.d.ts +1 -1
- package/src/domain/users/models/user-address.d.ts +1 -1
- package/src/domain/users/models/user-payment-method.d.ts +1 -1
- package/src/domain/users/services/authentication.service.d.ts +1 -1
- package/src/domain/users/services/register.service.d.ts +1 -1
- package/src/domain/users/services/types/basic-user-data.type.d.ts +1 -1
- package/src/domain/users/use-cases/authentication.d.ts +2 -2
- package/src/domain/users/use-cases/register.d.ts +1 -1
- package/src/infra/elasticsearch/adapters/axios.adapter.d.ts +1 -1
- package/src/infra/elasticsearch/types/elastic-search-result.d.ts +1 -1
- package/src/infra/firebase/auth/types/firebase-user-with-id.type.d.ts +1 -1
- package/src/infra/firebase/firestore/mixins/with-firestore.mixin.d.ts +1 -1
- package/src/infra/firebase/firestore/mixins/with-sub-collection.mixin.d.ts +1 -1
- package/src/infra/firebase/firestore/mixins/with-update-firestore.mixin.d.ts +1 -1
- package/src/infra/firebase/firestore/types/firestore-interceptors.type.d.ts +1 -1
- package/src/infra/firebase/firestore/types/firestore-sub.repository.type.d.ts +1 -1
- package/src/infra/firebase/firestore/types/firestore.repository.type.d.ts +1 -1
- package/src/infra/hasura-graphql/mixins/helpers/attribute-option.helper.d.ts +1 -1
- package/src/infra/hasura-graphql/mixins/with-create-hasura-graphql.mixin.d.ts +1 -1
- package/src/infra/hasura-graphql/mixins/with-delete-hasura-graphql.mixin.d.ts +1 -1
- package/src/infra/hasura-graphql/mixins/with-get-hasura-graphql.mixin.d.ts +1 -1
- package/src/infra/hasura-graphql/mixins/with-hasura-graphql.mixin.d.ts +3 -3
- package/src/infra/hasura-graphql/mixins/with-update-hasura-graphql.mixin.d.ts +2 -2
- package/src/infra/hasura-graphql/types/fields.type.d.ts +1 -1
- package/src/infra/hasura-graphql/types/graphql.repository.type.d.ts +2 -2
- package/src/infra/hasura-graphql/types/hasura-graphql-auth-options.type.d.ts +1 -1
- package/src/infra/hasura-graphql/types/hasura-graphql-fields.type.d.ts +6 -6
- package/src/infra/hasura-graphql/types/hasura-graphql-headers.type.d.ts +1 -1
- package/src/infra/hasura-graphql/types/nested-field.type.d.ts +1 -1
- package/src/infra/hasura-graphql/types/variable-options.type.d.ts +1 -1
- package/src/utils/decorators/trace.method.decorator.d.ts +3 -3
- package/src/utils/helpers/debug-decorator.helper.d.ts +1 -1
- package/src/utils/helpers/debug.helper.d.ts +3 -3
- package/src/utils/helpers/reflect.helper.d.ts +7 -7
- package/src/utils/index.d.ts +1 -1
- package/src/utils/mixins/merge-constructor-params.type.d.ts +2 -2
- package/src/utils/mixins/mixin-ctor.type.d.ts +1 -1
- package/src/utils/types/array-element.type.d.ts +1 -1
- package/src/utils/types/prop.type.d.ts +1 -1
- package/index.esm.js +0 -6127
- /package/{index.esm.d.ts → index.cjs.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infrab4a/connect",
|
|
3
|
-
"version": "4.0.2-beta.
|
|
3
|
+
"version": "4.0.2-beta.11",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org"
|
|
6
6
|
},
|
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
"@types/lodash": "^4.14.191",
|
|
27
27
|
"@types/node-fetch": "^2.6.2"
|
|
28
28
|
},
|
|
29
|
-
"
|
|
30
|
-
"type": "
|
|
31
|
-
"main": "./index.esm.js"
|
|
29
|
+
"main": "./index.cjs.js",
|
|
30
|
+
"type": "commonjs"
|
|
32
31
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseModel } from '../../generic/model';
|
|
2
|
-
export
|
|
2
|
+
export type CategoryCollectionChildrenIdentifiers = 'collectionId' | 'categoryId';
|
|
3
3
|
export declare class CategoryCollectionChildren extends BaseModel<CategoryCollectionChildren, CategoryCollectionChildrenIdentifiers> {
|
|
4
4
|
collectionId: number;
|
|
5
5
|
categoryId: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseModel } from '../../generic/model';
|
|
2
2
|
import { Category } from './category';
|
|
3
3
|
import { Filter } from './filter';
|
|
4
|
-
|
|
4
|
+
type CategoryFilterIdentifiers = 'id' | 'filterId' | 'categoryId';
|
|
5
5
|
export declare class CategoryFilter extends BaseModel<CategoryFilter, CategoryFilterIdentifiers> {
|
|
6
6
|
id: number;
|
|
7
7
|
filterId: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseModel } from '../../generic/model';
|
|
2
2
|
import { ProductForKit } from './product-for-kit';
|
|
3
|
-
|
|
3
|
+
type KitProductIdentifiers = 'productId' | 'kitProductId';
|
|
4
4
|
export declare class KitProduct extends BaseModel<KitProduct, KitProductIdentifiers> {
|
|
5
5
|
productId: string;
|
|
6
6
|
kitProductId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type ProductGender = 'female' | 'male' | 'unisex';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseModel } from '../../generic/model';
|
|
2
2
|
import { ShopPrice, Stock, VariantGrade } from './types';
|
|
3
|
-
export
|
|
3
|
+
export type ProductVariantIdentifiers = 'id' | 'productId';
|
|
4
4
|
export declare class Variant extends BaseModel<Variant, ProductVariantIdentifiers> {
|
|
5
5
|
id: string;
|
|
6
6
|
productId: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FindRepositoryParams, RepositoryFindResult } from '../../generic';
|
|
2
2
|
import { CrudRepository } from '../../generic/repository/crud.repository';
|
|
3
3
|
import { Product, ProductGender, ProductReview } from '../models';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export type ReviewStatusParams = 'pending' | 'approved' | 'rejected';
|
|
5
|
+
export type ReviewWithProductData = ProductReview & {
|
|
6
6
|
productId: string;
|
|
7
7
|
productName: string;
|
|
8
8
|
productSku: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModelBaseStructure, NonFunctionAndIdentifierProperties, NonFunctionAndIdentifierPropertyNames } from './types';
|
|
2
|
-
export
|
|
2
|
+
export type GenericIdentifier<M = {
|
|
3
3
|
id: string;
|
|
4
4
|
}, T = NonFunctionAndIdentifierPropertyNames<M>> = T;
|
|
5
5
|
export declare class BaseModel<Model extends ModelBaseStructure<Model, Identifiers>, Identifiers = GenericIdentifier> implements ModelBaseStructure<Model, Identifiers> {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PropType } from '../../../../utils';
|
|
2
2
|
import { ModelBaseStructure } from './model-base-structure.type';
|
|
3
3
|
import { NonFunctionAndIdentifierPropertyNames } from './non-function-property-name.type';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export type IdentifierModel<Model extends ModelBaseStructure> = Extract<NonFunctionAndIdentifierPropertyNames<Model>, PropType<Model, 'identifiersFields'>[number]>;
|
|
5
|
+
export type IdentifiersModel<Model extends ModelBaseStructure> = {
|
|
6
6
|
[K in IdentifierModel<Model>]: Model[K];
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type PartialIdentifiersModel<Model extends ModelBaseStructure> = Partial<IdentifiersModel<Model>>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { NonFunctionAndIdentifierPropertyNames } from '..';
|
|
2
|
-
|
|
2
|
+
type ModelBaseStructureRecord = Record<string, any> & {
|
|
3
3
|
identifiersFields: any[];
|
|
4
4
|
};
|
|
5
|
-
export
|
|
5
|
+
export type ModelBaseStructure<M extends ModelBaseStructureRecord = ModelBaseStructureRecord, I = M['identifiersFields'][number]> = {
|
|
6
6
|
identifier: {
|
|
7
7
|
[key in Extract<NonFunctionAndIdentifierPropertyNames<M>, I>]: M[key];
|
|
8
8
|
};
|
|
@@ -2,11 +2,11 @@ import { PropType } from '../../../../utils';
|
|
|
2
2
|
import { IdentifierModel, PartialIdentifiersModel } from './identifier-model.type';
|
|
3
3
|
import { ModelBaseStructure } from './model-base-structure.type';
|
|
4
4
|
import { NonFunctionAndIdentifierPropertyNames, NonFunctionPropertyNames } from './non-function-property-name.type';
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
5
|
+
export type NonFunctionProperties<T> = Pick<Partial<T>, NonFunctionPropertyNames<T>>;
|
|
6
|
+
export type NonFunctionAndIdentifierProperties<T> = Pick<Partial<T>, NonFunctionAndIdentifierPropertyNames<T>>;
|
|
7
|
+
export type NonFunctionAndIdentifierPropertiesWithNoPartial<T> = Pick<T, NonFunctionAndIdentifierPropertyNames<T>>;
|
|
8
|
+
export type NonFunctionAndIdentifierPropertiesWithNoModels<T> = {
|
|
9
9
|
[key in keyof NonFunctionAndIdentifierPropertiesWithNoPartial<T>]: PropType<T, key> extends ModelBaseStructure ? NonFunctionAndIdentifierPropertiesWithNoIdentifiers<PropType<T, key>> & PartialIdentifiersModel<PropType<T, key>> : PropType<T, key> extends ModelBaseStructure[] ? PropType<T, key>[] : PropType<T, key>;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
12
|
-
export
|
|
11
|
+
export type NonFunctionAndIdentifierPropertiesWithNoIdentifiers<T> = Omit<NonFunctionAndIdentifierPropertiesWithNoModels<T>, T extends ModelBaseStructure ? IdentifierModel<T> : never>;
|
|
12
|
+
export type NonFunctionAndIdentifierPropertiesWithPartialIdentifiers<T> = NonFunctionAndIdentifierPropertiesWithNoIdentifiers<T> & (T extends ModelBaseStructure ? PartialIdentifiersModel<T> : never);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type IfEquals<X, Y, A = X, B = never> = (<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y ? 1 : 2 ? A : B;
|
|
2
|
+
export type ReadonlyKeys<T> = {
|
|
3
3
|
[P in keyof T]-?: IfEquals<{
|
|
4
4
|
[Q in P]: T[P];
|
|
5
5
|
}, {
|
|
6
6
|
-readonly [Q in P]: T[P];
|
|
7
7
|
}, never, P>;
|
|
8
8
|
}[keyof T];
|
|
9
|
-
export
|
|
10
|
-
export
|
|
9
|
+
export type WritableKeys<T> = Exclude<keyof T, ReadonlyKeys<T>>;
|
|
10
|
+
export type NonFunctionPropertyNames<T, P = T, E extends WritableKeys<P> = WritableKeys<P>> = {
|
|
11
11
|
[K in E]: P[K] extends Function ? never : K extends 'identifiersFields' ? never : K;
|
|
12
12
|
}[E];
|
|
13
|
-
export
|
|
13
|
+
export type NonFunctionAndIdentifierPropertyNames<T> = NonFunctionPropertyNames<Omit<T, 'identifier' | 'identifiersFields'>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropType } from '../../../utils';
|
|
2
2
|
import { ModelBaseStructure, NonFunctionAndIdentifierProperties, PartialIdentifiersModel } from '../model/types';
|
|
3
|
-
export
|
|
3
|
+
export type CreateRepositoryParams<Model extends ModelBaseStructure> = {
|
|
4
4
|
[key in keyof NonFunctionAndIdentifierProperties<Model>]: PropType<Model, key> extends ModelBaseStructure ? CreateRepositoryParams<PropType<Model, key>> : PropType<Model, key>;
|
|
5
5
|
} & PartialIdentifiersModel<Model>;
|
|
6
6
|
export interface CreateRepository<Model extends ModelBaseStructure, Params = CreateRepositoryParams<Model>> {
|
|
@@ -3,13 +3,13 @@ import { CreateRepository, CreateRepositoryParams } from './create.repository';
|
|
|
3
3
|
import { DeleteRepository, DeleteRepositoryParams } from './delete.repository';
|
|
4
4
|
import { ReadRepository, ReadRepositoryParams } from './read.repository';
|
|
5
5
|
import { UpdateRepository, UpdateRepositoryParams } from './update.repository';
|
|
6
|
-
export
|
|
6
|
+
export type CrudGenericParams = {
|
|
7
7
|
Create?: any;
|
|
8
8
|
Delete?: any;
|
|
9
9
|
Read?: ReadRepositoryParams<any>;
|
|
10
10
|
Update?: any;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type CrudParams<Model extends ModelBaseStructure> = {
|
|
13
13
|
Create?: CreateRepositoryParams<Model>;
|
|
14
14
|
Delete?: DeleteRepositoryParams<Model>;
|
|
15
15
|
Read?: ReadRepositoryParams<Model>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IdentifiersModel, ModelBaseStructure } from '../model/types';
|
|
2
|
-
export
|
|
2
|
+
export type DeleteRepositoryParams<Model extends ModelBaseStructure> = {
|
|
3
3
|
[K in keyof IdentifiersModel<Model>]: Model[K] | null;
|
|
4
4
|
};
|
|
5
5
|
export interface DeleteRepository<Model extends ModelBaseStructure, Params = DeleteRepositoryParams<Model>> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModelBaseStructure, NonFunctionAndIdentifierPropertyNames, NonFunctionPropertyNames } from '../model/types';
|
|
2
2
|
import { RepositoryFindFielters, RepositoryFindResult, RepositoryLimitOptions, RepositoryOrderBy } from './types';
|
|
3
|
-
export
|
|
3
|
+
export type FindRepositoryParams<Model extends ModelBaseStructure> = {
|
|
4
4
|
filters?: RepositoryFindFielters<Model>;
|
|
5
5
|
fields?: NonFunctionPropertyNames<Model>[];
|
|
6
6
|
limits?: RepositoryLimitOptions<Model>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IdentifiersModel, ModelBaseStructure } from '../model/types';
|
|
2
|
-
export
|
|
2
|
+
export type GetRepositoryParams<Model extends ModelBaseStructure> = IdentifiersModel<Model>;
|
|
3
3
|
export interface GetRepository<Model extends ModelBaseStructure, Params = GetRepositoryParams<Model>> {
|
|
4
4
|
get(identifiers: Params): Promise<Model>;
|
|
5
5
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ModelBaseStructure } from '../model/types';
|
|
2
2
|
import { FindRepository, FindRepositoryParams } from './find.repository';
|
|
3
3
|
import { GetRepository, GetRepositoryParams } from './get.repository';
|
|
4
|
-
|
|
4
|
+
type ReadGenericRepository = {
|
|
5
5
|
Find?: any;
|
|
6
6
|
Get?: any;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type ReadRepositoryParams<Model extends ModelBaseStructure> = {
|
|
9
9
|
Find?: FindRepositoryParams<Model>;
|
|
10
10
|
Get?: GetRepositoryParams<Model>;
|
|
11
11
|
};
|
|
@@ -2,12 +2,12 @@ import { PropType } from '../../../../utils';
|
|
|
2
2
|
import { ModelBaseStructure } from '../../model';
|
|
3
3
|
import { NonFunctionAndIdentifierPropertyNames } from '../../model/types/non-function-property-name.type';
|
|
4
4
|
import { Where } from '../enums/where.enum';
|
|
5
|
-
export
|
|
5
|
+
export type RepositoryFindFieltersOptions<Model, FieldName extends keyof Model> = {
|
|
6
6
|
operator: Where;
|
|
7
7
|
value?: PropType<Model, FieldName> | PropType<Model, FieldName>[];
|
|
8
8
|
};
|
|
9
|
-
export
|
|
10
|
-
export
|
|
9
|
+
export type RepositoryFindField<Model, FieldName extends keyof Model> = RepositoryFindFieltersOptions<Model, FieldName> | RepositoryFindFieltersOptions<Model, FieldName>[] | Partial<PropType<Model, FieldName>>;
|
|
10
|
+
export type NestedRepositoryFindFieltersOptions<Model> = {
|
|
11
11
|
[key in NonFunctionAndIdentifierPropertyNames<Model>]?: PropType<Model, key> extends ModelBaseStructure ? NestedRepositoryFindFieltersOptions<PropType<Model, key>> : PropType<Required<Model>, key> extends any[] ? PropType<Required<Model>, key>[number] extends ModelBaseStructure ? NestedRepositoryFindFieltersOptions<PropType<Required<Model>, key>[number]> : PropType<Required<Model>, key>[number] extends Record<string, any> ? NestedRepositoryFindFieltersOptions<PropType<Required<Model>, key>[number]> : RepositoryFindField<Model, key> : PropType<Model, key> extends Record<string, any> ? NestedRepositoryFindFieltersOptions<Required<PropType<Model, key>>> : RepositoryFindField<Model, key>;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type RepositoryFindFielters<Model extends ModelBaseStructure> = NestedRepositoryFindFieltersOptions<Model>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { NonFunctionAndIdentifierPropertiesWithNoPartial, NonFunctionAndIdentifierPropertyNames } from '../../model';
|
|
2
|
-
|
|
2
|
+
type SortableFields<Model, K extends NonFunctionAndIdentifierPropertiesWithNoPartial<Model> = NonFunctionAndIdentifierPropertiesWithNoPartial<Model>> = {
|
|
3
3
|
[key in keyof K]: K[key];
|
|
4
4
|
};
|
|
5
|
-
export
|
|
5
|
+
export type RepositoryFindResult<Model> = {
|
|
6
6
|
data: Model[];
|
|
7
7
|
count?: number;
|
|
8
8
|
minimal?: SortableFields<Model>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NonFunctionAndIdentifierPropertyNames } from '../../model/types/non-function-property-name.type';
|
|
2
|
-
export
|
|
2
|
+
export type RepositoryOrderBy<Model> = {
|
|
3
3
|
[key in NonFunctionAndIdentifierPropertyNames<Model>]?: 'asc' | 'desc';
|
|
4
4
|
};
|
|
5
|
-
export
|
|
5
|
+
export type RepositoryOrderByList<Model> = RepositoryOrderBy<Model>[];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ModelBaseStructure } from '../..';
|
|
2
2
|
import { PropType } from '../../../../utils';
|
|
3
3
|
import { NonFunctionAndIdentifierPropertyNames } from '../../model/types/non-function-property-name.type';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export type UpdateOptionAction = 'removeField' | 'update' | 'merge' | 'remove' | 'null';
|
|
5
|
+
export type UpdateOptions<T> = {
|
|
6
6
|
action: UpdateOptionAction;
|
|
7
7
|
value?: T;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type RepositoryUpdateParams<Model extends ModelBaseStructure> = {
|
|
10
10
|
[key in NonFunctionAndIdentifierPropertyNames<Model>]?: UpdateOptions<PropType<Model, key>> | PropType<Model, key>;
|
|
11
11
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Where } from '../enums/where.enum';
|
|
2
|
-
export
|
|
2
|
+
export type WhereOptions = keyof typeof Where;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModelBaseStructure } from '../model/types/model-base-structure.type';
|
|
2
2
|
import { RepositoryUpdateParams } from './types';
|
|
3
|
-
export
|
|
3
|
+
export type UpdateRepositoryParams<Model extends ModelBaseStructure> = RepositoryUpdateParams<Model>;
|
|
4
4
|
export interface UpdateRepository<Model extends ModelBaseStructure, Params = RepositoryUpdateParams<Model>> {
|
|
5
5
|
update(data: Params): Promise<Model>;
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LocationBound } from './location-bound.type';
|
|
2
2
|
import { LocationLatLng } from './location-lat-lng.type';
|
|
3
|
-
export
|
|
3
|
+
export type LocationGeometry = {
|
|
4
4
|
locationType?: string;
|
|
5
5
|
location?: LocationLatLng;
|
|
6
6
|
viewport?: LocationBound;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Category, Product } from '../../../catalog';
|
|
2
|
-
export
|
|
2
|
+
export type HomeCategoryGroup = {
|
|
3
3
|
category: Category;
|
|
4
4
|
products: Product[];
|
|
5
5
|
};
|
|
6
|
-
export
|
|
6
|
+
export type HomeData = {
|
|
7
7
|
discoverProducts: HomeCategoryGroup[];
|
|
8
8
|
featuredProducts: HomeCategoryGroup[];
|
|
9
9
|
verticalProducts: HomeCategoryGroup[];
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type HomeDataStructure = {
|
|
12
12
|
createdAt: Date;
|
|
13
13
|
expiresAt: Date;
|
|
14
14
|
data: HomeData;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseModel } from '../../generic/model/base.model';
|
|
2
2
|
import { BeardSizes, HairTypes } from './enums';
|
|
3
|
-
export
|
|
3
|
+
export type BeautyProfileIdentifiers = 'id' | 'userId';
|
|
4
4
|
export declare class BeautyProfile extends BaseModel<BeautyProfile, BeautyProfileIdentifiers> {
|
|
5
5
|
id: string;
|
|
6
6
|
userId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseModel } from '../../../generic/model/base.model';
|
|
2
2
|
import { EditionStatus, BillingStatus } from './enums';
|
|
3
|
-
export
|
|
3
|
+
export type EditionIdentifiers = 'id' | 'subscriptionId';
|
|
4
4
|
export declare class Edition extends BaseModel<Edition, EditionIdentifiers> {
|
|
5
5
|
id: string;
|
|
6
6
|
subscriptionId: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseModel } from '../../../generic/model/base.model';
|
|
2
2
|
import { Payment } from '../../../shopping/models/payment';
|
|
3
3
|
import { PaymentType } from './enums/payment-type.enum';
|
|
4
|
-
export
|
|
4
|
+
export type SubscriptionPaymentIdentifiers = 'id' | 'subscriptionId';
|
|
5
5
|
export declare class SubscriptionPayment extends BaseModel<SubscriptionPayment, SubscriptionPaymentIdentifiers> {
|
|
6
6
|
id: string;
|
|
7
7
|
subscriptionId: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Address } from '../../location/models/address';
|
|
2
|
-
export
|
|
2
|
+
export type UserAddressIdentifiers = 'id' | 'userId';
|
|
3
3
|
export declare class UserAddress extends Address<UserAddress, UserAddressIdentifiers> {
|
|
4
4
|
userId: string;
|
|
5
5
|
static get identifiersFields(): UserAddressIdentifiers[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseModel } from '../../generic/model/base.model';
|
|
2
|
-
export
|
|
2
|
+
export type UserPaymentIdentifiers = 'id' | 'userId';
|
|
3
3
|
export declare class UserPaymentMethod extends BaseModel<UserPaymentMethod, UserPaymentIdentifiers> {
|
|
4
4
|
brand: string;
|
|
5
5
|
cpf: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BasicUserData } from './types/basic-user-data.type';
|
|
2
|
-
export
|
|
2
|
+
export type RegisterParams = Omit<BasicUserData, 'isAnonymous'> & {
|
|
3
3
|
password: string;
|
|
4
4
|
};
|
|
5
5
|
export interface RegisterService {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { User } from '../../models/user';
|
|
2
|
-
export
|
|
2
|
+
export type BasicUserData = Partial<Pick<User, 'id' | 'cpf' | 'email' | 'firstName' | 'lastName' | 'displayName' | 'phone' | 'birthday'>> & {
|
|
3
3
|
isAnonymous: boolean;
|
|
4
4
|
};
|
|
@@ -5,8 +5,8 @@ export declare enum SignInMethods {
|
|
|
5
5
|
EMAIL_PASSWORD = "email_password",
|
|
6
6
|
GOOGLE = "google"
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
type SignInMethod = Lowercase<keyof typeof SignInMethods>;
|
|
9
|
+
type SignInParams = {
|
|
10
10
|
email?: string;
|
|
11
11
|
password?: string;
|
|
12
12
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { User } from '../models';
|
|
2
2
|
import { RegisterService } from '../services/register.service';
|
|
3
3
|
import { UserRepository } from '../repositories/user.repository';
|
|
4
|
-
|
|
4
|
+
type RegisterParams = Partial<User> & {
|
|
5
5
|
password: string;
|
|
6
6
|
};
|
|
7
7
|
export declare class Register {
|