🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@prisma-next/emitter

Package Overview
Dependencies
Maintainers
4
Versions
1059
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prisma-next/emitter - npm Package Compare versions

Comparing version
0.15.0-dev.16
to
0.15.0-dev.22
+62
dist/domain-type-generation-egQOP6Jp.d.mts
import { ContractField, ContractModelBase, ContractValueObject, CrossReference, JsonValue } from "@prisma-next/contract/types";
import { CodecLookup } from "@prisma-next/framework-components/codec";
import { TypesImportSpec } from "@prisma-next/framework-components/emission";
//#region src/domain-type-generation.d.ts
declare function serializeValue(value: unknown): string;
declare function serializeObjectKey(key: string): string;
declare function serializeNamespaceId(value: string): string;
declare function serializeCrossReference(ref: CrossReference): string;
declare function generateRootsType(roots: Record<string, CrossReference> | undefined): string;
declare function generateModelFieldEntry(fieldName: string, field: ContractField): string;
declare function generateModelFieldsType(fields: Record<string, ContractField>): string;
declare function generateModelRelationsType(relations: Record<string, unknown>): string;
declare function generateModelsType(models: Record<string, ContractModelBase>, generateModelStorage: (modelName: string, model: ContractModelBase) => string): string;
declare function deduplicateImports(imports: TypesImportSpec[]): TypesImportSpec[];
declare function generateImportLines(imports: TypesImportSpec[]): string[];
declare function generateCodecTypeIntersection(imports: ReadonlyArray<TypesImportSpec>, named: string): string;
declare function serializeExecutionType(execution: Record<string, unknown>): string;
declare function generateHashTypeAliases(hashes: {
readonly storageHash: string;
readonly executionHash?: string;
readonly profileHash: string;
}): string;
type ResolvedFieldType = {
readonly input: string;
readonly output: string;
};
type FieldTypeParamsResolver = (modelName: string, fieldName: string, model: ContractModelBase) => Record<string, unknown> | undefined;
/**
* A field's permitted values (codec-encoded) plus the codec that types them, as supplied by the
* family-specific {@link EmissionSpi.resolveFieldValueSet}. The framework renders these into a TS
* literal union through the codec seam ({@link renderValueSetType}).
*/
type ResolvedFieldValueSet = {
readonly encodedValues: readonly JsonValue[];
readonly codecId: string;
};
type FieldValueSetResolver = (modelName: string, fieldName: string, model: ContractModelBase) => ResolvedFieldValueSet | undefined;
/**
* Renders a value set (a field/column's permitted values, codec-encoded) into a TS literal union by
* routing **each** value through the codec's `renderValueLiteral` — the seam owned by the codec, not
* a generic serializer. `side`: `output` = read type, `input` = create/update type.
*
* Returns `undefined` — signalling the caller to fall back to the codec's full output type — when
* the lookup is absent, has no `renderValueLiteralFor`, the value set is empty, or **any** value
* isn't literal-expressible. A caller that needs column and field types to agree shares this so both
* compute the union identically.
*/
declare function renderValueSetType(values: readonly JsonValue[], codecId: string, side: 'output' | 'input', codecLookup: CodecLookup | undefined): string | undefined;
declare function resolveFieldType(field: ContractField, codecLookup?: CodecLookup, resolvedTypeParams?: Record<string, unknown>, resolvedValueSet?: ResolvedFieldValueSet): ResolvedFieldType;
declare function generateFieldResolvedType(field: ContractField, codecLookup?: CodecLookup, side?: 'input' | 'output'): string;
declare function generateBothFieldTypesMaps(models: Record<string, ContractModelBase> | undefined, codecLookup?: CodecLookup, resolveFieldTypeParams?: FieldTypeParamsResolver, resolveFieldValueSet?: FieldValueSetResolver): ResolvedFieldType;
declare function generateFieldTypesMapsByNamespace(namespaceModels: ReadonlyArray<readonly [string, Record<string, ContractModelBase>]>, codecLookup?: CodecLookup, resolveFieldTypeParams?: FieldTypeParamsResolver, resolveFieldValueSet?: FieldValueSetResolver): ResolvedFieldType;
declare function generateFieldOutputTypesMap(models: Record<string, ContractModelBase> | undefined, codecLookup?: CodecLookup, resolveFieldTypeParams?: FieldTypeParamsResolver): string;
declare function generateFieldInputTypesMap(models: Record<string, ContractModelBase> | undefined, codecLookup?: CodecLookup, resolveFieldTypeParams?: FieldTypeParamsResolver): string;
declare function generateValueObjectType(_voName: string, vo: ContractValueObject, _valueObjects: Record<string, ContractValueObject>, side?: 'input' | 'output', codecLookup?: CodecLookup): string;
declare function resolveValueObjectType(_voName: string, vo: ContractValueObject, _valueObjects: Record<string, ContractValueObject>, codecLookup?: CodecLookup): ResolvedFieldType;
declare function generateContractFieldDescriptor(fieldName: string, field: ContractField): string;
declare function generateValueObjectsDescriptorType(valueObjects: Record<string, ContractValueObject> | undefined): string;
declare function generateValueObjectTypeAliases(valueObjects: Record<string, ContractValueObject> | undefined, codecLookup?: CodecLookup): string;
//#endregion
export { serializeValue as A, renderValueSetType as C, serializeExecutionType as D, serializeCrossReference as E, serializeNamespaceId as O, generateValueObjectsDescriptorType as S, resolveValueObjectType as T, generateModelRelationsType as _, deduplicateImports as a, generateValueObjectType as b, generateContractFieldDescriptor as c, generateFieldResolvedType as d, generateFieldTypesMapsByNamespace as f, generateModelFieldsType as g, generateModelFieldEntry as h, ResolvedFieldValueSet as i, serializeObjectKey as k, generateFieldInputTypesMap as l, generateImportLines as m, FieldValueSetResolver as n, generateBothFieldTypesMaps as o, generateHashTypeAliases as p, ResolvedFieldType as r, generateCodecTypeIntersection as s, FieldTypeParamsResolver as t, generateFieldOutputTypesMap as u, generateModelsType as v, resolveFieldType as w, generateValueObjectTypeAliases as x, generateRootsType as y };
//# sourceMappingURL=domain-type-generation-egQOP6Jp.d.mts.map
{"version":3,"file":"domain-type-generation-egQOP6Jp.d.mts","names":[],"sources":["../src/domain-type-generation.ts"],"mappings":";;;;iBAcgB,eAAe;iBA+Bf,mBAAmB;iBAOnB,qBAAqB;iBAIrB,wBAAwB,KAAK;iBAO7B,kBAAkB,OAAO,eAAe;iBAgBxC,wBAAwB,mBAAmB,OAAO;iBAgBlD,wBAAwB,QAAQ,eAAe;iBAQ/C,2BAA2B,WAAW;iBA4EtC,mBACd,QAAQ,eAAe,oBACvB,uBAAuB,mBAAmB,OAAO;iBAqCnC,mBAAmB,SAAS,oBAAoB;iBAahD,oBAAoB,SAAS;iBAW7B,8BACd,SAAS,cAAc,kBACvB;iBAMc,uBAAuB,WAAW;iBASlC,wBAAwB;WAC7B;WACA;WACA;;KAaC;WAA+B;WAAwB;;KAUvD,2BACV,mBACA,mBACA,OAAO,sBACJ;;;;;;KAOO;WACD,wBAAwB;WACxB;;KAGC,yBACV,mBACA,mBACA,OAAO,sBACJ;;;;;;;;;;;iBAYW,mBACd,iBAAiB,aACjB,iBACA,0BACA,aAAa;iBAYC,iBACd,OAAO,eACP,cAAc,aACd,qBAAqB,yBACrB,mBAAmB,wBAClB;iBA2Ea,0BACd,OAAO,eACP,cAAc,aACd;iBAKc,2BACd,QAAQ,eAAe,gCACvB,cAAc,aACd,yBAAyB,yBACzB,uBAAuB,wBACtB;iBA6Ca,kCACd,iBAAiB,gCAAgC,eAAe,sBAChE,cAAc,aACd,yBAAyB,yBACzB,uBAAuB,wBACtB;iBAyBa,4BACd,QAAQ,eAAe,gCACvB,cAAc,aACd,yBAAyB;iBAKX,2BACd,QAAQ,eAAe,gCACvB,cAAc,aACd,yBAAyB;iBAKX,wBACd,iBACA,IAAI,qBACJ,eAAe,eAAe,sBAC9B,2BACA,cAAc;iBAKA,uBACd,iBACA,IAAI,qBACJ,eAAe,eAAe,sBAC9B,cAAc,cACb;iBAgBa,gCAAgC,mBAAmB,OAAO;iBAoB1D,mCACd,cAAc,eAAe;iBAoBf,+BACd,cAAc,eAAe,kCAC7B,cAAc"}
import "./domain-type-generation-egQOP6Jp.mjs";
import { PreserveEmptyPredicate, SerializeContract, StorageSort } from "@prisma-next/contract/hashing";
import { Contract } from "@prisma-next/contract/types";
import { CodecLookup } from "@prisma-next/framework-components/codec";
import { EmissionSpi, GenerateContractTypesOptions, TypesImportSpec } from "@prisma-next/framework-components/emission";
//#region src/artifact-paths.d.ts
interface EmittedArtifactPaths {
readonly jsonPath: string;
readonly dtsPath: string;
}
declare function getEmittedArtifactPaths(outputJsonPath: string): EmittedArtifactPaths;
//#endregion
//#region src/emit-types.d.ts
/**
* The subset of ControlStack that emit() reads.
* All fields are optional so tests can pass minimal objects.
* A full ControlStack satisfies this via structural typing.
*/
interface EmitStackInput {
readonly codecTypeImports?: ReadonlyArray<TypesImportSpec>;
readonly queryOperationTypeImports?: ReadonlyArray<TypesImportSpec>;
readonly extensionIds?: ReadonlyArray<string>;
readonly codecLookup?: CodecLookup;
}
interface EmitOptions {
readonly outputJsonPath?: string;
/**
* Per-target serializer that converts the in-memory contract into its
* canonical on-disk JsonObject shape before the framework's
* key-ordering / default-omission walk runs. Threaded from the
* descriptor (`descriptor.contractSerializer.serializeContract`) at
* the CLI / control-API call site so target classes decide what
* appears in the JSON envelope rather than the framework guessing
* via property enumerability.
*/
readonly serializeContract: SerializeContract;
/**
* Optional family-contributed preserve-empty predicate. Threaded from
* `descriptor.contractSerializer.shouldPreserveEmpty` when present.
*/
readonly shouldPreserveEmpty?: PreserveEmptyPredicate;
/**
* Optional family-contributed storage sort hook. Threaded from
* `descriptor.contractSerializer.sortStorage` when present.
*/
readonly sortStorage?: StorageSort;
}
interface EmitResult {
readonly contractJson: string;
readonly contractDts: string;
readonly storageHash: string;
readonly executionHash?: string;
readonly profileHash: string;
}
//#endregion
//#region src/emit.d.ts
declare function emit(contract: Contract, stack: EmitStackInput, targetFamily: EmissionSpi, options: EmitOptions): Promise<EmitResult>;
//#endregion
//#region src/generate-contract-dts.d.ts
declare function generateContractDts(contract: Contract, emitter: EmissionSpi, codecTypeImports: ReadonlyArray<TypesImportSpec>, hashes: {
readonly storageHash: string;
readonly executionHash?: string;
readonly profileHash: string;
}, options?: GenerateContractTypesOptions, codecLookup?: CodecLookup): string;
//#endregion
export { EmitStackInput as a, EmitResult as i, emit as n, EmittedArtifactPaths as o, EmitOptions as r, getEmittedArtifactPaths as s, generateContractDts as t };
//# sourceMappingURL=index-P9tB7OkF.d.mts.map
{"version":3,"file":"index-P9tB7OkF.d.mts","names":[],"sources":["../src/artifact-paths.ts","../src/emit-types.ts","../src/emit.ts","../src/generate-contract-dts.ts"],"mappings":";;;;;;UAEiB;WACN;WACA;;iBAGK,wBAAwB,yBAAyB;;;;;;;;UCMhD;WACN,mBAAmB,cAAc;WACjC,4BAA4B,cAAc;WAC1C,eAAe;WACf,cAAc;;UAGR;WACN;;;;;;;;;;WAUA,mBAAmB;;;;;WAKnB,sBAAsB;;;;;WAKtB,cAAc;;UAGR;WACN;WACA;WACA;WACA;WACA;;;;iBCtCW,KACpB,UAAU,UACV,OAAO,gBACP,cAAc,aACd,SAAS,cACR,QAAQ;;;iBCyBK,oBACd,UAAU,UACV,SAAS,aACT,kBAAkB,cAAc,kBAChC;WACW;WACA;WACA;GAEX,UAAU,8BACV,cAAc"}
+1
-1

