@fern-api/csharp-dynamic-snippets 0.0.1

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 (45) hide show
  1. package/cjs/Config.cjs +11 -0
  2. package/cjs/Config.d.cts +5 -0
  3. package/cjs/DynamicSnippetsGenerator.cjs +34 -0
  4. package/cjs/DynamicSnippetsGenerator.d.cts +18 -0
  5. package/cjs/DynamicSnippetsGeneratorContext-DbMhuHoi.d.cts +116 -0
  6. package/cjs/EndpointSnippetGenerator.cjs +34 -0
  7. package/cjs/EndpointSnippetGenerator.d.cts +55 -0
  8. package/cjs/context/DynamicSnippetsGeneratorContext.cjs +34 -0
  9. package/cjs/context/DynamicSnippetsGeneratorContext.d.cts +4 -0
  10. package/cjs/context/DynamicTypeLiteralMapper.cjs +34 -0
  11. package/cjs/context/DynamicTypeLiteralMapper.d.cts +4 -0
  12. package/cjs/context/DynamicTypeMapper.cjs +34 -0
  13. package/cjs/context/DynamicTypeMapper.d.cts +4 -0
  14. package/cjs/context/FilePropertyMapper.cjs +34 -0
  15. package/cjs/context/FilePropertyMapper.d.cts +4 -0
  16. package/cjs/index.cjs +46 -0
  17. package/cjs/index.d.cts +7 -0
  18. package/esm/Config.d.ts +5 -0
  19. package/esm/Config.js +1 -0
  20. package/esm/DynamicSnippetsGenerator.d.ts +18 -0
  21. package/esm/DynamicSnippetsGenerator.js +1 -0
  22. package/esm/DynamicSnippetsGeneratorContext-DbMhuHoi.d.ts +116 -0
  23. package/esm/EndpointSnippetGenerator.d.ts +55 -0
  24. package/esm/EndpointSnippetGenerator.js +1 -0
  25. package/esm/chunk-2AZXIWKY.js +11 -0
  26. package/esm/chunk-3DCR7ZLP.js +1 -0
  27. package/esm/chunk-4PKDRTSC.js +1 -0
  28. package/esm/chunk-C4662L36.js +1 -0
  29. package/esm/chunk-HN67B7VQ.js +1 -0
  30. package/esm/chunk-JE2VCLEP.js +1 -0
  31. package/esm/chunk-SN6S6BH4.js +1 -0
  32. package/esm/chunk-WKJ2SB4L.js +1 -0
  33. package/esm/chunk-WNZYF5RX.js +26 -0
  34. package/esm/chunk-YSZHI4KM.js +1 -0
  35. package/esm/context/DynamicSnippetsGeneratorContext.d.ts +4 -0
  36. package/esm/context/DynamicSnippetsGeneratorContext.js +1 -0
  37. package/esm/context/DynamicTypeLiteralMapper.d.ts +4 -0
  38. package/esm/context/DynamicTypeLiteralMapper.js +1 -0
  39. package/esm/context/DynamicTypeMapper.d.ts +4 -0
  40. package/esm/context/DynamicTypeMapper.js +1 -0
  41. package/esm/context/FilePropertyMapper.d.ts +4 -0
  42. package/esm/context/FilePropertyMapper.js +1 -0
  43. package/esm/index.d.ts +7 -0
  44. package/esm/index.js +13 -0
  45. package/package.json +27 -0
