@fern-api/go-dynamic-snippets 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/cjs/DiscriminatedUnionTypeInstance.cjs +1 -0
  2. package/cjs/DiscriminatedUnionTypeInstance.d.cts +12 -0
  3. package/cjs/DynamicSnippetsGenerator.cjs +19 -0
  4. package/cjs/DynamicSnippetsGenerator.d.cts +20 -0
  5. package/cjs/DynamicSnippetsGeneratorContext-DuDerGxa.d.cts +143 -0
  6. package/cjs/EndpointSnippetGenerator.cjs +19 -0
  7. package/cjs/EndpointSnippetGenerator.d.cts +52 -0
  8. package/cjs/Result.cjs +1 -0
  9. package/cjs/Result.d.cts +23 -0
  10. package/cjs/Scope.cjs +1 -0
  11. package/cjs/Scope.d.cts +9 -0
  12. package/cjs/TypeInstance.cjs +1 -0
  13. package/cjs/TypeInstance.d.cts +15 -0
  14. package/cjs/context/DynamicSnippetsGeneratorContext.cjs +19 -0
  15. package/cjs/context/DynamicSnippetsGeneratorContext.d.cts +7 -0
  16. package/cjs/context/DynamicTypeInstantiationMapper.cjs +19 -0
  17. package/cjs/context/DynamicTypeInstantiationMapper.d.cts +7 -0
  18. package/cjs/context/DynamicTypeMapper.cjs +19 -0
  19. package/cjs/context/DynamicTypeMapper.d.cts +7 -0
  20. package/cjs/context/ErrorReporter.cjs +1 -0
  21. package/cjs/context/ErrorReporter.d.cts +39 -0
  22. package/cjs/context/FilePropertyMapper.cjs +19 -0
  23. package/cjs/context/FilePropertyMapper.d.cts +7 -0
  24. package/cjs/index.cjs +22 -0
  25. package/{index.d.ts → cjs/index.d.cts} +1 -1
  26. package/esm/DiscriminatedUnionTypeInstance.d.ts +12 -0
  27. package/esm/DiscriminatedUnionTypeInstance.js +0 -0
  28. package/esm/DynamicSnippetsGenerator.d.ts +20 -0
  29. package/esm/DynamicSnippetsGenerator.js +1 -0
  30. package/esm/DynamicSnippetsGeneratorContext-DKWsHJSo.d.ts +143 -0
  31. package/esm/EndpointSnippetGenerator.d.ts +52 -0
  32. package/esm/EndpointSnippetGenerator.js +1 -0
  33. package/esm/Result.d.ts +23 -0
  34. package/esm/Result.js +1 -0
  35. package/esm/Scope.d.ts +9 -0
  36. package/esm/Scope.js +1 -0
  37. package/esm/TypeInstance.d.ts +15 -0
  38. package/esm/TypeInstance.js +0 -0
  39. package/esm/chunk-4PKXKUYU.js +1 -0
  40. package/esm/chunk-5XUC5IOB.js +1 -0
  41. package/esm/chunk-6JCPJA27.js +1 -0
  42. package/esm/chunk-BC35GX6S.js +1 -0
  43. package/esm/chunk-COBOWL3P.js +1 -0
  44. package/esm/chunk-IQODEXPX.js +1 -0
  45. package/esm/chunk-KJOW5AZT.js +1 -0
  46. package/esm/chunk-UVYC4FWB.js +1 -0
  47. package/esm/chunk-VAYOWHUI.js +19 -0
  48. package/esm/chunk-ZQRLKIRW.js +1 -0
  49. package/esm/chunk-ZYGZ4VN4.js +1 -0
  50. package/esm/context/DynamicSnippetsGeneratorContext.d.ts +7 -0
  51. package/esm/context/DynamicSnippetsGeneratorContext.js +1 -0
  52. package/esm/context/DynamicTypeInstantiationMapper.d.ts +7 -0
  53. package/esm/context/DynamicTypeInstantiationMapper.js +1 -0
  54. package/esm/context/DynamicTypeMapper.d.ts +7 -0
  55. package/esm/context/DynamicTypeMapper.js +1 -0
  56. package/esm/context/ErrorReporter.d.ts +39 -0
  57. package/esm/context/ErrorReporter.js +1 -0
  58. package/esm/context/FilePropertyMapper.d.ts +7 -0
  59. package/esm/context/FilePropertyMapper.js +1 -0
  60. package/esm/index.d.ts +8 -0
  61. package/esm/index.js +4 -0
  62. package/package.json +18 -6
  63. package/index.cjs +0 -22