@@ -1,2 +0,2 @@

import { A as serializeValue, C as renderValueSetType, D as serializeExecutionType, E as serializeCrossReference, O as serializeNamespaceId, S as generateValueObjectsDescriptorType, T as resolveValueObjectType, _ as generateModelRelationsType, a as deduplicateImports, b as generateValueObjectType, c as generateContractFieldDescriptor, d as generateFieldResolvedType, f as generateFieldTypesMapsByNamespace, g as generateModelFieldsType, h as generateModelFieldEntry, i as ResolvedFieldValueSet, k as serializeObjectKey, l as generateFieldInputTypesMap, m as generateImportLines, n as FieldValueSetResolver, o as generateBothFieldTypesMaps, p as generateHashTypeAliases, r as ResolvedFieldType, s as generateCodecTypeIntersection, t as FieldTypeParamsResolver, u as generateFieldOutputTypesMap, v as generateModelsType, w as resolveFieldType, x as generateValueObjectTypeAliases, y as generateRootsType } from "./domain-type-generation-BYr4LZNS.mjs";
import { A as serializeValue, C as renderValueSetType, D as serializeExecutionType, E as serializeCrossReference, O as serializeNamespaceId, S as generateValueObjectsDescriptorType, T as resolveValueObjectType, _ as generateModelRelationsType, a as deduplicateImports, b as generateValueObjectType, c as generateContractFieldDescriptor, d as generateFieldResolvedType, f as generateFieldTypesMapsByNamespace, g as generateModelFieldsType, h as generateModelFieldEntry, i as ResolvedFieldValueSet, k as serializeObjectKey, l as generateFieldInputTypesMap, m as generateImportLines, n as FieldValueSetResolver, o as generateBothFieldTypesMaps, p as generateHashTypeAliases, r as ResolvedFieldType, s as generateCodecTypeIntersection, t as FieldTypeParamsResolver, u as generateFieldOutputTypesMap, v as generateModelsType, w as resolveFieldType, x as generateValueObjectTypeAliases, y as generateRootsType } from "./domain-type-generation-egQOP6Jp.mjs";
export { FieldTypeParamsResolver, FieldValueSetResolver, ResolvedFieldType, ResolvedFieldValueSet, deduplicateImports, generateBothFieldTypesMaps, generateCodecTypeIntersection, generateContractFieldDescriptor, generateFieldInputTypesMap, generateFieldOutputTypesMap, generateFieldResolvedType, generateFieldTypesMapsByNamespace, generateHashTypeAliases, generateImportLines, generateModelFieldEntry, generateModelFieldsType, generateModelRelationsType, generateModelsType, generateRootsType, generateValueObjectType, generateValueObjectTypeAliases, generateValueObjectsDescriptorType, renderValueSetType, resolveFieldType, resolveValueObjectType, serializeCrossReference, serializeExecutionType, serializeNamespaceId, serializeObjectKey, serializeValue };

