@prisma/config 6.4.0-dev.46 → 6.4.0-dev.48

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.
@@ -1,78 +1,80 @@
1
1
  import type { DriverAdapter as QueryableDriverAdapter } from '@prisma/driver-adapter-utils';
2
- import { Schema } from 'effect';
2
+ import { Schema as Shape } from 'effect';
3
3
  import type { Either } from 'effect/Either';
4
4
  import type { ParseError } from 'effect/ParseResult';
5
- declare const PrismaSchemaConfigSchema: Schema.Union<[Schema.Struct<{
5
+ declare const PrismaSchemaConfigShape: Shape.Union<[Shape.Struct<{
6
6
  /**
7
7
  * Tell Prisma to use a single `.prisma` schema file.
8
8
  */
9
- kind: Schema.Literal<["single"]>;
9
+ kind: Shape.Literal<["single"]>;
10
10
  /**
11
11
  * The path to a single `.prisma` schema file.
12
12
  */
13
- filenamePath: typeof Schema.String;
14
- }>, Schema.Struct<{
13
+ filenamePath: typeof Shape.String;
14
+ }>, Shape.Struct<{
15
15
  /**
16
16
  * Tell Prisma to use multiple `.prisma` schema files, via the `prismaSchemaFolder` preview feature.
17
17
  */
18
- kind: Schema.Literal<["multi"]>;
18
+ kind: Shape.Literal<["multi"]>;
19
19
  /**
20
20
  * The path to a folder containing multiple `.prisma` schema files.
21
21
  * All of the files in this folder will be used.
22
22
  */
23
- folder: typeof Schema.String;
23
+ folder: typeof Shape.String;
24
24
  }>]>;
25
- export type PrismaSchemaConfigSchema = typeof PrismaSchemaConfigSchema.Type;
26
- declare const createPrismaConfigSchema: <Env = any>() => Schema.Struct<{
25
+ export type PrismaSchemaConfigShape = typeof PrismaSchemaConfigShape.Type;
26
+ export declare const createPrismaConfigInternalShape: <Env = any>() => Shape.brand<Shape.Struct<{
27
27
  /**
28
28
  * Whether features with an unstable API are enabled.
29
29
  */
30
- earlyAccess: Schema.Literal<[true]>;
30
+ earlyAccess: Shape.Literal<[true]>;
31
31
  /**
32
32
  * The configuration for the Prisma schema file(s).
33
33
  */
34
- schema: Schema.optional<Schema.Union<[Schema.Struct<{
34
+ schema: Shape.optional<Shape.Union<[Shape.Struct<{
35
35
  /**
36
36
  * Tell Prisma to use a single `.prisma` schema file.
37
37
  */
38
- kind: Schema.Literal<["single"]>;
38
+ kind: Shape.Literal<["single"]>;
39
39
  /**
40
40
  * The path to a single `.prisma` schema file.
41
41
  */
42
- filenamePath: typeof Schema.String;
43
- }>, Schema.Struct<{
42
+ filenamePath: typeof Shape.String;
43
+ }>, Shape.Struct<{
44
44
  /**
45
45
  * Tell Prisma to use multiple `.prisma` schema files, via the `prismaSchemaFolder` preview feature.
46
46
  */
47
- kind: Schema.Literal<["multi"]>;
47
+ kind: Shape.Literal<["multi"]>;
48
48
  /**
49
49
  * The path to a folder containing multiple `.prisma` schema files.
50
50
  * All of the files in this folder will be used.
51
51
  */
52
- folder: typeof Schema.String;
52
+ folder: typeof Shape.String;
53
53
  }>]>>;
54
54
  /**
55
55
  * The configuration for Prisma Studio.
56
56
  */
57
- studio: Schema.optional<Schema.Struct<{
57
+ studio: Shape.optional<Shape.Struct<{
58
58
  /**
59
59
  * Instantiates the Prisma driver adapter to use for Prisma Studio.
60
60
  */
61
- createAdapter: Schema.SchemaClass<(env: Env) => Promise<QueryableDriverAdapter>, (env: Env) => Promise<QueryableDriverAdapter>, never>;
61
+ createAdapter: Shape.SchemaClass<(env: Env) => Promise<QueryableDriverAdapter>, (env: Env) => Promise<QueryableDriverAdapter>, never>;
62
62
  }>>;
63
63
  /**
64
64
  * The path from where the config was loaded.
65
65
  * It's set to `null` if no config file was found and only default config is applied.
66
66
  */
67
- loadedFromFile: Schema.NullOr<typeof Schema.String>;
68
- }>;
67
+ loadedFromFile: Shape.NullOr<typeof Shape.String>;
68
+ }>, "PrismaConfigInternal">;
69
69
  /**
70
- * The configuration for the Prisma Development Kit.
70
+ * The configuration for the Prisma Development Kit, after it has been parsed and processed
71
+ * by the `defineConfig` function.
72
+ * Thanks to the branding, this type is opaque and cannot be constructed directly.
71
73
  */
72
- export type PrismaConfig<Env = any> = ReturnType<typeof createPrismaConfigSchema<Env>>['Type'];
74
+ export type PrismaConfigInternal<Env = any> = ReturnType<typeof createPrismaConfigInternalShape<Env>>['Type'];
73
75
  /**
74
- * Parse a given input object to ensure it conforms to the `PrismaConfig` type schema.
76
+ * Parse a given input object to ensure it conforms to the `PrismaConfig` type Shape.
75
77
  * This function may fail, but it will never throw.
76
78
  */
77
- export declare function parsePrismaConfig<Env = any>(input: unknown): Either<PrismaConfig<Env>, ParseError>;
79
+ export declare function parsePrismaConfigInternalShape<Env = any>(input: unknown): Either<PrismaConfigInternal<Env>, ParseError>;
78
80
  export {};
@@ -29,7 +29,8 @@ var __privateSet = (obj, member, value3, setter) => (__accessCheck(obj, member,
29
29
  // src/PrismaConfig.ts
30
30
  var PrismaConfig_exports = {};
31
31
  __export(PrismaConfig_exports, {
32
- parsePrismaConfig: () => parsePrismaConfig
32
+ createPrismaConfigInternalShape: () => createPrismaConfigInternalShape,
33
+ parsePrismaConfigInternalShape: () => parsePrismaConfigInternalShape
33
34
  });
34
35
  module.exports = __toCommonJS(PrismaConfig_exports);
35
36
 
@@ -22143,7 +22144,7 @@ var ArrayFormatterIssue = class extends (/* @__PURE__ */ Struct({
22143
22144
  };
22144
22145
 
22145
22146
  // src/PrismaConfig.ts
22146
- var createAdapterSchema = () => Schema_exports.declare(
22147
+ var createAdapterShape = () => Schema_exports.declare(
22147
22148
  (input) => {
22148
22149
  return input instanceof Function;
22149
22150
  },
@@ -22153,13 +22154,13 @@ var createAdapterSchema = () => Schema_exports.declare(
22153
22154
  decode: identity
22154
22155
  }
22155
22156
  );
22156
- var createPrismaStudioConfigSchema = () => Schema_exports.Struct({
22157
+ var createPrismaStudioConfigInternalShape = () => Schema_exports.Struct({
22157
22158
  /**
22158
22159
  * Instantiates the Prisma driver adapter to use for Prisma Studio.
22159
22160
  */
22160
- createAdapter: createAdapterSchema()
22161
+ createAdapter: createAdapterShape()
22161
22162
  });
22162
- var PrismaConfigSchemaSingleSchema = Schema_exports.Struct({
22163
+ var PrismaConfigSchemaSingleShape = Schema_exports.Struct({
22163
22164
  /**
22164
22165
  * Tell Prisma to use a single `.prisma` schema file.
22165
22166
  */
@@ -22169,7 +22170,7 @@ var PrismaConfigSchemaSingleSchema = Schema_exports.Struct({
22169
22170
  */
22170
22171
  filenamePath: Schema_exports.String
22171
22172
  });
22172
- var PrismaConfigSchemaMultiSchema = Schema_exports.Struct({
22173
+ var PrismaConfigSchemaMultiShape = Schema_exports.Struct({
22173
22174
  /**
22174
22175
  * Tell Prisma to use multiple `.prisma` schema files, via the `prismaSchemaFolder` preview feature.
22175
22176
  */
@@ -22180,32 +22181,36 @@ var PrismaConfigSchemaMultiSchema = Schema_exports.Struct({
22180
22181
  */
22181
22182
  folder: Schema_exports.String
22182
22183
  });
22183
- var PrismaSchemaConfigSchema = Schema_exports.Union(PrismaConfigSchemaSingleSchema, PrismaConfigSchemaMultiSchema);
22184
- var createPrismaConfigSchema = () => Schema_exports.Struct({
22185
- /**
22186
- * Whether features with an unstable API are enabled.
22187
- */
22188
- earlyAccess: Schema_exports.Literal(true),
22189
- /**
22190
- * The configuration for the Prisma schema file(s).
22191
- */
22192
- schema: Schema_exports.optional(PrismaSchemaConfigSchema),
22193
- /**
22194
- * The configuration for Prisma Studio.
22195
- */
22196
- studio: Schema_exports.optional(createPrismaStudioConfigSchema()),
22197
- /**
22198
- * The path from where the config was loaded.
22199
- * It's set to `null` if no config file was found and only default config is applied.
22200
- */
22201
- loadedFromFile: Schema_exports.NullOr(Schema_exports.String)
22202
- });
22203
- function parsePrismaConfig(input) {
22204
- return Schema_exports.decodeUnknownEither(createPrismaConfigSchema(), {})(input, {
22184
+ var PrismaSchemaConfigShape = Schema_exports.Union(PrismaConfigSchemaSingleShape, PrismaConfigSchemaMultiShape);
22185
+ var createPrismaConfigInternalShape = () => pipe(
22186
+ Schema_exports.Struct({
22187
+ /**
22188
+ * Whether features with an unstable API are enabled.
22189
+ */
22190
+ earlyAccess: Schema_exports.Literal(true),
22191
+ /**
22192
+ * The configuration for the Prisma schema file(s).
22193
+ */
22194
+ schema: Schema_exports.optional(PrismaSchemaConfigShape),
22195
+ /**
22196
+ * The configuration for Prisma Studio.
22197
+ */
22198
+ studio: Schema_exports.optional(createPrismaStudioConfigInternalShape()),
22199
+ /**
22200
+ * The path from where the config was loaded.
22201
+ * It's set to `null` if no config file was found and only default config is applied.
22202
+ */
22203
+ loadedFromFile: Schema_exports.NullOr(Schema_exports.String)
22204
+ }),
22205
+ Schema_exports.brand("PrismaConfigInternal")
22206
+ );
22207
+ function parsePrismaConfigInternalShape(input) {
22208
+ return Schema_exports.decodeUnknownEither(createPrismaConfigInternalShape(), {})(input, {
22205
22209
  onExcessProperty: "error"
22206
22210
  });
22207
22211
  }
22208
22212
  // Annotate the CommonJS export names for ESM import in node:
22209
22213
  0 && (module.exports = {
22210
- parsePrismaConfig
22214
+ createPrismaConfigInternalShape,
22215
+ parsePrismaConfigInternalShape
22211
22216
  });
@@ -1,8 +1,8 @@
1
1
  import type { DeepMutable } from 'effect/Types';
2
- import type { PrismaConfig } from './PrismaConfig';
2
+ import { type PrismaConfigInternal } from './PrismaConfig';
3
3
  /**
4
4
  * All default values for the config shall be set here.
5
5
  * Modules should not have to deal with missing config values and determining a default themselves as far as possible.
6
6
  * => Consistent defaults and centralized top-level control of configuration via the CLI.
7
7
  */
8
- export declare function defaultConfig<Env = any>(): DeepMutable<PrismaConfig<Env>>;
8
+ export declare function defaultConfig<Env = any>(): DeepMutable<PrismaConfigInternal<Env>>;