@@ -0,0 +1,18 @@
1
+ import { AbstractDynamicSnippetsGenerator, FernGeneratorExec, Options } from '@fern-api/browser-compatible-base-generator';
2
+ import { FernIr } from '@fern-api/dynamic-ir-sdk';
3
+ import { EndpointSnippetGenerator } from './EndpointSnippetGenerator.cjs';
4
+ import { D as DynamicSnippetsGeneratorContext } from './DynamicSnippetsGeneratorContext-DbMhuHoi.cjs';
5
+ import '@fern-api/csharp-codegen';
6
+
7
+ declare class DynamicSnippetsGenerator extends AbstractDynamicSnippetsGenerator<DynamicSnippetsGeneratorContext, EndpointSnippetGenerator> {
8
+ constructor({ ir, config, options }: {
9
+ ir: FernIr.dynamic.DynamicIntermediateRepresentation;
10
+ config: FernGeneratorExec.GeneratorConfig;
11
+ options?: Options;
12
+ });
13
+ generate(request: FernIr.dynamic.EndpointSnippetRequest, options?: Options): Promise<FernIr.dynamic.EndpointSnippetResponse>;
14
+ generateSync(request: FernIr.dynamic.EndpointSnippetRequest, options?: Options): FernIr.dynamic.EndpointSnippetResponse;
15
+ protected createSnippetGenerator(context: DynamicSnippetsGeneratorContext): EndpointSnippetGenerator;
16
+ }
17
+
18
+ export { DynamicSnippetsGenerator };
@@ -0,0 +1,116 @@
1
+ import { AbstractDynamicSnippetsGeneratorContext, FernGeneratorExec, Options } from '@fern-api/browser-compatible-base-generator';
2
+ import { csharp, BaseCsharpCustomConfigSchema } from '@fern-api/csharp-codegen';
3
+ import { FernIr } from '@fern-api/dynamic-ir-sdk';
4
+
5
+ declare namespace DynamicTypeLiteralMapper {
6
+ interface Args {
7
+ typeReference: FernIr.dynamic.TypeReference;
8
+ value: unknown;
9
+ as?: ConvertedAs;
10
+ }
11
+ type ConvertedAs = "key";
12
+ }
13
+ declare class DynamicTypeLiteralMapper {
14
+ private context;
15
+ constructor({ context }: {
16
+ context: DynamicSnippetsGeneratorContext;
17
+ });
18
+ convert(args: DynamicTypeLiteralMapper.Args): csharp.TypeLiteral;
19
+ private convertList;
20
+ private convertSet;
21
+ private convertMap;
22
+ private convertNamed;
23
+ private convertDiscriminatedUnion;
24
+ private getBaseProperties;
25
+ private instantiateUnionWithBaseProperties;
26
+ private convertEnum;
27
+ private getEnumValueName;
28
+ private convertObject;
29
+ private convertUndiscriminatedUnion;
30
+ private findMatchingUndiscriminatedUnionType;
31
+ private convertUnknown;
32
+ private convertPrimitive;
33
+ private getValueAsNumber;
34
+ private getValueAsBoolean;
35
+ }
36
+
37
+ declare namespace DynamicTypeMapper {
38
+ interface Args {
39
+ typeReference: FernIr.dynamic.TypeReference;
40
+ unboxOptionals?: boolean;
41
+ }
42
+ }
43
+ declare class DynamicTypeMapper {
44
+ private context;
45
+ constructor({ context }: {
46
+ context: DynamicSnippetsGeneratorContext;
47
+ });
48
+ convert(args: DynamicTypeMapper.Args): csharp.Type;
49
+ private convertNamed;
50
+ private convertLiteral;
51
+ private convertUnknown;
52
+ private convertPrimitive;
53
+ }
54
+
55
+ interface FilePropertyInfo {
56
+ fileFields: csharp.ConstructorField[];
57
+ bodyPropertyFields: csharp.ConstructorField[];
58
+ }
59
+ declare class FilePropertyMapper {
60
+ private context;
61
+ constructor({ context }: {
62
+ context: DynamicSnippetsGeneratorContext;
63
+ });
64
+ getFilePropertyInfo({ body, value }: {
65
+ body: FernIr.dynamic.FileUploadRequestBody;
66
+ value: unknown;
67
+ }): FilePropertyInfo;
68
+ private getSingleFileProperty;
69
+ private getArrayFileProperty;
70
+ private getBodyProperty;
71
+ }
72
+
73
+ declare class DynamicSnippetsGeneratorContext extends AbstractDynamicSnippetsGeneratorContext {
74
+ ir: FernIr.dynamic.DynamicIntermediateRepresentation;
75
+ customConfig: BaseCsharpCustomConfigSchema | undefined;
76
+ dynamicTypeMapper: DynamicTypeMapper;
77
+ dynamicTypeLiteralMapper: DynamicTypeLiteralMapper;
78
+ filePropertyMapper: FilePropertyMapper;
79
+ rootNamespace: string;
80
+ constructor({ ir, config, options }: {
81
+ ir: FernIr.dynamic.DynamicIntermediateRepresentation;
82
+ config: FernGeneratorExec.GeneratorConfig;
83
+ options?: Options;
84
+ });
85
+ clone(): DynamicSnippetsGeneratorContext;
86
+ getFileParameterForString(str: string): csharp.TypeLiteral;
87
+ getMemoryStreamForString(str: string): csharp.ClassInstantiation;
88
+ getClassName(name: FernIr.Name): string;
89
+ getParameterName(name: FernIr.Name): string;
90
+ getPropertyName(name: FernIr.Name): string;
91
+ getMethodName(name: FernIr.Name): string;
92
+ getEnvironmentClassName(): string;
93
+ shouldUseDiscriminatedUnions(): boolean;
94
+ getRootClientClassName(): string;
95
+ getRootClientClassReference(): csharp.ClassReference;
96
+ getBaseExceptionClassReference(): csharp.ClassReference;
97
+ getBaseApiExceptionClassReference(): csharp.ClassReference;
98
+ getExceptionClassReference(declaration: FernIr.dynamic.Declaration): csharp.ClassReference;
99
+ getClientOptionsClassReference(): csharp.ClassReference;
100
+ getRequestOptionsClassReference(): csharp.ClassReference;
101
+ getFileParameterClassReference(): csharp.ClassReference;
102
+ getMemoryStreamClassReference(): csharp.ClassReference;
103
+ getEncodingUtf8ClassReference(): csharp.ClassReference;
104
+ getNamespace(fernFilepath: FernIr.FernFilepath, suffix?: string): string;
105
+ getRootNamespace(): string;
106
+ getCoreNamespace(): string;
107
+ getNamespaceForPublicCoreClasses(): string;
108
+ getEnvironmentTypeReferenceFromID(environmentID: string): csharp.ClassReference | undefined;
109
+ getEnvironmentClassReference(): csharp.ClassReference;
110
+ private getEnvironmentClassReferenceForEnumName;
111
+ private getClientPrefix;
112
+ private getNamespaceSegments;
113
+ private getComputedClientName;
114
+ }
115
+
116
+ export { DynamicSnippetsGeneratorContext as D, type FilePropertyInfo as F, DynamicTypeLiteralMapper as a, DynamicTypeMapper as b, FilePropertyMapper as c };