@@ -1,3 +0,3 @@

import { A as serializeValue, _ as generateModelRelationsType, a as deduplicateImports, k as serializeObjectKey, m as generateImportLines, p as generateHashTypeAliases, s as generateCodecTypeIntersection, u as generateFieldOutputTypesMap, y as generateRootsType } from "../domain-type-generation-BYr4LZNS.mjs";
import { a as EmitStackInput, i as EmitResult, n as emit, o as EmittedArtifactPaths, r as EmitOptions, s as getEmittedArtifactPaths, t as generateContractDts } from "../index-Cjiwoga9.mjs";
import { A as serializeValue, _ as generateModelRelationsType, a as deduplicateImports, k as serializeObjectKey, m as generateImportLines, p as generateHashTypeAliases, s as generateCodecTypeIntersection, u as generateFieldOutputTypesMap, y as generateRootsType } from "../domain-type-generation-egQOP6Jp.mjs";
import { a as EmitStackInput, i as EmitResult, n as emit, o as EmittedArtifactPaths, r as EmitOptions, s as getEmittedArtifactPaths, t as generateContractDts } from "../index-P9tB7OkF.mjs";
export { type EmitOptions, type EmitResult, type EmitStackInput, type EmittedArtifactPaths, deduplicateImports, emit, generateCodecTypeIntersection, generateContractDts, generateFieldOutputTypesMap, generateHashTypeAliases, generateImportLines, generateModelRelationsType, generateRootsType, getEmittedArtifactPaths, serializeObjectKey, serializeValue };

