@nx-ddd/hasura 19.0.0-preview.23 → 19.0.0-preview.25
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/builders/index.d.ts +2 -0
- package/builders/parts/_meta/graphql-query-part.d.ts +12 -0
- package/builders/parts/mutations/create.builder.d.ts +13 -0
- package/builders/parts/mutations/delete.builder.d.ts +12 -0
- package/builders/parts/mutations/index.d.ts +5 -0
- package/builders/parts/mutations/mutations.builder.d.ts +14 -0
- package/builders/parts/mutations/save.builder.d.ts +21 -0
- package/builders/parts/mutations/update.builder.d.ts +13 -0
- package/builders/parts/parts.builder.d.ts +10 -0
- package/builders/parts/queries/get.builder.d.ts +9 -0
- package/builders/parts/queries/index.d.ts +2 -0
- package/builders/parts/queries/queries.builder.d.ts +16 -0
- package/builders/query-builder.d.ts +15 -0
- package/fesm2022/nx-ddd-hasura.mjs +377 -222
- package/fesm2022/nx-ddd-hasura.mjs.map +1 -1
- package/hasura.converter.d.ts +14 -3
- package/hasura.repository.d.ts +16 -19
- package/hasura.service.d.ts +13 -2
- package/index.d.ts +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface TransactionQueryPart {
|
|
2
|
+
queryPart: string;
|
|
3
|
+
variableDefinitions: string[];
|
|
4
|
+
variables: Record<string, any>;
|
|
5
|
+
operationName: string;
|
|
6
|
+
alias?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface TableConfig {
|
|
9
|
+
tableName: string;
|
|
10
|
+
columns: string[];
|
|
11
|
+
pk: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TableConfig, TransactionQueryPart } from '../../parts/_meta/graphql-query-part';
|
|
2
|
+
type CreateData<E> = Omit<E, 'id' | 'createdAt' | 'updatedAt'>;
|
|
3
|
+
export declare class CreateMutationBuilder<E extends {
|
|
4
|
+
id: string;
|
|
5
|
+
}> {
|
|
6
|
+
protected readonly config: TableConfig;
|
|
7
|
+
constructor(config: TableConfig);
|
|
8
|
+
build(data: CreateData<E>, alias?: string): TransactionQueryPart;
|
|
9
|
+
buildMany(data: CreateData<E>[], alias?: string): TransactionQueryPart;
|
|
10
|
+
protected convertToObject(item: CreateData<E>): import("lodash").Dictionary<unknown>;
|
|
11
|
+
protected convertToObjects(items: CreateData<E>[]): import("lodash").Dictionary<unknown>[];
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TableConfig, TransactionQueryPart } from '../../parts/_meta/graphql-query-part';
|
|
2
|
+
export declare class DeleteMutationBuilder {
|
|
3
|
+
protected readonly config: TableConfig;
|
|
4
|
+
constructor(config: TableConfig);
|
|
5
|
+
build({ id }: {
|
|
6
|
+
id: any;
|
|
7
|
+
}): TransactionQueryPart;
|
|
8
|
+
buildMany(params: {
|
|
9
|
+
id: string;
|
|
10
|
+
}[], alias?: string): TransactionQueryPart;
|
|
11
|
+
buildAll(alias?: string): TransactionQueryPart;
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CreateMutationBuilder } from "./create.builder";
|
|
2
|
+
import { UpdateMutationBuilder } from "./update.builder";
|
|
3
|
+
import { SaveMutationBuilder } from "./save.builder";
|
|
4
|
+
import { DeleteMutationBuilder } from "./delete.builder";
|
|
5
|
+
import { TableConfig } from "../_meta/graphql-query-part";
|
|
6
|
+
export declare class HasuraMutationBuilder<E extends {
|
|
7
|
+
id: string;
|
|
8
|
+
}> {
|
|
9
|
+
readonly create: CreateMutationBuilder<E>;
|
|
10
|
+
readonly update: UpdateMutationBuilder<E>;
|
|
11
|
+
readonly save: SaveMutationBuilder<E>;
|
|
12
|
+
readonly delete_: DeleteMutationBuilder;
|
|
13
|
+
constructor(config: TableConfig);
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TableConfig, TransactionQueryPart } from '../../parts/_meta/graphql-query-part';
|
|
2
|
+
interface Options {
|
|
3
|
+
operationName?: string;
|
|
4
|
+
constraint?: string;
|
|
5
|
+
columns?: string[];
|
|
6
|
+
returningColumns?: string[];
|
|
7
|
+
alias?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class SaveMutationBuilder<E = any> {
|
|
10
|
+
protected readonly config: TableConfig;
|
|
11
|
+
constructor(config: TableConfig);
|
|
12
|
+
build(data: Omit<E, 'createdAt' | 'updatedAt'>, { operationName, constraint, columns, returningColumns, alias, }?: Options): TransactionQueryPart;
|
|
13
|
+
buildMany(entities: E[], { operationName, constraint, columns, returningColumns, alias }?: Options): TransactionQueryPart;
|
|
14
|
+
protected buildObject(item: Omit<E, 'createdAt' | 'updatedAt'>): import("lodash").Dictionary<unknown>;
|
|
15
|
+
protected buildObjects(items: Omit<E, 'createdAt' | 'updatedAt'>[]): import("lodash").Dictionary<unknown>[];
|
|
16
|
+
protected buildOnConflict(data: Omit<E, 'createdAt' | 'updatedAt'>, constraint: string, columns: string[]): {
|
|
17
|
+
constraint: string;
|
|
18
|
+
update_columns: string[];
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TableConfig, TransactionQueryPart } from '../../parts/_meta/graphql-query-part';
|
|
2
|
+
export declare class UpdateMutationBuilder<E extends {
|
|
3
|
+
id: string;
|
|
4
|
+
} = any> {
|
|
5
|
+
protected readonly config: TableConfig;
|
|
6
|
+
constructor(config: TableConfig);
|
|
7
|
+
build(data: Partial<E> & {
|
|
8
|
+
id: string;
|
|
9
|
+
}, alias?: string): TransactionQueryPart;
|
|
10
|
+
buildMany(data: Partial<E>[], alias?: string): TransactionQueryPart;
|
|
11
|
+
protected buildObject(item: Partial<E>): any;
|
|
12
|
+
protected buildObjects(items: Partial<E>[]): any[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HasuraMutationBuilder } from './mutations';
|
|
2
|
+
import { QueriesBuilder } from "./queries";
|
|
3
|
+
import { TableConfig } from "./_meta/graphql-query-part";
|
|
4
|
+
export declare class HasuraQueryPartsBuilder<E extends {
|
|
5
|
+
id: string;
|
|
6
|
+
}> {
|
|
7
|
+
readonly mutations: HasuraMutationBuilder<E>;
|
|
8
|
+
readonly queries: QueriesBuilder<E>;
|
|
9
|
+
constructor(config: TableConfig);
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TableConfig, TransactionQueryPart } from "../_meta/graphql-query-part";
|
|
2
|
+
export declare class GetQueryPartBuilder {
|
|
3
|
+
protected config: TableConfig;
|
|
4
|
+
constructor(config: TableConfig);
|
|
5
|
+
build(params: {
|
|
6
|
+
id: string;
|
|
7
|
+
}): TransactionQueryPart;
|
|
8
|
+
buildMany(): TransactionQueryPart;
|
|
9
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TableConfig } from "../_meta/graphql-query-part";
|
|
2
|
+
import { GetQueryPartBuilder } from "./get.builder";
|
|
3
|
+
export declare function makeSubscription(query: any): {
|
|
4
|
+
kind: any;
|
|
5
|
+
definitions: any;
|
|
6
|
+
};
|
|
7
|
+
export declare class QueriesBuilder<E extends {
|
|
8
|
+
id: string;
|
|
9
|
+
}> {
|
|
10
|
+
readonly get: GetQueryPartBuilder;
|
|
11
|
+
constructor(config: TableConfig);
|
|
12
|
+
makeSubscription(query: any): {
|
|
13
|
+
kind: any;
|
|
14
|
+
definitions: any;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TableConfig, TransactionQueryPart } from './parts/_meta/graphql-query-part';
|
|
2
|
+
import { HasuraQueryPartsBuilder } from './parts/parts.builder';
|
|
3
|
+
export declare class HasuraQueryBuilder<E extends {
|
|
4
|
+
id: string;
|
|
5
|
+
}> {
|
|
6
|
+
readonly parts: HasuraQueryPartsBuilder<E>;
|
|
7
|
+
constructor(config: TableConfig);
|
|
8
|
+
buildQuery(part: TransactionQueryPart): string;
|
|
9
|
+
static buildMutation(part: TransactionQueryPart): string;
|
|
10
|
+
buildMutation(part: TransactionQueryPart): string;
|
|
11
|
+
buildTransactionQuery(parts: TransactionQueryPart[]): {
|
|
12
|
+
query: string;
|
|
13
|
+
variables: Record<string, any>;
|
|
14
|
+
};
|
|
15
|
+
}
|