@fern-api/go-dynamic-snippets 0.0.19 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +32 -0
- package/dist/index.cjs.map +1 -0
- package/{esm/DynamicSnippetsGeneratorContext-X0Mtg6YW.d.ts → dist/index.d.cts} +76 -2
- package/{cjs/DynamicSnippetsGeneratorContext-X0Mtg6YW.d.cts → dist/index.d.ts} +76 -2
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -0
- package/package.json +9 -10
- package/cjs/DynamicSnippetsGenerator.cjs +0 -37
- package/cjs/DynamicSnippetsGenerator.cjs.map +0 -1
- package/cjs/DynamicSnippetsGenerator.d.cts +0 -20
- package/cjs/EndpointSnippetGenerator.cjs +0 -37
- package/cjs/EndpointSnippetGenerator.cjs.map +0 -1
- package/cjs/EndpointSnippetGenerator.d.cts +0 -66
- package/cjs/context/DynamicSnippetsGeneratorContext.cjs +0 -37
- package/cjs/context/DynamicSnippetsGeneratorContext.cjs.map +0 -1
- package/cjs/context/DynamicSnippetsGeneratorContext.d.cts +0 -4
- package/cjs/context/DynamicTypeInstantiationMapper.cjs +0 -37
- package/cjs/context/DynamicTypeInstantiationMapper.cjs.map +0 -1
- package/cjs/context/DynamicTypeInstantiationMapper.d.cts +0 -4
- package/cjs/context/DynamicTypeMapper.cjs +0 -37
- package/cjs/context/DynamicTypeMapper.cjs.map +0 -1
- package/cjs/context/DynamicTypeMapper.d.cts +0 -4
- package/cjs/context/FilePropertyMapper.cjs +0 -37
- package/cjs/context/FilePropertyMapper.cjs.map +0 -1
- package/cjs/context/FilePropertyMapper.d.cts +0 -4
- package/cjs/index.cjs +0 -37
- package/cjs/index.cjs.map +0 -1
- package/cjs/index.d.cts +0 -6
- package/esm/DynamicSnippetsGenerator.d.ts +0 -20
- package/esm/DynamicSnippetsGenerator.js +0 -2
- package/esm/DynamicSnippetsGenerator.js.map +0 -1
- package/esm/EndpointSnippetGenerator.d.ts +0 -66
- package/esm/EndpointSnippetGenerator.js +0 -2
- package/esm/EndpointSnippetGenerator.js.map +0 -1
- package/esm/chunk-5X6DU53C.js +0 -2
- package/esm/chunk-5X6DU53C.js.map +0 -1
- package/esm/chunk-EUHLPBOB.js +0 -2
- package/esm/chunk-EUHLPBOB.js.map +0 -1
- package/esm/chunk-FVPD7ODP.js +0 -2
- package/esm/chunk-FVPD7ODP.js.map +0 -1
- package/esm/chunk-KGXOPYBU.js +0 -2
- package/esm/chunk-KGXOPYBU.js.map +0 -1
- package/esm/chunk-NY6N4HP7.js +0 -2
- package/esm/chunk-NY6N4HP7.js.map +0 -1
- package/esm/chunk-S5R5YTLQ.js +0 -2
- package/esm/chunk-S5R5YTLQ.js.map +0 -1
- package/esm/chunk-T2DJJZPN.js +0 -2
- package/esm/chunk-T2DJJZPN.js.map +0 -1
- package/esm/chunk-VY2BNRW5.js +0 -37
- package/esm/chunk-VY2BNRW5.js.map +0 -1
- package/esm/context/DynamicSnippetsGeneratorContext.d.ts +0 -4
- package/esm/context/DynamicSnippetsGeneratorContext.js +0 -2
- package/esm/context/DynamicSnippetsGeneratorContext.js.map +0 -1
- package/esm/context/DynamicTypeInstantiationMapper.d.ts +0 -4
- package/esm/context/DynamicTypeInstantiationMapper.js +0 -2
- package/esm/context/DynamicTypeInstantiationMapper.js.map +0 -1
- package/esm/context/DynamicTypeMapper.d.ts +0 -4
- package/esm/context/DynamicTypeMapper.js +0 -2
- package/esm/context/DynamicTypeMapper.js.map +0 -1
- package/esm/context/FilePropertyMapper.d.ts +0 -4
- package/esm/context/FilePropertyMapper.js +0 -2
- package/esm/context/FilePropertyMapper.js.map +0 -1
- package/esm/index.d.ts +0 -6
- package/esm/index.js +0 -2
- package/esm/index.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../node_modules/.pnpm/@esbuild-plugins+node-globals-polyfill@0.2.3_esbuild@0.27.0/node_modules/@esbuild-plugins/node-globals-polyfill/process.js","../../../../../node_modules/.pnpm/@esbuild-plugins+node-globals-polyfill@0.2.3_esbuild@0.27.0/node_modules/@esbuild-plugins/node-globals-polyfill/Buffer.js","../../../../../node_modules/.pnpm/@esbuild-plugins+node-globals-polyfill@0.2.3_esbuild@0.27.0/node_modules/@esbuild-plugins/node-globals-polyfill/_buffer.js","node-modules-polyfills:path","../../src/DynamicSnippetsGenerator.ts","../../../../../packages/commons/core-utils/src/index.ts","../../../../../packages/commons/core-utils/src/assert.ts","../../../../../packages/commons/core-utils/src/objects/keys.ts","../../../../browser-compatible-base/src/ast/index.ts","../../../../browser-compatible-base/src/ast/AbstractAstNode.ts","../../../../browser-compatible-base/src/utils/stacktrace.ts","../../../../browser-compatible-base/src/ast/AbstractFormatter.ts","../../../../browser-compatible-base/src/ast/AbstractWriter.ts","../../../../browser-compatible-base/src/utils/index.ts","../../../../browser-compatible-base/src/ast/CodeBlock.ts","../../../../browser-compatible-base/src/dynamic-snippets/index.ts","../../../../browser-compatible-base/src/dynamic-snippets/AbstractDynamicSnippetsGenerator.ts","../../../../browser-compatible-base/src/dynamic-snippets/Result.ts","../../../../browser-compatible-base/src/dynamic-snippets/AbstractDynamicSnippetsGeneratorContext.ts","../../../../../packages/cli/fern-definition/schema/src/index.ts","../../../../../packages/cli/fern-definition/schema/src/utils/HttpEndpointReferenceParser.ts","../../../../browser-compatible-base/src/dynamic-snippets/ErrorReporter.ts","../../../../browser-compatible-base/src/dynamic-snippets/Scope.ts","../../../../../packages/commons/path-utils/src/index.ts","../../../../../packages/commons/path-utils/src/basename.ts","../../src/context/DynamicSnippetsGeneratorContext.ts","../../../ast/src/index.ts","../../../ast/src/ast/core/GoFile.ts","../../../ast/src/ast/core/Writer.ts","../../../ast/src/go.ts","../../../ast/src/ast/index.ts","../../../ast/src/ast/Alias.ts","../../../ast/src/ast/Comment.ts","../../../ast/src/ast/core/AstNode.ts","../../../ast/src/ast/CodeBlock.ts","../../../ast/src/ast/Enum.ts","../../../ast/src/ast/Identifier.ts","../../../ast/src/ast/TypeInstantiation.ts","../../../ast/src/ast/FuncInvocation.ts","../../../ast/src/ast/utils/writeArguments.ts","../../../ast/src/ast/GoTypeReference.ts","../../../ast/src/ast/utils/writeGenerics.ts","../../../ast/src/ast/MethodInvocation.ts","../../../ast/src/ast/Field.ts","../../../ast/src/ast/File.ts","../../../ast/src/ast/Func.ts","../../../ast/src/ast/Method.ts","../../../ast/src/ast/MultiNode.ts","../../../ast/src/ast/Parameter.ts","../../../ast/src/ast/Pointer.ts","../../../ast/src/ast/Selector.ts","../../../ast/src/ast/Struct.ts","../../../ast/src/ast/Switch.ts","../../../ast/src/ast/Type.ts","../../../ast/src/ast/TypeDeclaration.ts","../../../ast/src/utils/goExportedFieldName.ts","../../../ast/src/utils/resolveRootImportPath.ts","../../src/context/DynamicTypeInstantiationMapper.ts","../../src/context/DynamicTypeMapper.ts","../../src/context/FilePropertyMapper.ts","../../src/EndpointSnippetGenerator.ts"],"sourcesContent":["// shim for using process in browser\n// based off https://github.com/defunctzombie/node-process/blob/master/browser.js\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined')\n}\nfunction defaultClearTimeout() {\n throw new Error('clearTimeout has not been defined')\n}\nvar cachedSetTimeout = defaultSetTimout\nvar cachedClearTimeout = defaultClearTimeout\nif (typeof global.setTimeout === 'function') {\n cachedSetTimeout = setTimeout\n}\nif (typeof global.clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout\n}\n\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0)\n }\n // if setTimeout wasn't available but was latter defined\n if (\n (cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) &&\n setTimeout\n ) {\n cachedSetTimeout = setTimeout\n return setTimeout(fun, 0)\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0)\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0)\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0)\n }\n }\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker)\n }\n // if clearTimeout wasn't available but was latter defined\n if (\n (cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) &&\n clearTimeout\n ) {\n cachedClearTimeout = clearTimeout\n return clearTimeout(marker)\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker)\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker)\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker)\n }\n }\n}\nvar queue = []\nvar draining = false\nvar currentQueue\nvar queueIndex = -1\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return\n }\n draining = false\n if (currentQueue.length) {\n queue = currentQueue.concat(queue)\n } else {\n queueIndex = -1\n }\n if (queue.length) {\n drainQueue()\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return\n }\n var timeout = runTimeout(cleanUpNextTick)\n draining = true\n\n var len = queue.length\n while (len) {\n currentQueue = queue\n queue = []\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run()\n }\n }\n queueIndex = -1\n len = queue.length\n }\n currentQueue = null\n draining = false\n runClearTimeout(timeout)\n}\nfunction nextTick(fun) {\n var args = new Array(arguments.length - 1)\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i]\n }\n }\n queue.push(new Item(fun, args))\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue)\n }\n}\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun\n this.array = array\n}\nItem.prototype.run = function() {\n this.fun.apply(null, this.array)\n}\nvar title = 'browser'\nvar platform = 'browser'\nvar browser = true\nvar env = {}\nvar argv = []\nvar version = '' // empty string to avoid regexp issues\nvar versions = {}\nvar release = {}\nvar config = {}\n\nfunction noop() {}\n\nvar on = noop\nvar addListener = noop\nvar once = noop\nvar off = noop\nvar removeListener = noop\nvar removeAllListeners = noop\nvar emit = noop\n\nfunction binding(name) {\n throw new Error('process.binding is not supported')\n}\n\nfunction cwd() {\n return '/'\n}\nfunction chdir(dir) {\n throw new Error('process.chdir is not supported')\n}\nfunction umask() {\n return 0\n}\n\n// from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js\nvar performance = global.performance || {}\nvar performanceNow =\n performance.now ||\n performance.mozNow ||\n performance.msNow ||\n performance.oNow ||\n performance.webkitNow ||\n function() {\n return new Date().getTime()\n }\n\n// generate timestamp or delta\n// see http://nodejs.org/api/process.html#process_process_hrtime\nfunction hrtime(previousTimestamp) {\n var clocktime = performanceNow.call(performance) * 1e-3\n var seconds = Math.floor(clocktime)\n var nanoseconds = Math.floor((clocktime % 1) * 1e9)\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0]\n nanoseconds = nanoseconds - previousTimestamp[1]\n if (nanoseconds < 0) {\n seconds--\n nanoseconds += 1e9\n }\n }\n return [seconds, nanoseconds]\n}\n\nvar startTime = new Date()\nfunction uptime() {\n var currentTime = new Date()\n var dif = currentTime - startTime\n return dif / 1000\n}\n\nexport var process = {\n nextTick: nextTick,\n title: title,\n browser: browser,\n env: env,\n argv: argv,\n version: version,\n versions: versions,\n on: on,\n addListener: addListener,\n once: once,\n off: off,\n removeListener: removeListener,\n removeAllListeners: removeAllListeners,\n emit: emit,\n binding: binding,\n cwd: cwd,\n chdir: chdir,\n umask: umask,\n hrtime: hrtime,\n platform: platform,\n release: release,\n config: config,\n uptime: uptime,\n}\n\n// replace process.env.VAR with define\n\nconst defines = {}\nObject.keys(defines).forEach((key) => {\n const segs = key.split('.')\n let target = process\n for (let i = 0; i < segs.length; i++) {\n const seg = segs[i]\n if (i === segs.length - 1) {\n target[seg] = defines[key]\n } else {\n target = target[seg] || (target[seg] = {})\n }\n }\n})\n","// taken from https://github.com/calvinmetcalf/buffer-es6\n\n/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>\n * @license MIT\n */\n/* eslint-disable no-proto */\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\nvar inited = false\nfunction init() {\n inited = true\n var code =\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\n for (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n }\n\n revLookup['-'.charCodeAt(0)] = 62\n revLookup['_'.charCodeAt(0)] = 63\n}\n\nfunction base64toByteArray(b64) {\n if (!inited) {\n init()\n }\n var i, j, l, tmp, placeHolders, arr\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // the number of equal signs (place holders)\n // if there are two placeholders, than the two characters before it\n // represent one byte\n // if there is only one, then the three characters before it represent 2 bytes\n // this is just a cheap hack to not do indexOf twice\n placeHolders = b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0\n\n // base64 is 4/3 + up to two characters of the original data\n arr = new Arr((len * 3) / 4 - placeHolders)\n\n // if there are placeholders, only get up to the last complete 4 chars\n l = placeHolders > 0 ? len - 4 : len\n\n var L = 0\n\n for (i = 0, j = 0; i < l; i += 4, j += 3) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[L++] = (tmp >> 16) & 0xff\n arr[L++] = (tmp >> 8) & 0xff\n arr[L++] = tmp & 0xff\n }\n\n if (placeHolders === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[L++] = tmp & 0xff\n } else if (placeHolders === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[L++] = (tmp >> 8) & 0xff\n arr[L++] = tmp & 0xff\n }\n\n return arr\n}\n\nfunction tripletToBase64(num) {\n return (\n lookup[(num >> 18) & 0x3f] +\n lookup[(num >> 12) & 0x3f] +\n lookup[(num >> 6) & 0x3f] +\n lookup[num & 0x3f]\n )\n}\n\nfunction encodeChunk(uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + uint8[i + 2]\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction base64fromByteArray(uint8) {\n if (!inited) {\n init()\n }\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var output = ''\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(\n encodeChunk(\n uint8,\n i,\n i + maxChunkLength > len2 ? len2 : i + maxChunkLength,\n ),\n )\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n output += lookup[tmp >> 2]\n output += lookup[(tmp << 4) & 0x3f]\n output += '=='\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n output += lookup[tmp >> 10]\n output += lookup[(tmp >> 4) & 0x3f]\n output += lookup[(tmp << 2) & 0x3f]\n output += '='\n }\n\n parts.push(output)\n\n return parts.join('')\n}\n\nvar INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT =\n global.TYPED_ARRAY_SUPPORT !== undefined ? global.TYPED_ARRAY_SUPPORT : true\n\nfunction kMaxLength() {\n return Buffer.TYPED_ARRAY_SUPPORT ? 0x7fffffff : 0x3fffffff\n}\n\nfunction createBuffer(that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nexport function Buffer(arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string',\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function(arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from(that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function(value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nBuffer.kMaxLength = kMaxLength()\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (\n typeof Symbol !== 'undefined' &&\n Symbol.species &&\n Buffer[Symbol.species] === Buffer\n ) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n // Object.defineProperty(Buffer, Symbol.species, {\n // value: null,\n // configurable: true\n // })\n }\n}\n\nfunction assertSize(size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc(that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function(size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe(that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function(size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function(size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString(that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike(that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer(that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError(\"'offset' is out of bounds\")\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError(\"'length' is out of bounds\")\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject(that, obj) {\n if (internalIsBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if (\n (typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) ||\n 'length' in obj\n ) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError(\n 'First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.',\n )\n}\n\nfunction checked(length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError(\n 'Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' +\n kMaxLength().toString(16) +\n ' bytes',\n )\n }\n return length | 0\n}\n\nexport function SlowBuffer(length) {\n if (+length != length) {\n // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\nBuffer.isBuffer = isBuffer\nfunction internalIsBuffer(b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare(a, b) {\n if (!internalIsBuffer(a) || !internalIsBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding(encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat(list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!internalIsBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength(string, encoding) {\n if (internalIsBuffer(string)) {\n return string.length\n }\n if (\n typeof ArrayBuffer !== 'undefined' &&\n typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)\n ) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString(encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase)\n throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap(b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16() {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32() {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64() {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString() {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals(b) {\n if (!internalIsBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\n\nBuffer.prototype.compare = function compare(\n target,\n start,\n end,\n thisStart,\n thisEnd,\n) {\n if (!internalIsBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (\n start < 0 ||\n end > target.length ||\n thisStart < 0 ||\n thisEnd > this.length\n ) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : buffer.length - 1\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (internalIsBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xff // Search for a byte value [0-255]\n if (\n Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function'\n ) {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(\n buffer,\n val,\n byteOffset,\n )\n } else {\n return Uint8Array.prototype.lastIndexOf.call(\n buffer,\n val,\n byteOffset,\n )\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf(arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (\n encoding === 'ucs2' ||\n encoding === 'ucs-2' ||\n encoding === 'utf16le' ||\n encoding === 'utf-16le'\n ) {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read(buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (\n read(arr, i) ===\n read(val, foundIndex === -1 ? 0 : i - foundIndex)\n ) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength)\n return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength)\n byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes(val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite(buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write(buf, string, offset, length) {\n return blitBuffer(\n utf8ToBytes(string, buf.length - offset),\n buf,\n offset,\n length,\n )\n}\n\nfunction asciiWrite(buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write(buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write(buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write(buf, string, offset, length) {\n return blitBuffer(\n utf16leToBytes(string, buf.length - offset),\n buf,\n offset,\n length,\n )\n}\n\nBuffer.prototype.write = function write(string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported',\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if (\n (string.length > 0 && (length < 0 || offset < 0)) ||\n offset > this.length\n ) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase)\n throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON() {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0),\n }\n}\n\nfunction base64Slice(buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64fromByteArray(buf)\n } else {\n return base64fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice(buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence =\n firstByte > 0xef\n ? 4\n : firstByte > 0xdf\n ? 3\n : firstByte > 0xbf\n ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xc0) === 0x80) {\n tempCodePoint =\n ((firstByte & 0x1f) << 0x6) | (secondByte & 0x3f)\n if (tempCodePoint > 0x7f) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if (\n (secondByte & 0xc0) === 0x80 &&\n (thirdByte & 0xc0) === 0x80\n ) {\n tempCodePoint =\n ((firstByte & 0xf) << 0xc) |\n ((secondByte & 0x3f) << 0x6) |\n (thirdByte & 0x3f)\n if (\n tempCodePoint > 0x7ff &&\n (tempCodePoint < 0xd800 || tempCodePoint > 0xdfff)\n ) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if (\n (secondByte & 0xc0) === 0x80 &&\n (thirdByte & 0xc0) === 0x80 &&\n (fourthByte & 0xc0) === 0x80\n ) {\n tempCodePoint =\n ((firstByte & 0xf) << 0x12) |\n ((secondByte & 0x3f) << 0xc) |\n ((thirdByte & 0x3f) << 0x6) |\n (fourthByte & 0x3f)\n if (\n tempCodePoint > 0xffff &&\n tempCodePoint < 0x110000\n ) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xfffd\n bytesPerSequence = 1\n } else if (codePoint > 0xffff) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(((codePoint >>> 10) & 0x3ff) | 0xd800)\n codePoint = 0xdc00 | (codePoint & 0x3ff)\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray(codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, (i += MAX_ARGUMENTS_LENGTH)),\n )\n }\n return res\n}\n\nfunction asciiSlice(buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7f)\n }\n return ret\n}\n\nfunction latin1Slice(buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice(buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice(buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice(start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset(offset, ext, length) {\n if (offset % 1 !== 0 || offset < 0)\n throw new RangeError('offset is not uint')\n if (offset + ext > length)\n throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE(\n offset,\n byteLength,\n noAssert,\n) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE(\n offset,\n byteLength,\n noAssert,\n) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (\n (this[offset] | (this[offset + 1] << 8) | (this[offset + 2] << 16)) +\n this[offset + 3] * 0x1000000\n )\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (\n this[offset] * 0x1000000 +\n ((this[offset + 1] << 16) | (this[offset + 2] << 8) | this[offset + 3])\n )\n}\n\nBuffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return this[offset]\n return (0xff - this[offset] + 1) * -1\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return val & 0x8000 ? val | 0xffff0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return val & 0x8000 ? val | 0xffff0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (\n this[offset] |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n )\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (\n (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3]\n )\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754read(this, offset, false, 52, 8)\n}\n\nfunction checkInt(buf, value, offset, ext, max, min) {\n if (!internalIsBuffer(buf))\n throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min)\n throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE(\n value,\n offset,\n byteLength,\n noAssert,\n) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xff\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xff\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE(\n value,\n offset,\n byteLength,\n noAssert,\n) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xff\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xff\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = value & 0xff\n return offset + 1\n}\n\nfunction objectWriteUInt16(buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] =\n (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n ((littleEndian ? i : 1 - i) * 8)\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE(\n value,\n offset,\n noAssert,\n) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value & 0xff\n this[offset + 1] = value >>> 8\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE(\n value,\n offset,\n noAssert,\n) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value >>> 8\n this[offset + 1] = value & 0xff\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32(buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> ((littleEndian ? i : 3 - i) * 8)) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE(\n value,\n offset,\n noAssert,\n) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = value >>> 24\n this[offset + 2] = value >>> 16\n this[offset + 1] = value >>> 8\n this[offset] = value & 0xff\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE(\n value,\n offset,\n noAssert,\n) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value >>> 24\n this[offset + 1] = value >>> 16\n this[offset + 2] = value >>> 8\n this[offset + 3] = value & 0xff\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE(\n value,\n offset,\n byteLength,\n noAssert,\n) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xff\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = (((value / mul) >> 0) - sub) & 0xff\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE(\n value,\n offset,\n byteLength,\n noAssert,\n) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xff\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = (((value / mul) >> 0) - sub) & 0xff\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = value & 0xff\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value & 0xff\n this[offset + 1] = value >>> 8\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value >>> 8\n this[offset + 1] = value & 0xff\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value & 0xff\n this[offset + 1] = value >>> 8\n this[offset + 2] = value >>> 16\n this[offset + 3] = value >>> 24\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value >>> 24\n this[offset + 1] = value >>> 16\n this[offset + 2] = value >>> 8\n this[offset + 3] = value & 0xff\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754(buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat(buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(\n buf,\n value,\n offset,\n 4,\n 3.4028234663852886e38,\n -3.4028234663852886e38,\n )\n }\n ieee754write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble(buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(\n buf,\n value,\n offset,\n 8,\n 1.7976931348623157e308,\n -1.7976931348623157e308,\n )\n }\n ieee754write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE(\n value,\n offset,\n noAssert,\n) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE(\n value,\n offset,\n noAssert,\n) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy(target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length)\n throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart,\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill(val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = internalIsBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean(str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim(str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex(n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes(string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xd7ff && codePoint < 0xe000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xdbff) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xef, 0xbf, 0xbd)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xef, 0xbf, 0xbd)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xdc00) {\n if ((units -= 3) > -1) bytes.push(0xef, 0xbf, 0xbd)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint =\n (((leadSurrogate - 0xd800) << 10) | (codePoint - 0xdc00)) +\n 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xef, 0xbf, 0xbd)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push((codePoint >> 0x6) | 0xc0, (codePoint & 0x3f) | 0x80)\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n (codePoint >> 0xc) | 0xe0,\n ((codePoint >> 0x6) & 0x3f) | 0x80,\n (codePoint & 0x3f) | 0x80,\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n (codePoint >> 0x12) | 0xf0,\n ((codePoint >> 0xc) & 0x3f) | 0x80,\n ((codePoint >> 0x6) & 0x3f) | 0x80,\n (codePoint & 0x3f) | 0x80,\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes(str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xff)\n }\n return byteArray\n}\n\nfunction utf16leToBytes(str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes(str) {\n return base64toByteArray(base64clean(str))\n}\n\nfunction blitBuffer(src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if (i + offset >= dst.length || i >= src.length) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan(val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n\n// the following is from is-buffer, also by Feross Aboukhadijeh and with same lisence\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nfunction isBuffer(obj) {\n return (\n obj != null &&\n (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n )\n}\n\nfunction isFastBuffer(obj) {\n return (\n !!obj.constructor &&\n typeof obj.constructor.isBuffer === 'function' &&\n obj.constructor.isBuffer(obj)\n )\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer(obj) {\n return (\n typeof obj.readFloatLE === 'function' &&\n typeof obj.slice === 'function' &&\n isFastBuffer(obj.slice(0, 0))\n )\n}\n\nfunction ieee754read(buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? nBytes - 1 : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << -nBits) - 1)\n s >>= -nBits\n nBits += eLen\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << -nBits) - 1)\n e >>= -nBits\n nBits += mLen\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : (s ? -1 : 1) * Infinity\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nfunction ieee754write(buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0\n var i = isLE ? 0 : nBytes - 1\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (\n ;\n mLen >= 8;\n buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8\n ) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (\n ;\n eLen > 0;\n buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8\n ) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","export { Buffer } from '_node-buffer-polyfill_.js'\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// Split a filename into [root, dir, basename, ext], unix version\n// 'root' is just a slash, or nothing.\nvar splitPathRe =\n /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\nvar splitPath = function(filename) {\n return splitPathRe.exec(filename).slice(1);\n};\n\n// path.resolve([from ...], to)\n// posix version\nexport function resolve() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : '/';\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexport function normalize(path) {\n var isPathAbsolute = isAbsolute(path),\n trailingSlash = substr(path, -1) === '/';\n\n // Normalize the path\n path = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isPathAbsolute).join('/');\n\n if (!path && !isPathAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n\n return (isPathAbsolute ? '/' : '') + path;\n};\n\n// posix version\nexport function isAbsolute(path) {\n return path.charAt(0) === '/';\n}\n\n// posix version\nexport function join() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return normalize(filter(paths, function(p, index) {\n if (typeof p !== 'string') {\n throw new TypeError('Arguments to path.join must be strings');\n }\n return p;\n }).join('/'));\n}\n\n\n// path.relative(from, to)\n// posix version\nexport function relative(from, to) {\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n}\n\nexport var sep = '/';\nexport var delimiter = ':';\n\nexport function dirname(path) {\n var result = splitPath(path),\n root = result[0],\n dir = result[1];\n\n if (!root && !dir) {\n // No dirname whatsoever\n return '.';\n }\n\n if (dir) {\n // It has a dirname, strip trailing slash\n dir = dir.substr(0, dir.length - 1);\n }\n\n return root + dir;\n}\n\nexport function basename(path, ext) {\n var f = splitPath(path)[2];\n // TODO: make this comparison case-insensitive on windows?\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n}\n\n\nexport function extname(path) {\n return splitPath(path)[3];\n}\nexport default {\n extname: extname,\n basename: basename,\n dirname: dirname,\n sep: sep,\n delimiter: delimiter,\n relative: relative,\n join: join,\n isAbsolute: isAbsolute,\n normalize: normalize,\n resolve: resolve\n};\nfunction filter (xs, f) {\n if (xs.filter) return xs.filter(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (f(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// String.prototype.substr - negative index don't work in IE8\nvar substr = 'ab'.substr(-1) === 'b' ?\n function (str, start, len) { return str.substr(start, len) } :\n function (str, start, len) {\n if (start < 0) start = str.length + start;\n return str.substr(start, len);\n }\n;\n","import {\n AbstractAstNode,\n AbstractDynamicSnippetsGenerator,\n AbstractFormatter,\n FernGeneratorExec,\n Options\n} from \"@fern-api/browser-compatible-base-generator\";\nimport { FernIr } from \"@fern-api/dynamic-ir-sdk\";\nimport { DynamicSnippetsGeneratorContext } from \"./context/DynamicSnippetsGeneratorContext\";\nimport { EndpointSnippetGenerator } from \"./EndpointSnippetGenerator\";\n\nexport class DynamicSnippetsGenerator extends AbstractDynamicSnippetsGenerator<\n DynamicSnippetsGeneratorContext,\n EndpointSnippetGenerator\n> {\n private formatter: AbstractFormatter | undefined;\n\n constructor({\n ir,\n config,\n formatter\n }: {\n ir: FernIr.dynamic.DynamicIntermediateRepresentation;\n config: FernGeneratorExec.GeneratorConfig;\n formatter?: AbstractFormatter;\n }) {\n super(new DynamicSnippetsGeneratorContext({ ir, config }));\n this.formatter = formatter;\n }\n\n public async generate(\n request: FernIr.dynamic.EndpointSnippetRequest,\n options?: Options\n ): Promise<FernIr.dynamic.EndpointSnippetResponse> {\n return super.generate(request, options);\n }\n\n public generateSync(\n request: FernIr.dynamic.EndpointSnippetRequest,\n options?: Options\n ): FernIr.dynamic.EndpointSnippetResponse {\n return super.generateSync(request, options);\n }\n\n public async generateSnippetAst(request: FernIr.dynamic.EndpointSnippetRequest): Promise<AbstractAstNode> {\n return super.generateSnippetAst(request);\n }\n\n protected createSnippetGenerator(context: DynamicSnippetsGeneratorContext): EndpointSnippetGenerator {\n return new EndpointSnippetGenerator({ context, formatter: this.formatter });\n }\n}\n","export { addPrefixToString } from \"./addPrefixToString\";\nexport {\n assert,\n assertDefined,\n assertNever,\n assertNeverNoThrow,\n assertNonNull,\n assertString,\n assertVoidNoThrow\n} from \"./assert\";\nexport { delay } from \"./delay/delay\";\nexport { withMinimumTime } from \"./delay/withMinimumTime\";\nexport { EMPTY_ARRAY, EMPTY_OBJECT } from \"./empty\";\nexport * as Examples from \"./examples\";\nexport { extractErrorMessage } from \"./extractErrorMessage\";\nexport { getDuplicates } from \"./getDuplicates\";\nexport { identity } from \"./identity\";\nexport { isNonNullish } from \"./isNonNullish\";\nexport { MediaType } from \"./mediaType\";\nexport { mergeWithOverrides } from \"./mergeWithOverrides\";\nexport { noop } from \"./noop\";\nexport {\n haveSameNullishness,\n nullIfNullish,\n nullIfSomeNullish,\n undefinedIfNullish,\n undefinedIfSomeNullish\n} from \"./nullishUtils\";\nexport { type ObjectPropertiesVisitor, visitObject, visitObjectAsync } from \"./ObjectPropertiesVisitor\";\nexport { type Entries, entries } from \"./objects/entries\";\nexport { isPlainObject } from \"./objects/isPlainObject\";\nexport { keys } from \"./objects/keys\";\nexport { mapValues } from \"./objects/mapValues\";\nexport { type Values, values } from \"./objects/values\";\nexport { parseEndpointLocator } from \"./parseEndpointLocator\";\nexport { PLATFORM, type Platform } from \"./platform\";\nexport { removeSuffix } from \"./removeSuffix\";\nexport { replaceEnvVariables } from \"./replaceEnvVars\";\nexport { SymbolRegistry, type SymbolRegistryOptions } from \"./SymbolRegistry\";\nexport { diffSemverOrThrow, parseSemverOrThrow } from \"./semverUtils\";\nexport { type SetRequired } from \"./setRequired\";\nexport { stripLeadingSlash } from \"./stripLeadingSlash\";\nexport { titleCase } from \"./titleCase\";\nexport type { ContainerRunner, Digit, Letter, LowercaseLetter, UppercaseLetter } from \"./types\";\nexport { validateAgainstJsonSchema } from \"./validateAgainstJsonSchema\";\nexport { visitDiscriminatedUnion } from \"./visitDiscriminatedUnion\";\nexport type { WithoutQuestionMarks } from \"./withoutQuestionMarks\";\n","/**\n * Asserts that a condition is truthy, throwing an exception with the specified message if it is falsy.\n */\nexport function assert(condition: unknown, message?: string): asserts condition {\n if (!condition) {\n throw new Error(message ?? \"Expected condition to be truthy but got falsy.\");\n }\n}\n\nexport function assertDefined<T>(val: T, message?: string): asserts val is Exclude<T, undefined> {\n if (val === undefined) {\n throw new Error(message ?? \"Expected value to be defined but got undefined.\");\n }\n}\n\nexport function assertNonNull<T>(val: T, message?: string): asserts val is Exclude<T, null> {\n if (val === null) {\n throw new Error(message ?? \"Expected value to be non-null but got null.\");\n }\n}\n\nexport function assertString(val: unknown, message?: string): asserts val is string {\n if (typeof val !== \"string\") {\n throw new Error(message ?? `Expected value to be a string but got ${typeof val}.`);\n }\n}\n\nexport function assertNever(x: never): never {\n throw new Error(\"Unexpected value: \" + JSON.stringify(x));\n}\n\n// biome-ignore lint/suspicious/noEmptyBlockStatements: allow\nexport function assertNeverNoThrow(_: never): void {}\n\n// biome-ignore lint/suspicious/noEmptyBlockStatements: allow\nexport function assertVoidNoThrow(_x: void): void {}\n","export function keys<T extends object>(object: T): (keyof T)[] {\n return Object.keys(object) as (keyof T)[];\n}\n","export { AbstractAstNode } from \"./AbstractAstNode\";\nexport { AbstractFormatter, NopFormatter } from \"./AbstractFormatter\";\nexport { AbstractWriter } from \"./AbstractWriter\";\nexport {\n type Argument,\n type Arguments,\n hasNamedArgument,\n isNamedArgument,\n type NamedArgument,\n type UnnamedArgument\n} from \"./Argument\";\nexport { CodeBlock } from \"./CodeBlock\";\nexport { Ternary } from \"./Ternary\";\n","import { tag } from \"../utils/stacktrace\";\nimport { AbstractWriter } from \"./AbstractWriter\";\n\nexport abstract class AbstractAstNode {\n /**\n * Every AST node knows how to write itself to a string.\n */\n public abstract write(writer: AbstractWriter): void;\n\n public constructor() {\n // when FERN_STACK_TRACK is defined this will track the stack trace of the current AstNode.\n // otherwise this has absolutely no effect whatsoever.\n tag(this);\n }\n}\n","/**\n * Global flag that enables or disables stack tracing functionality throughout the application.\n * This is controlled via the FERN_STACK_TRACK environment variable.\n *\n * When enabled (truthy environment variable value), stack traces will be captured and processed\n * by the stacktrace functions in this module. When disabled, the stacktrace() function returns\n * an empty array for performance optimization.\n *\n * @example\n * // Enable tracing by setting the environment variable\n * // FERN_STACK_TRACK=1 <cmdline>\n */\nconst key = process.env[\"FERN_STACK_TRACK\"]?.toLowerCase() ?? \"\";\n\nexport const enableStackTracking = key !== \"\" && key !== \"0\" && key !== \"false\";\n\n/** The style of comments desired for the stack tracking comments\n *\n * can be \"single\", \"multiline\", or \"box\".\n * if not set to one of those, defaults to \"single\".\n */\nexport const trackingType = [\"single\", \"multiline\", \"box\"].includes(key) ? key : \"single\";\n\nif (enableStackTracking) {\n // we're going to put a hard max limit on the stack trace to prevent infinite recursion and excessive stack generation\n Error.stackTraceLimit = 50;\n}\n\n/**\n * Configuration options for controlling stack trace capture and filtering behavior.\n */\ninterface StackTraceOptions {\n /**\n * Maximum number of stack frames to return after filtering.\n *\n * Maximum may never exceed 50.\n * @default 50\n */\n maxFrames?: number;\n\n /**\n * Number of frames to skip from the beginning of the filtered stack trace.\n * Useful for omitting wrapper functions from the output.\n * @default 0\n */\n skip?: number;\n\n /**\n * Array of function name substrings that trigger an early stop when encountered.\n * When a frame's function name includes any of these strings, that frame and all\n * subsequent frames will be excluded from the output.\n *\n * implicitly includes \"runInteractiveTask\"\n * @default []\n */\n stopOn?: string[];\n\n /**\n * Array of file path substrings to filter out. Any frame whose path contains\n * any of these strings will be excluded from the output.\n * @default []\n */\n filterPaths?: string[];\n\n /**\n * Array of function name substrings to filter out. Any frame whose function name\n * contains any of these strings will be excluded from the output.\n *\n * implicitly includes \"SdkGeneratorCLI\", \"runCli\",\"Frames.trace\",\"Frames.tag\", \"at\", \"stacktrace\"\n * @default []\n */\n filterFunctions?: string[];\n\n /**\n * Whether to filter out Node.js internal frames (paths starting with \"node:\").\n * @default true\n */\n filterNode?: boolean;\n\n /**\n * Whether to filter out .js files, which typically indicate non-source files\n * without source map information.\n * @default true\n */\n filterJs?: boolean;\n\n /**\n * A function to format the file path of the stack trace frame.\n * @default (filename) => filename\n */\n formatFilename?: (filename: string) => string;\n}\n\n/**\n * Represents a single parsed stack trace frame containing function, file path, and position information.\n */\nexport interface StackTraceFrame {\n /**\n * The function name or context. May include special formatting like \"alias()=> { ... }\"\n * for certain Object methods, or be an empty string for anonymous contexts.\n */\n fn: string;\n\n /**\n * The file path where this frame originated. This will typically be the full path\n * to the source file.\n */\n path: string;\n\n /**\n * The line and column position in the format \"line:column\" (e.g., \"42:13\").\n */\n position: string;\n}\n\nconst globalFunctionFilters = new Set<string>([\"SdkGeneratorCLI\", \"runCli\", \"LoggerImpl\", \"Array.forEach\"]);\nconst globalFileFilters = new Set<string>([\"stacktrace\"]);\n\n/**\n * Adds a function name to the global function filters for stack traces\n * @param filter - The function name to add to the global function filters.\n */\nexport function addGlobalFunctionFilter(filter: string): void {\n if (enableStackTracking) {\n globalFunctionFilters.add(filter);\n }\n}\n\n/**\n * Adds a file path to the global file filters for stack traces.\n * @param filter - The file path to add to the global file filters.\n */\nexport function addGlobalFileFilter(filter: string): void {\n if (enableStackTracking) {\n globalFileFilters.add(filter);\n }\n}\n\n/**\n * Captures and parses the current call stack, returning an array of stack frames with filtering options.\n *\n * This function creates a new Error object to capture the stack trace, then parses each frame\n * to extract function names, file paths, and positions. It applies multiple filtering strategies\n * to exclude unwanted frames (e.g., Node.js internals, .js files, specific functions).\n *\n * The function only operates when `enableStackTracking` is true. If tracing is disabled, it returns\n * an empty array for performance optimization.\n *\n * @param options - Configuration options for stack trace capture and filtering\n * @returns Array of parsed stack trace frames, filtered and limited according to the options\n *\n * @example\n * // Capture the first 10 frames, skipping the first 2\n * const frames = stacktrace({ maxFrames: 10, skip: 2 });\n *\n * @example\n * // Capture frames until hitting \"main\" function, filter out test files\n * const frames = stacktrace({\n * stopOn: [\"main\"],\n * filterPaths: [\"/test/\"],\n * filterFunctions: [\"runTests\"]\n * });\n *\n * @remarks\n * The function applies filters in the following order:\n * 1. Parses each stack frame using regex to extract function, path, line, and column\n * 2. Applies early-stop logic when encountering functions in the `stopOn` array\n * 3. Formats special function names (e.g., \"Object.alias\" → \"alias()=> { ... }\")\n * 4. Filters out:\n * - The stacktrace function itself (\"at\", \"stacktrace\")\n * - Functions matching `filterFunctions` (substring match)\n * - Node.js internal frames (if `filterNode` is true)\n * - .js files (if `filterJs` is true)\n * - Paths matching `filterPaths` (substring match)\n * 5. Applies `skip` and `maxFrames` to limit the output\n */\nexport function stacktrace({\n maxFrames = 50,\n skip = 0,\n filterPaths = [],\n filterFunctions = [],\n stopOn = [],\n filterNode = true,\n filterJs = true,\n formatFilename = (filename) => filename\n}: StackTraceOptions = {}): StackTraceFrame[] {\n if (!enableStackTracking) {\n return [];\n }\n filterFunctions = [...filterFunctions, ...globalFunctionFilters];\n filterPaths = [...filterPaths, ...globalFileFilters];\n stopOn = [...stopOn, \"runInteractiveTask\"];\n let stop = false;\n return (\n (new Error().stack ?? \"\")\n .split(\"\\n\")\n .map((line) => {\n const match = line.match(/at\\s+(.*)\\s+\\((.*):(\\d+):(\\d+)\\)/);\n if (match && match.length === 5) {\n let [, fn, path, line, column] = match;\n if (!fn || !path || !line || !column) {\n return undefined;\n }\n\n if (stop || stopOn.some((s) => fn?.includes(s))) {\n stop = true;\n return undefined;\n }\n\n switch (fn) {\n case \"Object.<anonymous>\":\n fn = \"\";\n break;\n case \"Object.object\":\n case \"Object.alias\":\n case \"Object.union\":\n case \"Object.enum\":\n case \"Object.undiscriminatedUnion\":\n fn = `${fn.substring(fn.indexOf(\".\") + 1)}()=> { ... }`;\n break;\n }\n return {\n fn,\n path: formatFilename(path),\n position: `${line}:${column}`\n } as StackTraceFrame;\n }\n return undefined;\n })\n .filter(\n (each) =>\n each &&\n !filterFunctions.some((f) => each.fn.includes(f)) && // substring match for filter functions\n !(filterNode && each.path?.startsWith(\"node:\")) && // starts with node:\n !(filterJs && each.path?.endsWith(\".js\")) && // ends with .js (meaning likely not a source file - no source map info)\n !filterPaths.some((p) => each.path.includes(p)) // substring match for filter paths\n ) as StackTraceFrame[]\n ).slice(skip, skip + maxFrames);\n}\n\n/**\n * Returns a formatted stack trace string at the current location for debugging purposes.\n *\n * This is a convenience function that wraps `stacktrace()` and formats the output as a\n * human-readable string. It's particularly useful for logging or debugging to understand\n * the execution flow and call hierarchy.\n *\n * The function supports both single-line and multi-line output formats. Single-line format\n * concatenates all frames into one line (useful for compact logging), while multi-line format\n * adds newlines and indentation for better readability.\n *\n * @param options - Configuration options for stack trace capture, filtering, and formatting\n * @param options.multiline - Whether to format the output with newlines and indentation.\n * When true, each frame is on its own line with 4-space indent.\n * When false (default), all frames are concatenated on one line.\n * @returns A formatted string containing the stack trace information, prefixed with \"stacktrace - \"\n *\n * @example\n * // Single-line format (compact)\n * console.log(at());\n * // Output: \"stacktrace - myFunction - /path/to/file.ts:42:13anotherFunc - /path/to/other.ts:17:5\"\n *\n * @example\n * // Multi-line format (readable)\n * console.log(at({ multiline: true, maxFrames: 5 }));\n * // Output:\n * // stacktrace -\n * // myFunction - /path/to/file.ts:42:13\n * // anotherFunc - /path/to/other.ts:17:5\n * // main - /path/to/index.ts:10:1\n *\n * @example\n * // Custom filtering for specific use case\n * console.log(at({\n * maxFrames: 10,\n * skip: 1,\n * filterPaths: [\"foo.ts\"],\n * multiline: true\n * }));\n *\n * @remarks\n * This function automatically skips itself from the stack trace output by default.\n * The \"at\" function name is filtered by the underlying `stacktrace()` function.\n */\nexport function at({\n maxFrames = 50,\n skip = 0,\n filterPaths = [],\n filterFunctions = [],\n stopOn = [\"runInteractiveTask\"],\n filterNode = true,\n filterJs = true,\n multiline = false,\n formatFilename = (filename) => filename\n}: StackTraceOptions & { multiline?: boolean } = {}): string {\n return enableStackTracking\n ? `${stacktrace({ maxFrames, skip, filterPaths, filterFunctions, stopOn, filterNode, filterJs, formatFilename })\n .map((each) => `${multiline ? \"\\n \" : \" > \"}${each.fn} - ${each.path}:${each.position}`)\n .join(\"\")}`\n : \"\";\n}\n\n/** This class allows the developer to attach stack trace information to objects */\nexport class StackTraces {\n private readonly maxFrames: number;\n private readonly skip: number;\n private readonly filterPaths: string[];\n private readonly filterFunctions: string[];\n private readonly stopOn: string[];\n private readonly filterNode: boolean;\n private readonly filterJs: boolean;\n private readonly multiline: boolean;\n private readonly formatFilename: (filename: string) => string;\n private tracking = new WeakMap<object, Set<StackTraceFrame>>();\n\n constructor({\n maxFrames = 50,\n skip = 0,\n filterPaths = [],\n filterFunctions = [],\n stopOn = [],\n filterNode = true,\n filterJs = true,\n multiline = false,\n formatFilename = (filename) => filename\n }: StackTraceOptions & { multiline?: boolean } = {}) {\n this.maxFrames = maxFrames;\n this.skip = skip;\n this.filterPaths = filterPaths;\n this.filterFunctions = filterFunctions;\n this.stopOn = stopOn;\n this.filterNode = filterNode;\n this.filterJs = filterJs;\n this.multiline = multiline;\n this.formatFilename = formatFilename;\n }\n\n /**\n * Tags the current stack trace with the given object.\n *\n * This can be called multiple times to add more stack trace information to the object.\n *\n * @param obj - The object to tag the stack trace with.\n */\n tag(obj: object): void {\n const current = this.tracking.get(obj) || new Set<StackTraceFrame>();\n stacktrace({\n maxFrames: this.maxFrames,\n skip: this.skip,\n filterPaths: this.filterPaths,\n filterFunctions: this.filterFunctions,\n stopOn: this.stopOn,\n filterNode: this.filterNode,\n filterJs: this.filterJs,\n formatFilename: this.formatFilename\n }).forEach((frame) => current.add(frame));\n this.tracking.set(obj, current);\n }\n\n /**\n * Returns a formatted stack trace string for the given object.\n * @param obj - The object to get the stack trace for.\n * @returns A formatted string containing the stack trace information.\n */\n trace(obj: object): string {\n if (!enableStackTracking) {\n return \"\";\n }\n const frames = this.tracking.get(obj);\n if (!frames) {\n return \"\";\n }\n\n return [...frames]\n .map((each) => `${this.multiline ? \"\\n \" : \"\"}${each.fn} - ${each.path}:${each.position}`)\n .join(\"\");\n }\n\n /**\n * Gets the stack trace frames for the given object.\n *\n * Note: This will only work when FERN_STACK_TRACK is defined and the .startTracking() function has been called.\n * Otherwise this will return an empty array.\n *\n * @param obj - The object to get the stack trace frames for.\n * @returns The stack trace frames for the given object.\n */\n frames(obj: object): StackTraceFrame[] {\n const frames = this.tracking.get(obj);\n if (!frames) {\n return [];\n }\n return [...frames];\n }\n\n /**\n * Frees the stack trace information for the given object.\n * @param obj - The object to free the stack trace information for.\n */\n free(obj: object): void {\n this.tracking.delete(obj);\n }\n\n /**\n * Clears all stack trace information.\n */\n clear(): void {\n this.tracking = new WeakMap<object, Set<StackTraceFrame>>();\n }\n}\n\nlet stackTraces: StackTraces | undefined;\n/**\n * Starts tracking the stack trace of the current object.\n *\n * Note: This will only start tracking when FERN_STACK_TRACK is defined.\n *\n * @param options - Configuration options for stack trace capture and filtering\n * @returns The stack traces object.\n */\nexport function startTracking({\n maxFrames = 50,\n skip = 0,\n filterPaths = [],\n filterFunctions = [],\n stopOn = [],\n filterNode = true,\n filterJs = true,\n multiline = false,\n formatFilename = (filename) => filename\n}: StackTraceOptions & { multiline?: boolean } = {}) {\n if (!enableStackTracking) {\n return;\n }\n stackTraces ??= new StackTraces({\n maxFrames,\n skip,\n filterPaths,\n filterFunctions,\n stopOn,\n filterNode,\n filterJs,\n multiline,\n formatFilename\n });\n}\n\n/**\n * Tags the current stack trace with the given object.\n *\n * Note: This will only work when FERN_STACK_TRACK is defined and the .startTracking() function has been called.\n * Otherwise this will do nothing whatsoever.\n *\n * @param obj - The object to tag the stack trace with.\n */\nexport function tag(obj: object) {\n stackTraces?.tag(obj);\n}\n\n/**\n * Returns a formatted stack trace string for the given object.\n *\n * Note: This will only work when FERN_STACK_TRACK is defined and the .startTracking() function has been called.\n * Otherwise this will do nothing whatsoever.\n *\n * @param obj - The object to get the stack trace for.\n * @returns A formatted string containing the stack trace information.\n */\nexport function trace(obj: object) {\n return stackTraces?.trace(obj) ?? \"\";\n}\n\n/**\n * Frees the stack trace information for the given object.\n *\n * Note: This will only work when FERN_STACK_TRACK is defined and the .startTracking() function has been called.\n * Otherwise this will do nothing whatsoever.\n *\n * @param obj - The object to free the stack trace information for.\n */\nexport function free(obj: object) {\n stackTraces?.free(obj);\n}\n\n/**\n * Gets the stack trace frames for the given object.\n *\n * Note: This will only work when FERN_STACK_TRACK is defined and the .startTracking() function has been called.\n * Otherwise this will return an empty array.\n *\n * @param obj - The object to get the stack trace frames for.\n * @returns The stack trace frames for the given object.\n */\nexport function getFramesForTaggedObject(obj: object): StackTraceFrame[] {\n return stackTraces?.frames(obj) ?? [];\n}\n","export abstract class AbstractFormatter {\n abstract format(content: string): Promise<string>;\n abstract formatSync(content: string): string;\n formatMultiple(contents: string[]): Promise<string[]> {\n return Promise.all(contents.map((content) => this.format(content)));\n }\n formatMultipleSync(contents: string[]): string[] {\n return contents.map((content) => this.formatSync(content));\n }\n}\n\nexport class NopFormatter extends AbstractFormatter {\n public async format(content: string): Promise<string> {\n return content;\n }\n\n public formatSync(content: string): string {\n return content;\n }\n}\n","import { enableStackTracking } from \"../utils\";\nimport {\n getFramesForTaggedObject,\n StackTraceFrame,\n stacktrace,\n startTracking,\n trackingType\n} from \"../utils/stacktrace\";\nimport { AbstractAstNode } from \"./AbstractAstNode\";\nimport { CodeBlock } from \"./CodeBlock\";\n\nconst TAB_SIZE = 4;\n// this will start tracking only when FERN_STACK_TRACK is defined\n// otherwise this has absolutely no effect whatsoever.\nstartTracking({ skip: 0, maxFrames: 15, filterFunctions: [\"Abstract\"] });\n\nexport class AbstractWriter {\n /* The buffer of lines being written */\n protected readonly lineBuffer: string[] = [];\n\n /* The contents being written */\n public get buffer() {\n if (enableStackTracking && this.nodeStackFrames.length > 0) {\n // if we're emitting tracking comments, let's ensure we get the last little bit of info.\n // by appending a newline to the buffer before returning it.\n // (this can be useful when using toString() to get a node's content.)\n this.writeInternal(\"\\n\");\n }\n return this.lineBuffer.join(\"\\n\") + (this.lastCharacterIsNewline ? \"\\n\" : \"\");\n }\n\n /* Indentation level (multiple of 4) */\n private indentLevel = 0;\n /* Whether anything has been written to the buffer */\n private hasWrittenAnything = false;\n /* Whether the last character written was a semi colon */\n private lastCharacterIsSemicolon = false;\n /* Whether the last character written was a newline */\n private lastCharacterIsNewline = false;\n /* The stack traces associated with the current node */\n private nodeStackFrames: StackTraceFrame[] = [];\n\n /**\n * Writes arbitrary text and nodes\n * @param text\n */\n public write(...parts: (string | AbstractAstNode | undefined)[]): void {\n for (const text of parts) {\n if (text != null) {\n if (typeof text === \"string\") {\n const textEndsInNewline = text.length > 0 && text.endsWith(\"\\n\");\n // temporarily remove the trailing newline, since we don't want to add the indent prefix after it\n const textWithoutNewline = textEndsInNewline ? text.substring(0, text.length - 1) : text;\n\n const indent = this.getIndentString();\n let indentedText = textWithoutNewline.replaceAll(\"\\n\", `\\n${indent}`);\n if (this.isAtStartOfLine()) {\n indentedText = indent + indentedText;\n }\n if (textEndsInNewline) {\n indentedText += \"\\n\";\n }\n this.writeInternal(indentedText);\n } else {\n this.writeNode(text);\n }\n }\n }\n }\n\n public writeStatement(...parts: (string | AbstractAstNode | undefined)[]): void {\n this.write(...parts);\n this.write(\";\");\n this.writeNewLineIfLastLineNot();\n }\n\n /**\n * Writes arbitrary text without indentation\n * @param text\n */\n public writeNoIndent(text: string): void {\n const currIndentLevel = this.indentLevel;\n this.indentLevel = 0;\n this.write(text);\n this.indentLevel = currIndentLevel;\n }\n\n /**\n * Writes a node\n * @param node\n */\n public writeNode(node: AbstractAstNode): void {\n if (enableStackTracking) {\n this.nodeStackFrames.push(...getFramesForTaggedObject(node));\n }\n node.write(this);\n\n // if we're using box or multiline comments, write a newline after every node so it emits a comment for the node\n // since we're dumping a lot of data anyway, might as well be explicit about it.\n if (enableStackTracking && trackingType !== \"single\") {\n this.writeInternal(\"\\n\");\n }\n }\n\n /**\n * Writes a node or string\n * @param input\n */\n public writeNodeOrString(input: AbstractAstNode | string): void {\n if (typeof input === \"string\") {\n this.write(input);\n return;\n }\n\n this.writeNode(input);\n }\n\n /**\n * Writes a node but then suffixes with a `;` and new line\n * @param node\n */\n public writeNodeStatement(node: AbstractAstNode): void {\n this.writeNode(node);\n this.write(\";\");\n this.writeNewLineIfLastLineNot();\n }\n\n /**\n * Writes text but then suffixes with a `;`\n * @param node\n */\n public writeTextStatement(text: string): void {\n const codeBlock = new CodeBlock(text);\n codeBlock.write(this);\n if (!text.endsWith(\";\")) {\n this.write(\";\");\n }\n this.writeNewLineIfLastLineNot();\n }\n\n /**\n * Starts a control flow block\n * @param prefix\n * @param statement\n */\n public controlFlow(prefix: string, statement: AbstractAstNode): void {\n const codeBlock = new CodeBlock(prefix);\n codeBlock.write(this);\n this.write(\" (\", statement, \")\");\n this.pushScope();\n }\n\n /**\n * Starts a control flow block\n * @param prefix\n * @param statement\n */\n public controlFlowWithoutStatement(prefix: string): void {\n const codeBlock = new CodeBlock(prefix);\n codeBlock.write(this);\n this.pushScope();\n }\n\n /**\n * Ends a control flow block\n */\n public endControlFlow(): void {\n this.popScope();\n }\n\n /**\n * Starts a control flow without a newline from the previous control flow block\n * @param prefix\n * @param statement\n */\n public contiguousControlFlow(prefix: string, statement: AbstractAstNode): void {\n this.dedent();\n this.write(\"} \");\n const codeBlock = new CodeBlock(prefix);\n codeBlock.write(this);\n this.write(\" (\", statement, \")\");\n this.pushScope();\n }\n\n /**\n * Starts a control flow alternative block\n * @param prefix\n */\n public alternativeControlFlow(prefix: string): void {\n this.dedent();\n this.write(\"} \");\n const codeBlock = new CodeBlock(prefix);\n codeBlock.write(this);\n this.pushScope();\n }\n\n public pushScope() {\n this.writeLine(\"{\");\n this.indent();\n }\n\n public popScope(withNewline = true) {\n this.dedent();\n this.writeNewLineIfLastLineNot();\n if (withNewline) {\n this.writeLine(\"}\");\n } else {\n this.write(\"}\");\n }\n }\n\n /* Only writes a newline if last line in the buffer is not a newline */\n public writeLine(...parts: (string | AbstractAstNode | undefined)[]): void {\n this.write(...(parts.length === 0 ? [\"\"] : parts));\n this.writeNewLineIfLastLineNot();\n }\n\n /* Always writes newline */\n public newLine(): void {\n this.writeInternal(\"\\n\");\n }\n\n public writeSemicolonIfLastCharacterIsNot(): void {\n if (!this.lastCharacterIsSemicolon) {\n this.writeInternal(\";\");\n }\n }\n\n public writeNewLineIfLastLineNot(): void {\n if (!this.lastCharacterIsNewline) {\n this.writeInternal(\"\\n\");\n }\n }\n\n public indent(): void {\n this.indentLevel++;\n }\n\n public dedent(): void {\n this.indentLevel--;\n }\n\n public delimit<T extends AbstractAstNode>({\n nodes,\n delimiter,\n writeFunction\n }: {\n nodes: T[];\n delimiter: string;\n writeFunction: (node: T) => void;\n }): void {\n if (nodes.length > 0) {\n const firstNode = nodes[0];\n if (firstNode != null) {\n writeFunction(firstNode);\n }\n for (let i = 1; i < nodes.length; i++) {\n this.write(delimiter);\n const node = nodes[i];\n if (node != null) {\n writeFunction(node);\n }\n }\n }\n }\n\n public toString(): string {\n return this.buffer;\n }\n\n /*******************************\n * Helper Methods\n *******************************/\n private writeInternal(text: string) {\n if (text.length === 0) {\n return;\n }\n\n const appendToLastLine = !this.lastCharacterIsNewline;\n\n this.hasWrittenAnything = true;\n this.lastCharacterIsNewline = text.endsWith(\"\\n\");\n this.lastCharacterIsSemicolon = text.endsWith(\";\");\n\n const lines = text.split(\"\\n\");\n\n const appendTrackingComment =\n enableStackTracking && !this.shouldSkipTracking(lines) && this.lastCharacterIsNewline;\n\n if (appendToLastLine) {\n this.lastLine = `${this.lastLine}${lines.shift() || \"\"}`;\n }\n\n if (this.lastCharacterIsNewline) {\n lines.pop();\n }\n\n this.lineBuffer.push(...lines);\n\n if (appendTrackingComment) {\n this.appendTrackingComment();\n }\n }\n\n /**\n * Sets the last line of the buffer\n * @param line - The line to set\n */\n protected set lastLine(line: string) {\n if (this.lineBuffer.length > 0) {\n this.lineBuffer[this.lineBuffer.length - 1] = line;\n } else {\n this.lineBuffer.push(line);\n }\n }\n\n /**\n * Gets the last line of the buffer\n * @returns The last line of the buffer\n */\n protected get lastLine() {\n return this.lineBuffer[this.lineBuffer.length - 1] || \"\";\n }\n\n /**\n * Determines if the tracking comment should be skipped\n * @param lines - The that are being written out\n *\n * @returns True if the tracking comment should be skipped\n */\n protected shouldSkipTracking(lines: string[]) {\n return false;\n }\n\n /**\n * Formats the stack trace frames into a string\n * @param stack - The stack trace to format\n * @param prefix - The prefix to add to the stack trace\n * @returns The formatted stack trace\n */\n protected formatStack(stack: StackTraceFrame[], prefix = \"\") {\n return stack.map((each) => `${prefix ? `(${prefix}) ` : \"\"} ${each.fn} - ${each.path} : ${each.position}`);\n }\n\n /**\n * Filters out frames that start with the name of the current class\n *\n * This will filter out frames that start with the name of the current class that inherits from AbstractWriter.\n *\n * You can override this function to filter out more things.\n * @param stack - The stack trace to filter\n * @returns The filtered stack trace\n */\n protected filterStack(stack: StackTraceFrame[]) {\n return stack.filter((each) => !each.fn.startsWith(`${this.constructor.name}.`));\n }\n\n /**\n * Prepares the stack trace and calls the appropriate tracking comment formatter\n */\n protected appendTrackingComment() {\n const stack = [\n // adds the stack frames of the current function call\n ...this.formatStack(this.filterStack(stacktrace({ maxFrames: 15, skip: 3 }))),\n\n // adds the stack frames of any AstNodes that have been written since the last tracking comment\n ...this.formatStack(this.filterStack(this.nodeStackFrames), \"node\")\n ];\n // reset the ast node stack frames\n this.nodeStackFrames.length = 0;\n\n switch (trackingType) {\n case \"single\":\n return this.singleLineTrackingComment(stack);\n\n case \"multiline\":\n return this.multiLineTrackingComment(stack);\n\n case \"box\":\n return this.boxTrackingComment(stack);\n }\n }\n\n /**\n * Creates a single line tracking comment\n *\n * Override this to change the format of the comment.\n *\n * @param stack - The stack trace to add to the comment\n */\n protected singleLineTrackingComment(stack: string[]) {\n this.lastLine = `${this.lastLine} // ${stack.join(\" \")}`;\n }\n /**\n * Creates a multi line tracking comment\n *\n * Override this to change the format of the comment.\n *\n * @param stack - The stack trace to add to the comment\n */\n protected multiLineTrackingComment(stack: string[]) {\n this.lineBuffer.push(...stack.map((each) => ` // ${each}`));\n }\n /**\n * Creates a box tracking comment\n *\n * Override this to change the format of the comment.\n *\n * @param stack - The stack trace to add to the comment\n */\n protected boxTrackingComment(stack: string[]) {\n this.lineBuffer.push(\"/*\", ...stack.map((each) => ` ${each}`), \"*/\");\n }\n\n private isAtStartOfLine(): boolean {\n return this.lastCharacterIsNewline || !this.hasWrittenAnything;\n }\n\n private getIndentString(): string {\n return \" \".repeat(this.indentLevel * this.getTabSize());\n }\n\n protected getTabSize(): number {\n return TAB_SIZE;\n }\n}\n","export { getPackageName } from \"./getPackageName\";\nexport { getSdkVersion } from \"./getSdkVersion\";\nexport {\n addGlobalFileFilter,\n addGlobalFunctionFilter,\n at,\n enableStackTracking,\n getFramesForTaggedObject,\n StackTraces,\n stacktrace\n} from \"./stacktrace\";\n","import { AbstractAstNode } from \"./AbstractAstNode\";\nimport { AbstractWriter } from \"./AbstractWriter\";\n\nexport declare namespace CodeBlock {\n /* Write arbitrary code */\n type Arg<T extends AbstractWriter> = string | AbstractAstNode | ((writer: T) => void);\n}\n\nexport class CodeBlock<T extends AbstractWriter> extends AbstractAstNode {\n private value: CodeBlock.Arg<T>;\n\n constructor(value: CodeBlock.Arg<T>) {\n super();\n this.value = value;\n }\n\n public write(writer: T): void {\n if (typeof this.value === \"string\") {\n writer.write(this.value);\n // if function\n } else if (typeof this.value === \"function\") {\n this.value(writer);\n } else {\n this.value.write(writer);\n }\n }\n}\n","export { AbstractDynamicSnippetsGenerator } from \"./AbstractDynamicSnippetsGenerator\";\nexport { AbstractDynamicSnippetsGeneratorContext } from \"./AbstractDynamicSnippetsGeneratorContext\";\nexport { type DiscriminatedUnionTypeInstance } from \"./DiscriminatedUnionTypeInstance\";\nexport { ErrorReporter, Severity } from \"./ErrorReporter\";\nexport { type Options, Style } from \"./Options\";\nexport { Result } from \"./Result\";\nexport { Scope } from \"./Scope\";\nexport { type TypeInstance } from \"./TypeInstance\";\nexport { DynamicSnippetsTestRunner } from \"./test-utils/DynamicSnippetsTestRunner\";\n","import { FernIr } from \"@fern-api/dynamic-ir-sdk\";\nimport { AbstractAstNode } from \"../ast\";\nimport { AbstractDynamicSnippetsGeneratorContext } from \"./AbstractDynamicSnippetsGeneratorContext\";\nimport { AbstractEndpointSnippetGenerator } from \"./AbstractEndpointSnippetGenerator\";\nimport { Options } from \"./Options\";\nimport { Result } from \"./Result\";\n\nexport abstract class AbstractDynamicSnippetsGenerator<\n Context extends AbstractDynamicSnippetsGeneratorContext,\n EndpointSnippetGenerator extends AbstractEndpointSnippetGenerator<Context>\n> {\n public constructor(public readonly context: Context) {}\n\n protected abstract createSnippetGenerator(context: Context): EndpointSnippetGenerator;\n\n public async generate(\n request: FernIr.dynamic.EndpointSnippetRequest,\n options: Options = {}\n ): Promise<FernIr.dynamic.EndpointSnippetResponse> {\n const endpoints = this.context.resolveEndpointLocationOrThrow(request.endpoint);\n if (endpoints.length === 0) {\n throw new Error(`No endpoints found that match \"${request.endpoint.method} ${request.endpoint.path}\"`);\n }\n const result = new Result();\n for (const endpoint of endpoints) {\n const context = this.context.clone() as Context;\n const snippetGenerator = this.createSnippetGenerator(context);\n try {\n const snippet = await snippetGenerator.generateSnippet({ endpoint, request, options });\n if (context.errors.empty()) {\n return {\n snippet,\n errors: undefined\n };\n }\n result.update({ context, snippet });\n } catch (error) {\n if (result.err == null) {\n result.err = error as Error;\n }\n }\n }\n return result.getResponseOrThrow({ endpoint: request.endpoint });\n }\n\n public async generateSnippetAst(\n request: FernIr.dynamic.EndpointSnippetRequest,\n options: Options = {}\n ): Promise<AbstractAstNode> {\n const endpoints = this.context.resolveEndpointLocationOrThrow(request.endpoint);\n if (endpoints.length === 0) {\n throw new Error(`No endpoints found that match \"${request.endpoint.method} ${request.endpoint.path}\"`);\n }\n let lastError: Error | undefined = undefined;\n for (const endpoint of endpoints) {\n const context = this.context.clone() as Context;\n const snippetGenerator = this.createSnippetGenerator(context);\n try {\n const ast = await snippetGenerator.generateSnippetAst({ endpoint, request, options });\n return ast;\n } catch (error) {\n lastError = error as Error;\n }\n }\n if (lastError != null) {\n throw lastError;\n }\n throw new Error(\n `Failed to generate snippet AST for endpoint: ${request.endpoint.method} ${request.endpoint.path}`\n );\n }\n\n public generateSync(\n request: FernIr.dynamic.EndpointSnippetRequest,\n options: Options = {}\n ): FernIr.dynamic.EndpointSnippetResponse {\n const endpoints = this.context.resolveEndpointLocationOrThrow(request.endpoint);\n if (endpoints.length === 0) {\n throw new Error(`No endpoints found that match \"${request.endpoint.method} ${request.endpoint.path}\"`);\n }\n const result = new Result();\n for (const endpoint of endpoints) {\n const context = this.context.clone() as Context;\n const snippetGenerator = this.createSnippetGenerator(context);\n try {\n const snippet = snippetGenerator.generateSnippetSync({ endpoint, request, options });\n if (context.errors.empty()) {\n return {\n snippet,\n errors: undefined\n };\n }\n result.update({ context, snippet });\n } catch (error) {\n if (result.err == null) {\n result.err = error as Error;\n }\n }\n }\n return result.getResponseOrThrow({ endpoint: request.endpoint });\n }\n}\n","import { FernIr } from \"@fern-api/dynamic-ir-sdk\";\n\nimport { AbstractDynamicSnippetsGeneratorContext } from \"./AbstractDynamicSnippetsGeneratorContext\";\nimport { ErrorReporter } from \"./ErrorReporter\";\n\nexport class Result {\n public reporter: ErrorReporter | undefined;\n public snippet: string | undefined;\n public err: Error | undefined;\n\n constructor() {\n this.snippet = undefined;\n this.reporter = undefined;\n this.err = undefined;\n }\n\n public update({ context, snippet }: { context: AbstractDynamicSnippetsGeneratorContext; snippet: string }): void {\n if (this.shouldUpdate({ snippet, reporter: context.errors })) {\n this.reporter = context.errors.clone();\n this.snippet = snippet;\n }\n }\n\n public getResponseOrThrow({\n endpoint\n }: {\n endpoint: FernIr.dynamic.EndpointLocation;\n }): FernIr.dynamic.EndpointSnippetResponse {\n if (this.snippet != null && this.reporter != null) {\n return {\n snippet: this.snippet,\n errors: this.reporter.toDynamicSnippetErrors()\n };\n }\n throw this.err ?? new Error(`Failed to generate snippet for endpoint \"${endpoint.method} ${endpoint.path}\"`);\n }\n\n private shouldUpdate({ snippet, reporter }: { snippet: string; reporter: ErrorReporter }): boolean {\n if (this.reporter == null || (this.reporter.size() > 0 && reporter.size() === 0)) {\n return true;\n }\n return snippet.length > (this.snippet?.length ?? 0);\n }\n}\n","import { assertNever, keys } from \"@fern-api/core-utils\";\nimport { FernIr } from \"@fern-api/dynamic-ir-sdk\";\nimport { HttpEndpointReferenceParser } from \"@fern-api/fern-definition-schema\";\n\nimport { FernGeneratorExec } from \"../GeneratorNotificationService\";\nimport { DiscriminatedUnionTypeInstance } from \"./DiscriminatedUnionTypeInstance\";\nimport { ErrorReporter, Severity } from \"./ErrorReporter\";\nimport { Options } from \"./Options\";\nimport { TypeInstance } from \"./TypeInstance\";\n\nexport abstract class AbstractDynamicSnippetsGeneratorContext {\n public config: FernGeneratorExec.GeneratorConfig;\n public options: Options;\n public errors: ErrorReporter;\n\n private _ir: FernIr.dynamic.DynamicIntermediateRepresentation;\n private httpEndpointReferenceParser: HttpEndpointReferenceParser;\n\n constructor({\n ir,\n config,\n options = {}\n }: {\n ir: FernIr.dynamic.DynamicIntermediateRepresentation;\n config: FernGeneratorExec.GeneratorConfig;\n options?: Options;\n }) {\n this._ir = ir;\n this.config = config;\n this.options = options;\n this.errors = new ErrorReporter();\n this.httpEndpointReferenceParser = new HttpEndpointReferenceParser();\n }\n\n public abstract clone(): AbstractDynamicSnippetsGeneratorContext;\n\n public associateQueryParametersByWireValue({\n parameters,\n values\n }: {\n parameters: FernIr.dynamic.NamedParameter[];\n values: FernIr.dynamic.Values;\n }): TypeInstance[] {\n const instances: TypeInstance[] = [];\n for (const [key, value] of Object.entries(values)) {\n this.errors.scope(key);\n try {\n const parameter = parameters.find((param) => param.name.wireValue === key);\n if (parameter == null) {\n throw this.newParameterNotRecognizedError(key);\n }\n // If this query parameter supports allow-multiple, the user-provided values\n // must be wrapped in an array.\n const typeInstanceValue =\n this.isListTypeReference(parameter.typeReference) && !Array.isArray(value) ? [value] : value;\n instances.push({\n name: parameter.name,\n typeReference: parameter.typeReference,\n value: typeInstanceValue\n });\n } finally {\n this.errors.unscope();\n }\n }\n return instances;\n }\n\n public associateByWireValueOrDefault({\n parameters,\n values\n }: {\n parameters: FernIr.dynamic.NamedParameter[];\n values: FernIr.dynamic.Values;\n }): TypeInstance[] {\n const instances: TypeInstance[] = [];\n for (const parameter of parameters) {\n this.errors.scope(parameter.name.wireValue);\n try {\n let value = values[parameter.name.wireValue];\n\n if (value == null) {\n if (parameter.typeReference.type === \"primitive\" && parameter.typeReference.value === \"STRING\") {\n // synthesize a parameter value for string parameters that are missing data\n value = `<${parameter.name.wireValue}>`;\n } else {\n this.errors.add({\n severity: Severity.Critical,\n message: this.newParameterNotRecognizedError(parameter.name.wireValue).message\n });\n continue;\n }\n }\n\n instances.push({\n name: parameter.name,\n typeReference: parameter.typeReference,\n value\n });\n } finally {\n this.errors.unscope();\n }\n }\n\n return instances;\n }\n\n public associateByWireValue({\n parameters,\n values,\n ignoreMissingParameters\n }: {\n parameters: FernIr.dynamic.NamedParameter[];\n values: FernIr.dynamic.Values;\n ignoreMissingParameters?: boolean;\n }): TypeInstance[] {\n const instances: TypeInstance[] = [];\n for (const [key, value] of Object.entries(values)) {\n this.errors.scope(key);\n try {\n const parameter = parameters.find((param) => param.name.wireValue === key);\n if (parameter == null) {\n if (ignoreMissingParameters) {\n // Required for request payloads that include more information than\n // just the target parameters (e.g. union base properties).\n continue;\n }\n this.errors.add({\n severity: Severity.Critical,\n message: this.newParameterNotRecognizedError(key).message\n });\n continue;\n }\n instances.push({\n name: parameter.name,\n typeReference: parameter.typeReference,\n value\n });\n } finally {\n this.errors.unscope();\n }\n }\n return instances;\n }\n\n /**\n * Similar to `associateByWireValue` but it builds TypeInstance objects by iterating over schema parameters rather\n * than snippet values. Skips non-nullable parameters that are missing from the snippet object.\n */\n public getExampleObjectProperties({\n parameters,\n snippetObject\n }: {\n parameters: FernIr.dynamic.NamedParameter[];\n snippetObject: unknown;\n }): TypeInstance[] {\n const objectRecord = (\n typeof snippetObject === \"object\" && snippetObject !== null && !Array.isArray(snippetObject)\n ? snippetObject\n : {}\n ) as Record<string, unknown>;\n const instances: TypeInstance[] = [];\n for (const parameter of parameters) {\n const value = objectRecord[parameter.name.wireValue];\n if (value == null) {\n if (parameter.typeReference.type === \"nullable\") {\n instances.push({\n name: parameter.name,\n typeReference: parameter.typeReference,\n value: null\n });\n }\n } else {\n instances.push({\n name: parameter.name,\n typeReference: parameter.typeReference,\n value\n });\n }\n }\n return instances;\n }\n\n public getSingleFileValue({\n property,\n record\n }: {\n property: FernIr.dynamic.FileUploadRequestBodyProperty.File_;\n record: Record<string, unknown>;\n }): string | undefined {\n const fileValue = record[property.wireValue];\n if (fileValue == null) {\n return undefined;\n }\n if (typeof fileValue !== \"string\") {\n this.errors.add({\n severity: Severity.Critical,\n message: `Expected file value to be a string, got ${typeof fileValue}`\n });\n return undefined;\n }\n return fileValue;\n }\n\n public getFileArrayValues({\n property,\n record\n }: {\n property: FernIr.dynamic.FileUploadRequestBodyProperty.FileArray;\n record: Record<string, unknown>;\n }): string[] | undefined {\n const fileArrayValue = record[property.wireValue];\n if (fileArrayValue == null) {\n return undefined;\n }\n if (!Array.isArray(fileArrayValue)) {\n this.errors.add({\n severity: Severity.Critical,\n message: `Expected file array value to be an array of strings, got ${typeof fileArrayValue}`\n });\n return undefined;\n }\n const stringValues: string[] = [];\n for (const value of fileArrayValue) {\n if (typeof value !== \"string\") {\n this.errors.add({\n severity: Severity.Critical,\n message: `Expected file array value to be an array of strings, got ${typeof value}`\n });\n return undefined;\n }\n stringValues.push(value);\n }\n return stringValues;\n }\n\n public getRecord(value: unknown): Record<string, unknown> | undefined {\n if (typeof value !== \"object\" || Array.isArray(value)) {\n this.errors.add({\n severity: Severity.Critical,\n message: `Expected object with key, value pairs but got: ${\n Array.isArray(value) ? \"array\" : typeof value\n }`\n });\n return undefined;\n }\n if (value == null) {\n return {};\n }\n return value as Record<string, unknown>;\n }\n\n public resolveNamedType({ typeId }: { typeId: FernIr.dynamic.TypeId }): FernIr.dynamic.NamedType | undefined {\n const namedType = this._ir.types[typeId];\n if (namedType == null) {\n this.errors.add({\n severity: Severity.Critical,\n message: `Type identified by \"${typeId}\" could not be found`\n });\n return undefined;\n }\n return namedType;\n }\n\n public resolveDiscriminatedUnionTypeInstance({\n discriminatedUnion,\n value\n }: {\n discriminatedUnion: FernIr.dynamic.DiscriminatedUnionType;\n value: unknown;\n }): DiscriminatedUnionTypeInstance | undefined {\n const record = this.getRecord(value);\n if (record == null) {\n return undefined;\n }\n\n const discriminantFieldName = discriminatedUnion.discriminant.wireValue;\n const discriminantValue = record[discriminantFieldName];\n if (discriminantValue == null) {\n this.errors.add({\n severity: Severity.Critical,\n message: this.newParameterNotRecognizedError(discriminantFieldName).message\n });\n return undefined;\n }\n if (typeof discriminantValue !== \"string\") {\n this.errors.add({\n severity: Severity.Critical,\n message: `Expected discriminant value to be a string but got: ${typeof discriminantValue}`\n });\n return undefined;\n }\n\n const singleDiscriminatedUnionType = discriminatedUnion.types[discriminantValue];\n if (singleDiscriminatedUnionType == null) {\n this.errors.add({\n severity: Severity.Critical,\n message: `No type found for discriminant value \"${discriminantValue}\"`\n });\n return undefined;\n }\n\n // Remove the discriminant from the record so that the value is valid for the type.\n const { [discriminantFieldName]: _, ...filtered } = record;\n\n return {\n singleDiscriminatedUnionType,\n discriminantValue: singleDiscriminatedUnionType.discriminantValue,\n value: filtered\n };\n }\n\n public resolveEndpointOrThrow(rawEndpoint: string): FernIr.dynamic.Endpoint[] {\n const parsedEndpoint = this.httpEndpointReferenceParser.tryParse(rawEndpoint);\n if (parsedEndpoint == null) {\n throw new Error(`Failed to parse endpoint reference \"${rawEndpoint}\"`);\n }\n return this.resolveEndpointLocationOrThrow(parsedEndpoint);\n }\n\n public resolveEndpointLocation(location: FernIr.dynamic.EndpointLocation): FernIr.dynamic.Endpoint[] {\n const endpoints: FernIr.dynamic.Endpoint[] = [];\n for (const endpoint of Object.values(this._ir.endpoints)) {\n if (this.parsedEndpointMatches({ endpoint, parsedEndpoint: location })) {\n endpoints.push(endpoint);\n }\n }\n\n return endpoints;\n }\n\n public resolveEndpointLocationOrThrow(location: FernIr.dynamic.EndpointLocation): FernIr.dynamic.Endpoint[] {\n const endpoints = this.resolveEndpointLocation(location);\n if (endpoints.length === 0) {\n throw new Error(`Failed to find endpoint identified by \"${location.method} ${location.path}\"`);\n }\n return endpoints;\n }\n\n public needsRequestParameter({\n request,\n inlinePathParameters,\n inlineFileProperties\n }: {\n request: FernIr.dynamic.InlinedRequest;\n inlinePathParameters: boolean;\n inlineFileProperties: boolean;\n }): boolean {\n if (this.includePathParametersInWrappedRequest({ request, inlinePathParameters })) {\n return true;\n }\n if (request.queryParameters != null && request.queryParameters.length > 0) {\n return true;\n }\n if (request.headers != null && request.headers.length > 0) {\n return true;\n }\n if (request.body != null) {\n return this.includeRequestBodyInWrappedRequest({ body: request.body, inlineFileProperties });\n }\n if (request.metadata?.onlyPathParameters) {\n return false;\n }\n return true;\n }\n\n public includePathParametersInWrappedRequest({\n request,\n inlinePathParameters\n }: {\n request: FernIr.dynamic.InlinedRequest;\n inlinePathParameters: boolean;\n }): boolean {\n return inlinePathParameters && (request.metadata?.includePathParameters ?? false);\n }\n\n public isFileUploadRequestBody(\n body: FernIr.dynamic.InlinedRequestBody\n ): body is FernIr.dynamic.InlinedRequestBody.FileUpload {\n switch (body.type) {\n case \"fileUpload\":\n return true;\n case \"properties\":\n case \"referenced\":\n return false;\n default:\n assertNever(body);\n }\n }\n\n public resolveEnvironmentName(environmentID: string): FernIr.Name | undefined {\n if (this._ir.environments == null) {\n return undefined;\n }\n const environments = this._ir.environments.environments;\n switch (environments.type) {\n case \"singleBaseUrl\": {\n const environment = environments.environments.find((env) => env.id === environmentID);\n if (environment == null) {\n return undefined;\n }\n return environment.name;\n }\n case \"multipleBaseUrls\": {\n const environment = environments.environments.find((env) => env.id === environmentID);\n if (environment == null) {\n return undefined;\n }\n return environment.name;\n }\n default:\n assertNever(environments);\n }\n }\n\n public isSingleEnvironmentID(\n environment: FernIr.dynamic.EnvironmentValues\n ): environment is FernIr.dynamic.EnvironmentId {\n return typeof environment === \"string\";\n }\n\n public isMultiEnvironmentValues(\n environment: FernIr.dynamic.EnvironmentValues\n ): environment is FernIr.dynamic.MultipleEnvironmentUrlValues {\n return typeof environment === \"object\";\n }\n\n public validateMultiEnvironmentUrlValues(\n multiEnvironmentUrlValues: FernIr.dynamic.MultipleEnvironmentUrlValues\n ): boolean {\n if (this._ir.environments == null) {\n this.errors.add({\n severity: Severity.Critical,\n message:\n \"Multiple environments are not supported for single base URL environments; use the baseUrl option instead\"\n });\n return false;\n }\n const environments = this._ir.environments.environments;\n switch (environments.type) {\n case \"singleBaseUrl\": {\n this.errors.add({\n severity: Severity.Critical,\n message:\n \"Multiple environments are not supported for single base URL environments; use the baseUrl option instead\"\n });\n return false;\n }\n case \"multipleBaseUrls\": {\n const firstEnvironment = environments.environments[0];\n if (firstEnvironment == null) {\n this.errors.add({\n severity: Severity.Critical,\n message: \"Multiple environments are not supported; use the baseUrl option instead\"\n });\n return false;\n }\n const expectedKeys = new Set(keys(firstEnvironment.urls));\n for (const key of keys(multiEnvironmentUrlValues)) {\n if (expectedKeys.has(key)) {\n expectedKeys.delete(key);\n }\n }\n if (expectedKeys.size > 0) {\n this.errors.add({\n severity: Severity.Critical,\n message: `The provided environments are invalid; got: [${Object.keys(multiEnvironmentUrlValues).join(\", \")}], expected: [${keys(firstEnvironment.urls).join(\", \")}]`\n });\n return false;\n }\n return true;\n }\n }\n }\n\n public getValueAsNumber({ value }: { value: unknown }): number | undefined {\n if (typeof value !== \"number\") {\n this.errors.add({\n severity: Severity.Critical,\n message: this.newTypeMismatchError({ expected: \"number\", value }).message\n });\n return undefined;\n }\n return value;\n }\n\n public getValueAsBoolean({ value }: { value: unknown }): boolean | undefined {\n if (typeof value !== \"boolean\") {\n this.errors.add({\n severity: Severity.Critical,\n message: this.newTypeMismatchError({ expected: \"boolean\", value }).message\n });\n return undefined;\n }\n return value;\n }\n\n public getValueAsString({ value }: { value: unknown }): string | undefined {\n if (typeof value !== \"string\") {\n this.errors.add({\n severity: Severity.Critical,\n message: this.newTypeMismatchError({ expected: \"string\", value }).message\n });\n return undefined;\n }\n return value;\n }\n\n public isOptional(typeReference: FernIr.dynamic.TypeReference): boolean {\n switch (typeReference.type) {\n case \"nullable\":\n return this.isOptional(typeReference.value);\n case \"optional\":\n return true;\n case \"named\": {\n const resolvedType = this.resolveNamedType({ typeId: typeReference.value });\n if (resolvedType == null) {\n return false;\n }\n if (resolvedType.type === \"alias\") {\n return this.isNullable(resolvedType.typeReference);\n }\n return false;\n }\n }\n return false;\n }\n\n public isNullable(typeReference: FernIr.dynamic.TypeReference): boolean {\n switch (typeReference.type) {\n case \"nullable\":\n return true;\n case \"optional\":\n return this.isNullable(typeReference.value);\n case \"named\": {\n const resolvedType = this.resolveNamedType({ typeId: typeReference.value });\n if (resolvedType == null) {\n return false;\n }\n if (resolvedType.type === \"alias\") {\n return this.isNullable(resolvedType.typeReference);\n }\n return false;\n }\n }\n return false;\n }\n\n public newAuthMismatchError({\n auth,\n values\n }: {\n auth: FernIr.dynamic.Auth;\n values: FernIr.dynamic.AuthValues;\n }): Error {\n return new Error(`Expected auth type ${auth.type}, got ${values.type}`);\n }\n\n public newParameterNotRecognizedError(parameterName: string): Error {\n return new Error(`\"${parameterName}\" is not a recognized parameter for this endpoint`);\n }\n\n public newTypeMismatchError({ expected, value }: { expected: string; value: unknown }): Error {\n return new Error(`Expected ${expected}, got ${typeof value}`);\n }\n\n private includeRequestBodyInWrappedRequest({\n body,\n inlineFileProperties\n }: {\n body: FernIr.dynamic.InlinedRequestBody;\n inlineFileProperties: boolean;\n }): boolean {\n switch (body.type) {\n case \"properties\":\n case \"referenced\":\n return true;\n case \"fileUpload\":\n return this.includeFileUploadBodyInWrappedRequest({ fileUpload: body, inlineFileProperties });\n default:\n assertNever(body);\n }\n }\n\n private includeFileUploadBodyInWrappedRequest({\n fileUpload,\n inlineFileProperties\n }: {\n fileUpload: FernIr.dynamic.FileUploadRequestBody;\n inlineFileProperties: boolean;\n }): boolean {\n return (\n this.fileUploadHasBodyProperties({ fileUpload }) ||\n (inlineFileProperties && this.fileUploadHasFileProperties({ fileUpload }))\n );\n }\n\n private fileUploadHasBodyProperties({ fileUpload }: { fileUpload: FernIr.dynamic.FileUploadRequestBody }): boolean {\n return fileUpload.properties.some((property) => {\n switch (property.type) {\n case \"file\":\n case \"fileArray\":\n return false;\n case \"bodyProperty\":\n return true;\n default:\n assertNever(property);\n }\n });\n }\n\n private fileUploadHasFileProperties({ fileUpload }: { fileUpload: FernIr.dynamic.FileUploadRequestBody }): boolean {\n return fileUpload.properties.some((property) => {\n switch (property.type) {\n case \"file\":\n case \"fileArray\":\n return true;\n case \"bodyProperty\":\n return false;\n default:\n assertNever(property);\n }\n });\n }\n\n private isListTypeReference(typeReference: FernIr.dynamic.TypeReference): boolean {\n if (typeReference.type === \"optional\") {\n return this.isListTypeReference(typeReference.value);\n }\n return typeReference.type === \"list\" || typeReference.type === \"set\";\n }\n\n private parsedEndpointMatches({\n endpoint,\n parsedEndpoint\n }: {\n endpoint: FernIr.dynamic.Endpoint;\n parsedEndpoint: HttpEndpointReferenceParser.Parsed;\n }): boolean {\n return endpoint.location.method === parsedEndpoint.method && endpoint.location.path === parsedEndpoint.path;\n }\n}\n","export { EXAMPLE_REFERENCE_PREFIX, YAML_SCHEMA_VERSION } from \"./constants\";\nexport { type NodePath, type NodePathItem } from \"./NodePath\";\nexport * as RawSchemas from \"./schemas\";\nexport { type DefinitionFileSchema, type PackageMarkerFileSchema, type RootApiFileSchema } from \"./schemas\";\nexport * from \"./utils/auth\";\nexport * from \"./utils/generics\";\nexport { getRequestBody } from \"./utils/getRequestBody\";\nexport { getResponseBodyType } from \"./utils/getResponseBodyType\";\nexport { HttpEndpointReferenceParser } from \"./utils/HttpEndpointReferenceParser\";\nexport { isInlineRequestBody } from \"./utils/isInlineRequestBody\";\nexport { isOpenApiSourceSchema } from \"./utils/isOpenApiSourceSchema\";\nexport { isRawProtobufSourceSchema } from \"./utils/isRawProtobufSourceSchema\";\nexport { isRawTextType } from \"./utils/isRawTextType\";\nexport { type BytesRequest, parseBytesRequest } from \"./utils/parseBytesRequest\";\nexport { parseFileUploadRequest, type RawFileUploadRequest } from \"./utils/parseFileUploadRequest\";\nexport { parseRawBytesType, type RawBytesType } from \"./utils/parseRawBytesType\";\nexport { parseRawFileType, type RawFileType } from \"./utils/parseRawFileType\";\nexport { parseRawTextType, type RawTextType } from \"./utils/parseRawTextType\";\nexport { RawPrimitiveType } from \"./utils/RawPrimitiveType\";\nexport { recursivelyVisitRawTypeReference } from \"./utils/recursivelyVisitRawTypeReference\";\nexport { visitExampleCodeSampleSchema } from \"./utils/visitExampleCodeSampleSchema\";\nexport { type ExampleResponseSchemaVisitor, visitExampleResponseSchema } from \"./utils/visitExampleResponseSchema\";\nexport { isAnyAuthSchemes, isSingleAuthScheme, type RawApiAuthVisitor, visitRawApiAuth } from \"./utils/visitRawApiAuth\";\nexport {\n type AuthSchemeDeclarationVisitor,\n isHeaderAuthScheme,\n visitRawAuthSchemeDeclaration\n} from \"./utils/visitRawAuthSchemeDeclaration\";\nexport {\n isRawMultipleBaseUrlsEnvironment,\n isRawSingleBaseUrlEnvironment,\n visitRawEnvironmentDeclaration\n} from \"./utils/visitRawEnvironmentDeclaration\";\nexport {\n isVariablePathParameter,\n type PathParameterDeclarationVisitor,\n visitRawPathParameter\n} from \"./utils/visitRawPathParameter\";\nexport {\n isRawAliasDefinition,\n isRawDiscriminatedUnionDefinition,\n isRawEnumDefinition,\n isRawObjectDefinition,\n isRawUndiscriminatedUnionDefinition,\n type RawTypeDeclarationVisitor,\n visitRawTypeDeclaration\n} from \"./utils/visitRawTypeDeclaration\";\nexport { FernContainerRegex, visitRawTypeReference } from \"./utils/visitRawTypeReference\";\n","export declare namespace HttpEndpointReferenceParser {\n interface Parsed {\n path: string;\n method: Method;\n }\n\n type Method = \"GET\" | \"POST\" | \"PUT\" | \"DELETE\" | \"PATCH\" | \"HEAD\";\n\n export type ValidationResult = Valid | Invalid;\n\n interface Valid {\n type: \"valid\";\n }\n\n interface Invalid {\n type: \"invalid\";\n }\n}\n\n/**\n * Parses an HTTP endpoint reference like `POST /users/get`\n */\nexport class HttpEndpointReferenceParser {\n //eslint-disable-next-line\n private REFERENCE_REGEX = /^(GET|POST|PUT|DELETE|PATCH|HEAD)\\s(\\/\\S*)$/;\n\n public validate(reference: string): HttpEndpointReferenceParser.ValidationResult {\n const validFormat = this.REFERENCE_REGEX.test(reference);\n if (!validFormat) {\n return { type: \"invalid\" };\n }\n return { type: \"valid\" };\n }\n\n public tryParse(reference: string): HttpEndpointReferenceParser.Parsed | undefined {\n const validationResponse = this.validate(reference);\n if (validationResponse.type === \"invalid\") {\n return undefined;\n }\n const match = reference.match(this.REFERENCE_REGEX);\n if (match == null || match[1] == null || match[2] == null) {\n return undefined;\n }\n return {\n method: match[1] as HttpEndpointReferenceParser.Method,\n path: match[2]\n };\n }\n}\n","export const Severity = {\n Critical: \"CRITICAL\",\n Warning: \"WARNING\"\n} as const;\n\nexport declare namespace ErrorReporter {\n type Path = readonly PathItem[];\n\n type PathItem = string | ArrayPathItem;\n\n type Severity = (typeof Severity)[keyof typeof Severity];\n\n interface ArrayPathItem {\n index: number;\n }\n\n interface Error {\n path?: Path;\n severity: Severity;\n message: string;\n }\n}\n\ninterface Error_ {\n severity: \"CRITICAL\" | \"WARNING\";\n path: string[] | undefined;\n message: string;\n}\n\nexport class ErrorReporter {\n private errors: ErrorReporter.Error[];\n private path: ErrorReporter.PathItem[];\n\n constructor() {\n this.errors = [];\n this.path = [];\n }\n\n public add(err: Omit<ErrorReporter.Error, \"path\">): void {\n this.errors.push({\n ...err,\n path: [...this.path]\n });\n }\n\n public scope(path: ErrorReporter.PathItem): void {\n this.path.push(path);\n }\n\n public unscope(): void {\n this.path.pop();\n }\n\n public getBySeverity(severity: ErrorReporter.Severity): ErrorReporter.Error[] {\n return this.errors.filter((err) => err.severity === severity);\n }\n\n public empty(): boolean {\n return this.errors.length === 0;\n }\n\n public size(): number {\n return this.errors.length;\n }\n\n public clone(): ErrorReporter {\n const clone = new ErrorReporter();\n clone.errors = [...this.errors];\n clone.path = [...this.path];\n return clone;\n }\n\n public reset(): void {\n this.errors = [];\n this.path = [];\n }\n\n public toDynamicSnippetErrors(): Error_[] {\n return this.errors.map((err) => ({\n severity: err.severity,\n path: err.path != null ? this.pathToStringArray(err.path) : undefined,\n message: err.message\n }));\n }\n\n private pathToStringArray(path: ErrorReporter.Path): string[] {\n const result: string[] = [];\n for (const item of path) {\n if (typeof item === \"string\") {\n result.push(item);\n continue;\n }\n result[result.length - 1] += `[${item.index}]`;\n }\n return result;\n }\n}\n","export const Scope = {\n PathParameters: \"pathParameters\",\n QueryParameters: \"queryParameters\",\n Headers: \"headers\",\n RequestBody: \"requestBody\"\n} as const;\n\nexport type Scope = (typeof Scope)[keyof typeof Scope];\n","export { AbsoluteFilePath } from \"./AbsoluteFilePath\";\nexport { basename } from \"./basename\";\nexport { convertToOsPath } from \"./convertToOsPath\";\nexport { dirname } from \"./dirname\";\nexport { isAbsolute } from \"./isAbsolute\";\nexport { join } from \"./join\";\nexport { RelativeFilePath } from \"./RelativeFilePath\";\nexport { relative } from \"./relative\";\nexport { sep } from \"./sep\";\n","export function basename(path: string, options?: { stripExtension?: boolean }): string {\n const basename = path.split(\"/\").pop() ?? path;\n if (options?.stripExtension) {\n return basename.split(\".\")[0] ?? basename;\n }\n return basename;\n}\n","import {\n AbstractDynamicSnippetsGeneratorContext,\n FernGeneratorExec\n} from \"@fern-api/browser-compatible-base-generator\";\nimport { assertNever } from \"@fern-api/core-utils\";\nimport { FernIr } from \"@fern-api/dynamic-ir-sdk\";\nimport { BaseGoCustomConfigSchema, go, goExportedFieldName, resolveRootImportPath } from \"@fern-api/go-ast\";\n\nimport { DynamicTypeInstantiationMapper } from \"./DynamicTypeInstantiationMapper\";\nimport { DynamicTypeMapper } from \"./DynamicTypeMapper\";\nimport { FilePropertyMapper } from \"./FilePropertyMapper\";\n\nexport class DynamicSnippetsGeneratorContext extends AbstractDynamicSnippetsGeneratorContext {\n public ir: FernIr.dynamic.DynamicIntermediateRepresentation;\n public customConfig: BaseGoCustomConfigSchema | undefined;\n public dynamicTypeMapper: DynamicTypeMapper;\n public dynamicTypeInstantiationMapper: DynamicTypeInstantiationMapper;\n public filePropertyMapper: FilePropertyMapper;\n public rootImportPath: string;\n\n constructor({\n ir,\n config\n }: {\n ir: FernIr.dynamic.DynamicIntermediateRepresentation;\n config: FernGeneratorExec.GeneratorConfig;\n }) {\n super({ ir, config });\n this.ir = ir;\n this.customConfig = config.customConfig != null ? (config.customConfig as BaseGoCustomConfigSchema) : undefined;\n this.dynamicTypeMapper = new DynamicTypeMapper({ context: this });\n this.dynamicTypeInstantiationMapper = new DynamicTypeInstantiationMapper({ context: this });\n this.filePropertyMapper = new FilePropertyMapper({ context: this });\n this.rootImportPath = resolveRootImportPath({ config, customConfig: this.customConfig });\n }\n\n public clone(): DynamicSnippetsGeneratorContext {\n return new DynamicSnippetsGeneratorContext({\n ir: this.ir,\n config: this.config\n });\n }\n\n public isOptional(typeReference: FernIr.dynamic.TypeReference): boolean {\n switch (typeReference.type) {\n case \"optional\":\n case \"map\":\n return true;\n case \"nullable\":\n case \"list\":\n case \"set\":\n return this.isOptional(typeReference.value);\n case \"named\":\n case \"literal\":\n case \"primitive\":\n case \"unknown\":\n return false;\n default:\n assertNever(typeReference);\n }\n }\n\n public getMethodName(name: FernIr.Name): string {\n return name.pascalCase.unsafeName;\n }\n\n public getTestMethodName(endpoint: FernIr.dynamic.Endpoint): string {\n return (\n endpoint.declaration.fernFilepath.allParts.map((name) => name.pascalCase.unsafeName).join(\"\") +\n endpoint.declaration.name.pascalCase.unsafeName\n );\n }\n\n public getTypeName(name: FernIr.Name): string {\n return name.pascalCase.unsafeName;\n }\n\n public getFieldName(name: FernIr.Name): string {\n return goExportedFieldName(name.pascalCase.unsafeName);\n }\n\n public getImportPath(fernFilepath: FernIr.dynamic.FernFilepath): string {\n const parts = fernFilepath.packagePath.map((path) => path.pascalCase.unsafeName.toLowerCase());\n return [this.rootImportPath, ...parts].join(\"/\");\n }\n\n public getImportPathForRequest(fernFilepath: FernIr.dynamic.FernFilepath): string {\n if (this.customConfig?.exportAllRequestsAtRoot) {\n return this.rootImportPath;\n }\n return this.getImportPath(fernFilepath);\n }\n\n public getContextTypeReference(): go.TypeReference {\n return go.typeReference({\n name: \"Context\",\n importPath: \"context\"\n });\n }\n\n public getContextTodoFunctionInvocation(): go.FuncInvocation {\n return go.invokeFunc({\n func: go.typeReference({\n name: \"TODO\",\n importPath: \"context\"\n }),\n arguments_: []\n });\n }\n\n public getIoReaderTypeReference(): go.TypeReference {\n return go.typeReference({\n name: \"Reader\",\n importPath: \"io\"\n });\n }\n\n public getTestingTypeReference(): go.TypeReference {\n return go.typeReference({\n name: \"T\",\n importPath: \"testing\"\n });\n }\n\n public getNewStringsReaderFunctionInvocation(s: string): go.FuncInvocation {\n return go.invokeFunc({\n func: go.typeReference({\n name: \"NewReader\",\n importPath: \"strings\"\n }),\n arguments_: [go.TypeInstantiation.string(s)]\n });\n }\n\n public getClientConstructorName(): string {\n if (this.customConfig?.clientConstructorName != null) {\n return this.customConfig.clientConstructorName;\n }\n if (this.customConfig?.exportedClientName != null) {\n return `New${this.customConfig.exportedClientName}`;\n }\n return `New${this.getClientName()}`;\n }\n\n public getClientName(): string {\n if (this.customConfig?.clientName != null) {\n return this.customConfig.clientName;\n }\n return \"Client\";\n }\n\n public getClientImportPath(): string {\n return `${this.rootImportPath}/client`;\n }\n\n public getOptionImportPath(): string {\n return `${this.rootImportPath}/option`;\n }\n\n public getGoTypeReferenceFromDeclaration({\n declaration\n }: {\n declaration: FernIr.dynamic.Declaration;\n }): go.TypeReference {\n return go.typeReference({\n name: declaration.name.pascalCase.unsafeName,\n importPath: this.getImportPath(declaration.fernFilepath)\n });\n }\n\n public getEnvironmentTypeReferenceFromID(environmentID: string): go.TypeReference | undefined {\n const environmentName = this.resolveEnvironmentName(environmentID);\n if (environmentName == null) {\n return undefined;\n }\n return this.getEnvironmentTypeReference(environmentName);\n }\n\n private getEnvironmentTypeReference(name: FernIr.Name): go.TypeReference {\n return go.typeReference({\n name: `Environments.${this.getTypeName(name)}`,\n importPath: this.rootImportPath\n });\n }\n\n public static chainMethods(\n baseFunc: go.FuncInvocation,\n ...methods: Omit<go.MethodInvocation.Args, \"on\">[]\n ): go.MethodInvocation {\n if (methods.length === 0) {\n throw new Error(\"Must have methods to chain\");\n }\n\n let current: go.AstNode = baseFunc;\n for (const method of methods) {\n current = go.invokeMethod({\n on: current,\n method: method.method,\n arguments_: method.arguments_,\n multiline: method.multiline\n });\n }\n return current as go.MethodInvocation;\n }\n}\n","export { GoFile } from \"./ast/core/GoFile\";\nexport { type BaseGoCustomConfigSchema, baseGoCustomConfigSchema } from \"./custom-config/BaseGoCustomConfigSchema\";\nexport { defaultBaseGoCustomConfigSchema } from \"./custom-config/DefaultBaseGoCustomConfigSchema\";\nexport * as go from \"./go\";\nexport { goExportedFieldName } from \"./utils/goExportedFieldName\";\nexport { resolveRootImportPath, resolveRootModulePath } from \"./utils/resolveRootImportPath\";\n","import { Writer } from \"./Writer\";\n\nexport declare namespace GoFile {\n interface Args extends Writer.Args {}\n}\n\nexport class GoFile extends Writer {\n constructor({ packageName, rootImportPath, importPath, customConfig, formatter }: GoFile.Args) {\n super({ packageName, rootImportPath, importPath, customConfig, formatter });\n }\n\n public async toStringAsync(): Promise<string> {\n const content = this.getContent();\n if (this.formatter != null) {\n try {\n return this.formatter.format(content);\n } catch (error) {\n throw new Error(`Failed to format Go file: ${error}\\n${content}`);\n }\n }\n return content;\n }\n\n public toString(): string {\n const content = this.getContent();\n if (this.formatter != null) {\n try {\n return this.formatter.formatSync(content);\n } catch (error) {\n throw new Error(`Failed to format Go file: ${error}\\n${content}`);\n }\n }\n return content;\n }\n\n private getContent(): string {\n const packageStatement = `package ${this.packageName}\\n\\n`;\n const imports = this.stringifyImports();\n return imports.length > 0\n ? `${packageStatement}${imports}\n\n${this.buffer}`\n : packageStatement + this.buffer;\n }\n\n private stringifyImports(): string {\n const result = Object.entries(this.imports)\n .filter(([importPath, _]) => importPath !== this.importPath) // Skip the target import path\n .map(([importPath, alias]) => ` ${alias} \"${importPath}\"`)\n .join(\"\\n\");\n\n return result ? `import (\\n${result}\\n)` : \"\";\n }\n}\n","import { AbstractFormatter, AbstractWriter, NopFormatter } from \"@fern-api/browser-compatible-base-generator\";\nimport { basename } from \"@fern-api/path-utils\";\n\nimport { BaseGoCustomConfigSchema } from \"../../custom-config/BaseGoCustomConfigSchema\";\n\ntype Alias = string;\ntype ImportPath = string;\n\n// Regular expression to match invalid identifier characters\n// according to Go conventions.\nconst INVALID_GO_IDENTIFIER_TOKEN = /[^0-9a-zA-Z_]/g;\n\nconst RESERVED_KEYWORDS = [\n \"break\",\n \"case\",\n \"chan\",\n \"const\",\n \"continue\",\n \"default\",\n \"defer\",\n \"else\",\n \"fallthrough\",\n \"for\",\n \"func\",\n \"go\",\n \"goto\",\n \"if\",\n \"import\",\n \"interface\",\n \"map\",\n \"package\",\n \"range\",\n \"return\",\n \"select\",\n \"struct\",\n \"switch\",\n \"type\",\n \"var\"\n];\n\nexport declare namespace Writer {\n interface Args {\n /* The package name that is being written to */\n packageName: string;\n /* The root import path that is being written to */\n rootImportPath: string;\n /* The import path that is being written to */\n importPath: string;\n /* Custom generator config */\n customConfig: BaseGoCustomConfigSchema;\n /* Formatter used to format Go source files */\n formatter?: AbstractFormatter;\n }\n}\n\nexport class Writer extends AbstractWriter {\n /* The package name that is being written to */\n public packageName: string;\n /* The root import path that is being written to */\n public rootImportPath: string;\n /* The import path that is being written to */\n public importPath: string;\n /* Custom generator config */\n public customConfig: BaseGoCustomConfigSchema;\n /* Formatter used to format Go source files */\n public formatter: AbstractFormatter;\n\n /* Import statements */\n protected imports: Record<ImportPath, Alias> = {};\n\n constructor({ packageName, rootImportPath, importPath, customConfig, formatter }: Writer.Args) {\n super();\n this.packageName = packageName;\n this.rootImportPath = rootImportPath;\n this.importPath = importPath;\n this.customConfig = customConfig;\n this.formatter = formatter ?? new NopFormatter();\n }\n\n /**\n * Adds the given import path to the rolling set, and returns the associated alias\n * that should be used to reference the package. If a conflict exists, we try to use\n * path components to create a unique alias, and only fall back to prepending '_'\n * as a last resort.\n */\n public addImport(importPath: string): string {\n const maybeAlias = this.imports[importPath];\n if (maybeAlias != null) {\n return maybeAlias;\n }\n\n // If this is the root import path and we have a configured packageName, use it\n if (importPath === this.rootImportPath && this.customConfig.packageName != null) {\n this.imports[importPath] = this.customConfig.packageName;\n return this.customConfig.packageName;\n }\n\n const set = new Set<Alias>(Object.values(this.imports));\n const pathElements = importPath.split(\"/\");\n\n // Try using progressively more path components to create a unique alias.\n for (let i = 1; i <= pathElements.length; i++) {\n const elements = pathElements.slice(-i);\n const alias = this.getValidAlias(elements.join(\"\"));\n if (!set.has(alias)) {\n this.imports[importPath] = alias;\n return alias;\n }\n }\n\n // Fall back to prepending '_' until we find a unique alias.\n let alias = this.getValidAlias(basename(importPath));\n while (set.has(alias)) {\n alias = \"_\" + alias;\n }\n this.imports[importPath] = alias;\n return alias;\n }\n\n private isValidAlias(alias: string): boolean {\n return !RESERVED_KEYWORDS.includes(alias);\n }\n\n /**\n * Creates a new valid alias from the given string. Removes all\n * characters not included in the Go identifier grammar.\n *\n * This also removes any trailing '-' elements so the alias is as\n * terse as possible.\n */\n private getValidAlias(s: string): string {\n const split = s.split(\"-\");\n if (split[0] == null) {\n return s;\n }\n const possibleAlias = split.map((part) => part.replace(INVALID_GO_IDENTIFIER_TOKEN, \"\")).join(\"\");\n if (this.isValidAlias(possibleAlias)) {\n return possibleAlias;\n }\n return \"_\" + possibleAlias;\n }\n}\n","import {\n Alias,\n CodeBlock,\n Enum,\n Field,\n File,\n Func,\n FuncInvocation,\n GoTypeReference,\n Identifier,\n Method,\n MethodInvocation,\n Parameter,\n Pointer,\n Selector,\n Struct,\n Switch,\n TypeDeclaration\n} from \"./ast\";\n\nexport function alias(args: Alias.Args): Alias {\n return new Alias(args);\n}\n\nexport function codeblock(arg: CodeBlock.Arg): CodeBlock {\n return new CodeBlock(arg);\n}\n\nexport function enum_(args: Enum.Args): Enum {\n return new Enum(args);\n}\n\nexport function field(args: Field.Args): Field {\n return new Field(args);\n}\n\nexport function file(args: File.Args = {}): File {\n return new File(args);\n}\n\nexport function func(args: Func.Args): Func {\n return new Func(args);\n}\n\nexport function identifier(args: Identifier.Args): Identifier {\n return new Identifier(args);\n}\n\nexport function invokeFunc(args: FuncInvocation.Args): FuncInvocation {\n return new FuncInvocation(args);\n}\n\nexport function invokeMethod(args: MethodInvocation.Args): MethodInvocation {\n return new MethodInvocation(args);\n}\n\nexport function method(args: Method.Args): Method {\n return new Method(args);\n}\n\nexport function parameter(args: Parameter.Args): Parameter {\n return new Parameter(args);\n}\n\nexport function pointer(args: Pointer.Args): Pointer {\n return new Pointer(args);\n}\n\nexport function selector(args: Selector.Args): Selector {\n return new Selector(args);\n}\n\nexport function struct(args: Struct.Args = {}): Struct {\n return new Struct(args);\n}\n\nexport function switch_(args: Switch.Args): Switch {\n return new Switch(args);\n}\n\nexport function typeDeclaration(args: TypeDeclaration.Args): TypeDeclaration {\n return new TypeDeclaration(args);\n}\n\nexport function typeReference(args: GoTypeReference.Args): GoTypeReference {\n return new GoTypeReference(args);\n}\n\nexport {\n Alias,\n CodeBlock,\n Enum,\n Field,\n File,\n Func,\n FuncInvocation,\n GoTypeReference as TypeReference,\n IoReaderTypeReference,\n Method,\n MethodInvocation,\n MultiNode,\n Parameter,\n Pointer,\n Selector,\n Struct,\n type StructField,\n TimeTypeReference,\n Type,\n TypeDeclaration,\n TypeInstantiation,\n UuidTypeReference,\n Writer\n} from \"./ast\";\nexport { AstNode } from \"./ast/core/AstNode\";\n","export { Alias } from \"./Alias\";\nexport { CodeBlock } from \"./CodeBlock\";\nexport { Writer } from \"./core/Writer\";\nexport { Enum } from \"./Enum\";\nexport { Field } from \"./Field\";\nexport { File } from \"././File\";\nexport { Func } from \"./Func\";\nexport { FuncInvocation } from \"./FuncInvocation\";\nexport { GoTypeReference } from \"./GoTypeReference\";\nexport { Identifier } from \"./Identifier\";\nexport { Method } from \"./Method\";\nexport { MethodInvocation } from \"./MethodInvocation\";\nexport { MultiNode } from \"./MultiNode\";\nexport { Parameter } from \"./Parameter\";\nexport { Pointer } from \"./Pointer\";\nexport { Selector } from \"./Selector\";\nexport { Struct } from \"./Struct\";\nexport { Switch } from \"./Switch\";\nexport { IoReaderTypeReference, TimeTypeReference, Type, UuidTypeReference } from \"./Type\";\nexport { TypeDeclaration } from \"./TypeDeclaration\";\nexport { type StructField, TypeInstantiation } from \"./TypeInstantiation\";\n","import { Comment } from \"./Comment\";\nimport { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\nimport { Type } from \"./Type\";\n\nexport declare namespace Alias {\n interface Args {\n /* The name of the alias */\n name: string;\n /* The type of the alias */\n type: Type;\n /* The docs of the alias, if any */\n docs?: string;\n }\n}\n\nexport class Alias extends AstNode {\n public readonly name: string;\n public readonly type: Type;\n public readonly docs: string | undefined;\n\n constructor({ name, type, docs }: Alias.Args) {\n super();\n this.name = name;\n this.type = type;\n this.docs = docs;\n }\n\n public write(writer: Writer): void {\n writer.writeNode(new Comment({ docs: this.docs }));\n writer.write(\"type \");\n writer.write(this.name);\n writer.write(\" = \");\n writer.writeNode(this.type);\n }\n}\n","import { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\n\nexport declare namespace Comment {\n interface Args {\n /* The comment documentation, if any */\n docs?: string;\n }\n}\n\nexport class Comment extends AstNode {\n public readonly docs: string | undefined;\n\n constructor({ docs }: Comment.Args = {}) {\n super();\n this.docs = docs;\n }\n\n public write(writer: Writer): void {\n if (this.docs != null) {\n this.docs.split(\"\\n\").forEach((line) => {\n writer.writeLine(`// ${line}`);\n });\n }\n }\n}\n","import { AbstractAstNode, AbstractFormatter } from \"@fern-api/browser-compatible-base-generator\";\n\nimport { BaseGoCustomConfigSchema } from \"../../custom-config/BaseGoCustomConfigSchema\";\nimport { GoFile } from \"./GoFile\";\n\nexport abstract class AstNode extends AbstractAstNode {\n /**\n * Writes the node to a string.\n */\n public async toStringAsync({\n packageName,\n rootImportPath,\n importPath,\n customConfig,\n formatter\n }: {\n packageName: string;\n rootImportPath: string;\n importPath: string;\n customConfig: BaseGoCustomConfigSchema;\n formatter?: AbstractFormatter;\n }): Promise<string> {\n const file = new GoFile({\n packageName,\n rootImportPath,\n importPath,\n customConfig,\n formatter\n });\n this.write(file);\n return file.toStringAsync();\n }\n\n /**\n * Writes the node to a string.\n */\n public toString({\n packageName,\n rootImportPath,\n importPath,\n customConfig,\n formatter\n }: {\n packageName: string;\n rootImportPath: string;\n importPath: string;\n customConfig: BaseGoCustomConfigSchema;\n formatter?: AbstractFormatter;\n }): string {\n const file = new GoFile({\n packageName,\n rootImportPath,\n importPath,\n customConfig,\n formatter\n });\n this.write(file);\n return file.toString();\n }\n}\n","import { CodeBlock as CommonCodeBlock } from \"@fern-api/browser-compatible-base-generator\";\n\nimport { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\n\nexport declare namespace CodeBlock {\n /* Write arbitrary code */\n type Arg = CommonCodeBlock.Arg<Writer>;\n}\n\nexport class CodeBlock extends AstNode {\n private arg: CodeBlock.Arg;\n\n public constructor(arg: CodeBlock.Arg) {\n super();\n this.arg = arg;\n }\n\n public write(writer: Writer): void {\n const commonCodeBlock = new CommonCodeBlock(this.arg);\n return commonCodeBlock.write(writer);\n }\n}\n","import { Comment } from \"./Comment\";\nimport { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\nimport { Func } from \"./Func\";\nimport { Identifier } from \"./Identifier\";\nimport { Method } from \"./Method\";\nimport { TypeInstantiation } from \"./TypeInstantiation\";\n\nexport declare namespace Enum {\n interface Args {\n /* The name of the Go enum */\n name: string;\n /* The docs of the Go enum, if any */\n docs?: string;\n }\n\n interface Member {\n /* The name of the enum field */\n name: string;\n /* The value of the enum field */\n value: string;\n /* The docs of the Go enum member, if any */\n docs?: string;\n }\n}\n\nexport class Enum extends AstNode {\n public readonly name: string;\n public readonly docs: string | undefined;\n public readonly members: Enum.Member[] = [];\n public readonly methods: Method[] = [];\n\n private constructor_: Func | undefined;\n\n constructor({ name, docs }: Enum.Args) {\n super();\n this.name = name;\n this.docs = docs;\n }\n\n public addConstructor(constructor_: Func): void {\n this.constructor_ = constructor_;\n }\n\n public addMember(member: Enum.Member): void {\n this.members.push(member);\n }\n\n public addMethod(method: Method): void {\n this.methods.push(method);\n }\n\n public write(writer: Writer): void {\n this.writeType({ writer });\n this.writeMembers({ writer });\n this.writeConstructor({ writer });\n this.writeMethods({ writer });\n }\n\n private writeType({ writer }: { writer: Writer }): void {\n writer.writeNode(new Comment({ docs: this.docs }));\n writer.writeLine(`type ${this.name} string`);\n }\n\n private writeMembers({ writer }: { writer: Writer }): void {\n if (this.members.length === 0) {\n return;\n }\n writer.newLine();\n writer.writeLine(\"const (\");\n writer.indent();\n for (const member of this.members) {\n writer.writeNode(new Comment({ docs: member.docs }));\n writer.writeNode(Enum.getMemberIdentifier({ name: this.name, member }));\n writer.write(\" = \");\n writer.writeNode(TypeInstantiation.string(member.value));\n writer.newLine();\n }\n writer.dedent();\n writer.write(\")\");\n }\n\n private writeConstructor({ writer }: { writer: Writer }): void {\n if (this.constructor_ == null) {\n return;\n }\n writer.newLine();\n writer.writeNode(this.constructor_);\n }\n\n private writeMethods({ writer }: { writer: Writer }): void {\n writer.newLine();\n for (const method of this.methods) {\n writer.newLine();\n writer.writeNode(method);\n writer.newLine();\n }\n }\n\n public static getMemberIdentifier({ name, member }: { name: string; member: Enum.Member }): Identifier {\n return new Identifier(`${name}${member.name}`);\n }\n}\n","import { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\n\nexport declare namespace Identifier {\n type Args = string;\n}\n\nexport class Identifier extends AstNode {\n public readonly name: string;\n\n constructor(name: Identifier.Args) {\n super();\n this.name = name;\n }\n\n public write(writer: Writer): void {\n writer.write(this.name);\n }\n}\n","import { assertNever } from \"@fern-api/core-utils\";\n\nimport { CodeBlock } from \"./CodeBlock\";\nimport { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\nimport { FuncInvocation } from \"./FuncInvocation\";\nimport { GoTypeReference } from \"./GoTypeReference\";\nimport { MethodInvocation } from \"./MethodInvocation\";\nimport { Type } from \"./Type\";\n\ntype InternalTypeInstantiation =\n | Any_\n | Bool\n | Bytes\n | Date\n | DateTime\n | Enum\n | Float64\n | Int\n | Int64\n | Map\n | Nil\n | Nop\n | Optional\n | Reference\n | Slice\n | String_\n | Struct\n | Uuid;\n\ninterface Any_ {\n type: \"any\";\n value: unknown;\n}\n\ninterface Bool {\n type: \"bool\";\n value: boolean;\n}\n\ninterface Bytes {\n type: \"bytes\";\n value: string;\n}\n\ninterface Date {\n type: \"date\";\n value: string;\n}\n\ninterface DateTime {\n type: \"dateTime\";\n value: string;\n}\n\ninterface Enum {\n type: \"enum\";\n typeReference: GoTypeReference;\n}\n\ninterface Float64 {\n type: \"float64\";\n value: number;\n}\n\ninterface Int {\n type: \"int\";\n value: number;\n}\n\ninterface Int64 {\n type: \"int64\";\n value: number;\n}\n\ninterface Optional {\n type: \"optional\";\n value: TypeInstantiation;\n}\n\ninterface Map {\n type: \"map\";\n keyType: Type;\n valueType: Type;\n entries: MapEntry[];\n}\n\ninterface MapEntry {\n key: TypeInstantiation;\n value: TypeInstantiation;\n}\n\ninterface Nil {\n type: \"nil\";\n}\n\ninterface Nop {\n type: \"nop\";\n}\n\ninterface Reference {\n type: \"reference\";\n value: AstNode;\n}\n\ninterface Slice {\n type: \"slice\";\n valueType: Type;\n values: TypeInstantiation[];\n}\n\ninterface Struct {\n type: \"struct\";\n typeReference: AstNode;\n fields: StructField[];\n generics?: Type[];\n}\n\nexport interface StructField {\n name: string;\n value: TypeInstantiation;\n}\n\ninterface String_ {\n type: \"string\";\n value: string;\n}\n\ninterface Uuid {\n type: \"uuid\";\n value: string;\n}\n\nconst POINTER_HELPER_TYPES = new Set<string>([\"bool\", \"date\", \"dateTime\", \"float64\", \"int\", \"int64\", \"string\", \"uuid\"]);\nconst ADDRESSABLE_TYPES = new Set<string>([\"any\", \"bytes\", \"map\", \"slice\"]);\n\nexport class TypeInstantiation extends AstNode {\n private constructor(public readonly internalType: InternalTypeInstantiation) {\n super();\n }\n\n public write(writer: Writer): void {\n switch (this.internalType.type) {\n case \"any\":\n this.writeAny({ writer, value: this.internalType.value });\n break;\n case \"bool\":\n writer.write(this.internalType.value.toString());\n break;\n case \"bytes\":\n writer.write(`[]byte(\"${this.internalType.value}\")`);\n break;\n case \"date\":\n case \"dateTime\":\n writer.writeNode(invokeMustParseDate({ writer, type: this.internalType }));\n break;\n case \"enum\":\n writer.writeNode(this.internalType.typeReference);\n break;\n case \"float64\":\n writer.write(this.internalType.value.toString());\n break;\n case \"int\":\n case \"int64\":\n writer.write(this.internalType.value.toString());\n break;\n case \"map\":\n this.writeMap({ writer, map: this.internalType });\n break;\n case \"nil\":\n writer.write(\"nil\");\n break;\n case \"nop\":\n break; // no-op\n case \"optional\":\n this.writeOptional({ writer, type: this.internalType.value });\n break;\n case \"reference\":\n writer.writeNode(this.internalType.value);\n break;\n case \"slice\":\n this.writeSlice({ writer, slice: this.internalType });\n break;\n case \"string\":\n writer.write(\n this.internalType.value.includes('\"') || this.internalType.value.includes(\"\\n\")\n ? `\\`${this.internalType.value}\\``\n : `\"${this.internalType.value}\"`\n );\n break;\n case \"struct\":\n this.writeStruct({ writer, struct: this.internalType });\n break;\n case \"uuid\":\n writer.writeNode(invokeMustParseUUID({ value: this.internalType.value }));\n break;\n default:\n assertNever(this.internalType);\n }\n }\n\n /* Static factory methods for creating a TypeInstantiation */\n public static any(value: unknown): TypeInstantiation {\n return new this({\n type: \"any\",\n value\n });\n }\n\n public static bool(value: boolean): TypeInstantiation {\n return new this({\n type: \"bool\",\n value\n });\n }\n\n public static bytes(value: string): TypeInstantiation {\n return new this({\n type: \"bytes\",\n value\n });\n }\n\n public static date(value: string): TypeInstantiation {\n return new this({\n type: \"date\",\n value\n });\n }\n\n public static dateTime(value: string): TypeInstantiation {\n return new this({\n type: \"dateTime\",\n value\n });\n }\n\n public static enum(typeReference: GoTypeReference): TypeInstantiation {\n return new this({\n type: \"enum\",\n typeReference\n });\n }\n\n public static float64(value: number): TypeInstantiation {\n return new this({\n type: \"float64\",\n value\n });\n }\n\n public static int(value: number): TypeInstantiation {\n return new this({\n type: \"int\",\n value\n });\n }\n\n public static int64(value: number): TypeInstantiation {\n return new this({\n type: \"int64\",\n value\n });\n }\n\n public static map({\n keyType,\n valueType,\n entries\n }: {\n keyType: Type;\n valueType: Type;\n entries: MapEntry[];\n }): TypeInstantiation {\n return new this({\n type: \"map\",\n keyType,\n valueType,\n entries\n });\n }\n\n public static nil(): TypeInstantiation {\n return new this({\n type: \"nil\"\n });\n }\n\n public static nop(): TypeInstantiation {\n return new this({\n type: \"nop\"\n });\n }\n\n public static optional(value: TypeInstantiation): TypeInstantiation {\n if (this.isAlreadyOptional(value)) {\n // Avoids double optional.\n return value;\n }\n return new this({\n type: \"optional\",\n value\n });\n }\n\n public static reference(value: AstNode): TypeInstantiation {\n return new this({\n type: \"reference\",\n value\n });\n }\n\n public static slice({ valueType, values }: { valueType: Type; values: TypeInstantiation[] }): TypeInstantiation {\n return new this({\n type: \"slice\",\n valueType,\n values\n });\n }\n\n public static string(value: string): TypeInstantiation {\n return new this({\n type: \"string\",\n value\n });\n }\n\n public static struct({\n typeReference,\n fields\n }: {\n typeReference: AstNode;\n fields: StructField[];\n }): TypeInstantiation {\n return new this({\n type: \"struct\",\n typeReference,\n fields\n });\n }\n\n public static structPointer({\n typeReference,\n fields,\n generics\n }: {\n typeReference: AstNode;\n fields: StructField[];\n generics?: Type[];\n }): TypeInstantiation {\n return new this({\n type: \"optional\",\n value: new this({\n type: \"struct\",\n typeReference,\n fields,\n generics\n })\n });\n }\n\n public static uuid(value: string): TypeInstantiation {\n return new this({\n type: \"uuid\",\n value\n });\n }\n\n public static isNop(typeInstantiation: TypeInstantiation): boolean {\n if (typeInstantiation.internalType.type === \"optional\") {\n return this.isNop(typeInstantiation.internalType.value);\n }\n return typeInstantiation.internalType.type === \"nop\";\n }\n\n private writeAny({ writer, value }: { writer: Writer; value: unknown }): void {\n switch (typeof value) {\n case \"boolean\":\n writer.write(value.toString());\n return;\n case \"string\":\n writer.write(value.includes('\"') ? `\\`${value}\\`` : `\"${value}\"`);\n return;\n case \"number\":\n writer.write(value.toString());\n return;\n case \"object\":\n if (value == null) {\n writer.write(\"nil\");\n return;\n }\n if (Array.isArray(value)) {\n this.writeAnyArray({ writer, value });\n return;\n }\n this.writeAnyObject({ writer, value });\n return;\n default:\n throw new Error(`Internal error; unsupported unknown type: ${typeof value}`);\n }\n }\n\n private writeAnyArray({\n writer,\n value\n }: {\n writer: Writer;\n // biome-ignore lint/suspicious/noExplicitAny: allow\n value: any[];\n }): void {\n writer.write(\"[]any\");\n if (value.length === 0) {\n writer.write(\"{}\");\n return;\n }\n writer.writeLine(\"{\");\n writer.indent();\n for (const element of value) {\n writer.writeNode(TypeInstantiation.any(element));\n writer.writeLine(\",\");\n }\n writer.dedent();\n writer.write(\"}\");\n }\n\n private writeAnyObject({ writer, value }: { writer: Writer; value: object }): void {\n writer.write(\"map[string]any\");\n const entries = Object.entries(value);\n if (entries.length === 0) {\n writer.write(\"{}\");\n return;\n }\n writer.writeLine(\"{\");\n writer.indent();\n for (const [key, val] of entries) {\n writer.write(`\"${key}\": `);\n writer.writeNode(TypeInstantiation.any(val));\n writer.writeLine(\",\");\n }\n writer.dedent();\n writer.write(\"}\");\n }\n\n private writeMap({ writer, map }: { writer: Writer; map: Map }): void {\n writer.write(\"map[\");\n writer.writeNode(map.keyType);\n writer.write(\"]\");\n writer.writeNode(map.valueType);\n\n const entries = filterNopMapEntries({ entries: map.entries });\n if (entries.length === 0) {\n writer.write(\"{}\");\n return;\n }\n\n writer.writeLine(\"{\");\n writer.indent();\n for (const entry of entries) {\n entry.key.write(writer);\n writer.write(\": \");\n entry.value.write(writer);\n writer.writeLine(\",\");\n }\n writer.dedent();\n writer.write(\"}\");\n }\n\n private writeOptional({ writer, type }: { writer: Writer; type: TypeInstantiation }): void {\n if (POINTER_HELPER_TYPES.has(type.internalType.type)) {\n writer.writeNode(invokePointerHelper({ writer, type }));\n return;\n }\n if (ADDRESSABLE_TYPES.has(type.internalType.type)) {\n type.write(writer);\n return;\n }\n if (type.internalType.type === \"enum\") {\n writer.writeNode(\n new MethodInvocation({\n on: type.internalType.typeReference,\n method: \"Ptr\",\n arguments_: []\n })\n );\n return;\n }\n writer.write(\"&\");\n type.write(writer);\n }\n\n private static isAlreadyOptional(value: TypeInstantiation) {\n return value.internalType.type === \"optional\" || ADDRESSABLE_TYPES.has(value.internalType.type);\n }\n\n private writeSlice({ writer, slice }: { writer: Writer; slice: Slice }): void {\n writer.write(\"[]\");\n writer.writeNode(slice.valueType);\n\n const values = filterNopValues({ values: slice.values });\n if (values.length === 0) {\n writer.write(\"{}\");\n return;\n }\n\n writer.writeLine(\"{\");\n writer.indent();\n for (const value of values) {\n value.write(writer);\n writer.writeLine(\",\");\n }\n writer.dedent();\n writer.write(\"}\");\n }\n\n private writeStruct({ writer, struct }: { writer: Writer; struct: Struct }): void {\n writer.writeNode(struct.typeReference);\n\n if (struct.generics != null) {\n writer.write(\"[\");\n struct.generics.forEach((generic, index) => {\n if (index > 0) {\n writer.write(\", \");\n }\n writer.writeNode(generic);\n });\n writer.write(\"]\");\n }\n\n const fields = filterNopStructFields({ fields: struct.fields });\n if (fields.length === 0) {\n writer.write(\"{}\");\n return;\n }\n\n writer.writeLine(\"{\");\n writer.indent();\n for (const field of fields) {\n writer.write(`${field.name}: `);\n field.value.write(writer);\n writer.writeLine(\",\");\n }\n writer.dedent();\n writer.write(\"}\");\n }\n}\n\nfunction invokePointerHelper({ writer, type }: { writer: Writer; type: TypeInstantiation }): FuncInvocation {\n return new FuncInvocation({\n func: new GoTypeReference({\n name: getPointerHelperFuncName({ type }),\n importPath: writer.rootImportPath\n }),\n arguments_: [type]\n });\n}\n\nfunction getPointerHelperFuncName({ type }: { type: TypeInstantiation }): string {\n switch (type.internalType.type) {\n case \"bool\":\n return \"Bool\";\n case \"date\":\n case \"dateTime\":\n return \"Time\";\n case \"float64\":\n return \"Float64\";\n case \"int\":\n return \"Int\";\n case \"int64\":\n return \"Int64\";\n case \"string\":\n return \"String\";\n case \"uuid\":\n return \"UUID\";\n default:\n return \"\";\n }\n}\n\nfunction invokeMustParseDate({ writer, type }: { writer: Writer; type: Date | DateTime }): FuncInvocation {\n const funcName = type.type === \"date\" ? \"MustParseDate\" : \"MustParseDateTime\";\n return new FuncInvocation({\n func: new GoTypeReference({\n name: funcName,\n importPath: writer.rootImportPath\n }),\n arguments_: [new CodeBlock(`\"${type.value}\"`)]\n });\n}\n\nfunction invokeMustParseUUID({ value }: { value: string }): FuncInvocation {\n return new FuncInvocation({\n func: new GoTypeReference({\n name: \"MustParse\",\n importPath: \"github.com/google/uuid\"\n }),\n arguments_: [new CodeBlock(`\"${value}\"`)]\n });\n}\n\nfunction filterNopMapEntries({ entries }: { entries: MapEntry[] }): MapEntry[] {\n return entries.filter((entry) => !TypeInstantiation.isNop(entry.key) && !TypeInstantiation.isNop(entry.value));\n}\n\nfunction filterNopStructFields({ fields }: { fields: StructField[] }): StructField[] {\n return fields.filter((field) => !TypeInstantiation.isNop(field.value));\n}\n\nfunction filterNopValues({ values }: { values: TypeInstantiation[] }): TypeInstantiation[] {\n return values.filter((value) => !TypeInstantiation.isNop(value));\n}\n","import { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\nimport { GoTypeReference } from \"./GoTypeReference\";\nimport { writeArguments } from \"./utils/writeArguments\";\n\nexport declare namespace FuncInvocation {\n interface Args {\n /* The function to invoke */\n func: GoTypeReference;\n /* The arguments passed to the method */\n arguments_: AstNode[];\n /* Whether to write the invocation on multiple lines */\n multiline?: boolean;\n }\n}\n\nexport class FuncInvocation extends AstNode {\n private func: GoTypeReference;\n private arguments_: AstNode[];\n private multiline: boolean | undefined;\n\n constructor({ func, arguments_, multiline = true }: FuncInvocation.Args) {\n super();\n\n this.func = func;\n this.arguments_ = arguments_;\n this.multiline = multiline;\n }\n\n public write(writer: Writer): void {\n writer.writeNode(this.func);\n writeArguments({ writer, arguments_: this.arguments_, multiline: this.multiline });\n }\n}\n","import { UnnamedArgument } from \"@fern-api/browser-compatible-base-generator\";\nimport { Writer } from \"../core/Writer\";\nimport { TypeInstantiation } from \"../TypeInstantiation\";\n\nexport function writeArguments({\n writer,\n arguments_,\n multiline = true\n}: {\n writer: Writer;\n arguments_: UnnamedArgument[];\n multiline?: boolean;\n}): void {\n const modifiedArguments = arguments_.map((argument) => {\n // A nop argument (optional type reference) cannot be omitted (like in a struct literal type instantation with omitempty)\n // but must be replaced with nil\n if (argument instanceof TypeInstantiation && TypeInstantiation.isNop(argument)) {\n return TypeInstantiation.nil();\n }\n return argument;\n });\n if (modifiedArguments.length === 0) {\n writer.write(\"()\");\n return;\n }\n if (multiline) {\n writeMultiline({ writer, arguments_: modifiedArguments });\n return;\n }\n writeCompact({ writer, arguments_: modifiedArguments });\n}\n\nfunction writeMultiline({ writer, arguments_ }: { writer: Writer; arguments_: UnnamedArgument[] }): void {\n writer.writeLine(\"(\");\n writer.indent();\n for (const argument of arguments_) {\n argument.write(writer);\n writer.writeLine(\",\");\n }\n writer.dedent();\n writer.write(\")\");\n}\n\nfunction writeCompact({ writer, arguments_ }: { writer: Writer; arguments_: UnnamedArgument[] }): void {\n writer.write(\"(\");\n arguments_.forEach((argument, index) => {\n if (index > 0) {\n writer.write(\", \");\n }\n argument.write(writer);\n });\n writer.write(\")\");\n}\n","import { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\nimport { Type } from \"./Type\";\nimport { writeGenerics } from \"./utils/writeGenerics\";\n\nexport declare namespace GoTypeReference {\n interface Args {\n /* The name of the Go type */\n name: string;\n /* The import path of the Go type */\n importPath?: string;\n /* The generic type parameters, if any */\n generics?: Type[] | undefined;\n }\n}\n\nexport class GoTypeReference extends AstNode {\n public readonly name: string;\n public readonly importPath: string | undefined;\n public readonly generics: Type[] | undefined;\n\n constructor({ name, importPath, generics }: GoTypeReference.Args) {\n super();\n this.name = name;\n this.importPath = importPath;\n this.generics = generics;\n }\n\n public write(writer: Writer): void {\n if (this.importPath == null || writer.importPath === this.importPath) {\n writer.write(this.name);\n return;\n }\n const alias = writer.addImport(this.importPath);\n writer.write(`${alias}.${this.name}`);\n if (this.generics != null) {\n writeGenerics({ writer, generics: this.generics });\n }\n }\n}\n","import { Writer } from \"../core/Writer\";\nimport { Type } from \"../Type\";\n\nexport function writeGenerics({ writer, generics }: { writer: Writer; generics: Type[] }): void {\n if (generics.length === 0) {\n return;\n }\n writer.write(\"[\");\n generics.forEach((generic, idx) => {\n if (idx > 0) {\n writer.write(\", \");\n }\n if (generic != null) {\n writer.writeNode(generic);\n }\n });\n writer.write(\"]\");\n}\n","import { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\nimport { writeArguments } from \"./utils/writeArguments\";\n\nexport declare namespace MethodInvocation {\n interface Args {\n /* The instance to invoke the method on */\n on: AstNode;\n /* The method to invoke */\n method: string;\n /* The arguments passed to the method */\n arguments_: AstNode[];\n /* Whether to write the invocation on multiple lines */\n multiline?: boolean;\n }\n}\n\nexport class MethodInvocation extends AstNode {\n private on: AstNode;\n private method: string;\n private arguments_: AstNode[];\n private multiline: boolean | undefined;\n\n constructor({ method, arguments_, on, multiline }: MethodInvocation.Args) {\n super();\n\n this.on = on;\n this.method = method;\n this.arguments_ = arguments_;\n this.multiline = multiline;\n }\n\n public write(writer: Writer): void {\n this.on.write(writer);\n writer.write(\".\");\n writer.write(this.method);\n writeArguments({ writer, arguments_: this.arguments_, multiline: this.multiline });\n }\n}\n","import { Comment } from \"./Comment\";\nimport { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\nimport { Type } from \"./Type\";\n\nexport declare namespace Field {\n interface Args {\n /* The name of the field */\n name: string;\n /* The type of the field */\n type: Type;\n /* The docs of the field, if any */\n docs?: string;\n /* The tags of the field, if any */\n tags?: Tag[];\n }\n\n interface Tag {\n /* The name of the tag */\n name: string;\n /* The value of the tag */\n value: string;\n }\n}\n\nexport class Field extends AstNode {\n public readonly name: string;\n public readonly type: Type;\n\n private docs: string | undefined;\n private tags: Field.Tag[] = [];\n\n constructor({ name, type, docs, tags }: Field.Args) {\n super();\n this.name = name;\n this.type = type;\n this.docs = docs;\n this.tags = tags ?? [];\n }\n\n public addTags(...tags: Field.Tag[]): void {\n this.tags.push(...tags);\n }\n\n public write(writer: Writer): void {\n writer.writeNode(new Comment({ docs: this.docs }));\n writer.write(`${this.name} `);\n this.type.write(writer);\n this.writeTags({ writer });\n }\n\n private writeTags({ writer }: { writer: Writer }): void {\n if (this.tags.length === 0) {\n return;\n }\n writer.write(\" `\");\n this.tags.forEach((tag, index) => {\n if (index > 0) {\n writer.write(\" \");\n }\n writer.write(`${tag.name}:\"${tag.value}\"`);\n });\n writer.write(\"`\");\n }\n}\n","import { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\n\nexport declare namespace File {\n interface Args {\n /* The list of nodes in the file. */\n nodes?: AstNode[];\n }\n}\n\nexport class File extends AstNode {\n public readonly nodes: AstNode[];\n\n constructor({ nodes }: File.Args = { nodes: [] }) {\n super();\n this.nodes = nodes ?? [];\n }\n\n public add(...nodes: AstNode[]): void {\n this.nodes.push(...nodes);\n }\n\n public write(writer: Writer): void {\n for (const node of this.nodes) {\n node.write(writer);\n }\n }\n}\n","import { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\nimport { Method } from \"./Method\";\nimport { Parameter } from \"./Parameter\";\nimport { Type } from \"./Type\";\n\nexport declare namespace Func {\n type Args = Omit<Method.Args, \"typeReference\">;\n}\n\nexport class Func extends AstNode {\n private func: Method;\n\n constructor({ name, parameters, return_, body, docs, multiline }: Func.Args) {\n super();\n this.func = new Method({ name, parameters, return_, body, docs, multiline });\n }\n\n public get parameters(): Parameter[] {\n return this.func.parameters;\n }\n\n public get return_(): Type[] {\n return this.func.return_;\n }\n\n public get name(): string | undefined {\n return this.func.name;\n }\n\n public get body(): AstNode | undefined {\n return this.func.body;\n }\n\n public get docs(): string | undefined {\n return this.func.docs;\n }\n\n public write(writer: Writer): void {\n writer.writeNode(this.func);\n }\n}\n","import { Comment } from \"./Comment\";\nimport { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\nimport { GoTypeReference } from \"./GoTypeReference\";\nimport { Parameter } from \"./Parameter\";\nimport { Type } from \"./Type\";\nimport { writeArguments } from \"./utils/writeArguments\";\n\nexport declare namespace Method {\n interface Args {\n /* The parameters of the method */\n parameters: Parameter[];\n /* The return type of the method */\n return_: Type[];\n /* The name of the method */\n name?: string;\n /* The body of the method */\n body?: AstNode;\n /* Documentation for the method */\n docs?: string;\n /* The class this method belongs to, if any */\n typeReference?: GoTypeReference;\n /* Whether to write the invocation on multiple lines */\n multiline?: boolean;\n /* The custom name of the receiver, if any */\n receiver?: string;\n /* Whether this method should use a pointer receiver */\n pointerReceiver?: boolean;\n }\n}\n\nexport class Method extends AstNode {\n public readonly parameters: Parameter[];\n public readonly return_: Type[];\n public readonly name: string | undefined;\n public readonly body: AstNode | undefined;\n public readonly docs: string | undefined;\n public readonly typeReference: GoTypeReference | undefined;\n public readonly multiline: boolean | undefined;\n public readonly receiver: string | undefined;\n public readonly pointerReceiver: boolean | undefined;\n\n constructor({\n name,\n parameters,\n return_,\n body,\n docs,\n typeReference,\n multiline,\n receiver,\n pointerReceiver\n }: Method.Args) {\n super();\n this.name = name;\n this.parameters = parameters;\n this.return_ = return_;\n this.body = body;\n this.docs = docs;\n this.typeReference = typeReference;\n this.multiline = multiline;\n this.receiver = receiver;\n this.pointerReceiver = pointerReceiver;\n }\n\n public write(writer: Writer): void {\n writer.writeNode(new Comment({ docs: this.docs }));\n writer.write(\"func\");\n if (this.typeReference != null) {\n this.writeReceiver({ writer, typeReference: this.typeReference, receiver: this.receiver });\n }\n if (this.name != null) {\n writer.write(` ${this.name}`);\n }\n writeArguments({\n writer,\n arguments_: this.parameters,\n multiline: this.multiline\n });\n if (this.return_ != null) {\n writer.write(\" \");\n if (this.return_.length > 1) {\n writer.write(\"(\");\n }\n this.return_.forEach((returnType, index) => {\n if (index > 0) {\n writer.write(\", \");\n }\n writer.writeNode(returnType);\n });\n if (this.return_.length > 1) {\n writer.write(\")\");\n }\n }\n writer.writeLine(\"{\");\n writer.indent();\n this.body?.write(writer);\n writer.dedent();\n writer.writeNewLineIfLastLineNot();\n writer.write(\"}\");\n }\n\n private writeReceiver({\n writer,\n typeReference,\n receiver\n }: {\n writer: Writer;\n typeReference: GoTypeReference;\n receiver?: string;\n }): void {\n writer.write(` (${this.getReceiverName({ typeReference, receiver })} `);\n if (this.pointerReceiver) {\n writer.write(\"*\");\n }\n typeReference.write(writer);\n writer.write(\")\");\n }\n\n private getReceiverName({\n typeReference,\n receiver\n }: {\n typeReference: GoTypeReference;\n receiver?: string;\n }): string {\n if (receiver != null) {\n return receiver;\n }\n return typeReference.name.charAt(0).toLowerCase();\n }\n}\n","import { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\n\nexport declare namespace MultiNode {\n interface Args {\n nodes: AstNode[];\n }\n}\n\nexport class MultiNode extends AstNode {\n public readonly nodes: AstNode[];\n\n constructor({ nodes }: MultiNode.Args) {\n super();\n this.nodes = nodes;\n }\n\n public write(writer: Writer): void {\n for (const node of this.nodes) {\n writer.newLine();\n node.write(writer);\n writer.newLine();\n }\n }\n}\n","import { Comment } from \"./Comment\";\nimport { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\nimport { Type } from \"./Type\";\n\nexport declare namespace Parameter {\n interface Args {\n /* The name of the parameter */\n name: string;\n /* The type of the parameter */\n type: Type;\n /* The docs of the parameter, if any */\n docs?: string;\n }\n}\n\nexport class Parameter extends AstNode {\n public readonly name: string;\n public readonly type: Type;\n public readonly docs: string | undefined;\n\n constructor({ name, type, docs }: Parameter.Args) {\n super();\n this.name = name;\n this.type = type;\n this.docs = docs;\n }\n\n public write(writer: Writer): void {\n writer.writeNode(new Comment({ docs: this.docs }));\n writer.write(`${this.name} `);\n this.type.write(writer);\n }\n}\n","import { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\n\nexport declare namespace Pointer {\n interface Args {\n /* The value of the pointer */\n node: AstNode;\n }\n}\n\nexport class Pointer extends AstNode {\n public readonly node: AstNode;\n\n constructor({ node }: Pointer.Args) {\n super();\n this.node = node;\n }\n\n public write(writer: Writer): void {\n writer.write(\"*\");\n this.node.write(writer);\n }\n}\n","import { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\n\nexport declare namespace Selector {\n interface Args {\n /* The node to select from */\n on: AstNode;\n /* The node to select (e.g. a field name) */\n selector: AstNode;\n }\n}\n\nexport class Selector extends AstNode {\n public readonly on: AstNode;\n public readonly selector: AstNode;\n\n constructor({ on, selector }: Selector.Args) {\n super();\n this.on = on;\n this.selector = selector;\n }\n\n public write(writer: Writer): void {\n writer.writeNode(this.on);\n writer.write(\".\");\n writer.writeNode(this.selector);\n }\n}\n","import { Comment } from \"./Comment\";\nimport { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\nimport { Field } from \"./Field\";\nimport { GoTypeReference } from \"./GoTypeReference\";\nimport { Method } from \"./Method\";\nimport { Parameter } from \"./Parameter\";\n\nexport declare namespace Struct {\n interface Args {\n /* The name of the Go struct. If not provided, the struct is anonymous. */\n name?: string;\n /* Embedded types defined within the struct. */\n embeds?: GoTypeReference[];\n /* Fields defined within the struct. */\n fields?: Field[];\n /* Docs associated with the struct. */\n docs?: string;\n }\n\n interface Constructor {\n parameters: Parameter[];\n body: AstNode;\n /* Overrides the default name of the constructor. */\n name?: string;\n }\n}\n\nexport class Struct extends AstNode {\n public readonly name: string | undefined;\n public readonly embeds: GoTypeReference[] = [];\n public readonly fields: Field[] = [];\n public readonly docs: string | undefined;\n public readonly methods: Method[] = [];\n public constructor_: Struct.Constructor | undefined;\n\n constructor({ name, embeds, fields, docs }: Struct.Args) {\n super();\n this.name = name;\n this.docs = docs;\n this.embeds = embeds ?? [];\n this.fields = fields ?? [];\n }\n\n public addConstructor(constructor: Struct.Constructor): void {\n this.constructor_ = constructor;\n }\n\n public addField(...fields: Field[]): void {\n this.fields.push(...fields);\n }\n\n public addMethod(...methods: Method[]): void {\n this.methods.push(...methods);\n }\n\n public write(writer: Writer): void {\n this.writeType({ writer });\n if (this.constructor_ != null) {\n writer.newLine();\n writer.newLine();\n this.writeConstructor({ writer, constructor: this.constructor_ });\n }\n this.writeMethods({ writer });\n }\n\n private writeType({ writer }: { writer: Writer }): void {\n writer.writeNode(new Comment({ docs: this.docs }));\n if (this.name != null) {\n writer.write(`type ${this.name} struct {`);\n } else {\n writer.write(`struct{`);\n }\n if (this.embeds.length === 0 && this.fields.length === 0) {\n writer.writeLine(\"}\");\n return;\n }\n writer.newLine();\n writer.indent();\n for (const embed of this.embeds) {\n writer.writeNode(embed);\n writer.newLine();\n }\n const exportedFields = this.fields.filter((field) => this.isExported(field));\n for (const field of exportedFields) {\n writer.writeNode(field);\n writer.newLine();\n }\n const unexportedFields = this.fields.filter((field) => !this.isExported(field));\n if (exportedFields.length > 0 && unexportedFields.length > 0) {\n // Exported fields are grouped separately from unexported fields.\n writer.newLine();\n }\n for (const field of unexportedFields) {\n writer.writeNode(field);\n writer.newLine();\n }\n writer.dedent();\n writer.write(\"}\");\n }\n\n private writeConstructor({ writer, constructor }: { writer: Writer; constructor: Struct.Constructor }): void {\n if (constructor.name != null) {\n writer.write(`func ${constructor.name}(`);\n } else {\n writer.write(`func New${this.name}(`);\n }\n constructor.parameters.forEach((parameter, index) => {\n if (index > 0) {\n writer.write(\", \");\n }\n writer.writeNode(parameter);\n });\n writer.write(`) *${this.name} {`);\n writer.newLine();\n writer.indent();\n writer.writeNode(constructor.body);\n writer.writeNewLineIfLastLineNot();\n writer.dedent();\n writer.writeLine(\"}\");\n }\n\n private writeMethods({ writer }: { writer: Writer }): void {\n if (this.methods.length === 0) {\n return;\n }\n writer.writeNewLineIfLastLineNot();\n for (const method of this.methods) {\n writer.newLine();\n writer.writeNode(method);\n writer.newLine();\n }\n }\n\n private isExported(field: Field): boolean {\n const char = field.name.charAt(0);\n return char === char.toUpperCase();\n }\n}\n","import { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\nimport { Identifier } from \"./Identifier\";\n\nexport declare namespace Switch {\n interface Args {\n /* The expression to switch on */\n on: AstNode;\n /* The cases of the switch */\n cases: Case[];\n /* The default case, if any */\n default?: AstNode;\n }\n\n interface Case {\n on: AstNode;\n body: AstNode;\n }\n}\n\nexport class Switch extends AstNode {\n public readonly on: AstNode;\n public readonly cases: Switch.Case[];\n public readonly default: AstNode | undefined;\n\n constructor({ on, cases, default: default_ }: Switch.Args) {\n super();\n this.on = on;\n this.cases = cases;\n this.default = default_;\n }\n\n public write(writer: Writer): void {\n const cases = this.cases;\n if (this.default != null) {\n cases.push({\n on: new Identifier(\"default\"),\n body: this.default\n });\n }\n writer.write(\"switch \");\n writer.writeNode(this.on);\n writer.writeLine(\"{\");\n writer.indent();\n for (const case_ of cases) {\n writer.write(\"case \");\n writer.writeNode(case_.on);\n writer.writeLine(\":\");\n writer.indent();\n writer.writeNode(case_.body);\n writer.dedent();\n writer.writeNewLineIfLastLineNot();\n }\n writer.dedent();\n writer.write(\"}\");\n }\n}\n","import { assertNever } from \"@fern-api/core-utils\";\nimport { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\nimport { GoTypeReference } from \"./GoTypeReference\";\n\ntype InternalType =\n | Any_\n | Bool\n | Bytes\n | Float64\n | Date\n | DateTime\n | Error_\n | Int\n | Int64\n | Map\n | Optional\n | Reference\n | Slice\n | String_\n | Uuid\n | Variadic;\n\ninterface Any_ {\n type: \"any\";\n}\n\ninterface Bool {\n type: \"bool\";\n}\n\ninterface Bytes {\n type: \"bytes\";\n}\n\ninterface Float64 {\n type: \"float64\";\n}\n\ninterface Date {\n type: \"date\";\n}\n\ninterface Error_ {\n type: \"error\";\n}\n\ninterface DateTime {\n type: \"dateTime\";\n}\n\ninterface Int {\n type: \"int\";\n}\n\ninterface Int64 {\n type: \"int64\";\n}\n\ninterface Map {\n type: \"map\";\n keyType: Type;\n valueType: Type;\n}\n\ninterface Optional {\n type: \"optional\";\n value: Type;\n}\n\ninterface Reference {\n type: \"reference\";\n value: GoTypeReference;\n}\n\ninterface Slice {\n type: \"slice\";\n value: Type;\n}\n\ninterface String_ {\n type: \"string\";\n}\n\ninterface Uuid {\n type: \"uuid\";\n}\n\ninterface Variadic {\n type: \"variadic\";\n value: Type;\n}\n\nconst NILABLE_TYPES = new Set<string>([\"any\", \"bytes\", \"map\", \"slice\"]);\n\nexport class Type extends AstNode {\n private constructor(public readonly internalType: InternalType) {\n super();\n }\n\n public write(writer: Writer, { comment }: { comment?: boolean } = {}): void {\n switch (this.internalType.type) {\n case \"any\":\n writer.write(\"any\");\n break;\n case \"bool\":\n writer.write(\"bool\");\n break;\n case \"bytes\":\n writer.write(\"[]byte\");\n break;\n case \"date\":\n case \"dateTime\":\n writer.writeNode(TimeTypeReference);\n break;\n case \"error\":\n writer.write(\"error\");\n break;\n case \"float64\":\n writer.write(\"float64\");\n break;\n case \"int\":\n writer.write(\"int\");\n break;\n case \"int64\":\n writer.write(\"int64\");\n break;\n case \"map\": {\n writer.write(\"map[\");\n this.internalType.keyType.write(writer);\n writer.write(\"]\");\n this.internalType.valueType.write(writer);\n break;\n }\n case \"optional\": {\n writer.write(\"*\");\n this.internalType.value.write(writer);\n break;\n }\n case \"reference\":\n writer.writeNode(this.internalType.value);\n break;\n case \"slice\":\n writer.write(\"[]\");\n this.internalType.value.write(writer);\n break;\n case \"string\":\n writer.write(\"string\");\n break;\n case \"uuid\":\n writer.writeNode(UuidTypeReference);\n break;\n case \"variadic\":\n writer.write(\"...\");\n this.internalType.value.write(writer);\n break;\n default:\n assertNever(this.internalType);\n }\n }\n\n public isOptional(): boolean {\n return this.internalType.type === \"optional\";\n }\n\n public isIterable(): boolean {\n return this.internalType.type === \"slice\" || this.internalType.type === \"variadic\";\n }\n\n public iterableElement(): Type | undefined {\n if (this.internalType.type === \"slice\" || this.internalType.type === \"variadic\") {\n return this.internalType.value;\n }\n return undefined;\n }\n\n public underlying(): Type {\n if (this.internalType.type === \"optional\") {\n return this.internalType.value;\n }\n return this;\n }\n\n /* Static factory methods for creating a Type */\n public static any(): Type {\n return new this({\n type: \"any\"\n });\n }\n\n public static bool(): Type {\n return new this({\n type: \"bool\"\n });\n }\n\n public static bytes(): Type {\n return new this({\n type: \"bytes\"\n });\n }\n\n public static date(): Type {\n return new this({\n type: \"date\"\n });\n }\n\n public static dateTime(): Type {\n return new this({\n type: \"dateTime\"\n });\n }\n\n public static dereference(value: Type): Type {\n if (value.internalType.type === \"optional\") {\n return value.internalType.value;\n }\n return value;\n }\n\n public static error(): Type {\n return new this({\n type: \"error\"\n });\n }\n\n public static float64(): Type {\n return new this({\n type: \"float64\"\n });\n }\n\n public static int(): Type {\n return new this({\n type: \"int\"\n });\n }\n\n public static int64(): Type {\n return new this({\n type: \"int64\"\n });\n }\n\n public static map(keyType: Type, valueType: Type): Type {\n return new this({\n type: \"map\",\n keyType,\n valueType\n });\n }\n\n public static optional(value: Type): Type {\n if (this.isAlreadyOptional(value)) {\n // Avoids double optional.\n return value;\n }\n return new this({\n type: \"optional\",\n value\n });\n }\n\n public static pointer(value: Type): Type {\n // Specifying a pointer is equivalent to defining an optional.\n return Type.optional(value);\n }\n\n public static reference(value: GoTypeReference): Type {\n return new this({\n type: \"reference\",\n value\n });\n }\n\n public static slice(value: Type): Type {\n return new this({\n type: \"slice\",\n value\n });\n }\n\n public static string(): Type {\n return new this({\n type: \"string\"\n });\n }\n\n public static uuid(): Type {\n return new this({\n type: \"uuid\"\n });\n }\n\n public static variadic(value: Type): Type {\n if (this.isAlreadyVariadic(value)) {\n // Avoids double variadic.\n return value;\n }\n return new this({\n type: \"variadic\",\n value\n });\n }\n\n private static isAlreadyOptional(value: Type) {\n return value.internalType.type === \"optional\" || NILABLE_TYPES.has(value.internalType.type);\n }\n\n private static isAlreadyVariadic(value: Type) {\n return value.internalType.type === \"variadic\";\n }\n}\n\nexport const TimeTypeReference = new GoTypeReference({\n importPath: \"time\",\n name: \"Time\"\n});\n\nexport const UuidTypeReference = new GoTypeReference({\n importPath: \"github.com/google/uuid\",\n name: \"UUID\"\n});\n\nexport const IoReaderTypeReference = new GoTypeReference({\n importPath: \"io\",\n name: \"Reader\"\n});\n","import { Comment } from \"./Comment\";\nimport { AstNode } from \"./core/AstNode\";\nimport { Writer } from \"./core/Writer\";\nimport { Type } from \"./Type\";\n\nexport declare namespace TypeDeclaration {\n interface Args {\n /* The name of the alias */\n name: string;\n /* The type of the alias */\n type: Type;\n /* The docs of the alias, if any */\n docs?: string;\n }\n}\n\nexport class TypeDeclaration extends AstNode {\n public readonly name: string;\n public readonly type: Type;\n public readonly docs: string | undefined;\n\n constructor({ name, type, docs }: TypeDeclaration.Args) {\n super();\n this.name = name;\n this.type = type;\n this.docs = docs;\n }\n\n public write(writer: Writer): void {\n writer.writeNode(new Comment({ docs: this.docs }));\n writer.write(\"type \");\n writer.write(this.name);\n writer.write(\" \");\n writer.writeNode(this.type);\n }\n}\n","/**\n * Go keywords and predeclared types that should be avoided as struct field names.\n * We check case-insensitively since PascalCase versions like \"String\" should also be prefixed.\n * We will just add to this list as needed\n */\nconst GO_RESERVED_IDENTIFIERS = new Set([\"string\"]);\n\n/**\n * Converts a name to a valid Go exported identifier.\n * Go exported identifiers must start with an uppercase letter.\n * This function handles edge cases like:\n * - Names that are empty or only underscores (e.g., \"_\") -> \"Underscore\"\n * - Names that start with a digit (e.g., \"1\") -> \"Field1\"\n * - Names that start with underscore followed by digit (e.g., \"_1\") -> \"Field1\"\n * - Names that match Go reserved words/predeclared identifiers (e.g., \"String\") -> \"FieldString\"\n */\nexport function goExportedFieldName(name: string): string {\n if (name === \"\") {\n return \"Underscore\";\n }\n\n // Strip leading underscores\n let stripped = name;\n while (stripped.startsWith(\"_\")) {\n stripped = stripped.slice(1);\n }\n if (stripped === \"\") {\n // Name was all underscores\n return \"Underscore\";\n }\n\n // Check if the first character is a digit\n if (stripped.length > 0 && /^\\d/.test(stripped)) {\n return \"Field\" + stripped;\n }\n\n // Ensure the first letter is uppercase for export\n let result = stripped;\n const firstChar = stripped[0];\n if (stripped.length > 0 && firstChar != null && firstChar !== firstChar.toUpperCase()) {\n result = firstChar.toUpperCase() + stripped.slice(1);\n }\n\n // Check if the name matches a Go reserved word or predeclared identifier (case-insensitive)\n if (GO_RESERVED_IDENTIFIERS.has(result.toLowerCase())) {\n return \"Field\" + result;\n }\n\n return result;\n}\n","import { FernGeneratorExec } from \"@fern-api/browser-compatible-base-generator\";\nimport { basename } from \"@fern-api/path-utils\";\nimport path from \"path\";\nimport { BaseGoCustomConfigSchema } from \"../custom-config/BaseGoCustomConfigSchema\";\n\nconst DEFAULT_MODULE_PATH = \"sdk\";\n\nexport function resolveRootImportPath({\n config,\n customConfig\n}: {\n config: FernGeneratorExec.config.GeneratorConfig;\n customConfig: BaseGoCustomConfigSchema | undefined;\n}): string {\n const suffix = getMajorVersionSuffix({ config });\n const importPath = getImportPath({ config, customConfig });\n return suffix != null ? maybeAppendMajorVersionSuffix({ importPath, majorVersion: suffix }) : importPath;\n}\n\nexport function resolveRootModulePath({\n config,\n customConfig\n}: {\n config: FernGeneratorExec.config.GeneratorConfig;\n customConfig: BaseGoCustomConfigSchema | undefined;\n}): string {\n const suffix = getMajorVersionSuffix({ config });\n const importPath = getImportPath({ config, customConfig, isModulePath: true });\n return suffix != null ? maybeAppendMajorVersionSuffix({ importPath, majorVersion: suffix }) : importPath;\n}\n\nfunction getImportPath({\n config,\n customConfig,\n isModulePath = false\n}: {\n config: FernGeneratorExec.config.GeneratorConfig;\n customConfig: BaseGoCustomConfigSchema | undefined;\n isModulePath?: boolean;\n}): string {\n const importPath =\n customConfig?.importPath ??\n customConfig?.module?.path ??\n (config.output.mode.type === \"github\"\n ? trimPrefix(config.output.mode.repoUrl, \"https://\")\n : DEFAULT_MODULE_PATH);\n return isModulePath ? importPath : path.join(importPath, customConfig?.packagePath ?? \"\");\n}\n\nfunction getMajorVersionSuffix({ config }: { config: FernGeneratorExec.config.GeneratorConfig }): string | undefined {\n const majorVersion = parseMajorVersion({ config });\n if (majorVersion == null || majorVersion === \"v0\" || majorVersion === \"v1\") {\n return undefined;\n }\n return `${majorVersion}`;\n}\n\n// parseMajorVersion returns the major version of the SDK, including Go's expected \"v\"\n// prefix, e.g. \"v0\", \"v1\", \"v2\", etc.\nfunction parseMajorVersion({ config }: { config: FernGeneratorExec.config.GeneratorConfig }): string | undefined {\n const version = getVersion(config);\n if (version == null) {\n return undefined;\n }\n const split = version.split(\".\");\n if (split[0] == null) {\n return undefined;\n }\n const majorVersion = split[0];\n if (majorVersion.startsWith(\"v\")) {\n return majorVersion;\n }\n return `v${majorVersion}`;\n}\n\nfunction maybeAppendMajorVersionSuffix({\n importPath,\n majorVersion\n}: {\n importPath: string;\n majorVersion: string;\n}): string {\n if (basename(importPath) === majorVersion) {\n return importPath;\n }\n return `${importPath}/${majorVersion}`;\n}\n\nfunction trimPrefix(str: string, prefix: string): string {\n if (str.startsWith(prefix)) {\n return str.slice(prefix.length);\n }\n return str;\n}\n\nfunction getVersion(config: FernGeneratorExec.GeneratorConfig): string | undefined {\n const mode = config?.output?.mode;\n if (mode == null) {\n return undefined;\n }\n return mode.type === \"github\" || mode.type === \"publish\" ? mode.version : undefined;\n}\n","import { DiscriminatedUnionTypeInstance, Severity } from \"@fern-api/browser-compatible-base-generator\";\nimport { assertNever } from \"@fern-api/core-utils\";\nimport { FernIr } from \"@fern-api/dynamic-ir-sdk\";\nimport { go } from \"@fern-api/go-ast\";\n\nimport { DynamicSnippetsGeneratorContext } from \"./DynamicSnippetsGeneratorContext\";\n\nexport declare namespace DynamicTypeInstantiationMapper {\n interface Args {\n typeReference: FernIr.dynamic.TypeReference;\n value: unknown;\n as?: ConvertedAs;\n }\n\n // Identifies what the type is being converted as, which sometimes influences how\n // the type is instantiated.\n type ConvertedAs = \"key\";\n}\n\nexport class DynamicTypeInstantiationMapper {\n private context: DynamicSnippetsGeneratorContext;\n\n constructor({ context }: { context: DynamicSnippetsGeneratorContext }) {\n this.context = context;\n }\n\n public convert(args: DynamicTypeInstantiationMapper.Args): go.TypeInstantiation {\n // eslint-disable-next-line eqeqeq\n if (args.value === null && !this.context.isNullable(args.typeReference)) {\n this.context.errors.add({\n severity: Severity.Critical,\n message: \"Expected non-null value, but got null\"\n });\n }\n if (args.value == null) {\n return go.TypeInstantiation.nop();\n }\n switch (args.typeReference.type) {\n case \"list\":\n return this.convertList({ list: args.typeReference.value, value: args.value });\n case \"literal\":\n return go.TypeInstantiation.nop();\n case \"map\":\n return this.convertMap({ map: args.typeReference, value: args.value });\n case \"named\": {\n const named = this.context.resolveNamedType({ typeId: args.typeReference.value });\n if (named == null) {\n return go.TypeInstantiation.nop();\n }\n return this.convertNamed({ named, value: args.value, as: args.as });\n }\n case \"nullable\": {\n const inner = args.typeReference.value;\n // Special case: nullable + alias-of-collection\n // For fields like `Services *ServicesUs50` where `type ServicesUs50 = []*ServiceUs50`,\n // we generate `&ServicesUs50{...}` using the alias name in the composite literal.\n // This is more idiomatic and matches the exported API type users see.\n if (inner.type === \"named\") {\n const named = this.context.resolveNamedType({ typeId: inner.value });\n if (named?.type === \"alias\" && [\"list\", \"set\", \"map\"].includes(named.typeReference.type)) {\n // Build the underlying collection literal\n const collectionLiteral = this.convert({\n typeReference: named.typeReference,\n value: args.value,\n as: args.as\n });\n\n // Get the alias type reference\n const aliasName = this.context.getTypeName(named.declaration.name);\n const aliasImportPath = this.context.getImportPath(named.declaration.fernFilepath);\n\n // Reconstruct the composite literal using the alias name\n return this.reconstructAliasCollectionLiteral({\n collectionLiteral,\n aliasName,\n aliasImportPath\n });\n }\n }\n // Default behavior for all other nullables\n return go.TypeInstantiation.optional(\n this.convert({ typeReference: inner, value: args.value, as: args.as })\n );\n }\n case \"optional\": {\n const inner = args.typeReference.value;\n // Special case: optional + alias-of-collection\n // For fields like `Services *ServicesUs50` where `type ServicesUs50 = []*ServiceUs50`,\n // we generate `&ServicesUs50{...}` using the alias name in the composite literal.\n // This is more idiomatic and matches the exported API type users see.\n if (inner.type === \"named\") {\n const named = this.context.resolveNamedType({ typeId: inner.value });\n if (named?.type === \"alias\" && [\"list\", \"set\", \"map\"].includes(named.typeReference.type)) {\n // Build the underlying collection literal\n const collectionLiteral = this.convert({\n typeReference: named.typeReference,\n value: args.value,\n as: args.as\n });\n\n // Get the alias type reference\n const aliasName = this.context.getTypeName(named.declaration.name);\n const aliasImportPath = this.context.getImportPath(named.declaration.fernFilepath);\n\n // Reconstruct the composite literal using the alias name\n return this.reconstructAliasCollectionLiteral({\n collectionLiteral,\n aliasName,\n aliasImportPath\n });\n }\n }\n // Default behavior for all other optionals\n return go.TypeInstantiation.optional(\n this.convert({ typeReference: inner, value: args.value, as: args.as })\n );\n }\n case \"primitive\":\n return this.convertPrimitive({ primitive: args.typeReference.value, value: args.value, as: args.as });\n case \"set\":\n return this.convertList({ list: args.typeReference.value, value: args.value });\n case \"unknown\":\n return this.convertUnknown({ value: args.value });\n default:\n assertNever(args.typeReference);\n }\n }\n\n public convertToPointerIfPossible(args: DynamicTypeInstantiationMapper.Args): go.TypeInstantiation {\n const converted = this.convert(args);\n switch (args.typeReference.type) {\n case \"named\": {\n const named = this.context.resolveNamedType({ typeId: args.typeReference.value });\n if (named?.type === \"enum\") {\n return go.TypeInstantiation.reference(\n go.invokeMethod({\n on: converted,\n method: \"Ptr\",\n arguments_: []\n })\n );\n }\n return converted;\n }\n default:\n return converted;\n }\n }\n\n private convertList({ list, value }: { list: FernIr.dynamic.TypeReference; value: unknown }): go.TypeInstantiation {\n if (!Array.isArray(value)) {\n this.context.errors.add({\n severity: Severity.Critical,\n message: `Expected array but got: ${typeof value}`\n });\n return go.TypeInstantiation.nop();\n }\n return go.TypeInstantiation.slice({\n valueType: this.context.dynamicTypeMapper.convert({ typeReference: list }),\n values: value.map((v, index) => {\n this.context.errors.scope({ index });\n try {\n return this.convert({ typeReference: list, value: v });\n } finally {\n this.context.errors.unscope();\n }\n })\n });\n }\n\n private convertMap({ map, value }: { map: FernIr.dynamic.MapType; value: unknown }): go.TypeInstantiation {\n if (typeof value !== \"object\" || value == null) {\n this.context.errors.add({\n severity: Severity.Critical,\n message: `Expected object but got: ${value == null ? \"null\" : typeof value}`\n });\n return go.TypeInstantiation.nop();\n }\n return go.TypeInstantiation.map({\n keyType: this.context.dynamicTypeMapper.convert({ typeReference: map.key }),\n valueType: this.context.dynamicTypeMapper.convert({ typeReference: map.value }),\n entries: Object.entries(value).map(([key, value]) => {\n this.context.errors.scope(key);\n try {\n return {\n key: this.convert({ typeReference: map.key, value: key, as: \"key\" }),\n value: this.convert({ typeReference: map.value, value })\n };\n } finally {\n this.context.errors.unscope();\n }\n })\n });\n }\n\n private convertNamed({\n named,\n value,\n as\n }: {\n named: FernIr.dynamic.NamedType;\n value: unknown;\n as?: DynamicTypeInstantiationMapper.ConvertedAs;\n }): go.TypeInstantiation {\n switch (named.type) {\n case \"alias\":\n return this.convertAlias({\n aliasType: named,\n value,\n as\n });\n case \"discriminatedUnion\":\n return this.convertDiscriminatedUnion({\n discriminatedUnion: named,\n value\n });\n case \"enum\":\n return this.convertEnum({ enum_: named, value });\n case \"object\":\n return this.convertObject({ object_: named, value });\n case \"undiscriminatedUnion\":\n return this.convertUndiscriminatedUnion({ undiscriminatedUnion: named, value });\n default:\n assertNever(named);\n }\n }\n\n private convertAlias({\n aliasType,\n value,\n as\n }: {\n aliasType: FernIr.dynamic.NamedType.Alias;\n value: unknown;\n as?: DynamicTypeInstantiationMapper.ConvertedAs;\n }): go.TypeInstantiation {\n switch (aliasType.typeReference.type) {\n case \"literal\":\n return go.TypeInstantiation.reference(\n go.invokeFunc({\n func: go.typeReference({\n name: this.context.getTypeName(aliasType.declaration.name),\n importPath: this.context.getImportPath(aliasType.declaration.fernFilepath)\n }),\n arguments_: [this.convertLiteralValue(aliasType.typeReference.value)]\n })\n );\n default:\n return this.convert({ typeReference: aliasType.typeReference, value, as });\n }\n }\n\n private reconstructAliasCollectionLiteral({\n collectionLiteral,\n aliasName,\n aliasImportPath\n }: {\n collectionLiteral: go.TypeInstantiation;\n aliasName: string;\n aliasImportPath: string;\n }): go.TypeInstantiation {\n // Reconstruct the composite literal using the alias name\n const internal = collectionLiteral.internalType;\n // Note: sets are converted to slices via convertList, so they're handled by the slice case\n if (internal.type === \"slice\") {\n return go.TypeInstantiation.reference(\n go.codeblock((writer) => {\n writer.write(\"&\");\n writer.writeNode(\n go.typeReference({\n name: aliasName,\n importPath: aliasImportPath\n })\n );\n\n const values = internal.values;\n if (values.length === 0) {\n writer.write(\"{}\");\n return;\n }\n\n writer.writeLine(\"{\");\n writer.indent();\n for (const v of values) {\n writer.writeNode(v);\n writer.writeLine(\",\");\n }\n writer.dedent();\n writer.write(\"}\");\n })\n );\n }\n if (internal.type === \"map\") {\n return go.TypeInstantiation.reference(\n go.codeblock((writer) => {\n writer.write(\"&\");\n writer.writeNode(\n go.typeReference({\n name: aliasName,\n importPath: aliasImportPath\n })\n );\n\n const entries = internal.entries;\n if (entries.length === 0) {\n writer.write(\"{}\");\n return;\n }\n\n writer.writeLine(\"{\");\n writer.indent();\n for (const entry of entries) {\n writer.writeNode(entry.key);\n writer.write(\": \");\n writer.writeNode(entry.value);\n writer.writeLine(\",\");\n }\n writer.dedent();\n writer.write(\"}\");\n })\n );\n }\n // Fallback: if not a slice or map, use the underlying type approach\n return go.TypeInstantiation.reference(\n go.codeblock((writer) => {\n writer.write(\"&\");\n writer.writeNode(collectionLiteral);\n })\n );\n }\n\n private convertLiteralValue(literal: FernIr.dynamic.LiteralType): go.TypeInstantiation {\n switch (literal.type) {\n case \"boolean\":\n return go.TypeInstantiation.bool(literal.value);\n case \"string\":\n return go.TypeInstantiation.string(literal.value);\n default:\n assertNever(literal);\n }\n }\n\n private convertDiscriminatedUnion({\n discriminatedUnion,\n value\n }: {\n discriminatedUnion: FernIr.dynamic.DiscriminatedUnionType;\n value: unknown;\n }): go.TypeInstantiation {\n const structTypeReference = this.context.getGoTypeReferenceFromDeclaration({\n declaration: discriminatedUnion.declaration\n });\n const discriminatedUnionTypeInstance = this.context.resolveDiscriminatedUnionTypeInstance({\n discriminatedUnion,\n value\n });\n if (discriminatedUnionTypeInstance == null) {\n return go.TypeInstantiation.nop();\n }\n const unionVariant = discriminatedUnionTypeInstance.singleDiscriminatedUnionType;\n const baseFields = this.getBaseFields({\n discriminatedUnionTypeInstance,\n singleDiscriminatedUnionType: unionVariant\n });\n switch (unionVariant.type) {\n case \"samePropertiesAsObject\": {\n const named = this.context.resolveNamedType({\n typeId: unionVariant.typeId\n });\n if (named == null) {\n return go.TypeInstantiation.nop();\n }\n return go.TypeInstantiation.structPointer({\n typeReference: structTypeReference,\n fields: [\n {\n name: this.context.getFieldName(unionVariant.discriminantValue.name),\n value: this.convertNamed({ named, value: discriminatedUnionTypeInstance.value })\n },\n ...baseFields\n ]\n });\n }\n case \"singleProperty\": {\n const record = this.context.getRecord(discriminatedUnionTypeInstance.value);\n if (record == null) {\n return go.TypeInstantiation.nop();\n }\n try {\n this.context.errors.scope(unionVariant.discriminantValue.wireValue);\n return go.TypeInstantiation.structPointer({\n typeReference: structTypeReference,\n fields: [\n {\n name: this.context.getFieldName(unionVariant.discriminantValue.name),\n value: this.convert({\n typeReference: unionVariant.typeReference,\n value: record[unionVariant.discriminantValue.wireValue]\n })\n },\n ...baseFields\n ]\n });\n } finally {\n this.context.errors.unscope();\n }\n }\n case \"noProperties\":\n return go.TypeInstantiation.structPointer({\n typeReference: structTypeReference,\n fields: [\n {\n // Unions with no properties require the discriminant property to be set.\n name: this.context.getFieldName(discriminatedUnionTypeInstance.discriminantValue.name),\n value: go.TypeInstantiation.string(unionVariant.discriminantValue.wireValue)\n },\n ...baseFields\n ]\n });\n default:\n assertNever(unionVariant);\n }\n }\n\n private getBaseFields({\n discriminatedUnionTypeInstance,\n singleDiscriminatedUnionType\n }: {\n discriminatedUnionTypeInstance: DiscriminatedUnionTypeInstance;\n singleDiscriminatedUnionType: FernIr.dynamic.SingleDiscriminatedUnionType;\n }): go.StructField[] {\n const properties = this.context.associateByWireValue({\n parameters: singleDiscriminatedUnionType.properties ?? [],\n values: this.context.getRecord(discriminatedUnionTypeInstance.value) ?? {},\n\n // We're only selecting the base properties here. The rest of the properties\n // are handled by the union variant.\n ignoreMissingParameters: true\n });\n return properties.map((property) => {\n this.context.errors.scope(property.name.wireValue);\n try {\n return {\n name: this.context.getFieldName(property.name.name),\n value: this.convert(property)\n };\n } finally {\n this.context.errors.unscope();\n }\n });\n }\n\n private convertObject({\n object_,\n value\n }: {\n object_: FernIr.dynamic.ObjectType;\n value: unknown;\n }): go.TypeInstantiation {\n const properties = this.context.associateByWireValue({\n parameters: object_.properties,\n values: this.context.getRecord(value) ?? {}\n });\n return go.TypeInstantiation.structPointer({\n typeReference: go.typeReference({\n name: this.context.getTypeName(object_.declaration.name),\n importPath: this.context.getImportPath(object_.declaration.fernFilepath)\n }),\n fields: properties.map((property) => {\n this.context.errors.scope(property.name.wireValue);\n try {\n return {\n name: this.context.getFieldName(property.name.name),\n value: this.convert(property)\n };\n } finally {\n this.context.errors.unscope();\n }\n })\n });\n }\n\n private convertEnum({ enum_, value }: { enum_: FernIr.dynamic.EnumType; value: unknown }): go.TypeInstantiation {\n const name = this.getEnumValueName({ enum_, value });\n if (name == null) {\n return go.TypeInstantiation.nop();\n }\n return go.TypeInstantiation.enum(\n go.typeReference({\n name,\n importPath: this.context.getImportPath(enum_.declaration.fernFilepath)\n })\n );\n }\n\n private getEnumValueName({ enum_, value }: { enum_: FernIr.dynamic.EnumType; value: unknown }): string | undefined {\n if (typeof value !== \"string\") {\n this.context.errors.add({\n severity: Severity.Critical,\n message: `Expected enum value string, got: ${typeof value}`\n });\n return undefined;\n }\n const enumValue = enum_.values.find((v) => v.wireValue === value);\n if (enumValue == null) {\n this.context.errors.add({\n severity: Severity.Critical,\n message: `An enum value named \"${value}\" does not exist in this context`\n });\n return undefined;\n }\n return `${this.context.getTypeName(enum_.declaration.name)}${this.context.getTypeName(enumValue.name)}`;\n }\n\n private convertUndiscriminatedUnion({\n undiscriminatedUnion,\n value\n }: {\n undiscriminatedUnion: FernIr.dynamic.UndiscriminatedUnionType;\n value: unknown;\n }): go.TypeInstantiation {\n const result = this.findMatchingUndiscriminatedUnionType({\n undiscriminatedUnion,\n value\n });\n if (result == null) {\n return go.TypeInstantiation.nop();\n }\n const fieldName = this.getUndiscriminatedUnionFieldName({ typeReference: result.valueTypeReference });\n if (fieldName == null) {\n return go.TypeInstantiation.nop();\n }\n return go.TypeInstantiation.structPointer({\n typeReference: this.context.getGoTypeReferenceFromDeclaration({\n declaration: undiscriminatedUnion.declaration\n }),\n fields: [\n {\n name: fieldName,\n value: result.typeInstantiation\n }\n ]\n });\n }\n\n private findMatchingUndiscriminatedUnionType({\n undiscriminatedUnion,\n value\n }: {\n undiscriminatedUnion: FernIr.dynamic.UndiscriminatedUnionType;\n value: unknown;\n }): { valueTypeReference: FernIr.dynamic.TypeReference; typeInstantiation: go.TypeInstantiation } | undefined {\n for (const typeReference of undiscriminatedUnion.types) {\n try {\n const typeInstantiation = this.convert({ typeReference, value });\n return { valueTypeReference: typeReference, typeInstantiation };\n } catch (e) {\n continue;\n }\n }\n this.context.errors.add({\n severity: Severity.Critical,\n message: `None of the types in the undiscriminated union matched the given \"${typeof value}\" value`\n });\n return undefined;\n }\n\n private getUndiscriminatedUnionFieldName({\n typeReference\n }: {\n typeReference: FernIr.dynamic.TypeReference;\n }): string | undefined {\n switch (typeReference.type) {\n case \"list\":\n return this.getUndiscriminatedUnionFieldNameForList({ list: typeReference });\n case \"literal\":\n return this.getUndiscriminatedUnionFieldNameForLiteral({ literal: typeReference.value });\n case \"map\":\n return this.getUndiscriminatedUnionFieldNameForMap({ map: typeReference });\n case \"named\": {\n const named = this.context.resolveNamedType({ typeId: typeReference.value });\n if (named == null) {\n return undefined;\n }\n return this.context.getTypeName(named.declaration.name);\n }\n case \"optional\":\n return this.getUndiscriminatedUnionFieldNameForOptional({ typeReference });\n case \"nullable\":\n return this.getUndiscriminatedUnionFieldNameForOptional({ typeReference });\n case \"primitive\":\n return this.getUndiscriminatedUnionFieldNameForPrimitive({ primitive: typeReference.value });\n case \"set\":\n return this.getUndiscriminatedUnionFieldNameForSet({ set: typeReference });\n case \"unknown\":\n return \"Unknown\";\n default:\n assertNever(typeReference);\n }\n }\n\n private getUndiscriminatedUnionFieldNameForList({\n list\n }: {\n list: FernIr.dynamic.TypeReference.List;\n }): string | undefined {\n const fieldName = this.getUndiscriminatedUnionFieldName({ typeReference: list });\n if (fieldName == null) {\n return undefined;\n }\n return `${fieldName}List`;\n }\n\n private getUndiscriminatedUnionFieldNameForMap({ map }: { map: FernIr.dynamic.MapType }): string | undefined {\n const keyFieldName = this.getUndiscriminatedUnionFieldName({ typeReference: map.key });\n if (keyFieldName == null) {\n return undefined;\n }\n const valueFieldName = this.getUndiscriminatedUnionFieldName({ typeReference: map.value });\n if (valueFieldName == null) {\n return undefined;\n }\n return `${keyFieldName}${valueFieldName}Map`;\n }\n\n private getUndiscriminatedUnionFieldNameForOptional({\n typeReference\n }: {\n typeReference: FernIr.dynamic.TypeReference.Optional | FernIr.dynamic.TypeReference.Nullable;\n }): string | undefined {\n const fieldName = this.getUndiscriminatedUnionFieldName({ typeReference });\n if (fieldName == null) {\n return undefined;\n }\n return `${fieldName}Optional`;\n }\n\n private getUndiscriminatedUnionFieldNameForSet({\n set\n }: {\n set: FernIr.dynamic.TypeReference.Set;\n }): string | undefined {\n const fieldName = this.getUndiscriminatedUnionFieldName({ typeReference: set });\n if (fieldName == null) {\n return undefined;\n }\n return `${fieldName}Set`;\n }\n\n private getUndiscriminatedUnionFieldNameForLiteral({\n literal\n }: {\n literal: FernIr.dynamic.LiteralType;\n }): string | undefined {\n switch (literal.type) {\n case \"boolean\":\n if (literal.value) {\n return \"TrueLiteral\";\n }\n return \"FalseLiteral\";\n case \"string\":\n return `${literal.value}StringLiteral`;\n default:\n assertNever(literal);\n }\n }\n\n private getUndiscriminatedUnionFieldNameForPrimitive({\n primitive\n }: {\n primitive: FernIr.dynamic.PrimitiveTypeV1;\n }): string {\n switch (primitive) {\n case \"INTEGER\":\n case \"UINT\":\n return \"Integer\";\n case \"LONG\":\n case \"UINT_64\":\n return \"Long\";\n case \"FLOAT\":\n case \"DOUBLE\":\n return \"Double\";\n case \"BOOLEAN\":\n return \"Boolean\";\n case \"BIG_INTEGER\":\n case \"STRING\":\n return \"String\";\n case \"UUID\":\n return \"Uuid\";\n case \"DATE\":\n return \"Date\";\n case \"DATE_TIME\":\n return \"DateTime\";\n case \"BASE_64\":\n return \"Base64\";\n default:\n assertNever(primitive);\n }\n }\n\n private convertUnknown({ value }: { value: unknown }): go.TypeInstantiation {\n return go.TypeInstantiation.any(value);\n }\n\n private convertPrimitive({\n primitive,\n value,\n as\n }: {\n primitive: FernIr.dynamic.PrimitiveTypeV1;\n value: unknown;\n as?: DynamicTypeInstantiationMapper.ConvertedAs;\n }): go.TypeInstantiation {\n switch (primitive) {\n case \"INTEGER\":\n case \"UINT\": {\n const num = this.getValueAsNumber({ value, as });\n if (num == null) {\n return go.TypeInstantiation.nop();\n }\n return go.TypeInstantiation.int(num);\n }\n case \"LONG\":\n case \"UINT_64\": {\n const num = this.getValueAsNumber({ value, as });\n if (num == null) {\n return go.TypeInstantiation.nop();\n }\n return go.TypeInstantiation.int64(num);\n }\n case \"FLOAT\":\n case \"DOUBLE\": {\n const num = this.getValueAsNumber({ value, as });\n if (num == null) {\n return go.TypeInstantiation.nop();\n }\n return go.TypeInstantiation.float64(num);\n }\n case \"BOOLEAN\": {\n const bool = this.getValueAsBoolean({ value, as });\n if (bool == null) {\n return go.TypeInstantiation.nop();\n }\n return go.TypeInstantiation.bool(bool);\n }\n case \"STRING\": {\n const str = this.context.getValueAsString({ value });\n if (str == null) {\n return go.TypeInstantiation.nop();\n }\n return go.TypeInstantiation.string(str);\n }\n case \"DATE\": {\n const date = this.context.getValueAsString({ value });\n if (date == null) {\n return go.TypeInstantiation.nop();\n }\n return go.TypeInstantiation.date(date);\n }\n case \"DATE_TIME\": {\n const dateTime = this.context.getValueAsString({ value });\n if (dateTime == null) {\n return go.TypeInstantiation.nop();\n }\n const normalizedDateTime = this.normalizeDateTimeString(dateTime);\n return go.TypeInstantiation.dateTime(normalizedDateTime);\n }\n case \"UUID\": {\n const uuid = this.context.getValueAsString({ value });\n if (uuid == null) {\n return go.TypeInstantiation.nop();\n }\n return go.TypeInstantiation.uuid(uuid);\n }\n case \"BASE_64\": {\n const base64 = this.context.getValueAsString({ value });\n if (base64 == null) {\n return go.TypeInstantiation.nop();\n }\n return go.TypeInstantiation.bytes(base64);\n }\n case \"BIG_INTEGER\": {\n const bigInt = this.context.getValueAsString({ value });\n if (bigInt == null) {\n return go.TypeInstantiation.nop();\n }\n return go.TypeInstantiation.string(bigInt);\n }\n default:\n assertNever(primitive);\n }\n }\n\n private getValueAsNumber({\n value,\n as\n }: {\n value: unknown;\n as?: DynamicTypeInstantiationMapper.ConvertedAs;\n }): number | undefined {\n const num = as === \"key\" ? (typeof value === \"string\" ? Number(value) : value) : value;\n return this.context.getValueAsNumber({ value: num });\n }\n\n private getValueAsBoolean({\n value,\n as\n }: {\n value: unknown;\n as?: DynamicTypeInstantiationMapper.ConvertedAs;\n }): boolean | undefined {\n const bool =\n as === \"key\" ? (typeof value === \"string\" ? value === \"true\" : value === \"false\" ? false : value) : value;\n return this.context.getValueAsBoolean({ value: bool });\n }\n\n private normalizeDateTimeString(dateTime: string): string {\n if (/^\\d{4}-\\d{2}-\\d{2}$/.test(dateTime)) {\n return `${dateTime}T00:00:00Z`;\n }\n if (/^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$/.test(dateTime)) {\n return `${dateTime}Z`;\n }\n return dateTime;\n }\n}\n","import { assertNever } from \"@fern-api/core-utils\";\nimport { FernIr } from \"@fern-api/dynamic-ir-sdk\";\nimport { go } from \"@fern-api/go-ast\";\n\nimport { DynamicSnippetsGeneratorContext } from \"./DynamicSnippetsGeneratorContext\";\n\nexport declare namespace DynamicTypeMapper {\n interface Args {\n typeReference: FernIr.dynamic.TypeReference;\n }\n}\n\nexport class DynamicTypeMapper {\n private context: DynamicSnippetsGeneratorContext;\n\n constructor({ context }: { context: DynamicSnippetsGeneratorContext }) {\n this.context = context;\n }\n\n public convert(args: DynamicTypeMapper.Args): go.Type {\n switch (args.typeReference.type) {\n case \"list\":\n return go.Type.slice(this.convert({ typeReference: args.typeReference.value }));\n case \"literal\":\n return this.convertLiteral({ literal: args.typeReference.value });\n case \"map\":\n return go.Type.map(\n this.convert({ typeReference: args.typeReference.key }),\n this.convert({ typeReference: args.typeReference.value })\n );\n case \"named\": {\n const named = this.context.resolveNamedType({ typeId: args.typeReference.value });\n if (named == null) {\n return this.convertUnknown();\n }\n return this.convertNamed({ named });\n }\n case \"optional\":\n return go.Type.optional(this.convert({ typeReference: args.typeReference.value }));\n case \"nullable\":\n return go.Type.optional(this.convert({ typeReference: args.typeReference.value }));\n case \"primitive\":\n return this.convertPrimitive({ primitive: args.typeReference.value });\n case \"set\":\n return go.Type.slice(this.convert({ typeReference: args.typeReference }));\n case \"unknown\":\n return this.convertUnknown();\n default:\n assertNever(args.typeReference);\n }\n }\n\n private convertLiteral({ literal }: { literal: FernIr.dynamic.LiteralType }): go.Type {\n switch (literal.type) {\n case \"boolean\":\n return go.Type.bool();\n case \"string\":\n return go.Type.string();\n }\n }\n\n private convertNamed({ named }: { named: FernIr.dynamic.NamedType }): go.Type {\n const goTypeReference = go.Type.reference(\n go.typeReference({\n name: this.context.getTypeName(named.declaration.name),\n importPath: this.context.getImportPath(named.declaration.fernFilepath)\n })\n );\n switch (named.type) {\n case \"alias\":\n case \"enum\":\n return goTypeReference;\n case \"discriminatedUnion\":\n case \"object\":\n case \"undiscriminatedUnion\":\n return go.Type.pointer(goTypeReference);\n default:\n assertNever(named);\n }\n }\n\n private convertUnknown(): go.Type {\n return go.Type.any();\n }\n\n private convertPrimitive({ primitive }: { primitive: FernIr.dynamic.PrimitiveTypeV1 }): go.Type {\n switch (primitive) {\n case \"INTEGER\":\n return go.Type.int();\n case \"UINT\":\n return go.Type.int();\n case \"LONG\":\n return go.Type.int64();\n case \"UINT_64\":\n return go.Type.int64();\n case \"FLOAT\":\n return go.Type.float64();\n case \"DOUBLE\":\n return go.Type.float64();\n case \"BOOLEAN\":\n return go.Type.bool();\n case \"STRING\":\n return go.Type.string();\n case \"DATE\":\n return go.Type.date();\n case \"DATE_TIME\":\n return go.Type.dateTime();\n case \"UUID\":\n return go.Type.uuid();\n case \"BASE_64\":\n return go.Type.bytes();\n case \"BIG_INTEGER\":\n return go.Type.string();\n default:\n assertNever(primitive);\n }\n }\n}\n","import { assertNever } from \"@fern-api/core-utils\";\nimport { FernIr } from \"@fern-api/dynamic-ir-sdk\";\nimport { go } from \"@fern-api/go-ast\";\n\nimport { DynamicSnippetsGeneratorContext } from \"./DynamicSnippetsGeneratorContext\";\n\nexport interface FilePropertyInfo {\n fileFields: go.StructField[];\n bodyPropertyFields: go.StructField[];\n}\n\nexport class FilePropertyMapper {\n private context: DynamicSnippetsGeneratorContext;\n\n constructor({ context }: { context: DynamicSnippetsGeneratorContext }) {\n this.context = context;\n }\n\n public getFilePropertyInfo({\n body,\n value\n }: {\n body: FernIr.dynamic.FileUploadRequestBody;\n value: unknown;\n }): FilePropertyInfo {\n const result: FilePropertyInfo = {\n fileFields: [],\n bodyPropertyFields: []\n };\n const record = this.context.getRecord(value) ?? {};\n for (const property of body.properties) {\n switch (property.type) {\n case \"file\":\n result.fileFields.push({\n name: this.context.getFieldName(property.name),\n value: this.getSingleFileProperty({ property, record })\n });\n break;\n case \"fileArray\":\n result.fileFields.push({\n name: this.context.getFieldName(property.name),\n value: this.getArrayFileProperty({ property, record })\n });\n break;\n case \"bodyProperty\":\n result.bodyPropertyFields.push({\n name: this.context.getFieldName(property.name.name),\n value: this.getBodyProperty({ property, record })\n });\n break;\n default:\n assertNever(property);\n }\n }\n return result;\n }\n\n private getSingleFileProperty({\n property,\n record\n }: {\n property: FernIr.dynamic.FileUploadRequestBodyProperty.File_;\n record: Record<string, unknown>;\n }): go.TypeInstantiation {\n // fix(williammcadams): always return a string reader even if no example was provided\n const fileValue = this.context.getSingleFileValue({ property, record }) || \"\";\n return go.TypeInstantiation.reference(this.context.getNewStringsReaderFunctionInvocation(fileValue));\n }\n\n private getArrayFileProperty({\n property,\n record\n }: {\n property: FernIr.dynamic.FileUploadRequestBodyProperty.FileArray;\n record: Record<string, unknown>;\n }): go.TypeInstantiation {\n const fileValues = this.context.getFileArrayValues({ property, record });\n if (fileValues == null) {\n return go.TypeInstantiation.nop();\n }\n return go.TypeInstantiation.slice({\n valueType: go.Type.reference(this.context.getIoReaderTypeReference()),\n values: fileValues.map((value) =>\n go.TypeInstantiation.reference(this.context.getNewStringsReaderFunctionInvocation(value))\n )\n });\n }\n\n private getBodyProperty({\n property,\n record\n }: {\n property: FernIr.dynamic.NamedParameter;\n record: Record<string, unknown>;\n }): go.TypeInstantiation {\n const bodyPropertyValue = record[property.name.wireValue];\n if (bodyPropertyValue == null) {\n return go.TypeInstantiation.nop();\n }\n return this.context.dynamicTypeInstantiationMapper.convert({\n typeReference: property.typeReference,\n value: bodyPropertyValue\n });\n }\n}\n","import { AbstractFormatter, Options, Scope, Severity } from \"@fern-api/browser-compatible-base-generator\";\nimport { assertNever } from \"@fern-api/core-utils\";\nimport { FernIr } from \"@fern-api/dynamic-ir-sdk\";\nimport { go } from \"@fern-api/go-ast\";\n\nimport { DynamicSnippetsGeneratorContext } from \"./context/DynamicSnippetsGeneratorContext\";\nimport { FilePropertyInfo } from \"./context/FilePropertyMapper\";\n\nconst SNIPPET_PACKAGE_NAME = \"example\";\nconst SNIPPET_IMPORT_PATH = \"fern\";\nconst SNIPPET_FUNC_NAME = \"do\";\nconst CLIENT_VAR_NAME = \"client\";\nconst TypeInst = go.TypeInstantiation;\nconst WIREMOCK_BASE_URL = \"WireMockBaseURL\";\nconst WIREMOCK_CLIENT_VAR_NAME = \"WireMockClient\";\n\nexport class EndpointSnippetGenerator {\n private context: DynamicSnippetsGeneratorContext;\n private formatter: AbstractFormatter | undefined;\n\n constructor({ context, formatter }: { context: DynamicSnippetsGeneratorContext; formatter?: AbstractFormatter }) {\n this.context = context;\n this.formatter = formatter;\n }\n\n public async generateSnippet({\n endpoint,\n request,\n options\n }: {\n endpoint: FernIr.dynamic.Endpoint;\n request: FernIr.dynamic.EndpointSnippetRequest;\n options?: Options;\n }): Promise<string> {\n const outputWiremockTests =\n (options?.config as { outputWiremockTests?: boolean })?.outputWiremockTests ?? false;\n if (outputWiremockTests) {\n return this.generateWiremockTest({ endpoint, snippet: request });\n }\n const code = this.buildCodeBlock({ endpoint, snippet: request });\n return await code.toStringAsync({\n packageName: SNIPPET_PACKAGE_NAME,\n importPath: SNIPPET_IMPORT_PATH,\n rootImportPath: this.context.rootImportPath,\n customConfig: this.context.customConfig ?? {},\n formatter: this.formatter\n });\n }\n\n public generateSnippetSync({\n endpoint,\n request,\n options\n }: {\n endpoint: FernIr.dynamic.Endpoint;\n request: FernIr.dynamic.EndpointSnippetRequest;\n options?: Options;\n }): string {\n const outputWiremockTests =\n (options?.config as { outputWiremockTests?: boolean })?.outputWiremockTests ?? false;\n if (outputWiremockTests) {\n return this.generateWiremockTest({ endpoint, snippet: request });\n }\n const code = this.buildCodeBlock({ endpoint, snippet: request });\n return code.toString({\n packageName: SNIPPET_PACKAGE_NAME,\n importPath: SNIPPET_IMPORT_PATH,\n rootImportPath: this.context.rootImportPath,\n customConfig: this.context.customConfig ?? {},\n formatter: this.formatter\n });\n }\n\n public async generateSnippetAst({\n endpoint,\n request,\n options\n }: {\n endpoint: FernIr.dynamic.Endpoint;\n request: FernIr.dynamic.EndpointSnippetRequest;\n options?: Options;\n }): Promise<go.AstNode> {\n throw new Error(\"Unsupported\");\n }\n\n private generateWiremockTest({\n endpoint,\n snippet\n }: {\n endpoint: FernIr.dynamic.Endpoint;\n snippet: FernIr.dynamic.EndpointSnippetRequest;\n }): string {\n const code = this.buildWiremockTestCodeBlock({ endpoint, snippet });\n return code.toString({\n packageName: \"wiremock\",\n importPath: SNIPPET_IMPORT_PATH,\n rootImportPath: this.context.rootImportPath,\n customConfig: this.context.customConfig ?? {},\n formatter: this.formatter\n });\n }\n\n private buildCodeBlock({\n endpoint,\n snippet\n }: {\n endpoint: FernIr.dynamic.Endpoint;\n snippet: FernIr.dynamic.EndpointSnippetRequest;\n }): go.AstNode {\n return go.codeblock((writer) => {\n writer.writeNode(\n go.func({\n name: SNIPPET_FUNC_NAME,\n parameters: [],\n return_: [],\n body: go.codeblock((writer) => {\n writer.writeNode(this.constructClient({ endpoint, snippet }));\n writer.writeLine();\n writer.writeNode(this.callMethod({ endpoint, snippet }));\n })\n })\n );\n writer.writeNewLineIfLastLineNot();\n });\n }\n\n private buildWiremockTestCodeBlock({\n endpoint,\n snippet\n }: {\n endpoint: FernIr.dynamic.Endpoint;\n snippet: FernIr.dynamic.EndpointSnippetRequest;\n }): go.AstNode {\n return go.codeblock((writer) => {\n writer.writeNode(\n go.func({\n name: \"Test\" + this.context.getTestMethodName(endpoint) + \"WithWireMock\",\n parameters: [\n go.parameter({\n name: \"t\",\n type: go.Type.pointer(go.Type.reference(this.context.getTestingTypeReference()))\n })\n ],\n return_: [],\n body: go.codeblock((writer) => {\n for (const node of this.buildWiremockTestSetup({ endpoint })) {\n writer.writeNode(node);\n writer.writeLine();\n }\n writer.writeLine();\n writer.writeNode(this.constructWiremockTestClient({ endpoint, snippet }));\n writer.writeLine();\n writer.writeNode(this.callClientMethodAndAssert({ endpoint, snippet }));\n })\n })\n );\n // Not including error case for now until I can figure out why its not matching the wiremock stub\n // writer.writeLine();\n // writer.writeNode(\n // go.func({\n // name: \"Test\" + this.context.getMethodName(endpoint.declaration.name) + \"Error\" + \"WithWireMock\",\n // parameters: [\n // go.parameter({\n // name: \"t\",\n // type: go.Type.pointer(go.Type.reference(this.context.getTestingTypeReference()))\n // })\n // ],\n // return_: [],\n // body: go.codeblock((writer) => {\n // for (const node of this.buildWiremockTestSetup({ endpoint, errorCase: true })) {\n // writer.writeNode(node);\n // writer.writeLine();\n // }\n // writer.writeLine();\n // writer.writeNode(this.constructWiremockTestClient({ endpoint, snippet }));\n // writer.writeLine();\n // writer.writeNode(this.callClientMethodAndAssert({ endpoint, snippet }));\n // })\n // })\n // );\n writer.writeNewLineIfLastLineNot();\n });\n }\n\n private constructClient({\n endpoint,\n snippet\n }: {\n endpoint: FernIr.dynamic.Endpoint;\n snippet: FernIr.dynamic.EndpointSnippetRequest;\n }): go.CodeBlock {\n return go.codeblock((writer) => {\n writer.write(`${CLIENT_VAR_NAME} := `);\n writer.writeNode(this.getRootClientFuncInvocation(this.getConstructorArgs({ endpoint, snippet })));\n });\n }\n\n private constructWiremockTestClient({\n endpoint,\n snippet\n }: {\n endpoint: FernIr.dynamic.Endpoint;\n snippet: FernIr.dynamic.EndpointSnippetRequest;\n }): go.CodeBlock {\n return go.codeblock((writer) => {\n writer.write(`${CLIENT_VAR_NAME} := `);\n writer.writeNode(this.getRootClientFuncInvocation(this.getWiremockTestConstructorArgs()));\n });\n }\n\n private writeMethodInvocation({\n writer,\n endpoint,\n snippet\n }: {\n writer: go.Writer;\n endpoint: FernIr.dynamic.Endpoint;\n snippet: FernIr.dynamic.EndpointSnippetRequest;\n }): void {\n const { otherArgs, requestArg } = this.getMethodArgs({ endpoint, snippet });\n\n if (requestArg != null) {\n if (requestArg instanceof go.TypeInstantiation && go.TypeInstantiation.isNop(requestArg)) {\n writer.writeNode(\n go.invokeMethod({\n on: go.codeblock(CLIENT_VAR_NAME),\n method: this.getMethod({ endpoint }),\n arguments_: [this.context.getContextTodoFunctionInvocation(), ...otherArgs, go.codeblock(\"nil\")]\n })\n );\n } else {\n writer.write(\"request := \");\n writer.writeNode(requestArg);\n writer.writeLine();\n\n const requestRef = go.codeblock(\"request\");\n writer.writeNode(\n go.invokeMethod({\n on: go.codeblock(CLIENT_VAR_NAME),\n method: this.getMethod({ endpoint }),\n arguments_: [this.context.getContextTodoFunctionInvocation(), ...otherArgs, requestRef]\n })\n );\n }\n } else {\n writer.writeNode(\n go.invokeMethod({\n on: go.codeblock(CLIENT_VAR_NAME),\n method: this.getMethod({ endpoint }),\n arguments_: [this.context.getContextTodoFunctionInvocation(), ...otherArgs]\n })\n );\n }\n }\n\n private callMethod({\n endpoint,\n snippet\n }: {\n endpoint: FernIr.dynamic.Endpoint;\n snippet: FernIr.dynamic.EndpointSnippetRequest;\n }): go.CodeBlock {\n return go.codeblock((writer) => {\n this.writeMethodInvocation({ writer, endpoint, snippet });\n });\n }\n\n private getConstructorArgs({\n endpoint,\n snippet\n }: {\n endpoint: FernIr.dynamic.Endpoint;\n snippet: FernIr.dynamic.EndpointSnippetRequest;\n }): go.AstNode[] {\n const args: go.AstNode[] = [];\n const baseUrlArg = this.getConstructorBaseUrlArg({\n baseUrl: snippet.baseURL,\n environment: snippet.environment\n });\n if (baseUrlArg != null) {\n args.push(baseUrlArg);\n }\n if (endpoint.auth != null) {\n if (snippet.auth != null) {\n args.push(this.getConstructorAuthArg({ auth: endpoint.auth, values: snippet.auth }));\n } else {\n this.context.errors.add({\n severity: Severity.Warning,\n message: `Auth with ${endpoint.auth.type} configuration is required for this endpoint`\n });\n }\n }\n this.context.errors.scope(Scope.Headers);\n if (this.context.ir.headers != null && snippet.headers != null) {\n args.push(...this.getConstructorHeaderArgs({ headers: this.context.ir.headers, values: snippet.headers }));\n }\n this.context.errors.unscope();\n return args;\n }\n\n private getWiremockTestConstructorArgs(): go.AstNode[] {\n return [\n go.codeblock((writer) => {\n writer.writeNode(\n go.invokeFunc({\n func: go.typeReference({\n name: \"WithBaseURL\",\n importPath: this.context.getOptionImportPath()\n }),\n arguments_: [go.codeblock(WIREMOCK_BASE_URL)]\n })\n );\n })\n ];\n }\n\n private getConstructorAuthArg({\n auth,\n values\n }: {\n auth: FernIr.dynamic.Auth;\n values: FernIr.dynamic.AuthValues;\n }): go.AstNode {\n if (values.type !== auth.type) {\n this.addError(this.context.newAuthMismatchError({ auth, values }).message);\n return TypeInst.nop();\n }\n switch (auth.type) {\n case \"basic\":\n return values.type === \"basic\" ? this.getConstructorBasicAuthArg({ auth, values }) : TypeInst.nop();\n case \"bearer\":\n return values.type === \"bearer\" ? this.getConstructorBearerAuthArg({ auth, values }) : TypeInst.nop();\n case \"header\":\n return values.type === \"header\" ? this.getConstructorHeaderAuthArg({ auth, values }) : TypeInst.nop();\n case \"oauth\":\n this.addWarning(\"The Go SDK doesn't support OAuth client credentials yet\");\n return TypeInst.nop();\n case \"inferred\":\n this.addWarning(\"The Go SDK Generator does not support Inferred auth scheme yet\");\n return TypeInst.nop();\n default:\n assertNever(auth);\n }\n }\n\n private addError(message: string): void {\n this.context.errors.add({ severity: Severity.Critical, message });\n }\n\n private addWarning(message: string): void {\n this.context.errors.add({ severity: Severity.Warning, message });\n }\n\n private getConstructorBasicAuthArg({\n auth,\n values\n }: {\n auth: FernIr.dynamic.BasicAuth;\n values: FernIr.dynamic.BasicAuthValues;\n }): go.AstNode {\n return go.codeblock((writer) => {\n writer.writeNode(\n go.invokeFunc({\n func: go.typeReference({\n name: \"WithBasicAuth\",\n importPath: this.context.getOptionImportPath()\n }),\n arguments_: [\n go.TypeInstantiation.string(values.username),\n go.TypeInstantiation.string(values.password)\n ]\n })\n );\n });\n }\n\n private getConstructorBaseUrlArg({\n baseUrl,\n environment\n }: {\n baseUrl: string | undefined;\n environment: FernIr.dynamic.EnvironmentValues | undefined;\n }): go.AstNode | undefined {\n const baseUrlArg = this.getBaseUrlArg({ baseUrl, environment });\n if (baseUrlArg == null) {\n return undefined;\n }\n return go.codeblock((writer) => {\n writer.writeNode(\n go.invokeFunc({\n func: go.typeReference({\n name: \"WithBaseURL\",\n importPath: this.context.getOptionImportPath()\n }),\n arguments_: [baseUrlArg]\n })\n );\n });\n }\n\n private getBaseUrlArg({\n baseUrl,\n environment\n }: {\n baseUrl: string | undefined;\n environment: FernIr.dynamic.EnvironmentValues | undefined;\n }): go.AstNode | undefined {\n if (baseUrl != null && environment != null) {\n this.context.errors.add({\n severity: Severity.Critical,\n message: \"Cannot specify both baseUrl and environment options\"\n });\n return undefined;\n }\n if (baseUrl != null) {\n return go.TypeInstantiation.string(baseUrl);\n }\n if (environment != null) {\n if (this.context.isSingleEnvironmentID(environment)) {\n const typeReference = this.context.getEnvironmentTypeReferenceFromID(environment);\n if (typeReference == null) {\n this.context.errors.add({\n severity: Severity.Warning,\n message: `Environment ${JSON.stringify(environment)} was not found`\n });\n return undefined;\n }\n return go.TypeInstantiation.reference(typeReference);\n }\n if (this.context.isMultiEnvironmentValues(environment)) {\n this.context.errors.add({\n severity: Severity.Warning,\n message:\n \"The Go SDK doesn't support a multi-environment client option yet; use the baseUrl option instead\"\n });\n }\n }\n return undefined;\n }\n\n private getConstructorBearerAuthArg({\n auth,\n values\n }: {\n auth: FernIr.dynamic.BearerAuth;\n values: FernIr.dynamic.BearerAuthValues;\n }): go.AstNode {\n return go.codeblock((writer) => {\n writer.writeNode(\n go.invokeFunc({\n func: go.typeReference({\n name: `With${auth.token.pascalCase.unsafeName}`,\n importPath: this.context.getOptionImportPath()\n }),\n arguments_: [go.TypeInstantiation.string(values.token)]\n })\n );\n });\n }\n\n private getConstructorHeaderAuthArg({\n auth,\n values\n }: {\n auth: FernIr.dynamic.HeaderAuth;\n values: FernIr.dynamic.HeaderAuthValues;\n }): go.AstNode {\n return go.codeblock((writer) => {\n writer.writeNode(\n go.invokeFunc({\n func: go.typeReference({\n name: `With${auth.header.name.name.pascalCase.unsafeName}`,\n importPath: this.context.getOptionImportPath()\n }),\n arguments_: [\n this.context.dynamicTypeInstantiationMapper.convert({\n typeReference: auth.header.typeReference,\n value: values.value\n })\n ]\n })\n );\n });\n }\n\n private getConstructorHeaderArgs({\n headers,\n values\n }: {\n headers: FernIr.dynamic.NamedParameter[];\n values: FernIr.dynamic.Values;\n }): go.AstNode[] {\n const args: go.AstNode[] = [];\n for (const header of headers) {\n const arg = this.getConstructorHeaderArg({ header, value: values.value });\n if (arg != null) {\n args.push(arg);\n }\n }\n return args;\n }\n\n private getConstructorHeaderArg({\n header,\n value\n }: {\n header: FernIr.dynamic.NamedParameter;\n value: unknown;\n }): go.AstNode | undefined {\n const typeInstantiation = this.context.dynamicTypeInstantiationMapper.convert({\n typeReference: header.typeReference,\n value\n });\n if (go.TypeInstantiation.isNop(typeInstantiation)) {\n // Literal header values (e.g. \"X-API-Version\") should not be included in the\n // client constructor.\n return undefined;\n }\n return go.codeblock((writer) => {\n writer.writeNode(\n go.invokeFunc({\n func: go.typeReference({\n name: `With${header.name.name.pascalCase.unsafeName}`,\n importPath: this.context.getOptionImportPath()\n }),\n arguments_: [typeInstantiation]\n })\n );\n });\n }\n\n private getMethodArgs({\n endpoint,\n snippet\n }: {\n endpoint: FernIr.dynamic.Endpoint;\n snippet: FernIr.dynamic.EndpointSnippetRequest;\n }): { otherArgs: go.AstNode[]; requestArg: go.AstNode | undefined } {\n switch (endpoint.request.type) {\n case \"inlined\":\n return this.getMethodArgsForInlinedRequest({ request: endpoint.request, snippet });\n case \"body\":\n return this.getMethodArgsForBodyRequest({ request: endpoint.request, snippet });\n default:\n assertNever(endpoint.request);\n }\n }\n\n private getMethodArgsForBodyRequest({\n request,\n snippet\n }: {\n request: FernIr.dynamic.BodyRequest;\n snippet: FernIr.dynamic.EndpointSnippetRequest;\n }): { otherArgs: go.AstNode[]; requestArg: go.AstNode | undefined } {\n const otherArgs: go.AstNode[] = [];\n\n this.context.errors.scope(Scope.PathParameters);\n const pathParameters = [...(this.context.ir.pathParameters ?? []), ...(request.pathParameters ?? [])];\n if (pathParameters.length > 0) {\n otherArgs.push(\n ...this.getPathParameters({ namedParameters: pathParameters, snippet }).map((field) => field.value)\n );\n }\n this.context.errors.unscope();\n\n this.context.errors.scope(Scope.RequestBody);\n const requestArg: go.AstNode | undefined =\n request.body != null\n ? this.getBodyRequestArg({ body: request.body, value: snippet.requestBody })\n : undefined;\n this.context.errors.unscope();\n\n return { otherArgs, requestArg };\n }\n\n private getBodyRequestArg({\n body,\n value\n }: {\n body: FernIr.dynamic.ReferencedRequestBodyType;\n value: unknown;\n }): go.TypeInstantiation {\n switch (body.type) {\n case \"bytes\": {\n return this.getBytesBodyRequestArg({ value });\n }\n case \"typeReference\":\n return this.context.dynamicTypeInstantiationMapper.convert({ typeReference: body.value, value });\n default:\n assertNever(body);\n }\n }\n\n private getBytesBodyRequestArg({ value }: { value: unknown }): go.TypeInstantiation {\n if (typeof value !== \"string\") {\n this.context.errors.add({\n severity: Severity.Critical,\n message: `Expected bytes value to be a string, got ${typeof value}`\n });\n return go.TypeInstantiation.nop();\n }\n return go.TypeInstantiation.bytes(value as string);\n }\n\n private getMethodArgsForInlinedRequest({\n request,\n snippet\n }: {\n request: FernIr.dynamic.InlinedRequest;\n snippet: FernIr.dynamic.EndpointSnippetRequest;\n }): { otherArgs: go.AstNode[]; requestArg: go.AstNode | undefined } {\n const otherArgs: go.AstNode[] = [];\n\n const { inlinePathParameters, inlineFileProperties } = {\n inlinePathParameters: this.context.customConfig?.inlinePathParameters ?? true,\n inlineFileProperties: this.context.customConfig?.inlineFileProperties ?? true\n };\n\n this.context.errors.scope(Scope.PathParameters);\n const pathParameterFields: go.StructField[] = [];\n const pathParameters = [...(this.context.ir.pathParameters ?? []), ...(request.pathParameters ?? [])];\n if (pathParameters.length > 0) {\n pathParameterFields.push(\n ...this.getPathParameters({\n namedParameters: pathParameters,\n snippet\n })\n );\n }\n this.context.errors.unscope();\n\n this.context.errors.scope(Scope.RequestBody);\n const filePropertyInfo = this.getFilePropertyInfo({ request, snippet });\n this.context.errors.unscope();\n\n if (!this.context.includePathParametersInWrappedRequest({ request, inlinePathParameters })) {\n otherArgs.push(...pathParameterFields.map((field) => field.value));\n }\n\n if (!inlineFileProperties) {\n otherArgs.push(...filePropertyInfo.fileFields.map((field) => field.value));\n }\n\n const requestArg: go.AstNode | undefined = this.context.needsRequestParameter({\n request,\n inlinePathParameters,\n inlineFileProperties\n })\n ? this.getInlinedRequestArg({\n request,\n snippet,\n pathParameterFields: this.context.includePathParametersInWrappedRequest({\n request,\n inlinePathParameters\n })\n ? pathParameterFields\n : [],\n filePropertyInfo\n })\n : undefined;\n return { otherArgs, requestArg };\n }\n\n private getFilePropertyInfo({\n request,\n snippet\n }: {\n request: FernIr.dynamic.InlinedRequest;\n snippet: FernIr.dynamic.EndpointSnippetRequest;\n }): FilePropertyInfo {\n if (request.body == null || !this.context.isFileUploadRequestBody(request.body)) {\n return {\n fileFields: [],\n bodyPropertyFields: []\n };\n }\n return this.context.filePropertyMapper.getFilePropertyInfo({\n body: request.body,\n value: snippet.requestBody\n });\n }\n\n private getInlinedRequestArg({\n request,\n snippet,\n pathParameterFields,\n filePropertyInfo\n }: {\n request: FernIr.dynamic.InlinedRequest;\n snippet: FernIr.dynamic.EndpointSnippetRequest;\n pathParameterFields: go.StructField[];\n filePropertyInfo: FilePropertyInfo;\n }): go.TypeInstantiation {\n this.context.errors.scope(Scope.QueryParameters);\n const queryParameters = this.context.associateQueryParametersByWireValue({\n parameters: request.queryParameters ?? [],\n values: snippet.queryParameters ?? {}\n });\n const queryParameterFields = queryParameters.map((queryParameter) => ({\n name: queryParameter.name.name.pascalCase.unsafeName,\n value: this.context.dynamicTypeInstantiationMapper.convert(queryParameter)\n }));\n this.context.errors.unscope();\n\n this.context.errors.scope(Scope.Headers);\n const headers = this.context.associateByWireValue({\n parameters: request.headers ?? [],\n values: snippet.headers ?? {}\n });\n const headerFields = headers.map((header) => ({\n name: header.name.name.pascalCase.unsafeName,\n value: this.context.dynamicTypeInstantiationMapper.convert(header)\n }));\n this.context.errors.unscope();\n\n this.context.errors.scope(Scope.RequestBody);\n const requestBodyFields =\n request.body != null\n ? this.getInlinedRequestBodyStructFields({\n body: request.body,\n value: snippet.requestBody,\n filePropertyInfo\n })\n : [];\n this.context.errors.unscope();\n\n return go.TypeInstantiation.structPointer({\n typeReference: go.typeReference({\n name: this.context.getMethodName(request.declaration.name),\n importPath: this.context.getImportPathForRequest(request.declaration.fernFilepath)\n }),\n fields: [...pathParameterFields, ...queryParameterFields, ...headerFields, ...requestBodyFields]\n });\n }\n\n private getInlinedRequestBodyStructFields({\n body,\n value,\n filePropertyInfo\n }: {\n body: FernIr.dynamic.InlinedRequestBody;\n value: unknown;\n filePropertyInfo: FilePropertyInfo;\n }): go.StructField[] {\n switch (body.type) {\n case \"properties\":\n return this.getInlinedRequestBodyPropertyStructFields({ parameters: body.value, value });\n case \"referenced\":\n return [this.getReferencedRequestBodyPropertyStructField({ body, value })];\n case \"fileUpload\":\n return this.getFileUploadRequestBodyStructFields({ filePropertyInfo });\n default:\n assertNever(body);\n }\n }\n\n private getFileUploadRequestBodyStructFields({\n filePropertyInfo\n }: {\n filePropertyInfo: FilePropertyInfo;\n }): go.StructField[] {\n if (this.context.customConfig?.inlineFileProperties) {\n return [...filePropertyInfo.fileFields, ...filePropertyInfo.bodyPropertyFields];\n }\n return filePropertyInfo.bodyPropertyFields;\n }\n\n private getReferencedRequestBodyPropertyStructField({\n body,\n value\n }: {\n body: FernIr.dynamic.ReferencedRequestBody;\n value: unknown;\n }): go.StructField {\n return {\n name: this.context.getTypeName(body.bodyKey),\n value: this.getReferencedRequestBodyPropertyTypeInstantiation({ body: body.bodyType, value })\n };\n }\n\n private getReferencedRequestBodyPropertyTypeInstantiation({\n body,\n value\n }: {\n body: FernIr.dynamic.ReferencedRequestBodyType;\n value: unknown;\n }): go.TypeInstantiation {\n switch (body.type) {\n case \"bytes\":\n return this.getBytesBodyRequestArg({ value });\n case \"typeReference\":\n return this.context.dynamicTypeInstantiationMapper.convert({ typeReference: body.value, value });\n default:\n assertNever(body);\n }\n }\n\n private getInlinedRequestBodyPropertyStructFields({\n parameters,\n value\n }: {\n parameters: FernIr.dynamic.NamedParameter[];\n value: unknown;\n }): go.StructField[] {\n const fields: go.StructField[] = [];\n\n const bodyProperties = this.context.associateByWireValue({\n parameters,\n values: this.context.getRecord(value) ?? {}\n });\n for (const parameter of bodyProperties) {\n fields.push({\n name: this.context.getTypeName(parameter.name.name),\n value: this.context.dynamicTypeInstantiationMapper.convert(parameter)\n });\n }\n\n return fields;\n }\n\n private getPathParameters({\n namedParameters,\n snippet\n }: {\n namedParameters: FernIr.dynamic.NamedParameter[];\n snippet: FernIr.dynamic.EndpointSnippetRequest;\n }): go.StructField[] {\n const args: go.StructField[] = [];\n\n const pathParameters = this.context.associateByWireValue({\n parameters: namedParameters,\n values: snippet.pathParameters ?? {}\n });\n for (const parameter of pathParameters) {\n args.push({\n name: this.context.getTypeName(parameter.name.name),\n value: this.context.dynamicTypeInstantiationMapper.convertToPointerIfPossible(parameter)\n });\n }\n\n return args;\n }\n\n private getMethod({ endpoint }: { endpoint: FernIr.dynamic.Endpoint }): string {\n if (endpoint.declaration.fernFilepath.allParts.length > 0) {\n return `${endpoint.declaration.fernFilepath.allParts\n .map((val) => this.context.getMethodName(val))\n .join(\".\")}.${this.context.getMethodName(endpoint.declaration.name)}`;\n }\n return this.context.getMethodName(endpoint.declaration.name);\n }\n\n private getRootClientFuncInvocation(arguments_: go.AstNode[]): go.FuncInvocation {\n return go.invokeFunc({\n func: go.typeReference({\n name: this.context.getClientConstructorName(),\n importPath: this.context.getClientImportPath()\n }),\n arguments_\n });\n }\n\n private buildWiremockTestSetup({\n endpoint,\n errorCase\n }: {\n endpoint: FernIr.dynamic.Endpoint;\n errorCase?: boolean;\n }): go.AstNode[] {\n const ENDPOINT_STUB_NAME = \"stub\";\n const usedSharedMainTest = true;\n return [\n ...(!usedSharedMainTest\n ? [\n // Initialize context\n go.codeblock((writer) => {\n writer.write(\"ctx := \");\n writer.writeNode(\n go.invokeFunc({\n func: go.typeReference({\n name: \"Background\",\n importPath: \"context\"\n }),\n arguments_: [],\n multiline: false\n })\n );\n }),\n\n // Start WireMock container\n go.codeblock((writer) => {\n writer.write(`container, containerErr := `);\n writer.writeNode(\n go.invokeFunc({\n func: go.typeReference({\n name: \"RunContainerAndStopOnCleanup\",\n importPath: \"github.com/wiremock/wiremock-testcontainers-go\"\n }),\n arguments_: [\n go.codeblock(\"ctx\"),\n go.codeblock(\"t\"),\n go.invokeFunc({\n func: go.typeReference({\n name: \"WithImage\",\n importPath: \"github.com/wiremock/wiremock-testcontainers-go\"\n }),\n arguments_: [\n go.TypeInstantiation.string(\"docker.io/wiremock/wiremock:3.9.1\")\n ],\n multiline: false\n })\n ],\n multiline: true\n })\n );\n }),\n\n // Check for container error\n go.codeblock((writer) => {\n writer.write(\"if containerErr != nil {\");\n writer.writeLine();\n writer.write(\" t.Fatal(containerErr)\");\n writer.writeLine();\n writer.write(\"}\");\n }),\n\n // Get WireMock URL from container\n go.codeblock((writer) => {\n writer.write(`${WIREMOCK_BASE_URL}, endpointErr := `);\n writer.writeNode(\n go.invokeMethod({\n on: go.codeblock(\"container\"),\n method: \"Endpoint\",\n arguments_: [go.codeblock(\"ctx\"), go.TypeInstantiation.string(\"\")],\n multiline: false\n })\n );\n }),\n\n go.invokeFunc({\n func: go.typeReference({\n name: \"NoError\",\n importPath: \"github.com/stretchr/testify/require\"\n }),\n arguments_: [\n go.codeblock(\"t\"),\n go.codeblock(\"endpointErr\"),\n go.TypeInstantiation.string(\"Failed to get WireMock container endpoint\")\n ],\n multiline: false\n }),\n\n go.codeblock((writer) => {\n writer.write(`${WIREMOCK_BASE_URL} = \"http://\" + ${WIREMOCK_BASE_URL}`);\n }),\n\n // Get WireMock client from container\n go.codeblock((writer) => {\n writer.write(`${WIREMOCK_CLIENT_VAR_NAME} := `);\n writer.writeNode(\n go.selector({\n on: go.codeblock(\"container\"),\n selector: go.codeblock(\"Client\")\n })\n );\n })\n ]\n : [])\n ];\n }\n\n private callClientMethodAndAssert({\n endpoint,\n snippet\n }: {\n endpoint: FernIr.dynamic.Endpoint;\n snippet: FernIr.dynamic.EndpointSnippetRequest;\n }): go.CodeBlock {\n return go.codeblock((writer) => {\n // IMPORTANT: currently not capturing the response/error values since its not trivial to determine\n // the number of return values for the method using the dynamic ir\n\n // Call the method and capture response and error\n // writer.write(\"_, invocationErr := \");\n this.writeMethodInvocation({ writer, endpoint, snippet });\n writer.writeLine();\n writer.writeLine();\n\n // Verify WireMock request was matched\n writer.write(\"ok, countErr := \");\n writer.writeNode(\n go.invokeMethod({\n on: go.codeblock(WIREMOCK_CLIENT_VAR_NAME),\n method: \"Verify\",\n arguments_: [\n go.invokeMethod({\n on: go.codeblock(\"stub\"),\n method: \"Request\",\n arguments_: [],\n multiline: false\n }),\n go.codeblock(\"1\")\n ],\n multiline: false\n })\n );\n writer.writeLine();\n\n writer.writeNode(\n go.invokeFunc({\n func: go.typeReference({\n name: \"NoError\",\n importPath: \"github.com/stretchr/testify/require\"\n }),\n arguments_: [\n go.codeblock(\"t\"),\n go.codeblock(\"countErr\"),\n go.TypeInstantiation.string(\"Failed to verify WireMock request was matched\")\n ],\n multiline: false\n })\n );\n writer.writeLine();\n\n writer.writeNode(\n go.invokeFunc({\n func: go.typeReference({\n name: \"True\",\n importPath: \"github.com/stretchr/testify/require\"\n }),\n arguments_: [\n go.codeblock(\"t\"),\n go.codeblock(\"ok\"),\n go.TypeInstantiation.string(\"WireMock request was not matched\")\n ],\n multiline: false\n })\n );\n writer.writeLine();\n\n // IMPORTANT: currently not asserting that the call succeeded since its not trivial to determine\n // the number of return values for the method using the dynamic ir\n\n // Verify the call succeeded (may not assert this at all and only assert the WireMock request was matched)\n // Since we don't necessarily have valid response bodies in our WireMock stubs (so type casting will fail)\n // writer.writeNode(\n // go.invokeFunc({\n // func: go.typeReference({\n // name: \"NoError\",\n // importPath: \"github.com/stretchr/testify/require\"\n // }),\n // arguments_: [\n // go.codeblock(\"t\"),\n // go.codeblock(\"invocationErr\"),\n // go.TypeInstantiation.string(`${this.getMethod({ endpoint })} call should succeed with WireMock`)\n // ],\n // multiline: false\n // })\n // );\n // writer.writeLine();\n });\n }\n}\n"],"mappings":"8jCAGA,SAASA,IAAmB,CACxB,MAAM,IAAI,MAAM,iCAAiC,CACrD,CACA,SAASC,IAAsB,CAC3B,MAAM,IAAI,MAAM,mCAAmC,CACvD,CAUA,SAASC,GAAWC,EAAK,CACrB,GAAIC,IAAqB,WAErB,OAAO,WAAWD,EAAK,CAAC,EAG5B,IACKC,IAAqBJ,IAAoB,CAACI,IAC3C,WAEA,OAAAA,EAAmB,WACZ,WAAWD,EAAK,CAAC,EAE5B,GAAI,CAEA,OAAOC,EAAiBD,EAAK,CAAC,CAClC,OAASE,EAAG,CACR,GAAI,CAEA,OAAOD,EAAiB,KAAK,KAAMD,EAAK,CAAC,CAC7C,OAAS,EAAG,CAER,OAAOC,EAAiB,KAAK,KAAMD,EAAK,CAAC,CAC7C,CACJ,CACJ,CACA,SAASG,GAAgBC,EAAQ,CAC7B,GAAIC,IAAuB,aAEvB,OAAO,aAAaD,CAAM,EAG9B,IACKC,IAAuBP,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EAAG,UAAU,UAAU,EACvBA,EAAG,kBAAkB,OAAO,+CAA+C,CAC/E,EACA,UAAW,EACf,CAAC,CACL,EACAc,EAAO,UAAU,EAEjBA,EAAO,UACHd,EAAG,WAAW,CACV,KAAMA,EAAG,cAAc,CACnB,KAAM,OACN,WAAY,qCAChB,CAAC,EACD,WAAY,CACRA,EAAG,UAAU,GAAG,EAChBA,EAAG,UAAU,IAAI,EACjBA,EAAG,kBAAkB,OAAO,kCAAkC,CAClE,EACA,UAAW,EACf,CAAC,CACL,EACAc,EAAO,UAAU,CAsBrB,CAAC,CACL,CACJ,ExD5hCO,IAAM4C,GAAN,cAAuCC,EAG5C,CAGE,YAAY,CACR,GAAAC,EACA,OAAAC,EACA,UAAAC,CACJ,EAIG,CACC,MAAM,IAAIC,GAAgC,CAAE,GAAAH,EAAI,OAAAC,CAAO,CAAC,CAAC,EAX7DG,EAAA,KAAQ,aAYJ,KAAK,UAAYF,CACrB,CAEA,MAAa,SACTG,EACAC,EAC+C,CAC/C,OAAO,MAAM,SAASD,EAASC,CAAO,CAC1C,CAEO,aACHD,EACAC,EACsC,CACtC,OAAO,MAAM,aAAaD,EAASC,CAAO,CAC9C,CAEA,MAAa,mBAAmBD,EAA0E,CACtG,OAAO,MAAM,mBAAmBA,CAAO,CAC3C,CAEU,uBAAuBE,EAAoE,CACjG,OAAO,IAAIC,GAAyB,CAAE,QAAAD,EAAS,UAAW,KAAK,SAAU,CAAC,CAC9E,CACJ","names":["defaultSetTimout","defaultClearTimeout","runTimeout","fun","cachedSetTimeout","e","runClearTimeout","marker","cachedClearTimeout","cleanUpNextTick","draining","currentQueue","queue","queueIndex","drainQueue","timeout","len","nextTick","args","i","Item","array","noop","binding","name","cwd","chdir","dir","umask","hrtime","previousTimestamp","clocktime","performanceNow","performance","seconds","nanoseconds","uptime","currentTime","dif","startTime","title","platform","browser","env","argv","version","versions","release","config","on","addListener","once","off","removeListener","removeAllListeners","emit","process","defines","init_process","__esmMin","key","segs","target","seg","init","inited","code","i","len","lookup","revLookup","base64toByteArray","b64","j","l","tmp","placeHolders","arr","Arr","L","tripletToBase64","num","encodeChunk","uint8","start","end","output","base64fromByteArray","extraBytes","parts","maxChunkLength","len2","kMaxLength","Buffer","createBuffer","that","length","arg","encodingOrOffset","allocUnsafe","from","value","fromArrayBuffer","fromString","fromObject","assertSize","size","alloc","fill","encoding","checked","string","byteLength","actual","fromArrayLike","array","byteOffset","obj","internalIsBuffer","isnan","b","loweredCase","utf8ToBytes","base64ToBytes","slowToString","hexSlice","utf8Slice","asciiSlice","latin1Slice","base64Slice","utf16leSlice","swap","n","m","bidirectionalIndexOf","buffer","val","dir","arrayIndexOf","indexSize","arrLength","valLength","read","buf","foundIndex","found","hexWrite","offset","remaining","strLen","parsed","utf8Write","blitBuffer","asciiWrite","asciiToBytes","latin1Write","base64Write","ucs2Write","utf16leToBytes","res","firstByte","codePoint","bytesPerSequence","secondByte","thirdByte","fourthByte","tempCodePoint","decodeCodePointsArray","codePoints","MAX_ARGUMENTS_LENGTH","ret","out","toHex","bytes","checkOffset","ext","checkInt","max","min","objectWriteUInt16","littleEndian","objectWriteUInt32","checkIEEE754","writeFloat","noAssert","ieee754write","writeDouble","base64clean","str","stringtrim","INVALID_BASE64_RE","units","leadSurrogate","byteArray","c","hi","lo","src","dst","isBuffer","isFastBuffer","isSlowBuffer","ieee754read","isLE","mLen","nBytes","e","eLen","eMax","eBias","nBits","d","s","rt","init_Buffer","__esmMin","init_process","init_buffer","a","x","y","list","pos","target","thisStart","thisEnd","thisCopy","targetCopy","newBuf","sliceLen","mul","maxBytes","limit","sub","targetStart","init_buffer","__esmMin","init_Buffer","normalizeArray","parts","allowAboveRoot","up","i","last","resolve","resolvedPath","resolvedAbsolute","path","filter","p","normalize","isPathAbsolute","isAbsolute","trailingSlash","substr","join","paths","index","relative","from","to","trim","arr","start","end","fromParts","toParts","length","samePartsLength","outputParts","dirname","result","splitPath","root","dir","basename","ext","f","extname","xs","res","splitPathRe","sep","delimiter","path_default","init_path","__esmMin","init_process","init_buffer","filename","str","len","DynamicSnippetsGenerator_exports","__export","DynamicSnippetsGenerator","__toCommonJS","init_process","init_buffer","init_process","init_buffer","init_process","init_buffer","assertNever","x","init_process","init_buffer","keys","object","init_process","init_buffer","init_process","init_buffer","init_process","init_buffer","_a","_b","key","process","enableStackTracking","trackingType","globalFunctionFilters","globalFileFilters","stacktrace","maxFrames","skip","filterPaths","filterFunctions","stopOn","filterNode","filterJs","formatFilename","filename","_a","enableStackTracking","globalFunctionFilters","globalFileFilters","stop","line","match","fn","path","column","s","each","_b","f","p","StackTraces","maxFrames","skip","filterPaths","filterFunctions","stopOn","filterNode","filterJs","multiline","formatFilename","filename","__publicField","obj","current","stacktrace","frame","enableStackTracking","frames","each","stackTraces","startTracking","tag","getFramesForTaggedObject","obj","_a","stackTraces","AbstractAstNode","tag","init_process","init_buffer","AbstractFormatter","contents","content","NopFormatter","init_process","init_buffer","init_process","init_buffer","init_process","init_buffer","CodeBlock","AbstractAstNode","value","__publicField","writer","TAB_SIZE","startTracking","AbstractWriter","__publicField","enableStackTracking","parts","text","textEndsInNewline","textWithoutNewline","indent","indentedText","currIndentLevel","node","getFramesForTaggedObject","trackingType","input","CodeBlock","prefix","statement","withNewline","nodes","delimiter","writeFunction","firstNode","i","appendToLastLine","lines","appendTrackingComment","line","stack","each","stacktrace","init_process","init_buffer","init_process","init_buffer","init_process","init_buffer","Result","__publicField","context","snippet","endpoint","_a","reporter","_b","AbstractDynamicSnippetsGenerator","context","__publicField","request","options","endpoints","result","Result","endpoint","snippetGenerator","snippet","error","lastError","init_process","init_buffer","init_process","init_buffer","init_process","init_buffer","HttpEndpointReferenceParser","__publicField","reference","match","init_process","init_buffer","Severity","ErrorReporter","_ErrorReporter","__publicField","err","__spreadProps","__spreadValues","path","severity","clone","result","item","AbstractDynamicSnippetsGeneratorContext","ir","config","options","__publicField","ErrorReporter","HttpEndpointReferenceParser","parameters","values","instances","key","value","parameter","param","typeInstanceValue","Severity","ignoreMissingParameters","snippetObject","objectRecord","property","record","fileValue","fileArrayValue","stringValues","typeId","namedType","discriminatedUnion","discriminantFieldName","discriminantValue","singleDiscriminatedUnionType","_a","_","filtered","__objRest","__restKey","rawEndpoint","parsedEndpoint","location","endpoints","endpoint","request","inlinePathParameters","inlineFileProperties","_b","body","assertNever","environmentID","environments","environment","env","multiEnvironmentUrlValues","firstEnvironment","expectedKeys","keys","typeReference","resolvedType","auth","parameterName","expected","fileUpload","init_process","init_buffer","Scope","init_process","init_buffer","init_process","init_buffer","basename","path","options","_a","_b","init_process","init_buffer","init_process","init_buffer","init_process","init_buffer","init_process","init_buffer","INVALID_GO_IDENTIFIER_TOKEN","RESERVED_KEYWORDS","Writer","AbstractWriter","packageName","rootImportPath","importPath","customConfig","formatter","__publicField","NopFormatter","maybeAlias","set","pathElements","i","elements","alias","basename","s","split","possibleAlias","part","GoFile","Writer","packageName","rootImportPath","importPath","customConfig","formatter","content","error","packageStatement","imports","result","_","alias","go_exports","__export","Alias","AstNode","CodeBlock","Enum","Field","File","Func","FuncInvocation","IoReaderTypeReference","Method","MethodInvocation","MultiNode","Parameter","Pointer","Selector","Struct","TimeTypeReference","Type","TypeDeclaration","TypeInstantiation","GoTypeReference","UuidTypeReference","Writer","alias","codeblock","enum_","field","file","func","identifier","invokeFunc","invokeMethod","method","parameter","pointer","selector","struct","switch_","typeDeclaration","typeReference","init_process","init_buffer","init_process","init_buffer","init_process","init_buffer","init_process","init_buffer","init_process","init_buffer","AstNode","AbstractAstNode","packageName","rootImportPath","importPath","customConfig","formatter","file","GoFile","Comment","AstNode","docs","__publicField","writer","line","Alias","AstNode","name","type","docs","__publicField","writer","Comment","init_process","init_buffer","CodeBlock","AstNode","arg","__publicField","writer","init_process","init_buffer","init_process","init_buffer","Identifier","AstNode","name","__publicField","writer","init_process","init_buffer","init_process","init_buffer","init_process","init_buffer","writeArguments","writer","arguments_","multiline","modifiedArguments","argument","TypeInstantiation","writeMultiline","writeCompact","index","FuncInvocation","AstNode","func","arguments_","multiline","__publicField","writer","writeArguments","init_process","init_buffer","init_process","init_buffer","writeGenerics","writer","generics","generic","idx","GoTypeReference","AstNode","name","importPath","generics","__publicField","writer","alias","writeGenerics","init_process","init_buffer","MethodInvocation","AstNode","method","arguments_","on","multiline","__publicField","writer","writeArguments","POINTER_HELPER_TYPES","ADDRESSABLE_TYPES","TypeInstantiation","_TypeInstantiation","AstNode","internalType","__publicField","writer","invokeMustParseDate","invokeMustParseUUID","assertNever","value","typeReference","keyType","valueType","entries","values","fields","generics","typeInstantiation","element","key","val","map","filterNopMapEntries","entry","type","invokePointerHelper","MethodInvocation","slice","filterNopValues","struct","generic","index","filterNopStructFields","field","FuncInvocation","GoTypeReference","getPointerHelperFuncName","funcName","CodeBlock","Enum","_Enum","AstNode","name","docs","__publicField","constructor_","member","method","writer","Comment","TypeInstantiation","Identifier","init_process","init_buffer","Field","AstNode","name","type","docs","tags","__publicField","writer","Comment","tag","index","init_process","init_buffer","File","AstNode","nodes","__publicField","writer","node","init_process","init_buffer","init_process","init_buffer","Method","AstNode","name","parameters","return_","body","docs","typeReference","multiline","receiver","pointerReceiver","__publicField","writer","_a","Comment","writeArguments","returnType","index","Func","AstNode","name","parameters","return_","body","docs","multiline","__publicField","Method","writer","init_process","init_buffer","MultiNode","AstNode","nodes","__publicField","writer","node","init_process","init_buffer","Parameter","AstNode","name","type","docs","__publicField","writer","Comment","init_process","init_buffer","Pointer","AstNode","node","__publicField","writer","init_process","init_buffer","Selector","AstNode","on","selector","__publicField","writer","init_process","init_buffer","Struct","AstNode","name","embeds","fields","docs","__publicField","constructor","methods","writer","Comment","embed","exportedFields","field","unexportedFields","parameter","index","method","char","init_process","init_buffer","Switch","AstNode","on","cases","default_","__publicField","writer","Identifier","case_","init_process","init_buffer","NILABLE_TYPES","Type","_Type","AstNode","internalType","__publicField","writer","comment","TimeTypeReference","UuidTypeReference","assertNever","value","keyType","valueType","GoTypeReference","IoReaderTypeReference","init_process","init_buffer","TypeDeclaration","AstNode","name","type","docs","__publicField","writer","Comment","alias","args","Alias","codeblock","arg","CodeBlock","enum_","Enum","field","Field","file","File","func","Func","identifier","Identifier","invokeFunc","FuncInvocation","invokeMethod","MethodInvocation","method","Method","parameter","Parameter","pointer","Pointer","selector","Selector","struct","Struct","switch_","Switch","typeDeclaration","TypeDeclaration","typeReference","GoTypeReference","init_process","init_buffer","GO_RESERVED_IDENTIFIERS","goExportedFieldName","name","stripped","result","firstChar","init_process","init_buffer","init_path","DEFAULT_MODULE_PATH","resolveRootImportPath","config","customConfig","suffix","getMajorVersionSuffix","importPath","getImportPath","maybeAppendMajorVersionSuffix","getImportPath","config","customConfig","isModulePath","_a","_b","_c","_d","importPath","trimPrefix","DEFAULT_MODULE_PATH","path_default","getMajorVersionSuffix","majorVersion","parseMajorVersion","version","getVersion","split","maybeAppendMajorVersionSuffix","basename","str","prefix","mode","init_process","init_buffer","DynamicTypeInstantiationMapper","context","__publicField","args","Severity","go_exports","named","inner","collectionLiteral","aliasName","aliasImportPath","assertNever","converted","list","value","v","index","map","key","as","aliasType","internal","writer","values","entries","entry","literal","discriminatedUnion","structTypeReference","discriminatedUnionTypeInstance","unionVariant","baseFields","record","singleDiscriminatedUnionType","_a","_b","property","object_","properties","enum_","name","enumValue","undiscriminatedUnion","result","fieldName","typeReference","typeInstantiation","e","keyFieldName","valueFieldName","set","primitive","num","bool","str","date","dateTime","normalizedDateTime","uuid","base64","bigInt","init_process","init_buffer","DynamicTypeMapper","context","__publicField","args","go_exports","named","assertNever","literal","goTypeReference","primitive","init_process","init_buffer","FilePropertyMapper","context","__publicField","body","value","_a","result","record","property","assertNever","fileValue","go_exports","fileValues","bodyPropertyValue","DynamicSnippetsGeneratorContext","_DynamicSnippetsGeneratorContext","AbstractDynamicSnippetsGeneratorContext","ir","config","__publicField","DynamicTypeMapper","DynamicTypeInstantiationMapper","FilePropertyMapper","resolveRootImportPath","typeReference","assertNever","name","endpoint","goExportedFieldName","fernFilepath","parts","path","_a","go_exports","s","_b","declaration","environmentID","environmentName","baseFunc","methods","current","method","init_process","init_buffer","SNIPPET_PACKAGE_NAME","SNIPPET_IMPORT_PATH","SNIPPET_FUNC_NAME","CLIENT_VAR_NAME","TypeInst","go_exports","WIREMOCK_BASE_URL","WIREMOCK_CLIENT_VAR_NAME","EndpointSnippetGenerator","context","formatter","__publicField","endpoint","request","options","_a","_b","_c","snippet","writer","node","otherArgs","requestArg","requestRef","args","baseUrlArg","Severity","Scope","auth","values","assertNever","message","baseUrl","environment","typeReference","headers","header","arg","value","typeInstantiation","pathParameters","field","body","_d","_e","_f","inlinePathParameters","inlineFileProperties","pathParameterFields","filePropertyInfo","queryParameterFields","queryParameter","headerFields","requestBodyFields","parameters","fields","bodyProperties","parameter","namedParameters","val","arguments_","errorCase","ENDPOINT_STUB_NAME","DynamicSnippetsGenerator","AbstractDynamicSnippetsGenerator","ir","config","formatter","DynamicSnippetsGeneratorContext","__publicField","request","options","context","EndpointSnippetGenerator"]}
|