@@ -1,5 +0,4 @@

import { a as EmitStackInput, i as EmitResult, r as EmitOptions } from "../index-Cjiwoga9.mjs";
import { a as EmitStackInput, i as EmitResult, r as EmitOptions } from "../index-P9tB7OkF.mjs";
import { Contract, CrossReference } from "@prisma-next/contract/types";
import { EmissionSpi } from "@prisma-next/framework-components/emission";
//#region test/utils.d.ts

@@ -6,0 +5,0 @@ /**

@@ -1,1 +0,1 @@

{"version":3,"file":"utils.d.mts","names":[],"sources":["../../test/utils.ts"],"mappings":";;;;;;;AA2CA;;;iBAAgB,IAAA,CACd,QAAA,EAAU,QAAA,EACV,KAAA,EAAO,cAAA,EACP,MAAA,EAAQ,WAAA,EACR,OAAA,GAAU,IAAA,CAAK,WAAA,yBACd,OAAA,CAAQ,UAAA;AAAA,KAQN,qBAAA;EACH,MAAA;EACA,YAAA;EACA,KAAA,GAAQ,MAAA,SAAe,cAAA;EACvB,MAAA,GAAS,MAAA;EACT,YAAA,GAAe,MAAA;EACf,IAAA,GAAO,MAAA;EACP,OAAA,GAAU,MAAA;EACV,YAAA,GAAe,MAAA,SAAe,MAAA;EAC9B,cAAA,GAAiB,MAAA;EACjB,SAAA,GAAY,MAAA;EACZ,IAAA,GAAO,MAAA;EACP,WAAA;EACA,aAAA;EACA,OAAA,GAAU,MAAA;AAAA;;iBAII,2BAAA,CACd,IAAA,EAAM,MAAA,oBACL,MAAM;AAAA,iBAoBO,kBAAA,CAAmB,SAAA,GAAW,qBAAA,GAA6B,QAAQ"}
{"version":3,"file":"utils.d.mts","names":[],"sources":["../../test/utils.ts"],"mappings":";;;;;;;;;iBA2CgB,KACd,UAAU,UACV,OAAO,gBACP,QAAQ,aACR,UAAU,KAAK,oCACd,QAAQ;KAQN;EACH;EACA;EACA,QAAQ,eAAe;EACvB,SAAS;EACT,eAAe;EACf,OAAO;EACP,UAAU;EACV,eAAe,eAAe;EAC9B,iBAAiB;EACjB,YAAY;EACZ,OAAO;EACP;EACA;EACA,UAAU;;;iBAII,4BACd,MAAM,0BACL;iBAoBa,mBAAmB,YAAW,wBAA6B"}

@@ -1,1 +0,1 @@

{"version":3,"file":"type-expression-safety.d.mts","names":[],"sources":["../src/type-expression-safety.ts"],"mappings":";iBAAgB,oBAAA,CAAqB,IAAY"}
{"version":3,"file":"type-expression-safety.d.mts","names":[],"sources":["../src/type-expression-safety.ts"],"mappings":";iBAAgB,qBAAqB"}
{
"name": "@prisma-next/emitter",
"version": "0.15.0-dev.16",
"version": "0.15.0-dev.22",
"license": "Apache-2.0",

@@ -8,16 +8,16 @@ "type": "module",

"dependencies": {
"@prisma-next/contract": "0.15.0-dev.16",
"@prisma-next/framework-components": "0.15.0-dev.16",
"@prisma-next/operations": "0.15.0-dev.16",
"@prisma-next/ts-render": "0.15.0-dev.16",
"@prisma-next/utils": "0.15.0-dev.16",
"@prisma-next/contract": "0.15.0-dev.22",
"@prisma-next/framework-components": "0.15.0-dev.22",
"@prisma-next/operations": "0.15.0-dev.22",
"@prisma-next/ts-render": "0.15.0-dev.22",
"@prisma-next/utils": "0.15.0-dev.22",
"arktype": "^2.2.2",
"prettier": "^3.9.4"
"prettier": "^3.9.5"
},
"devDependencies": {
"@prisma-next/test-utils": "0.15.0-dev.16",
"@prisma-next/tsconfig": "0.15.0-dev.16",
"@prisma-next/test-utils": "0.15.0-dev.22",
"@prisma-next/tsconfig": "0.15.0-dev.22",
"@types/node": "25.9.4",
"@prisma-next/tsdown": "0.15.0-dev.16",
"tsdown": "0.22.3",
"@prisma-next/tsdown": "0.15.0-dev.22",
"tsdown": "0.22.8",
"typescript": "5.9.3",

@@ -24,0 +24,0 @@ "vitest": "4.1.10"

import { ContractField, ContractModelBase, ContractValueObject, CrossReference, JsonValue } from "@prisma-next/contract/types";
import { CodecLookup } from "@prisma-next/framework-components/codec";
import { TypesImportSpec } from "@prisma-next/framework-components/emission";
//#region src/domain-type-generation.d.ts
declare function serializeValue(value: unknown): string;
declare function serializeObjectKey(key: string): string;
declare function serializeNamespaceId(value: string): string;
declare function serializeCrossReference(ref: CrossReference): string;
declare function generateRootsType(roots: Record<string, CrossReference> | undefined): string;
declare function generateModelFieldEntry(fieldName: string, field: ContractField): string;
declare function generateModelFieldsType(fields: Record<string, ContractField>): string;
declare function generateModelRelationsType(relations: Record<string, unknown>): string;
declare function generateModelsType(models: Record<string, ContractModelBase>, generateModelStorage: (modelName: string, model: ContractModelBase) => string): string;
declare function deduplicateImports(imports: TypesImportSpec[]): TypesImportSpec[];
declare function generateImportLines(imports: TypesImportSpec[]): string[];
declare function generateCodecTypeIntersection(imports: ReadonlyArray<TypesImportSpec>, named: string): string;
declare function serializeExecutionType(execution: Record<string, unknown>): string;
declare function generateHashTypeAliases(hashes: {
readonly storageHash: string;
readonly executionHash?: string;
readonly profileHash: string;
}): string;
type ResolvedFieldType = {
readonly input: string;
readonly output: string;
};
type FieldTypeParamsResolver = (modelName: string, fieldName: string, model: ContractModelBase) => Record<string, unknown> | undefined;
/**
* A field's permitted values (codec-encoded) plus the codec that types them, as supplied by the
* family-specific {@link EmissionSpi.resolveFieldValueSet}. The framework renders these into a TS
* literal union through the codec seam ({@link renderValueSetType}).
*/
type ResolvedFieldValueSet = {
readonly encodedValues: readonly JsonValue[];
readonly codecId: string;
};
type FieldValueSetResolver = (modelName: string, fieldName: string, model: ContractModelBase) => ResolvedFieldValueSet | undefined;
/**
* Renders a value set (a field/column's permitted values, codec-encoded) into a TS literal union by
* routing **each** value through the codec's `renderValueLiteral` — the seam owned by the codec, not
* a generic serializer. `side`: `output` = read type, `input` = create/update type.
*
* Returns `undefined` — signalling the caller to fall back to the codec's full output type — when
* the lookup is absent, has no `renderValueLiteralFor`, the value set is empty, or **any** value
* isn't literal-expressible. A caller that needs column and field types to agree shares this so both
* compute the union identically.
*/
declare function renderValueSetType(values: readonly JsonValue[], codecId: string, side: 'output' | 'input', codecLookup: CodecLookup | undefined): string | undefined;
declare function resolveFieldType(field: ContractField, codecLookup?: CodecLookup, resolvedTypeParams?: Record<string, unknown>, resolvedValueSet?: ResolvedFieldValueSet): ResolvedFieldType;
declare function generateFieldResolvedType(field: ContractField, codecLookup?: CodecLookup, side?: 'input' | 'output'): string;
declare function generateBothFieldTypesMaps(models: Record<string, ContractModelBase> | undefined, codecLookup?: CodecLookup, resolveFieldTypeParams?: FieldTypeParamsResolver, resolveFieldValueSet?: FieldValueSetResolver): ResolvedFieldType;
declare function generateFieldTypesMapsByNamespace(namespaceModels: ReadonlyArray<readonly [string, Record<string, ContractModelBase>]>, codecLookup?: CodecLookup, resolveFieldTypeParams?: FieldTypeParamsResolver, resolveFieldValueSet?: FieldValueSetResolver): ResolvedFieldType;
declare function generateFieldOutputTypesMap(models: Record<string, ContractModelBase> | undefined, codecLookup?: CodecLookup, resolveFieldTypeParams?: FieldTypeParamsResolver): string;
declare function generateFieldInputTypesMap(models: Record<string, ContractModelBase> | undefined, codecLookup?: CodecLookup, resolveFieldTypeParams?: FieldTypeParamsResolver): string;
declare function generateValueObjectType(_voName: string, vo: ContractValueObject, _valueObjects: Record<string, ContractValueObject>, side?: 'input' | 'output', codecLookup?: CodecLookup): string;
declare function resolveValueObjectType(_voName: string, vo: ContractValueObject, _valueObjects: Record<string, ContractValueObject>, codecLookup?: CodecLookup): ResolvedFieldType;
declare function generateContractFieldDescriptor(fieldName: string, field: ContractField): string;
declare function generateValueObjectsDescriptorType(valueObjects: Record<string, ContractValueObject> | undefined): string;
declare function generateValueObjectTypeAliases(valueObjects: Record<string, ContractValueObject> | undefined, codecLookup?: CodecLookup): string;
//#endregion
export { serializeValue as A, renderValueSetType as C, serializeExecutionType as D, serializeCrossReference as E, serializeNamespaceId as O, generateValueObjectsDescriptorType as S, resolveValueObjectType as T, generateModelRelationsType as _, deduplicateImports as a, generateValueObjectType as b, generateContractFieldDescriptor as c, generateFieldResolvedType as d, generateFieldTypesMapsByNamespace as f, generateModelFieldsType as g, generateModelFieldEntry as h, ResolvedFieldValueSet as i, serializeObjectKey as k, generateFieldInputTypesMap as l, generateImportLines as m, FieldValueSetResolver as n, generateBothFieldTypesMaps as o, generateHashTypeAliases as p, ResolvedFieldType as r, generateCodecTypeIntersection as s, FieldTypeParamsResolver as t, generateFieldOutputTypesMap as u, generateModelsType as v, resolveFieldType as w, generateValueObjectTypeAliases as x, generateRootsType as y };
//# sourceMappingURL=domain-type-generation-BYr4LZNS.d.mts.map
{"version":3,"file":"domain-type-generation-BYr4LZNS.d.mts","names":[],"sources":["../src/domain-type-generation.ts"],"mappings":"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"}
import { PreserveEmptyPredicate, SerializeContract, StorageSort } from "@prisma-next/contract/hashing";
import { Contract } from "@prisma-next/contract/types";
import { CodecLookup } from "@prisma-next/framework-components/codec";
import { EmissionSpi, GenerateContractTypesOptions, TypesImportSpec } from "@prisma-next/framework-components/emission";
//#region src/artifact-paths.d.ts
interface EmittedArtifactPaths {
readonly jsonPath: string;
readonly dtsPath: string;
}
declare function getEmittedArtifactPaths(outputJsonPath: string): EmittedArtifactPaths;
//#endregion
//#region src/emit-types.d.ts
/**
* The subset of ControlStack that emit() reads.
* All fields are optional so tests can pass minimal objects.
* A full ControlStack satisfies this via structural typing.
*/
interface EmitStackInput {
readonly codecTypeImports?: ReadonlyArray<TypesImportSpec>;
readonly queryOperationTypeImports?: ReadonlyArray<TypesImportSpec>;
readonly extensionIds?: ReadonlyArray<string>;
readonly codecLookup?: CodecLookup;
}
interface EmitOptions {
readonly outputJsonPath?: string;
/**
* Per-target serializer that converts the in-memory contract into its
* canonical on-disk JsonObject shape before the framework's
* key-ordering / default-omission walk runs. Threaded from the
* descriptor (`descriptor.contractSerializer.serializeContract`) at
* the CLI / control-API call site so target classes decide what
* appears in the JSON envelope rather than the framework guessing
* via property enumerability.
*/
readonly serializeContract: SerializeContract;
/**
* Optional family-contributed preserve-empty predicate. Threaded from
* `descriptor.contractSerializer.shouldPreserveEmpty` when present.
*/
readonly shouldPreserveEmpty?: PreserveEmptyPredicate;
/**
* Optional family-contributed storage sort hook. Threaded from
* `descriptor.contractSerializer.sortStorage` when present.
*/
readonly sortStorage?: StorageSort;
}
interface EmitResult {
readonly contractJson: string;
readonly contractDts: string;
readonly storageHash: string;
readonly executionHash?: string;
readonly profileHash: string;
}
//#endregion
//#region src/emit.d.ts
declare function emit(contract: Contract, stack: EmitStackInput, targetFamily: EmissionSpi, options: EmitOptions): Promise<EmitResult>;
//#endregion
//#region src/generate-contract-dts.d.ts
declare function generateContractDts(contract: Contract, emitter: EmissionSpi, codecTypeImports: ReadonlyArray<TypesImportSpec>, hashes: {
readonly storageHash: string;
readonly executionHash?: string;
readonly profileHash: string;
}, options?: GenerateContractTypesOptions, codecLookup?: CodecLookup): string;
//#endregion
export { EmitStackInput as a, EmitResult as i, emit as n, EmittedArtifactPaths as o, EmitOptions as r, getEmittedArtifactPaths as s, generateContractDts as t };
//# sourceMappingURL=index-Cjiwoga9.d.mts.map
{"version":3,"file":"index-Cjiwoga9.d.mts","names":[],"sources":["../src/artifact-paths.ts","../src/emit-types.ts","../src/emit.ts","../src/generate-contract-dts.ts"],"mappings":";;;;;;UAEiB,oBAAA;EAAA,SACN,QAAA;EAAA,SACA,OAAO;AAAA;AAAA,iBAGF,uBAAA,CAAwB,cAAA,WAAyB,oBAAoB;;;;;;;AALrF;UCWiB,cAAA;EAAA,SACN,gBAAA,GAAmB,aAAA,CAAc,eAAA;EAAA,SACjC,yBAAA,GAA4B,aAAA,CAAc,eAAA;EAAA,SAC1C,YAAA,GAAe,aAAA;EAAA,SACf,WAAA,GAAc,WAAA;AAAA;AAAA,UAGR,WAAA;EAAA,SACN,cAAA;EDd0E;;;;ACMrF;;;;;EDNqF,SCwB1E,iBAAA,EAAmB,iBAAA;EAhBS;;;;EAAA,SAqB5B,mBAAA,GAAsB,sBAAA;EAtBtB;;;;EAAA,SA2BA,WAAA,GAAc,WAAA;AAAA;AAAA,UAGR,UAAA;EAAA,SACN,YAAA;EAAA,SACA,WAAA;EAAA,SACA,WAAA;EAAA,SACA,aAAA;EAAA,SACA,WAAA;AAAA;;;iBCtCW,IAAA,CACpB,QAAA,EAAU,QAAA,EACV,KAAA,EAAO,cAAA,EACP,YAAA,EAAc,WAAA,EACd,OAAA,EAAS,WAAA,GACR,OAAA,CAAQ,UAAA;;;iBCyBK,mBAAA,CACd,QAAA,EAAU,QAAA,EACV,OAAA,EAAS,WAAA,EACT,gBAAA,EAAkB,aAAA,CAAc,eAAA,GAChC,MAAA;EAAA,SACW,WAAA;EAAA,SACA,aAAA;EAAA,SACA,WAAA;AAAA,GAEX,OAAA,GAAU,4BAAA,EACV,WAAA,GAAc,WAAA"}