@emeryld/rrroutes-contract 2.7.13 → 2.8.0

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,62 +0,0 @@
1
- import type { AnyLeafLowProfile } from '../core/routesV3.core';
2
- import type { FinalizedRegistry } from '../core/routesV3.finalize';
3
- import { type FlatSchemaMap } from './flattenSchema';
4
- import { type SerializeLeafContractOptions, type SerializedLeafContract } from './serializeLeafContract';
5
- import { type LeafSourceByKey, type SourceExtractionReason } from './extractLeafSourceByAst';
6
- export type ExportFinalizedLeavesInput = readonly AnyLeafLowProfile[] | FinalizedRegistry<readonly AnyLeafLowProfile[]>;
7
- export type ExportFinalizedLeavesMeta = {
8
- generatedAt: string;
9
- description: string;
10
- sourceExtraction?: {
11
- mode: 'ast';
12
- enabled: boolean;
13
- modulePath?: string;
14
- exportName?: string;
15
- tsconfigPath?: string;
16
- resolvedLeafCount: number;
17
- reason?: SourceExtractionReason;
18
- stats?: {
19
- visitedSymbols: number;
20
- visitedFiles: number;
21
- unresolvedReferences: number;
22
- };
23
- };
24
- fieldCatalog: {
25
- leaf: string[];
26
- cfg: string[];
27
- schemaNode: string[];
28
- flatSchemaEntry: string[];
29
- };
30
- flattening: {
31
- notation: 'dot+[]';
32
- unionBranchSuffix: '-N';
33
- sections: readonly ['params', 'query', 'body', 'output'];
34
- };
35
- };
36
- export type FinalizedLeavesExport = {
37
- _meta: ExportFinalizedLeavesMeta;
38
- leaves: SerializedLeafContract[];
39
- schemaFlatByLeaf: Record<string, FlatSchemaMap>;
40
- sourceByLeaf?: LeafSourceByKey;
41
- };
42
- export type ExportFinalizedLeavesOptions = SerializeLeafContractOptions & {
43
- outFile?: string;
44
- htmlFile?: string;
45
- viewerTemplateFile?: string;
46
- openOnFinish?: boolean;
47
- includeSource?: boolean;
48
- tsconfigPath?: string;
49
- sourceModulePath?: string;
50
- sourceExportName?: string;
51
- };
52
- export type WriteFinalizedLeavesExportOptions = {
53
- outFile?: string;
54
- htmlFile?: string;
55
- viewerTemplateFile?: string;
56
- openOnFinish?: boolean;
57
- };
58
- export declare function writeFinalizedLeavesExport(payload: FinalizedLeavesExport, outFileOrOptions: string | WriteFinalizedLeavesExportOptions): Promise<{
59
- outFile?: string;
60
- htmlFile?: string;
61
- }>;
62
- export declare function exportFinalizedLeaves(input: ExportFinalizedLeavesInput, options?: ExportFinalizedLeavesOptions): Promise<FinalizedLeavesExport>;
@@ -1,38 +0,0 @@
1
- declare const SCHEMA_KEYS: readonly ["bodySchema", "querySchema", "paramsSchema", "outputSchema", "outputMetaSchema", "queryExtensionSchema"];
2
- export type SourceExtractionReason = 'module_not_in_program' | 'export_not_found' | 'unsupported_expression_shape' | 'resolved_zero_leaves';
3
- type SchemaKey = (typeof SCHEMA_KEYS)[number];
4
- export type LeafSourceLocation = {
5
- file: string;
6
- line: number;
7
- column: number;
8
- };
9
- export type SchemaSourceMetadata = LeafSourceLocation & {
10
- sourceName?: string;
11
- tag?: '<inline>' | '<anonymous>' | '<expression>';
12
- };
13
- export type LeafSourceMetadata = {
14
- definition: LeafSourceLocation & {
15
- symbolName?: string;
16
- };
17
- schemas: Partial<Record<SchemaKey, SchemaSourceMetadata>>;
18
- };
19
- export type LeafSourceByKey = Record<string, LeafSourceMetadata>;
20
- export type ExtractLeafSourceByAstOptions = {
21
- modulePath: string;
22
- exportName: string;
23
- tsconfigPath?: string;
24
- cwd?: string;
25
- };
26
- export type ExtractLeafSourceByAstStats = {
27
- visitedSymbols: number;
28
- visitedFiles: number;
29
- unresolvedReferences: number;
30
- };
31
- export type ExtractLeafSourceByAstResult = {
32
- sourceByLeaf: LeafSourceByKey;
33
- tsconfigPath?: string;
34
- reason?: SourceExtractionReason;
35
- stats: ExtractLeafSourceByAstStats;
36
- };
37
- export declare function extractLeafSourceByAst({ modulePath, exportName, tsconfigPath, cwd, }: ExtractLeafSourceByAstOptions): ExtractLeafSourceByAstResult;
38
- export {};
@@ -1,12 +0,0 @@
1
- import type { AnyLeafLowProfile } from '../core/routesV3.core';
2
- import { type SerializedLeafContract } from './serializeLeafContract';
3
- import type { SerializableSchema } from './schemaIntrospection';
4
- export type FlatSchemaEntry = {
5
- type: string;
6
- nullable: boolean;
7
- optional: boolean;
8
- literal?: unknown;
9
- };
10
- export type FlatSchemaMap = Record<string, FlatSchemaEntry>;
11
- export declare function flattenSerializableSchema(schema: SerializableSchema | undefined, path: string): FlatSchemaMap;
12
- export declare function flattenLeafSchemas(leaf: AnyLeafLowProfile | SerializedLeafContract): FlatSchemaMap;
@@ -1,7 +0,0 @@
1
- export * from './schemaIntrospection';
2
- export * from './serializeLeafContract';
3
- export * from './flattenSchema';
4
- export * from './exportFinalizedLeaves';
5
- export * from './exportFinalizedLeaves.cli';
6
- export * from './defaultViewerTemplate';
7
- export * from './extractLeafSourceByAst';
@@ -1,47 +0,0 @@
1
- import * as z from 'zod';
2
- export declare const serializableSchemaKinds: readonly ["object", "string", "number", "boolean", "bigint", "date", "array", "enum", "literal", "union", "record", "tuple", "unknown", "any"];
3
- export type SerializableSchemaKind = (typeof serializableSchemaKinds)[number];
4
- export type SerializableSchema = {
5
- kind: SerializableSchemaKind;
6
- optional?: boolean;
7
- nullable?: boolean;
8
- description?: string;
9
- properties?: Record<string, SerializableSchema>;
10
- element?: SerializableSchema;
11
- union?: SerializableSchema[];
12
- literal?: unknown;
13
- enumValues?: string[];
14
- };
15
- type ZodAny = z.ZodTypeAny;
16
- type InternalSchemaKind = SerializableSchemaKind | 'intersection';
17
- type IntrospectionWalker = (schema: ZodAny | undefined) => SerializableSchema | undefined;
18
- export type IntrospectionContext = {
19
- zod: typeof z;
20
- introspect: IntrospectionWalker;
21
- getDef: (schema: unknown) => any | undefined;
22
- unwrap: (schema: ZodAny) => {
23
- base: ZodAny;
24
- optional: boolean;
25
- nullable: boolean;
26
- };
27
- getDescription: (schema: ZodAny) => string | undefined;
28
- };
29
- export type IntrospectionNode = {
30
- schema: ZodAny;
31
- base: ZodAny;
32
- def: any;
33
- kind: InternalSchemaKind;
34
- optional: boolean;
35
- nullable: boolean;
36
- node: SerializableSchema;
37
- };
38
- export type SchemaIntrospectionHandler = (args: IntrospectionNode, ctx: IntrospectionContext) => SerializableSchema | undefined;
39
- export type SchemaIntrospectionHandlerMap = Partial<Record<InternalSchemaKind, SchemaIntrospectionHandler>>;
40
- export type IntrospectSchemaOptions = {
41
- handlers?: SchemaIntrospectionHandlerMap;
42
- };
43
- export declare function registerSchemaIntrospectionHandler(kind: InternalSchemaKind, handler: SchemaIntrospectionHandler): void;
44
- export declare function clearSchemaIntrospectionHandlers(): void;
45
- export declare function createSchemaIntrospector(options?: IntrospectSchemaOptions): IntrospectionWalker;
46
- export declare function introspectSchema(schema: ZodAny | undefined, options?: IntrospectSchemaOptions): SerializableSchema | undefined;
47
- export {};
@@ -1,31 +0,0 @@
1
- import { type AnyLeafLowProfile, type FileField } from '../core/routesV3.core';
2
- import { type IntrospectSchemaOptions, type SerializableSchema } from './schemaIntrospection';
3
- export type ContractLeafSchemas = {
4
- body?: SerializableSchema;
5
- query?: SerializableSchema;
6
- params?: SerializableSchema;
7
- output?: SerializableSchema;
8
- outputMeta?: SerializableSchema;
9
- queryExtension?: SerializableSchema;
10
- };
11
- export type SerializedLeafContract = {
12
- key: string;
13
- method: AnyLeafLowProfile['method'];
14
- path: string;
15
- cfg: {
16
- description?: string;
17
- summary?: string;
18
- docsGroup?: string;
19
- tags?: string[];
20
- deprecated?: boolean;
21
- stability?: 'experimental' | 'beta' | 'stable' | 'deprecated';
22
- docsHidden?: boolean;
23
- docsMeta?: Record<string, unknown>;
24
- feed?: boolean;
25
- bodyFiles?: FileField[];
26
- schemas: ContractLeafSchemas;
27
- };
28
- };
29
- export type SerializeLeafContractOptions = IntrospectSchemaOptions;
30
- export declare function serializeLeafContract(leaf: AnyLeafLowProfile, options?: SerializeLeafContractOptions): SerializedLeafContract;
31
- export declare function serializeLeavesContract(leaves: readonly AnyLeafLowProfile[], options?: SerializeLeafContractOptions): SerializedLeafContract[];