@fern-api/java-dynamic-snippets 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/cjs/DynamicSnippetsGenerator.cjs +3 -3
  2. package/cjs/DynamicSnippetsGenerator.cjs.map +1 -1
  3. package/cjs/EndpointSnippetGenerator.cjs +2 -2
  4. package/cjs/EndpointSnippetGenerator.cjs.map +1 -1
  5. package/cjs/context/DynamicSnippetsGeneratorContext.cjs +5 -5
  6. package/cjs/context/DynamicSnippetsGeneratorContext.cjs.map +1 -1
  7. package/cjs/context/DynamicTypeLiteralMapper.cjs +6 -6
  8. package/cjs/context/DynamicTypeLiteralMapper.cjs.map +1 -1
  9. package/cjs/context/DynamicTypeMapper.cjs +5 -5
  10. package/cjs/context/DynamicTypeMapper.cjs.map +1 -1
  11. package/cjs/context/FilePropertyMapper.cjs +5 -5
  12. package/cjs/context/FilePropertyMapper.cjs.map +1 -1
  13. package/cjs/index.cjs +3 -3
  14. package/cjs/index.cjs.map +1 -1
  15. package/esm/DynamicSnippetsGenerator.js +1 -1
  16. package/esm/EndpointSnippetGenerator.js +1 -1
  17. package/esm/{chunk-2KH7MFRW.js → chunk-4CABHDQV.js} +2 -2
  18. package/esm/{chunk-GESEOQT7.js → chunk-DD37GKIE.js} +2 -2
  19. package/esm/{chunk-OMKG67AN.js → chunk-FT6O7RFS.js} +2 -2
  20. package/esm/{chunk-6CITGEM3.js → chunk-JWUP3MFF.js} +3 -3
  21. package/esm/chunk-JWUP3MFF.js.map +1 -0
  22. package/esm/{chunk-G35HVZPV.js → chunk-PSRNJYSA.js} +2 -2
  23. package/esm/{chunk-L6HHZWHP.js → chunk-RVPVA4ZP.js} +2 -2
  24. package/esm/{chunk-SNGFCNTO.js → chunk-TJKLGKYV.js} +2 -2
  25. package/esm/chunk-V3XTHNV6.js +8 -0
  26. package/esm/chunk-V3XTHNV6.js.map +1 -0
  27. package/esm/context/DynamicSnippetsGeneratorContext.js +1 -1
  28. package/esm/context/DynamicTypeLiteralMapper.js +1 -1
  29. package/esm/context/DynamicTypeMapper.js +1 -1
  30. package/esm/context/FilePropertyMapper.js +1 -1
  31. package/esm/index.js +1 -1
  32. package/package.json +1 -1
  33. package/esm/chunk-6CITGEM3.js.map +0 -1
  34. package/esm/chunk-GTD7VYDZ.js +0 -8
  35. package/esm/chunk-GTD7VYDZ.js.map +0 -1
  36. /package/esm/{chunk-2KH7MFRW.js.map → chunk-4CABHDQV.js.map} +0 -0
  37. /package/esm/{chunk-GESEOQT7.js.map → chunk-DD37GKIE.js.map} +0 -0
  38. /package/esm/{chunk-OMKG67AN.js.map → chunk-FT6O7RFS.js.map} +0 -0
  39. /package/esm/{chunk-G35HVZPV.js.map → chunk-PSRNJYSA.js.map} +0 -0
  40. /package/esm/{chunk-L6HHZWHP.js.map → chunk-RVPVA4ZP.js.map} +0 -0
  41. /package/esm/{chunk-SNGFCNTO.js.map → chunk-TJKLGKYV.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-SNGFCNTO.js";import"./chunk-G35HVZPV.js";import"./chunk-OMKG67AN.js";import"./chunk-GTD7VYDZ.js";import"./chunk-GESEOQT7.js";import"./chunk-L6HHZWHP.js";import"./chunk-2KH7MFRW.js";import"./chunk-6CITGEM3.js";import"./chunk-2U3YQWRZ.js";export{a as DynamicSnippetsGenerator};
1
+ import{a}from"./chunk-TJKLGKYV.js";import"./chunk-PSRNJYSA.js";import"./chunk-FT6O7RFS.js";import"./chunk-V3XTHNV6.js";import"./chunk-DD37GKIE.js";import"./chunk-RVPVA4ZP.js";import"./chunk-4CABHDQV.js";import"./chunk-JWUP3MFF.js";import"./chunk-2U3YQWRZ.js";export{a as DynamicSnippetsGenerator};
2
2
  //# sourceMappingURL=DynamicSnippetsGenerator.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-G35HVZPV.js";import"./chunk-GESEOQT7.js";import"./chunk-6CITGEM3.js";import"./chunk-2U3YQWRZ.js";export{a as EndpointSnippetGenerator};
1
+ import{a}from"./chunk-PSRNJYSA.js";import"./chunk-DD37GKIE.js";import"./chunk-JWUP3MFF.js";import"./chunk-2U3YQWRZ.js";export{a as EndpointSnippetGenerator};
2
2
  //# sourceMappingURL=EndpointSnippetGenerator.js.map
@@ -1,2 +1,2 @@
1
- import{a as s,d as n}from"./chunk-6CITGEM3.js";import{f as l,h as p,i as y}from"./chunk-2U3YQWRZ.js";p();y();var c=class{constructor({context:r}){l(this,"context");this.context=r}getFilePropertyInfo({body:r,value:o}){var a;let e={fileFields:[],bodyPropertyFields:[]},i=(a=this.context.getRecord(o))!=null?a:{};for(let t of r.properties)switch(t.type){case"file":e.fileFields.push({name:this.context.getMethodName(t.name),value:this.getSingleFileProperty({property:t,record:i})});break;case"fileArray":e.fileFields.push({name:this.context.getMethodName(t.name),value:this.getArrayFileProperty({property:t,record:i})});break;case"bodyProperty":e.bodyPropertyFields.push({name:this.context.getMethodName(t.name.name),value:this.getBodyProperty({property:t,record:i})});break;default:s(t)}return e}getSingleFileProperty({property:r,record:o}){let e=this.context.getSingleFileValue({property:r,record:o});return e==null?n.TypeLiteral.nop():n.TypeLiteral.reference(this.context.getFileStreamFromString(e))}getArrayFileProperty({property:r,record:o}){let e=this.context.getFileArrayValues({property:r,record:o});if(e==null)return n.TypeLiteral.nop();for(let i of e)return n.TypeLiteral.reference(this.context.getFileStreamFromString(i));return n.TypeLiteral.nop()}getBodyProperty({property:r,record:o}){let e=o[r.name.wireValue];return e==null?n.TypeLiteral.nop():this.context.dynamicTypeLiteralMapper.convert({typeReference:r.typeReference,value:e})}};export{c as a};
2
- //# sourceMappingURL=chunk-2KH7MFRW.js.map
1
+ import{a as s,d as n}from"./chunk-JWUP3MFF.js";import{f as l,h as p,i as y}from"./chunk-2U3YQWRZ.js";p();y();var c=class{constructor({context:r}){l(this,"context");this.context=r}getFilePropertyInfo({body:r,value:o}){var a;let e={fileFields:[],bodyPropertyFields:[]},i=(a=this.context.getRecord(o))!=null?a:{};for(let t of r.properties)switch(t.type){case"file":e.fileFields.push({name:this.context.getMethodName(t.name),value:this.getSingleFileProperty({property:t,record:i})});break;case"fileArray":e.fileFields.push({name:this.context.getMethodName(t.name),value:this.getArrayFileProperty({property:t,record:i})});break;case"bodyProperty":e.bodyPropertyFields.push({name:this.context.getMethodName(t.name.name),value:this.getBodyProperty({property:t,record:i})});break;default:s(t)}return e}getSingleFileProperty({property:r,record:o}){let e=this.context.getSingleFileValue({property:r,record:o});return e==null?n.TypeLiteral.nop():n.TypeLiteral.reference(this.context.getFileStreamFromString(e))}getArrayFileProperty({property:r,record:o}){let e=this.context.getFileArrayValues({property:r,record:o});if(e==null)return n.TypeLiteral.nop();for(let i of e)return n.TypeLiteral.reference(this.context.getFileStreamFromString(i));return n.TypeLiteral.nop()}getBodyProperty({property:r,record:o}){let e=o[r.name.wireValue];return e==null?n.TypeLiteral.nop():this.context.dynamicTypeLiteralMapper.convert({typeReference:r.typeReference,value:e})}};export{c as a};
2
+ //# sourceMappingURL=chunk-4CABHDQV.js.map
@@ -1,2 +1,2 @@
1
- import{a as m,b as R}from"./chunk-6CITGEM3.js";import{a as T,b as S,c as b,d as A,f as l,h as a,i as p}from"./chunk-2U3YQWRZ.js";a();p();a();p();var y=class{constructor(){l(this,"reporter");l(this,"snippet");l(this,"err");this.snippet=void 0,this.reporter=void 0,this.err=void 0}update({context:e,snippet:r}){this.shouldUpdate({snippet:r,reporter:e.errors})&&(this.reporter=e.errors.clone(),this.snippet=r)}getResponseOrThrow({endpoint:e}){var r;if(this.snippet!=null&&this.reporter!=null)return{snippet:this.snippet,errors:this.reporter.toDynamicSnippetErrors()};throw(r=this.err)!=null?r:new Error(`Failed to generate snippet for endpoint "${e.method} ${e.path}"`)}shouldUpdate({snippet:e,reporter:r}){var t,n;return this.reporter==null||this.reporter.size()>0&&r.size()===0?!0:e.length>((n=(t=this.snippet)==null?void 0:t.length)!=null?n:0)}};var E=class{constructor(e){l(this,"context");this.context=e}async generate(e,r={}){let t=this.context.resolveEndpointLocationOrThrow(e.endpoint);if(t.length===0)throw new Error(`No endpoints found that match "${e.endpoint.method} ${e.endpoint.path}"`);let n=new y;for(let i of t){let s=this.context.clone(),d=this.createSnippetGenerator(s);try{let u=await d.generateSnippet({endpoint:i,request:e,options:r});if(s.errors.empty())return{snippet:u,errors:void 0};n.update({context:s,snippet:u})}catch(u){n.err==null&&(n.err=u)}}return n.getResponseOrThrow({endpoint:e.endpoint})}generateSync(e,r={}){let t=this.context.resolveEndpointLocationOrThrow(e.endpoint);if(t.length===0)throw new Error(`No endpoints found that match "${e.endpoint.method} ${e.endpoint.path}"`);let n=new y;for(let i of t){let s=this.context.clone(),d=this.createSnippetGenerator(s);try{let u=d.generateSnippetSync({endpoint:i,request:e,options:r});if(s.errors.empty())return{snippet:u,errors:void 0};n.update({context:s,snippet:u})}catch(u){n.err==null&&(n.err=u)}}return n.getResponseOrThrow({endpoint:e.endpoint})}};a();p();var o={Critical:"CRITICAL",Warning:"WARNING"},v=class c{constructor(){l(this,"errors");l(this,"path");this.errors=[],this.path=[]}add(e){this.errors.push(S(T({},e),{path:[...this.path]}))}scope(e){this.path.push(e)}unscope(){this.path.pop()}getBySeverity(e){return this.errors.filter(r=>r.severity===e)}empty(){return this.errors.length===0}size(){return this.errors.length}clone(){let e=new c;return e.errors=[...this.errors],e.path=[...this.path],e}reset(){this.errors=[],this.path=[]}toDynamicSnippetErrors(){return this.errors.map(e=>({severity:e.severity,path:e.path!=null?this.pathToStringArray(e.path):void 0,message:e.message}))}pathToStringArray(e){let r=[];for(let t of e){if(typeof t=="string"){r.push(t);continue}r[r.length-1]+=`[${t.index}]`}return r}};a();p();a();p();a();p();var g=class{constructor(){l(this,"REFERENCE_REGEX",/^(GET|POST|PUT|DELETE|PATCH|HEAD)\s(\/\S*)$/)}validate(e){return this.REFERENCE_REGEX.test(e)?{type:"valid"}:{type:"invalid"}}tryParse(e){if(this.validate(e).type==="invalid")return;let t=e.match(this.REFERENCE_REGEX);if(!(t==null||t[1]==null||t[2]==null))return{method:t[1],path:t[2]}}};var w=class{constructor({ir:e,config:r,options:t={}}){l(this,"config");l(this,"options");l(this,"errors");l(this,"_ir");l(this,"httpEndpointReferenceParser");this._ir=e,this.config=r,this.options=t,this.errors=new v,this.httpEndpointReferenceParser=new g}associateQueryParametersByWireValue({parameters:e,values:r}){let t=[];for(let[n,i]of Object.entries(r)){this.errors.scope(n);try{let s=e.find(u=>u.name.wireValue===n);if(s==null)throw this.newParameterNotRecognizedError(n);let d=this.isListTypeReference(s.typeReference)&&!Array.isArray(i)?[i]:i;t.push({name:s.name,typeReference:s.typeReference,value:d})}finally{this.errors.unscope()}}return t}associateByWireValueOrDefault({parameters:e,values:r}){let t=[];for(let n of e){this.errors.scope(n.name.wireValue);try{let i=r[n.name.wireValue];if(i==null)if(n.typeReference.type==="primitive"&&n.typeReference.value==="STRING")i=`<${n.name.wireValue}>`;else{this.errors.add({severity:o.Critical,message:this.newParameterNotRecognizedError(n.name.wireValue).message});continue}t.push({name:n.name,typeReference:n.typeReference,value:i})}finally{this.errors.unscope()}}return t}associateByWireValue({parameters:e,values:r,ignoreMissingParameters:t}){let n=[];for(let[i,s]of Object.entries(r)){this.errors.scope(i);try{let d=e.find(u=>u.name.wireValue===i);if(d==null){if(t)continue;this.errors.add({severity:o.Critical,message:this.newParameterNotRecognizedError(i).message});continue}n.push({name:d.name,typeReference:d.typeReference,value:s})}finally{this.errors.unscope()}}return n}getExampleObjectProperties({parameters:e,snippetObject:r}){let t=typeof r=="object"&&r!==null&&!Array.isArray(r)?r:{},n=[];for(let i of e){let s=t[i.name.wireValue];s==null?i.typeReference.type==="nullable"&&n.push({name:i.name,typeReference:i.typeReference,value:null}):n.push({name:i.name,typeReference:i.typeReference,value:s})}return n}getSingleFileValue({property:e,record:r}){let t=r[e.wireValue];if(t!=null){if(typeof t!="string"){this.errors.add({severity:o.Critical,message:`Expected file value to be a string, got ${typeof t}`});return}return t}}getFileArrayValues({property:e,record:r}){let t=r[e.wireValue];if(t==null)return;if(!Array.isArray(t)){this.errors.add({severity:o.Critical,message:`Expected file array value to be an array of strings, got ${typeof t}`});return}let n=[];for(let i of t){if(typeof i!="string"){this.errors.add({severity:o.Critical,message:`Expected file array value to be an array of strings, got ${typeof i}`});return}n.push(i)}return n}getRecord(e){if(typeof e!="object"||Array.isArray(e)){this.errors.add({severity:o.Critical,message:`Expected object with key, value pairs but got: ${Array.isArray(e)?"array":typeof e}`});return}return e==null?{}:e}resolveNamedType({typeId:e}){let r=this._ir.types[e];if(r==null){this.errors.add({severity:o.Critical,message:`Type identified by "${e}" could not be found`});return}return r}resolveDiscriminatedUnionTypeInstance({discriminatedUnion:e,value:r}){let t=this.getRecord(r);if(t==null)return;let n=e.discriminant.wireValue,i=t[n];if(i==null){this.errors.add({severity:o.Critical,message:this.newParameterNotRecognizedError(n).message});return}if(typeof i!="string"){this.errors.add({severity:o.Critical,message:`Expected discriminant value to be a string but got: ${typeof i}`});return}let s=e.types[i];if(s==null){this.errors.add({severity:o.Critical,message:`No type found for discriminant value "${i}"`});return}let P=t,{[n]:d}=P,u=A(P,[b(n)]);return{singleDiscriminatedUnionType:s,discriminantValue:s.discriminantValue,value:u}}resolveEndpointOrThrow(e){let r=this.httpEndpointReferenceParser.tryParse(e);if(r==null)throw new Error(`Failed to parse endpoint reference "${e}"`);return this.resolveEndpointLocationOrThrow(r)}resolveEndpointLocation(e){let r=[];for(let t of Object.values(this._ir.endpoints))this.parsedEndpointMatches({endpoint:t,parsedEndpoint:e})&&r.push(t);return r}resolveEndpointLocationOrThrow(e){let r=this.resolveEndpointLocation(e);if(r.length===0)throw new Error(`Failed to find endpoint identified by "${e.method} ${e.path}"`);return r}needsRequestParameter({request:e,inlinePathParameters:r,inlineFileProperties:t}){var n;return this.includePathParametersInWrappedRequest({request:e,inlinePathParameters:r})||e.queryParameters!=null&&e.queryParameters.length>0||e.headers!=null&&e.headers.length>0?!0:e.body!=null?this.includeRequestBodyInWrappedRequest({body:e.body,inlineFileProperties:t}):!((n=e.metadata)!=null&&n.onlyPathParameters)}includePathParametersInWrappedRequest({request:e,inlinePathParameters:r}){var t,n;return r&&((n=(t=e.metadata)==null?void 0:t.includePathParameters)!=null?n:!1)}isFileUploadRequestBody(e){switch(e.type){case"fileUpload":return!0;case"properties":case"referenced":return!1;default:m(e)}}resolveEnvironmentName(e){if(this._ir.environments==null)return;let r=this._ir.environments.environments;switch(r.type){case"singleBaseUrl":{let t=r.environments.find(n=>n.id===e);return t==null?void 0:t.name}case"multipleBaseUrls":{let t=r.environments.find(n=>n.id===e);return t==null?void 0:t.name}default:m(r)}}isSingleEnvironmentID(e){return typeof e=="string"}isMultiEnvironmentValues(e){return typeof e=="object"}validateMultiEnvironmentUrlValues(e){if(this._ir.environments==null)return this.errors.add({severity:o.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;let r=this._ir.environments.environments;switch(r.type){case"singleBaseUrl":return this.errors.add({severity:o.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;case"multipleBaseUrls":{let t=r.environments[0];if(t==null)return this.errors.add({severity:o.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let n=new Set(R(t.urls));for(let i of R(e))n.has(i)&&n.delete(i);return n.size>0?(this.errors.add({severity:o.Critical,message:`The provided environments are invalid; got: [${Object.keys(e).join(", ")}], expected: [${R(t.urls).join(", ")}]`}),!1):!0}}}getValueAsNumber({value:e}){if(typeof e!="number"){this.errors.add({severity:o.Critical,message:this.newTypeMismatchError({expected:"number",value:e}).message});return}return e}getValueAsBoolean({value:e}){if(typeof e!="boolean"){this.errors.add({severity:o.Critical,message:this.newTypeMismatchError({expected:"boolean",value:e}).message});return}return e}getValueAsString({value:e}){if(typeof e!="string"){this.errors.add({severity:o.Critical,message:this.newTypeMismatchError({expected:"string",value:e}).message});return}return e}isOptional(e){switch(e.type){case"nullable":return this.isOptional(e.value);case"optional":return!0;case"named":{let r=this.resolveNamedType({typeId:e.value});return r==null?!1:r.type==="alias"?this.isNullable(r.typeReference):!1}}return!1}isNullable(e){switch(e.type){case"nullable":return!0;case"optional":return this.isNullable(e.value);case"named":{let r=this.resolveNamedType({typeId:e.value});return r==null?!1:r.type==="alias"?this.isNullable(r.typeReference):!1}}return!1}newAuthMismatchError({auth:e,values:r}){return new Error(`Expected auth type ${e.type}, got ${r.type}`)}newParameterNotRecognizedError(e){return new Error(`"${e}" is not a recognized parameter for this endpoint`)}newTypeMismatchError({expected:e,value:r}){return new Error(`Expected ${e}, got ${typeof r}`)}includeRequestBodyInWrappedRequest({body:e,inlineFileProperties:r}){switch(e.type){case"properties":case"referenced":return!0;case"fileUpload":return this.includeFileUploadBodyInWrappedRequest({fileUpload:e,inlineFileProperties:r});default:m(e)}}includeFileUploadBodyInWrappedRequest({fileUpload:e,inlineFileProperties:r}){return this.fileUploadHasBodyProperties({fileUpload:e})||r&&this.fileUploadHasFileProperties({fileUpload:e})}fileUploadHasBodyProperties({fileUpload:e}){return e.properties.some(r=>{switch(r.type){case"file":case"fileArray":return!1;case"bodyProperty":return!0;default:m(r)}})}fileUploadHasFileProperties({fileUpload:e}){return e.properties.some(r=>{switch(r.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:m(r)}})}isListTypeReference(e){return e.type==="optional"?this.isListTypeReference(e.value):e.type==="list"||e.type==="set"}parsedEndpointMatches({endpoint:e,parsedEndpoint:r}){return e.location.method===r.method&&e.location.path===r.path}};a();p();var x;(function(c){c.Concise="concise",c.Full="full"})(x||(x={}));a();p();var C={PathParameters:"pathParameters",QueryParameters:"queryParameters",Headers:"headers",RequestBody:"requestBody"};a();p();export{E as a,o as b,w as c,x as d,C as e};
2
- //# sourceMappingURL=chunk-GESEOQT7.js.map
1
+ import{a as m,b as R}from"./chunk-JWUP3MFF.js";import{a as T,b as S,c as b,d as A,f as l,h as a,i as p}from"./chunk-2U3YQWRZ.js";a();p();a();p();var y=class{constructor(){l(this,"reporter");l(this,"snippet");l(this,"err");this.snippet=void 0,this.reporter=void 0,this.err=void 0}update({context:e,snippet:r}){this.shouldUpdate({snippet:r,reporter:e.errors})&&(this.reporter=e.errors.clone(),this.snippet=r)}getResponseOrThrow({endpoint:e}){var r;if(this.snippet!=null&&this.reporter!=null)return{snippet:this.snippet,errors:this.reporter.toDynamicSnippetErrors()};throw(r=this.err)!=null?r:new Error(`Failed to generate snippet for endpoint "${e.method} ${e.path}"`)}shouldUpdate({snippet:e,reporter:r}){var t,n;return this.reporter==null||this.reporter.size()>0&&r.size()===0?!0:e.length>((n=(t=this.snippet)==null?void 0:t.length)!=null?n:0)}};var E=class{constructor(e){l(this,"context");this.context=e}async generate(e,r={}){let t=this.context.resolveEndpointLocationOrThrow(e.endpoint);if(t.length===0)throw new Error(`No endpoints found that match "${e.endpoint.method} ${e.endpoint.path}"`);let n=new y;for(let i of t){let s=this.context.clone(),d=this.createSnippetGenerator(s);try{let u=await d.generateSnippet({endpoint:i,request:e,options:r});if(s.errors.empty())return{snippet:u,errors:void 0};n.update({context:s,snippet:u})}catch(u){n.err==null&&(n.err=u)}}return n.getResponseOrThrow({endpoint:e.endpoint})}generateSync(e,r={}){let t=this.context.resolveEndpointLocationOrThrow(e.endpoint);if(t.length===0)throw new Error(`No endpoints found that match "${e.endpoint.method} ${e.endpoint.path}"`);let n=new y;for(let i of t){let s=this.context.clone(),d=this.createSnippetGenerator(s);try{let u=d.generateSnippetSync({endpoint:i,request:e,options:r});if(s.errors.empty())return{snippet:u,errors:void 0};n.update({context:s,snippet:u})}catch(u){n.err==null&&(n.err=u)}}return n.getResponseOrThrow({endpoint:e.endpoint})}};a();p();var o={Critical:"CRITICAL",Warning:"WARNING"},v=class c{constructor(){l(this,"errors");l(this,"path");this.errors=[],this.path=[]}add(e){this.errors.push(S(T({},e),{path:[...this.path]}))}scope(e){this.path.push(e)}unscope(){this.path.pop()}getBySeverity(e){return this.errors.filter(r=>r.severity===e)}empty(){return this.errors.length===0}size(){return this.errors.length}clone(){let e=new c;return e.errors=[...this.errors],e.path=[...this.path],e}reset(){this.errors=[],this.path=[]}toDynamicSnippetErrors(){return this.errors.map(e=>({severity:e.severity,path:e.path!=null?this.pathToStringArray(e.path):void 0,message:e.message}))}pathToStringArray(e){let r=[];for(let t of e){if(typeof t=="string"){r.push(t);continue}r[r.length-1]+=`[${t.index}]`}return r}};a();p();a();p();a();p();var g=class{constructor(){l(this,"REFERENCE_REGEX",/^(GET|POST|PUT|DELETE|PATCH|HEAD)\s(\/\S*)$/)}validate(e){return this.REFERENCE_REGEX.test(e)?{type:"valid"}:{type:"invalid"}}tryParse(e){if(this.validate(e).type==="invalid")return;let t=e.match(this.REFERENCE_REGEX);if(!(t==null||t[1]==null||t[2]==null))return{method:t[1],path:t[2]}}};var w=class{constructor({ir:e,config:r,options:t={}}){l(this,"config");l(this,"options");l(this,"errors");l(this,"_ir");l(this,"httpEndpointReferenceParser");this._ir=e,this.config=r,this.options=t,this.errors=new v,this.httpEndpointReferenceParser=new g}associateQueryParametersByWireValue({parameters:e,values:r}){let t=[];for(let[n,i]of Object.entries(r)){this.errors.scope(n);try{let s=e.find(u=>u.name.wireValue===n);if(s==null)throw this.newParameterNotRecognizedError(n);let d=this.isListTypeReference(s.typeReference)&&!Array.isArray(i)?[i]:i;t.push({name:s.name,typeReference:s.typeReference,value:d})}finally{this.errors.unscope()}}return t}associateByWireValueOrDefault({parameters:e,values:r}){let t=[];for(let n of e){this.errors.scope(n.name.wireValue);try{let i=r[n.name.wireValue];if(i==null)if(n.typeReference.type==="primitive"&&n.typeReference.value==="STRING")i=`<${n.name.wireValue}>`;else{this.errors.add({severity:o.Critical,message:this.newParameterNotRecognizedError(n.name.wireValue).message});continue}t.push({name:n.name,typeReference:n.typeReference,value:i})}finally{this.errors.unscope()}}return t}associateByWireValue({parameters:e,values:r,ignoreMissingParameters:t}){let n=[];for(let[i,s]of Object.entries(r)){this.errors.scope(i);try{let d=e.find(u=>u.name.wireValue===i);if(d==null){if(t)continue;this.errors.add({severity:o.Critical,message:this.newParameterNotRecognizedError(i).message});continue}n.push({name:d.name,typeReference:d.typeReference,value:s})}finally{this.errors.unscope()}}return n}getExampleObjectProperties({parameters:e,snippetObject:r}){let t=typeof r=="object"&&r!==null&&!Array.isArray(r)?r:{},n=[];for(let i of e){let s=t[i.name.wireValue];s==null?i.typeReference.type==="nullable"&&n.push({name:i.name,typeReference:i.typeReference,value:null}):n.push({name:i.name,typeReference:i.typeReference,value:s})}return n}getSingleFileValue({property:e,record:r}){let t=r[e.wireValue];if(t!=null){if(typeof t!="string"){this.errors.add({severity:o.Critical,message:`Expected file value to be a string, got ${typeof t}`});return}return t}}getFileArrayValues({property:e,record:r}){let t=r[e.wireValue];if(t==null)return;if(!Array.isArray(t)){this.errors.add({severity:o.Critical,message:`Expected file array value to be an array of strings, got ${typeof t}`});return}let n=[];for(let i of t){if(typeof i!="string"){this.errors.add({severity:o.Critical,message:`Expected file array value to be an array of strings, got ${typeof i}`});return}n.push(i)}return n}getRecord(e){if(typeof e!="object"||Array.isArray(e)){this.errors.add({severity:o.Critical,message:`Expected object with key, value pairs but got: ${Array.isArray(e)?"array":typeof e}`});return}return e==null?{}:e}resolveNamedType({typeId:e}){let r=this._ir.types[e];if(r==null){this.errors.add({severity:o.Critical,message:`Type identified by "${e}" could not be found`});return}return r}resolveDiscriminatedUnionTypeInstance({discriminatedUnion:e,value:r}){let t=this.getRecord(r);if(t==null)return;let n=e.discriminant.wireValue,i=t[n];if(i==null){this.errors.add({severity:o.Critical,message:this.newParameterNotRecognizedError(n).message});return}if(typeof i!="string"){this.errors.add({severity:o.Critical,message:`Expected discriminant value to be a string but got: ${typeof i}`});return}let s=e.types[i];if(s==null){this.errors.add({severity:o.Critical,message:`No type found for discriminant value "${i}"`});return}let P=t,{[n]:d}=P,u=A(P,[b(n)]);return{singleDiscriminatedUnionType:s,discriminantValue:s.discriminantValue,value:u}}resolveEndpointOrThrow(e){let r=this.httpEndpointReferenceParser.tryParse(e);if(r==null)throw new Error(`Failed to parse endpoint reference "${e}"`);return this.resolveEndpointLocationOrThrow(r)}resolveEndpointLocation(e){let r=[];for(let t of Object.values(this._ir.endpoints))this.parsedEndpointMatches({endpoint:t,parsedEndpoint:e})&&r.push(t);return r}resolveEndpointLocationOrThrow(e){let r=this.resolveEndpointLocation(e);if(r.length===0)throw new Error(`Failed to find endpoint identified by "${e.method} ${e.path}"`);return r}needsRequestParameter({request:e,inlinePathParameters:r,inlineFileProperties:t}){var n;return this.includePathParametersInWrappedRequest({request:e,inlinePathParameters:r})||e.queryParameters!=null&&e.queryParameters.length>0||e.headers!=null&&e.headers.length>0?!0:e.body!=null?this.includeRequestBodyInWrappedRequest({body:e.body,inlineFileProperties:t}):!((n=e.metadata)!=null&&n.onlyPathParameters)}includePathParametersInWrappedRequest({request:e,inlinePathParameters:r}){var t,n;return r&&((n=(t=e.metadata)==null?void 0:t.includePathParameters)!=null?n:!1)}isFileUploadRequestBody(e){switch(e.type){case"fileUpload":return!0;case"properties":case"referenced":return!1;default:m(e)}}resolveEnvironmentName(e){if(this._ir.environments==null)return;let r=this._ir.environments.environments;switch(r.type){case"singleBaseUrl":{let t=r.environments.find(n=>n.id===e);return t==null?void 0:t.name}case"multipleBaseUrls":{let t=r.environments.find(n=>n.id===e);return t==null?void 0:t.name}default:m(r)}}isSingleEnvironmentID(e){return typeof e=="string"}isMultiEnvironmentValues(e){return typeof e=="object"}validateMultiEnvironmentUrlValues(e){if(this._ir.environments==null)return this.errors.add({severity:o.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;let r=this._ir.environments.environments;switch(r.type){case"singleBaseUrl":return this.errors.add({severity:o.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;case"multipleBaseUrls":{let t=r.environments[0];if(t==null)return this.errors.add({severity:o.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let n=new Set(R(t.urls));for(let i of R(e))n.has(i)&&n.delete(i);return n.size>0?(this.errors.add({severity:o.Critical,message:`The provided environments are invalid; got: [${Object.keys(e).join(", ")}], expected: [${R(t.urls).join(", ")}]`}),!1):!0}}}getValueAsNumber({value:e}){if(typeof e!="number"){this.errors.add({severity:o.Critical,message:this.newTypeMismatchError({expected:"number",value:e}).message});return}return e}getValueAsBoolean({value:e}){if(typeof e!="boolean"){this.errors.add({severity:o.Critical,message:this.newTypeMismatchError({expected:"boolean",value:e}).message});return}return e}getValueAsString({value:e}){if(typeof e!="string"){this.errors.add({severity:o.Critical,message:this.newTypeMismatchError({expected:"string",value:e}).message});return}return e}isOptional(e){switch(e.type){case"nullable":return this.isOptional(e.value);case"optional":return!0;case"named":{let r=this.resolveNamedType({typeId:e.value});return r==null?!1:r.type==="alias"?this.isNullable(r.typeReference):!1}}return!1}isNullable(e){switch(e.type){case"nullable":return!0;case"optional":return this.isNullable(e.value);case"named":{let r=this.resolveNamedType({typeId:e.value});return r==null?!1:r.type==="alias"?this.isNullable(r.typeReference):!1}}return!1}newAuthMismatchError({auth:e,values:r}){return new Error(`Expected auth type ${e.type}, got ${r.type}`)}newParameterNotRecognizedError(e){return new Error(`"${e}" is not a recognized parameter for this endpoint`)}newTypeMismatchError({expected:e,value:r}){return new Error(`Expected ${e}, got ${typeof r}`)}includeRequestBodyInWrappedRequest({body:e,inlineFileProperties:r}){switch(e.type){case"properties":case"referenced":return!0;case"fileUpload":return this.includeFileUploadBodyInWrappedRequest({fileUpload:e,inlineFileProperties:r});default:m(e)}}includeFileUploadBodyInWrappedRequest({fileUpload:e,inlineFileProperties:r}){return this.fileUploadHasBodyProperties({fileUpload:e})||r&&this.fileUploadHasFileProperties({fileUpload:e})}fileUploadHasBodyProperties({fileUpload:e}){return e.properties.some(r=>{switch(r.type){case"file":case"fileArray":return!1;case"bodyProperty":return!0;default:m(r)}})}fileUploadHasFileProperties({fileUpload:e}){return e.properties.some(r=>{switch(r.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:m(r)}})}isListTypeReference(e){return e.type==="optional"?this.isListTypeReference(e.value):e.type==="list"||e.type==="set"}parsedEndpointMatches({endpoint:e,parsedEndpoint:r}){return e.location.method===r.method&&e.location.path===r.path}};a();p();var x;(function(c){c.Concise="concise",c.Full="full"})(x||(x={}));a();p();var C={PathParameters:"pathParameters",QueryParameters:"queryParameters",Headers:"headers",RequestBody:"requestBody"};a();p();export{E as a,o as b,w as c,x as d,C as e};
2
+ //# sourceMappingURL=chunk-DD37GKIE.js.map
@@ -1,4 +1,4 @@
1
- import{a as I}from"./chunk-GTD7VYDZ.js";import{c as T}from"./chunk-GESEOQT7.js";import{a as P}from"./chunk-L6HHZWHP.js";import{a as O}from"./chunk-2KH7MFRW.js";import{a as y,c as A,d as l}from"./chunk-6CITGEM3.js";import{f as x,h as t,i as a}from"./chunk-2U3YQWRZ.js";t();a();t();a();t();a();t();a();t();a();t();a();t();a();var we=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,j=we;var Le=typeof self=="object"&&self&&self.Object===Object&&self,Me=j||Le||Function("return this")(),F=Me;var Ee=F.Symbol,p=Ee;t();a();var w=Object.prototype,We=w.hasOwnProperty,Ue=w.toString,g=p?p.toStringTag:void 0;function Be(r){var s=We.call(r,g),e=r[g];try{r[g]=void 0;var o=!0}catch(i){}var f=Ue.call(r);return o&&(s?r[g]=e:delete r[g]),f}var L=Be;t();a();var ze=Object.prototype,De=ze.toString;function Ve(r){return De.call(r)}var M=Ve;var qe="[object Null]",Ze="[object Undefined]",E=p?p.toStringTag:void 0;function Ge(r){return r==null?r===void 0?Ze:qe:E&&E in Object(r)?L(r):M(r)}var W=Ge;t();a();function Je(r){return r!=null&&typeof r=="object"}var U=Je;var He="[object Symbol]";function _e(r){return typeof r=="symbol"||U(r)&&W(r)==He}var B=_e;t();a();t();a();function Ke(r,s){for(var e=-1,o=r==null?0:r.length,f=Array(o);++e<o;)f[e]=s(r[e],e,r);return f}var z=Ke;t();a();var Ye=Array.isArray,D=Ye;var $e=1/0,V=p?p.prototype:void 0,q=V?V.toString:void 0;function Z(r){if(typeof r=="string")return r;if(D(r))return z(r,Z)+"";if(B(r))return q?q.call(r):"";var s=r+"";return s=="0"&&1/r==-$e?"-0":s}var G=Z;t();a();function Qe(r){return r==null?"":G(r)}var m=Qe;t();a();t();a();t();a();t();a();t();a();t();a();function Xe(r,s,e){var o=-1,f=r.length;s<0&&(s=-s>f?0:f+s),e=e>f?f:e,e<0&&(e+=f),f=s>e?0:e-s>>>0,s>>>=0;for(var i=Array(f);++o<f;)i[o]=r[o+s];return i}var J=Xe;function er(r,s,e){var o=r.length;return e=e===void 0?o:e,!s&&e>=o?r:J(r,s,e)}var H=er;t();a();var rr="\\ud800-\\udfff",tr="\\u0300-\\u036f",ar="\\ufe20-\\ufe2f",or="\\u20d0-\\u20ff",fr=tr+ar+or,sr="\\ufe0e\\ufe0f",ur="\\u200d",nr=RegExp("["+ur+rr+fr+sr+"]");function lr(r){return nr.test(r)}var h=lr;t();a();t();a();function ir(r){return r.split("")}var _=ir;t();a();var K="\\ud800-\\udfff",pr="\\u0300-\\u036f",mr="\\ufe20-\\ufe2f",dr="\\u20d0-\\u20ff",xr=pr+mr+dr,cr="\\ufe0e\\ufe0f",gr="["+K+"]",C="["+xr+"]",R="\\ud83c[\\udffb-\\udfff]",hr="(?:"+C+"|"+R+")",Y="[^"+K+"]",$="(?:\\ud83c[\\udde6-\\uddff]){2}",Q="[\\ud800-\\udbff][\\udc00-\\udfff]",br="\\u200d",X=hr+"?",ee="["+cr+"]?",yr="(?:"+br+"(?:"+[Y,$,Q].join("|")+")"+ee+X+")*",Cr=ee+X+yr,Rr="(?:"+[Y+C+"?",C,$,Q,gr].join("|")+")",Nr=RegExp(R+"(?="+R+")|"+Rr+Cr,"g");function vr(r){return r.match(Nr)||[]}var re=vr;function kr(r){return h(r)?re(r):_(r)}var te=kr;function Sr(r){return function(s){s=m(s);var e=h(s)?te(s):void 0,o=e?e[0]:s.charAt(0),f=e?H(e,1).join(""):s.slice(1);return o[r]()+f}}var ae=Sr;var Tr=ae("toUpperCase"),oe=Tr;function Ar(r){return oe(m(r).toLowerCase())}var fe=Ar;t();a();t();a();function Ir(r,s,e,o){var f=-1,i=r==null?0:r.length;for(o&&i&&(e=r[++f]);++f<i;)e=s(e,r[f],f,r);return e}var se=Ir;t();a();t();a();t();a();function Pr(r){return function(s){return r==null?void 0:r[s]}}var ue=Pr;var Or={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},jr=ue(Or),ne=jr;var Fr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,wr="\\u0300-\\u036f",Lr="\\ufe20-\\ufe2f",Mr="\\u20d0-\\u20ff",Er=wr+Lr+Mr,Wr="["+Er+"]",Ur=RegExp(Wr,"g");function Br(r){return r=m(r),r&&r.replace(Fr,ne).replace(Ur,"")}var le=Br;t();a();t();a();var zr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Dr(r){return r.match(zr)||[]}var ie=Dr;t();a();var Vr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function qr(r){return Vr.test(r)}var pe=qr;t();a();var ge="\\ud800-\\udfff",Zr="\\u0300-\\u036f",Gr="\\ufe20-\\ufe2f",Jr="\\u20d0-\\u20ff",Hr=Zr+Gr+Jr,he="\\u2700-\\u27bf",be="a-z\\xdf-\\xf6\\xf8-\\xff",_r="\\xac\\xb1\\xd7\\xf7",Kr="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Yr="\\u2000-\\u206f",$r=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ye="A-Z\\xc0-\\xd6\\xd8-\\xde",Qr="\\ufe0e\\ufe0f",Ce=_r+Kr+Yr+$r,Re="['\u2019]",me="["+Ce+"]",Xr="["+Hr+"]",Ne="\\d+",et="["+he+"]",ve="["+be+"]",ke="[^"+ge+Ce+Ne+he+be+ye+"]",rt="\\ud83c[\\udffb-\\udfff]",tt="(?:"+Xr+"|"+rt+")",at="[^"+ge+"]",Se="(?:\\ud83c[\\udde6-\\uddff]){2}",Te="[\\ud800-\\udbff][\\udc00-\\udfff]",c="["+ye+"]",ot="\\u200d",de="(?:"+ve+"|"+ke+")",ft="(?:"+c+"|"+ke+")",xe="(?:"+Re+"(?:d|ll|m|re|s|t|ve))?",ce="(?:"+Re+"(?:D|LL|M|RE|S|T|VE))?",Ae=tt+"?",Ie="["+Qr+"]?",st="(?:"+ot+"(?:"+[at,Se,Te].join("|")+")"+Ie+Ae+")*",ut="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",nt="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",lt=Ie+Ae+st,it="(?:"+[et,Se,Te].join("|")+")"+lt,pt=RegExp([c+"?"+ve+"+"+xe+"(?="+[me,c,"$"].join("|")+")",ft+"+"+ce+"(?="+[me,c+de,"$"].join("|")+")",c+"?"+de+"+"+xe,c+"+"+ce,nt,ut,Ne,it].join("|"),"g");function mt(r){return r.match(pt)||[]}var Pe=mt;function dt(r,s,e){return r=m(r),s=e?void 0:s,s===void 0?pe(r)?Pe(r):ie(r):r.match(s)||[]}var Oe=dt;var xt="['\u2019]",ct=RegExp(xt,"g");function gt(r){return function(s){return se(Oe(le(s).replace(ct,"")),r,"")}}var je=gt;var ht=je(function(r,s,e){return s=s.toLowerCase(),r+(e?fe(s):s)}),N=ht;var bt=new Set(["enum","extends","package","void","short","class","abstract","return","import","for","assert","switch","getClass"]),Fe=class r extends T{constructor({ir:e,config:o,options:f}){var i;super({ir:e,config:o,options:f});x(this,"ir");x(this,"customConfig");x(this,"dynamicTypeMapper");x(this,"dynamicTypeLiteralMapper");x(this,"filePropertyMapper");this.ir=e,this.customConfig=A.parse((i=o.customConfig)!=null?i:{}),this.dynamicTypeMapper=new P({context:this}),this.dynamicTypeLiteralMapper=new I({context:this}),this.filePropertyMapper=new O({context:this})}clone(){return new r({ir:this.ir,config:this.config,options:this.options})}getClassName(e){return this.getName(e.pascalCase.safeName)}getEnumName(e){return this.getName(e.screamingSnakeCase.safeName)}getPropertyName(e){return this.getName(e.camelCase.safeName)}getMethodName(e){return this.getName(e.camelCase.safeName)}getRootClientClassReference(){return l.classReference({name:this.getRootClientClassName(),packageName:this.getRootPackageName()})}getRootClientClassName(){var e,o;return(o=(e=this.customConfig)==null?void 0:e["client-class-name"])!=null?o:`${this.getBaseNamePrefix()}Client`}getEnvironmentClassName(){return"Environment"}getEnvironmentTypeReferenceFromID(e){let o=this.resolveEnvironmentName(e);if(o!=null)return l.codeblock(f=>{f.writeNode(this.getEnvironmentClassReference()),f.write("."),f.write(this.getEnumName(o))})}getEnvironmentClassReference(){return l.classReference({name:this.getEnvironmentClassName(),packageName:this.getCorePackageName()})}getJavaClassReferenceFromDeclaration({declaration:e}){return l.classReference({name:e.name.pascalCase.unsafeName,packageName:this.getTypesPackageName(e.fernFilepath)})}getNullableClassReference(){return l.classReference({name:"Nullable",packageName:this.getCorePackageName()})}getNullableOfNull(){return l.TypeLiteral.reference(l.invokeMethod({on:this.getNullableClassReference(),method:"ofNull",arguments_:[]}))}getOptionalNullableClassReference(){return l.classReference({name:"OptionalNullable",packageName:this.getCorePackageName()})}getOptionalNullableAbsent(){return l.TypeLiteral.reference(l.invokeMethod({on:this.getOptionalNullableClassReference(),method:"absent",arguments_:[]}))}getOptionalNullableOf(e){return l.TypeLiteral.reference(l.invokeMethod({on:this.getOptionalNullableClassReference(),method:"of",arguments_:[e]}))}getFileStreamFromString(e){return l.TypeLiteral.reference(l.codeblock(o=>{o.write("new "),o.writeNode(this.getFileStreamClassReference()),o.write("("),o.writeNode(this.getByteArrayInputStreamClassReference()),o.write("("),o.writeNode(l.TypeLiteral.string(e)),o.write(".getBytes("),o.writeNode(this.getStandardCharsetsClassReference()),o.write(".UTF_8)))")}))}getFileStreamClassReference(){return l.classReference({name:"FileStream",packageName:this.getCorePackageName()})}getByteArrayInputStreamClassReference(){return l.classReference({name:"ByteArrayInputStream",packageName:"java.io"})}getStandardCharsetsClassReference(){return l.classReference({name:"StandardCharsets",packageName:"java.nio.charset"})}isPrimitive(e){switch(e.type){case"primitive":return!0;case"optional":case"nullable":return this.isPrimitive(e.value);case"named":{let o=this.resolveNamedType({typeId:e.value});if(o==null)return!1;switch(o.type){case"alias":return this.isPrimitive(o.typeReference);case"discriminatedUnion":case"undiscriminatedUnion":case"object":case"enum":return!1;default:y(o)}break}case"list":case"set":case"map":case"literal":case"unknown":return!1;default:y(e)}}isDirectLiteral(e){return e.type==="literal"}sortTypeInstancesByRequiredFirst(e,o){let f=new Map;o.forEach((d,b)=>{f.set(d.name.wireValue,b)});let i=[],v=[];for(let d of e)this.isOptional(d.typeReference)?v.push(d):i.push(d);return i.sort((d,b)=>{var k,S;return((k=f.get(d.name.wireValue))!=null?k:0)-((S=f.get(b.name.wireValue))!=null?S:0)}),[...i,...v]}getRootPackageName(){let e=this.getPackagePrefixTokens();return this.joinPackageTokens(e)}getCorePackageName(){let e=this.getPackagePrefixTokens();return e.push("core"),this.joinPackageTokens(e)}getTypesPackageName(e){return this.getResourcesPackage(e,"types")}getRequestsPackageName(e){return this.getPackageLayout()==="flat"?this.getTypesPackageName(e):this.getResourcesPackage(e,"requests")}getResourcesPackage(e,o){let f=this.getPackagePrefixTokens();switch(this.getPackageLayout()){case"flat":e!=null&&f.push(...e.packagePath.map(i=>this.getPackageNameSegment(i)));break;case"nested":default:e!=null&&e.allParts.length>0&&f.push("resources"),e!=null&&f.push(...e.allParts.map(i=>this.getPackageNameSegment(i)))}return o!=null&&f.push(o),this.joinPackageTokens(f)}getPackageName(e,o){let f=this.getPackageNameSegments(e);return f=o!=null?[...f,o]:f,[...this.getPackagePrefixTokens(),...f].join(".")}getPackageLayout(){var e,o;return(o=(e=this.customConfig)==null?void 0:e["package-layout"])!=null?o:"nested"}shouldInlinePathParameters(){var e,o;return(o=(e=this.customConfig)==null?void 0:e["inline-path-parameters"])!=null?o:!1}shouldInlineFileProperties(){var e,o;return(o=(e=this.customConfig)==null?void 0:e["inline-file-properties"])!=null?o:!1}getPackageNameSegments(e){return e.packagePath.map(o=>this.getPackageNameSegment(o))}getPackageNameSegment(e){return e.camelCase.safeName.toLowerCase()}getPackagePrefixTokens(){var o;if(((o=this.customConfig)==null?void 0:o["package-prefix"])!=null)return this.customConfig["package-prefix"].split(".");let e=[];return e.push("com"),e.push(...this.splitOnNonAlphaNumericChar(this.config.organization)),e.push(...this.splitOnNonAlphaNumericChar(this.getApiName())),e}getBaseNamePrefix(){return this.convertKebabCaseToUpperCamelCase(this.config.organization)+this.convertKebabCaseToUpperCamelCase(this.getApiName())}getApiName(){return N(this.config.workspaceName)}startsWithNumber(e){return/^\d/.test(e)}splitOnNonAlphaNumericChar(e){return e.split(/[^a-zA-Z0-9]/)}convertKebabCaseToUpperCamelCase(e){return e.replace(/-([a-z])/g,(o,f)=>f.toUpperCase()).replace(/^[a-z]/,o=>o.toUpperCase())}joinPackageTokens(e){return e.map(f=>this.startsWithNumber(f)?"_"+f:f).join(".")}getName(e){return this.isReservedName(e)?"_"+e:e}isReservedName(e){return bt.has(e)}};export{Fe as a};
1
+ import{a as I}from"./chunk-V3XTHNV6.js";import{c as T}from"./chunk-DD37GKIE.js";import{a as P}from"./chunk-RVPVA4ZP.js";import{a as O}from"./chunk-4CABHDQV.js";import{a as y,c as A,d as l}from"./chunk-JWUP3MFF.js";import{f as x,h as t,i as a}from"./chunk-2U3YQWRZ.js";t();a();t();a();t();a();t();a();t();a();t();a();t();a();var we=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,j=we;var Le=typeof self=="object"&&self&&self.Object===Object&&self,Me=j||Le||Function("return this")(),F=Me;var Ee=F.Symbol,p=Ee;t();a();var w=Object.prototype,We=w.hasOwnProperty,Ue=w.toString,g=p?p.toStringTag:void 0;function Be(r){var s=We.call(r,g),e=r[g];try{r[g]=void 0;var o=!0}catch(i){}var f=Ue.call(r);return o&&(s?r[g]=e:delete r[g]),f}var L=Be;t();a();var ze=Object.prototype,De=ze.toString;function Ve(r){return De.call(r)}var M=Ve;var qe="[object Null]",Ze="[object Undefined]",E=p?p.toStringTag:void 0;function Ge(r){return r==null?r===void 0?Ze:qe:E&&E in Object(r)?L(r):M(r)}var W=Ge;t();a();function Je(r){return r!=null&&typeof r=="object"}var U=Je;var He="[object Symbol]";function _e(r){return typeof r=="symbol"||U(r)&&W(r)==He}var B=_e;t();a();t();a();function Ke(r,s){for(var e=-1,o=r==null?0:r.length,f=Array(o);++e<o;)f[e]=s(r[e],e,r);return f}var z=Ke;t();a();var Ye=Array.isArray,D=Ye;var $e=1/0,V=p?p.prototype:void 0,q=V?V.toString:void 0;function Z(r){if(typeof r=="string")return r;if(D(r))return z(r,Z)+"";if(B(r))return q?q.call(r):"";var s=r+"";return s=="0"&&1/r==-$e?"-0":s}var G=Z;t();a();function Qe(r){return r==null?"":G(r)}var m=Qe;t();a();t();a();t();a();t();a();t();a();t();a();function Xe(r,s,e){var o=-1,f=r.length;s<0&&(s=-s>f?0:f+s),e=e>f?f:e,e<0&&(e+=f),f=s>e?0:e-s>>>0,s>>>=0;for(var i=Array(f);++o<f;)i[o]=r[o+s];return i}var J=Xe;function er(r,s,e){var o=r.length;return e=e===void 0?o:e,!s&&e>=o?r:J(r,s,e)}var H=er;t();a();var rr="\\ud800-\\udfff",tr="\\u0300-\\u036f",ar="\\ufe20-\\ufe2f",or="\\u20d0-\\u20ff",fr=tr+ar+or,sr="\\ufe0e\\ufe0f",ur="\\u200d",nr=RegExp("["+ur+rr+fr+sr+"]");function lr(r){return nr.test(r)}var h=lr;t();a();t();a();function ir(r){return r.split("")}var _=ir;t();a();var K="\\ud800-\\udfff",pr="\\u0300-\\u036f",mr="\\ufe20-\\ufe2f",dr="\\u20d0-\\u20ff",xr=pr+mr+dr,cr="\\ufe0e\\ufe0f",gr="["+K+"]",C="["+xr+"]",R="\\ud83c[\\udffb-\\udfff]",hr="(?:"+C+"|"+R+")",Y="[^"+K+"]",$="(?:\\ud83c[\\udde6-\\uddff]){2}",Q="[\\ud800-\\udbff][\\udc00-\\udfff]",br="\\u200d",X=hr+"?",ee="["+cr+"]?",yr="(?:"+br+"(?:"+[Y,$,Q].join("|")+")"+ee+X+")*",Cr=ee+X+yr,Rr="(?:"+[Y+C+"?",C,$,Q,gr].join("|")+")",Nr=RegExp(R+"(?="+R+")|"+Rr+Cr,"g");function vr(r){return r.match(Nr)||[]}var re=vr;function kr(r){return h(r)?re(r):_(r)}var te=kr;function Sr(r){return function(s){s=m(s);var e=h(s)?te(s):void 0,o=e?e[0]:s.charAt(0),f=e?H(e,1).join(""):s.slice(1);return o[r]()+f}}var ae=Sr;var Tr=ae("toUpperCase"),oe=Tr;function Ar(r){return oe(m(r).toLowerCase())}var fe=Ar;t();a();t();a();function Ir(r,s,e,o){var f=-1,i=r==null?0:r.length;for(o&&i&&(e=r[++f]);++f<i;)e=s(e,r[f],f,r);return e}var se=Ir;t();a();t();a();t();a();function Pr(r){return function(s){return r==null?void 0:r[s]}}var ue=Pr;var Or={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},jr=ue(Or),ne=jr;var Fr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,wr="\\u0300-\\u036f",Lr="\\ufe20-\\ufe2f",Mr="\\u20d0-\\u20ff",Er=wr+Lr+Mr,Wr="["+Er+"]",Ur=RegExp(Wr,"g");function Br(r){return r=m(r),r&&r.replace(Fr,ne).replace(Ur,"")}var le=Br;t();a();t();a();var zr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Dr(r){return r.match(zr)||[]}var ie=Dr;t();a();var Vr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function qr(r){return Vr.test(r)}var pe=qr;t();a();var ge="\\ud800-\\udfff",Zr="\\u0300-\\u036f",Gr="\\ufe20-\\ufe2f",Jr="\\u20d0-\\u20ff",Hr=Zr+Gr+Jr,he="\\u2700-\\u27bf",be="a-z\\xdf-\\xf6\\xf8-\\xff",_r="\\xac\\xb1\\xd7\\xf7",Kr="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Yr="\\u2000-\\u206f",$r=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ye="A-Z\\xc0-\\xd6\\xd8-\\xde",Qr="\\ufe0e\\ufe0f",Ce=_r+Kr+Yr+$r,Re="['\u2019]",me="["+Ce+"]",Xr="["+Hr+"]",Ne="\\d+",et="["+he+"]",ve="["+be+"]",ke="[^"+ge+Ce+Ne+he+be+ye+"]",rt="\\ud83c[\\udffb-\\udfff]",tt="(?:"+Xr+"|"+rt+")",at="[^"+ge+"]",Se="(?:\\ud83c[\\udde6-\\uddff]){2}",Te="[\\ud800-\\udbff][\\udc00-\\udfff]",c="["+ye+"]",ot="\\u200d",de="(?:"+ve+"|"+ke+")",ft="(?:"+c+"|"+ke+")",xe="(?:"+Re+"(?:d|ll|m|re|s|t|ve))?",ce="(?:"+Re+"(?:D|LL|M|RE|S|T|VE))?",Ae=tt+"?",Ie="["+Qr+"]?",st="(?:"+ot+"(?:"+[at,Se,Te].join("|")+")"+Ie+Ae+")*",ut="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",nt="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",lt=Ie+Ae+st,it="(?:"+[et,Se,Te].join("|")+")"+lt,pt=RegExp([c+"?"+ve+"+"+xe+"(?="+[me,c,"$"].join("|")+")",ft+"+"+ce+"(?="+[me,c+de,"$"].join("|")+")",c+"?"+de+"+"+xe,c+"+"+ce,nt,ut,Ne,it].join("|"),"g");function mt(r){return r.match(pt)||[]}var Pe=mt;function dt(r,s,e){return r=m(r),s=e?void 0:s,s===void 0?pe(r)?Pe(r):ie(r):r.match(s)||[]}var Oe=dt;var xt="['\u2019]",ct=RegExp(xt,"g");function gt(r){return function(s){return se(Oe(le(s).replace(ct,"")),r,"")}}var je=gt;var ht=je(function(r,s,e){return s=s.toLowerCase(),r+(e?fe(s):s)}),N=ht;var bt=new Set(["enum","extends","package","void","short","class","abstract","return","import","for","assert","switch","getClass"]),Fe=class r extends T{constructor({ir:e,config:o,options:f}){var i;super({ir:e,config:o,options:f});x(this,"ir");x(this,"customConfig");x(this,"dynamicTypeMapper");x(this,"dynamicTypeLiteralMapper");x(this,"filePropertyMapper");this.ir=e,this.customConfig=A.parse((i=o.customConfig)!=null?i:{}),this.dynamicTypeMapper=new P({context:this}),this.dynamicTypeLiteralMapper=new I({context:this}),this.filePropertyMapper=new O({context:this})}clone(){return new r({ir:this.ir,config:this.config,options:this.options})}getClassName(e){return this.getName(e.pascalCase.safeName)}getEnumName(e){return this.getName(e.screamingSnakeCase.safeName)}getPropertyName(e){return this.getName(e.camelCase.safeName)}getMethodName(e){return this.getName(e.camelCase.safeName)}getRootClientClassReference(){return l.classReference({name:this.getRootClientClassName(),packageName:this.getRootPackageName()})}getRootClientClassName(){var e,o;return(o=(e=this.customConfig)==null?void 0:e["client-class-name"])!=null?o:`${this.getBaseNamePrefix()}Client`}getEnvironmentClassName(){return"Environment"}getEnvironmentTypeReferenceFromID(e){let o=this.resolveEnvironmentName(e);if(o!=null)return l.codeblock(f=>{f.writeNode(this.getEnvironmentClassReference()),f.write("."),f.write(this.getEnumName(o))})}getEnvironmentClassReference(){return l.classReference({name:this.getEnvironmentClassName(),packageName:this.getCorePackageName()})}getJavaClassReferenceFromDeclaration({declaration:e}){return l.classReference({name:e.name.pascalCase.unsafeName,packageName:this.getTypesPackageName(e.fernFilepath)})}getNullableClassReference(){return l.classReference({name:"Nullable",packageName:this.getCorePackageName()})}getNullableOfNull(){return l.TypeLiteral.reference(l.invokeMethod({on:this.getNullableClassReference(),method:"ofNull",arguments_:[]}))}getOptionalNullableClassReference(){return l.classReference({name:"OptionalNullable",packageName:this.getCorePackageName()})}getOptionalNullableAbsent(){return l.TypeLiteral.reference(l.invokeMethod({on:this.getOptionalNullableClassReference(),method:"absent",arguments_:[]}))}getOptionalNullableOf(e){return l.TypeLiteral.reference(l.invokeMethod({on:this.getOptionalNullableClassReference(),method:"of",arguments_:[e]}))}getFileStreamFromString(e){return l.TypeLiteral.reference(l.codeblock(o=>{o.write("new "),o.writeNode(this.getFileStreamClassReference()),o.write("("),o.writeNode(this.getByteArrayInputStreamClassReference()),o.write("("),o.writeNode(l.TypeLiteral.string(e)),o.write(".getBytes("),o.writeNode(this.getStandardCharsetsClassReference()),o.write(".UTF_8)))")}))}getFileStreamClassReference(){return l.classReference({name:"FileStream",packageName:this.getCorePackageName()})}getByteArrayInputStreamClassReference(){return l.classReference({name:"ByteArrayInputStream",packageName:"java.io"})}getStandardCharsetsClassReference(){return l.classReference({name:"StandardCharsets",packageName:"java.nio.charset"})}isPrimitive(e){switch(e.type){case"primitive":return!0;case"optional":case"nullable":return this.isPrimitive(e.value);case"named":{let o=this.resolveNamedType({typeId:e.value});if(o==null)return!1;switch(o.type){case"alias":return this.isPrimitive(o.typeReference);case"discriminatedUnion":case"undiscriminatedUnion":case"object":case"enum":return!1;default:y(o)}break}case"list":case"set":case"map":case"literal":case"unknown":return!1;default:y(e)}}isDirectLiteral(e){return e.type==="literal"}sortTypeInstancesByRequiredFirst(e,o){let f=new Map;o.forEach((d,b)=>{f.set(d.name.wireValue,b)});let i=[],v=[];for(let d of e)this.isOptional(d.typeReference)?v.push(d):i.push(d);return i.sort((d,b)=>{var k,S;return((k=f.get(d.name.wireValue))!=null?k:0)-((S=f.get(b.name.wireValue))!=null?S:0)}),[...i,...v]}getRootPackageName(){let e=this.getPackagePrefixTokens();return this.joinPackageTokens(e)}getCorePackageName(){let e=this.getPackagePrefixTokens();return e.push("core"),this.joinPackageTokens(e)}getTypesPackageName(e){return this.getResourcesPackage(e,"types")}getRequestsPackageName(e){return this.getPackageLayout()==="flat"?this.getTypesPackageName(e):this.getResourcesPackage(e,"requests")}getResourcesPackage(e,o){let f=this.getPackagePrefixTokens();switch(this.getPackageLayout()){case"flat":e!=null&&f.push(...e.packagePath.map(i=>this.getPackageNameSegment(i)));break;case"nested":default:e!=null&&e.allParts.length>0&&f.push("resources"),e!=null&&f.push(...e.allParts.map(i=>this.getPackageNameSegment(i)))}return o!=null&&f.push(o),this.joinPackageTokens(f)}getPackageName(e,o){let f=this.getPackageNameSegments(e);return f=o!=null?[...f,o]:f,[...this.getPackagePrefixTokens(),...f].join(".")}getPackageLayout(){var e,o;return(o=(e=this.customConfig)==null?void 0:e["package-layout"])!=null?o:"nested"}shouldInlinePathParameters(){var e,o;return(o=(e=this.customConfig)==null?void 0:e["inline-path-parameters"])!=null?o:!1}shouldInlineFileProperties(){var e,o;return(o=(e=this.customConfig)==null?void 0:e["inline-file-properties"])!=null?o:!1}getPackageNameSegments(e){return e.packagePath.map(o=>this.getPackageNameSegment(o))}getPackageNameSegment(e){return e.camelCase.safeName.toLowerCase()}getPackagePrefixTokens(){var o;if(((o=this.customConfig)==null?void 0:o["package-prefix"])!=null)return this.customConfig["package-prefix"].split(".");let e=[];return e.push("com"),e.push(...this.splitOnNonAlphaNumericChar(this.config.organization)),e.push(...this.splitOnNonAlphaNumericChar(this.getApiName())),e}getBaseNamePrefix(){return this.convertKebabCaseToUpperCamelCase(this.config.organization)+this.convertKebabCaseToUpperCamelCase(this.getApiName())}getApiName(){return N(this.config.workspaceName)}startsWithNumber(e){return/^\d/.test(e)}splitOnNonAlphaNumericChar(e){return e.split(/[^a-zA-Z0-9]/)}convertKebabCaseToUpperCamelCase(e){return e.replace(/-([a-z])/g,(o,f)=>f.toUpperCase()).replace(/^[a-z]/,o=>o.toUpperCase())}joinPackageTokens(e){return e.map(f=>this.startsWithNumber(f)?"_"+f:f).join(".")}getName(e){return this.isReservedName(e)?"_"+e:e}isReservedName(e){return bt.has(e)}};export{Fe as a};
2
2
  /*! Bundled license information:
3
3
 
4
4
  lodash-es/lodash.js:
@@ -12,4 +12,4 @@ lodash-es/lodash.js:
12
12
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
13
13
  *)
14
14
  */
15
- //# sourceMappingURL=chunk-OMKG67AN.js.map
15
+ //# sourceMappingURL=chunk-FT6O7RFS.js.map