@prisma/client-generator-ts 6.7.0-dev.7 → 6.7.0-dev.9
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/dist/TSClient/Count.d.ts +1 -2
- package/dist/TSClient/Datasources.d.ts +1 -2
- package/dist/TSClient/Enum.d.ts +1 -2
- package/dist/TSClient/FieldRefInput.d.ts +1 -2
- package/dist/TSClient/GenerateContext.d.ts +8 -1
- package/dist/TSClient/Input.d.ts +2 -5
- package/dist/TSClient/Model.d.ts +11 -38
- package/dist/TSClient/ModelFieldRefs.d.ts +1 -2
- package/dist/TSClient/PrismaClient.d.ts +5 -10
- package/dist/TSClient/TSClient.d.ts +3 -3
- package/dist/TSClient/TypeMap.d.ts +2 -0
- package/dist/TSClient/common.d.ts +1 -4
- package/dist/TSClient/file-generators/ClassFile.d.ts +3 -0
- package/dist/TSClient/file-generators/ClientFile.d.ts +3 -0
- package/dist/TSClient/file-generators/CommonInputTypesFile.d.ts +2 -0
- package/dist/TSClient/file-generators/EnumsFile.d.ts +2 -0
- package/dist/TSClient/file-generators/ModelFile.d.ts +2 -0
- package/dist/TSClient/file-generators/ModelsFile.d.ts +2 -0
- package/dist/TSClient/file-generators/PrismaNamespaceFile.d.ts +3 -0
- package/dist/TSClient/index.d.ts +0 -1
- package/dist/TSClient/utils/type-builders.d.ts +1 -0
- package/dist/index.js +2726 -2594
- package/dist/index.mjs +2709 -2577
- package/dist/utils/common.d.ts +1 -9
- package/dist/utils.d.ts +1 -0
- package/package.json +10 -10
- package/dist/TSClient/Generable.d.ts +0 -3
package/dist/TSClient/Count.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as DMMF from '@prisma/dmmf';
|
|
2
2
|
import * as ts from '@prisma/ts-builders';
|
|
3
|
-
import type { Generable } from './Generable';
|
|
4
3
|
import { GenerateContext } from './GenerateContext';
|
|
5
|
-
export declare class Count
|
|
4
|
+
export declare class Count {
|
|
6
5
|
protected readonly type: DMMF.OutputType;
|
|
7
6
|
protected readonly context: GenerateContext;
|
|
8
7
|
constructor(type: DMMF.OutputType, context: GenerateContext);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DataSource } from '@prisma/generator';
|
|
2
|
-
|
|
3
|
-
export declare class Datasources implements Generable {
|
|
2
|
+
export declare class Datasources {
|
|
4
3
|
protected readonly internalDatasources: DataSource[];
|
|
5
4
|
constructor(internalDatasources: DataSource[]);
|
|
6
5
|
toTS(): string;
|
package/dist/TSClient/Enum.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type * as DMMF from '@prisma/dmmf';
|
|
2
|
-
|
|
3
|
-
export declare class Enum implements Generable {
|
|
2
|
+
export declare class Enum {
|
|
4
3
|
protected readonly type: DMMF.SchemaEnum;
|
|
5
4
|
protected readonly useNamespace: boolean;
|
|
6
5
|
constructor(type: DMMF.SchemaEnum, useNamespace: boolean);
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import { GeneratorConfig } from '@prisma/generator';
|
|
2
2
|
import { DMMFHelper } from '../dmmf';
|
|
3
|
+
import { FileNameMapper } from '../file-extensions';
|
|
3
4
|
import { GenericArgsInfo } from '../GenericsArgsInfo';
|
|
4
5
|
export interface GenerateContextOptions {
|
|
5
6
|
dmmf: DMMFHelper;
|
|
6
7
|
genericArgsInfo: GenericArgsInfo;
|
|
8
|
+
runtimeImport: string;
|
|
9
|
+
outputFileName: FileNameMapper;
|
|
10
|
+
importFileName: FileNameMapper;
|
|
7
11
|
generator?: GeneratorConfig;
|
|
8
12
|
}
|
|
9
13
|
export declare class GenerateContext implements GenerateContextOptions {
|
|
10
14
|
dmmf: DMMFHelper;
|
|
11
15
|
genericArgsInfo: GenericArgsInfo;
|
|
16
|
+
runtimeImport: string;
|
|
17
|
+
outputFileName: FileNameMapper;
|
|
18
|
+
importFileName: FileNameMapper;
|
|
12
19
|
generator?: GeneratorConfig;
|
|
13
|
-
constructor({ dmmf, genericArgsInfo, generator }: GenerateContextOptions);
|
|
20
|
+
constructor({ dmmf, genericArgsInfo, runtimeImport, outputFileName, importFileName, generator, }: GenerateContextOptions);
|
|
14
21
|
isPreviewFeatureOn(previewFeature: string): boolean;
|
|
15
22
|
}
|
package/dist/TSClient/Input.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type * as DMMF from '@prisma/dmmf';
|
|
2
2
|
import * as ts from '@prisma/ts-builders';
|
|
3
|
-
import type { Generable } from './Generable';
|
|
4
3
|
import { GenerateContext } from './GenerateContext';
|
|
5
|
-
export declare class InputField
|
|
4
|
+
export declare class InputField {
|
|
6
5
|
protected readonly field: DMMF.SchemaArg;
|
|
7
6
|
protected readonly context: GenerateContext;
|
|
8
7
|
protected readonly source?: string | undefined;
|
|
@@ -10,12 +9,10 @@ export declare class InputField implements Generable {
|
|
|
10
9
|
toTS(): string;
|
|
11
10
|
}
|
|
12
11
|
export declare function buildInputField(field: DMMF.SchemaArg, context: GenerateContext, source?: string): ts.Property;
|
|
13
|
-
export declare class InputType
|
|
12
|
+
export declare class InputType {
|
|
14
13
|
protected readonly type: DMMF.InputType;
|
|
15
14
|
protected readonly context: GenerateContext;
|
|
16
15
|
private generatedName;
|
|
17
16
|
constructor(type: DMMF.InputType, context: GenerateContext);
|
|
18
17
|
toTS(): string;
|
|
19
|
-
overrideName(name: string): this;
|
|
20
|
-
private getTypeName;
|
|
21
18
|
}
|
package/dist/TSClient/Model.d.ts
CHANGED
|
@@ -1,47 +1,20 @@
|
|
|
1
1
|
import * as DMMF from '@prisma/dmmf';
|
|
2
|
-
import * as ts from '@prisma/ts-builders';
|
|
3
|
-
import type { Generable } from './Generable';
|
|
4
2
|
import { GenerateContext } from './GenerateContext';
|
|
5
|
-
export declare class Model
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
export declare class Model {
|
|
4
|
+
private readonly model;
|
|
5
|
+
private readonly context;
|
|
6
|
+
private type;
|
|
7
|
+
private createManyAndReturnType;
|
|
8
|
+
private updateManyAndReturnType;
|
|
9
|
+
private mapping?;
|
|
12
10
|
private dmmf;
|
|
13
11
|
constructor(model: DMMF.Model, context: GenerateContext);
|
|
14
|
-
|
|
12
|
+
private get argsTypes();
|
|
15
13
|
private rootFieldNameForAction;
|
|
16
14
|
private getGroupByTypes;
|
|
17
15
|
private getAggregationTypes;
|
|
18
|
-
|
|
16
|
+
private getDeepInputTypes;
|
|
17
|
+
private getCountTypes;
|
|
18
|
+
private getModelExport;
|
|
19
19
|
toTS(): string;
|
|
20
20
|
}
|
|
21
|
-
export declare class ModelDelegate implements Generable {
|
|
22
|
-
protected readonly outputType: DMMF.OutputType;
|
|
23
|
-
protected readonly context: GenerateContext;
|
|
24
|
-
constructor(outputType: DMMF.OutputType, context: GenerateContext);
|
|
25
|
-
/**
|
|
26
|
-
* Returns all available non-aggregate or group actions
|
|
27
|
-
* Includes both dmmf and client-only actions
|
|
28
|
-
*
|
|
29
|
-
* @param availableActions
|
|
30
|
-
* @returns
|
|
31
|
-
*/
|
|
32
|
-
private getNonAggregateActions;
|
|
33
|
-
toTS(): string;
|
|
34
|
-
}
|
|
35
|
-
type GetReturnTypeOptions = {
|
|
36
|
-
modelName: string;
|
|
37
|
-
actionName: DMMF.ModelAction;
|
|
38
|
-
isChaining?: boolean;
|
|
39
|
-
isNullable?: boolean;
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Get the complicated extract output
|
|
43
|
-
* @param name Model name
|
|
44
|
-
* @param actionName action name
|
|
45
|
-
*/
|
|
46
|
-
export declare function getReturnType({ modelName, actionName, isChaining, isNullable, }: GetReturnTypeOptions): ts.TypeBuilder;
|
|
47
|
-
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as DMMF from '@prisma/dmmf';
|
|
2
|
-
|
|
3
|
-
export declare class ModelFieldRefs implements Generable {
|
|
2
|
+
export declare class ModelFieldRefs {
|
|
4
3
|
protected outputType: DMMF.OutputType;
|
|
5
4
|
constructor(outputType: DMMF.OutputType);
|
|
6
5
|
toTS(): string;
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import type { DataSource } from '@prisma/generator';
|
|
2
|
-
import type { Generable } from './Generable';
|
|
3
1
|
import { GenerateContext } from './GenerateContext';
|
|
4
2
|
import { TSClientOptions } from './TSClient';
|
|
5
|
-
export declare class PrismaClientClass
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
protected readonly runtimeName: TSClientOptions['runtimeName'];
|
|
10
|
-
constructor(context: GenerateContext, internalDatasources: DataSource[], outputDir: string, runtimeName: TSClientOptions['runtimeName']);
|
|
3
|
+
export declare class PrismaClientClass {
|
|
4
|
+
private readonly context;
|
|
5
|
+
private readonly runtimeName;
|
|
6
|
+
constructor(context: GenerateContext, runtimeName: TSClientOptions['runtimeName']);
|
|
11
7
|
private get jsDoc();
|
|
12
|
-
toTSWithoutNamespace(): string;
|
|
13
8
|
toTS(): string;
|
|
14
|
-
private
|
|
9
|
+
private applyPendingMigrationsDefinition;
|
|
15
10
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { O } from 'ts-toolbelt';
|
|
2
2
|
import { DMMFHelper } from '../dmmf';
|
|
3
|
+
import type { FileMap } from '../generateClient';
|
|
3
4
|
import { GenerateClientOptions } from '../generateClient';
|
|
4
5
|
import { GenericArgsInfo } from '../GenericsArgsInfo';
|
|
5
|
-
import { type Generable } from './Generable';
|
|
6
6
|
export type RuntimeName = 'binary' | 'library' | 'wasm' | 'edge' | 'react-native' | 'client' | (string & {});
|
|
7
7
|
export type TSClientOptions = O.Required<GenerateClientOptions, 'runtimeBase'> & {
|
|
8
8
|
/** The name of the runtime bundle to use */
|
|
@@ -10,10 +10,10 @@ export type TSClientOptions = O.Required<GenerateClientOptions, 'runtimeBase'> &
|
|
|
10
10
|
/** When we are generating an edge-compatible client */
|
|
11
11
|
edge: boolean;
|
|
12
12
|
};
|
|
13
|
-
export declare class TSClient
|
|
13
|
+
export declare class TSClient {
|
|
14
14
|
protected readonly options: TSClientOptions;
|
|
15
15
|
protected readonly dmmf: DMMFHelper;
|
|
16
16
|
protected readonly genericsInfo: GenericArgsInfo;
|
|
17
17
|
constructor(options: TSClientOptions);
|
|
18
|
-
|
|
18
|
+
generateClientFiles(): FileMap;
|
|
19
19
|
}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
import type { TSClientOptions } from './TSClient';
|
|
2
|
-
export declare const commonCodeTS: ({
|
|
3
|
-
tsWithoutNamespace: () => string;
|
|
4
|
-
ts: () => string;
|
|
5
|
-
};
|
|
2
|
+
export declare const commonCodeTS: ({ clientVersion, engineVersion, generator }: TSClientOptions) => string;
|
package/dist/TSClient/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { NamedType, TypeBuilder } from '@prisma/ts-builders';
|
|
2
|
+
export declare function omit(type: TypeBuilder, keyType: TypeBuilder): NamedType;
|
|
2
3
|
export declare function promise(resultType: TypeBuilder): NamedType;
|
|
3
4
|
export declare function prismaPromise(resultType: TypeBuilder): NamedType;
|
|
4
5
|
export declare function optional(innerType: TypeBuilder): NamedType;
|