@@ -0,0 +1,19 @@
1
+ "use strict";var R=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var W=Object.prototype.hasOwnProperty;var U=(n,r,e)=>r in n?R(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e;var O=(n,r)=>{for(var e in r)R(n,e,{get:r[e],enumerable:!0})},j=(n,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of V(r))!W.call(n,i)&&i!==e&&R(n,i,{get:()=>r[i],enumerable:!(t=G(r,i))||t.enumerable});return n};var Y=n=>j(R({},"__esModule",{value:!0}),n);var o=(n,r,e)=>U(n,typeof r!="symbol"?r+"":r,e);var we={};O(we,{FilePropertyMapper:()=>B});module.exports=Y(we);function g(n){throw new Error("Unexpected value: "+JSON.stringify(n))}var x=class{};var w=class extends x{constructor(e){super();o(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):this.value(e)}};var q=4,k=class{constructor(){o(this,"buffer","");o(this,"indentLevel",0);o(this,"hasWrittenAnything",!1);o(this,"lastCharacterIsNewline",!1)}write(r){let e=r.length>0&&r.endsWith(`
2
+ `),t=e?r.substring(0,r.length-1):r,i=this.getIndentString(),s=t.replaceAll(`
3
+ `,`
4
+ ${i}`);this.isAtStartOfLine()&&(s=i+s),e&&(s+=`
5
+ `),this.writeInternal(s)}writeNoIndent(r){let e=this.indentLevel;this.indentLevel=0,this.write(r),this.indentLevel=e}writeNode(r){r.write(this)}writeNodeStatement(r){r.write(this),this.write(";"),this.writeNewLineIfLastLineNot()}writeTextStatement(r){new w(r).write(this),this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(r,e){new w(r).write(this),this.write(" ("),this.writeNode(e),this.write(") {"),this.writeNewLineIfLastLineNot(),this.indent()}endControlFlow(){this.dedent(),this.writeLine("}")}openBlock(r,e="{",t,i="}"){let s=r.filter(p=>p!==void 0).join(" ");s?this.write(`${s} ${e!=null?e:""}`):this.write(e!=null?e:"");try{this.indent(),t(),this.dedent()}finally{this.write(i!=null?i:"")}}writeLine(r=""){this.write(r),this.writeNewLineIfLastLineNot()}newLine(){this.writeInternal(`
6
+ `)}writeNewLineIfLastLineNot(){this.lastCharacterIsNewline||this.writeInternal(`
7
+ `)}indent(){this.indentLevel++}dedent(){this.indentLevel--}writeInternal(r){return r.length>0&&(this.hasWrittenAnything=!0,this.lastCharacterIsNewline=r.endsWith(`
8
+ `)),this.buffer+=r}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*q)}};var E=class{},P=class extends E{async format(r){return r}formatSync(r){return r}};function _(n){return(n==null?void 0:n.name)!=null}function C(n,r){var t,i;let e=(t=n.split("/").pop())!=null?t:n;return r!=null&&r.stripExtension&&(i=e.split(".")[0])!=null?i:e}var H=/[^0-9a-zA-Z_]/g,N=class extends k{constructor({packageName:e,rootImportPath:t,importPath:i,customConfig:s,formatter:p}){super();o(this,"packageName");o(this,"rootImportPath");o(this,"importPath");o(this,"customConfig");o(this,"formatter");o(this,"imports",{});this.packageName=e,this.rootImportPath=t,this.importPath=i,this.customConfig=s,this.formatter=p!=null?p:new P}addImport(e){let t=this.imports[e];if(t!=null)return t;let i=this.getValidAlias(C(e));for(;i in this.imports;)i="_"+i;return this.imports[e]=i,i}getValidAlias(e){let t=e.split("-");return t[0]==null?e:t[0].replace(H,"")}};var S=class extends N{constructor({packageName:r,rootImportPath:e,importPath:t,customConfig:i,formatter:s}){super({packageName:r,rootImportPath:e,importPath:t,customConfig:i,formatter:s})}async toString(){let r=this.getContent();if(this.formatter!=null)try{return this.formatter.format(r)}catch(e){throw new Error(`Failed to format Go file: ${e}
9
+ ${r}`)}return r}toStringSync(){let r=this.getContent();if(this.formatter!=null)try{return this.formatter.formatSync(r)}catch(e){throw new Error(`Failed to format Go file: ${e}
10
+ ${r}`)}return r}getContent(){let r=`package ${this.packageName}
11
+
12
+ `,e=this.stringifyImports();return e.length>0?`${r}${e}
13
+
14
+ ${this.buffer}`:r+this.buffer}stringifyImports(){let r=Object.entries(this.imports).filter(([e,t])=>e!==this.importPath).map(([e,t])=>` ${t} "${e}"`).join(`
15
+ `);return r?`import (
16
+ ${r}
17
+ )`:""}};var a=class extends x{async toString({packageName:r,rootImportPath:e,importPath:t,customConfig:i,formatter:s}){let p=new S({packageName:r,rootImportPath:e,importPath:t,customConfig:i,formatter:s});return this.write(p),p.toString()}toStringSync({packageName:r,rootImportPath:e,importPath:t,customConfig:i,formatter:s}){let p=new S({packageName:r,rootImportPath:e,importPath:t,customConfig:i,formatter:s});return this.write(p),p.toStringSync()}};var f=class extends a{constructor(e){super();o(this,"arg");this.arg=e}write(e){return new w(this.arg).write(e)}};var u=class extends a{constructor({docs:e}={}){super();o(this,"docs");this.docs=e}write(e){this.docs!=null&&this.docs.split(`
18
+ `).forEach(t=>{e.writeLine(`// ${t}`)})}};var T=class extends a{constructor({name:e,docs:t}){super();o(this,"name");o(this,"docs");o(this,"members",[]);this.name=e,this.docs=t}addMember(e){this.members.push(e)}write(e){e.writeNode(new u({docs:this.docs})),e.write(`type ${this.name} string`)}};var b=class extends a{constructor({name:e,type:t,docs:i}){super();o(this,"name");o(this,"type");o(this,"docs");this.name=e,this.type=t,this.docs=i}write(e){e.writeNode(new u({docs:this.docs})),e.write(`${this.name} `),this.type.write(e)}};var d=class extends a{constructor({name:e,parameters:t,return_:i,body:s,docs:p,typeReference:D}){super();o(this,"name");o(this,"parameters");o(this,"return_");o(this,"body");o(this,"docs");o(this,"typeReference");this.name=e,this.parameters=t,this.return_=i,this.body=s,this.docs=p,this.typeReference=D}write(e){var t;if(e.writeNode(new u({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,s)=>{s>0&&e.write(", "),e.writeNode(i)}),e.write(")")),e.writeLine(" {"),e.indent(),(t=this.body)==null||t.write(e),e.dedent(),e.writeNewLineIfLastLineNot(),e.writeLine("}")}writeReceiver({writer:e,typeReference:t}){e.write(`(${this.getReceiverName(t.name)} `),t.write(e),e.write(") ")}getReceiverName(e){return e.charAt(0).toLowerCase()}};var v=class extends a{constructor({name:e,parameters:t,return_:i,body:s,docs:p}){super();o(this,"func");this.func=new d({name:e,parameters:t,return_:i,body:s,docs:p})}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)}};var c=class extends a{constructor({name:e,importPath:t}){super();o(this,"name");o(this,"importPath");this.name=e,this.importPath=t}write(e){if(e.importPath===this.importPath){e.write(this.name);return}let t=e.addImport(this.importPath);e.write(`${t}.${this.name}`)}};var y=class extends a{constructor({method:e,arguments_:t,on:i}){super();o(this,"on");o(this,"method");o(this,"arguments_");this.on=i,this.method=e,this.arguments_=t}write(e){this.on.write(e),e.write("."),e.write(this.method),F({writer:e,arguments_:this.arguments_})}};var J=new Set(["bool","date","dateTime","float64","int","int64","string","uuid"]),M=new Set(["any","bytes","map","slice"]),m=class n extends a{constructor(e){super();o(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(K({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(Q({value:this.internalType.value}));break;default:g(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:t,entries:i}){return new this({type:"map",keyType:e,valueType:t,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:t}){return new this({type:"slice",valueType:e,values:t})}static string(e){return new this({type:"string",value:e})}static struct({typeReference:e,fields:t}){return new this({type:"struct",typeReference:e,fields:t})}static structPointer({typeReference:e,fields:t}){return new this({type:"optional",value:new this({type:"struct",typeReference:e,fields:t})})}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:t}){switch(typeof t){case"boolean":e.write(t.toString());return;case"string":e.write(t.includes('"')?`\`${t}\``:`"${t}"`);return;case"number":e.write(t.toString());return;case"object":if(t==null){e.write("nil");return}if(Array.isArray(t)){this.writeAnyArray({writer:e,value:t});return}this.writeAnyObject({writer:e,value:t});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof t}`)}}writeAnyArray({writer:e,value:t}){if(e.write("[]interface{}"),t.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let i of t)e.writeNode(n.any(i)),e.writeLine(",");e.dedent(),e.write("}")}writeAnyObject({writer:e,value:t}){e.write("map[string]interface{}");let i=Object.entries(t);if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let[s,p]of i)e.write(`"${s}": `),e.writeNode(n.any(p)),e.writeLine(",");e.dedent(),e.write("}")}writeMap({writer:e,map:t}){e.write("map["),e.writeNode(t.keyType),e.write("]"),e.writeNode(t.valueType);let i=X({entries:t.entries});if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let s of i)s.key.write(e),e.write(": "),s.value.write(e),e.writeLine(",");e.dedent(),e.write("}")}writeOptional({writer:e,type:t}){if(J.has(t.internalType.type)){e.writeNode(z({writer:e,type:t}));return}if(M.has(t.internalType.type)){t.write(e);return}if(t.internalType.type==="enum"){e.writeNode(new y({on:t.internalType.typeReference,method:"Ptr",arguments_:[]}));return}e.write("&"),t.write(e)}static isAlreadyOptional(e){return e.internalType.type==="optional"||M.has(e.internalType.type)}writeSlice({writer:e,slice:t}){e.write("[]"),e.writeNode(t.valueType);let i=te({values:t.values});if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let s of i)s.write(e),e.writeLine(",");e.dedent(),e.write("}")}writeStruct({writer:e,struct:t}){e.writeNode(t.typeReference);let i=ee({fields:t.fields});if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let s of i)e.write(`${s.name}: `),s.value.write(e),e.writeLine(",");e.dedent(),e.write("}")}};function z({writer:n,type:r}){return new h({func:new c({name:Z({type:r}),importPath:n.rootImportPath}),arguments_:[r]})}function Z({type:n}){switch(n.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 K({writer:n,type:r}){let e=r instanceof Date?"MustParseDate":"MustParseDateTime";return new h({func:new c({name:e,importPath:n.rootImportPath}),arguments_:[new f(`"${r.value}"`)]})}function Q({value:n}){return new h({func:new c({name:"MustParse",importPath:"github.com/google/uuid"}),arguments_:[new f(`"${n}"`)]})}function X({entries:n}){return n.filter(r=>!m.isNop(r.key)&&!m.isNop(r.value))}function ee({fields:n}){return n.filter(r=>!m.isNop(r.value))}function te({values:n}){return n.filter(r=>!m.isNop(r))}function F({writer:n,arguments_:r}){let e=ne(r);if(e.length===0){n.write("()");return}n.writeLine("("),n.indent();for(let t of e)re({writer:n,argument:t}),n.writeLine(",");n.dedent(),n.write(")")}function re({writer:n,argument:r}){_(r)?r.assignment.write(n):r.write(n)}function ne(n){return n.filter(r=>!(r instanceof m&&m.isNop(r)))}var h=class extends a{constructor({func:e,arguments_:t}){super();o(this,"func");o(this,"arguments_");this.func=e,this.arguments_=t}write(e){e.writeNode(this.func),F({writer:e,arguments_:this.arguments_})}};var A=class extends a{constructor({name:e,type:t,docs:i}){super();o(this,"name");o(this,"type");o(this,"docs");this.name=e,this.type=t,this.docs=i}write(e){e.writeNode(new u({docs:this.docs})),e.write(`${this.name} `),this.type.write(e)}};var I=class extends a{constructor({name:e,importPath:t,docs:i}){super();o(this,"name");o(this,"importPath");o(this,"docs");o(this,"fields",[]);o(this,"methods",[]);this.name=e,this.importPath=t,this.docs=i}addField(e){this.fields.push(e)}addMethod(e){this.methods.push(e)}write(e){if(e.writeNode(new u({docs:this.docs})),e.write(`type ${this.name} struct {`),this.fields.length>0)e.writeLine("}");else{e.newLine(),e.indent();for(let t of this.fields)e.writeNode(t),e.newLine();e.dedent(),e.writeLine("}")}(this.constructor!=null||this.methods.length>0)&&e.newLine();for(let t of this.methods)e.writeNode(t),e.newLine()}};var ie=new Set(["any","bytes","map","slice"]),L=class n extends a{constructor(e){super();o(this,"internalType");this.internalType=e}write(e,{comment:t}={}){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(oe);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(se);break;default:g(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,t){return new this({type:"map",keyType:e,valueType:t})}static optional(e){return this.isAlreadyOptional(e)?e:new this({type:"optional",value:e})}static pointer(e){return n.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"||ie.has(e.internalType.type)}},oe=new c({importPath:"time",name:"Time"}),se=new c({importPath:"github.com/google/uuid",name:"UUID"});var l={};O(l,{AstNode:()=>a,CodeBlock:()=>f,Enum:()=>T,Field:()=>b,Func:()=>v,FuncInvocation:()=>h,Method:()=>d,MethodInvocation:()=>y,Parameter:()=>A,Struct:()=>I,Type:()=>L,TypeInstantiation:()=>m,TypeReference:()=>c,Writer:()=>N,codeblock:()=>ae,enum_:()=>pe,field:()=>ce,func:()=>le,invokeFunc:()=>ue,invokeMethod:()=>me,method:()=>he,parameter:()=>fe,struct:()=>de,typeReference:()=>ye});function ae(n){return new f(n)}function pe(n){return new T(n)}function ce(n){return new b(n)}function le(n){return new v(n)}function ue(n){return new h(n)}function me(n){return new y(n)}function he(n){return new d(n)}function fe(n){return new A(n)}function de(n){return new I(n)}function ye(n){return new c(n)}var $={Critical:"CRITICAL",Warning:"WARNING"};var B=class{constructor({context:r}){o(this,"context");this.context=r}getFilePropertyInfo({body:r,value:e}){var s;let t={fileFields:[],bodyPropertyFields:[]},i=(s=this.context.getRecord(e))!=null?s:{};for(let p of r.properties)switch(p.type){case"file":t.fileFields.push({name:this.context.getTypeName(p.name),value:this.getSingleFileProperty({property:p,record:i})});break;case"fileArray":t.fileFields.push({name:this.context.getTypeName(p.name),value:this.getArrayFileProperty({property:p,record:i})});break;case"bodyProperty":t.bodyPropertyFields.push({name:this.context.getTypeName(p.name.name),value:this.getBodyProperty({property:p,record:i})});break;default:g(p)}return t}getSingleFileProperty({property:r,record:e}){let t=e[r.wireValue];return t==null?l.TypeInstantiation.nop():typeof t!="string"?(this.context.errors.add({severity:$.Critical,message:`Expected file value to be a string, got ${typeof t}`}),l.TypeInstantiation.nop()):l.TypeInstantiation.reference(this.context.getNewStringsReaderFunctionInvocation(t))}getArrayFileProperty({property:r,record:e}){let t=e[r.wireValue];if(t==null)return l.TypeInstantiation.nop();if(!Array.isArray(t))return this.context.errors.add({severity:$.Critical,message:`Expected file array value to be an array of strings, got ${typeof t}`}),l.TypeInstantiation.nop();let i=[];for(let s of t)typeof s!="string"&&this.context.errors.add({severity:$.Critical,message:`Expected file array value to be an array of strings, got ${typeof s}`}),i.push(s);return l.TypeInstantiation.slice({valueType:l.Type.reference(this.context.getIoReaderTypeReference()),values:i.map(s=>l.TypeInstantiation.reference(this.context.getNewStringsReaderFunctionInvocation(s)))})}getBodyProperty({property:r,record:e}){let t=e[r.name.wireValue];return t==null?l.TypeInstantiation.nop():this.context.dynamicTypeInstantiationMapper.convert({typeReference:r.typeReference,value:t})}};0&&(module.exports={FilePropertyMapper});
@@ -0,0 +1,7 @@
1
+ import '@fern-api/go-ast';
2
+ export { F as FilePropertyInfo, c as FilePropertyMapper } from '../DynamicSnippetsGeneratorContext-DuDerGxa.cjs';
3
+ import '@fern-fern/ir-sdk/api';
4
+ import '@fern-api/browser-compatible-base-generator';
5
+ import '../TypeInstance.cjs';
6
+ import '../DiscriminatedUnionTypeInstance.cjs';
7
+ import './ErrorReporter.cjs';