@prisma/client-generator-ts 6.6.0-dev.100

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.
Files changed (63) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +5 -0
  3. package/dist/GenericsArgsInfo.d.ts +18 -0
  4. package/dist/GenericsArgsInfo.test.d.ts +1 -0
  5. package/dist/TSClient/Args.d.ts +43 -0
  6. package/dist/TSClient/Count.d.ts +11 -0
  7. package/dist/TSClient/Datasources.d.ts +7 -0
  8. package/dist/TSClient/DefaultArgsAliases.d.ts +4 -0
  9. package/dist/TSClient/Enum.d.ts +11 -0
  10. package/dist/TSClient/FieldRefInput.d.ts +8 -0
  11. package/dist/TSClient/Generable.d.ts +3 -0
  12. package/dist/TSClient/GenerateContext.d.ts +15 -0
  13. package/dist/TSClient/Input.d.ts +21 -0
  14. package/dist/TSClient/Model.d.ts +47 -0
  15. package/dist/TSClient/ModelFieldRefs.d.ts +8 -0
  16. package/dist/TSClient/Output.d.ts +5 -0
  17. package/dist/TSClient/Payload.d.ts +4 -0
  18. package/dist/TSClient/PrismaClient.d.ts +15 -0
  19. package/dist/TSClient/SelectIncludeOmit.d.ts +25 -0
  20. package/dist/TSClient/TSClient.d.ts +19 -0
  21. package/dist/TSClient/common.d.ts +5 -0
  22. package/dist/TSClient/constants.d.ts +1 -0
  23. package/dist/TSClient/globalOmit.d.ts +3 -0
  24. package/dist/TSClient/helpers.d.ts +6 -0
  25. package/dist/TSClient/index.d.ts +4 -0
  26. package/dist/TSClient/jsdoc.d.ts +20 -0
  27. package/dist/TSClient/utils/getModelActions.d.ts +3 -0
  28. package/dist/TSClient/utils/type-builders.d.ts +4 -0
  29. package/dist/dmmf.d.ts +40 -0
  30. package/dist/externalToInternalDmmf.d.ts +7 -0
  31. package/dist/extractSqliteSources.d.ts +6 -0
  32. package/dist/extractSqliteSources.test.d.ts +1 -0
  33. package/dist/file-extensions.d.ts +16 -0
  34. package/dist/generateClient.d.ts +43 -0
  35. package/dist/generator.d.ts +6 -0
  36. package/dist/getDMMF.d.ts +4 -0
  37. package/dist/index.d.mts +70 -0
  38. package/dist/index.d.ts +70 -0
  39. package/dist/index.js +6442 -0
  40. package/dist/index.mjs +6440 -0
  41. package/dist/module-format.d.ts +13 -0
  42. package/dist/resolveDatasources.d.ts +1 -0
  43. package/dist/resolveDatasources.test.d.ts +1 -0
  44. package/dist/runtime-targets.d.ts +5 -0
  45. package/dist/serializeDatasources.d.ts +4 -0
  46. package/dist/serializeDatasources.test.d.ts +1 -0
  47. package/dist/typedSql/buildDbEnums.d.ts +17 -0
  48. package/dist/typedSql/buildIndex.d.ts +10 -0
  49. package/dist/typedSql/buildTypedQuery.d.ts +12 -0
  50. package/dist/typedSql/mapTypes.d.ts +5 -0
  51. package/dist/typedSql/typedSql.d.ts +15 -0
  52. package/dist/utils/buildDMMF.d.ts +7 -0
  53. package/dist/utils/buildDebugInitialization.d.ts +12 -0
  54. package/dist/utils/buildDirname.d.ts +4 -0
  55. package/dist/utils/buildGetWasmModule.d.ts +13 -0
  56. package/dist/utils/buildInjectableEdgeEnv.d.ts +20 -0
  57. package/dist/utils/buildNFTAnnotations.d.ts +11 -0
  58. package/dist/utils/buildNFTAnnotations.test.d.ts +1 -0
  59. package/dist/utils/common.d.ts +29 -0
  60. package/dist/utils/runtimeImport.d.ts +11 -0
  61. package/dist/utils/types/buildComment.d.ts +6 -0
  62. package/dist/utils.d.ts +36 -0
  63. package/package.json +60 -0
