@fern-api/go-dynamic-snippets 0.0.12 → 0.0.14
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/cjs/DynamicSnippetsGenerator.cjs +15 -15
- package/cjs/DynamicSnippetsGenerator.d.cts +6 -9
- package/{esm/DynamicSnippetsGeneratorContext-Dyk9qWMy.d.ts → cjs/DynamicSnippetsGeneratorContext-lz2pTZw3.d.cts} +28 -69
- package/cjs/EndpointSnippetGenerator.cjs +8 -8
- package/cjs/EndpointSnippetGenerator.d.cts +6 -10
- package/cjs/context/DynamicSnippetsGeneratorContext.cjs +15 -15
- package/cjs/context/DynamicSnippetsGeneratorContext.d.cts +2 -5
- package/cjs/context/DynamicTypeInstantiationMapper.cjs +15 -15
- package/cjs/context/DynamicTypeInstantiationMapper.d.cts +2 -5
- package/cjs/context/DynamicTypeMapper.cjs +7 -7
- package/cjs/context/DynamicTypeMapper.d.cts +2 -5
- package/cjs/context/FilePropertyMapper.cjs +8 -8
- package/cjs/context/FilePropertyMapper.d.cts +2 -5
- package/cjs/index.cjs +22 -22
- package/cjs/index.d.cts +2 -5
- package/esm/DynamicSnippetsGenerator.d.ts +6 -9
- package/esm/DynamicSnippetsGenerator.js +1 -1
- package/{cjs/DynamicSnippetsGeneratorContext-f4OAff1R.d.cts → esm/DynamicSnippetsGeneratorContext-lz2pTZw3.d.ts} +28 -69
- package/esm/EndpointSnippetGenerator.d.ts +6 -10
- package/esm/EndpointSnippetGenerator.js +1 -1
- package/esm/chunk-5HP3T45N.js +1 -0
- package/esm/chunk-D3UUM672.js +1 -0
- package/esm/chunk-I3VUX77R.js +1 -0
- package/esm/chunk-J745U74Q.js +1 -0
- package/esm/chunk-SS6XZXHU.js +1 -0
- package/esm/chunk-TUE3DOHS.js +29 -0
- package/esm/chunk-X7QP3WH3.js +1 -0
- package/esm/chunk-YAGEU3HO.js +1 -0
- package/esm/context/DynamicSnippetsGeneratorContext.d.ts +2 -5
- package/esm/context/DynamicSnippetsGeneratorContext.js +1 -1
- package/esm/context/DynamicTypeInstantiationMapper.d.ts +2 -5
- package/esm/context/DynamicTypeInstantiationMapper.js +1 -1
- package/esm/context/DynamicTypeMapper.d.ts +2 -5
- package/esm/context/DynamicTypeMapper.js +1 -1
- package/esm/context/FilePropertyMapper.d.ts +2 -5
- package/esm/context/FilePropertyMapper.js +1 -1
- package/esm/index.d.ts +2 -5
- package/esm/index.js +5 -5
- package/package.json +2 -2
- package/cjs/DiscriminatedUnionTypeInstance.cjs +0 -11
- package/cjs/DiscriminatedUnionTypeInstance.d.cts +0 -12
- package/cjs/Result.cjs +0 -11
- package/cjs/Result.d.cts +0 -23
- package/cjs/Scope.cjs +0 -11
- package/cjs/Scope.d.cts +0 -9
- package/cjs/TypeInstance.cjs +0 -11
- package/cjs/TypeInstance.d.cts +0 -15
- package/cjs/context/ErrorReporter.cjs +0 -11
- package/cjs/context/ErrorReporter.d.cts +0 -39
- package/esm/DiscriminatedUnionTypeInstance.d.ts +0 -12
- package/esm/DiscriminatedUnionTypeInstance.js +0 -1
- package/esm/Result.d.ts +0 -23
- package/esm/Result.js +0 -1
- package/esm/Scope.d.ts +0 -9
- package/esm/Scope.js +0 -1
- package/esm/TypeInstance.d.ts +0 -15
- package/esm/TypeInstance.js +0 -1
- package/esm/chunk-2AZXIWKY.js +0 -11
- package/esm/chunk-575DWQWD.js +0 -1
- package/esm/chunk-5TA7XQOD.js +0 -1
- package/esm/chunk-DMDZDIA7.js +0 -1
- package/esm/chunk-E5FOYV6P.js +0 -19
- package/esm/chunk-HBFOF5YT.js +0 -1
- package/esm/chunk-IIKN6XQS.js +0 -1
- package/esm/chunk-LLE63BZO.js +0 -1
- package/esm/chunk-M3DYFCFN.js +0 -1
- package/esm/chunk-VLNKANS2.js +0 -1
- package/esm/chunk-ZI6CAI2V.js +0 -1
- package/esm/context/ErrorReporter.d.ts +0 -39
- package/esm/context/ErrorReporter.js +0 -1
package/cjs/index.d.cts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
export { DynamicSnippetsGenerator } from './DynamicSnippetsGenerator.cjs';
|
|
2
2
|
import '@fern-api/browser-compatible-base-generator';
|
|
3
|
-
import '
|
|
3
|
+
import '@fern-api/dynamic-ir-sdk';
|
|
4
|
+
import './DynamicSnippetsGeneratorContext-lz2pTZw3.cjs';
|
|
4
5
|
import '@fern-api/go-ast';
|
|
5
|
-
import '@fern-fern/ir-sdk/api';
|
|
6
|
-
import './TypeInstance.cjs';
|
|
7
|
-
import './DiscriminatedUnionTypeInstance.cjs';
|
|
8
|
-
import './context/ErrorReporter.cjs';
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
import { AbstractDynamicSnippetsGenerator, FernGeneratorExec, AbstractFormatter } from '@fern-api/browser-compatible-base-generator';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { FernIr } from '@fern-api/dynamic-ir-sdk';
|
|
3
|
+
import { D as DynamicSnippetsGeneratorContext } from './DynamicSnippetsGeneratorContext-lz2pTZw3.js';
|
|
4
4
|
import '@fern-api/go-ast';
|
|
5
|
-
import './TypeInstance.js';
|
|
6
|
-
import './DiscriminatedUnionTypeInstance.js';
|
|
7
|
-
import './context/ErrorReporter.js';
|
|
8
5
|
|
|
9
|
-
declare class DynamicSnippetsGenerator extends AbstractDynamicSnippetsGenerator<
|
|
6
|
+
declare class DynamicSnippetsGenerator extends AbstractDynamicSnippetsGenerator<DynamicSnippetsGeneratorContext, FernIr.dynamic.EndpointSnippetRequest, FernIr.dynamic.EndpointSnippetResponse> {
|
|
10
7
|
private formatter;
|
|
11
8
|
constructor({ ir, config, formatter }: {
|
|
12
|
-
ir: dynamic.DynamicIntermediateRepresentation;
|
|
9
|
+
ir: FernIr.dynamic.DynamicIntermediateRepresentation;
|
|
13
10
|
config: FernGeneratorExec.GeneratorConfig;
|
|
14
11
|
formatter?: AbstractFormatter;
|
|
15
12
|
});
|
|
16
|
-
generate(request: dynamic.EndpointSnippetRequest): Promise<dynamic.EndpointSnippetResponse>;
|
|
17
|
-
generateSync(request: dynamic.EndpointSnippetRequest): dynamic.EndpointSnippetResponse;
|
|
13
|
+
generate(request: FernIr.dynamic.EndpointSnippetRequest): Promise<FernIr.dynamic.EndpointSnippetResponse>;
|
|
14
|
+
generateSync(request: FernIr.dynamic.EndpointSnippetRequest): FernIr.dynamic.EndpointSnippetResponse;
|
|
18
15
|
}
|
|
19
16
|
|
|
20
17
|
export { DynamicSnippetsGenerator };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-YAGEU3HO.js";import"./chunk-X7QP3WH3.js";import"./chunk-5HP3T45N.js";import"./chunk-SS6XZXHU.js";import"./chunk-J745U74Q.js";import"./chunk-D3UUM672.js";import"./chunk-I3VUX77R.js";import"./chunk-TUE3DOHS.js";export{a as DynamicSnippetsGenerator};
|
|
@@ -1,30 +1,10 @@
|
|
|
1
1
|
import { AbstractDynamicSnippetsGeneratorContext, FernGeneratorExec } from '@fern-api/browser-compatible-base-generator';
|
|
2
|
+
import { FernIr } from '@fern-api/dynamic-ir-sdk';
|
|
2
3
|
import { go, BaseGoCustomConfigSchema } from '@fern-api/go-ast';
|
|
3
|
-
import { dynamic, TypeId, Name, FernFilepath, EnvironmentId } from '@fern-fern/ir-sdk/api';
|
|
4
|
-
import { TypeInstance } from './TypeInstance.cjs';
|
|
5
|
-
import { DiscriminatedUnionTypeInstance } from './DiscriminatedUnionTypeInstance.cjs';
|
|
6
|
-
import { ErrorReporter } from './context/ErrorReporter.cjs';
|
|
7
|
-
|
|
8
|
-
declare namespace DynamicTypeMapper {
|
|
9
|
-
interface Args {
|
|
10
|
-
typeReference: dynamic.TypeReference;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
declare class DynamicTypeMapper {
|
|
14
|
-
private context;
|
|
15
|
-
constructor({ context }: {
|
|
16
|
-
context: DynamicSnippetsGeneratorContext;
|
|
17
|
-
});
|
|
18
|
-
convert(args: DynamicTypeMapper.Args): go.Type;
|
|
19
|
-
private convertLiteral;
|
|
20
|
-
private convertNamed;
|
|
21
|
-
private convertUnknown;
|
|
22
|
-
private convertPrimitive;
|
|
23
|
-
}
|
|
24
4
|
|
|
25
5
|
declare namespace DynamicTypeInstantiationMapper {
|
|
26
6
|
interface Args {
|
|
27
|
-
typeReference: dynamic.TypeReference;
|
|
7
|
+
typeReference: FernIr.dynamic.TypeReference;
|
|
28
8
|
value: unknown;
|
|
29
9
|
as?: ConvertedAs;
|
|
30
10
|
}
|
|
@@ -57,8 +37,23 @@ declare class DynamicTypeInstantiationMapper {
|
|
|
57
37
|
private convertPrimitive;
|
|
58
38
|
private getValueAsNumber;
|
|
59
39
|
private getValueAsBoolean;
|
|
60
|
-
|
|
61
|
-
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare namespace DynamicTypeMapper {
|
|
43
|
+
interface Args {
|
|
44
|
+
typeReference: FernIr.dynamic.TypeReference;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
declare class DynamicTypeMapper {
|
|
48
|
+
private context;
|
|
49
|
+
constructor({ context }: {
|
|
50
|
+
context: DynamicSnippetsGeneratorContext;
|
|
51
|
+
});
|
|
52
|
+
convert(args: DynamicTypeMapper.Args): go.Type;
|
|
53
|
+
private convertLiteral;
|
|
54
|
+
private convertNamed;
|
|
55
|
+
private convertUnknown;
|
|
56
|
+
private convertPrimitive;
|
|
62
57
|
}
|
|
63
58
|
|
|
64
59
|
interface FilePropertyInfo {
|
|
@@ -71,7 +66,7 @@ declare class FilePropertyMapper {
|
|
|
71
66
|
context: DynamicSnippetsGeneratorContext;
|
|
72
67
|
});
|
|
73
68
|
getFilePropertyInfo({ body, value }: {
|
|
74
|
-
body: dynamic.FileUploadRequestBody;
|
|
69
|
+
body: FernIr.dynamic.FileUploadRequestBody;
|
|
75
70
|
value: unknown;
|
|
76
71
|
}): FilePropertyInfo;
|
|
77
72
|
private getSingleFileProperty;
|
|
@@ -79,50 +74,21 @@ declare class FilePropertyMapper {
|
|
|
79
74
|
private getBodyProperty;
|
|
80
75
|
}
|
|
81
76
|
|
|
82
|
-
declare class DynamicSnippetsGeneratorContext extends AbstractDynamicSnippetsGeneratorContext
|
|
77
|
+
declare class DynamicSnippetsGeneratorContext extends AbstractDynamicSnippetsGeneratorContext {
|
|
78
|
+
ir: FernIr.dynamic.DynamicIntermediateRepresentation;
|
|
83
79
|
customConfig: BaseGoCustomConfigSchema | undefined;
|
|
84
|
-
errors: ErrorReporter;
|
|
85
80
|
dynamicTypeMapper: DynamicTypeMapper;
|
|
86
81
|
dynamicTypeInstantiationMapper: DynamicTypeInstantiationMapper;
|
|
87
82
|
filePropertyMapper: FilePropertyMapper;
|
|
88
83
|
rootImportPath: string;
|
|
89
|
-
private httpEndpointReferenceParser;
|
|
90
84
|
constructor({ ir, config }: {
|
|
91
|
-
ir: dynamic.DynamicIntermediateRepresentation;
|
|
85
|
+
ir: FernIr.dynamic.DynamicIntermediateRepresentation;
|
|
92
86
|
config: FernGeneratorExec.GeneratorConfig;
|
|
93
87
|
});
|
|
94
88
|
clone(): DynamicSnippetsGeneratorContext;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}): TypeInstance[];
|
|
99
|
-
associateByWireValue({ parameters, values, ignoreMissingParameters }: {
|
|
100
|
-
parameters: dynamic.NamedParameter[];
|
|
101
|
-
values: dynamic.Values;
|
|
102
|
-
ignoreMissingParameters?: boolean;
|
|
103
|
-
}): TypeInstance[];
|
|
104
|
-
isFileUploadRequestBody(body: dynamic.InlinedRequestBody): body is dynamic.InlinedRequestBody.FileUpload;
|
|
105
|
-
needsRequestParameter({ request }: {
|
|
106
|
-
request: dynamic.InlinedRequest;
|
|
107
|
-
}): boolean;
|
|
108
|
-
includePathParametersInWrappedRequest({ request }: {
|
|
109
|
-
request: dynamic.InlinedRequest;
|
|
110
|
-
}): boolean;
|
|
111
|
-
private includeRequestBodyInWrappedRequest;
|
|
112
|
-
private includeFileUploadBodyInWrappedRequest;
|
|
113
|
-
private fileUploadHasBodyProperties;
|
|
114
|
-
private fileUploadHasFileProperties;
|
|
115
|
-
getRecord(value: unknown): Record<string, unknown> | undefined;
|
|
116
|
-
resolveNamedType({ typeId }: {
|
|
117
|
-
typeId: TypeId;
|
|
118
|
-
}): dynamic.NamedType | undefined;
|
|
119
|
-
resolveDiscriminatedUnionTypeInstance({ discriminatedUnion, value }: {
|
|
120
|
-
discriminatedUnion: dynamic.DiscriminatedUnionType;
|
|
121
|
-
value: unknown;
|
|
122
|
-
}): DiscriminatedUnionTypeInstance | undefined;
|
|
123
|
-
getMethodName(name: Name): string;
|
|
124
|
-
getTypeName(name: Name): string;
|
|
125
|
-
getImportPath(fernFilepath: FernFilepath): string;
|
|
89
|
+
getMethodName(name: FernIr.Name): string;
|
|
90
|
+
getTypeName(name: FernIr.Name): string;
|
|
91
|
+
getImportPath(fernFilepath: FernIr.FernFilepath): string;
|
|
126
92
|
getContextTypeReference(): go.TypeReference;
|
|
127
93
|
getContextTodoFunctionInvocation(): go.FuncInvocation;
|
|
128
94
|
getIoReaderTypeReference(): go.TypeReference;
|
|
@@ -130,18 +96,11 @@ declare class DynamicSnippetsGeneratorContext extends AbstractDynamicSnippetsGen
|
|
|
130
96
|
getClientConstructorName(): string;
|
|
131
97
|
getClientImportPath(): string;
|
|
132
98
|
getOptionImportPath(): string;
|
|
133
|
-
resolveEndpointOrThrow(rawEndpoint: string): dynamic.Endpoint[];
|
|
134
|
-
resolveEndpointLocationOrThrow(location: dynamic.EndpointLocation): dynamic.Endpoint[];
|
|
135
99
|
getGoTypeReferenceFromDeclaration({ declaration }: {
|
|
136
|
-
declaration: dynamic.Declaration;
|
|
100
|
+
declaration: FernIr.dynamic.Declaration;
|
|
137
101
|
}): go.TypeReference;
|
|
138
102
|
getEnvironmentTypeReferenceFromID(environmentID: string): go.TypeReference | undefined;
|
|
139
|
-
isSingleEnvironmentID(environment: dynamic.EnvironmentValues): environment is EnvironmentId;
|
|
140
|
-
isMultiEnvironmentValues(environment: dynamic.EnvironmentValues): environment is dynamic.MultipleEnvironmentUrlValues;
|
|
141
|
-
newParameterNotRecognizedError(parameterName: string): Error;
|
|
142
103
|
private getEnvironmentTypeReference;
|
|
143
|
-
private isListTypeReference;
|
|
144
|
-
private parsedEndpointMatches;
|
|
145
104
|
}
|
|
146
105
|
|
|
147
|
-
export { DynamicSnippetsGeneratorContext as D, type FilePropertyInfo as F,
|
|
106
|
+
export { DynamicSnippetsGeneratorContext as D, type FilePropertyInfo as F, DynamicTypeInstantiationMapper as a, DynamicTypeMapper as b, FilePropertyMapper as c };
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { AbstractFormatter } from '@fern-api/browser-compatible-base-generator';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { FernIr } from '@fern-api/dynamic-ir-sdk';
|
|
3
|
+
import { D as DynamicSnippetsGeneratorContext } from './DynamicSnippetsGeneratorContext-lz2pTZw3.js';
|
|
4
4
|
import '@fern-api/go-ast';
|
|
5
|
-
import './TypeInstance.js';
|
|
6
|
-
import './DiscriminatedUnionTypeInstance.js';
|
|
7
|
-
import './context/ErrorReporter.js';
|
|
8
5
|
|
|
9
6
|
declare class EndpointSnippetGenerator {
|
|
10
7
|
private context;
|
|
@@ -14,12 +11,12 @@ declare class EndpointSnippetGenerator {
|
|
|
14
11
|
formatter?: AbstractFormatter;
|
|
15
12
|
});
|
|
16
13
|
generateSnippet({ endpoint, request }: {
|
|
17
|
-
endpoint: dynamic.Endpoint;
|
|
18
|
-
request: dynamic.EndpointSnippetRequest;
|
|
14
|
+
endpoint: FernIr.dynamic.Endpoint;
|
|
15
|
+
request: FernIr.dynamic.EndpointSnippetRequest;
|
|
19
16
|
}): Promise<string>;
|
|
20
17
|
generateSnippetSync({ endpoint, request }: {
|
|
21
|
-
endpoint: dynamic.Endpoint;
|
|
22
|
-
request: dynamic.EndpointSnippetRequest;
|
|
18
|
+
endpoint: FernIr.dynamic.Endpoint;
|
|
19
|
+
request: FernIr.dynamic.EndpointSnippetRequest;
|
|
23
20
|
}): string;
|
|
24
21
|
private buildCodeBlock;
|
|
25
22
|
private constructClient;
|
|
@@ -48,7 +45,6 @@ declare class EndpointSnippetGenerator {
|
|
|
48
45
|
private getPathParameters;
|
|
49
46
|
private getMethod;
|
|
50
47
|
private getRootClientFuncInvocation;
|
|
51
|
-
private newAuthMismatchError;
|
|
52
48
|
}
|
|
53
49
|
|
|
54
50
|
export { EndpointSnippetGenerator };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-X7QP3WH3.js";import"./chunk-J745U74Q.js";import"./chunk-TUE3DOHS.js";export{a as EndpointSnippetGenerator};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as c}from"./chunk-SS6XZXHU.js";import{c as a}from"./chunk-J745U74Q.js";import{a as m}from"./chunk-D3UUM672.js";import{a as s}from"./chunk-I3VUX77R.js";import{j as r,k as i,m as o,p,q as t}from"./chunk-TUE3DOHS.js";i();o();var u=class f extends a{constructor({ir:e,config:n}){super({ir:e,config:n});r(this,"ir");r(this,"customConfig");r(this,"dynamicTypeMapper");r(this,"dynamicTypeInstantiationMapper");r(this,"filePropertyMapper");r(this,"rootImportPath");this.ir=e,this.customConfig=n.customConfig!=null?n.customConfig:void 0,this.dynamicTypeMapper=new m({context:this}),this.dynamicTypeInstantiationMapper=new c({context:this}),this.filePropertyMapper=new s({context:this}),this.rootImportPath=p({config:n,customConfig:this.customConfig})}clone(){return new f({ir:this.ir,config:this.config})}getMethodName(e){return e.pascalCase.unsafeName}getTypeName(e){return e.pascalCase.unsafeName}getImportPath(e){let n=e.packagePath.map(g=>g.pascalCase.unsafeName.toLowerCase());return[this.rootImportPath,...n].join("/")}getContextTypeReference(){return t.typeReference({name:"Context",importPath:"context"})}getContextTodoFunctionInvocation(){return t.invokeFunc({func:t.typeReference({name:"TODO",importPath:"context"}),arguments_:[]})}getIoReaderTypeReference(){return t.typeReference({name:"Reader",importPath:"io"})}getNewStringsReaderFunctionInvocation(e){return t.invokeFunc({func:t.typeReference({name:"NewReader",importPath:"strings"}),arguments_:[t.TypeInstantiation.string(e)]})}getClientConstructorName(){var e;return((e=this.customConfig)==null?void 0:e.exportedClientName)!=null?`New${this.customConfig.exportedClientName}`:"NewClient"}getClientImportPath(){return`${this.rootImportPath}/client`}getOptionImportPath(){return`${this.rootImportPath}/option`}getGoTypeReferenceFromDeclaration({declaration:e}){return t.typeReference({name:e.name.pascalCase.unsafeName,importPath:this.getImportPath(e.fernFilepath)})}getEnvironmentTypeReferenceFromID(e){let n=this.resolveEnvironmentName(e);if(n!=null)return this.getEnvironmentTypeReference(n)}getEnvironmentTypeReference(e){return t.typeReference({name:`Environments.${this.getTypeName(e)}`,importPath:this.rootImportPath})}};export{u as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as c,k as i,m as p,n,q as e}from"./chunk-TUE3DOHS.js";i();p();var a=class{constructor({context:t}){c(this,"context");this.context=t}convert(t){switch(t.typeReference.type){case"list":return e.Type.slice(this.convert({typeReference:t.typeReference}));case"literal":return this.convertLiteral({literal:t.typeReference.value});case"map":return e.Type.map(this.convert({typeReference:t.typeReference.key}),this.convert({typeReference:t.typeReference.value}));case"named":{let r=this.context.resolveNamedType({typeId:t.typeReference.value});return r==null?this.convertUnknown():this.convertNamed({named:r})}case"optional":return e.Type.optional(this.convert({typeReference:t.typeReference.value}));case"nullable":return e.Type.optional(this.convert({typeReference:t.typeReference.value}));case"primitive":return this.convertPrimitive({primitive:t.typeReference.value});case"set":return e.Type.slice(this.convert({typeReference:t.typeReference}));case"unknown":return this.convertUnknown();default:n(t.typeReference)}}convertLiteral({literal:t}){switch(t.type){case"boolean":return e.Type.bool();case"string":return e.Type.string()}}convertNamed({named:t}){let r=e.Type.reference(e.typeReference({name:this.context.getTypeName(t.declaration.name),importPath:this.context.getImportPath(t.declaration.fernFilepath)}));switch(t.type){case"alias":case"enum":return r;case"discriminatedUnion":case"object":case"undiscriminatedUnion":return e.Type.pointer(r);default:n(t)}}convertUnknown(){return e.Type.any()}convertPrimitive({primitive:t}){switch(t){case"INTEGER":return e.Type.int();case"UINT":return e.Type.int();case"LONG":return e.Type.int64();case"UINT_64":return e.Type.int64();case"FLOAT":return e.Type.float64();case"DOUBLE":return e.Type.float64();case"BOOLEAN":return e.Type.bool();case"STRING":return e.Type.string();case"DATE":return e.Type.date();case"DATE_TIME":return e.Type.dateTime();case"UUID":return e.Type.uuid();case"BASE_64":return e.Type.bytes();case"BIG_INTEGER":return e.Type.string();default:n(t)}}};export{a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as p,k as s,m as y,n as l,q as n}from"./chunk-TUE3DOHS.js";s();y();var c=class{constructor({context:t}){p(this,"context");this.context=t}getFilePropertyInfo({body:t,value:o}){var a;let e={fileFields:[],bodyPropertyFields:[]},i=(a=this.context.getRecord(o))!=null?a:{};for(let r of t.properties)switch(r.type){case"file":e.fileFields.push({name:this.context.getTypeName(r.name),value:this.getSingleFileProperty({property:r,record:i})});break;case"fileArray":e.fileFields.push({name:this.context.getTypeName(r.name),value:this.getArrayFileProperty({property:r,record:i})});break;case"bodyProperty":e.bodyPropertyFields.push({name:this.context.getTypeName(r.name.name),value:this.getBodyProperty({property:r,record:i})});break;default:l(r)}return e}getSingleFileProperty({property:t,record:o}){let e=this.context.getSingleFileValue({property:t,record:o});return e==null?n.TypeInstantiation.nop():n.TypeInstantiation.reference(this.context.getNewStringsReaderFunctionInvocation(e))}getArrayFileProperty({property:t,record:o}){let e=this.context.getFileArrayValues({property:t,record:o});return e==null?n.TypeInstantiation.nop():n.TypeInstantiation.slice({valueType:n.Type.reference(this.context.getIoReaderTypeReference()),values:e.map(i=>n.TypeInstantiation.reference(this.context.getNewStringsReaderFunctionInvocation(i)))})}getBodyProperty({property:t,record:o}){let e=o[t.name.wireValue];return e==null?n.TypeInstantiation.nop():this.context.dynamicTypeInstantiationMapper.convert({typeReference:t.typeReference,value:e})}};export{c as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as P,b as T,c as b,d as A,j as o,k as a,m as p,n as f,o as g}from"./chunk-TUE3DOHS.js";a();p();var E=class{constructor(e){o(this,"context");this.context=e}};a();p();var n={Critical:"CRITICAL",Warning:"WARNING"},y=class h{constructor(){o(this,"errors");o(this,"path");this.errors=[],this.path=[]}add(e){this.errors.push(T(P({},e),{path:[...this.path]}))}scope(e){this.path.push(e)}unscope(){this.path.pop()}getBySeverity(e){return this.errors.filter(r=>r.severity===e)}empty(){return this.errors.length===0}size(){return this.errors.length}clone(){let e=new h;return e.errors=[...this.errors],e.path=[...this.path],e}reset(){this.errors=[],this.path=[]}toDynamicSnippetErrors(){return this.errors.map(e=>({severity:e.severity,path:e.path!=null?this.pathToStringArray(e.path):void 0,message:e.message}))}pathToStringArray(e){let r=[];for(let t of e){if(typeof t=="string"){r.push(t);continue}r[r.length-1]+=`[${t.index}]`}return r}};a();p();a();p();a();p();var v=class{constructor(){o(this,"REFERENCE_REGEX",/^(GET|POST|PUT|DELETE|PATCH)\s(\/[a-zA-Z0-9\/{}_-]*)$/)}validate(e){return this.REFERENCE_REGEX.test(e)?{type:"valid"}:{type:"invalid"}}tryParse(e){if(this.validate(e).type==="invalid")return;let t=e.match(this.REFERENCE_REGEX);if(!(t==null||t[1]==null||t[2]==null))return{method:t[1],path:t[2]}}};var R=class{constructor({ir:e,config:r}){o(this,"config");o(this,"errors");o(this,"_ir");o(this,"httpEndpointReferenceParser");this._ir=e,this.config=r,this.errors=new y,this.httpEndpointReferenceParser=new v}associateQueryParametersByWireValue({parameters:e,values:r}){let t=[];for(let[i,s]of Object.entries(r)){this.errors.scope(i);try{let l=e.find(m=>m.name.wireValue===i);if(l==null)throw this.newParameterNotRecognizedError(i);let c=this.isListTypeReference(l.typeReference)&&!Array.isArray(s)?[s]:s;t.push({name:l.name,typeReference:l.typeReference,value:c})}finally{this.errors.unscope()}}return t}associateByWireValue({parameters:e,values:r,ignoreMissingParameters:t}){let i=[];for(let[s,l]of Object.entries(r)){this.errors.scope(s);try{let c=e.find(m=>m.name.wireValue===s);if(c==null){if(t)continue;this.errors.add({severity:n.Critical,message:this.newParameterNotRecognizedError(s).message});continue}i.push({name:c.name,typeReference:c.typeReference,value:l})}finally{this.errors.unscope()}}return i}getSingleFileValue({property:e,record:r}){let t=r[e.wireValue];if(t!=null){if(typeof t!="string"){this.errors.add({severity:n.Critical,message:`Expected file value to be a string, got ${typeof t}`});return}return t}}getFileArrayValues({property:e,record:r}){let t=r[e.wireValue];if(t==null)return;if(!Array.isArray(t)){this.errors.add({severity:n.Critical,message:`Expected file array value to be an array of strings, got ${typeof t}`});return}let i=[];for(let s of t){if(typeof s!="string"){this.errors.add({severity:n.Critical,message:`Expected file array value to be an array of strings, got ${typeof s}`});return}i.push(s)}return i}getRecord(e){if(typeof e!="object"||Array.isArray(e)){this.errors.add({severity:n.Critical,message:`Expected object with key, value pairs but got: ${Array.isArray(e)?"array":typeof e}`});return}return e==null?{}:e}resolveNamedType({typeId:e}){let r=this._ir.types[e];if(r==null){this.errors.add({severity:n.Critical,message:`Type identified by "${e}" could not be found`});return}return r}resolveDiscriminatedUnionTypeInstance({discriminatedUnion:e,value:r}){let t=this.getRecord(r);if(t==null)return;let i=e.discriminant.wireValue,s=t[i];if(s==null){this.errors.add({severity:n.Critical,message:this.newParameterNotRecognizedError(i).message});return}if(typeof s!="string"){this.errors.add({severity:n.Critical,message:`Expected discriminant value to be a string but got: ${typeof s}`});return}let l=e.types[s];if(l==null){this.errors.add({severity:n.Critical,message:`No type found for discriminant value "${s}"`});return}let x=t,{[i]:c}=x,m=A(x,[b(i)]);return{singleDiscriminatedUnionType:l,discriminantValue:l.discriminantValue,value:m}}resolveEndpointOrThrow(e){let r=this.httpEndpointReferenceParser.tryParse(e);if(r==null)throw new Error(`Failed to parse endpoint reference "${e}"`);return this.resolveEndpointLocationOrThrow(r)}resolveEndpointLocationOrThrow(e){let r=[];for(let t of Object.values(this._ir.endpoints))this.parsedEndpointMatches({endpoint:t,parsedEndpoint:e})&&r.push(t);if(r.length===0)throw new Error(`Failed to find endpoint identified by "${e.method} ${e.path}"`);return r}needsRequestParameter({request:e,inlinePathParameters:r,inlineFileProperties:t}){var i;return this.includePathParametersInWrappedRequest({request:e,inlinePathParameters:r})||e.queryParameters!=null&&e.queryParameters.length>0||e.headers!=null&&e.headers.length>0?!0:e.body!=null?this.includeRequestBodyInWrappedRequest({body:e.body,inlineFileProperties:t}):!((i=e.metadata)!=null&&i.onlyPathParameters)}includePathParametersInWrappedRequest({request:e,inlinePathParameters:r}){var t,i;return r&&((i=(t=e.metadata)==null?void 0:t.includePathParameters)!=null?i:!1)}isFileUploadRequestBody(e){switch(e.type){case"fileUpload":return!0;case"properties":case"referenced":return!1;default:f(e)}}resolveEnvironmentName(e){if(this._ir.environments==null)return;let r=this._ir.environments.environments;switch(r.type){case"singleBaseUrl":{let t=r.environments.find(i=>i.id===e);return t==null?void 0:t.name}case"multipleBaseUrls":{let t=r.environments.find(i=>i.id===e);return t==null?void 0:t.name}default:f(r)}}isSingleEnvironmentID(e){return typeof e=="string"}isMultiEnvironmentValues(e){return typeof e=="object"}validateMultiEnvironmentUrlValues(e){if(this._ir.environments==null)return this.errors.add({severity:n.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;let r=this._ir.environments.environments;switch(r.type){case"singleBaseUrl":return this.errors.add({severity:n.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;case"multipleBaseUrls":{let t=r.environments[0];if(t==null)return this.errors.add({severity:n.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let i=new Set(g(t.urls));for(let s of g(e))i.has(s)&&i.delete(s);return i.size>0?(this.errors.add({severity:n.Critical,message:`The provided environments are invalid; got: [${Object.keys(e).join(", ")}], expected: [${g(t.urls).join(", ")}]`}),!1):!0}}}getValueAsNumber({value:e}){if(typeof e!="number"){this.errors.add({severity:n.Critical,message:this.newTypeMismatchError({expected:"number",value:e}).message});return}return e}getValueAsBoolean({value:e}){if(typeof e!="boolean"){this.errors.add({severity:n.Critical,message:this.newTypeMismatchError({expected:"boolean",value:e}).message});return}return e}getValueAsString({value:e}){if(typeof e!="string"){this.errors.add({severity:n.Critical,message:this.newTypeMismatchError({expected:"string",value:e}).message});return}return e}isOptional(e){switch(e.type){case"nullable":return this.isOptional(e.value);case"optional":return!0;case"named":{let r=this.resolveNamedType({typeId:e.value});return r==null?!1:r.type==="alias"?this.isNullable(r.typeReference):!1}}return!1}isNullable(e){switch(e.type){case"nullable":return!0;case"optional":return this.isNullable(e.value);case"named":{let r=this.resolveNamedType({typeId:e.value});return r==null?!1:r.type==="alias"?this.isNullable(r.typeReference):!1}}return!1}newAuthMismatchError({auth:e,values:r}){return new Error(`Expected auth type ${e.type}, got ${r.type}`)}newParameterNotRecognizedError(e){return new Error(`"${e}" is not a recognized parameter for this endpoint`)}newTypeMismatchError({expected:e,value:r}){return new Error(`Expected ${e}, got ${typeof r}`)}includeRequestBodyInWrappedRequest({body:e,inlineFileProperties:r}){switch(e.type){case"properties":case"referenced":return!0;case"fileUpload":return this.includeFileUploadBodyInWrappedRequest({fileUpload:e,inlineFileProperties:r});default:f(e)}}includeFileUploadBodyInWrappedRequest({fileUpload:e,inlineFileProperties:r}){return this.fileUploadHasBodyProperties({fileUpload:e})||r&&this.fileUploadHasFileProperties({fileUpload:e})}fileUploadHasBodyProperties({fileUpload:e}){return e.properties.some(r=>{switch(r.type){case"file":case"fileArray":return!1;case"bodyProperty":return!0;default:f(r)}})}fileUploadHasFileProperties({fileUpload:e}){return e.properties.some(r=>{switch(r.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:f(r)}})}isListTypeReference(e){return e.type==="optional"?this.isListTypeReference(e.value):e.type==="list"||e.type==="set"}parsedEndpointMatches({endpoint:e,parsedEndpoint:r}){return e.location.method===r.method&&e.location.path===r.path}};a();p();var w=class{constructor(){o(this,"reporter");o(this,"snippet");o(this,"err");this.snippet=void 0,this.reporter=void 0,this.err=void 0}update({context:e,snippet:r}){(this.reporter==null||this.reporter.size()>e.errors.size())&&(this.reporter=e.errors.clone(),this.snippet=r)}getResponseOrThrow({endpoint:e}){var r;if(this.snippet!=null&&this.reporter!=null)return{snippet:this.snippet,errors:this.reporter.toDynamicSnippetErrors()};throw(r=this.err)!=null?r:new Error(`Failed to generate snippet for endpoint "${e.method} ${e.path}"`)}};a();p();var S={PathParameters:"pathParameters",QueryParameters:"queryParameters",Headers:"headers",RequestBody:"requestBody"};a();p();export{E as a,n as b,R as c,w as d,S as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as c}from"./chunk-J745U74Q.js";import{j as p,k as l,m as d,n as s,q as i}from"./chunk-TUE3DOHS.js";l();d();var y=class{constructor({context:e}){p(this,"context");this.context=e}convert(e){if(e.value===null&&!this.context.isNullable(e.typeReference)&&this.context.errors.add({severity:c.Critical,message:"Expected non-null value, but got null"}),e.value==null)return i.TypeInstantiation.nop();switch(e.typeReference.type){case"list":return this.convertList({list:e.typeReference.value,value:e.value});case"literal":return i.TypeInstantiation.nop();case"map":return this.convertMap({map:e.typeReference,value:e.value});case"named":{let n=this.context.resolveNamedType({typeId:e.typeReference.value});return n==null?i.TypeInstantiation.nop():this.convertNamed({named:n,value:e.value,as:e.as})}case"nullable":return i.TypeInstantiation.optional(this.convert({typeReference:e.typeReference.value,value:e.value,as:e.as}));case"optional":return i.TypeInstantiation.optional(this.convert({typeReference:e.typeReference.value,value:e.value,as:e.as}));case"primitive":return this.convertPrimitive({primitive:e.typeReference.value,value:e.value,as:e.as});case"set":return this.convertList({list:e.typeReference.value,value:e.value});case"unknown":return this.convertUnknown({value:e.value});default:s(e.typeReference)}}convertList({list:e,value:n}){return Array.isArray(n)?i.TypeInstantiation.slice({valueType:this.context.dynamicTypeMapper.convert({typeReference:e}),values:n.map((r,t)=>{this.context.errors.scope({index:t});try{return this.convert({typeReference:e,value:r})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:c.Critical,message:`Expected array but got: ${typeof n}`}),i.TypeInstantiation.nop())}convertMap({map:e,value:n}){return typeof n!="object"||n==null?(this.context.errors.add({severity:c.Critical,message:`Expected object but got: ${n==null?"null":typeof n}`}),i.TypeInstantiation.nop()):i.TypeInstantiation.map({keyType:this.context.dynamicTypeMapper.convert({typeReference:e.key}),valueType:this.context.dynamicTypeMapper.convert({typeReference:e.value}),entries:Object.entries(n).map(([r,t])=>{this.context.errors.scope(r);try{return{key:this.convert({typeReference:e.key,value:r,as:"key"}),value:this.convert({typeReference:e.value,value:t})}}finally{this.context.errors.unscope()}})})}convertNamed({named:e,value:n,as:r}){switch(e.type){case"alias":return this.convert({typeReference:e.typeReference,value:n,as:r});case"discriminatedUnion":return this.convertDiscriminatedUnion({discriminatedUnion:e,value:n});case"enum":return this.convertEnum({enum_:e,value:n});case"object":return this.convertObject({object_:e,value:n});case"undiscriminatedUnion":return this.convertUndicriminatedUnion({undicriminatedUnion:e,value:n});default:s(e)}}convertDiscriminatedUnion({discriminatedUnion:e,value:n}){let r=this.context.getGoTypeReferenceFromDeclaration({declaration:e.declaration}),t=this.context.resolveDiscriminatedUnionTypeInstance({discriminatedUnion:e,value:n});if(t==null)return i.TypeInstantiation.nop();let a=t.singleDiscriminatedUnionType,o=this.getBaseFields({discriminatedUnionTypeInstance:t,singleDiscriminatedUnionType:a});switch(a.type){case"samePropertiesAsObject":{let u=this.context.resolveNamedType({typeId:a.typeId});return u==null?i.TypeInstantiation.nop():i.TypeInstantiation.structPointer({typeReference:r,fields:[{name:this.context.getTypeName(a.discriminantValue.name),value:this.convertNamed({named:u,value:t.value})},...o]})}case"singleProperty":{let u=this.context.getRecord(t.value);if(u==null)return i.TypeInstantiation.nop();try{return this.context.errors.scope(a.discriminantValue.wireValue),i.TypeInstantiation.structPointer({typeReference:r,fields:[{name:this.context.getTypeName(a.discriminantValue.name),value:this.convert({typeReference:a.typeReference,value:u[a.discriminantValue.wireValue]})},...o]})}finally{this.context.errors.unscope()}}case"noProperties":return i.TypeInstantiation.structPointer({typeReference:r,fields:[{name:this.context.getTypeName(t.discriminantValue.name),value:i.TypeInstantiation.string(a.discriminantValue.wireValue)},...o]});default:s(a)}}getBaseFields({discriminatedUnionTypeInstance:e,singleDiscriminatedUnionType:n}){var t,a;return this.context.associateByWireValue({parameters:(t=n.properties)!=null?t:[],values:(a=this.context.getRecord(e.value))!=null?a:{},ignoreMissingParameters:!0}).map(o=>{this.context.errors.scope(o.name.wireValue);try{return{name:this.context.getTypeName(o.name.name),value:this.convert(o)}}finally{this.context.errors.unscope()}})}convertObject({object_:e,value:n}){var t;let r=this.context.associateByWireValue({parameters:e.properties,values:(t=this.context.getRecord(n))!=null?t:{}});return i.TypeInstantiation.structPointer({typeReference:i.typeReference({name:this.context.getTypeName(e.declaration.name),importPath:this.context.getImportPath(e.declaration.fernFilepath)}),fields:r.map(a=>{this.context.errors.scope(a.name.wireValue);try{return{name:this.context.getTypeName(a.name.name),value:this.convert(a)}}finally{this.context.errors.unscope()}})})}convertEnum({enum_:e,value:n}){let r=this.getEnumValueName({enum_:e,value:n});return r==null?i.TypeInstantiation.nop():i.TypeInstantiation.enum(i.typeReference({name:r,importPath:this.context.getImportPath(e.declaration.fernFilepath)}))}getEnumValueName({enum_:e,value:n}){if(typeof n!="string"){this.context.errors.add({severity:c.Critical,message:`Expected enum value string, got: ${typeof n}`});return}let r=e.values.find(t=>t.wireValue===n);if(r==null){this.context.errors.add({severity:c.Critical,message:`An enum value named "${n}" does not exist in this context`});return}return`${this.context.getTypeName(e.declaration.name)}${this.context.getTypeName(r.name)}`}convertUndicriminatedUnion({undicriminatedUnion:e,value:n}){let r=this.findMatchingUndiscriminatedUnionType({undicriminatedUnion:e,value:n});if(r==null)return i.TypeInstantiation.nop();let t=this.getUndiscriminatedUnionFieldName({typeReference:r.valueTypeReference});return t==null?i.TypeInstantiation.nop():i.TypeInstantiation.structPointer({typeReference:this.context.getGoTypeReferenceFromDeclaration({declaration:e.declaration}),fields:[{name:t,value:r.typeInstantiation}]})}findMatchingUndiscriminatedUnionType({undicriminatedUnion:e,value:n}){for(let r of e.types)try{let t=this.convert({typeReference:r,value:n});return{valueTypeReference:r,typeInstantiation:t}}catch(t){continue}this.context.errors.add({severity:c.Critical,message:`None of the types in the undicriminated union matched the given "${typeof n}" value`})}getUndiscriminatedUnionFieldName({typeReference:e}){switch(e.type){case"list":return this.getUndiscriminatedUnionFieldNameForList({list:e});case"literal":return this.getUndiscriminatedUnionFieldNameForLiteral({literal:e.value});case"map":return this.getUndiscriminatedUnionFieldNameForMap({map:e});case"named":{let n=this.context.resolveNamedType({typeId:e.value});return n==null?void 0:this.context.getTypeName(n.declaration.name)}case"optional":return this.getUndiscriminatedUnionFieldNameForOptional({typeReference:e});case"nullable":return this.getUndiscriminatedUnionFieldNameForOptional({typeReference:e});case"primitive":return this.getUndiscriminatedUnionFieldNameForPrimitive({primitive:e.value});case"set":return this.getUndiscriminatedUnionFieldNameForSet({set:e});case"unknown":return"Unknown";default:s(e)}}getUndiscriminatedUnionFieldNameForList({list:e}){let n=this.getUndiscriminatedUnionFieldName({typeReference:e});if(n!=null)return`${n}List`}getUndiscriminatedUnionFieldNameForMap({map:e}){let n=this.getUndiscriminatedUnionFieldName({typeReference:e.key});if(n==null)return;let r=this.getUndiscriminatedUnionFieldName({typeReference:e.value});if(r!=null)return`${n}${r}Map`}getUndiscriminatedUnionFieldNameForOptional({typeReference:e}){let n=this.getUndiscriminatedUnionFieldName({typeReference:e});if(n!=null)return`${n}Optional`}getUndiscriminatedUnionFieldNameForSet({set:e}){let n=this.getUndiscriminatedUnionFieldName({typeReference:e});if(n!=null)return`${n}Set`}getUndiscriminatedUnionFieldNameForLiteral({literal:e}){switch(e.type){case"boolean":return e.value?"TrueLiteral":"FalseLiteral";case"string":return`${e.value}StringLiteral`;default:s(e)}}getUndiscriminatedUnionFieldNameForPrimitive({primitive:e}){switch(e){case"INTEGER":case"UINT":return"Integer";case"LONG":case"UINT_64":return"Long";case"FLOAT":case"DOUBLE":return"Double";case"BOOLEAN":return"Boolean";case"BIG_INTEGER":case"STRING":return"String";case"UUID":return"Uuid";case"DATE":return"Date";case"DATE_TIME":return"DateTime";case"BASE_64":return"Base64";default:s(e)}}convertUnknown({value:e}){return i.TypeInstantiation.any(e)}convertPrimitive({primitive:e,value:n,as:r}){switch(e){case"INTEGER":case"UINT":{let t=this.getValueAsNumber({value:n,as:r});return t==null?i.TypeInstantiation.nop():i.TypeInstantiation.int(t)}case"LONG":case"UINT_64":{let t=this.getValueAsNumber({value:n,as:r});return t==null?i.TypeInstantiation.nop():i.TypeInstantiation.int64(t)}case"FLOAT":case"DOUBLE":{let t=this.getValueAsNumber({value:n,as:r});return t==null?i.TypeInstantiation.nop():i.TypeInstantiation.float64(t)}case"BOOLEAN":{let t=this.getValueAsBoolean({value:n,as:r});return t==null?i.TypeInstantiation.nop():i.TypeInstantiation.bool(t)}case"STRING":{let t=this.context.getValueAsString({value:n});return t==null?i.TypeInstantiation.nop():i.TypeInstantiation.string(t)}case"DATE":{let t=this.context.getValueAsString({value:n});return t==null?i.TypeInstantiation.nop():i.TypeInstantiation.date(t)}case"DATE_TIME":{let t=this.context.getValueAsString({value:n});return t==null?i.TypeInstantiation.nop():i.TypeInstantiation.dateTime(t)}case"UUID":{let t=this.context.getValueAsString({value:n});return t==null?i.TypeInstantiation.nop():i.TypeInstantiation.uuid(t)}case"BASE_64":{let t=this.context.getValueAsString({value:n});return t==null?i.TypeInstantiation.nop():i.TypeInstantiation.bytes(t)}case"BIG_INTEGER":{let t=this.context.getValueAsString({value:n});return t==null?i.TypeInstantiation.nop():i.TypeInstantiation.string(t)}default:s(e)}}getValueAsNumber({value:e,as:n}){let r=n==="key"&&typeof e=="string"?Number(e):e;return this.context.getValueAsNumber({value:r})}getValueAsBoolean({value:e,as:n}){let r=n==="key"?typeof e=="string"?e==="true":e==="false"?!1:e:e;return this.context.getValueAsBoolean({value:r})}};export{y as a};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var Ze=Object.create;var Q=Object.defineProperty,Qe=Object.defineProperties,Xe=Object.getOwnPropertyDescriptor,qe=Object.getOwnPropertyDescriptors,Ke=Object.getOwnPropertyNames,ne=Object.getOwnPropertySymbols,et=Object.getPrototypeOf,me=Object.prototype.hasOwnProperty,Ee=Object.prototype.propertyIsEnumerable;var le=(r,t,e)=>t in r?Q(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Cr=(r,t)=>{for(var e in t||(t={}))me.call(t,e)&&le(r,e,t[e]);if(ne)for(var e of ne(t))Ee.call(t,e)&&le(r,e,t[e]);return r},$r=(r,t)=>Qe(r,qe(t));var Fr=r=>typeof r=="symbol"?r:r+"",Or=(r,t)=>{var e={};for(var n in r)me.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&ne)for(var n of ne(r))t.indexOf(n)<0&&Ee.call(r,n)&&(e[n]=r[n]);return e};var we=(r,t)=>()=>(r&&(t=r(r=0)),t);var Wr=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),tt=(r,t)=>{for(var e in t)Q(r,e,{get:t[e],enumerable:!0})},ve=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ke(t))!me.call(r,i)&&i!==e&&Q(r,i,{get:()=>t[i],enumerable:!(n=Xe(t,i))||n.enumerable});return r};var Vr=(r,t,e)=>(e=r!=null?Ze(et(r)):{},ve(t||!r||!r.__esModule?Q(e,"default",{value:r,enumerable:!0}):e,r)),Gr=r=>ve(Q({},"__esModule",{value:!0}),r);var h=(r,t,e)=>le(r,typeof t!="symbol"?t+"":t,e);function Ie(){throw new Error("setTimeout has not been defined")}function Re(){throw new Error("clearTimeout has not been defined")}function _e(r){if(B===setTimeout)return setTimeout(r,0);if((B===Ie||!B)&&setTimeout)return B=setTimeout,setTimeout(r,0);try{return B(r,0)}catch(t){try{return B.call(null,r,0)}catch(e){return B.call(this,r,0)}}}function rt(r){if(M===clearTimeout)return clearTimeout(r);if((M===Re||!M)&&clearTimeout)return M=clearTimeout,clearTimeout(r);try{return M(r)}catch(t){try{return M.call(null,r)}catch(e){return M.call(this,r)}}}function nt(){!Z||!D||(Z=!1,D.length?P=D.concat(P):ie=-1,P.length&&ke())}function ke(){if(!Z){var r=_e(nt);Z=!0;for(var t=P.length;t;){for(D=P,P=[];++ie<t;)D&&D[ie].run();ie=-1,t=P.length}D=null,Z=!1,rt(r)}}function it(r){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];P.push(new Se(r,t)),P.length===1&&!Z&&_e(ke)}function Se(r,t){this.fun=r,this.array=t}function C(){}function At(r){throw new Error("process.binding is not supported")}function Et(){return"/"}function vt(r){throw new Error("process.chdir is not supported")}function Nt(){return 0}function Rt(r){var t=It.call(z)*.001,e=Math.floor(t),n=Math.floor(t%1*1e9);return r&&(e=e-r[0],n=n-r[1],n<0&&(e--,n+=1e9)),[e,n]}function kt(){var r=new Date,t=r-_t;return t/1e3}var B,M,P,Z,D,ie,ot,st,at,ut,ft,ct,ht,pt,lt,mt,wt,dt,xt,yt,Tt,gt,z,It,_t,m,Ne,u=we(()=>{"use strict";B=Ie,M=Re;typeof globalThis.setTimeout=="function"&&(B=setTimeout);typeof globalThis.clearTimeout=="function"&&(M=clearTimeout);P=[],Z=!1,ie=-1;Se.prototype.run=function(){this.fun.apply(null,this.array)};ot="browser",st="browser",at=!0,ut={},ft=[],ct="",ht={},pt={},lt={};mt=C,wt=C,dt=C,xt=C,yt=C,Tt=C,gt=C;z=globalThis.performance||{},It=z.now||z.mozNow||z.msNow||z.oNow||z.webkitNow||function(){return new Date().getTime()};_t=new Date;m={nextTick:it,title:ot,browser:at,env:ut,argv:ft,version:ct,versions:ht,on:mt,addListener:wt,once:dt,off:xt,removeListener:yt,removeAllListeners:Tt,emit:gt,binding:At,cwd:Et,chdir:vt,umask:Nt,hrtime:Rt,platform:st,release:pt,config:lt,uptime:kt},Ne={};Object.keys(Ne).forEach(r=>{let t=r.split("."),e=m;for(let n=0;n<t.length;n++){let i=t[n];n===t.length-1?e[i]=Ne[r]:e=e[i]||(e[i]={})}})});function Le(){xe=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=r.length;t<e;++t)_[t]=r[t],E[r.charCodeAt(t)]=t;E[45]=62,E[95]=63}function Pt(r){xe||Le();var t,e,n,i,o,s,c=r.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=r[c-2]==="="?2:r[c-1]==="="?1:0,s=new St(c*3/4-o),n=o>0?c-4:c;var p=0;for(t=0,e=0;t<n;t+=4,e+=3)i=E[r.charCodeAt(t)]<<18|E[r.charCodeAt(t+1)]<<12|E[r.charCodeAt(t+2)]<<6|E[r.charCodeAt(t+3)],s[p++]=i>>16&255,s[p++]=i>>8&255,s[p++]=i&255;return o===2?(i=E[r.charCodeAt(t)]<<2|E[r.charCodeAt(t+1)]>>4,s[p++]=i&255):o===1&&(i=E[r.charCodeAt(t)]<<10|E[r.charCodeAt(t+1)]<<4|E[r.charCodeAt(t+2)]>>2,s[p++]=i>>8&255,s[p++]=i&255),s}function Ut(r){return _[r>>18&63]+_[r>>12&63]+_[r>>6&63]+_[r&63]}function bt(r,t,e){for(var n,i=[],o=t;o<e;o+=3)n=(r[o]<<16)+(r[o+1]<<8)+r[o+2],i.push(Ut(n));return i.join("")}function Pe(r){xe||Le();for(var t,e=r.length,n=e%3,i="",o=[],s=16383,c=0,p=e-n;c<p;c+=s)o.push(bt(r,c,c+s>p?p:c+s));return n===1?(t=r[e-1],i+=_[t>>2],i+=_[t<<4&63],i+="=="):n===2&&(t=(r[e-2]<<8)+r[e-1],i+=_[t>>10],i+=_[t>>4&63],i+=_[t<<2&63],i+="="),o.push(i),o.join("")}function oe(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function U(r,t){if(oe()<t)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(t),r.__proto__=a.prototype):(r===null&&(r=new a(t)),r.length=t),r}function a(r,t,e){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(r,t,e);if(typeof r=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return ye(this,r)}return Be(this,r,t,e)}function Be(r,t,e,n){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&t instanceof ArrayBuffer?Mt(r,t,e,n):typeof t=="string"?Bt(r,t,e):Yt(r,t)}function Me(r){if(typeof r!="number")throw new TypeError('"size" argument must be a number');if(r<0)throw new RangeError('"size" argument must not be negative')}function Lt(r,t,e,n){return Me(t),t<=0?U(r,t):e!==void 0?typeof n=="string"?U(r,t).fill(e,n):U(r,t).fill(e):U(r,t)}function ye(r,t){if(Me(t),r=U(r,t<0?0:Te(t)|0),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)r[e]=0;return r}function Bt(r,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Ye(t,e)|0;r=U(r,n);var i=r.write(t,e);return i!==n&&(r=r.slice(0,i)),r}function de(r,t){var e=t.length<0?0:Te(t.length)|0;r=U(r,e);for(var n=0;n<e;n+=1)r[n]=t[n]&255;return r}function Mt(r,t,e,n){if(t.byteLength,e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?t=new Uint8Array(t):n===void 0?t=new Uint8Array(t,e):t=new Uint8Array(t,e,n),a.TYPED_ARRAY_SUPPORT?(r=t,r.__proto__=a.prototype):r=de(r,t),r}function Yt(r,t){if(k(t)){var e=Te(t.length)|0;return r=U(r,e),r.length===0||t.copy(r,0,0,e),r}if(t){if(typeof ArrayBuffer!="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||tr(t.length)?U(r,0):de(r,t);if(t.type==="Buffer"&&Array.isArray(t.data))return de(r,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Te(r){if(r>=oe())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+oe().toString(16)+" bytes");return r|0}function k(r){return!!(r!=null&&r._isBuffer)}function Ye(r,t){if(k(r))return r.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;typeof r!="string"&&(r=""+r);var e=r.length;if(e===0)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return se(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Ve(r).length;default:if(n)return se(r).length;t=(""+t).toLowerCase(),n=!0}}function Dt(r,t,e){var n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,t>>>=0,e<=t))return"";for(r||(r="utf8");;)switch(r){case"hex":return jt(this,t,e);case"utf8":case"utf-8":return $e(this,t,e);case"ascii":return Ht(this,t,e);case"latin1":case"binary":return Jt(this,t,e);case"base64":return Vt(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return zt(this,t,e);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}function $(r,t,e){var n=r[t];r[t]=r[e],r[e]=n}function De(r,t,e,n,i){if(r.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:r.length-1),e<0&&(e=r.length+e),e>=r.length){if(i)return-1;e=r.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof t=="string"&&(t=a.from(t,n)),k(t))return t.length===0?-1:Ue(r,t,e,n,i);if(typeof t=="number")return t=t&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,t,e):Uint8Array.prototype.lastIndexOf.call(r,t,e):Ue(r,[t],e,n,i);throw new TypeError("val must be string, number or Buffer")}function Ue(r,t,e,n,i){var o=1,s=r.length,c=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||t.length<2)return-1;o=2,s/=2,c/=2,e/=2}function p(A,j){return o===1?A[j]:A.readUInt16BE(j*o)}var w;if(i){var d=-1;for(w=e;w<s;w++)if(p(r,w)===p(t,d===-1?0:w-d)){if(d===-1&&(d=w),w-d+1===c)return d*o}else d!==-1&&(w-=w-d),d=-1}else for(e+c>s&&(e=s-c),w=e;w>=0;w--){for(var l=!0,I=0;I<c;I++)if(p(r,w+I)!==p(t,I)){l=!1;break}if(l)return w}return-1}function Ct(r,t,e,n){e=Number(e)||0;var i=r.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var c=parseInt(t.substr(s*2,2),16);if(isNaN(c))return s;r[e+s]=c}return s}function $t(r,t,e,n){return fe(se(t,r.length-e),r,e,n)}function Ce(r,t,e,n){return fe(Kt(t),r,e,n)}function Ft(r,t,e,n){return Ce(r,t,e,n)}function Ot(r,t,e,n){return fe(Ve(t),r,e,n)}function Wt(r,t,e,n){return fe(er(t,r.length-e),r,e,n)}function Vt(r,t,e){return t===0&&e===r.length?Pe(r):Pe(r.slice(t,e))}function $e(r,t,e){e=Math.min(r.length,e);for(var n=[],i=t;i<e;){var o=r[i],s=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c<=e){var p,w,d,l;switch(c){case 1:o<128&&(s=o);break;case 2:p=r[i+1],(p&192)===128&&(l=(o&31)<<6|p&63,l>127&&(s=l));break;case 3:p=r[i+1],w=r[i+2],(p&192)===128&&(w&192)===128&&(l=(o&15)<<12|(p&63)<<6|w&63,l>2047&&(l<55296||l>57343)&&(s=l));break;case 4:p=r[i+1],w=r[i+2],d=r[i+3],(p&192)===128&&(w&192)===128&&(d&192)===128&&(l=(o&15)<<18|(p&63)<<12|(w&63)<<6|d&63,l>65535&&l<1114112&&(s=l))}}s===null?(s=65533,c=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=c}return Gt(n)}function Gt(r){var t=r.length;if(t<=be)return String.fromCharCode.apply(String,r);for(var e="",n=0;n<t;)e+=String.fromCharCode.apply(String,r.slice(n,n+=be));return e}function Ht(r,t,e){var n="";e=Math.min(r.length,e);for(var i=t;i<e;++i)n+=String.fromCharCode(r[i]&127);return n}function Jt(r,t,e){var n="";e=Math.min(r.length,e);for(var i=t;i<e;++i)n+=String.fromCharCode(r[i]);return n}function jt(r,t,e){var n=r.length;(!t||t<0)&&(t=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=t;o<e;++o)i+=qt(r[o]);return i}function zt(r,t,e){for(var n=r.slice(t,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}function y(r,t,e){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+t>e)throw new RangeError("Trying to access beyond buffer length")}function T(r,t,e,n,i,o){if(!k(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(e+n>r.length)throw new RangeError("Index out of range")}function ae(r,t,e,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(r.length-e,2);i<o;++i)r[e+i]=(t&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}function ue(r,t,e,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(r.length-e,4);i<o;++i)r[e+i]=t>>>(n?i:3-i)*8&255}function Fe(r,t,e,n,i,o){if(e+n>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Oe(r,t,e,n,i){return i||Fe(r,t,e,4,34028234663852886e22,-34028234663852886e22),He(r,t,e,n,23,4),e+4}function We(r,t,e,n,i){return i||Fe(r,t,e,8,17976931348623157e292,-17976931348623157e292),He(r,t,e,n,52,8),e+8}function Qt(r){if(r=Xt(r).replace(Zt,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function Xt(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function qt(r){return r<16?"0"+r.toString(16):r.toString(16)}function se(r,t){t=t||1/0;for(var e,n=r.length,i=null,o=[],s=0;s<n;++s){if(e=r.charCodeAt(s),e>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(t-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((t-=1)<0)break;o.push(e)}else if(e<2048){if((t-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function Kt(r){for(var t=[],e=0;e<r.length;++e)t.push(r.charCodeAt(e)&255);return t}function er(r,t){for(var e,n,i,o=[],s=0;s<r.length&&!((t-=2)<0);++s)e=r.charCodeAt(s),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function Ve(r){return Pt(Qt(r))}function fe(r,t,e,n){for(var i=0;i<n&&!(i+e>=t.length||i>=r.length);++i)t[i+e]=r[i];return i}function tr(r){return r!==r}function rr(r){return r!=null&&(!!r._isBuffer||Ge(r)||nr(r))}function Ge(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function nr(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&Ge(r.slice(0,0))}function ce(r,t,e,n,i){var o,s,c=i*8-n-1,p=(1<<c)-1,w=p>>1,d=-7,l=e?i-1:0,I=e?-1:1,A=r[t+l];for(l+=I,o=A&(1<<-d)-1,A>>=-d,d+=c;d>0;o=o*256+r[t+l],l+=I,d-=8);for(s=o&(1<<-d)-1,o>>=-d,d+=n;d>0;s=s*256+r[t+l],l+=I,d-=8);if(o===0)o=1-w;else{if(o===p)return s?NaN:(A?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-w}return(A?-1:1)*s*Math.pow(2,o-n)}function He(r,t,e,n,i,o){var s,c,p,w=o*8-i-1,d=(1<<w)-1,l=d>>1,I=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=n?0:o-1,j=n?1:-1,ze=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,s=d):(s=Math.floor(Math.log(t)/Math.LN2),t*(p=Math.pow(2,-s))<1&&(s--,p*=2),s+l>=1?t+=I/p:t+=I*Math.pow(2,1-l),t*p>=2&&(s++,p/=2),s+l>=d?(c=0,s=d):s+l>=1?(c=(t*p-1)*Math.pow(2,i),s=s+l):(c=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;r[e+A]=c&255,A+=j,c/=256,i-=8);for(s=s<<i|c,w+=i;w>0;r[e+A]=s&255,A+=j,s/=256,w-=8);r[e+A-j]|=ze*128}var _,E,St,xe,be,Zt,Je=we(()=>{"use strict";u();f();_=[],E=[],St=typeof Uint8Array!="undefined"?Uint8Array:Array,xe=!1;a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;a.poolSize=8192;a._augment=function(r){return r.__proto__=a.prototype,r};a.from=function(r,t,e){return Be(null,r,t,e)};a.kMaxLength=oe();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&a[Symbol.species]);a.alloc=function(r,t,e){return Lt(null,r,t,e)};a.allocUnsafe=function(r){return ye(null,r)};a.allocUnsafeSlow=function(r){return ye(null,r)};a.isBuffer=rr;a.compare=function(t,e){if(!k(t)||!k(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,i=e.length,o=0,s=Math.min(n,i);o<s;++o)if(t[o]!==e[o]){n=t[o],i=e[o];break}return n<i?-1:i<n?1:0};a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};a.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return a.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var i=a.allocUnsafe(e),o=0;for(n=0;n<t.length;++n){var s=t[n];if(!k(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,o),o+=s.length}return i};a.byteLength=Ye;a.prototype._isBuffer=!0;a.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)$(this,e,e+1);return this};a.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)$(this,e,e+3),$(this,e+1,e+2);return this};a.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)$(this,e,e+7),$(this,e+1,e+6),$(this,e+2,e+5),$(this,e+3,e+4);return this};a.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?$e(this,0,t):Dt.apply(this,arguments)};a.prototype.equals=function(t){if(!k(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:a.compare(this,t)===0};a.prototype.compare=function(t,e,n,i,o){if(!k(t))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===t)return 0;for(var s=o-i,c=n-e,p=Math.min(s,c),w=this.slice(i,o),d=t.slice(e,n),l=0;l<p;++l)if(w[l]!==d[l]){s=w[l],c=d[l];break}return s<c?-1:c<s?1:0};a.prototype.includes=function(t,e,n){return this.indexOf(t,e,n)!==-1};a.prototype.indexOf=function(t,e,n){return De(this,t,e,n,!0)};a.prototype.lastIndexOf=function(t,e,n){return De(this,t,e,n,!1)};a.prototype.write=function(t,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((n===void 0||n>o)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return Ct(this,t,e,n);case"utf8":case"utf-8":return $t(this,t,e,n);case"ascii":return Ce(this,t,e,n);case"latin1":case"binary":return Ft(this,t,e,n);case"base64":return Ot(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Wt(this,t,e,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};be=4096;a.prototype.slice=function(t,e){var n=this.length;t=~~t,e=e===void 0?n:~~e,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<t&&(e=t);var i;if(a.TYPED_ARRAY_SUPPORT)i=this.subarray(t,e),i.__proto__=a.prototype;else{var o=e-t;i=new a(o,void 0);for(var s=0;s<o;++s)i[s]=this[s+t]}return i};a.prototype.readUIntLE=function(t,e,n){t=t|0,e=e|0,n||y(t,e,this.length);for(var i=this[t],o=1,s=0;++s<e&&(o*=256);)i+=this[t+s]*o;return i};a.prototype.readUIntBE=function(t,e,n){t=t|0,e=e|0,n||y(t,e,this.length);for(var i=this[t+--e],o=1;e>0&&(o*=256);)i+=this[t+--e]*o;return i};a.prototype.readUInt8=function(t,e){return e||y(t,1,this.length),this[t]};a.prototype.readUInt16LE=function(t,e){return e||y(t,2,this.length),this[t]|this[t+1]<<8};a.prototype.readUInt16BE=function(t,e){return e||y(t,2,this.length),this[t]<<8|this[t+1]};a.prototype.readUInt32LE=function(t,e){return e||y(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};a.prototype.readUInt32BE=function(t,e){return e||y(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};a.prototype.readIntLE=function(t,e,n){t=t|0,e=e|0,n||y(t,e,this.length);for(var i=this[t],o=1,s=0;++s<e&&(o*=256);)i+=this[t+s]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};a.prototype.readIntBE=function(t,e,n){t=t|0,e=e|0,n||y(t,e,this.length);for(var i=e,o=1,s=this[t+--i];i>0&&(o*=256);)s+=this[t+--i]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*e)),s};a.prototype.readInt8=function(t,e){return e||y(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};a.prototype.readInt16LE=function(t,e){e||y(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};a.prototype.readInt16BE=function(t,e){e||y(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};a.prototype.readInt32LE=function(t,e){return e||y(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};a.prototype.readInt32BE=function(t,e){return e||y(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};a.prototype.readFloatLE=function(t,e){return e||y(t,4,this.length),ce(this,t,!0,23,4)};a.prototype.readFloatBE=function(t,e){return e||y(t,4,this.length),ce(this,t,!1,23,4)};a.prototype.readDoubleLE=function(t,e){return e||y(t,8,this.length),ce(this,t,!0,52,8)};a.prototype.readDoubleBE=function(t,e){return e||y(t,8,this.length),ce(this,t,!1,52,8)};a.prototype.writeUIntLE=function(t,e,n,i){if(t=+t,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;T(this,t,e,n,o,0)}var s=1,c=0;for(this[e]=t&255;++c<n&&(s*=256);)this[e+c]=t/s&255;return e+n};a.prototype.writeUIntBE=function(t,e,n,i){if(t=+t,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;T(this,t,e,n,o,0)}var s=n-1,c=1;for(this[e+s]=t&255;--s>=0&&(c*=256);)this[e+s]=t/c&255;return e+n};a.prototype.writeUInt8=function(t,e,n){return t=+t,e=e|0,n||T(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t&255,e+1};a.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=e|0,n||T(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):ae(this,t,e,!0),e+2};a.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=e|0,n||T(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):ae(this,t,e,!1),e+2};a.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=e|0,n||T(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255):ue(this,t,e,!0),e+4};a.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=e|0,n||T(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):ue(this,t,e,!1),e+4};a.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*n-1);T(this,t,e,n,o-1,-o)}var s=0,c=1,p=0;for(this[e]=t&255;++s<n&&(c*=256);)t<0&&p===0&&this[e+s-1]!==0&&(p=1),this[e+s]=(t/c>>0)-p&255;return e+n};a.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*n-1);T(this,t,e,n,o-1,-o)}var s=n-1,c=1,p=0;for(this[e+s]=t&255;--s>=0&&(c*=256);)t<0&&p===0&&this[e+s+1]!==0&&(p=1),this[e+s]=(t/c>>0)-p&255;return e+n};a.prototype.writeInt8=function(t,e,n){return t=+t,e=e|0,n||T(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=t&255,e+1};a.prototype.writeInt16LE=function(t,e,n){return t=+t,e=e|0,n||T(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):ae(this,t,e,!0),e+2};a.prototype.writeInt16BE=function(t,e,n){return t=+t,e=e|0,n||T(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):ae(this,t,e,!1),e+2};a.prototype.writeInt32LE=function(t,e,n){return t=+t,e=e|0,n||T(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):ue(this,t,e,!0),e+4};a.prototype.writeInt32BE=function(t,e,n){return t=+t,e=e|0,n||T(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):ue(this,t,e,!1),e+4};a.prototype.writeFloatLE=function(t,e,n){return Oe(this,t,e,!0,n)};a.prototype.writeFloatBE=function(t,e,n){return Oe(this,t,e,!1,n)};a.prototype.writeDoubleLE=function(t,e,n){return We(this,t,e,!0,n)};a.prototype.writeDoubleBE=function(t,e,n){return We(this,t,e,!1,n)};a.prototype.copy=function(t,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-n&&(i=t.length-e+n);var o=i-n,s;if(this===t&&n<e&&e<i)for(s=o-1;s>=0;--s)t[s+e]=this[s+n];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(s=0;s<o;++s)t[s+e]=this[s+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o};a.prototype.fill=function(t,e,n,i){if(typeof t=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),t.length===1){var o=t.charCodeAt(0);o<256&&(t=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!a.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof t=="number"&&(t=t&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);var s;if(typeof t=="number")for(s=e;s<n;++s)this[s]=t;else{var c=k(t)?t:se(new a(t,i).toString()),p=c.length;for(s=0;s<n-e;++s)this[s+e]=c[s%p]}return this};Zt=/[^+\/0-9A-Za-z-_]/g});var f=we(()=>{"use strict";Je()});u();f();function X(r){throw new Error("Unexpected value: "+JSON.stringify(r))}u();f();u();f();function ir(r){return Object.keys(r)}u();f();u();f();u();f();function q(r,t){var n,i;let e=(n=r.split("/").pop())!=null?n:r;return t!=null&&t.stripExtension&&(i=e.split(".")[0])!=null?i:e}var or="sdk";function sr({config:r,customConfig:t}){let e=ur({config:r}),n=ar({config:r,customConfig:t});return e!=null?cr({importPath:n,majorVersion:e}):n}function ar({config:r,customConfig:t}){var e,n,i;return(i=(n=t==null?void 0:t.importPath)!=null?n:(e=t==null?void 0:t.module)==null?void 0:e.path)!=null?i:r.output.mode.type==="github"?hr(r.output.mode.repoUrl,"https://"):or}function ur({config:r}){let t=fr({config:r});if(!(t==null||t==="v0"||t==="v1"))return`${t}`}function fr({config:r}){let t=pr(r);if(t==null)return;let e=t.split(".");if(e[0]==null)return;let n=e[0];return n.startsWith("v")?n:`v${n}`}function cr({importPath:r,majorVersion:t}){return q(r)===t?r:`${r}/${t}`}function hr(r,t){return r.startsWith(t)?r.slice(t.length):r}function pr(r){var e;let t=(e=r==null?void 0:r.output)==null?void 0:e.mode;if(t!=null)return t.type==="github"||t.type==="publish"?t.version:void 0}var Ae={};tt(Ae,{AstNode:()=>x,CodeBlock:()=>S,Enum:()=>W,Field:()=>V,Func:()=>G,FuncInvocation:()=>R,Method:()=>b,MethodInvocation:()=>L,Parameter:()=>H,Struct:()=>J,Type:()=>re,TypeInstantiation:()=>N,TypeReference:()=>g,Writer:()=>O,codeblock:()=>kr,enum_:()=>Sr,field:()=>Pr,func:()=>Ur,invokeFunc:()=>br,invokeMethod:()=>Lr,method:()=>Br,parameter:()=>Mr,struct:()=>Yr,typeReference:()=>Dr});u();f();u();f();u();f();u();f();u();f();var F=class{};u();f();u();f();var Y=class extends F{constructor(e){super();h(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):this.value(e)}};var lr=4,K=class{constructor(){h(this,"buffer","");h(this,"indentLevel",0);h(this,"hasWrittenAnything",!1);h(this,"lastCharacterIsNewline",!1)}write(t){let e=t.length>0&&t.endsWith(`
|
|
2
|
+
`),n=e?t.substring(0,t.length-1):t,i=this.getIndentString(),o=n.replaceAll(`
|
|
3
|
+
`,`
|
|
4
|
+
${i}`);this.isAtStartOfLine()&&(o=i+o),e&&(o+=`
|
|
5
|
+
`),this.writeInternal(o)}writeNoIndent(t){let e=this.indentLevel;this.indentLevel=0,this.write(t),this.indentLevel=e}writeNode(t){t.write(this)}writeNodeStatement(t){t.write(this),this.write(";"),this.writeNewLineIfLastLineNot()}writeTextStatement(t){new Y(t).write(this),this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(t,e){new Y(t).write(this),this.write(" ("),this.writeNode(e),this.write(") {"),this.writeNewLineIfLastLineNot(),this.indent()}endControlFlow(){this.dedent(),this.writeLine("}")}openBlock(t,e="{",n,i="}"){let o=t.filter(s=>s!==void 0).join(" ");o?this.write(`${o} ${e!=null?e:""}`):this.write(e!=null?e:"");try{this.indent(),n(),this.dedent()}finally{this.write(i!=null?i:"")}}writeLine(t=""){this.write(t),this.writeNewLineIfLastLineNot()}newLine(){this.writeInternal(`
|
|
6
|
+
`)}writeNewLineIfLastLineNot(){this.lastCharacterIsNewline||this.writeInternal(`
|
|
7
|
+
`)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:t,delimiter:e,writeFunction:n}){if(t.length>0){let i=t[0];i!=null&&n(i);for(let o=1;o<t.length;o++){this.write(e);let s=t[o];s!=null&&n(s)}}}toString(){return this.buffer}writeInternal(t){return t.length>0&&(this.hasWrittenAnything=!0,this.lastCharacterIsNewline=t.endsWith(`
|
|
8
|
+
`)),this.buffer+=t}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*lr)}};u();f();var he=class{},ee=class extends he{async format(t){return t}formatSync(t){return t}};u();f();function ge(r){return(r==null?void 0:r.name)!=null}u();f();u();f();u();f();var mr=/[^0-9a-zA-Z_]/g,O=class extends K{constructor({packageName:e,rootImportPath:n,importPath:i,customConfig:o,formatter:s}){super();h(this,"packageName");h(this,"rootImportPath");h(this,"importPath");h(this,"customConfig");h(this,"formatter");h(this,"imports",{});this.packageName=e,this.rootImportPath=n,this.importPath=i,this.customConfig=o,this.formatter=s!=null?s:new ee}addImport(e){let n=this.imports[e];if(n!=null)return n;let i=this.getValidAlias(q(e));for(;i in this.imports;)i="_"+i;return this.imports[e]=i,i}getValidAlias(e){let n=e.split("-");return n[0]==null?e:n[0].replace(mr,"")}};var te=class extends O{constructor({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o}){super({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o})}async toStringAsync(){let t=this.getContent();if(this.formatter!=null)try{return this.formatter.format(t)}catch(e){throw new Error(`Failed to format Go file: ${e}
|
|
9
|
+
${t}`)}return t}toString(){let t=this.getContent();if(this.formatter!=null)try{return this.formatter.formatSync(t)}catch(e){throw new Error(`Failed to format Go file: ${e}
|
|
10
|
+
${t}`)}return t}getContent(){let t=`package ${this.packageName}
|
|
11
|
+
|
|
12
|
+
`,e=this.stringifyImports();return e.length>0?`${t}${e}
|
|
13
|
+
|
|
14
|
+
${this.buffer}`:t+this.buffer}stringifyImports(){let t=Object.entries(this.imports).filter(([e,n])=>e!==this.importPath).map(([e,n])=>` ${n} "${e}"`).join(`
|
|
15
|
+
`);return t?`import (
|
|
16
|
+
${t}
|
|
17
|
+
)`:""}};var x=class extends F{async toStringAsync({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o}){let s=new te({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o});return this.write(s),s.toStringAsync()}toString({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o}){let s=new te({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o});return this.write(s),s.toString()}};var S=class extends x{constructor(e){super();h(this,"arg");this.arg=e}write(e){return new Y(this.arg).write(e)}};u();f();u();f();var v=class extends x{constructor({docs:e}={}){super();h(this,"docs");this.docs=e}write(e){this.docs!=null&&this.docs.split(`
|
|
18
|
+
`).forEach(n=>{e.writeLine(`// ${n}`)})}};var W=class extends x{constructor({name:e,docs:n}){super();h(this,"name");h(this,"docs");h(this,"members",[]);this.name=e,this.docs=n}addMember(e){this.members.push(e)}write(e){e.writeNode(new v({docs:this.docs})),e.write(`type ${this.name} string`)}};u();f();var V=class extends x{constructor({name:e,type:n,docs:i}){super();h(this,"name");h(this,"type");h(this,"docs");this.name=e,this.type=n,this.docs=i}write(e){e.writeNode(new v({docs:this.docs})),e.write(`${this.name} `),this.type.write(e)}};u();f();u();f();var b=class extends x{constructor({name:e,parameters:n,return_:i,body:o,docs:s,typeReference:c}){super();h(this,"name");h(this,"parameters");h(this,"return_");h(this,"body");h(this,"docs");h(this,"typeReference");this.name=e,this.parameters=n,this.return_=i,this.body=o,this.docs=s,this.typeReference=c}write(e){var n;if(e.writeNode(new v({docs:this.docs})),e.write("func "),this.typeReference!=null&&this.writeReceiver({writer:e,typeReference:this.typeReference}),e.write(`${this.name}`),this.parameters.length===0)e.write("() ");else{e.writeLine("(");for(let i of this.parameters)e.writeNode(i),e.writeLine(",");e.write(")")}this.return_!=null&&(e.write("("),this.return_.forEach((i,o)=>{o>0&&e.write(", "),e.writeNode(i)}),e.write(")")),e.writeLine(" {"),e.indent(),(n=this.body)==null||n.write(e),e.dedent(),e.writeNewLineIfLastLineNot(),e.writeLine("}")}writeReceiver({writer:e,typeReference:n}){e.write(`(${this.getReceiverName(n.name)} `),n.write(e),e.write(") ")}getReceiverName(e){return e.charAt(0).toLowerCase()}};var G=class extends x{constructor({name:e,parameters:n,return_:i,body:o,docs:s}){super();h(this,"func");this.func=new b({name:e,parameters:n,return_:i,body:o,docs:s})}get name(){return this.func.name}get parameters(){return this.func.parameters}get return_(){return this.func.return_}get body(){return this.func.body}get docs(){return this.func.docs}write(e){e.writeNode(this.func)}};u();f();u();f();u();f();u();f();var g=class extends x{constructor({name:e,importPath:n}){super();h(this,"name");h(this,"importPath");this.name=e,this.importPath=n}write(e){if(e.importPath===this.importPath){e.write(this.name);return}let n=e.addImport(this.importPath);e.write(`${n}.${this.name}`)}};u();f();var L=class extends x{constructor({method:e,arguments_:n,on:i}){super();h(this,"on");h(this,"method");h(this,"arguments_");this.on=i,this.method=e,this.arguments_=n}write(e){this.on.write(e),e.write("."),e.write(this.method),pe({writer:e,arguments_:this.arguments_})}};var wr=new Set(["bool","date","dateTime","float64","int","int64","string","uuid"]),je=new Set(["any","bytes","map","slice"]),N=class r extends x{constructor(e){super();h(this,"internalType");this.internalType=e}write(e){switch(this.internalType.type){case"any":this.writeAny({writer:e,value:this.internalType.value});break;case"bool":e.write(this.internalType.value.toString());break;case"bytes":e.write(`[]byte("${this.internalType.value}")`);break;case"date":case"dateTime":e.writeNode(yr({writer:e,type:this.internalType}));break;case"enum":e.writeNode(this.internalType.typeReference);break;case"float64":e.write(this.internalType.value.toString());break;case"int":case"int64":e.write(this.internalType.value.toString());break;case"map":this.writeMap({writer:e,map:this.internalType});break;case"nil":e.write("nil");break;case"nop":break;case"optional":this.writeOptional({writer:e,type:this.internalType.value});break;case"reference":e.writeNode(this.internalType.value);break;case"slice":this.writeSlice({writer:e,slice:this.internalType});break;case"string":e.write(this.internalType.value.includes('"')||this.internalType.value.includes(`
|
|
19
|
+
`)?`\`${this.internalType.value}\``:`"${this.internalType.value}"`);break;case"struct":this.writeStruct({writer:e,struct:this.internalType});break;case"uuid":e.writeNode(Tr({value:this.internalType.value}));break;default:X(this.internalType)}}static any(e){return new this({type:"any",value:e})}static bool(e){return new this({type:"bool",value:e})}static bytes(e){return new this({type:"bytes",value:e})}static date(e){return new this({type:"date",value:e})}static dateTime(e){return new this({type:"dateTime",value:e})}static enum(e){return new this({type:"enum",typeReference:e})}static float64(e){return new this({type:"float64",value:e})}static int(e){return new this({type:"int",value:e})}static int64(e){return new this({type:"int64",value:e})}static map({keyType:e,valueType:n,entries:i}){return new this({type:"map",keyType:e,valueType:n,entries:i})}static nil(){return new this({type:"nil"})}static nop(){return new this({type:"nop"})}static optional(e){return this.isAlreadyOptional(e)?e:new this({type:"optional",value:e})}static reference(e){return new this({type:"reference",value:e})}static slice({valueType:e,values:n}){return new this({type:"slice",valueType:e,values:n})}static string(e){return new this({type:"string",value:e})}static struct({typeReference:e,fields:n}){return new this({type:"struct",typeReference:e,fields:n})}static structPointer({typeReference:e,fields:n}){return new this({type:"optional",value:new this({type:"struct",typeReference:e,fields:n})})}static uuid(e){return new this({type:"uuid",value:e})}static isNop(e){return e.internalType.type==="optional"?this.isNop(e.internalType.value):e.internalType.type==="nop"}writeAny({writer:e,value:n}){switch(typeof n){case"boolean":e.write(n.toString());return;case"string":e.write(n.includes('"')?`\`${n}\``:`"${n}"`);return;case"number":e.write(n.toString());return;case"object":if(n==null){e.write("nil");return}if(Array.isArray(n)){this.writeAnyArray({writer:e,value:n});return}this.writeAnyObject({writer:e,value:n});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof n}`)}}writeAnyArray({writer:e,value:n}){if(e.write("[]interface{}"),n.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let i of n)e.writeNode(r.any(i)),e.writeLine(",");e.dedent(),e.write("}")}writeAnyObject({writer:e,value:n}){e.write("map[string]interface{}");let i=Object.entries(n);if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let[o,s]of i)e.write(`"${o}": `),e.writeNode(r.any(s)),e.writeLine(",");e.dedent(),e.write("}")}writeMap({writer:e,map:n}){e.write("map["),e.writeNode(n.keyType),e.write("]"),e.writeNode(n.valueType);let i=gr({entries:n.entries});if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let o of i)o.key.write(e),e.write(": "),o.value.write(e),e.writeLine(",");e.dedent(),e.write("}")}writeOptional({writer:e,type:n}){if(wr.has(n.internalType.type)){e.writeNode(dr({writer:e,type:n}));return}if(je.has(n.internalType.type)){n.write(e);return}if(n.internalType.type==="enum"){e.writeNode(new L({on:n.internalType.typeReference,method:"Ptr",arguments_:[]}));return}e.write("&"),n.write(e)}static isAlreadyOptional(e){return e.internalType.type==="optional"||je.has(e.internalType.type)}writeSlice({writer:e,slice:n}){e.write("[]"),e.writeNode(n.valueType);let i=Er({values:n.values});if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let o of i)o.write(e),e.writeLine(",");e.dedent(),e.write("}")}writeStruct({writer:e,struct:n}){e.writeNode(n.typeReference);let i=Ar({fields:n.fields});if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let o of i)e.write(`${o.name}: `),o.value.write(e),e.writeLine(",");e.dedent(),e.write("}")}};function dr({writer:r,type:t}){return new R({func:new g({name:xr({type:t}),importPath:r.rootImportPath}),arguments_:[t]})}function xr({type:r}){switch(r.internalType.type){case"bool":return"Bool";case"date":case"dateTime":return"Time";case"float64":return"Float64";case"int":return"Int";case"int64":return"Int64";case"string":return"String";case"uuid":return"UUID";default:return""}}function yr({writer:r,type:t}){let e=t instanceof Date?"MustParseDate":"MustParseDateTime";return new R({func:new g({name:e,importPath:r.rootImportPath}),arguments_:[new S(`"${t.value}"`)]})}function Tr({value:r}){return new R({func:new g({name:"MustParse",importPath:"github.com/google/uuid"}),arguments_:[new S(`"${r}"`)]})}function gr({entries:r}){return r.filter(t=>!N.isNop(t.key)&&!N.isNop(t.value))}function Ar({fields:r}){return r.filter(t=>!N.isNop(t.value))}function Er({values:r}){return r.filter(t=>!N.isNop(t))}function pe({writer:r,arguments_:t}){let e=Nr(t);if(e.length===0){r.write("()");return}r.writeLine("("),r.indent();for(let n of e)vr({writer:r,argument:n}),r.writeLine(",");r.dedent(),r.write(")")}function vr({writer:r,argument:t}){ge(t)?t.assignment.write(r):t.write(r)}function Nr(r){return r.filter(t=>!(t instanceof N&&N.isNop(t)))}var R=class extends x{constructor({func:e,arguments_:n}){super();h(this,"func");h(this,"arguments_");this.func=e,this.arguments_=n}write(e){e.writeNode(this.func),pe({writer:e,arguments_:this.arguments_})}};u();f();var H=class extends x{constructor({name:e,type:n,docs:i}){super();h(this,"name");h(this,"type");h(this,"docs");this.name=e,this.type=n,this.docs=i}write(e){e.writeNode(new v({docs:this.docs})),e.write(`${this.name} `),this.type.write(e)}};u();f();var J=class extends x{constructor({name:e,importPath:n,docs:i}){super();h(this,"name");h(this,"importPath");h(this,"docs");h(this,"fields",[]);h(this,"methods",[]);this.name=e,this.importPath=n,this.docs=i}addField(e){this.fields.push(e)}addMethod(e){this.methods.push(e)}write(e){if(e.writeNode(new v({docs:this.docs})),e.write(`type ${this.name} struct {`),this.fields.length>0)e.writeLine("}");else{e.newLine(),e.indent();for(let n of this.fields)e.writeNode(n),e.newLine();e.dedent(),e.writeLine("}")}(this.constructor!=null||this.methods.length>0)&&e.newLine();for(let n of this.methods)e.writeNode(n),e.newLine()}};u();f();var Ir=new Set(["any","bytes","map","slice"]),re=class r extends x{constructor(e){super();h(this,"internalType");this.internalType=e}write(e,{comment:n}={}){switch(this.internalType.type){case"any":e.write("interface{}");break;case"bool":e.write("bool");break;case"bytes":e.write("[]byte");break;case"date":case"dateTime":e.writeNode(Rr);break;case"float64":e.write("float64");break;case"int":e.write("int");break;case"int64":e.write("int64");break;case"map":{e.write("map["),this.internalType.keyType.write(e),e.write("]"),this.internalType.valueType.write(e);break}case"optional":{e.write("*"),this.internalType.value.write(e);break}case"reference":e.writeNode(this.internalType.value);break;case"slice":e.write("[]"),this.internalType.value.write(e);break;case"string":e.write("string");break;case"uuid":e.writeNode(_r);break;default:X(this.internalType)}}isOptional(){return this.internalType.type==="optional"}static any(){return new this({type:"any"})}static bool(){return new this({type:"bool"})}static bytes(){return new this({type:"bytes"})}static date(){return new this({type:"date"})}static dateTime(){return new this({type:"dateTime"})}static float64(){return new this({type:"float64"})}static int(){return new this({type:"int"})}static int64(){return new this({type:"int64"})}static map(e,n){return new this({type:"map",keyType:e,valueType:n})}static optional(e){return this.isAlreadyOptional(e)?e:new this({type:"optional",value:e})}static pointer(e){return r.optional(e)}static reference(e){return new this({type:"reference",value:e})}static slice(e){return new this({type:"slice",value:e})}static string(){return new this({type:"string"})}static uuid(){return new this({type:"uuid"})}static isAlreadyOptional(e){return e.internalType.type==="optional"||Ir.has(e.internalType.type)}},Rr=new g({importPath:"time",name:"Time"}),_r=new g({importPath:"github.com/google/uuid",name:"UUID"});function kr(r){return new S(r)}function Sr(r){return new W(r)}function Pr(r){return new V(r)}function Ur(r){return new G(r)}function br(r){return new R(r)}function Lr(r){return new L(r)}function Br(r){return new b(r)}function Mr(r){return new H(r)}function Yr(r){return new J(r)}function Dr(r){return new g(r)}u();f();export{Cr as a,$r as b,Fr as c,Or as d,we as e,Wr as f,tt as g,Vr as h,Gr as i,h as j,u as k,a as l,f as m,X as n,ir as o,sr as p,Ae as q};
|
|
20
|
+
/*! Bundled license information:
|
|
21
|
+
|
|
22
|
+
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
23
|
+
(*!
|
|
24
|
+
* The buffer module from node.js, for the browser.
|
|
25
|
+
*
|
|
26
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
27
|
+
* @license MIT
|
|
28
|
+
*)
|
|
29
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as s,e as c}from"./chunk-J745U74Q.js";import{j as f,k as F,m as P,n as u,q as n}from"./chunk-TUE3DOHS.js";F();P();var v="example",x="fern",B="do",R="client",A=class{constructor({context:e,formatter:t}){f(this,"context");f(this,"formatter");this.context=e,this.formatter=t}async generateSnippet({endpoint:e,request:t}){var o;return await this.buildCodeBlock({endpoint:e,snippet:t}).toStringAsync({packageName:v,importPath:x,rootImportPath:this.context.rootImportPath,customConfig:(o=this.context.customConfig)!=null?o:{},formatter:this.formatter})}generateSnippetSync({endpoint:e,request:t}){var o;return this.buildCodeBlock({endpoint:e,snippet:t}).toString({packageName:v,importPath:x,rootImportPath:this.context.rootImportPath,customConfig:(o=this.context.customConfig)!=null?o:{},formatter:this.formatter})}buildCodeBlock({endpoint:e,snippet:t}){return n.func({name:B,parameters:[],return_:[],body:n.codeblock(r=>{r.writeNode(this.constructClient({endpoint:e,snippet:t})),r.writeLine(),r.writeNode(this.callMethod({endpoint:e,snippet:t}))})})}constructClient({endpoint:e,snippet:t}){return n.codeblock(r=>{r.write(`${R} := `),r.writeNode(this.getRootClientFuncInvocation(this.getConstructorArgs({endpoint:e,snippet:t})))})}callMethod({endpoint:e,snippet:t}){return n.invokeMethod({on:n.codeblock(R),method:this.getMethod({endpoint:e}),arguments_:[this.context.getContextTodoFunctionInvocation(),...this.getMethodArgs({endpoint:e,snippet:t})]})}getConstructorArgs({endpoint:e,snippet:t}){let r=[],o=this.getConstructorBaseUrlArg({baseUrl:t.baseURL,environment:t.environment});return o!=null&&r.push(o),e.auth!=null&&(t.auth!=null?r.push(this.getConstructorAuthArg({auth:e.auth,values:t.auth})):this.context.errors.add({severity:s.Warning,message:`Auth with ${e.auth.type} configuration is required for this endpoint`})),this.context.errors.scope(c.Headers),this.context.ir.headers!=null&&t.headers!=null&&r.push(...this.getConstructorHeaderArgs({headers:this.context.ir.headers,values:t.headers})),this.context.errors.unscope(),r}getConstructorAuthArg({auth:e,values:t}){switch(e.type){case"basic":return t.type!=="basic"?(this.context.errors.add({severity:s.Critical,message:this.context.newAuthMismatchError({auth:e,values:t}).message}),n.TypeInstantiation.nop()):this.getConstructorBasicAuthArg({auth:e,values:t});case"bearer":return t.type!=="bearer"?(this.context.errors.add({severity:s.Critical,message:this.context.newAuthMismatchError({auth:e,values:t}).message}),n.TypeInstantiation.nop()):this.getConstructorBearerAuthArg({auth:e,values:t});case"header":return t.type!=="header"?(this.context.errors.add({severity:s.Critical,message:this.context.newAuthMismatchError({auth:e,values:t}).message}),n.TypeInstantiation.nop()):this.getConstructorHeaderAuthArg({auth:e,values:t});default:u(e)}}getConstructorBasicAuthArg({auth:e,values:t}){return n.codeblock(r=>{r.writeNode(n.invokeFunc({func:n.typeReference({name:"WithBasicAuth",importPath:this.context.getOptionImportPath()}),arguments_:[n.TypeInstantiation.string(t.username),n.TypeInstantiation.string(t.password)]}))})}getConstructorBaseUrlArg({baseUrl:e,environment:t}){let r=this.getBaseUrlArg({baseUrl:e,environment:t});if(r!=null)return n.codeblock(o=>{o.writeNode(n.invokeFunc({func:n.typeReference({name:"WithBaseURL",importPath:this.context.getOptionImportPath()}),arguments_:[r]}))})}getBaseUrlArg({baseUrl:e,environment:t}){if(e!=null&&t!=null){this.context.errors.add({severity:s.Critical,message:"Cannot specify both baseUrl and environment options"});return}if(e!=null)return n.TypeInstantiation.string(e);if(t!=null){if(this.context.isSingleEnvironmentID(t)){let r=this.context.getEnvironmentTypeReferenceFromID(t);if(r==null){this.context.errors.add({severity:s.Warning,message:`Environment ${JSON.stringify(t)} was not found`});return}return n.TypeInstantiation.reference(r)}this.context.isMultiEnvironmentValues(t)&&this.context.errors.add({severity:s.Warning,message:"The Go SDK doesn't support a multi-environment client option yet; use the baseUrl option instead"})}}getConstructorBearerAuthArg({auth:e,values:t}){return n.codeblock(r=>{r.writeNode(n.invokeFunc({func:n.typeReference({name:`With${e.token.pascalCase.unsafeName}`,importPath:this.context.getOptionImportPath()}),arguments_:[n.TypeInstantiation.string(t.token)]}))})}getConstructorHeaderAuthArg({auth:e,values:t}){return n.codeblock(r=>{r.writeNode(n.invokeFunc({func:n.typeReference({name:`With${e.header.name.name.pascalCase.unsafeName}`,importPath:this.context.getOptionImportPath()}),arguments_:[this.context.dynamicTypeInstantiationMapper.convert({typeReference:e.header.typeReference,value:t.value})]}))})}getConstructorHeaderArgs({headers:e,values:t}){let r=[];for(let o of e){let i=this.getConstructorHeaderArg({header:o,value:t.value});i!=null&&r.push(i)}return r}getConstructorHeaderArg({header:e,value:t}){let r=this.context.dynamicTypeInstantiationMapper.convert({typeReference:e.typeReference,value:t});if(!n.TypeInstantiation.isNop(r))return n.codeblock(o=>{o.writeNode(n.invokeFunc({func:n.typeReference({name:`With${e.name.name.pascalCase.unsafeName}`,importPath:this.context.getOptionImportPath()}),arguments_:[r]}))})}getMethodArgs({endpoint:e,snippet:t}){switch(e.request.type){case"inlined":return this.getMethodArgsForInlinedRequest({request:e.request,snippet:t});case"body":return this.getMethodArgsForBodyRequest({request:e.request,snippet:t});default:u(e.request)}}getMethodArgsForBodyRequest({request:e,snippet:t}){let r=[];if(this.context.errors.scope(c.PathParameters),e.pathParameters!=null){let o=this.getPathParameters({namedParameters:e.pathParameters,snippet:t});r.push(...o.map(i=>i.value))}return this.context.errors.unscope(),this.context.errors.scope(c.RequestBody),e.body!=null&&r.push(this.getBodyRequestArg({body:e.body,value:t.requestBody})),this.context.errors.unscope(),r}getBodyRequestArg({body:e,value:t}){switch(e.type){case"bytes":return this.getBytesBodyRequestArg({value:t});case"typeReference":return this.context.dynamicTypeInstantiationMapper.convert({typeReference:e.value,value:t});default:u(e)}}getBytesBodyRequestArg({value:e}){return typeof e!="string"?(this.context.errors.add({severity:s.Critical,message:`Expected bytes value to be a string, got ${typeof e}`}),n.TypeInstantiation.nop()):n.TypeInstantiation.bytes(e)}getMethodArgsForInlinedRequest({request:e,snippet:t}){var l,y,p,h;let r=[],{inlinePathParameters:o,inlineFileProperties:i}={inlinePathParameters:(y=(l=this.context.customConfig)==null?void 0:l.inlinePathParameters)!=null?y:!1,inlineFileProperties:(h=(p=this.context.customConfig)==null?void 0:p.inlineFileProperties)!=null?h:!1};this.context.errors.scope(c.PathParameters);let a=[];e.pathParameters!=null&&a.push(...this.getPathParameters({namedParameters:e.pathParameters,snippet:t})),this.context.errors.unscope(),this.context.errors.scope(c.RequestBody);let g=this.getFilePropertyInfo({request:e,snippet:t});return this.context.errors.unscope(),this.context.includePathParametersInWrappedRequest({request:e,inlinePathParameters:o})||r.push(...a.map(d=>d.value)),i||r.push(...g.fileFields.map(d=>d.value)),this.context.needsRequestParameter({request:e,inlinePathParameters:o,inlineFileProperties:i})&&r.push(this.getInlinedRequestArg({request:e,snippet:t,pathParameterFields:this.context.includePathParametersInWrappedRequest({request:e,inlinePathParameters:o})?a:[],filePropertyInfo:g})),r}getFilePropertyInfo({request:e,snippet:t}){return e.body==null||!this.context.isFileUploadRequestBody(e.body)?{fileFields:[],bodyPropertyFields:[]}:this.context.filePropertyMapper.getFilePropertyInfo({body:e.body,value:t.requestBody})}getInlinedRequestArg({request:e,snippet:t,pathParameterFields:r,filePropertyInfo:o}){var p,h,d,I;this.context.errors.scope(c.QueryParameters);let a=this.context.associateQueryParametersByWireValue({parameters:(p=e.queryParameters)!=null?p:[],values:(h=t.queryParameters)!=null?h:{}}).map(m=>({name:m.name.name.pascalCase.unsafeName,value:this.context.dynamicTypeInstantiationMapper.convert(m)}));this.context.errors.unscope(),this.context.errors.scope(c.Headers);let l=this.context.associateByWireValue({parameters:(d=e.headers)!=null?d:[],values:(I=t.headers)!=null?I:{}}).map(m=>({name:m.name.name.pascalCase.unsafeName,value:this.context.dynamicTypeInstantiationMapper.convert(m)}));this.context.errors.unscope(),this.context.errors.scope(c.RequestBody);let y=e.body!=null?this.getInlinedRequestBodyStructFields({body:e.body,value:t.requestBody,filePropertyInfo:o}):[];return this.context.errors.unscope(),n.TypeInstantiation.structPointer({typeReference:n.typeReference({name:this.context.getMethodName(e.declaration.name),importPath:this.context.getImportPath(e.declaration.fernFilepath)}),fields:[...r,...a,...l,...y]})}getInlinedRequestBodyStructFields({body:e,value:t,filePropertyInfo:r}){switch(e.type){case"properties":return this.getInlinedRequestBodyPropertyStructFields({parameters:e.value,value:t});case"referenced":return[this.getReferencedRequestBodyPropertyStructField({body:e,value:t})];case"fileUpload":return this.getFileUploadRequestBodyStructFields({filePropertyInfo:r});default:u(e)}}getFileUploadRequestBodyStructFields({filePropertyInfo:e}){var t;return(t=this.context.customConfig)!=null&&t.inlineFileProperties?[...e.fileFields,...e.bodyPropertyFields]:e.bodyPropertyFields}getReferencedRequestBodyPropertyStructField({body:e,value:t}){return{name:this.context.getTypeName(e.bodyKey),value:this.getReferencedRequestBodyPropertyTypeInstantiation({body:e.bodyType,value:t})}}getReferencedRequestBodyPropertyTypeInstantiation({body:e,value:t}){switch(e.type){case"bytes":return this.getBytesBodyRequestArg({value:t});case"typeReference":return this.context.dynamicTypeInstantiationMapper.convert({typeReference:e.value,value:t});default:u(e)}}getInlinedRequestBodyPropertyStructFields({parameters:e,value:t}){var i;let r=[],o=this.context.associateByWireValue({parameters:e,values:(i=this.context.getRecord(t))!=null?i:{}});for(let a of o)r.push({name:this.context.getTypeName(a.name.name),value:this.context.dynamicTypeInstantiationMapper.convert(a)});return r}getPathParameters({namedParameters:e,snippet:t}){var i;let r=[],o=this.context.associateByWireValue({parameters:e,values:(i=t.pathParameters)!=null?i:{}});for(let a of o)r.push({name:this.context.getTypeName(a.name.name),value:this.context.dynamicTypeInstantiationMapper.convert(a)});return r}getMethod({endpoint:e}){return e.declaration.fernFilepath.allParts.length>0?`${e.declaration.fernFilepath.allParts.map(t=>this.context.getMethodName(t)).join(".")}.${this.context.getMethodName(e.declaration.name)}`:this.context.getMethodName(e.declaration.name)}getRootClientFuncInvocation(e){return n.invokeFunc({func:n.typeReference({name:this.context.getClientConstructorName(),importPath:this.context.getClientImportPath()}),arguments_:e})}};export{A as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s}from"./chunk-X7QP3WH3.js";import{a as h}from"./chunk-5HP3T45N.js";import{a as f,d as a}from"./chunk-J745U74Q.js";import{j as c,k as d,m}from"./chunk-TUE3DOHS.js";d();m();var y=class extends f{constructor({ir:n,config:r,formatter:t}){super(new h({ir:n,config:r}));c(this,"formatter");this.formatter=t}async generate(n){let r=this.context.resolveEndpointLocationOrThrow(n.endpoint);if(r.length===0)throw new Error(`No endpoints found that match "${n.endpoint.method} ${n.endpoint.path}"`);let t=new a;for(let i of r){let o=this.context.clone(),p=new s({context:o,formatter:this.formatter});try{let e=await p.generateSnippet({endpoint:i,request:n});if(o.errors.empty())return{snippet:e,errors:void 0};t.update({context:o,snippet:e})}catch(e){t.err==null&&(t.err=e)}}return t.getResponseOrThrow({endpoint:n.endpoint})}generateSync(n){let r=this.context.resolveEndpointLocationOrThrow(n.endpoint);if(r.length===0)throw new Error(`No endpoints found that match "${n.endpoint.method} ${n.endpoint.path}"`);let t=new a;for(let i of r){let o=this.context.clone(),p=new s({context:o,formatter:this.formatter});try{let e=p.generateSnippetSync({endpoint:i,request:n});if(o.errors.empty())return{snippet:e,errors:void 0};t.update({context:o,snippet:e})}catch(e){t.err==null&&(t.err=e)}}return t.getResponseOrThrow({endpoint:n.endpoint})}};export{y as a};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import '@fern-api/browser-compatible-base-generator';
|
|
2
|
+
import '@fern-api/dynamic-ir-sdk';
|
|
2
3
|
import '@fern-api/go-ast';
|
|
3
|
-
|
|
4
|
-
import '../TypeInstance.js';
|
|
5
|
-
import '../DiscriminatedUnionTypeInstance.js';
|
|
6
|
-
export { D as DynamicSnippetsGeneratorContext } from '../DynamicSnippetsGeneratorContext-Dyk9qWMy.js';
|
|
7
|
-
import './ErrorReporter.js';
|
|
4
|
+
export { D as DynamicSnippetsGeneratorContext } from '../DynamicSnippetsGeneratorContext-lz2pTZw3.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a}from"../chunk-5HP3T45N.js";import"../chunk-SS6XZXHU.js";import"../chunk-J745U74Q.js";import"../chunk-D3UUM672.js";import"../chunk-I3VUX77R.js";import"../chunk-TUE3DOHS.js";export{a as DynamicSnippetsGeneratorContext};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
+
import '@fern-api/dynamic-ir-sdk';
|
|
1
2
|
import '@fern-api/go-ast';
|
|
2
|
-
export {
|
|
3
|
-
import '@fern-fern/ir-sdk/api';
|
|
3
|
+
export { a as DynamicTypeInstantiationMapper } from '../DynamicSnippetsGeneratorContext-lz2pTZw3.js';
|
|
4
4
|
import '@fern-api/browser-compatible-base-generator';
|
|
5
|
-
import '../TypeInstance.js';
|
|
6
|
-
import '../DiscriminatedUnionTypeInstance.js';
|
|
7
|
-
import './ErrorReporter.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-SS6XZXHU.js";import"../chunk-J745U74Q.js";import"../chunk-TUE3DOHS.js";export{a as DynamicTypeInstantiationMapper};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
+
import '@fern-api/dynamic-ir-sdk';
|
|
1
2
|
import '@fern-api/go-ast';
|
|
2
|
-
export {
|
|
3
|
-
import '@fern-fern/ir-sdk/api';
|
|
3
|
+
export { b as DynamicTypeMapper } from '../DynamicSnippetsGeneratorContext-lz2pTZw3.js';
|
|
4
4
|
import '@fern-api/browser-compatible-base-generator';
|
|
5
|
-
import '../TypeInstance.js';
|
|
6
|
-
import '../DiscriminatedUnionTypeInstance.js';
|
|
7
|
-
import './ErrorReporter.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-D3UUM672.js";import"../chunk-TUE3DOHS.js";export{a as DynamicTypeMapper};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
+
import '@fern-api/dynamic-ir-sdk';
|
|
1
2
|
import '@fern-api/go-ast';
|
|
2
|
-
export { F as FilePropertyInfo, c as FilePropertyMapper } from '../DynamicSnippetsGeneratorContext-
|
|
3
|
-
import '@fern-fern/ir-sdk/api';
|
|
3
|
+
export { F as FilePropertyInfo, c as FilePropertyMapper } from '../DynamicSnippetsGeneratorContext-lz2pTZw3.js';
|
|
4
4
|
import '@fern-api/browser-compatible-base-generator';
|
|
5
|
-
import '../TypeInstance.js';
|
|
6
|
-
import '../DiscriminatedUnionTypeInstance.js';
|
|
7
|
-
import './ErrorReporter.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-I3VUX77R.js";import"../chunk-TUE3DOHS.js";export{a as FilePropertyMapper};
|
package/esm/index.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
export { DynamicSnippetsGenerator } from './DynamicSnippetsGenerator.js';
|
|
2
2
|
import '@fern-api/browser-compatible-base-generator';
|
|
3
|
-
import '
|
|
3
|
+
import '@fern-api/dynamic-ir-sdk';
|
|
4
|
+
import './DynamicSnippetsGeneratorContext-lz2pTZw3.js';
|
|
4
5
|
import '@fern-api/go-ast';
|
|
5
|
-
import '@fern-fern/ir-sdk/api';
|
|
6
|
-
import './TypeInstance.js';
|
|
7
|
-
import './DiscriminatedUnionTypeInstance.js';
|
|
8
|
-
import './context/ErrorReporter.js';
|