@fern-api/java-dynamic-snippets 4.10.5 → 4.10.7
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/index.cjs +9 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +47 -2
- package/dist/index.d.ts +47 -2
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -14,6 +14,7 @@ declare namespace DynamicTypeLiteralMapper {
|
|
|
14
14
|
as?: ConvertedAs;
|
|
15
15
|
inUndiscriminatedUnion?: boolean;
|
|
16
16
|
isCollapsedOptionalNullable?: boolean;
|
|
17
|
+
nestedClassReference?: java.ClassReference;
|
|
17
18
|
}
|
|
18
19
|
type ConvertedAs = "mapKey" | "mapValue" | "request";
|
|
19
20
|
}
|
|
@@ -34,6 +35,30 @@ declare class DynamicTypeLiteralMapper {
|
|
|
34
35
|
private convertNamed;
|
|
35
36
|
private convertDiscriminatedUnion;
|
|
36
37
|
private convertObject;
|
|
38
|
+
/**
|
|
39
|
+
* Mirrors the v1 generator's inline-type naming (see ObjectGenerator / InlineTypeIdResolver):
|
|
40
|
+
* when a property's type resolves to an inline named type, v1 emits it as a class nested within
|
|
41
|
+
* the enclosing object. This walks the property's type reference (descending through container
|
|
42
|
+
* wrappers, applying the same name suffixes as v1) and, if it terminates in an inline named type,
|
|
43
|
+
* returns the nested class reference to use. Returns undefined for non-inline types, which fall
|
|
44
|
+
* back to the standalone top-level class name.
|
|
45
|
+
*/
|
|
46
|
+
resolveInlineNestedClassReference({ enclosing, baseName, typeReference, reservedNames, siblingPropertyNames }: {
|
|
47
|
+
enclosing: java.ClassReference;
|
|
48
|
+
baseName: string;
|
|
49
|
+
typeReference: FernIr.dynamic.TypeReference;
|
|
50
|
+
reservedNames: Set<string>;
|
|
51
|
+
siblingPropertyNames: Set<string>;
|
|
52
|
+
}): java.ClassReference | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Resolves the nested class reference for an inline member of an undiscriminated union.
|
|
55
|
+
* Unlike object properties and discriminated-union variants (whose nested name is derived
|
|
56
|
+
* from the property/discriminant name), v1 names an undiscriminated union's inline members
|
|
57
|
+
* after the member type's own name, with the union's name stripped as a prefix (see
|
|
58
|
+
* UndiscriminatedUnionGenerator). Descends through container wrappers to the terminal named
|
|
59
|
+
* type.
|
|
60
|
+
*/
|
|
61
|
+
private resolveUndiscriminatedInlineNestedClassReference;
|
|
37
62
|
/**
|
|
38
63
|
* Returns true when a property becomes a required stage in v1's staged builder. v1 stages
|
|
39
64
|
* fields that are neither optional, nullable, nor collections (list/set/map); those are all
|
|
@@ -105,13 +130,32 @@ declare class DynamicSnippetsGeneratorContext extends AbstractDynamicSnippetsGen
|
|
|
105
130
|
dynamicTypeMapper: DynamicTypeMapper;
|
|
106
131
|
dynamicTypeLiteralMapper: DynamicTypeLiteralMapper;
|
|
107
132
|
filePropertyMapper: FilePropertyMapper;
|
|
108
|
-
|
|
133
|
+
/**
|
|
134
|
+
* The set of type IDs that the v1 generator emits as nested (inline) classes rather than
|
|
135
|
+
* top-level types. The dynamic IR does not carry the `inline` flag, so the v2 SDK generator
|
|
136
|
+
* computes this from the full IR and threads it through. Used to mirror v1's nested-class
|
|
137
|
+
* naming when referencing inline types in snippets.
|
|
138
|
+
*/
|
|
139
|
+
inlineTypeIds: Set<string>;
|
|
140
|
+
constructor({ ir, config, options, sharedCustomConfig, inlineTypeIds }: {
|
|
109
141
|
ir: FernIr.dynamic.DynamicIntermediateRepresentation;
|
|
110
142
|
config: FernGeneratorExec.GeneratorConfig;
|
|
111
143
|
options?: Options;
|
|
112
144
|
sharedCustomConfig?: BaseJavaCustomConfigSchema;
|
|
145
|
+
inlineTypeIds?: Set<string>;
|
|
113
146
|
});
|
|
114
147
|
clone(): DynamicSnippetsGeneratorContext;
|
|
148
|
+
isInlineType(typeId: string): boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Builds a reference to a class nested within `enclosing`. The resulting reference imports the
|
|
151
|
+
* outermost enclosing class and is written using the dotted path (e.g. `PostRootRequest.Bar`).
|
|
152
|
+
*/
|
|
153
|
+
getNestedInlineClassReference({ enclosing, name }: {
|
|
154
|
+
enclosing: java.ClassReference;
|
|
155
|
+
name: string;
|
|
156
|
+
}): java.ClassReference;
|
|
157
|
+
wrappedAliases(): boolean;
|
|
158
|
+
enableInlineTypes(): boolean;
|
|
115
159
|
getClassName(name: FernIr.Name): string;
|
|
116
160
|
getEnumName(name: FernIr.Name): string;
|
|
117
161
|
getPropertyName(name: FernIr.Name): string;
|
|
@@ -252,10 +296,11 @@ declare class EndpointSnippetGenerator {
|
|
|
252
296
|
}
|
|
253
297
|
|
|
254
298
|
declare class DynamicSnippetsGenerator extends AbstractDynamicSnippetsGenerator<DynamicSnippetsGeneratorContext, EndpointSnippetGenerator> {
|
|
255
|
-
constructor({ ir, config, options }: {
|
|
299
|
+
constructor({ ir, config, options, inlineTypeIds }: {
|
|
256
300
|
ir: FernIr.dynamic.DynamicIntermediateRepresentation;
|
|
257
301
|
config: FernGeneratorExec.GeneratorConfig;
|
|
258
302
|
options?: Options;
|
|
303
|
+
inlineTypeIds?: Set<string>;
|
|
259
304
|
});
|
|
260
305
|
generate(request: FernIr.dynamic.EndpointSnippetRequest, options?: Options): Promise<FernIr.dynamic.EndpointSnippetResponse>;
|
|
261
306
|
generateSync(request: FernIr.dynamic.EndpointSnippetRequest, options?: Options): FernIr.dynamic.EndpointSnippetResponse;
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ declare namespace DynamicTypeLiteralMapper {
|
|
|
14
14
|
as?: ConvertedAs;
|
|
15
15
|
inUndiscriminatedUnion?: boolean;
|
|
16
16
|
isCollapsedOptionalNullable?: boolean;
|
|
17
|
+
nestedClassReference?: java.ClassReference;
|
|
17
18
|
}
|
|
18
19
|
type ConvertedAs = "mapKey" | "mapValue" | "request";
|
|
19
20
|
}
|
|
@@ -34,6 +35,30 @@ declare class DynamicTypeLiteralMapper {
|
|
|
34
35
|
private convertNamed;
|
|
35
36
|
private convertDiscriminatedUnion;
|
|
36
37
|
private convertObject;
|
|
38
|
+
/**
|
|
39
|
+
* Mirrors the v1 generator's inline-type naming (see ObjectGenerator / InlineTypeIdResolver):
|
|
40
|
+
* when a property's type resolves to an inline named type, v1 emits it as a class nested within
|
|
41
|
+
* the enclosing object. This walks the property's type reference (descending through container
|
|
42
|
+
* wrappers, applying the same name suffixes as v1) and, if it terminates in an inline named type,
|
|
43
|
+
* returns the nested class reference to use. Returns undefined for non-inline types, which fall
|
|
44
|
+
* back to the standalone top-level class name.
|
|
45
|
+
*/
|
|
46
|
+
resolveInlineNestedClassReference({ enclosing, baseName, typeReference, reservedNames, siblingPropertyNames }: {
|
|
47
|
+
enclosing: java.ClassReference;
|
|
48
|
+
baseName: string;
|
|
49
|
+
typeReference: FernIr.dynamic.TypeReference;
|
|
50
|
+
reservedNames: Set<string>;
|
|
51
|
+
siblingPropertyNames: Set<string>;
|
|
52
|
+
}): java.ClassReference | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Resolves the nested class reference for an inline member of an undiscriminated union.
|
|
55
|
+
* Unlike object properties and discriminated-union variants (whose nested name is derived
|
|
56
|
+
* from the property/discriminant name), v1 names an undiscriminated union's inline members
|
|
57
|
+
* after the member type's own name, with the union's name stripped as a prefix (see
|
|
58
|
+
* UndiscriminatedUnionGenerator). Descends through container wrappers to the terminal named
|
|
59
|
+
* type.
|
|
60
|
+
*/
|
|
61
|
+
private resolveUndiscriminatedInlineNestedClassReference;
|
|
37
62
|
/**
|
|
38
63
|
* Returns true when a property becomes a required stage in v1's staged builder. v1 stages
|
|
39
64
|
* fields that are neither optional, nullable, nor collections (list/set/map); those are all
|
|
@@ -105,13 +130,32 @@ declare class DynamicSnippetsGeneratorContext extends AbstractDynamicSnippetsGen
|
|
|
105
130
|
dynamicTypeMapper: DynamicTypeMapper;
|
|
106
131
|
dynamicTypeLiteralMapper: DynamicTypeLiteralMapper;
|
|
107
132
|
filePropertyMapper: FilePropertyMapper;
|
|
108
|
-
|
|
133
|
+
/**
|
|
134
|
+
* The set of type IDs that the v1 generator emits as nested (inline) classes rather than
|
|
135
|
+
* top-level types. The dynamic IR does not carry the `inline` flag, so the v2 SDK generator
|
|
136
|
+
* computes this from the full IR and threads it through. Used to mirror v1's nested-class
|
|
137
|
+
* naming when referencing inline types in snippets.
|
|
138
|
+
*/
|
|
139
|
+
inlineTypeIds: Set<string>;
|
|
140
|
+
constructor({ ir, config, options, sharedCustomConfig, inlineTypeIds }: {
|
|
109
141
|
ir: FernIr.dynamic.DynamicIntermediateRepresentation;
|
|
110
142
|
config: FernGeneratorExec.GeneratorConfig;
|
|
111
143
|
options?: Options;
|
|
112
144
|
sharedCustomConfig?: BaseJavaCustomConfigSchema;
|
|
145
|
+
inlineTypeIds?: Set<string>;
|
|
113
146
|
});
|
|
114
147
|
clone(): DynamicSnippetsGeneratorContext;
|
|
148
|
+
isInlineType(typeId: string): boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Builds a reference to a class nested within `enclosing`. The resulting reference imports the
|
|
151
|
+
* outermost enclosing class and is written using the dotted path (e.g. `PostRootRequest.Bar`).
|
|
152
|
+
*/
|
|
153
|
+
getNestedInlineClassReference({ enclosing, name }: {
|
|
154
|
+
enclosing: java.ClassReference;
|
|
155
|
+
name: string;
|
|
156
|
+
}): java.ClassReference;
|
|
157
|
+
wrappedAliases(): boolean;
|
|
158
|
+
enableInlineTypes(): boolean;
|
|
115
159
|
getClassName(name: FernIr.Name): string;
|
|
116
160
|
getEnumName(name: FernIr.Name): string;
|
|
117
161
|
getPropertyName(name: FernIr.Name): string;
|
|
@@ -252,10 +296,11 @@ declare class EndpointSnippetGenerator {
|
|
|
252
296
|
}
|
|
253
297
|
|
|
254
298
|
declare class DynamicSnippetsGenerator extends AbstractDynamicSnippetsGenerator<DynamicSnippetsGeneratorContext, EndpointSnippetGenerator> {
|
|
255
|
-
constructor({ ir, config, options }: {
|
|
299
|
+
constructor({ ir, config, options, inlineTypeIds }: {
|
|
256
300
|
ir: FernIr.dynamic.DynamicIntermediateRepresentation;
|
|
257
301
|
config: FernGeneratorExec.GeneratorConfig;
|
|
258
302
|
options?: Options;
|
|
303
|
+
inlineTypeIds?: Set<string>;
|
|
259
304
|
});
|
|
260
305
|
generate(request: FernIr.dynamic.EndpointSnippetRequest, options?: Options): Promise<FernIr.dynamic.EndpointSnippetResponse>;
|
|
261
306
|
generateSync(request: FernIr.dynamic.EndpointSnippetRequest, options?: Options): FernIr.dynamic.EndpointSnippetResponse;
|