@infrab4a/connect 4.0.0-beta.26 → 4.0.0-beta.28
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/domain/catalog/models/category-collection-children.d.ts +1 -2
- package/domain/catalog/models/category-filter.d.ts +1 -1
- package/domain/catalog/models/category.d.ts +1 -2
- package/domain/catalog/models/filter-option.d.ts +1 -2
- package/domain/catalog/models/filter.d.ts +1 -2
- package/domain/catalog/models/kit-product.d.ts +1 -1
- package/domain/catalog/models/product.d.ts +1 -2
- package/domain/catalog/models/variant.d.ts +1 -2
- package/domain/generic/model/base.model.d.ts +9 -5
- package/domain/generic/model/types/base-model-builder.type.d.ts +4 -2
- package/domain/generic/model/types/identifier-model.type.d.ts +6 -5
- package/domain/generic/model/types/model-base-structure.type.d.ts +9 -3
- package/domain/generic/model/types/non-function-property-name.type.d.ts +12 -3
- package/domain/generic/repository/get.repository.d.ts +2 -2
- package/domain/generic/repository/types/repository-find-filters.type.d.ts +3 -3
- package/domain/generic/repository/types/repository-order-by-list.type.d.ts +2 -2
- package/domain/generic/repository/types/repository-update-params.type.d.ts +2 -2
- package/domain/location/models/address.d.ts +4 -3
- package/domain/shopping/models/checkout.d.ts +5 -6
- package/domain/shopping/models/subscription/checkout.d.ts +3 -4
- package/domain/users/models/subscription/subscription.d.ts +3 -3
- package/domain/users/models/user-address.d.ts +1 -2
- package/domain/users/models/user.d.ts +2 -3
- package/esm2020/domain/catalog/models/category-collection-children.mjs +1 -4
- package/esm2020/domain/catalog/models/category-filter.mjs +1 -1
- package/esm2020/domain/catalog/models/category.mjs +1 -4
- package/esm2020/domain/catalog/models/filter-option.mjs +1 -4
- package/esm2020/domain/catalog/models/filter.mjs +1 -4
- package/esm2020/domain/catalog/models/kit-product.mjs +2 -2
- package/esm2020/domain/catalog/models/product.mjs +1 -4
- package/esm2020/domain/catalog/models/variant.mjs +1 -4
- package/esm2020/domain/generic/model/base.model.mjs +3 -2
- package/esm2020/domain/generic/model/types/base-model-builder.type.mjs +1 -1
- package/esm2020/domain/generic/model/types/identifier-model.type.mjs +1 -1
- package/esm2020/domain/generic/model/types/model-base-structure.type.mjs +1 -1
- package/esm2020/domain/generic/model/types/non-function-property-name.type.mjs +1 -1
- package/esm2020/domain/generic/repository/get.repository.mjs +1 -1
- package/esm2020/domain/generic/repository/types/repository-find-filters.type.mjs +1 -1
- package/esm2020/domain/generic/repository/types/repository-order-by-list.type.mjs +1 -1
- package/esm2020/domain/generic/repository/types/repository-update-params.type.mjs +1 -1
- package/esm2020/domain/location/models/address.mjs +2 -2
- package/esm2020/domain/shopping/models/checkout.mjs +6 -7
- package/esm2020/domain/shopping/models/order.mjs +1 -1
- package/esm2020/domain/shopping/models/subscription/checkout.mjs +6 -6
- package/esm2020/domain/users/models/subscription/subscription.mjs +6 -6
- package/esm2020/domain/users/models/user-address.mjs +1 -1
- package/esm2020/domain/users/models/user.mjs +3 -3
- package/esm2020/domain/users/use-cases/authentication.mjs +2 -2
- package/esm2020/infra/elasticsearch/adapters/axios.adapter.mjs +1 -1
- package/esm2020/infra/firebase/firestore/mixins/with-create-firestore.mixin.mjs +2 -2
- package/esm2020/infra/firebase/firestore/mixins/with-crud-firestore.mixin.mjs +1 -1
- package/esm2020/infra/firebase/firestore/mixins/with-delete-firestore.mixin.mjs +1 -1
- package/esm2020/infra/firebase/firestore/mixins/with-find-firestore.mixin.mjs +3 -3
- package/esm2020/infra/firebase/firestore/mixins/with-firestore.mixin.mjs +17 -2
- package/esm2020/infra/firebase/firestore/mixins/with-get-firestore.mixin.mjs +1 -1
- package/esm2020/infra/firebase/firestore/mixins/with-helpers.mixin.mjs +1 -1
- package/esm2020/infra/firebase/firestore/mixins/with-sub-collection.mixin.mjs +1 -1
- package/esm2020/infra/firebase/firestore/mixins/with-update-firestore.mixin.mjs +1 -1
- package/esm2020/infra/firebase/firestore/types/firestore-sub.repository.type.mjs +1 -1
- package/esm2020/infra/firebase/firestore/types/firestore.helpers.type.mjs +1 -1
- package/esm2020/infra/firebase/firestore/types/firestore.repository.type.mjs +1 -1
- package/esm2020/infra/hasura-graphql/mixins/helpers/attribute-option.helper.mjs +1 -1
- package/esm2020/infra/hasura-graphql/mixins/helpers/bind-filter-query.helper.mjs +5 -4
- package/esm2020/infra/hasura-graphql/mixins/helpers/filter-option.helper.mjs +1 -1
- package/esm2020/infra/hasura-graphql/mixins/helpers/graphql-field.helper.mjs +25 -20
- package/esm2020/infra/hasura-graphql/mixins/with-create-hasura-graphql.mixin.mjs +5 -3
- package/esm2020/infra/hasura-graphql/mixins/with-crud-hasura-graphql.mixin.mjs +1 -1
- package/esm2020/infra/hasura-graphql/mixins/with-delete-hasura-graphql.mixin.mjs +5 -3
- package/esm2020/infra/hasura-graphql/mixins/with-find-hasura-graphql.mixin.mjs +21 -4
- package/esm2020/infra/hasura-graphql/mixins/with-get-hasura-graphql.mixin.mjs +5 -3
- package/esm2020/infra/hasura-graphql/mixins/with-hasura-graphql.mixin.mjs +12 -5
- package/esm2020/infra/hasura-graphql/mixins/with-update-hasura-graphql.mixin.mjs +7 -5
- package/esm2020/infra/hasura-graphql/types/graphql.repository.type.mjs +1 -1
- package/esm2020/infra/hasura-graphql/types/hasura-graphql-fields.type.mjs +1 -1
- package/esm2020/utils/decorators/debug.class.decorator.mjs +7 -0
- package/esm2020/utils/decorators/index.mjs +3 -0
- package/esm2020/utils/decorators/trace.method.decorator.mjs +81 -0
- package/esm2020/utils/helpers/class-name.helper.mjs +15 -0
- package/esm2020/utils/helpers/debug-decorator.helper.mjs +18 -0
- package/esm2020/utils/helpers/debug.helper.mjs +150 -0
- package/esm2020/utils/helpers/index.mjs +5 -0
- package/esm2020/utils/helpers/reflect.helper.mjs +165 -0
- package/esm2020/utils/index.mjs +6 -3
- package/esm2020/utils/log.utils.mjs +9 -0
- package/fesm2015/infrab4a-connect.mjs +546 -82
- package/fesm2015/infrab4a-connect.mjs.map +1 -1
- package/fesm2020/infrab4a-connect.mjs +550 -82
- package/fesm2020/infrab4a-connect.mjs.map +1 -1
- package/infra/elasticsearch/adapters/axios.adapter.d.ts +2 -2
- package/infra/firebase/firestore/mixins/with-create-firestore.mixin.d.ts +2 -2
- package/infra/firebase/firestore/mixins/with-crud-firestore.mixin.d.ts +1 -1
- package/infra/firebase/firestore/mixins/with-delete-firestore.mixin.d.ts +2 -2
- package/infra/firebase/firestore/mixins/with-find-firestore.mixin.d.ts +2 -2
- package/infra/firebase/firestore/mixins/with-firestore.mixin.d.ts +2 -2
- package/infra/firebase/firestore/mixins/with-get-firestore.mixin.d.ts +2 -2
- package/infra/firebase/firestore/mixins/with-helpers.mixin.d.ts +2 -2
- package/infra/firebase/firestore/mixins/with-sub-collection.mixin.d.ts +2 -2
- package/infra/firebase/firestore/mixins/with-update-firestore.mixin.d.ts +3 -3
- package/infra/firebase/firestore/types/firestore-sub.repository.type.d.ts +3 -3
- package/infra/firebase/firestore/types/firestore.helpers.type.d.ts +5 -5
- package/infra/firebase/firestore/types/firestore.repository.type.d.ts +1 -1
- package/infra/hasura-graphql/mixins/helpers/attribute-option.helper.d.ts +9 -3
- package/infra/hasura-graphql/mixins/helpers/bind-filter-query.helper.d.ts +5 -5
- package/infra/hasura-graphql/mixins/helpers/filter-option.helper.d.ts +4 -2
- package/infra/hasura-graphql/mixins/helpers/graphql-field.helper.d.ts +8 -5
- package/infra/hasura-graphql/mixins/with-create-hasura-graphql.mixin.d.ts +2 -1
- package/infra/hasura-graphql/mixins/with-crud-hasura-graphql.mixin.d.ts +1 -1
- package/infra/hasura-graphql/mixins/with-delete-hasura-graphql.mixin.d.ts +1 -1
- package/infra/hasura-graphql/mixins/with-find-hasura-graphql.mixin.d.ts +11 -9
- package/infra/hasura-graphql/mixins/with-get-hasura-graphql.mixin.d.ts +7 -6
- package/infra/hasura-graphql/mixins/with-hasura-graphql.mixin.d.ts +2 -2
- package/infra/hasura-graphql/mixins/with-update-hasura-graphql.mixin.d.ts +2 -2
- package/infra/hasura-graphql/types/graphql.repository.type.d.ts +7 -5
- package/infra/hasura-graphql/types/hasura-graphql-fields.type.d.ts +7 -3
- package/package.json +2 -1
- package/utils/decorators/debug.class.decorator.d.ts +2 -0
- package/utils/decorators/index.d.ts +2 -0
- package/utils/decorators/trace.method.decorator.d.ts +14 -0
- package/utils/helpers/class-name.helper.d.ts +3 -0
- package/utils/helpers/debug-decorator.helper.d.ts +9 -0
- package/utils/helpers/debug.helper.d.ts +60 -0
- package/utils/helpers/index.d.ts +4 -0
- package/utils/helpers/reflect.helper.d.ts +50 -0
- package/utils/index.d.ts +5 -2
- package/utils/log.utils.d.ts +7 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ModelBaseStructure } from '../../../domain';
|
|
2
2
|
import { ElasticSearchResult } from '../types/elastic-search-result';
|
|
3
3
|
import { ElasticSearchAdapter } from './elastic-search.adapter';
|
|
4
4
|
export declare type AxiosElasticSearchConfig = {
|
|
5
5
|
url: string;
|
|
6
6
|
credential: string;
|
|
7
7
|
};
|
|
8
|
-
export declare class AxiosAdapter<T extends
|
|
8
|
+
export declare class AxiosAdapter<T extends ModelBaseStructure<T>> implements ElasticSearchAdapter<T> {
|
|
9
9
|
private readonly config;
|
|
10
10
|
constructor(config: AxiosElasticSearchConfig);
|
|
11
11
|
get(index: string, id: string): Promise<T>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { CreateRepository, CreateRepositoryParams, ModelBaseStructure } from '../../../../domain';
|
|
2
|
-
import {
|
|
2
|
+
import { MixinCtor } from '../../../../utils';
|
|
3
3
|
import { FirestoreHelpers, FirestoreRepository } from '../types';
|
|
4
|
-
export declare const withCreateFirestore: <TBase extends ModelBaseStructure<
|
|
4
|
+
export declare const withCreateFirestore: <TBase extends ModelBaseStructure<TBase, TBase["identifiersFields"][number]>, TMixinBase extends MixinCtor<FirestoreRepository<TBase>, any[]>>(MixinBase: MixinCtor<FirestoreRepository<TBase> & FirestoreHelpers, any[]> & TMixinBase) => MixinCtor<FirestoreRepository<TBase> & InstanceType<TMixinBase> & CreateRepository<TBase, CreateRepositoryParams<TBase>> & FirestoreHelpers, []>;
|
|
@@ -2,4 +2,4 @@ import { CrudRepository, ModelBaseStructure } from '../../../../domain';
|
|
|
2
2
|
import { MergeConstructorParams, MixinCtor } from '../../../../utils';
|
|
3
3
|
import { FirestoreHelpers, FirestoreRepository } from '../types';
|
|
4
4
|
import { FirestoreConstructorParams } from './with-firestore.mixin';
|
|
5
|
-
export declare const withCrudFirestore: <TBase extends ModelBaseStructure<
|
|
5
|
+
export declare const withCrudFirestore: <TBase extends ModelBaseStructure<TBase, TBase["identifiersFields"][number]>, Repository = CrudRepository<TBase, import("../../../../domain").CrudParams<TBase>>, TMixinBase extends MixinCtor<any, any[]> = MixinCtor<any, any[]>>(MixinBase: MixinCtor<FirestoreRepository<TBase> & FirestoreHelpers, any[]> & TMixinBase) => MixinCtor<FirestoreRepository<TBase> & Repository & FirestoreHelpers, MergeConstructorParams<[FirestoreConstructorParams<TBase>, ...any[]], ConstructorParameters<TMixinBase>>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { DeleteRepository, DeleteRepositoryParams, ModelBaseStructure } from '../../../../domain';
|
|
2
|
-
import {
|
|
2
|
+
import { MixinCtor } from '../../../../utils';
|
|
3
3
|
import { FirestoreHelpers, FirestoreRepository } from '../types';
|
|
4
|
-
export declare const withDeleteFirestore: <TBase extends ModelBaseStructure<
|
|
4
|
+
export declare const withDeleteFirestore: <TBase extends ModelBaseStructure<TBase, TBase["identifiersFields"][number]>, TMixinBase extends MixinCtor<FirestoreRepository<TBase>, any[]>>(MixinBase: MixinCtor<FirestoreRepository<TBase> & FirestoreHelpers, any[]> & TMixinBase) => MixinCtor<FirestoreRepository<TBase> & InstanceType<TMixinBase> & DeleteRepository<TBase, DeleteRepositoryParams<TBase>> & FirestoreHelpers, []>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { FindRepository, ModelBaseStructure } from '../../../../domain';
|
|
2
|
-
import {
|
|
2
|
+
import { MixinCtor } from '../../../../utils';
|
|
3
3
|
import { FirestoreHelpers, FirestoreRepository } from '../types';
|
|
4
|
-
export declare const withFindFirestore: <TBase extends ModelBaseStructure<
|
|
4
|
+
export declare const withFindFirestore: <TBase extends ModelBaseStructure<TBase, TBase["identifiersFields"][number]>, TMixinBase extends MixinCtor<FirestoreRepository<TBase>, any[]>>(MixinBase: MixinCtor<FirestoreRepository<TBase> & FirestoreHelpers, any[]> & TMixinBase) => MixinCtor<FirestoreRepository<TBase> & InstanceType<TMixinBase> & FindRepository<TBase, import("../../../../domain").FindRepositoryParams<TBase>> & FirestoreHelpers, []>;
|
|
@@ -3,11 +3,11 @@ import { BaseModelBuilder, ModelBaseStructure, NonFunctionAndIdentifierPropertyN
|
|
|
3
3
|
import { MergeConstructorParams, MixinCtor } from '../../../../utils';
|
|
4
4
|
import { FirestoreFieldType } from '../enums';
|
|
5
5
|
import { FirestoreInterceptors, FirestoreRepository } from '../types';
|
|
6
|
-
export declare type FirestoreConstructorParams<Model extends ModelBaseStructure
|
|
6
|
+
export declare type FirestoreConstructorParams<Model extends ModelBaseStructure<Model>> = {
|
|
7
7
|
firestore: Firestore;
|
|
8
8
|
collectionName: string;
|
|
9
9
|
model: BaseModelBuilder<Model>;
|
|
10
10
|
fields?: Partial<Record<NonFunctionAndIdentifierPropertyNames<Model>, FirestoreFieldType>>;
|
|
11
11
|
interceptors?: FirestoreInterceptors<Model>;
|
|
12
12
|
};
|
|
13
|
-
export declare const withFirestore: <TBase extends ModelBaseStructure<
|
|
13
|
+
export declare const withFirestore: <TBase extends ModelBaseStructure<TBase, TBase["identifiersFields"][number]>, T extends MixinCtor<any, any[]> = MixinCtor<any, any[]>>(MixinBase: T) => MixinCtor<FirestoreRepository<TBase>, any[]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { GetRepository, ModelBaseStructure } from '../../../../domain';
|
|
2
|
-
import {
|
|
2
|
+
import { MixinCtor } from '../../../../utils';
|
|
3
3
|
import { FirestoreHelpers, FirestoreRepository } from '../types';
|
|
4
|
-
export declare const withGetFirestore: <TBase extends ModelBaseStructure<
|
|
4
|
+
export declare const withGetFirestore: <TBase extends ModelBaseStructure<TBase, TBase["identifiersFields"][number]>, TMixinBase extends MixinCtor<FirestoreRepository<TBase>, any[]>>(MixinBase: MixinCtor<FirestoreRepository<TBase> & FirestoreHelpers, any[]> & TMixinBase) => MixinCtor<FirestoreRepository<TBase> & InstanceType<TMixinBase> & GetRepository<TBase, import("../../../../domain").GetRepositoryParams<TBase>> & FirestoreHelpers, []>;
|
|
@@ -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<
|
|
9
|
-
isSubCollection<T_1 extends ModelBaseStructure<
|
|
8
|
+
toArray<T extends ModelBaseStructure<T, T["identifiersFields"][number]>>(snapShot: QuerySnapshot<T> | QueryDocumentSnapshot<T>[]): T[];
|
|
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;
|
|
@@ -5,7 +5,7 @@ import { FirestoreConstructorParams } from './with-firestore.mixin';
|
|
|
5
5
|
export declare type FirestoreSubCollectionConstructorParams<TBase extends ModelBaseStructure> = {
|
|
6
6
|
parentIdField: keyof IdentifiersModel<TBase>;
|
|
7
7
|
};
|
|
8
|
-
export declare const withSubCollection: <TBase extends ModelBaseStructure<
|
|
8
|
+
export declare const withSubCollection: <TBase extends ModelBaseStructure<TBase, TBase["identifiersFields"][number]>, TBaseParent extends ModelBaseStructure<TBaseParent, TBaseParent["identifiersFields"][number]>, TMixinBase extends MixinCtor<FirestoreRepository<TBase>, any[]>>(MixinBase: MixinCtor<FirestoreRepository<TBase>, any[]> & TMixinBase, ParentModel: new () => TBaseParent) => MixinCtor<FirestoreRepository<TBase> & InstanceType<TMixinBase> & {
|
|
9
9
|
readonly parentRepository: FirestoreRepository<TBaseParent>;
|
|
10
|
-
parentIdField: Extract<import("../../../../domain").NonFunctionAndIdentifierPropertyNames<TBase>, import("../../../../utils").
|
|
10
|
+
parentIdField: Extract<import("../../../../domain").NonFunctionAndIdentifierPropertyNames<TBase>, import("../../../../utils").PropType<TBase, "identifiersFields">[number]>;
|
|
11
11
|
} & FirestoreHelpers, MergeConstructorParams<[FirestoreConstructorParams<TBase> & FirestoreSubCollectionConstructorParams<TBase>, ...any[]], ConstructorParameters<TMixinBase>>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ModelBaseStructure, RepositoryUpdateParams, UpdateRepository } from '../../../../domain';
|
|
2
|
-
import {
|
|
2
|
+
import { MixinCtor } from '../../../../utils';
|
|
3
3
|
import { FirestoreHelpers, FirestoreRepository } from '../types';
|
|
4
|
-
export declare type UpdateFirestoreRepositoryType<MBase extends ModelBaseStructure
|
|
4
|
+
export declare type UpdateFirestoreRepositoryType<MBase extends ModelBaseStructure<MBase>> = UpdateRepository<MBase> & {
|
|
5
5
|
paramsToPlain(params: RepositoryUpdateParams<MBase>): Partial<MBase>;
|
|
6
6
|
};
|
|
7
|
-
export declare const withUpdateFirestore: <TBase extends ModelBaseStructure<
|
|
7
|
+
export declare const withUpdateFirestore: <TBase extends ModelBaseStructure<TBase, TBase["identifiersFields"][number]>, TMixinBase extends MixinCtor<FirestoreRepository<TBase>, any[]>>(MixinBase: MixinCtor<FirestoreRepository<TBase> & FirestoreHelpers, any[]> & TMixinBase) => MixinCtor<FirestoreRepository<TBase> & UpdateRepository<TBase, RepositoryUpdateParams<TBase>> & InstanceType<TMixinBase> & FirestoreHelpers, []>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { IdentifierModel, ModelBaseStructure } from '../../../../domain';
|
|
1
2
|
import { FirestoreRepository } from './firestore.repository.type';
|
|
2
|
-
|
|
3
|
-
export declare type FirestoreSubRepository<Model extends ModelBaseStructure, ParentModel extends ModelBaseStructure = BaseModel<{}>> = {
|
|
3
|
+
export declare type FirestoreSubRepository<Model extends ModelBaseStructure<Model>, ParentModel extends ModelBaseStructure<ParentModel>> = {
|
|
4
4
|
readonly parentRepository: FirestoreRepository<ParentModel>;
|
|
5
|
-
parentIdField:
|
|
5
|
+
parentIdField: IdentifierModel<Model>;
|
|
6
6
|
} & FirestoreRepository<Model>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { FirestoreRepository } from './firestore.repository.type';
|
|
1
|
+
import { QueryDocumentSnapshot, QuerySnapshot } from 'firebase/firestore';
|
|
2
|
+
import { ModelBaseStructure } from '../../../../domain';
|
|
4
3
|
import { FirestoreSubRepository } from './firestore-sub.repository.type';
|
|
4
|
+
import { FirestoreRepository } from './firestore.repository.type';
|
|
5
5
|
export interface FirestoreHelpers {
|
|
6
|
-
toArray<T extends
|
|
7
|
-
isSubCollection<T extends
|
|
6
|
+
toArray<T extends ModelBaseStructure<T>>(snapShot: QuerySnapshot<T> | Array<QueryDocumentSnapshot<T>>): Array<T>;
|
|
7
|
+
isSubCollection<T extends ModelBaseStructure<T>, E extends ModelBaseStructure<E>>(repository: FirestoreRepository<T> | FirestoreSubRepository<T, E>): repository is FirestoreSubRepository<T, E>;
|
|
8
8
|
}
|
|
@@ -2,7 +2,7 @@ import { CollectionReference, DocumentData, Firestore, QueryDocumentSnapshot } f
|
|
|
2
2
|
import { BaseModelBuilder, ModelBaseStructure, NonFunctionAndIdentifierPropertyNames } from '../../../../domain';
|
|
3
3
|
import { FirestoreFieldType } from '../enums';
|
|
4
4
|
import { FirestoreInterceptors } from './firestore-interceptors.type';
|
|
5
|
-
export declare type FirestoreRepository<Model extends ModelBaseStructure
|
|
5
|
+
export declare type FirestoreRepository<Model extends ModelBaseStructure<Model>> = {
|
|
6
6
|
readonly firestore?: Firestore;
|
|
7
7
|
collectionName: string;
|
|
8
8
|
model: BaseModelBuilder<Model>;
|
|
@@ -4,9 +4,15 @@ declare type FindByAttributeResult<MBase extends ModelBaseStructure<MBase>, Attr
|
|
|
4
4
|
attributeName: Attribute;
|
|
5
5
|
};
|
|
6
6
|
export declare class AttributeOptionHelper {
|
|
7
|
-
static FindByAttribute: <MBase extends ModelBaseStructure<
|
|
8
|
-
static CheckIsColumnOption: <Model extends ModelBaseStructure<
|
|
9
|
-
|
|
7
|
+
static FindByAttribute: <MBase extends ModelBaseStructure<MBase, MBase["identifiersFields"][number]>, Attribute extends NonFunctionAndIdentifierPropertyNames<MBase> = NonFunctionAndIdentifierPropertyNames<MBase>>(attributeName: Attribute, fields: HasuraGraphQLFields<MBase>) => FindByAttributeResult<MBase, Attribute>;
|
|
8
|
+
static CheckIsColumnOption: <Model extends ModelBaseStructure<Model, Model["identifiersFields"][number]>, ParentModel extends ModelBaseStructure<Record<string, any> & {
|
|
9
|
+
identifiersFields: any[];
|
|
10
|
+
}, any>>(fieldValue: any) => fieldValue is ColumnOptions<Model, ParentModel, any>;
|
|
11
|
+
static FindColumnOptionFromList: <Model extends ModelBaseStructure<Record<string, any> & {
|
|
12
|
+
identifiersFields: any[];
|
|
13
|
+
}, any>, ParentModel extends ModelBaseStructure<Record<string, any> & {
|
|
14
|
+
identifiersFields: any[];
|
|
15
|
+
}, any>>(columnName: string, fields: HasuraGraphQLFields<ParentModel>) => ColumnOptions<Model, ParentModel, any> & {
|
|
10
16
|
attributeName: NonFunctionAndIdentifierPropertyNames<ParentModel>;
|
|
11
17
|
};
|
|
12
18
|
}
|
|
@@ -2,9 +2,9 @@ import { ModelBaseStructure, NonFunctionAndIdentifierPropertyNames, NonFunctionP
|
|
|
2
2
|
import { HasuraGraphQLWhere } from '../../enums';
|
|
3
3
|
import { ColumnOptions, HasuraGraphQLFields, VariableOptions } from '../../types';
|
|
4
4
|
export declare class BindFilterQueryHelper {
|
|
5
|
-
static MakeGraphQLWhere: <MBase extends ModelBaseStructure<
|
|
6
|
-
static BuildWhereSentence: <MBase extends ModelBaseStructure<
|
|
7
|
-
static BuildOperatorSentence: <MBase extends ModelBaseStructure<
|
|
8
|
-
static GetHasuraOperator: <MBase extends ModelBaseStructure<
|
|
9
|
-
static GetHasuraJsonbOperator: <MBase extends ModelBaseStructure<
|
|
5
|
+
static MakeGraphQLWhere: <MBase extends ModelBaseStructure<MBase, MBase["identifiersFields"][number]>>(filter: RepositoryFindFielters<MBase>, fields: HasuraGraphQLFields<MBase>) => VariableOptions;
|
|
6
|
+
static BuildWhereSentence: <MBase extends ModelBaseStructure<MBase, MBase["identifiersFields"][number]>>(field: NonFunctionAndIdentifierPropertyNames<MBase>, options: RepositoryFindFieltersOptions<MBase, NonFunctionAndIdentifierPropertyNames<MBase>>, fields: HasuraGraphQLFields<MBase>) => VariableOptions;
|
|
7
|
+
static BuildOperatorSentence: <MBase extends ModelBaseStructure<MBase, MBase["identifiersFields"][number]>>(options: RepositoryFindFieltersOptions<MBase, any>, fieldOption: ColumnOptions<any, any>) => VariableOptions;
|
|
8
|
+
static GetHasuraOperator: <MBase extends ModelBaseStructure<MBase, MBase["identifiersFields"][number]>>(options: RepositoryFindFieltersOptions<MBase, NonFunctionPropertyNames<MBase, MBase, Exclude<keyof MBase, import("../../../../domain").ReadonlyKeys<MBase>>>>, fieldOption: ColumnOptions<any, any>) => HasuraGraphQLWhere;
|
|
9
|
+
static GetHasuraJsonbOperator: <MBase extends ModelBaseStructure<MBase, MBase["identifiersFields"][number]>>(options: RepositoryFindFieltersOptions<MBase, NonFunctionPropertyNames<MBase, MBase, Exclude<keyof MBase, import("../../../../domain").ReadonlyKeys<MBase>>>>) => HasuraGraphQLWhere;
|
|
10
10
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ModelBaseStructure, RepositoryFindFieltersOptions } from '../../../../domain';
|
|
2
2
|
import { ColumnOptions } from '../../types';
|
|
3
3
|
export declare class FilterOptionHelper {
|
|
4
|
-
static CheckIfIsFilterOption: <Model extends ModelBaseStructure<
|
|
5
|
-
|
|
4
|
+
static CheckIfIsFilterOption: <Model extends ModelBaseStructure<Record<string, any> & {
|
|
5
|
+
identifiersFields: any[];
|
|
6
|
+
}, any>>(filter: any) => filter is RepositoryFindFieltersOptions<Model, any>;
|
|
7
|
+
static GetValueFromFilter: <Model extends ModelBaseStructure<Model, Model["identifiersFields"][number]>>(filter: RepositoryFindFieltersOptions<Model, any>, fieldOption: ColumnOptions<any, any>) => any;
|
|
6
8
|
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { ModelBaseStructure,
|
|
1
|
+
import { ModelBaseStructure, NonFunctionAndIdentifierPropertiesWithNoPartial, PartialIdentifiersModel } from '../../../../domain';
|
|
2
2
|
import { Fields, GraphQLParams, HasuraGraphQLFields } from '../../types';
|
|
3
3
|
export declare class GraphQLFieldHelper {
|
|
4
|
-
static CheckIsGraphQLParams: <Model extends ModelBaseStructure<
|
|
5
|
-
static ConvertModelFieldsToGraphQLFields: <Model extends ModelBaseStructure<
|
|
6
|
-
static ConvertFieldValueFrom: <Model extends ModelBaseStructure<
|
|
7
|
-
|
|
4
|
+
static CheckIsGraphQLParams: <Model extends ModelBaseStructure<Model, Model["identifiersFields"][number]>>(params: string | GraphQLParams<Model>[]) => params is GraphQLParams<Model>[];
|
|
5
|
+
static ConvertModelFieldsToGraphQLFields: <Model extends ModelBaseStructure<Model, Model["identifiersFields"][number]>>(fields: HasuraGraphQLFields<Model>) => Fields;
|
|
6
|
+
static ConvertFieldValueFrom: <Model extends ModelBaseStructure<Record<string, any> & {
|
|
7
|
+
identifiersFields: any[];
|
|
8
|
+
}, any>, RecordDataType extends string | number | Date | DataType, DataType extends Record<string, RecordDataType | RecordDataType[]>>(data: DataType, fields: HasuraGraphQLFields<Model>) => NonFunctionAndIdentifierPropertiesWithNoPartial<Model> | Partial<import("../../../../domain").IdentifiersModel<Model>>;
|
|
9
|
+
static ConvertFieldValueTo: <Model extends ModelBaseStructure<Model, Model["identifiersFields"][number]>, DataType extends Record<string, string | number | Date | DataType>>(instance: Model, fields: HasuraGraphQLFields<Model>, update?: boolean) => DataType;
|
|
10
|
+
private static ConvertNestedFieldsToGraphQLFields;
|
|
8
11
|
}
|
|
@@ -3,6 +3,7 @@ import { MergeConstructorParams, MixinCtor } from '../../../utils';
|
|
|
3
3
|
import { GraphQLRepository } from '../types';
|
|
4
4
|
export declare type CreateConstructorParams = {
|
|
5
5
|
insertGraphQLOperation?: string;
|
|
6
|
+
insertAllGraphQLOperation?: string;
|
|
6
7
|
insertGraphQLObjectType?: string;
|
|
7
8
|
};
|
|
8
|
-
export declare const withCreateHasuraGraphQL: <MBase extends ModelBaseStructure<
|
|
9
|
+
export declare const withCreateHasuraGraphQL: <MBase extends ModelBaseStructure<MBase, MBase["identifiersFields"][number]>, TMixinBase extends MixinCtor<GraphQLRepository<MBase>, any[]>>(MixinBase: MixinCtor<GraphQLRepository<MBase>, any[]> & TMixinBase) => MixinCtor<GraphQLRepository<MBase> & InstanceType<TMixinBase> & CreateRepository<MBase, CreateRepositoryParams<MBase>>, MergeConstructorParams<[CreateConstructorParams, ...any[]], ConstructorParameters<TMixinBase>>>;
|
|
@@ -6,6 +6,6 @@ import { DeleteConstructorParams } from './with-delete-hasura-graphql.mixin';
|
|
|
6
6
|
import { GetConstructorParams } from './with-get-hasura-graphql.mixin';
|
|
7
7
|
import { HasuraConstructorParams } from './with-hasura-graphql.mixin';
|
|
8
8
|
import { UpdateConstructorParams, UpdateHasuraGraphQLRepositoryType } from './with-update-hasura-graphql.mixin';
|
|
9
|
-
export declare const withCrudHasuraGraphQL: <TBase extends ModelBaseStructure<
|
|
9
|
+
export declare const withCrudHasuraGraphQL: <TBase extends ModelBaseStructure<TBase, TBase["identifiersFields"][number]>, Repository = CrudRepository<TBase, import("../../../domain").CrudParams<TBase>>, TMixinBase extends MixinCtor<any, any[]> = MixinCtor<any, any[]>>(MixinBase: MixinCtor<GraphQLRepository<TBase>, any[]> & TMixinBase) => MixinCtor<GraphQLRepository<TBase> & Repository & import("../../../domain").UpdateRepository<TBase, import("../../../domain").RepositoryUpdateParams<TBase>> & {
|
|
10
10
|
paramsToPlain(params: import("../../../domain").RepositoryUpdateParams<TBase>): Partial<TBase>;
|
|
11
11
|
}, MergeConstructorParams<[HasuraConstructorParams<TBase> & CreateConstructorParams & DeleteConstructorParams & GetConstructorParams & UpdateConstructorParams, ...any[]], ConstructorParameters<TMixinBase>>>;
|
|
@@ -4,4 +4,4 @@ import { GraphQLRepository } from '../types';
|
|
|
4
4
|
export declare type DeleteConstructorParams = {
|
|
5
5
|
deleteGraphQLOperation?: string;
|
|
6
6
|
};
|
|
7
|
-
export declare const withDeleteHasuraGraphQL: <MBase extends ModelBaseStructure<
|
|
7
|
+
export declare const withDeleteHasuraGraphQL: <MBase extends ModelBaseStructure<MBase, MBase["identifiersFields"][number]>, TMixinBase extends MixinCtor<GraphQLRepository<MBase>, any[]>>(MixinBase: MixinCtor<GraphQLRepository<MBase>, any[]> & TMixinBase) => MixinCtor<GraphQLRepository<MBase> & DeleteRepository<MBase, DeleteRepositoryParams<MBase>> & InstanceType<TMixinBase>, MergeConstructorParams<[DeleteConstructorParams, ...any[]], ConstructorParameters<TMixinBase>>>;
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { FindRepositoryParams, ModelBaseStructure, RepositoryFindResult } from '../../../domain';
|
|
2
|
-
import { MixinCtor } from '../../../utils';
|
|
3
|
-
import { GraphQLParams, GraphQLRepository } from '../types';
|
|
4
|
-
export declare const withFindHasuraGraphQL: <MBase extends ModelBaseStructure<
|
|
1
|
+
import { FindRepositoryParams, ModelBaseStructure, RepositoryFindResult, RepositoryOrderBy } from '../../../domain';
|
|
2
|
+
import { DebugHelper, MixinCtor } from '../../../utils';
|
|
3
|
+
import { GraphQLParams, GraphQLRepository, HasuraGraphQLFields } from '../types';
|
|
4
|
+
export declare const withFindHasuraGraphQL: <MBase extends ModelBaseStructure<MBase, MBase["identifiersFields"][number]>, TMixinBase extends MixinCtor<GraphQLRepository<MBase>, any[]>>(MixinBase: MixinCtor<GraphQLRepository<MBase>, any[]> & TMixinBase) => {
|
|
5
5
|
new (...args: any[]): {
|
|
6
6
|
find(params?: FindRepositoryParams<MBase>): Promise<RepositoryFindResult<MBase>>;
|
|
7
|
+
bindOrderByAttributes: (orderBy: RepositoryOrderBy<MBase>, fields: HasuraGraphQLFields<MBase>) => {};
|
|
7
8
|
tableName: string;
|
|
8
|
-
model: import("../../../domain").BaseModelBuilder<MBase,
|
|
9
|
+
model: import("../../../domain").BaseModelBuilder<MBase, any, MBase & {
|
|
9
10
|
prototype: unknown;
|
|
10
11
|
}>;
|
|
11
|
-
fields:
|
|
12
|
+
fields: HasuraGraphQLFields<MBase>;
|
|
12
13
|
endpoint: string;
|
|
13
14
|
authOptions: import("../types").HasuraGraphQLAuthOptions;
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
logger: DebugHelper;
|
|
16
|
+
mutation: <ReturnFields = any>(operation: string, fields?: string[] | HasuraGraphQLFields<MBase>, variables?: import("../types").VariableOptions) => Promise<ReturnFields>;
|
|
17
|
+
query: <ReturnFields_1 = any>(operation: string | GraphQLParams<MBase>[], fields?: string[] | HasuraGraphQLFields<MBase>, variables?: import("../types").VariableOptions) => Promise<ReturnFields_1>;
|
|
16
18
|
getAttributeGraphQLTypeOf: <FieldValue>(value: FieldValue) => string;
|
|
17
|
-
convertDataFromHasura
|
|
19
|
+
convertDataFromHasura(data: Record<string, string | number>, fields?: string[] | HasuraGraphQLFields<MBase>): MBase;
|
|
18
20
|
convertDataToHasura(instance: MBase, update?: boolean): Record<string, string | number>;
|
|
19
21
|
};
|
|
20
22
|
} & TMixinBase;
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { GetRepositoryParams, ModelBaseStructure } from '../../../domain';
|
|
2
|
-
import { MixinCtor } from '../../../utils';
|
|
2
|
+
import { DebugHelper, MixinCtor } from '../../../utils';
|
|
3
3
|
import { GraphQLRepository } from '../types';
|
|
4
4
|
export declare type GetConstructorParams = {
|
|
5
5
|
getGraphQLOperation?: string;
|
|
6
6
|
};
|
|
7
|
-
export declare const withGetHasuraGraphQL: <MBase extends ModelBaseStructure<
|
|
7
|
+
export declare const withGetHasuraGraphQL: <MBase extends ModelBaseStructure<MBase, MBase["identifiersFields"][number]>, TMixinBase extends MixinCtor<GraphQLRepository<MBase>, any[]>>(MixinBase: MixinCtor<GraphQLRepository<MBase>, any[]> & TMixinBase) => {
|
|
8
8
|
new (...params: any[]): {
|
|
9
9
|
getGraphQLOperation: string;
|
|
10
10
|
get(identifiers: GetRepositoryParams<MBase>): Promise<MBase>;
|
|
11
11
|
tableName: string;
|
|
12
|
-
model: import("../../../domain").BaseModelBuilder<MBase,
|
|
12
|
+
model: import("../../../domain").BaseModelBuilder<MBase, any, MBase & {
|
|
13
13
|
prototype: unknown;
|
|
14
14
|
}>;
|
|
15
15
|
fields: import("../types").HasuraGraphQLFields<MBase>;
|
|
16
16
|
endpoint: string;
|
|
17
17
|
authOptions: import("../types").HasuraGraphQLAuthOptions;
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
logger: DebugHelper;
|
|
19
|
+
mutation: <ReturnFields = any>(operation: string, fields?: string[] | import("../types").HasuraGraphQLFields<MBase>, variables?: import("../types").VariableOptions) => Promise<ReturnFields>;
|
|
20
|
+
query: <ReturnFields_1 = any>(operation: string | import("../types").GraphQLParams<MBase>[], fields?: string[] | import("../types").HasuraGraphQLFields<MBase>, variables?: import("../types").VariableOptions) => Promise<ReturnFields_1>;
|
|
20
21
|
getAttributeGraphQLTypeOf: <FieldValue>(value: FieldValue) => string;
|
|
21
|
-
convertDataFromHasura
|
|
22
|
+
convertDataFromHasura(data: Record<string, string | number>, fields?: string[] | import("../types").HasuraGraphQLFields<MBase>): MBase;
|
|
22
23
|
convertDataToHasura(instance: MBase, update?: boolean): Record<string, string | number>;
|
|
23
24
|
};
|
|
24
25
|
} & TMixinBase;
|
|
@@ -10,7 +10,7 @@ declare type HasuraGraphQLInterceptors<P = QueryBuilderOptions | QueryBuilderOpt
|
|
|
10
10
|
request?: <R>(request: P) => Promise<P & R>;
|
|
11
11
|
response?: <R>(response: R, request: P) => Promise<R>;
|
|
12
12
|
};
|
|
13
|
-
export declare type HasuraConstructorParams<Model extends ModelBaseStructure
|
|
13
|
+
export declare type HasuraConstructorParams<Model extends ModelBaseStructure<Model, Model['identifiersFields'][number]>> = {
|
|
14
14
|
tableName: string;
|
|
15
15
|
model: BaseModelBuilder<Model>;
|
|
16
16
|
fields: HasuraGraphQLFields<Model>;
|
|
@@ -18,5 +18,5 @@ export declare type HasuraConstructorParams<Model extends ModelBaseStructure> =
|
|
|
18
18
|
interceptors?: HasuraGraphQLInterceptors;
|
|
19
19
|
authOptions: HasuraGraphQLAuthOptions;
|
|
20
20
|
};
|
|
21
|
-
export declare const withHasuraGraphQL: <MBase extends ModelBaseStructure<
|
|
21
|
+
export declare const withHasuraGraphQL: <MBase extends ModelBaseStructure<MBase, MBase["identifiersFields"][number]>, T extends MixinCtor<any, any[]> = MixinCtor<any, any[]>>(MixinBase: T) => MixinCtor<GraphQLRepository<MBase>, any[]>;
|
|
22
22
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ModelBaseStructure, RepositoryUpdateParams, UpdateRepository } from '../../../domain';
|
|
2
2
|
import { MergeConstructorParams, MixinCtor } from '../../../utils';
|
|
3
3
|
import { GraphQLRepository } from '../types';
|
|
4
|
-
export declare type UpdateHasuraGraphQLRepositoryType<MBase extends ModelBaseStructure
|
|
4
|
+
export declare type UpdateHasuraGraphQLRepositoryType<MBase extends ModelBaseStructure<MBase, MBase['identifiersFields'][number]>> = UpdateRepository<MBase> & {
|
|
5
5
|
paramsToPlain(params: RepositoryUpdateParams<MBase>): Partial<MBase>;
|
|
6
6
|
};
|
|
7
7
|
export declare type UpdateConstructorParams = {
|
|
@@ -9,6 +9,6 @@ export declare type UpdateConstructorParams = {
|
|
|
9
9
|
updateGraphQLObjectType?: string;
|
|
10
10
|
updateGraphQLPKType?: string;
|
|
11
11
|
};
|
|
12
|
-
export declare const withUpdateHasuraGraphQL: <MBase extends ModelBaseStructure<
|
|
12
|
+
export declare const withUpdateHasuraGraphQL: <MBase extends ModelBaseStructure<MBase, MBase["identifiersFields"][number]>, TMixinBase extends MixinCtor<GraphQLRepository<MBase>, any[]>>(MixinBase: MixinCtor<GraphQLRepository<MBase>, any[]> & TMixinBase) => MixinCtor<GraphQLRepository<MBase> & UpdateRepository<MBase, RepositoryUpdateParams<MBase>> & {
|
|
13
13
|
paramsToPlain(params: RepositoryUpdateParams<MBase>): Partial<MBase>;
|
|
14
14
|
} & InstanceType<TMixinBase>, MergeConstructorParams<[UpdateConstructorParams, ...any[]], ConstructorParameters<TMixinBase>>>;
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { BaseModelBuilder, ModelBaseStructure } from '../../../domain';
|
|
2
|
+
import { DebugHelper } from '../../../utils';
|
|
2
3
|
import { HasuraGraphQLAuthOptions } from './hasura-graphql-auth-options.type';
|
|
3
4
|
import { HasuraGraphQLFields } from './hasura-graphql-fields.type';
|
|
4
5
|
import { VariableOptions } from './variable-options.type';
|
|
5
|
-
export declare type GraphQLParams<Model extends ModelBaseStructure
|
|
6
|
+
export declare type GraphQLParams<Model extends ModelBaseStructure<Model>> = {
|
|
6
7
|
operation: string;
|
|
7
8
|
fields?: HasuraGraphQLFields<Model>;
|
|
8
9
|
variables?: VariableOptions;
|
|
9
10
|
};
|
|
10
|
-
export declare type GraphQLRepository<Model extends ModelBaseStructure
|
|
11
|
+
export declare type GraphQLRepository<Model extends ModelBaseStructure<Model>> = {
|
|
11
12
|
tableName: string;
|
|
12
13
|
model: BaseModelBuilder<Model>;
|
|
13
14
|
fields: HasuraGraphQLFields<Model>;
|
|
14
15
|
endpoint: string;
|
|
15
16
|
authOptions: HasuraGraphQLAuthOptions;
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
logger: DebugHelper;
|
|
18
|
+
mutation: <ReturnFields = any>(operation: string, fields?: string[] | HasuraGraphQLFields<Model>, variables?: VariableOptions) => Promise<ReturnFields>;
|
|
19
|
+
query: <ReturnFields = any>(operation: string | GraphQLParams<Model>[], fields?: string[] | HasuraGraphQLFields<Model>, variables?: VariableOptions) => Promise<ReturnFields>;
|
|
18
20
|
getAttributeGraphQLTypeOf: <FieldValue>(value: FieldValue) => string;
|
|
19
|
-
convertDataFromHasura
|
|
21
|
+
convertDataFromHasura(data: Record<string, string | number>, fields?: string[] | HasuraGraphQLFields<Model>): Model;
|
|
20
22
|
convertDataToHasura(instance: Model, update?: boolean): Record<string, string | number>;
|
|
21
23
|
};
|
|
@@ -8,7 +8,7 @@ export declare type ColumnOptions<FieldType, Model, ValueFrom = any> = {
|
|
|
8
8
|
filterType: HasuraGraphQLColumnType | string;
|
|
9
9
|
filters: NestedRepositoryFindFieltersOptions<FieldType>;
|
|
10
10
|
};
|
|
11
|
-
fields?: HasuraGraphQLFields<FieldType
|
|
11
|
+
fields?: HasuraGraphQLFields<FieldType>;
|
|
12
12
|
foreignKeyColumn?: Partial<Record<NonFunctionAndIdentifierPropertyNames<FieldType extends any[] ? FieldType[number] : FieldType>, NonFunctionAndIdentifierPropertyNames<Model> | (string & {})>> | {};
|
|
13
13
|
from?: (value: ValueFrom | ValueFrom[], data?: any) => FieldType;
|
|
14
14
|
to?: (value: FieldType, instance?: Model) => ValueFrom;
|
|
@@ -31,10 +31,14 @@ export declare type AggregateOptions<Model> = {
|
|
|
31
31
|
var_samp?: Array<AggregateOptionFields<Model, number>>;
|
|
32
32
|
variance?: Array<AggregateOptionFields<Model, number>>;
|
|
33
33
|
};
|
|
34
|
-
|
|
34
|
+
declare type ModelBaseHasuraGraphQLFields<Model> = Model extends ModelBaseStructure ? NonFunctionAndIdentifierPropertyNames<Model> | {
|
|
35
35
|
[key in NonFunctionAndIdentifierPropertyNames<Model>]?: PropType<Model, key> extends ModelBaseStructure ? HasuraGraphQLFields<PropType<Model, key>> : PropType<Model, key> extends any[] ? PropType<Model, key>[] extends ModelBaseStructure[] ? HasuraGraphQLFields<PropType<Model, key>[]> : never : never;
|
|
36
36
|
} | {
|
|
37
37
|
[key in NonFunctionAndIdentifierPropertyNames<Model>]?: key extends 'aggregate' ? never : PropType<Model, key> extends ModelBaseStructure ? ColumnOptions<PropType<Model, key>, Model> : ColumnOptions<PropType<Model, key>, Model>;
|
|
38
|
-
} | Record<string, ColumnOptions<PropType<Model, any>, Model>>
|
|
38
|
+
} | Record<string, ColumnOptions<PropType<Model, any>, Model>> : string;
|
|
39
|
+
export declare type HasuraGraphQLFields<Model> = (ModelBaseHasuraGraphQLFields<Model> | {
|
|
39
40
|
aggregate: Array<AggregateOptions<Model> | 'count'>;
|
|
41
|
+
} | {
|
|
42
|
+
returning: NonFunctionAndIdentifierPropertyNames<Model>[];
|
|
40
43
|
} | 'affected_rows')[];
|
|
44
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infrab4a/connect",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.28",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org"
|
|
6
6
|
},
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"axios": "^0.27.2",
|
|
13
13
|
"class-transformer": "^0.5.1",
|
|
14
14
|
"date-fns": "^2.28.0",
|
|
15
|
+
"debug": "^4.3.4",
|
|
15
16
|
"firebase": "^9.9.0",
|
|
16
17
|
"gql-query-builder": "3.7.0",
|
|
17
18
|
"lodash": "^4.17.21",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare type CallbackFnArgs<T, Result> = {
|
|
2
|
+
target: T;
|
|
3
|
+
result: Result;
|
|
4
|
+
args: Array<any>;
|
|
5
|
+
namespace?: Array<string>;
|
|
6
|
+
};
|
|
7
|
+
declare type CallbackFn<T, Result> = (opts: CallbackFnArgs<T, Result>) => void;
|
|
8
|
+
declare type TraceOptions<T, Result> = {
|
|
9
|
+
callbackFn?: CallbackFn<T, Result>;
|
|
10
|
+
level?: 'trace' | 'log';
|
|
11
|
+
};
|
|
12
|
+
export declare function Log<T, Result>(options?: TraceOptions<T, Result>): (target: any, propertyKey: string, propertyDescriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
13
|
+
export declare function Trace<T, Result>(options?: TraceOptions<T, Result>): (target: any, propertyKey: string, propertyDescriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare type DebugOptions = {
|
|
2
|
+
name?: string;
|
|
3
|
+
namespaces?: Array<string>;
|
|
4
|
+
};
|
|
5
|
+
export declare class DebugDecoratorHelper {
|
|
6
|
+
static DebugNamingMetadataKey: string;
|
|
7
|
+
static set(target: object, options: DebugOptions): void;
|
|
8
|
+
static get(target: object): DebugOptions;
|
|
9
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Debugger } from 'debug';
|
|
2
|
+
import { Subject } from 'rxjs';
|
|
3
|
+
export declare type Debuggable = {
|
|
4
|
+
debug: DebugHelper;
|
|
5
|
+
};
|
|
6
|
+
declare type DebugLog = {
|
|
7
|
+
namespace: string;
|
|
8
|
+
message: string;
|
|
9
|
+
args: Array<any>;
|
|
10
|
+
};
|
|
11
|
+
declare type DebugError = {
|
|
12
|
+
namespace: string;
|
|
13
|
+
error: any;
|
|
14
|
+
args: Array<any>;
|
|
15
|
+
};
|
|
16
|
+
export declare const isDebuggable: (object: any) => object is Debuggable;
|
|
17
|
+
export declare class DebugHelper {
|
|
18
|
+
static logs$: Subject<DebugLog>;
|
|
19
|
+
static traces$: Subject<DebugLog>;
|
|
20
|
+
static errors$: Subject<DebugError>;
|
|
21
|
+
static isDebuggable: (object: any) => object is Debuggable;
|
|
22
|
+
static namespacesFor(target: object): Array<string>;
|
|
23
|
+
static as(...namespaces: Array<string>): DebugHelper;
|
|
24
|
+
static for(target: object, ...namespaces: Array<string>): DebugHelper;
|
|
25
|
+
static from(target: object, ...namespaces: Array<string>): DebugHelper;
|
|
26
|
+
static clonedFrom(target: object, ...namespaces: Array<string>): DebugHelper;
|
|
27
|
+
static clone(target: object, ...namespaces: Array<string>): {
|
|
28
|
+
original: DebugHelper;
|
|
29
|
+
debug: DebugHelper;
|
|
30
|
+
};
|
|
31
|
+
static replace(target: any, attrs: {
|
|
32
|
+
with: DebugHelper;
|
|
33
|
+
}): void;
|
|
34
|
+
static mock(target: object, ...namespaces: Array<string>): {
|
|
35
|
+
original: DebugHelper;
|
|
36
|
+
debug: DebugHelper;
|
|
37
|
+
};
|
|
38
|
+
logger: Debugger;
|
|
39
|
+
tracer: Debugger;
|
|
40
|
+
err: Debugger;
|
|
41
|
+
namespaces: Set<string>;
|
|
42
|
+
constructor(...namespace: Array<string>);
|
|
43
|
+
get entries(): Array<string>;
|
|
44
|
+
get namespace(): string;
|
|
45
|
+
log(message?: any, ...args: Array<any>): DebugHelper;
|
|
46
|
+
trace(message?: any, ...args: Array<any>): DebugHelper;
|
|
47
|
+
error(error: any, ...args: Array<any>): DebugHelper;
|
|
48
|
+
build(): DebugHelper;
|
|
49
|
+
with(...namespace: Array<string>): DebugHelper;
|
|
50
|
+
push(...namespace: Array<string>): DebugHelper;
|
|
51
|
+
unshift(...namespace: Array<string>): DebugHelper;
|
|
52
|
+
reset(...namespace: Array<string>): DebugHelper;
|
|
53
|
+
startWith(...namespace: Array<string>): DebugHelper;
|
|
54
|
+
shift(): DebugHelper;
|
|
55
|
+
pop(): DebugHelper;
|
|
56
|
+
clear(): DebugHelper;
|
|
57
|
+
remove(...namespace: Array<string>): DebugHelper;
|
|
58
|
+
puts(...args: Array<string>): string;
|
|
59
|
+
}
|
|
60
|
+
export {};
|