@@ -0,0 +1,13 @@
1
+ import { TsConfigJsonResolved } from 'get-tsconfig';
2
+ import { GeneratedFileExtension } from './file-extensions';
3
+ declare const moduleFormats: readonly ["esm", "cjs"];
4
+ export type ModuleFormat = (typeof moduleFormats)[number];
5
+ export declare function parseModuleFormat(format: string): ModuleFormat;
6
+ export declare function parseModuleFormatFromUnknown(value: unknown): ModuleFormat;
7
+ type InferModuleFormatOptions = {
8
+ tsconfig: TsConfigJsonResolved | undefined;
9
+ generatedFileExtension: GeneratedFileExtension;
10
+ importFileExtension: GeneratedFileExtension;
11
+ };
12
+ export declare function inferModuleFormat({ tsconfig, generatedFileExtension, importFileExtension, }: InferModuleFormatOptions): ModuleFormat;
13
+ export {};
@@ -0,0 +1 @@
1
+ export declare function absolutizeRelativePath(url: string, cwd: string, outputDir: string, absolutePaths?: boolean): string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ declare const supportedRuntimes: readonly ["nodejs", "deno", "deno-deploy", "bun", "workerd", "edge-light", "react-native"];
2
+ export type RuntimeTarget = (typeof supportedRuntimes)[number];
3
+ export declare function parseRuntimeTarget(target: string): RuntimeTarget;
4
+ export declare function parseRuntimeTargetFromUnknown(target: unknown): RuntimeTarget;
5
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { DataSource } from '@prisma/generator';
2
+ import type { DatasourceOverwrite } from './extractSqliteSources';
3
+ export declare function serializeDatasources(datasources: DatasourceOverwrite[]): string;
4
+ export declare function datasourceToDatasourceOverwrite(datasource: DataSource): DatasourceOverwrite;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,17 @@
1
+ import type * as DMMF from '@prisma/dmmf';
2
+ import { SqlQueryOutput } from '@prisma/generator';
3
+ type DbEnum = {
4
+ name: string;
5
+ values: string[];
6
+ };
7
+ export declare class DbEnumsList {
8
+ readonly enums: DbEnum[];
9
+ constructor(enums: readonly DMMF.DatamodelEnum[]);
10
+ isEmpty(): boolean;
11
+ hasEnum(name: string): boolean;
12
+ validJsIdentifiers(): Generator<DbEnum, void, unknown>;
13
+ invalidJsIdentifiers(): Generator<DbEnum, void, unknown>;
14
+ }
15
+ export declare function buildDbEnums(list: DbEnumsList): string;
16
+ export declare function queryUsesEnums(query: SqlQueryOutput, enums: DbEnumsList): boolean;
17
+ export {};
@@ -0,0 +1,10 @@
1
+ import { SqlQueryOutput } from '@prisma/generator';
2
+ import { FileNameMapper } from '../file-extensions';
3
+ import { DbEnumsList } from './buildDbEnums';
4
+ type BuildIndexOptions = {
5
+ queries: SqlQueryOutput[];
6
+ enums: DbEnumsList;
7
+ importName: FileNameMapper;
8
+ };
9
+ export declare function buildIndex({ queries, enums, importName }: BuildIndexOptions): string;
10
+ export {};
@@ -0,0 +1,12 @@
1
+ import { SqlQueryOutput } from '@prisma/generator';
2
+ import { FileNameMapper } from '../file-extensions';
3
+ import { DbEnumsList } from './buildDbEnums';
4
+ type BuildTypedQueryOptions = {
5
+ runtimeBase: string;
6
+ runtimeName: string;
7
+ query: SqlQueryOutput;
8
+ enums: DbEnumsList;
9
+ importName: FileNameMapper;
10
+ };
11
+ export declare function buildTypedQuery({ query, runtimeBase, runtimeName, enums, importName }: BuildTypedQueryOptions): string;
12
+ export {};
@@ -0,0 +1,5 @@
1
+ import { QueryIntrospectionType } from '@prisma/generator';
2
+ import * as ts from '@prisma/ts-builders';
3
+ import { DbEnumsList } from './buildDbEnums';
4
+ export declare function getInputType(introspectionType: QueryIntrospectionType, nullable: boolean, enums: DbEnumsList): ts.TypeBuilder;
5
+ export declare function getOutputType(introspectionType: QueryIntrospectionType, nullable: boolean, enums: DbEnumsList): ts.TypeBuilder;
@@ -0,0 +1,15 @@
1
+ import type * as DMMF from '@prisma/dmmf';
2
+ import { SqlQueryOutput } from '@prisma/generator';
3
+ import { FileNameMapper } from '../file-extensions';
4
+ import { FileMap } from '../generateClient';
5
+ import type { RuntimeName } from '../TSClient/TSClient';
6
+ type TypeSqlBuildOptions = {
7
+ runtimeBase: string;
8
+ runtimeName: RuntimeName;
9
+ dmmf: DMMF.Document;
10
+ queries: SqlQueryOutput[];
11
+ outputName: FileNameMapper;
12
+ importName: FileNameMapper;
13
+ };
14
+ export declare function buildTypedSql({ queries, runtimeBase, runtimeName, dmmf, outputName, importName, }: TypeSqlBuildOptions): FileMap;
15
+ export {};
@@ -0,0 +1,7 @@
1
+ import type * as DMMF from '@prisma/dmmf';
2
+ import { TSClientOptions } from '../TSClient/TSClient';
3
+ /**
4
+ * Given DMMF models, computes runtime datamodel from it and embeds
5
+ * it into generated client.
6
+ */
7
+ export declare function buildRuntimeDataModel(datamodel: DMMF.Datamodel, runtimeName: TSClientOptions['runtimeName']): string;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Builds the code to initialize the `debug` package.
3
+ *
4
+ * The code running in the Edge Client entry point has access to `process.env`
5
+ * if it's defined, but the code in the runtime bundle doesn't. Furthermore, in
6
+ * some environments `DEBUG` may be defined as a global variable rather than
7
+ * available in `process.env`. The entry point fetches the value of `DEBUG` and
8
+ * passes into the `debug` package.
9
+ *
10
+ * @param edge Whether the edge runtime is used
11
+ */
12
+ export declare function buildDebugInitialization(edge: boolean): string;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Builds a `dirname` variable that holds the location of the generated client.
3
+ */
4
+ export declare function buildDirname(edge: boolean): "config.dirname = '/'" | "config.dirname = __dirname";
@@ -0,0 +1,13 @@
1
+ import { ActiveConnectorType } from '@prisma/generator';
2
+ import { ModuleFormat } from '../module-format';
3
+ import { RuntimeTarget } from '../runtime-targets';
4
+ import { RuntimeName } from '../TSClient/TSClient';
5
+ export type BuildWasmModuleOptions = {
6
+ component: 'engine' | 'compiler';
7
+ runtimeName: RuntimeName;
8
+ runtimeBase: string;
9
+ target: RuntimeTarget;
10
+ activeProvider: ActiveConnectorType;
11
+ moduleFormat: ModuleFormat;
12
+ };
13
+ export declare function buildGetWasmModule({ component, runtimeName, runtimeBase, target, activeProvider, moduleFormat, }: BuildWasmModuleOptions): string;
@@ -0,0 +1,20 @@
1
+ import { DataSource } from '@prisma/generator';
2
+ /**
3
+ * Builds an injectable environment for the data proxy edge client. It's useful
4
+ * because it is designed to run in browser-like environments where things like
5
+ * `fs`, `process.env`, and .env file loading are not available. That means env
6
+ * vars are represented as a global variable or injected at build time. This is
7
+ * the glue code to make this work with our existing env var loading logic. It
8
+ * is the place where we make collect the env vars for the edge client. To
9
+ * understand this better, take a look at the generated code in the edge client.
10
+ * @see {@link declareInjectableEdgeEnv}
11
+ * @param edge
12
+ * @param datasources
13
+ * @returns
14
+ */
15
+ export declare function buildInjectableEdgeEnv(edge: boolean, datasources: DataSource[]): string;
16
+ /**
17
+ * Builds the expression to get the value of an environment variable at run time.
18
+ * @param envVarName Name of the environment variable
19
+ */
20
+ export declare function getRuntimeEdgeEnvVar(envVarName: string): string;
@@ -0,0 +1,11 @@
1
+ import type { BinaryTarget } from '@prisma/get-platform';
2
+ import { ClientEngineType } from '@prisma/internals';
3
+ /**
4
+ * Build bundler-like annotations so that Vercel automatically uploads the
5
+ * prisma schema as well as the query engine binaries to the deployments.
6
+ * @param engineType the client engine in use
7
+ * @param binaryTargets the targeted binaryTargets
8
+ * @param relativeOutdir outdir relative to root
9
+ * @returns
10
+ */
11
+ export declare function buildNFTAnnotations(noEngine: boolean, engineType: ClientEngineType, binaryTargets: BinaryTarget[] | undefined, relativeOutdir: string): string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,29 @@
1
+ import type * as DMMF from '@prisma/dmmf';
2
+ export declare const needNamespace: {
3
+ Json: string;
4
+ Decimal: string;
5
+ };
6
+ export declare function needsNamespace(field: DMMF.Field): boolean;
7
+ export declare const GraphQLScalarToJSTypeTable: {
8
+ String: string;
9
+ Int: string;
10
+ Float: string;
11
+ Boolean: string;
12
+ Long: string;
13
+ DateTime: string[];
14
+ ID: string;
15
+ UUID: string;
16
+ Json: string;
17
+ Bytes: string;
18
+ Decimal: string[];
19
+ BigInt: string[];
20
+ };
21
+ export declare const JSOutputTypeToInputType: {
22
+ JsonValue: string;
23
+ };
24
+ export declare const JSTypeToGraphQLType: {
25
+ string: string;
26
+ boolean: string;
27
+ object: string;
28
+ symbol: string;
29
+ };
@@ -0,0 +1,11 @@
1
+ import * as ts from '@prisma/ts-builders';
2
+ type RuntimeExport = keyof typeof import('@prisma/client/runtime/library') & string;
3
+ /**
4
+ * Helps to ensure that when we want to refer to a type or value, imported from runtime Module
5
+ * we are referring to the name, that is actually exported
6
+ *
7
+ * @param name imported name
8
+ */
9
+ export declare function runtimeImport(name: RuntimeExport): string;
10
+ export declare function runtimeImportedType(name: RuntimeExport): ts.NamedType;
11
+ export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Build comments for generating ts docs
3
+ * @param documentation
4
+ * @returns
5
+ */
6
+ export declare function buildComment(documentation?: string): string;
@@ -0,0 +1,36 @@
1
+ import * as DMMF from '@prisma/dmmf';
2
+ import * as ts from '@prisma/ts-builders';
3
+ import { GenerateContext } from './TSClient/GenerateContext';
4
+ export declare function getSelectName(modelName: string): string;
5
+ export declare function getSelectCreateManyAndReturnName(modelName: string): string;
6
+ export declare function getSelectUpdateManyAndReturnName(modelName: string): string;
7
+ export declare function getIncludeName(modelName: string): string;
8
+ export declare function getIncludeCreateManyAndReturnName(modelName: string): string;
9
+ export declare function getIncludeUpdateManyAndReturnName(modelName: string): string;
10
+ export declare function getCreateManyAndReturnOutputType(modelName: string): string;
11
+ export declare function getUpdateManyAndReturnOutputType(modelName: string): string;
12
+ export declare function getOmitName(modelName: string): string;
13
+ export declare function getAggregateName(modelName: string): string;
14
+ export declare function getGroupByName(modelName: string): string;
15
+ export declare function getAvgAggregateName(modelName: string): string;
16
+ export declare function getSumAggregateName(modelName: string): string;
17
+ export declare function getMinAggregateName(modelName: string): string;
18
+ export declare function getMaxAggregateName(modelName: string): string;
19
+ export declare function getCountAggregateInputName(modelName: string): string;
20
+ export declare function getCountAggregateOutputName(modelName: string): string;
21
+ export declare function getAggregateInputType(aggregateOutputType: string): string;
22
+ export declare function getGroupByArgsName(modelName: string): string;
23
+ export declare function getGroupByPayloadName(modelName: string): string;
24
+ export declare function getAggregateArgsName(modelName: string): string;
25
+ export declare function getAggregateGetName(modelName: string): string;
26
+ export declare function getAggregateScalarGetName(modelName: string): string;
27
+ export declare function getFieldArgName(field: DMMF.SchemaField, modelName: string): string;
28
+ export declare function getModelFieldArgsName(field: DMMF.SchemaField, modelName: string): string;
29
+ export declare function getModelArgName(modelName: string, action?: DMMF.ModelAction): string;
30
+ export declare function getPayloadName(modelName: string, namespace?: boolean): string;
31
+ export declare function getFieldRefsTypeName(name: string): string;
32
+ export declare function getType(name: string, isList: boolean, isOptional?: boolean): string;
33
+ export declare function capitalize(str: string): string;
34
+ export declare function getRefAllowedTypeName(type: DMMF.OutputTypeRef): string;
35
+ export declare function appendSkipType(context: GenerateContext, type: ts.TypeBuilder): ts.TypeBuilder;
36
+ export declare const extArgsParam: ts.GenericParameter;
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@prisma/client-generator-ts",
3
+ "version": "6.6.0-dev.100",
4
+ "description": "This package is intended for Prisma's internal use",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "require": {
11
+ "types": "./dist/index.d.ts",
12
+ "default": "./dist/index.js"
13
+ },
14
+ "import": {
15
+ "types": "./dist/index.d.mts",
16
+ "default": "./dist/index.mjs"
17
+ }
18
+ }
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "https://github.com/prisma/prisma.git",
23
+ "directory": "packages/client-generator-ts"
24
+ },
25
+ "license": "Apache-2.0",
26
+ "dependencies": {
27
+ "@antfu/ni": "0.21.12",
28
+ "@prisma/engines-version": "6.6.0-46.dc2c1279f201ab67d96815a69b3a831a2f89c207",
29
+ "ci-info": "4.2.0",
30
+ "fast-glob": "3.3.3",
31
+ "get-tsconfig": "4.10.0",
32
+ "indent-string": "4.0.0",
33
+ "klona": "2.0.6",
34
+ "pkg-up": "3.1.0",
35
+ "pluralize": "8.0.0",
36
+ "ts-pattern": "5.6.2",
37
+ "@prisma/client-common": "6.6.0-dev.100",
38
+ "@prisma/dmmf": "6.6.0-dev.100",
39
+ "@prisma/debug": "6.6.0-dev.100",
40
+ "@prisma/fetch-engine": "6.6.0-dev.100",
41
+ "@prisma/generator": "6.6.0-dev.100",
42
+ "@prisma/get-platform": "6.6.0-dev.100",
43
+ "@prisma/internals": "6.6.0-dev.100",
44
+ "@prisma/ts-builders": "6.6.0-dev.100"
45
+ },
46
+ "devDependencies": {
47
+ "@types/pluralize": "0.0.33",
48
+ "strip-ansi": "7.1.0",
49
+ "vitest": "3.0.9"
50
+ },
51
+ "files": [
52
+ "dist"
53
+ ],
54
+ "sideEffects": false,
55
+ "scripts": {
56
+ "dev": "DEV=true tsx helpers/build.ts",
57
+ "build": "tsx helpers/build.ts",
58
+ "test": "vitest run --testTimeout 30000"
59
+ }
60
+ }