@jackchuka/gql-ingest 1.1.0 → 1.3.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/bin/cli.js CHANGED
@@ -1,47 +1,50 @@
1
1
  #!/usr/bin/env node
2
- var an=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports);var un=an((fo,qr)=>{qr.exports={name:"@jackchuka/gql-ingest",version:"1.1.0",description:"A CLI tool for ingesting data from CSV files into a GraphQL API",type:"module",main:"dist/cli.js",bin:{"gql-ingest":"bin/cli.js"},scripts:{build:"node esbuild.config.js","build:types":"tsc --emitDeclarationOnly","build:all":"npm run build && npm run build:types",dev:"ts-node src/cli.ts",test:"jest","test:watch":"jest --watch",prepublishOnly:"npm run build:all"},keywords:["graphql","cli","csv","ingest","api"],author:"jackchuka",license:"MIT",repository:{type:"git",url:"https://github.com/jackchuka/gql-ingest.git"},dependencies:{commander:"^14.0.0","csv-parser":"^3.0.0","graphql-request":"^7.2.0","js-yaml":"^4.1.0"},devDependencies:{"@types/jest":"^30.0.0","@types/js-yaml":"^4.0.9","@types/node":"^24.0.4",esbuild:"^0.25.5",jest:"^30.0.3","ts-jest":"^29.4.0","ts-node":"^10.9.0",typescript:"^5.3.0"},files:["dist/**/*","src/**/*"]}});import{Command as Yr}from"commander";import{GraphQLClient as fn}from"graphql-request";var H=class{constructor(n,i,o,r=!1){this.client=new fn(n,{headers:i||{}}),this.metrics=o,this.verbose=r}async executeMutation(n,i){let o=Date.now();try{let r=await this.client.request(n,i);if(this.metrics){let l=Date.now()-o;this.metrics.recordRequestDuration(l)}return this.verbose&&console.log(`\u2713 GraphQL request completed in ${Date.now()-o}ms:`,r),r}catch(r){if(this.metrics){let l=Date.now()-o;this.metrics.recordRequestDuration(l)}throw this.verbose?console.error(`\u2717 GraphQL request failed in ${Date.now()-o}ms:`,r):console.error("GraphQL mutation failed:",r),r}}setHeaders(n){this.client.setHeaders(n)}};import J from"fs";import T from"path";import pn from"fs";import hn from"csv-parser";async function ge(e){return new Promise((n,i)=>{let o=[];pn.createReadStream(e).pipe(hn()).on("data",r=>o.push(r)).on("end",()=>n(o)).on("error",r=>i(r))})}var P=class{constructor(){this.metrics={totalEntities:0,totalSuccesses:0,totalFailures:0,entityMetrics:new Map,requestDurations:[],startTime:Date.now()}}startEntityProcessing(n){this.metrics.entityMetrics.has(n)||this.metrics.entityMetrics.set(n,{entityName:n,successCount:0,failureCount:0,startTime:Date.now()})}recordSuccess(n){let i=this.metrics.entityMetrics.get(n);i&&(i.successCount++,this.metrics.totalSuccesses++,this.metrics.totalEntities++)}recordFailure(n){let i=this.metrics.entityMetrics.get(n);i&&(i.failureCount++,this.metrics.totalFailures++,this.metrics.totalEntities++)}finishEntityProcessing(n){let i=this.metrics.entityMetrics.get(n);i&&(i.endTime=Date.now())}finishProcessing(){return this.metrics.endTime=Date.now(),{...this.metrics}}getEntityMetrics(n){return this.metrics.entityMetrics.get(n)}getTotalProcessed(){return this.metrics.totalEntities}getSuccessRate(){return this.metrics.totalEntities===0?0:this.metrics.totalSuccesses/this.metrics.totalEntities*100}recordRequestDuration(n){this.metrics.requestDurations.push(n)}getAverageRequestDuration(){return this.metrics.requestDurations.length===0?0:this.metrics.requestDurations.reduce((i,o)=>i+o,0)/this.metrics.requestDurations.length}getDurationMs(){return(this.metrics.endTime||Date.now())-this.metrics.startTime}generateSummary(){let n=this.getDurationMs(),i=this.getSuccessRate(),o=this.getAverageRequestDuration(),r=`
3
- \u{1F4CA} Processing Summary:
4
- `;if(r+=` Total Processed: ${this.metrics.totalEntities}
5
- `,r+=` \u2713 Successes: ${this.metrics.totalSuccesses}
6
- `,r+=` \u2717 Failures: ${this.metrics.totalFailures}
7
- `,r+=` Success Rate: ${i.toFixed(1)}%
8
- `,r+=` Duration: ${(n/1e3).toFixed(2)}s
9
- `,this.metrics.requestDurations.length>0&&(r+=` Avg Request Time: ${o.toFixed(0)}ms
10
- `),this.metrics.entityMetrics.size>1){r+=`
11
- \u{1F4CB} Per-Entity Breakdown:
12
- `;for(let[l,t]of this.metrics.entityMetrics){let c=t.successCount+t.failureCount,u=c>0?t.successCount/c*100:0,s=t.endTime?t.endTime-t.startTime:0;r+=` ${l}: ${c} total (${t.successCount} \u2713, ${t.failureCount} \u2717) - ${u.toFixed(1)}% success - ${(s/1e3).toFixed(2)}s
13
- `}}return r}};var U=class{constructor(n,i=process.cwd(),o,r=!1){this.client=n,this.basePath=i,this.metrics=o||new P,this.verbose=r}discoverMappings(n){let i=T.resolve(this.basePath,n,"mappings");try{let r=J.readdirSync(i).filter(l=>l.endsWith(".json")).sort();return console.log(`Discovered ${r.length} mapping files: ${r.join(", ")}`),r.map(l=>T.join(n,"mappings",l))}catch(o){return console.error(`Error reading mappings directory ${i}:`,o),[]}}async processEntity(n,i){let o=T.basename(n,".json");console.log(`Processing entity: ${n}`),this.metrics.startEntityProcessing(o);let r=T.resolve(this.basePath,n),l=JSON.parse(J.readFileSync(r,"utf8")),t=T.dirname(T.dirname(r)),c=T.resolve(t,l.csvFile),u=await ge(c),s=T.resolve(t,l.graphqlFile),f=J.readFileSync(s,"utf8");i&&i.concurrency>1?await this.processRowsConcurrently(u,f,l.mapping,o,i):await this.processRowsSequentially(u,f,l.mapping,o),this.metrics.finishEntityProcessing(o)}async processRowsSequentially(n,i,o,r){let l=n.length;for(let t=0;t<n.length;t++){let c=n[t],u=this.mapCsvRowToVariables(c,o);try{if(await this.client.executeMutation(i,u),this.metrics.recordSuccess(r),!this.verbose&&((t+1)%Math.max(1,Math.floor(l/10))===0||t===l-1)){let s=((t+1)/l*100).toFixed(1);console.log(`\u{1F4CA} Progress: ${t+1}/${l} (${s}%) \u2713`)}}catch(s){this.metrics.recordFailure(r),this.verbose||console.error(`\u2717 Failed to create entity for row ${t+1}:`,c,s)}}}async processRowsConcurrently(n,i,o,r,l){let t=l.concurrency;console.log(`Processing ${n.length} rows with concurrency: ${t}`);let c=this.chunkArray(n,t),u=0,s=n.length;for(let f=0;f<c.length;f++){let a=c[f],h=a.map(async x=>{let b=this.mapCsvRowToVariables(x,o);try{let g=await this.client.executeMutation(i,b);return this.metrics.recordSuccess(r),{success:!0,result:g,row:x}}catch(g){return this.metrics.recordFailure(r),{success:!1,error:g,row:x}}}),d=await Promise.allSettled(h);u+=a.length;let m=0,v=0;if(d.forEach(x=>{if(x.status==="fulfilled"){let{success:b,error:g,row:sn}=x.value;b?m++:(v++,this.verbose||console.error("\u2717 Failed to create entity for row:",sn,g))}else v++,this.verbose||console.error("\u2717 Promise rejected:",x.reason)}),!this.verbose){let x=(u/s*100).toFixed(1);console.log(`\u{1F4CA} Progress: ${u}/${s} (${x}%) - Chunk ${f+1}: ${m} \u2713, ${v} \u2717`)}}}chunkArray(n,i){let o=[];for(let r=0;r<n.length;r+=i)o.push(n.slice(r,r+i));return o}mapCsvRowToVariables(n,i){let o={};for(let[r,l]of Object.entries(i))n[l]!==void 0&&(o[r]=n[l]);return o}getMetrics(){return this.metrics}};import on from"fs";import Nr from"path";function Ie(e){return typeof e>"u"||e===null}function dn(e){return typeof e=="object"&&e!==null}function gn(e){return Array.isArray(e)?e:Ie(e)?[]:[e]}function mn(e,n){var i,o,r,l;if(n)for(l=Object.keys(n),i=0,o=l.length;i<o;i+=1)r=l[i],e[r]=n[r];return e}function xn(e,n){var i="",o;for(o=0;o<n;o+=1)i+=e;return i}function vn(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var yn=Ie,An=dn,Cn=gn,wn=xn,bn=vn,En=mn,A={isNothing:yn,isObject:An,toArray:Cn,repeat:wn,isNegativeZero:bn,extend:En};function ke(e,n){var i="",o=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(i+='in "'+e.mark.name+'" '),i+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!n&&e.mark.snippet&&(i+=`
2
+ var pr=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var ar=pr((xo,Yi)=>{Yi.exports={name:"@jackchuka/gql-ingest",version:"1.3.0",description:"A CLI tool for ingesting data from CSV files into a GraphQL API",type:"module",main:"dist/cli.js",bin:{"gql-ingest":"bin/cli.js"},scripts:{build:"node esbuild.config.js","build:types":"tsc --emitDeclarationOnly","build:all":"npm run build && npm run build:types",dev:"ts-node src/cli.ts",test:"jest","test:watch":"jest --watch",prepublishOnly:"npm run build:all"},keywords:["graphql","cli","csv","ingest","api"],author:"jackchuka",license:"MIT",repository:{type:"git",url:"https://github.com/jackchuka/gql-ingest.git"},dependencies:{commander:"^14.0.0","csv-parser":"^3.0.0","graphql-request":"^7.2.0","js-yaml":"^4.1.0"},devDependencies:{"@types/jest":"^30.0.0","@types/js-yaml":"^4.0.9","@types/node":"^24.0.4",esbuild:"^0.25.5",jest:"^30.0.3","ts-jest":"^29.4.0","ts-node":"^10.9.0",typescript:"^5.3.0"},files:["dist/**/*","src/**/*"]}});import{Command as Hi}from"commander";import{GraphQLClient as $i}from"graphql-request";import tr from"fs";import Ni from"path";function ke(e){return typeof e>"u"||e===null}function hr(e){return typeof e=="object"&&e!==null}function dr(e){return Array.isArray(e)?e:ke(e)?[]:[e]}function mr(e,r){var n,o,i,l;if(r)for(l=Object.keys(r),n=0,o=l.length;n<o;n+=1)i=l[n],e[i]=r[i];return e}function gr(e,r){var n="",o;for(o=0;o<r;o+=1)n+=e;return n}function yr(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var xr=ke,vr=hr,Ar=dr,Cr=gr,wr=yr,br=mr,C={isNothing:xr,isObject:vr,toArray:Ar,repeat:Cr,isNegativeZero:wr,extend:br};function Ie(e,r){var n="",o=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!r&&e.mark.snippet&&(n+=`
14
3
 
15
- `+e.mark.snippet),o+" "+i):o}function q(e,n){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=n,this.message=ke(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}q.prototype=Object.create(Error.prototype);q.prototype.constructor=q;q.prototype.toString=function(n){return this.name+": "+ke(this,n)};var E=q;function ee(e,n,i,o,r){var l="",t="",c=Math.floor(r/2)-1;return o-n>c&&(l=" ... ",n=o-c+l.length),i-o>c&&(t=" ...",i=o+c-t.length),{str:l+e.slice(n,i).replace(/\t/g,"\u2192")+t,pos:o-n+l.length}}function ne(e,n){return A.repeat(" ",n-e.length)+e}function Sn(e,n){if(n=Object.create(n||null),!e.buffer)return null;n.maxLength||(n.maxLength=79),typeof n.indent!="number"&&(n.indent=1),typeof n.linesBefore!="number"&&(n.linesBefore=3),typeof n.linesAfter!="number"&&(n.linesAfter=2);for(var i=/\r?\n|\r|\0/g,o=[0],r=[],l,t=-1;l=i.exec(e.buffer);)r.push(l.index),o.push(l.index+l[0].length),e.position<=l.index&&t<0&&(t=o.length-2);t<0&&(t=o.length-1);var c="",u,s,f=Math.min(e.line+n.linesAfter,r.length).toString().length,a=n.maxLength-(n.indent+f+3);for(u=1;u<=n.linesBefore&&!(t-u<0);u++)s=ee(e.buffer,o[t-u],r[t-u],e.position-(o[t]-o[t-u]),a),c=A.repeat(" ",n.indent)+ne((e.line-u+1).toString(),f)+" | "+s.str+`
16
- `+c;for(s=ee(e.buffer,o[t],r[t],e.position,a),c+=A.repeat(" ",n.indent)+ne((e.line+1).toString(),f)+" | "+s.str+`
17
- `,c+=A.repeat("-",n.indent+f+3+s.pos)+`^
18
- `,u=1;u<=n.linesAfter&&!(t+u>=r.length);u++)s=ee(e.buffer,o[t+u],r[t+u],e.position-(o[t]-o[t+u]),a),c+=A.repeat(" ",n.indent)+ne((e.line+u+1).toString(),f)+" | "+s.str+`
19
- `;return c.replace(/\n$/,"")}var _n=Sn,Fn=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Tn=["scalar","sequence","mapping"];function On(e){var n={};return e!==null&&Object.keys(e).forEach(function(i){e[i].forEach(function(o){n[String(o)]=i})}),n}function Ln(e,n){if(n=n||{},Object.keys(n).forEach(function(i){if(Fn.indexOf(i)===-1)throw new E('Unknown option "'+i+'" is met in definition of "'+e+'" YAML type.')}),this.options=n,this.tag=e,this.kind=n.kind||null,this.resolve=n.resolve||function(){return!0},this.construct=n.construct||function(i){return i},this.instanceOf=n.instanceOf||null,this.predicate=n.predicate||null,this.represent=n.represent||null,this.representName=n.representName||null,this.defaultStyle=n.defaultStyle||null,this.multi=n.multi||!1,this.styleAliases=On(n.styleAliases||null),Tn.indexOf(this.kind)===-1)throw new E('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var C=Ln;function me(e,n){var i=[];return e[n].forEach(function(o){var r=i.length;i.forEach(function(l,t){l.tag===o.tag&&l.kind===o.kind&&l.multi===o.multi&&(r=t)}),i[r]=o}),i}function In(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},n,i;function o(r){r.multi?(e.multi[r.kind].push(r),e.multi.fallback.push(r)):e[r.kind][r.tag]=e.fallback[r.tag]=r}for(n=0,i=arguments.length;n<i;n+=1)arguments[n].forEach(o);return e}function re(e){return this.extend(e)}re.prototype.extend=function(n){var i=[],o=[];if(n instanceof C)o.push(n);else if(Array.isArray(n))o=o.concat(n);else if(n&&(Array.isArray(n.implicit)||Array.isArray(n.explicit)))n.implicit&&(i=i.concat(n.implicit)),n.explicit&&(o=o.concat(n.explicit));else throw new E("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");i.forEach(function(l){if(!(l instanceof C))throw new E("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(l.loadKind&&l.loadKind!=="scalar")throw new E("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(l.multi)throw new E("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),o.forEach(function(l){if(!(l instanceof C))throw new E("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(re.prototype);return r.implicit=(this.implicit||[]).concat(i),r.explicit=(this.explicit||[]).concat(o),r.compiledImplicit=me(r,"implicit"),r.compiledExplicit=me(r,"explicit"),r.compiledTypeMap=In(r.compiledImplicit,r.compiledExplicit),r};var kn=re,Pn=new C("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Rn=new C("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Mn=new C("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Dn=new kn({explicit:[Pn,Rn,Mn]});function Nn(e){if(e===null)return!0;var n=e.length;return n===1&&e==="~"||n===4&&(e==="null"||e==="Null"||e==="NULL")}function jn(){return null}function qn(e){return e===null}var Yn=new C("tag:yaml.org,2002:null",{kind:"scalar",resolve:Nn,construct:jn,predicate:qn,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function $n(e){if(e===null)return!1;var n=e.length;return n===4&&(e==="true"||e==="True"||e==="TRUE")||n===5&&(e==="false"||e==="False"||e==="FALSE")}function Bn(e){return e==="true"||e==="True"||e==="TRUE"}function Hn(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Un=new C("tag:yaml.org,2002:bool",{kind:"scalar",resolve:$n,construct:Bn,predicate:Hn,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Gn(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Wn(e){return 48<=e&&e<=55}function Kn(e){return 48<=e&&e<=57}function Qn(e){if(e===null)return!1;var n=e.length,i=0,o=!1,r;if(!n)return!1;if(r=e[i],(r==="-"||r==="+")&&(r=e[++i]),r==="0"){if(i+1===n)return!0;if(r=e[++i],r==="b"){for(i++;i<n;i++)if(r=e[i],r!=="_"){if(r!=="0"&&r!=="1")return!1;o=!0}return o&&r!=="_"}if(r==="x"){for(i++;i<n;i++)if(r=e[i],r!=="_"){if(!Gn(e.charCodeAt(i)))return!1;o=!0}return o&&r!=="_"}if(r==="o"){for(i++;i<n;i++)if(r=e[i],r!=="_"){if(!Wn(e.charCodeAt(i)))return!1;o=!0}return o&&r!=="_"}}if(r==="_")return!1;for(;i<n;i++)if(r=e[i],r!=="_"){if(!Kn(e.charCodeAt(i)))return!1;o=!0}return!(!o||r==="_")}function Vn(e){var n=e,i=1,o;if(n.indexOf("_")!==-1&&(n=n.replace(/_/g,"")),o=n[0],(o==="-"||o==="+")&&(o==="-"&&(i=-1),n=n.slice(1),o=n[0]),n==="0")return 0;if(o==="0"){if(n[1]==="b")return i*parseInt(n.slice(2),2);if(n[1]==="x")return i*parseInt(n.slice(2),16);if(n[1]==="o")return i*parseInt(n.slice(2),8)}return i*parseInt(n,10)}function Xn(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!A.isNegativeZero(e)}var zn=new C("tag:yaml.org,2002:int",{kind:"scalar",resolve:Qn,construct:Vn,predicate:Xn,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Zn=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Jn(e){return!(e===null||!Zn.test(e)||e[e.length-1]==="_")}function ei(e){var n,i;return n=e.replace(/_/g,"").toLowerCase(),i=n[0]==="-"?-1:1,"+-".indexOf(n[0])>=0&&(n=n.slice(1)),n===".inf"?i===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:n===".nan"?NaN:i*parseFloat(n,10)}var ni=/^[-+]?[0-9]+e/;function ii(e,n){var i;if(isNaN(e))switch(n){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(n){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(n){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(A.isNegativeZero(e))return"-0.0";return i=e.toString(10),ni.test(i)?i.replace("e",".e"):i}function ri(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||A.isNegativeZero(e))}var oi=new C("tag:yaml.org,2002:float",{kind:"scalar",resolve:Jn,construct:ei,predicate:ri,represent:ii,defaultStyle:"lowercase"}),ti=Dn.extend({implicit:[Yn,Un,zn,oi]}),li=ti,Pe=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Re=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function ci(e){return e===null?!1:Pe.exec(e)!==null||Re.exec(e)!==null}function ui(e){var n,i,o,r,l,t,c,u=0,s=null,f,a,h;if(n=Pe.exec(e),n===null&&(n=Re.exec(e)),n===null)throw new Error("Date resolve error");if(i=+n[1],o=+n[2]-1,r=+n[3],!n[4])return new Date(Date.UTC(i,o,r));if(l=+n[4],t=+n[5],c=+n[6],n[7]){for(u=n[7].slice(0,3);u.length<3;)u+="0";u=+u}return n[9]&&(f=+n[10],a=+(n[11]||0),s=(f*60+a)*6e4,n[9]==="-"&&(s=-s)),h=new Date(Date.UTC(i,o,r,l,t,c,u)),s&&h.setTime(h.getTime()-s),h}function si(e){return e.toISOString()}var ai=new C("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:ci,construct:ui,instanceOf:Date,represent:si});function fi(e){return e==="<<"||e===null}var pi=new C("tag:yaml.org,2002:merge",{kind:"scalar",resolve:fi}),ue=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
20
- \r`;function hi(e){if(e===null)return!1;var n,i,o=0,r=e.length,l=ue;for(i=0;i<r;i++)if(n=l.indexOf(e.charAt(i)),!(n>64)){if(n<0)return!1;o+=6}return o%8===0}function di(e){var n,i,o=e.replace(/[\r\n=]/g,""),r=o.length,l=ue,t=0,c=[];for(n=0;n<r;n++)n%4===0&&n&&(c.push(t>>16&255),c.push(t>>8&255),c.push(t&255)),t=t<<6|l.indexOf(o.charAt(n));return i=r%4*6,i===0?(c.push(t>>16&255),c.push(t>>8&255),c.push(t&255)):i===18?(c.push(t>>10&255),c.push(t>>2&255)):i===12&&c.push(t>>4&255),new Uint8Array(c)}function gi(e){var n="",i=0,o,r,l=e.length,t=ue;for(o=0;o<l;o++)o%3===0&&o&&(n+=t[i>>18&63],n+=t[i>>12&63],n+=t[i>>6&63],n+=t[i&63]),i=(i<<8)+e[o];return r=l%3,r===0?(n+=t[i>>18&63],n+=t[i>>12&63],n+=t[i>>6&63],n+=t[i&63]):r===2?(n+=t[i>>10&63],n+=t[i>>4&63],n+=t[i<<2&63],n+=t[64]):r===1&&(n+=t[i>>2&63],n+=t[i<<4&63],n+=t[64],n+=t[64]),n}function mi(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var xi=new C("tag:yaml.org,2002:binary",{kind:"scalar",resolve:hi,construct:di,predicate:mi,represent:gi}),vi=Object.prototype.hasOwnProperty,yi=Object.prototype.toString;function Ai(e){if(e===null)return!0;var n=[],i,o,r,l,t,c=e;for(i=0,o=c.length;i<o;i+=1){if(r=c[i],t=!1,yi.call(r)!=="[object Object]")return!1;for(l in r)if(vi.call(r,l))if(!t)t=!0;else return!1;if(!t)return!1;if(n.indexOf(l)===-1)n.push(l);else return!1}return!0}function Ci(e){return e!==null?e:[]}var wi=new C("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Ai,construct:Ci}),bi=Object.prototype.toString;function Ei(e){if(e===null)return!0;var n,i,o,r,l,t=e;for(l=new Array(t.length),n=0,i=t.length;n<i;n+=1){if(o=t[n],bi.call(o)!=="[object Object]"||(r=Object.keys(o),r.length!==1))return!1;l[n]=[r[0],o[r[0]]]}return!0}function Si(e){if(e===null)return[];var n,i,o,r,l,t=e;for(l=new Array(t.length),n=0,i=t.length;n<i;n+=1)o=t[n],r=Object.keys(o),l[n]=[r[0],o[r[0]]];return l}var _i=new C("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Ei,construct:Si}),Fi=Object.prototype.hasOwnProperty;function Ti(e){if(e===null)return!0;var n,i=e;for(n in i)if(Fi.call(i,n)&&i[n]!==null)return!1;return!0}function Oi(e){return e!==null?e:{}}var Li=new C("tag:yaml.org,2002:set",{kind:"mapping",resolve:Ti,construct:Oi}),Me=li.extend({implicit:[ai,pi],explicit:[xi,wi,_i,Li]}),L=Object.prototype.hasOwnProperty,G=1,De=2,Ne=3,W=4,ie=1,Ii=2,xe=3,ki=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Pi=/[\x85\u2028\u2029]/,Ri=/[,\[\]\{\}]/,je=/^(?:!|!!|![a-z\-]+!)$/i,qe=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function ve(e){return Object.prototype.toString.call(e)}function _(e){return e===10||e===13}function k(e){return e===9||e===32}function S(e){return e===9||e===32||e===10||e===13}function M(e){return e===44||e===91||e===93||e===123||e===125}function Mi(e){var n;return 48<=e&&e<=57?e-48:(n=e|32,97<=n&&n<=102?n-97+10:-1)}function Di(e){return e===120?2:e===117?4:e===85?8:0}function Ni(e){return 48<=e&&e<=57?e-48:-1}function ye(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
21
- `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function ji(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var Ye=new Array(256),$e=new Array(256);for(I=0;I<256;I++)Ye[I]=ye(I)?1:0,$e[I]=ye(I);var I;function qi(e,n){this.input=e,this.filename=n.filename||null,this.schema=n.schema||Me,this.onWarning=n.onWarning||null,this.legacy=n.legacy||!1,this.json=n.json||!1,this.listener=n.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Be(e,n){var i={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return i.snippet=_n(i),new E(n,i)}function p(e,n){throw Be(e,n)}function K(e,n){e.onWarning&&e.onWarning.call(null,Be(e,n))}var Ae={YAML:function(n,i,o){var r,l,t;n.version!==null&&p(n,"duplication of %YAML directive"),o.length!==1&&p(n,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(o[0]),r===null&&p(n,"ill-formed argument of the YAML directive"),l=parseInt(r[1],10),t=parseInt(r[2],10),l!==1&&p(n,"unacceptable YAML version of the document"),n.version=o[0],n.checkLineBreaks=t<2,t!==1&&t!==2&&K(n,"unsupported YAML version of the document")},TAG:function(n,i,o){var r,l;o.length!==2&&p(n,"TAG directive accepts exactly two arguments"),r=o[0],l=o[1],je.test(r)||p(n,"ill-formed tag handle (first argument) of the TAG directive"),L.call(n.tagMap,r)&&p(n,'there is a previously declared suffix for "'+r+'" tag handle'),qe.test(l)||p(n,"ill-formed tag prefix (second argument) of the TAG directive");try{l=decodeURIComponent(l)}catch{p(n,"tag prefix is malformed: "+l)}n.tagMap[r]=l}};function O(e,n,i,o){var r,l,t,c;if(n<i){if(c=e.input.slice(n,i),o)for(r=0,l=c.length;r<l;r+=1)t=c.charCodeAt(r),t===9||32<=t&&t<=1114111||p(e,"expected valid JSON character");else ki.test(c)&&p(e,"the stream contains non-printable characters");e.result+=c}}function Ce(e,n,i,o){var r,l,t,c;for(A.isObject(i)||p(e,"cannot merge mappings; the provided source object is unacceptable"),r=Object.keys(i),t=0,c=r.length;t<c;t+=1)l=r[t],L.call(n,l)||(n[l]=i[l],o[l]=!0)}function D(e,n,i,o,r,l,t,c,u){var s,f;if(Array.isArray(r))for(r=Array.prototype.slice.call(r),s=0,f=r.length;s<f;s+=1)Array.isArray(r[s])&&p(e,"nested arrays are not supported inside keys"),typeof r=="object"&&ve(r[s])==="[object Object]"&&(r[s]="[object Object]");if(typeof r=="object"&&ve(r)==="[object Object]"&&(r="[object Object]"),r=String(r),n===null&&(n={}),o==="tag:yaml.org,2002:merge")if(Array.isArray(l))for(s=0,f=l.length;s<f;s+=1)Ce(e,n,l[s],i);else Ce(e,n,l,i);else!e.json&&!L.call(i,r)&&L.call(n,r)&&(e.line=t||e.line,e.lineStart=c||e.lineStart,e.position=u||e.position,p(e,"duplicated mapping key")),r==="__proto__"?Object.defineProperty(n,r,{configurable:!0,enumerable:!0,writable:!0,value:l}):n[r]=l,delete i[r];return n}function se(e){var n;n=e.input.charCodeAt(e.position),n===10?e.position++:n===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):p(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function y(e,n,i){for(var o=0,r=e.input.charCodeAt(e.position);r!==0;){for(;k(r);)r===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),r=e.input.charCodeAt(++e.position);if(n&&r===35)do r=e.input.charCodeAt(++e.position);while(r!==10&&r!==13&&r!==0);if(_(r))for(se(e),r=e.input.charCodeAt(e.position),o++,e.lineIndent=0;r===32;)e.lineIndent++,r=e.input.charCodeAt(++e.position);else break}return i!==-1&&o!==0&&e.lineIndent<i&&K(e,"deficient indentation"),o}function X(e){var n=e.position,i;return i=e.input.charCodeAt(n),!!((i===45||i===46)&&i===e.input.charCodeAt(n+1)&&i===e.input.charCodeAt(n+2)&&(n+=3,i=e.input.charCodeAt(n),i===0||S(i)))}function ae(e,n){n===1?e.result+=" ":n>1&&(e.result+=A.repeat(`
22
- `,n-1))}function Yi(e,n,i){var o,r,l,t,c,u,s,f,a=e.kind,h=e.result,d;if(d=e.input.charCodeAt(e.position),S(d)||M(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(r=e.input.charCodeAt(e.position+1),S(r)||i&&M(r)))return!1;for(e.kind="scalar",e.result="",l=t=e.position,c=!1;d!==0;){if(d===58){if(r=e.input.charCodeAt(e.position+1),S(r)||i&&M(r))break}else if(d===35){if(o=e.input.charCodeAt(e.position-1),S(o))break}else{if(e.position===e.lineStart&&X(e)||i&&M(d))break;if(_(d))if(u=e.line,s=e.lineStart,f=e.lineIndent,y(e,!1,-1),e.lineIndent>=n){c=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=t,e.line=u,e.lineStart=s,e.lineIndent=f;break}}c&&(O(e,l,t,!1),ae(e,e.line-u),l=t=e.position,c=!1),k(d)||(t=e.position+1),d=e.input.charCodeAt(++e.position)}return O(e,l,t,!1),e.result?!0:(e.kind=a,e.result=h,!1)}function $i(e,n){var i,o,r;if(i=e.input.charCodeAt(e.position),i!==39)return!1;for(e.kind="scalar",e.result="",e.position++,o=r=e.position;(i=e.input.charCodeAt(e.position))!==0;)if(i===39)if(O(e,o,e.position,!0),i=e.input.charCodeAt(++e.position),i===39)o=e.position,e.position++,r=e.position;else return!0;else _(i)?(O(e,o,r,!0),ae(e,y(e,!1,n)),o=r=e.position):e.position===e.lineStart&&X(e)?p(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);p(e,"unexpected end of the stream within a single quoted scalar")}function Bi(e,n){var i,o,r,l,t,c;if(c=e.input.charCodeAt(e.position),c!==34)return!1;for(e.kind="scalar",e.result="",e.position++,i=o=e.position;(c=e.input.charCodeAt(e.position))!==0;){if(c===34)return O(e,i,e.position,!0),e.position++,!0;if(c===92){if(O(e,i,e.position,!0),c=e.input.charCodeAt(++e.position),_(c))y(e,!1,n);else if(c<256&&Ye[c])e.result+=$e[c],e.position++;else if((t=Di(c))>0){for(r=t,l=0;r>0;r--)c=e.input.charCodeAt(++e.position),(t=Mi(c))>=0?l=(l<<4)+t:p(e,"expected hexadecimal character");e.result+=ji(l),e.position++}else p(e,"unknown escape sequence");i=o=e.position}else _(c)?(O(e,i,o,!0),ae(e,y(e,!1,n)),i=o=e.position):e.position===e.lineStart&&X(e)?p(e,"unexpected end of the document within a double quoted scalar"):(e.position++,o=e.position)}p(e,"unexpected end of the stream within a double quoted scalar")}function Hi(e,n){var i=!0,o,r,l,t=e.tag,c,u=e.anchor,s,f,a,h,d,m=Object.create(null),v,x,b,g;if(g=e.input.charCodeAt(e.position),g===91)f=93,d=!1,c=[];else if(g===123)f=125,d=!0,c={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=c),g=e.input.charCodeAt(++e.position);g!==0;){if(y(e,!0,n),g=e.input.charCodeAt(e.position),g===f)return e.position++,e.tag=t,e.anchor=u,e.kind=d?"mapping":"sequence",e.result=c,!0;i?g===44&&p(e,"expected the node content, but found ','"):p(e,"missed comma between flow collection entries"),x=v=b=null,a=h=!1,g===63&&(s=e.input.charCodeAt(e.position+1),S(s)&&(a=h=!0,e.position++,y(e,!0,n))),o=e.line,r=e.lineStart,l=e.position,N(e,n,G,!1,!0),x=e.tag,v=e.result,y(e,!0,n),g=e.input.charCodeAt(e.position),(h||e.line===o)&&g===58&&(a=!0,g=e.input.charCodeAt(++e.position),y(e,!0,n),N(e,n,G,!1,!0),b=e.result),d?D(e,c,m,x,v,b,o,r,l):a?c.push(D(e,null,m,x,v,b,o,r,l)):c.push(v),y(e,!0,n),g=e.input.charCodeAt(e.position),g===44?(i=!0,g=e.input.charCodeAt(++e.position)):i=!1}p(e,"unexpected end of the stream within a flow collection")}function Ui(e,n){var i,o,r=ie,l=!1,t=!1,c=n,u=0,s=!1,f,a;if(a=e.input.charCodeAt(e.position),a===124)o=!1;else if(a===62)o=!0;else return!1;for(e.kind="scalar",e.result="";a!==0;)if(a=e.input.charCodeAt(++e.position),a===43||a===45)ie===r?r=a===43?xe:Ii:p(e,"repeat of a chomping mode identifier");else if((f=Ni(a))>=0)f===0?p(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):t?p(e,"repeat of an indentation width identifier"):(c=n+f-1,t=!0);else break;if(k(a)){do a=e.input.charCodeAt(++e.position);while(k(a));if(a===35)do a=e.input.charCodeAt(++e.position);while(!_(a)&&a!==0)}for(;a!==0;){for(se(e),e.lineIndent=0,a=e.input.charCodeAt(e.position);(!t||e.lineIndent<c)&&a===32;)e.lineIndent++,a=e.input.charCodeAt(++e.position);if(!t&&e.lineIndent>c&&(c=e.lineIndent),_(a)){u++;continue}if(e.lineIndent<c){r===xe?e.result+=A.repeat(`
23
- `,l?1+u:u):r===ie&&l&&(e.result+=`
24
- `);break}for(o?k(a)?(s=!0,e.result+=A.repeat(`
25
- `,l?1+u:u)):s?(s=!1,e.result+=A.repeat(`
26
- `,u+1)):u===0?l&&(e.result+=" "):e.result+=A.repeat(`
27
- `,u):e.result+=A.repeat(`
28
- `,l?1+u:u),l=!0,t=!0,u=0,i=e.position;!_(a)&&a!==0;)a=e.input.charCodeAt(++e.position);O(e,i,e.position,!1)}return!0}function we(e,n){var i,o=e.tag,r=e.anchor,l=[],t,c=!1,u;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=l),u=e.input.charCodeAt(e.position);u!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,p(e,"tab characters must not be used in indentation")),!(u!==45||(t=e.input.charCodeAt(e.position+1),!S(t))));){if(c=!0,e.position++,y(e,!0,-1)&&e.lineIndent<=n){l.push(null),u=e.input.charCodeAt(e.position);continue}if(i=e.line,N(e,n,Ne,!1,!0),l.push(e.result),y(e,!0,-1),u=e.input.charCodeAt(e.position),(e.line===i||e.lineIndent>n)&&u!==0)p(e,"bad indentation of a sequence entry");else if(e.lineIndent<n)break}return c?(e.tag=o,e.anchor=r,e.kind="sequence",e.result=l,!0):!1}function Gi(e,n,i){var o,r,l,t,c,u,s=e.tag,f=e.anchor,a={},h=Object.create(null),d=null,m=null,v=null,x=!1,b=!1,g;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),g=e.input.charCodeAt(e.position);g!==0;){if(!x&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,p(e,"tab characters must not be used in indentation")),o=e.input.charCodeAt(e.position+1),l=e.line,(g===63||g===58)&&S(o))g===63?(x&&(D(e,a,h,d,m,null,t,c,u),d=m=v=null),b=!0,x=!0,r=!0):x?(x=!1,r=!0):p(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,g=o;else{if(t=e.line,c=e.lineStart,u=e.position,!N(e,i,De,!1,!0))break;if(e.line===l){for(g=e.input.charCodeAt(e.position);k(g);)g=e.input.charCodeAt(++e.position);if(g===58)g=e.input.charCodeAt(++e.position),S(g)||p(e,"a whitespace character is expected after the key-value separator within a block mapping"),x&&(D(e,a,h,d,m,null,t,c,u),d=m=v=null),b=!0,x=!1,r=!1,d=e.tag,m=e.result;else if(b)p(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=s,e.anchor=f,!0}else if(b)p(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=s,e.anchor=f,!0}if((e.line===l||e.lineIndent>n)&&(x&&(t=e.line,c=e.lineStart,u=e.position),N(e,n,W,!0,r)&&(x?m=e.result:v=e.result),x||(D(e,a,h,d,m,v,t,c,u),d=m=v=null),y(e,!0,-1),g=e.input.charCodeAt(e.position)),(e.line===l||e.lineIndent>n)&&g!==0)p(e,"bad indentation of a mapping entry");else if(e.lineIndent<n)break}return x&&D(e,a,h,d,m,null,t,c,u),b&&(e.tag=s,e.anchor=f,e.kind="mapping",e.result=a),b}function Wi(e){var n,i=!1,o=!1,r,l,t;if(t=e.input.charCodeAt(e.position),t!==33)return!1;if(e.tag!==null&&p(e,"duplication of a tag property"),t=e.input.charCodeAt(++e.position),t===60?(i=!0,t=e.input.charCodeAt(++e.position)):t===33?(o=!0,r="!!",t=e.input.charCodeAt(++e.position)):r="!",n=e.position,i){do t=e.input.charCodeAt(++e.position);while(t!==0&&t!==62);e.position<e.length?(l=e.input.slice(n,e.position),t=e.input.charCodeAt(++e.position)):p(e,"unexpected end of the stream within a verbatim tag")}else{for(;t!==0&&!S(t);)t===33&&(o?p(e,"tag suffix cannot contain exclamation marks"):(r=e.input.slice(n-1,e.position+1),je.test(r)||p(e,"named tag handle cannot contain such characters"),o=!0,n=e.position+1)),t=e.input.charCodeAt(++e.position);l=e.input.slice(n,e.position),Ri.test(l)&&p(e,"tag suffix cannot contain flow indicator characters")}l&&!qe.test(l)&&p(e,"tag name cannot contain such characters: "+l);try{l=decodeURIComponent(l)}catch{p(e,"tag name is malformed: "+l)}return i?e.tag=l:L.call(e.tagMap,r)?e.tag=e.tagMap[r]+l:r==="!"?e.tag="!"+l:r==="!!"?e.tag="tag:yaml.org,2002:"+l:p(e,'undeclared tag handle "'+r+'"'),!0}function Ki(e){var n,i;if(i=e.input.charCodeAt(e.position),i!==38)return!1;for(e.anchor!==null&&p(e,"duplication of an anchor property"),i=e.input.charCodeAt(++e.position),n=e.position;i!==0&&!S(i)&&!M(i);)i=e.input.charCodeAt(++e.position);return e.position===n&&p(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(n,e.position),!0}function Qi(e){var n,i,o;if(o=e.input.charCodeAt(e.position),o!==42)return!1;for(o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!S(o)&&!M(o);)o=e.input.charCodeAt(++e.position);return e.position===n&&p(e,"name of an alias node must contain at least one character"),i=e.input.slice(n,e.position),L.call(e.anchorMap,i)||p(e,'unidentified alias "'+i+'"'),e.result=e.anchorMap[i],y(e,!0,-1),!0}function N(e,n,i,o,r){var l,t,c,u=1,s=!1,f=!1,a,h,d,m,v,x;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,l=t=c=W===i||Ne===i,o&&y(e,!0,-1)&&(s=!0,e.lineIndent>n?u=1:e.lineIndent===n?u=0:e.lineIndent<n&&(u=-1)),u===1)for(;Wi(e)||Ki(e);)y(e,!0,-1)?(s=!0,c=l,e.lineIndent>n?u=1:e.lineIndent===n?u=0:e.lineIndent<n&&(u=-1)):c=!1;if(c&&(c=s||r),(u===1||W===i)&&(G===i||De===i?v=n:v=n+1,x=e.position-e.lineStart,u===1?c&&(we(e,x)||Gi(e,x,v))||Hi(e,v)?f=!0:(t&&Ui(e,v)||$i(e,v)||Bi(e,v)?f=!0:Qi(e)?(f=!0,(e.tag!==null||e.anchor!==null)&&p(e,"alias node should not have any properties")):Yi(e,v,G===i)&&(f=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):u===0&&(f=c&&we(e,x))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&p(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),a=0,h=e.implicitTypes.length;a<h;a+=1)if(m=e.implicitTypes[a],m.resolve(e.result)){e.result=m.construct(e.result),e.tag=m.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(L.call(e.typeMap[e.kind||"fallback"],e.tag))m=e.typeMap[e.kind||"fallback"][e.tag];else for(m=null,d=e.typeMap.multi[e.kind||"fallback"],a=0,h=d.length;a<h;a+=1)if(e.tag.slice(0,d[a].tag.length)===d[a].tag){m=d[a];break}m||p(e,"unknown tag !<"+e.tag+">"),e.result!==null&&m.kind!==e.kind&&p(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+m.kind+'", not "'+e.kind+'"'),m.resolve(e.result,e.tag)?(e.result=m.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):p(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||f}function Vi(e){var n=e.position,i,o,r,l=!1,t;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(t=e.input.charCodeAt(e.position))!==0&&(y(e,!0,-1),t=e.input.charCodeAt(e.position),!(e.lineIndent>0||t!==37));){for(l=!0,t=e.input.charCodeAt(++e.position),i=e.position;t!==0&&!S(t);)t=e.input.charCodeAt(++e.position);for(o=e.input.slice(i,e.position),r=[],o.length<1&&p(e,"directive name must not be less than one character in length");t!==0;){for(;k(t);)t=e.input.charCodeAt(++e.position);if(t===35){do t=e.input.charCodeAt(++e.position);while(t!==0&&!_(t));break}if(_(t))break;for(i=e.position;t!==0&&!S(t);)t=e.input.charCodeAt(++e.position);r.push(e.input.slice(i,e.position))}t!==0&&se(e),L.call(Ae,o)?Ae[o](e,o,r):K(e,'unknown document directive "'+o+'"')}if(y(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,y(e,!0,-1)):l&&p(e,"directives end mark is expected"),N(e,e.lineIndent-1,W,!1,!0),y(e,!0,-1),e.checkLineBreaks&&Pi.test(e.input.slice(n,e.position))&&K(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&X(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,y(e,!0,-1));return}if(e.position<e.length-1)p(e,"end of the stream or a document separator is expected");else return}function He(e,n){e=String(e),n=n||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
29
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var i=new qi(e,n),o=e.indexOf("\0");for(o!==-1&&(i.position=o,p(i,"null byte is not allowed in input")),i.input+="\0";i.input.charCodeAt(i.position)===32;)i.lineIndent+=1,i.position+=1;for(;i.position<i.length-1;)Vi(i);return i.documents}function Xi(e,n,i){n!==null&&typeof n=="object"&&typeof i>"u"&&(i=n,n=null);var o=He(e,i);if(typeof n!="function")return o;for(var r=0,l=o.length;r<l;r+=1)n(o[r])}function zi(e,n){var i=He(e,n);if(i.length!==0){if(i.length===1)return i[0];throw new E("expected a single document in the stream, but found more")}}var Zi=Xi,Ji=zi,Ue={loadAll:Zi,load:Ji},Ge=Object.prototype.toString,We=Object.prototype.hasOwnProperty,fe=65279,er=9,Y=10,nr=13,ir=32,rr=33,or=34,oe=35,tr=37,lr=38,cr=39,ur=42,Ke=44,sr=45,Q=58,ar=61,fr=62,pr=63,hr=64,Qe=91,Ve=93,dr=96,Xe=123,gr=124,ze=125,w={};w[0]="\\0";w[7]="\\a";w[8]="\\b";w[9]="\\t";w[10]="\\n";w[11]="\\v";w[12]="\\f";w[13]="\\r";w[27]="\\e";w[34]='\\"';w[92]="\\\\";w[133]="\\N";w[160]="\\_";w[8232]="\\L";w[8233]="\\P";var mr=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],xr=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function vr(e,n){var i,o,r,l,t,c,u;if(n===null)return{};for(i={},o=Object.keys(n),r=0,l=o.length;r<l;r+=1)t=o[r],c=String(n[t]),t.slice(0,2)==="!!"&&(t="tag:yaml.org,2002:"+t.slice(2)),u=e.compiledTypeMap.fallback[t],u&&We.call(u.styleAliases,c)&&(c=u.styleAliases[c]),i[t]=c;return i}function yr(e){var n,i,o;if(n=e.toString(16).toUpperCase(),e<=255)i="x",o=2;else if(e<=65535)i="u",o=4;else if(e<=4294967295)i="U",o=8;else throw new E("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+i+A.repeat("0",o-n.length)+n}var Ar=1,$=2;function Cr(e){this.schema=e.schema||Me,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=A.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=vr(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?$:Ar,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function be(e,n){for(var i=A.repeat(" ",n),o=0,r=-1,l="",t,c=e.length;o<c;)r=e.indexOf(`
30
- `,o),r===-1?(t=e.slice(o),o=c):(t=e.slice(o,r+1),o=r+1),t.length&&t!==`
31
- `&&(l+=i),l+=t;return l}function te(e,n){return`
32
- `+A.repeat(" ",e.indent*n)}function wr(e,n){var i,o,r;for(i=0,o=e.implicitTypes.length;i<o;i+=1)if(r=e.implicitTypes[i],r.resolve(n))return!0;return!1}function V(e){return e===ir||e===er}function B(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==fe||65536<=e&&e<=1114111}function Ee(e){return B(e)&&e!==fe&&e!==nr&&e!==Y}function Se(e,n,i){var o=Ee(e),r=o&&!V(e);return(i?o:o&&e!==Ke&&e!==Qe&&e!==Ve&&e!==Xe&&e!==ze)&&e!==oe&&!(n===Q&&!r)||Ee(n)&&!V(n)&&e===oe||n===Q&&r}function br(e){return B(e)&&e!==fe&&!V(e)&&e!==sr&&e!==pr&&e!==Q&&e!==Ke&&e!==Qe&&e!==Ve&&e!==Xe&&e!==ze&&e!==oe&&e!==lr&&e!==ur&&e!==rr&&e!==gr&&e!==ar&&e!==fr&&e!==cr&&e!==or&&e!==tr&&e!==hr&&e!==dr}function Er(e){return!V(e)&&e!==Q}function j(e,n){var i=e.charCodeAt(n),o;return i>=55296&&i<=56319&&n+1<e.length&&(o=e.charCodeAt(n+1),o>=56320&&o<=57343)?(i-55296)*1024+o-56320+65536:i}function Ze(e){var n=/^\n* /;return n.test(e)}var Je=1,le=2,en=3,nn=4,R=5;function Sr(e,n,i,o,r,l,t,c){var u,s=0,f=null,a=!1,h=!1,d=o!==-1,m=-1,v=br(j(e,0))&&Er(j(e,e.length-1));if(n||t)for(u=0;u<e.length;s>=65536?u+=2:u++){if(s=j(e,u),!B(s))return R;v=v&&Se(s,f,c),f=s}else{for(u=0;u<e.length;s>=65536?u+=2:u++){if(s=j(e,u),s===Y)a=!0,d&&(h=h||u-m-1>o&&e[m+1]!==" ",m=u);else if(!B(s))return R;v=v&&Se(s,f,c),f=s}h=h||d&&u-m-1>o&&e[m+1]!==" "}return!a&&!h?v&&!t&&!r(e)?Je:l===$?R:le:i>9&&Ze(e)?R:t?l===$?R:le:h?nn:en}function _r(e,n,i,o,r){e.dump=function(){if(n.length===0)return e.quotingType===$?'""':"''";if(!e.noCompatMode&&(mr.indexOf(n)!==-1||xr.test(n)))return e.quotingType===$?'"'+n+'"':"'"+n+"'";var l=e.indent*Math.max(1,i),t=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-l),c=o||e.flowLevel>-1&&i>=e.flowLevel;function u(s){return wr(e,s)}switch(Sr(n,c,e.indent,t,u,e.quotingType,e.forceQuotes&&!o,r)){case Je:return n;case le:return"'"+n.replace(/'/g,"''")+"'";case en:return"|"+_e(n,e.indent)+Fe(be(n,l));case nn:return">"+_e(n,e.indent)+Fe(be(Fr(n,t),l));case R:return'"'+Tr(n)+'"';default:throw new E("impossible error: invalid scalar style")}}()}function _e(e,n){var i=Ze(e)?String(n):"",o=e[e.length-1]===`
33
- `,r=o&&(e[e.length-2]===`
4
+ `+e.mark.snippet),o+" "+n):o}function q(e,r){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=r,this.message=Ie(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}q.prototype=Object.create(Error.prototype);q.prototype.constructor=q;q.prototype.toString=function(r){return this.name+": "+Ie(this,r)};var E=q;function ee(e,r,n,o,i){var l="",t="",c=Math.floor(i/2)-1;return o-r>c&&(l=" ... ",r=o-c+l.length),n-o>c&&(t=" ...",n=o+c-t.length),{str:l+e.slice(r,n).replace(/\t/g,"\u2192")+t,pos:o-r+l.length}}function re(e,r){return C.repeat(" ",r-e.length)+e}function Er(e,r){if(r=Object.create(r||null),!e.buffer)return null;r.maxLength||(r.maxLength=79),typeof r.indent!="number"&&(r.indent=1),typeof r.linesBefore!="number"&&(r.linesBefore=3),typeof r.linesAfter!="number"&&(r.linesAfter=2);for(var n=/\r?\n|\r|\0/g,o=[0],i=[],l,t=-1;l=n.exec(e.buffer);)i.push(l.index),o.push(l.index+l[0].length),e.position<=l.index&&t<0&&(t=o.length-2);t<0&&(t=o.length-1);var c="",s,u,f=Math.min(e.line+r.linesAfter,i.length).toString().length,a=r.maxLength-(r.indent+f+3);for(s=1;s<=r.linesBefore&&!(t-s<0);s++)u=ee(e.buffer,o[t-s],i[t-s],e.position-(o[t]-o[t-s]),a),c=C.repeat(" ",r.indent)+re((e.line-s+1).toString(),f)+" | "+u.str+`
5
+ `+c;for(u=ee(e.buffer,o[t],i[t],e.position,a),c+=C.repeat(" ",r.indent)+re((e.line+1).toString(),f)+" | "+u.str+`
6
+ `,c+=C.repeat("-",r.indent+f+3+u.pos)+`^
7
+ `,s=1;s<=r.linesAfter&&!(t+s>=i.length);s++)u=ee(e.buffer,o[t+s],i[t+s],e.position-(o[t]-o[t+s]),a),c+=C.repeat(" ",r.indent)+re((e.line+s+1).toString(),f)+" | "+u.str+`
8
+ `;return c.replace(/\n$/,"")}var Sr=Er,Fr=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],_r=["scalar","sequence","mapping"];function Tr(e){var r={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(o){r[String(o)]=n})}),r}function Rr(e,r){if(r=r||{},Object.keys(r).forEach(function(n){if(Fr.indexOf(n)===-1)throw new E('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=r,this.tag=e,this.kind=r.kind||null,this.resolve=r.resolve||function(){return!0},this.construct=r.construct||function(n){return n},this.instanceOf=r.instanceOf||null,this.predicate=r.predicate||null,this.represent=r.represent||null,this.representName=r.representName||null,this.defaultStyle=r.defaultStyle||null,this.multi=r.multi||!1,this.styleAliases=Tr(r.styleAliases||null),_r.indexOf(this.kind)===-1)throw new E('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var w=Rr;function xe(e,r){var n=[];return e[r].forEach(function(o){var i=n.length;n.forEach(function(l,t){l.tag===o.tag&&l.kind===o.kind&&l.multi===o.multi&&(i=t)}),n[i]=o}),n}function Or(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},r,n;function o(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(r=0,n=arguments.length;r<n;r+=1)arguments[r].forEach(o);return e}function ie(e){return this.extend(e)}ie.prototype.extend=function(r){var n=[],o=[];if(r instanceof w)o.push(r);else if(Array.isArray(r))o=o.concat(r);else if(r&&(Array.isArray(r.implicit)||Array.isArray(r.explicit)))r.implicit&&(n=n.concat(r.implicit)),r.explicit&&(o=o.concat(r.explicit));else throw new E("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(l){if(!(l instanceof w))throw new E("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(l.loadKind&&l.loadKind!=="scalar")throw new E("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(l.multi)throw new E("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),o.forEach(function(l){if(!(l instanceof w))throw new E("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(ie.prototype);return i.implicit=(this.implicit||[]).concat(n),i.explicit=(this.explicit||[]).concat(o),i.compiledImplicit=xe(i,"implicit"),i.compiledExplicit=xe(i,"explicit"),i.compiledTypeMap=Or(i.compiledImplicit,i.compiledExplicit),i};var Lr=ie,Dr=new w("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),kr=new w("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Ir=new w("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Pr=new Lr({explicit:[Dr,kr,Ir]});function Mr(e){if(e===null)return!0;var r=e.length;return r===1&&e==="~"||r===4&&(e==="null"||e==="Null"||e==="NULL")}function Nr(){return null}function jr(e){return e===null}var $r=new w("tag:yaml.org,2002:null",{kind:"scalar",resolve:Mr,construct:Nr,predicate:jr,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function qr(e){if(e===null)return!1;var r=e.length;return r===4&&(e==="true"||e==="True"||e==="TRUE")||r===5&&(e==="false"||e==="False"||e==="FALSE")}function Br(e){return e==="true"||e==="True"||e==="TRUE"}function Yr(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Hr=new w("tag:yaml.org,2002:bool",{kind:"scalar",resolve:qr,construct:Br,predicate:Yr,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Ur(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Gr(e){return 48<=e&&e<=55}function Wr(e){return 48<=e&&e<=57}function Kr(e){if(e===null)return!1;var r=e.length,n=0,o=!1,i;if(!r)return!1;if(i=e[n],(i==="-"||i==="+")&&(i=e[++n]),i==="0"){if(n+1===r)return!0;if(i=e[++n],i==="b"){for(n++;n<r;n++)if(i=e[n],i!=="_"){if(i!=="0"&&i!=="1")return!1;o=!0}return o&&i!=="_"}if(i==="x"){for(n++;n<r;n++)if(i=e[n],i!=="_"){if(!Ur(e.charCodeAt(n)))return!1;o=!0}return o&&i!=="_"}if(i==="o"){for(n++;n<r;n++)if(i=e[n],i!=="_"){if(!Gr(e.charCodeAt(n)))return!1;o=!0}return o&&i!=="_"}}if(i==="_")return!1;for(;n<r;n++)if(i=e[n],i!=="_"){if(!Wr(e.charCodeAt(n)))return!1;o=!0}return!(!o||i==="_")}function Qr(e){var r=e,n=1,o;if(r.indexOf("_")!==-1&&(r=r.replace(/_/g,"")),o=r[0],(o==="-"||o==="+")&&(o==="-"&&(n=-1),r=r.slice(1),o=r[0]),r==="0")return 0;if(o==="0"){if(r[1]==="b")return n*parseInt(r.slice(2),2);if(r[1]==="x")return n*parseInt(r.slice(2),16);if(r[1]==="o")return n*parseInt(r.slice(2),8)}return n*parseInt(r,10)}function Vr(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!C.isNegativeZero(e)}var Xr=new w("tag:yaml.org,2002:int",{kind:"scalar",resolve:Kr,construct:Qr,predicate:Vr,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Zr=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Jr(e){return!(e===null||!Zr.test(e)||e[e.length-1]==="_")}function zr(e){var r,n;return r=e.replace(/_/g,"").toLowerCase(),n=r[0]==="-"?-1:1,"+-".indexOf(r[0])>=0&&(r=r.slice(1)),r===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:r===".nan"?NaN:n*parseFloat(r,10)}var en=/^[-+]?[0-9]+e/;function rn(e,r){var n;if(isNaN(e))switch(r){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(r){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(r){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(C.isNegativeZero(e))return"-0.0";return n=e.toString(10),en.test(n)?n.replace("e",".e"):n}function nn(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||C.isNegativeZero(e))}var on=new w("tag:yaml.org,2002:float",{kind:"scalar",resolve:Jr,construct:zr,predicate:nn,represent:rn,defaultStyle:"lowercase"}),tn=Pr.extend({implicit:[$r,Hr,Xr,on]}),ln=tn,Pe=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Me=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function cn(e){return e===null?!1:Pe.exec(e)!==null||Me.exec(e)!==null}function sn(e){var r,n,o,i,l,t,c,s=0,u=null,f,a,h;if(r=Pe.exec(e),r===null&&(r=Me.exec(e)),r===null)throw new Error("Date resolve error");if(n=+r[1],o=+r[2]-1,i=+r[3],!r[4])return new Date(Date.UTC(n,o,i));if(l=+r[4],t=+r[5],c=+r[6],r[7]){for(s=r[7].slice(0,3);s.length<3;)s+="0";s=+s}return r[9]&&(f=+r[10],a=+(r[11]||0),u=(f*60+a)*6e4,r[9]==="-"&&(u=-u)),h=new Date(Date.UTC(n,o,i,l,t,c,s)),u&&h.setTime(h.getTime()-u),h}function un(e){return e.toISOString()}var an=new w("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:cn,construct:sn,instanceOf:Date,represent:un});function fn(e){return e==="<<"||e===null}var pn=new w("tag:yaml.org,2002:merge",{kind:"scalar",resolve:fn}),se=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
9
+ \r`;function hn(e){if(e===null)return!1;var r,n,o=0,i=e.length,l=se;for(n=0;n<i;n++)if(r=l.indexOf(e.charAt(n)),!(r>64)){if(r<0)return!1;o+=6}return o%8===0}function dn(e){var r,n,o=e.replace(/[\r\n=]/g,""),i=o.length,l=se,t=0,c=[];for(r=0;r<i;r++)r%4===0&&r&&(c.push(t>>16&255),c.push(t>>8&255),c.push(t&255)),t=t<<6|l.indexOf(o.charAt(r));return n=i%4*6,n===0?(c.push(t>>16&255),c.push(t>>8&255),c.push(t&255)):n===18?(c.push(t>>10&255),c.push(t>>2&255)):n===12&&c.push(t>>4&255),new Uint8Array(c)}function mn(e){var r="",n=0,o,i,l=e.length,t=se;for(o=0;o<l;o++)o%3===0&&o&&(r+=t[n>>18&63],r+=t[n>>12&63],r+=t[n>>6&63],r+=t[n&63]),n=(n<<8)+e[o];return i=l%3,i===0?(r+=t[n>>18&63],r+=t[n>>12&63],r+=t[n>>6&63],r+=t[n&63]):i===2?(r+=t[n>>10&63],r+=t[n>>4&63],r+=t[n<<2&63],r+=t[64]):i===1&&(r+=t[n>>2&63],r+=t[n<<4&63],r+=t[64],r+=t[64]),r}function gn(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var yn=new w("tag:yaml.org,2002:binary",{kind:"scalar",resolve:hn,construct:dn,predicate:gn,represent:mn}),xn=Object.prototype.hasOwnProperty,vn=Object.prototype.toString;function An(e){if(e===null)return!0;var r=[],n,o,i,l,t,c=e;for(n=0,o=c.length;n<o;n+=1){if(i=c[n],t=!1,vn.call(i)!=="[object Object]")return!1;for(l in i)if(xn.call(i,l))if(!t)t=!0;else return!1;if(!t)return!1;if(r.indexOf(l)===-1)r.push(l);else return!1}return!0}function Cn(e){return e!==null?e:[]}var wn=new w("tag:yaml.org,2002:omap",{kind:"sequence",resolve:An,construct:Cn}),bn=Object.prototype.toString;function En(e){if(e===null)return!0;var r,n,o,i,l,t=e;for(l=new Array(t.length),r=0,n=t.length;r<n;r+=1){if(o=t[r],bn.call(o)!=="[object Object]"||(i=Object.keys(o),i.length!==1))return!1;l[r]=[i[0],o[i[0]]]}return!0}function Sn(e){if(e===null)return[];var r,n,o,i,l,t=e;for(l=new Array(t.length),r=0,n=t.length;r<n;r+=1)o=t[r],i=Object.keys(o),l[r]=[i[0],o[i[0]]];return l}var Fn=new w("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:En,construct:Sn}),_n=Object.prototype.hasOwnProperty;function Tn(e){if(e===null)return!0;var r,n=e;for(r in n)if(_n.call(n,r)&&n[r]!==null)return!1;return!0}function Rn(e){return e!==null?e:{}}var On=new w("tag:yaml.org,2002:set",{kind:"mapping",resolve:Tn,construct:Rn}),Ne=ln.extend({implicit:[an,pn],explicit:[yn,wn,Fn,On]}),R=Object.prototype.hasOwnProperty,U=1,je=2,$e=3,G=4,ne=1,Ln=2,ve=3,Dn=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,kn=/[\x85\u2028\u2029]/,In=/[,\[\]\{\}]/,qe=/^(?:!|!!|![a-z\-]+!)$/i,Be=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Ae(e){return Object.prototype.toString.call(e)}function F(e){return e===10||e===13}function D(e){return e===9||e===32}function S(e){return e===9||e===32||e===10||e===13}function I(e){return e===44||e===91||e===93||e===123||e===125}function Pn(e){var r;return 48<=e&&e<=57?e-48:(r=e|32,97<=r&&r<=102?r-97+10:-1)}function Mn(e){return e===120?2:e===117?4:e===85?8:0}function Nn(e){return 48<=e&&e<=57?e-48:-1}function Ce(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
10
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function jn(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var Ye=new Array(256),He=new Array(256);for(L=0;L<256;L++)Ye[L]=Ce(L)?1:0,He[L]=Ce(L);var L;function $n(e,r){this.input=e,this.filename=r.filename||null,this.schema=r.schema||Ne,this.onWarning=r.onWarning||null,this.legacy=r.legacy||!1,this.json=r.json||!1,this.listener=r.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Ue(e,r){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=Sr(n),new E(r,n)}function p(e,r){throw Ue(e,r)}function W(e,r){e.onWarning&&e.onWarning.call(null,Ue(e,r))}var we={YAML:function(r,n,o){var i,l,t;r.version!==null&&p(r,"duplication of %YAML directive"),o.length!==1&&p(r,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(o[0]),i===null&&p(r,"ill-formed argument of the YAML directive"),l=parseInt(i[1],10),t=parseInt(i[2],10),l!==1&&p(r,"unacceptable YAML version of the document"),r.version=o[0],r.checkLineBreaks=t<2,t!==1&&t!==2&&W(r,"unsupported YAML version of the document")},TAG:function(r,n,o){var i,l;o.length!==2&&p(r,"TAG directive accepts exactly two arguments"),i=o[0],l=o[1],qe.test(i)||p(r,"ill-formed tag handle (first argument) of the TAG directive"),R.call(r.tagMap,i)&&p(r,'there is a previously declared suffix for "'+i+'" tag handle'),Be.test(l)||p(r,"ill-formed tag prefix (second argument) of the TAG directive");try{l=decodeURIComponent(l)}catch{p(r,"tag prefix is malformed: "+l)}r.tagMap[i]=l}};function T(e,r,n,o){var i,l,t,c;if(r<n){if(c=e.input.slice(r,n),o)for(i=0,l=c.length;i<l;i+=1)t=c.charCodeAt(i),t===9||32<=t&&t<=1114111||p(e,"expected valid JSON character");else Dn.test(c)&&p(e,"the stream contains non-printable characters");e.result+=c}}function be(e,r,n,o){var i,l,t,c;for(C.isObject(n)||p(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),t=0,c=i.length;t<c;t+=1)l=i[t],R.call(r,l)||(r[l]=n[l],o[l]=!0)}function P(e,r,n,o,i,l,t,c,s){var u,f;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),u=0,f=i.length;u<f;u+=1)Array.isArray(i[u])&&p(e,"nested arrays are not supported inside keys"),typeof i=="object"&&Ae(i[u])==="[object Object]"&&(i[u]="[object Object]");if(typeof i=="object"&&Ae(i)==="[object Object]"&&(i="[object Object]"),i=String(i),r===null&&(r={}),o==="tag:yaml.org,2002:merge")if(Array.isArray(l))for(u=0,f=l.length;u<f;u+=1)be(e,r,l[u],n);else be(e,r,l,n);else!e.json&&!R.call(n,i)&&R.call(r,i)&&(e.line=t||e.line,e.lineStart=c||e.lineStart,e.position=s||e.position,p(e,"duplicated mapping key")),i==="__proto__"?Object.defineProperty(r,i,{configurable:!0,enumerable:!0,writable:!0,value:l}):r[i]=l,delete n[i];return r}function ue(e){var r;r=e.input.charCodeAt(e.position),r===10?e.position++:r===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):p(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function A(e,r,n){for(var o=0,i=e.input.charCodeAt(e.position);i!==0;){for(;D(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(r&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(F(i))for(ue(e),i=e.input.charCodeAt(e.position),o++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&o!==0&&e.lineIndent<n&&W(e,"deficient indentation"),o}function V(e){var r=e.position,n;return n=e.input.charCodeAt(r),!!((n===45||n===46)&&n===e.input.charCodeAt(r+1)&&n===e.input.charCodeAt(r+2)&&(r+=3,n=e.input.charCodeAt(r),n===0||S(n)))}function ae(e,r){r===1?e.result+=" ":r>1&&(e.result+=C.repeat(`
11
+ `,r-1))}function qn(e,r,n){var o,i,l,t,c,s,u,f,a=e.kind,h=e.result,d;if(d=e.input.charCodeAt(e.position),S(d)||I(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(i=e.input.charCodeAt(e.position+1),S(i)||n&&I(i)))return!1;for(e.kind="scalar",e.result="",l=t=e.position,c=!1;d!==0;){if(d===58){if(i=e.input.charCodeAt(e.position+1),S(i)||n&&I(i))break}else if(d===35){if(o=e.input.charCodeAt(e.position-1),S(o))break}else{if(e.position===e.lineStart&&V(e)||n&&I(d))break;if(F(d))if(s=e.line,u=e.lineStart,f=e.lineIndent,A(e,!1,-1),e.lineIndent>=r){c=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=t,e.line=s,e.lineStart=u,e.lineIndent=f;break}}c&&(T(e,l,t,!1),ae(e,e.line-s),l=t=e.position,c=!1),D(d)||(t=e.position+1),d=e.input.charCodeAt(++e.position)}return T(e,l,t,!1),e.result?!0:(e.kind=a,e.result=h,!1)}function Bn(e,r){var n,o,i;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,o=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(T(e,o,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)o=e.position,e.position++,i=e.position;else return!0;else F(n)?(T(e,o,i,!0),ae(e,A(e,!1,r)),o=i=e.position):e.position===e.lineStart&&V(e)?p(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);p(e,"unexpected end of the stream within a single quoted scalar")}function Yn(e,r){var n,o,i,l,t,c;if(c=e.input.charCodeAt(e.position),c!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=o=e.position;(c=e.input.charCodeAt(e.position))!==0;){if(c===34)return T(e,n,e.position,!0),e.position++,!0;if(c===92){if(T(e,n,e.position,!0),c=e.input.charCodeAt(++e.position),F(c))A(e,!1,r);else if(c<256&&Ye[c])e.result+=He[c],e.position++;else if((t=Mn(c))>0){for(i=t,l=0;i>0;i--)c=e.input.charCodeAt(++e.position),(t=Pn(c))>=0?l=(l<<4)+t:p(e,"expected hexadecimal character");e.result+=jn(l),e.position++}else p(e,"unknown escape sequence");n=o=e.position}else F(c)?(T(e,n,o,!0),ae(e,A(e,!1,r)),n=o=e.position):e.position===e.lineStart&&V(e)?p(e,"unexpected end of the document within a double quoted scalar"):(e.position++,o=e.position)}p(e,"unexpected end of the stream within a double quoted scalar")}function Hn(e,r){var n=!0,o,i,l,t=e.tag,c,s=e.anchor,u,f,a,h,d,m=Object.create(null),y,x,v,g;if(g=e.input.charCodeAt(e.position),g===91)f=93,d=!1,c=[];else if(g===123)f=125,d=!0,c={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=c),g=e.input.charCodeAt(++e.position);g!==0;){if(A(e,!0,r),g=e.input.charCodeAt(e.position),g===f)return e.position++,e.tag=t,e.anchor=s,e.kind=d?"mapping":"sequence",e.result=c,!0;n?g===44&&p(e,"expected the node content, but found ','"):p(e,"missed comma between flow collection entries"),x=y=v=null,a=h=!1,g===63&&(u=e.input.charCodeAt(e.position+1),S(u)&&(a=h=!0,e.position++,A(e,!0,r))),o=e.line,i=e.lineStart,l=e.position,M(e,r,U,!1,!0),x=e.tag,y=e.result,A(e,!0,r),g=e.input.charCodeAt(e.position),(h||e.line===o)&&g===58&&(a=!0,g=e.input.charCodeAt(++e.position),A(e,!0,r),M(e,r,U,!1,!0),v=e.result),d?P(e,c,m,x,y,v,o,i,l):a?c.push(P(e,null,m,x,y,v,o,i,l)):c.push(y),A(e,!0,r),g=e.input.charCodeAt(e.position),g===44?(n=!0,g=e.input.charCodeAt(++e.position)):n=!1}p(e,"unexpected end of the stream within a flow collection")}function Un(e,r){var n,o,i=ne,l=!1,t=!1,c=r,s=0,u=!1,f,a;if(a=e.input.charCodeAt(e.position),a===124)o=!1;else if(a===62)o=!0;else return!1;for(e.kind="scalar",e.result="";a!==0;)if(a=e.input.charCodeAt(++e.position),a===43||a===45)ne===i?i=a===43?ve:Ln:p(e,"repeat of a chomping mode identifier");else if((f=Nn(a))>=0)f===0?p(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):t?p(e,"repeat of an indentation width identifier"):(c=r+f-1,t=!0);else break;if(D(a)){do a=e.input.charCodeAt(++e.position);while(D(a));if(a===35)do a=e.input.charCodeAt(++e.position);while(!F(a)&&a!==0)}for(;a!==0;){for(ue(e),e.lineIndent=0,a=e.input.charCodeAt(e.position);(!t||e.lineIndent<c)&&a===32;)e.lineIndent++,a=e.input.charCodeAt(++e.position);if(!t&&e.lineIndent>c&&(c=e.lineIndent),F(a)){s++;continue}if(e.lineIndent<c){i===ve?e.result+=C.repeat(`
12
+ `,l?1+s:s):i===ne&&l&&(e.result+=`
13
+ `);break}for(o?D(a)?(u=!0,e.result+=C.repeat(`
14
+ `,l?1+s:s)):u?(u=!1,e.result+=C.repeat(`
15
+ `,s+1)):s===0?l&&(e.result+=" "):e.result+=C.repeat(`
16
+ `,s):e.result+=C.repeat(`
17
+ `,l?1+s:s),l=!0,t=!0,s=0,n=e.position;!F(a)&&a!==0;)a=e.input.charCodeAt(++e.position);T(e,n,e.position,!1)}return!0}function Ee(e,r){var n,o=e.tag,i=e.anchor,l=[],t,c=!1,s;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=l),s=e.input.charCodeAt(e.position);s!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,p(e,"tab characters must not be used in indentation")),!(s!==45||(t=e.input.charCodeAt(e.position+1),!S(t))));){if(c=!0,e.position++,A(e,!0,-1)&&e.lineIndent<=r){l.push(null),s=e.input.charCodeAt(e.position);continue}if(n=e.line,M(e,r,$e,!1,!0),l.push(e.result),A(e,!0,-1),s=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>r)&&s!==0)p(e,"bad indentation of a sequence entry");else if(e.lineIndent<r)break}return c?(e.tag=o,e.anchor=i,e.kind="sequence",e.result=l,!0):!1}function Gn(e,r,n){var o,i,l,t,c,s,u=e.tag,f=e.anchor,a={},h=Object.create(null),d=null,m=null,y=null,x=!1,v=!1,g;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),g=e.input.charCodeAt(e.position);g!==0;){if(!x&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,p(e,"tab characters must not be used in indentation")),o=e.input.charCodeAt(e.position+1),l=e.line,(g===63||g===58)&&S(o))g===63?(x&&(P(e,a,h,d,m,null,t,c,s),d=m=y=null),v=!0,x=!0,i=!0):x?(x=!1,i=!0):p(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,g=o;else{if(t=e.line,c=e.lineStart,s=e.position,!M(e,n,je,!1,!0))break;if(e.line===l){for(g=e.input.charCodeAt(e.position);D(g);)g=e.input.charCodeAt(++e.position);if(g===58)g=e.input.charCodeAt(++e.position),S(g)||p(e,"a whitespace character is expected after the key-value separator within a block mapping"),x&&(P(e,a,h,d,m,null,t,c,s),d=m=y=null),v=!0,x=!1,i=!1,d=e.tag,m=e.result;else if(v)p(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=u,e.anchor=f,!0}else if(v)p(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=u,e.anchor=f,!0}if((e.line===l||e.lineIndent>r)&&(x&&(t=e.line,c=e.lineStart,s=e.position),M(e,r,G,!0,i)&&(x?m=e.result:y=e.result),x||(P(e,a,h,d,m,y,t,c,s),d=m=y=null),A(e,!0,-1),g=e.input.charCodeAt(e.position)),(e.line===l||e.lineIndent>r)&&g!==0)p(e,"bad indentation of a mapping entry");else if(e.lineIndent<r)break}return x&&P(e,a,h,d,m,null,t,c,s),v&&(e.tag=u,e.anchor=f,e.kind="mapping",e.result=a),v}function Wn(e){var r,n=!1,o=!1,i,l,t;if(t=e.input.charCodeAt(e.position),t!==33)return!1;if(e.tag!==null&&p(e,"duplication of a tag property"),t=e.input.charCodeAt(++e.position),t===60?(n=!0,t=e.input.charCodeAt(++e.position)):t===33?(o=!0,i="!!",t=e.input.charCodeAt(++e.position)):i="!",r=e.position,n){do t=e.input.charCodeAt(++e.position);while(t!==0&&t!==62);e.position<e.length?(l=e.input.slice(r,e.position),t=e.input.charCodeAt(++e.position)):p(e,"unexpected end of the stream within a verbatim tag")}else{for(;t!==0&&!S(t);)t===33&&(o?p(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(r-1,e.position+1),qe.test(i)||p(e,"named tag handle cannot contain such characters"),o=!0,r=e.position+1)),t=e.input.charCodeAt(++e.position);l=e.input.slice(r,e.position),In.test(l)&&p(e,"tag suffix cannot contain flow indicator characters")}l&&!Be.test(l)&&p(e,"tag name cannot contain such characters: "+l);try{l=decodeURIComponent(l)}catch{p(e,"tag name is malformed: "+l)}return n?e.tag=l:R.call(e.tagMap,i)?e.tag=e.tagMap[i]+l:i==="!"?e.tag="!"+l:i==="!!"?e.tag="tag:yaml.org,2002:"+l:p(e,'undeclared tag handle "'+i+'"'),!0}function Kn(e){var r,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&p(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),r=e.position;n!==0&&!S(n)&&!I(n);)n=e.input.charCodeAt(++e.position);return e.position===r&&p(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(r,e.position),!0}function Qn(e){var r,n,o;if(o=e.input.charCodeAt(e.position),o!==42)return!1;for(o=e.input.charCodeAt(++e.position),r=e.position;o!==0&&!S(o)&&!I(o);)o=e.input.charCodeAt(++e.position);return e.position===r&&p(e,"name of an alias node must contain at least one character"),n=e.input.slice(r,e.position),R.call(e.anchorMap,n)||p(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],A(e,!0,-1),!0}function M(e,r,n,o,i){var l,t,c,s=1,u=!1,f=!1,a,h,d,m,y,x;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,l=t=c=G===n||$e===n,o&&A(e,!0,-1)&&(u=!0,e.lineIndent>r?s=1:e.lineIndent===r?s=0:e.lineIndent<r&&(s=-1)),s===1)for(;Wn(e)||Kn(e);)A(e,!0,-1)?(u=!0,c=l,e.lineIndent>r?s=1:e.lineIndent===r?s=0:e.lineIndent<r&&(s=-1)):c=!1;if(c&&(c=u||i),(s===1||G===n)&&(U===n||je===n?y=r:y=r+1,x=e.position-e.lineStart,s===1?c&&(Ee(e,x)||Gn(e,x,y))||Hn(e,y)?f=!0:(t&&Un(e,y)||Bn(e,y)||Yn(e,y)?f=!0:Qn(e)?(f=!0,(e.tag!==null||e.anchor!==null)&&p(e,"alias node should not have any properties")):qn(e,y,U===n)&&(f=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):s===0&&(f=c&&Ee(e,x))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&p(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),a=0,h=e.implicitTypes.length;a<h;a+=1)if(m=e.implicitTypes[a],m.resolve(e.result)){e.result=m.construct(e.result),e.tag=m.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(R.call(e.typeMap[e.kind||"fallback"],e.tag))m=e.typeMap[e.kind||"fallback"][e.tag];else for(m=null,d=e.typeMap.multi[e.kind||"fallback"],a=0,h=d.length;a<h;a+=1)if(e.tag.slice(0,d[a].tag.length)===d[a].tag){m=d[a];break}m||p(e,"unknown tag !<"+e.tag+">"),e.result!==null&&m.kind!==e.kind&&p(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+m.kind+'", not "'+e.kind+'"'),m.resolve(e.result,e.tag)?(e.result=m.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):p(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||f}function Vn(e){var r=e.position,n,o,i,l=!1,t;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(t=e.input.charCodeAt(e.position))!==0&&(A(e,!0,-1),t=e.input.charCodeAt(e.position),!(e.lineIndent>0||t!==37));){for(l=!0,t=e.input.charCodeAt(++e.position),n=e.position;t!==0&&!S(t);)t=e.input.charCodeAt(++e.position);for(o=e.input.slice(n,e.position),i=[],o.length<1&&p(e,"directive name must not be less than one character in length");t!==0;){for(;D(t);)t=e.input.charCodeAt(++e.position);if(t===35){do t=e.input.charCodeAt(++e.position);while(t!==0&&!F(t));break}if(F(t))break;for(n=e.position;t!==0&&!S(t);)t=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}t!==0&&ue(e),R.call(we,o)?we[o](e,o,i):W(e,'unknown document directive "'+o+'"')}if(A(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,A(e,!0,-1)):l&&p(e,"directives end mark is expected"),M(e,e.lineIndent-1,G,!1,!0),A(e,!0,-1),e.checkLineBreaks&&kn.test(e.input.slice(r,e.position))&&W(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&V(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,A(e,!0,-1));return}if(e.position<e.length-1)p(e,"end of the stream or a document separator is expected");else return}function Ge(e,r){e=String(e),r=r||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
18
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new $n(e,r),o=e.indexOf("\0");for(o!==-1&&(n.position=o,p(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Vn(n);return n.documents}function Xn(e,r,n){r!==null&&typeof r=="object"&&typeof n>"u"&&(n=r,r=null);var o=Ge(e,n);if(typeof r!="function")return o;for(var i=0,l=o.length;i<l;i+=1)r(o[i])}function Zn(e,r){var n=Ge(e,r);if(n.length!==0){if(n.length===1)return n[0];throw new E("expected a single document in the stream, but found more")}}var Jn=Xn,zn=Zn,We={loadAll:Jn,load:zn},Ke=Object.prototype.toString,Qe=Object.prototype.hasOwnProperty,fe=65279,ei=9,B=10,ri=13,ni=32,ii=33,oi=34,oe=35,ti=37,li=38,ci=39,si=42,Ve=44,ui=45,K=58,ai=61,fi=62,pi=63,hi=64,Xe=91,Ze=93,di=96,Je=123,mi=124,ze=125,b={};b[0]="\\0";b[7]="\\a";b[8]="\\b";b[9]="\\t";b[10]="\\n";b[11]="\\v";b[12]="\\f";b[13]="\\r";b[27]="\\e";b[34]='\\"';b[92]="\\\\";b[133]="\\N";b[160]="\\_";b[8232]="\\L";b[8233]="\\P";var gi=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],yi=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function xi(e,r){var n,o,i,l,t,c,s;if(r===null)return{};for(n={},o=Object.keys(r),i=0,l=o.length;i<l;i+=1)t=o[i],c=String(r[t]),t.slice(0,2)==="!!"&&(t="tag:yaml.org,2002:"+t.slice(2)),s=e.compiledTypeMap.fallback[t],s&&Qe.call(s.styleAliases,c)&&(c=s.styleAliases[c]),n[t]=c;return n}function vi(e){var r,n,o;if(r=e.toString(16).toUpperCase(),e<=255)n="x",o=2;else if(e<=65535)n="u",o=4;else if(e<=4294967295)n="U",o=8;else throw new E("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+C.repeat("0",o-r.length)+r}var Ai=1,Y=2;function Ci(e){this.schema=e.schema||Ne,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=C.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=xi(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Y:Ai,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Se(e,r){for(var n=C.repeat(" ",r),o=0,i=-1,l="",t,c=e.length;o<c;)i=e.indexOf(`
19
+ `,o),i===-1?(t=e.slice(o),o=c):(t=e.slice(o,i+1),o=i+1),t.length&&t!==`
20
+ `&&(l+=n),l+=t;return l}function te(e,r){return`
21
+ `+C.repeat(" ",e.indent*r)}function wi(e,r){var n,o,i;for(n=0,o=e.implicitTypes.length;n<o;n+=1)if(i=e.implicitTypes[n],i.resolve(r))return!0;return!1}function Q(e){return e===ni||e===ei}function H(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==fe||65536<=e&&e<=1114111}function Fe(e){return H(e)&&e!==fe&&e!==ri&&e!==B}function _e(e,r,n){var o=Fe(e),i=o&&!Q(e);return(n?o:o&&e!==Ve&&e!==Xe&&e!==Ze&&e!==Je&&e!==ze)&&e!==oe&&!(r===K&&!i)||Fe(r)&&!Q(r)&&e===oe||r===K&&i}function bi(e){return H(e)&&e!==fe&&!Q(e)&&e!==ui&&e!==pi&&e!==K&&e!==Ve&&e!==Xe&&e!==Ze&&e!==Je&&e!==ze&&e!==oe&&e!==li&&e!==si&&e!==ii&&e!==mi&&e!==ai&&e!==fi&&e!==ci&&e!==oi&&e!==ti&&e!==hi&&e!==di}function Ei(e){return!Q(e)&&e!==K}function $(e,r){var n=e.charCodeAt(r),o;return n>=55296&&n<=56319&&r+1<e.length&&(o=e.charCodeAt(r+1),o>=56320&&o<=57343)?(n-55296)*1024+o-56320+65536:n}function er(e){var r=/^\n* /;return r.test(e)}var rr=1,le=2,nr=3,ir=4,k=5;function Si(e,r,n,o,i,l,t,c){var s,u=0,f=null,a=!1,h=!1,d=o!==-1,m=-1,y=bi($(e,0))&&Ei($(e,e.length-1));if(r||t)for(s=0;s<e.length;u>=65536?s+=2:s++){if(u=$(e,s),!H(u))return k;y=y&&_e(u,f,c),f=u}else{for(s=0;s<e.length;u>=65536?s+=2:s++){if(u=$(e,s),u===B)a=!0,d&&(h=h||s-m-1>o&&e[m+1]!==" ",m=s);else if(!H(u))return k;y=y&&_e(u,f,c),f=u}h=h||d&&s-m-1>o&&e[m+1]!==" "}return!a&&!h?y&&!t&&!i(e)?rr:l===Y?k:le:n>9&&er(e)?k:t?l===Y?k:le:h?ir:nr}function Fi(e,r,n,o,i){e.dump=function(){if(r.length===0)return e.quotingType===Y?'""':"''";if(!e.noCompatMode&&(gi.indexOf(r)!==-1||yi.test(r)))return e.quotingType===Y?'"'+r+'"':"'"+r+"'";var l=e.indent*Math.max(1,n),t=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-l),c=o||e.flowLevel>-1&&n>=e.flowLevel;function s(u){return wi(e,u)}switch(Si(r,c,e.indent,t,s,e.quotingType,e.forceQuotes&&!o,i)){case rr:return r;case le:return"'"+r.replace(/'/g,"''")+"'";case nr:return"|"+Te(r,e.indent)+Re(Se(r,l));case ir:return">"+Te(r,e.indent)+Re(Se(_i(r,t),l));case k:return'"'+Ti(r)+'"';default:throw new E("impossible error: invalid scalar style")}}()}function Te(e,r){var n=er(e)?String(r):"",o=e[e.length-1]===`
22
+ `,i=o&&(e[e.length-2]===`
34
23
  `||e===`
35
- `),l=r?"+":o?"":"-";return i+l+`
36
- `}function Fe(e){return e[e.length-1]===`
37
- `?e.slice(0,-1):e}function Fr(e,n){for(var i=/(\n+)([^\n]*)/g,o=function(){var s=e.indexOf(`
38
- `);return s=s!==-1?s:e.length,i.lastIndex=s,Te(e.slice(0,s),n)}(),r=e[0]===`
39
- `||e[0]===" ",l,t;t=i.exec(e);){var c=t[1],u=t[2];l=u[0]===" ",o+=c+(!r&&!l&&u!==""?`
40
- `:"")+Te(u,n),r=l}return o}function Te(e,n){if(e===""||e[0]===" ")return e;for(var i=/ [^ ]/g,o,r=0,l,t=0,c=0,u="";o=i.exec(e);)c=o.index,c-r>n&&(l=t>r?t:c,u+=`
41
- `+e.slice(r,l),r=l+1),t=c;return u+=`
42
- `,e.length-r>n&&t>r?u+=e.slice(r,t)+`
43
- `+e.slice(t+1):u+=e.slice(r),u.slice(1)}function Tr(e){for(var n="",i=0,o,r=0;r<e.length;i>=65536?r+=2:r++)i=j(e,r),o=w[i],!o&&B(i)?(n+=e[r],i>=65536&&(n+=e[r+1])):n+=o||yr(i);return n}function Or(e,n,i){var o="",r=e.tag,l,t,c;for(l=0,t=i.length;l<t;l+=1)c=i[l],e.replacer&&(c=e.replacer.call(i,String(l),c)),(F(e,n,c,!1,!1)||typeof c>"u"&&F(e,n,null,!1,!1))&&(o!==""&&(o+=","+(e.condenseFlow?"":" ")),o+=e.dump);e.tag=r,e.dump="["+o+"]"}function Oe(e,n,i,o){var r="",l=e.tag,t,c,u;for(t=0,c=i.length;t<c;t+=1)u=i[t],e.replacer&&(u=e.replacer.call(i,String(t),u)),(F(e,n+1,u,!0,!0,!1,!0)||typeof u>"u"&&F(e,n+1,null,!0,!0,!1,!0))&&((!o||r!=="")&&(r+=te(e,n)),e.dump&&Y===e.dump.charCodeAt(0)?r+="-":r+="- ",r+=e.dump);e.tag=l,e.dump=r||"[]"}function Lr(e,n,i){var o="",r=e.tag,l=Object.keys(i),t,c,u,s,f;for(t=0,c=l.length;t<c;t+=1)f="",o!==""&&(f+=", "),e.condenseFlow&&(f+='"'),u=l[t],s=i[u],e.replacer&&(s=e.replacer.call(i,u,s)),F(e,n,u,!1,!1)&&(e.dump.length>1024&&(f+="? "),f+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),F(e,n,s,!1,!1)&&(f+=e.dump,o+=f));e.tag=r,e.dump="{"+o+"}"}function Ir(e,n,i,o){var r="",l=e.tag,t=Object.keys(i),c,u,s,f,a,h;if(e.sortKeys===!0)t.sort();else if(typeof e.sortKeys=="function")t.sort(e.sortKeys);else if(e.sortKeys)throw new E("sortKeys must be a boolean or a function");for(c=0,u=t.length;c<u;c+=1)h="",(!o||r!=="")&&(h+=te(e,n)),s=t[c],f=i[s],e.replacer&&(f=e.replacer.call(i,s,f)),F(e,n+1,s,!0,!0,!0)&&(a=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,a&&(e.dump&&Y===e.dump.charCodeAt(0)?h+="?":h+="? "),h+=e.dump,a&&(h+=te(e,n)),F(e,n+1,f,!0,a)&&(e.dump&&Y===e.dump.charCodeAt(0)?h+=":":h+=": ",h+=e.dump,r+=h));e.tag=l,e.dump=r||"{}"}function Le(e,n,i){var o,r,l,t,c,u;for(r=i?e.explicitTypes:e.implicitTypes,l=0,t=r.length;l<t;l+=1)if(c=r[l],(c.instanceOf||c.predicate)&&(!c.instanceOf||typeof n=="object"&&n instanceof c.instanceOf)&&(!c.predicate||c.predicate(n))){if(i?c.multi&&c.representName?e.tag=c.representName(n):e.tag=c.tag:e.tag="?",c.represent){if(u=e.styleMap[c.tag]||c.defaultStyle,Ge.call(c.represent)==="[object Function]")o=c.represent(n,u);else if(We.call(c.represent,u))o=c.represent[u](n,u);else throw new E("!<"+c.tag+'> tag resolver accepts not "'+u+'" style');e.dump=o}return!0}return!1}function F(e,n,i,o,r,l,t){e.tag=null,e.dump=i,Le(e,i,!1)||Le(e,i,!0);var c=Ge.call(e.dump),u=o,s;o&&(o=e.flowLevel<0||e.flowLevel>n);var f=c==="[object Object]"||c==="[object Array]",a,h;if(f&&(a=e.duplicates.indexOf(i),h=a!==-1),(e.tag!==null&&e.tag!=="?"||h||e.indent!==2&&n>0)&&(r=!1),h&&e.usedDuplicates[a])e.dump="*ref_"+a;else{if(f&&h&&!e.usedDuplicates[a]&&(e.usedDuplicates[a]=!0),c==="[object Object]")o&&Object.keys(e.dump).length!==0?(Ir(e,n,e.dump,r),h&&(e.dump="&ref_"+a+e.dump)):(Lr(e,n,e.dump),h&&(e.dump="&ref_"+a+" "+e.dump));else if(c==="[object Array]")o&&e.dump.length!==0?(e.noArrayIndent&&!t&&n>0?Oe(e,n-1,e.dump,r):Oe(e,n,e.dump,r),h&&(e.dump="&ref_"+a+e.dump)):(Or(e,n,e.dump),h&&(e.dump="&ref_"+a+" "+e.dump));else if(c==="[object String]")e.tag!=="?"&&_r(e,e.dump,n,l,u);else{if(c==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new E("unacceptable kind of an object to dump "+c)}e.tag!==null&&e.tag!=="?"&&(s=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?s="!"+s:s.slice(0,18)==="tag:yaml.org,2002:"?s="!!"+s.slice(18):s="!<"+s+">",e.dump=s+" "+e.dump)}return!0}function kr(e,n){var i=[],o=[],r,l;for(ce(e,i,o),r=0,l=o.length;r<l;r+=1)n.duplicates.push(i[o[r]]);n.usedDuplicates=new Array(l)}function ce(e,n,i){var o,r,l;if(e!==null&&typeof e=="object")if(r=n.indexOf(e),r!==-1)i.indexOf(r)===-1&&i.push(r);else if(n.push(e),Array.isArray(e))for(r=0,l=e.length;r<l;r+=1)ce(e[r],n,i);else for(o=Object.keys(e),r=0,l=o.length;r<l;r+=1)ce(e[o[r]],n,i)}function Pr(e,n){n=n||{};var i=new Cr(n);i.noRefs||kr(e,i);var o=e;return i.replacer&&(o=i.replacer.call({"":o},"",o)),F(i,0,o,!0,!0)?i.dump+`
44
- `:""}var Rr=Pr,Mr={dump:Rr};function pe(e,n){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}var rn=Ue.load,io=Ue.loadAll,ro=Mr.dump;var oo=pe("safeLoad","load"),to=pe("safeLoadAll","loadAll"),lo=pe("safeDump","dump");var ln={concurrency:1,enableEntityParallelization:!1,preserveRowOrder:!0,preserveEntityOrder:!0},tn={parallelProcessing:ln,entityConfig:{},entityDependencies:{}};function cn(e){let n=Nr.join(e,"config.yaml");try{if(!on.existsSync(n))return console.log("No config.yaml found, using default sequential processing"),tn;let i=on.readFileSync(n,"utf8"),o=rn(i);return jr(o)}catch(i){return console.warn(`Warning: Failed to parse config.yaml: ${i}. Using defaults.`),tn}}function jr(e){return{parallelProcessing:{...ln,...e.parallelProcessing||{}},entityConfig:e.entityConfig||{},entityDependencies:e.entityDependencies||{}}}function z(e,n){let i=n.entityConfig[e]||{},o={...n.parallelProcessing,...i};return o.preserveRowOrder&&o.concurrency>1&&(console.warn(`Entity '${e}': preserveRowOrder=true forces concurrency=1 (was ${o.concurrency})`),o.concurrency=1),o}var Z=class{constructor(n,i={}){this.entities=n,this.dependencies=i}resolveExecutionOrder(){let n=[],i=new Set,o=new Set,r=0;for(;i.size<this.entities.length;){let l=[];for(let t of this.entities){if(i.has(t)||o.has(t))continue;(this.dependencies[t]||[]).every(s=>i.has(s))&&(l.push(t),o.add(t))}if(l.length===0){let t=this.entities.filter(c=>!i.has(c));throw new Error(`Circular dependency detected or missing dependencies for entities: ${t.join(", ")}`)}n.push({entities:l,wave:r++}),l.forEach(t=>{i.add(t),o.delete(t)})}return n}validateDependencies(){let n=[],i=new Set(this.entities);for(let[o,r]of Object.entries(this.dependencies)){if(!i.has(o)){n.push(`Entity '${o}' has dependencies but is not in the entity list`);continue}for(let l of r)i.has(l)||n.push(`Entity '${o}' depends on '${l}' which does not exist`)}return n}getDependents(n){return Object.entries(this.dependencies).filter(([i,o])=>o.includes(n)).map(([i,o])=>i)}getDependencies(n){return this.dependencies[n]||[]}};import{basename as he}from"path";var de=new Yr;de.name("gql-ingest").description("A CLI tool for ingesting data from CSV files into a GraphQL API").version(un().version);de.requiredOption("-e, --endpoint <url>","GraphQL endpoint URL").requiredOption("-c, --config <path>","Path to configuration directory (containing data/, graphql/, mappings/ subdirectories)").option("-h, --headers <headers>","JSON string of headers to include in requests").option("-v, --verbose","Show detailed request results and responses").action(async e=>{try{console.log("Starting seed data generation...");let n=e.headers?JSON.parse(e.headers):{},i=new P,o=new H(e.endpoint,n,i,e.verbose),r=cn(e.config),l=new U(o,process.cwd(),i,e.verbose),t=l.discoverMappings(e.config);if(t.length===0){console.warn(`No mapping files found in ${e.config}/mappings`);return}let c=t.map(f=>he(f,".json")),u=new Z(c,r.entityDependencies),s=u.validateDependencies();s.length>0&&(console.error("Dependency validation errors:"),s.forEach(f=>console.error(` - ${f}`)),process.exit(1)),r.parallelProcessing.enableEntityParallelization?await Br(t,u,l,r):await $r(t,l,r),i.finishProcessing(),console.log(i.generateSummary())}catch(n){console.error("Error:",n),process.exit(1)}});async function $r(e,n,i){for(let o of e)try{let r=he(o,".json"),l=z(r,i);await n.processEntity(o,l)}catch(r){console.warn(`Warning: Could not process ${o}:`,r)}}async function Br(e,n,i,o){let r=n.resolveExecutionOrder(),l=new Map(e.map(t=>[he(t,".json"),t]));console.log(`Processing ${r.length} dependency waves...`);for(let t of r)if(console.log(`Wave ${t.wave+1}: Processing entities [${t.entities.join(", ")}]`),o.parallelProcessing.preserveEntityOrder)for(let c of t.entities){let u=l.get(c);if(u)try{let s=z(c,o);await i.processEntity(u,s)}catch(s){console.warn(`Warning: Could not process ${u}:`,s)}}else{let c=t.entities.map(async u=>{let s=l.get(u);if(s)try{let f=z(u,o);await i.processEntity(s,f)}catch(f){console.warn(`Warning: Could not process ${s}:`,f)}});await Promise.allSettled(c)}}de.parse();
24
+ `),l=i?"+":o?"":"-";return n+l+`
25
+ `}function Re(e){return e[e.length-1]===`
26
+ `?e.slice(0,-1):e}function _i(e,r){for(var n=/(\n+)([^\n]*)/g,o=function(){var u=e.indexOf(`
27
+ `);return u=u!==-1?u:e.length,n.lastIndex=u,Oe(e.slice(0,u),r)}(),i=e[0]===`
28
+ `||e[0]===" ",l,t;t=n.exec(e);){var c=t[1],s=t[2];l=s[0]===" ",o+=c+(!i&&!l&&s!==""?`
29
+ `:"")+Oe(s,r),i=l}return o}function Oe(e,r){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,o,i=0,l,t=0,c=0,s="";o=n.exec(e);)c=o.index,c-i>r&&(l=t>i?t:c,s+=`
30
+ `+e.slice(i,l),i=l+1),t=c;return s+=`
31
+ `,e.length-i>r&&t>i?s+=e.slice(i,t)+`
32
+ `+e.slice(t+1):s+=e.slice(i),s.slice(1)}function Ti(e){for(var r="",n=0,o,i=0;i<e.length;n>=65536?i+=2:i++)n=$(e,i),o=b[n],!o&&H(n)?(r+=e[i],n>=65536&&(r+=e[i+1])):r+=o||vi(n);return r}function Ri(e,r,n){var o="",i=e.tag,l,t,c;for(l=0,t=n.length;l<t;l+=1)c=n[l],e.replacer&&(c=e.replacer.call(n,String(l),c)),(_(e,r,c,!1,!1)||typeof c>"u"&&_(e,r,null,!1,!1))&&(o!==""&&(o+=","+(e.condenseFlow?"":" ")),o+=e.dump);e.tag=i,e.dump="["+o+"]"}function Le(e,r,n,o){var i="",l=e.tag,t,c,s;for(t=0,c=n.length;t<c;t+=1)s=n[t],e.replacer&&(s=e.replacer.call(n,String(t),s)),(_(e,r+1,s,!0,!0,!1,!0)||typeof s>"u"&&_(e,r+1,null,!0,!0,!1,!0))&&((!o||i!=="")&&(i+=te(e,r)),e.dump&&B===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=l,e.dump=i||"[]"}function Oi(e,r,n){var o="",i=e.tag,l=Object.keys(n),t,c,s,u,f;for(t=0,c=l.length;t<c;t+=1)f="",o!==""&&(f+=", "),e.condenseFlow&&(f+='"'),s=l[t],u=n[s],e.replacer&&(u=e.replacer.call(n,s,u)),_(e,r,s,!1,!1)&&(e.dump.length>1024&&(f+="? "),f+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),_(e,r,u,!1,!1)&&(f+=e.dump,o+=f));e.tag=i,e.dump="{"+o+"}"}function Li(e,r,n,o){var i="",l=e.tag,t=Object.keys(n),c,s,u,f,a,h;if(e.sortKeys===!0)t.sort();else if(typeof e.sortKeys=="function")t.sort(e.sortKeys);else if(e.sortKeys)throw new E("sortKeys must be a boolean or a function");for(c=0,s=t.length;c<s;c+=1)h="",(!o||i!=="")&&(h+=te(e,r)),u=t[c],f=n[u],e.replacer&&(f=e.replacer.call(n,u,f)),_(e,r+1,u,!0,!0,!0)&&(a=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,a&&(e.dump&&B===e.dump.charCodeAt(0)?h+="?":h+="? "),h+=e.dump,a&&(h+=te(e,r)),_(e,r+1,f,!0,a)&&(e.dump&&B===e.dump.charCodeAt(0)?h+=":":h+=": ",h+=e.dump,i+=h));e.tag=l,e.dump=i||"{}"}function De(e,r,n){var o,i,l,t,c,s;for(i=n?e.explicitTypes:e.implicitTypes,l=0,t=i.length;l<t;l+=1)if(c=i[l],(c.instanceOf||c.predicate)&&(!c.instanceOf||typeof r=="object"&&r instanceof c.instanceOf)&&(!c.predicate||c.predicate(r))){if(n?c.multi&&c.representName?e.tag=c.representName(r):e.tag=c.tag:e.tag="?",c.represent){if(s=e.styleMap[c.tag]||c.defaultStyle,Ke.call(c.represent)==="[object Function]")o=c.represent(r,s);else if(Qe.call(c.represent,s))o=c.represent[s](r,s);else throw new E("!<"+c.tag+'> tag resolver accepts not "'+s+'" style');e.dump=o}return!0}return!1}function _(e,r,n,o,i,l,t){e.tag=null,e.dump=n,De(e,n,!1)||De(e,n,!0);var c=Ke.call(e.dump),s=o,u;o&&(o=e.flowLevel<0||e.flowLevel>r);var f=c==="[object Object]"||c==="[object Array]",a,h;if(f&&(a=e.duplicates.indexOf(n),h=a!==-1),(e.tag!==null&&e.tag!=="?"||h||e.indent!==2&&r>0)&&(i=!1),h&&e.usedDuplicates[a])e.dump="*ref_"+a;else{if(f&&h&&!e.usedDuplicates[a]&&(e.usedDuplicates[a]=!0),c==="[object Object]")o&&Object.keys(e.dump).length!==0?(Li(e,r,e.dump,i),h&&(e.dump="&ref_"+a+e.dump)):(Oi(e,r,e.dump),h&&(e.dump="&ref_"+a+" "+e.dump));else if(c==="[object Array]")o&&e.dump.length!==0?(e.noArrayIndent&&!t&&r>0?Le(e,r-1,e.dump,i):Le(e,r,e.dump,i),h&&(e.dump="&ref_"+a+e.dump)):(Ri(e,r,e.dump),h&&(e.dump="&ref_"+a+" "+e.dump));else if(c==="[object String]")e.tag!=="?"&&Fi(e,e.dump,r,l,s);else{if(c==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new E("unacceptable kind of an object to dump "+c)}e.tag!==null&&e.tag!=="?"&&(u=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",e.dump=u+" "+e.dump)}return!0}function Di(e,r){var n=[],o=[],i,l;for(ce(e,n,o),i=0,l=o.length;i<l;i+=1)r.duplicates.push(n[o[i]]);r.usedDuplicates=new Array(l)}function ce(e,r,n){var o,i,l;if(e!==null&&typeof e=="object")if(i=r.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(r.push(e),Array.isArray(e))for(i=0,l=e.length;i<l;i+=1)ce(e[i],r,n);else for(o=Object.keys(e),i=0,l=o.length;i<l;i+=1)ce(e[o[i]],r,n)}function ki(e,r){r=r||{};var n=new Ci(r);n.noRefs||Di(e,n);var o=e;return n.replacer&&(o=n.replacer.call({"":o},"",o)),_(n,0,o,!0,!0)?n.dump+`
33
+ `:""}var Ii=ki,Pi={dump:Ii};function pe(e,r){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+r+" instead, which is now safe by default.")}}var or=We.load,Qi=We.loadAll,Vi=Pi.dump;var Xi=pe("safeLoad","load"),Zi=pe("safeLoadAll","loadAll"),Ji=pe("safeDump","dump");var X={maxAttempts:3,baseDelay:1e3,maxDelay:3e4,exponentialBackoff:!0,retryableStatusCodes:[408,429,500,502,503,504]},cr={concurrency:1,entityConcurrency:1,preserveRowOrder:!0},lr={retry:X,parallelProcessing:cr,entityConfig:{},entityDependencies:{}};function sr(e){let r=Ni.join(e,"config.yaml");try{if(!tr.existsSync(r))return console.log("No config.yaml found, using default sequential processing"),lr;let n=tr.readFileSync(r,"utf8"),o=or(n);return ji(o)}catch(n){return console.warn(`Warning: Failed to parse config.yaml: ${n}. Using defaults.`),lr}}function ji(e){return{retry:{...X,...e.retry||{}},parallelProcessing:{...cr,...e.parallelProcessing||{}},entityConfig:e.entityConfig||{},entityDependencies:e.entityDependencies||{}}}function he(e,r){let n=r.entityConfig[e]||{},o={...r.parallelProcessing,...n};return o.preserveRowOrder&&o.concurrency>1&&(console.warn(`Entity '${e}': preserveRowOrder=true forces concurrency=1 (was ${o.concurrency})`),o.concurrency=1),o}function de(e,r){let n=r.entityConfig[e]?.retry||{};return{...r.retry,...n}}var Z=class{constructor(r,n,o,i=!1){this.client=new $i(r,{headers:n||{}}),this.metrics=o,this.verbose=i}async executeMutation(r,n,o){let i=o||X,l,t=Date.now();for(let c=0;c<i.maxAttempts;c++){let s=Date.now();try{let u=await this.client.request(r,n);if(this.metrics){let f=Date.now()-s;this.metrics.recordRequestDuration(f),c>0&&this.metrics.recordRetrySuccess(c)}if(this.verbose){let f=Date.now()-t,a=c>0?` (succeeded on attempt ${c+1})`:"";console.log(`\u2713 GraphQL request completed in ${f}ms${a}:`,u)}return u}catch(u){l=u;let f=Date.now()-s;if(this.metrics&&this.metrics.recordRequestDuration(f),c===i.maxAttempts-1){this.metrics&&c>0&&this.metrics.recordRetryFailure(c);break}if(!this.isRetryableError(u,i))throw this.verbose?console.error(`\u2717 GraphQL request failed with non-retryable error in ${f}ms:`,u):console.error("GraphQL mutation failed (non-retryable):",u),u;let a=this.calculateDelay(c,i);this.verbose&&console.log(`\u23F3 GraphQL request failed (attempt ${c+1}/${i.maxAttempts}), retrying in ${a}ms...`),await this.sleep(a)}}if(this.verbose){let c=Date.now()-t;console.error(`\u2717 GraphQL request failed after ${i.maxAttempts} attempts in ${c}ms:`,l)}else console.error(`GraphQL mutation failed after ${i.maxAttempts} attempts:`,l);throw l}isRetryableError(r,n){if(!r.response)return!0;let o=r.response.status;return n.retryableStatusCodes.includes(o)}calculateDelay(r,n){if(!n.exponentialBackoff)return n.baseDelay;let o=n.baseDelay*Math.pow(2,r),i=Math.min(o,n.maxDelay),l=i*.2*(Math.random()-.5);return Math.max(0,i+l)}sleep(r){return new Promise(n=>setTimeout(n,r))}setHeaders(r){this.client.setHeaders(r)}};import me from"fs";import O from"path";import qi from"fs";import Bi from"csv-parser";async function ur(e){return new Promise((r,n)=>{let o=[];qi.createReadStream(e).pipe(Bi()).on("data",i=>o.push(i)).on("end",()=>r(o)).on("error",i=>n(i))})}var N=class{constructor(){this.metrics={totalEntities:0,totalSuccesses:0,totalFailures:0,entityMetrics:new Map,requestDurations:[],retryAttempts:0,retrySuccesses:0,retryFailures:0,startTime:Date.now()}}startEntityProcessing(r){this.metrics.entityMetrics.has(r)||this.metrics.entityMetrics.set(r,{entityName:r,successCount:0,failureCount:0,startTime:Date.now()})}recordSuccess(r){let n=this.metrics.entityMetrics.get(r);n&&(n.successCount++,this.metrics.totalSuccesses++,this.metrics.totalEntities++)}recordFailure(r){let n=this.metrics.entityMetrics.get(r);n&&(n.failureCount++,this.metrics.totalFailures++,this.metrics.totalEntities++)}finishEntityProcessing(r){let n=this.metrics.entityMetrics.get(r);n&&(n.endTime=Date.now())}finishProcessing(){return this.metrics.endTime=Date.now(),{...this.metrics}}getEntityMetrics(r){return this.metrics.entityMetrics.get(r)}getTotalProcessed(){return this.metrics.totalEntities}getSuccessRate(){return this.metrics.totalEntities===0?0:this.metrics.totalSuccesses/this.metrics.totalEntities*100}recordRequestDuration(r){this.metrics.requestDurations.push(r)}recordRetrySuccess(r){this.metrics.retryAttempts+=r,this.metrics.retrySuccesses++}recordRetryFailure(r){this.metrics.retryAttempts+=r,this.metrics.retryFailures++}getAverageRequestDuration(){return this.metrics.requestDurations.length===0?0:this.metrics.requestDurations.reduce((n,o)=>n+o,0)/this.metrics.requestDurations.length}getDurationMs(){return(this.metrics.endTime||Date.now())-this.metrics.startTime}generateSummary(){let r=this.getDurationMs(),n=this.getSuccessRate(),o=this.getAverageRequestDuration(),i=`
34
+ \u{1F4CA} Processing Summary:
35
+ `;if(i+=` Total Processed: ${this.metrics.totalEntities}
36
+ `,i+=` \u2713 Successes: ${this.metrics.totalSuccesses}
37
+ `,i+=` \u2717 Failures: ${this.metrics.totalFailures}
38
+ `,i+=` Success Rate: ${n.toFixed(1)}%
39
+ `,i+=` Duration: ${(r/1e3).toFixed(2)}s
40
+ `,this.metrics.requestDurations.length>0&&(i+=` Avg Request Time: ${o.toFixed(0)}ms
41
+ `),this.metrics.retryAttempts>0&&(i+=` Retry Attempts: ${this.metrics.retryAttempts}
42
+ `,i+=` Retry Successes: ${this.metrics.retrySuccesses}
43
+ `,i+=` Retry Failures: ${this.metrics.retryFailures}
44
+ `),this.metrics.entityMetrics.size>1){i+=`
45
+ \u{1F4CB} Per-Entity Breakdown:
46
+ `;for(let[l,t]of this.metrics.entityMetrics){let c=t.successCount+t.failureCount,s=c>0?t.successCount/c*100:0,u=t.endTime?t.endTime-t.startTime:0;i+=` ${l}: ${c} total (${t.successCount} \u2713, ${t.failureCount} \u2717) - ${s.toFixed(1)}% success - ${(u/1e3).toFixed(2)}s
47
+ `}}return i}};var J=class{constructor(r,n=process.cwd(),o,i=!1){this.client=r,this.basePath=n,this.metrics=o||new N,this.verbose=i}discoverMappings(r){let n=O.resolve(this.basePath,r,"mappings");try{let i=me.readdirSync(n).filter(l=>l.endsWith(".json")).sort();return console.log(`Discovered ${i.length} mapping files: ${i.join(", ")}`),i.map(l=>O.join(r,"mappings",l))}catch(o){return console.error(`Error reading mappings directory ${n}:`,o),[]}}async processEntity(r,n,o){let i=O.basename(r,".json");console.log(`Processing entity: ${r}`),this.metrics.startEntityProcessing(i);let l=O.resolve(this.basePath,r),t=JSON.parse(me.readFileSync(l,"utf8")),c=O.dirname(O.dirname(l)),s=O.resolve(c,t.csvFile),u=await ur(s),f=O.resolve(c,t.graphqlFile),a=me.readFileSync(f,"utf8");n&&n.concurrency>1?await this.processRowsConcurrently(u,a,t.mapping,i,n,o):await this.processRowsSequentially(u,a,t.mapping,i,o),this.metrics.finishEntityProcessing(i)}async processRowsSequentially(r,n,o,i,l){let t=r.length;for(let c=0;c<r.length;c++){let s=r[c],u=this.mapCsvRowToVariables(s,o);try{if(await this.client.executeMutation(n,u,l),this.metrics.recordSuccess(i),!this.verbose&&((c+1)%Math.max(1,Math.floor(t/10))===0||c===t-1)){let f=((c+1)/t*100).toFixed(1);console.log(`\u{1F4CA} Progress: ${c+1}/${t} (${f}%) \u2713`)}}catch(f){this.metrics.recordFailure(i),this.verbose||console.error(`\u2717 Failed to create entity for row ${c+1}:`,s,f)}}}async processRowsConcurrently(r,n,o,i,l,t){let c=l.concurrency;console.log(`Processing ${r.length} rows with concurrency: ${c}`);let s=this.chunkArray(r,c),u=0,f=r.length;for(let a=0;a<s.length;a++){let h=s[a],d=h.map(async v=>{let g=this.mapCsvRowToVariables(v,o);try{let j=await this.client.executeMutation(n,g,t);return this.metrics.recordSuccess(i),{success:!0,result:j,row:v}}catch(j){return this.metrics.recordFailure(i),{success:!1,error:j,row:v}}}),m=await Promise.allSettled(d);u+=h.length;let y=0,x=0;if(m.forEach(v=>{if(v.status==="fulfilled"){let{success:g,error:j,row:fr}=v.value;g?y++:(x++,this.verbose||console.error("\u2717 Failed to create entity for row:",fr,j))}else x++,this.verbose||console.error("\u2717 Promise rejected:",v.reason)}),!this.verbose){let v=(u/f*100).toFixed(1);console.log(`\u{1F4CA} Progress: ${u}/${f} (${v}%) - Chunk ${a+1}: ${y} \u2713, ${x} \u2717`)}}}chunkArray(r,n){let o=[];for(let i=0;i<r.length;i+=n)o.push(r.slice(i,i+n));return o}mapCsvRowToVariables(r,n){let o={};for(let[i,l]of Object.entries(n))r[l]!==void 0&&(o[i]=r[l]);return o}getMetrics(){return this.metrics}};var z=class{constructor(r,n={}){this.entities=r,this.dependencies=n}resolveExecutionOrder(){let r=[],n=new Set,o=new Set,i=0;for(;n.size<this.entities.length;){let l=[];for(let t of this.entities){if(n.has(t)||o.has(t))continue;(this.dependencies[t]||[]).every(u=>n.has(u))&&(l.push(t),o.add(t))}if(l.length===0){let t=this.entities.filter(c=>!n.has(c));throw new Error(`Circular dependency detected or missing dependencies for entities: ${t.join(", ")}`)}r.push({entities:l,wave:i++}),l.forEach(t=>{n.add(t),o.delete(t)})}return r}validateDependencies(){let r=[],n=new Set(this.entities);for(let[o,i]of Object.entries(this.dependencies)){if(!n.has(o)){r.push(`Entity '${o}' has dependencies but is not in the entity list`);continue}for(let l of i)n.has(l)||r.push(`Entity '${o}' depends on '${l}' which does not exist`)}return r}getDependents(r){return Object.entries(this.dependencies).filter(([n,o])=>o.includes(r)).map(([n,o])=>n)}getDependencies(r){return this.dependencies[r]||[]}};import{basename as ge}from"path";function Ui(e,r){if(r<=0)return[e];let n=[];for(let o=0;o<e.length;o+=r)n.push(e.slice(o,o+r));return n}var ye=new Hi;ye.name("gql-ingest").description("A CLI tool for ingesting data from CSV files into a GraphQL API").version(ar().version);ye.requiredOption("-e, --endpoint <url>","GraphQL endpoint URL").requiredOption("-c, --config <path>","Path to configuration directory (containing data/, graphql/, mappings/ subdirectories)").option("-h, --headers <headers>","JSON string of headers to include in requests").option("-v, --verbose","Show detailed request results and responses").action(async e=>{try{console.log("Starting seed data generation...");let r=e.headers?JSON.parse(e.headers):{},n=new N,o=new Z(e.endpoint,r,n,e.verbose),i=sr(e.config),l=new J(o,process.cwd(),n,e.verbose),t=l.discoverMappings(e.config);if(t.length===0){console.warn(`No mapping files found in ${e.config}/mappings`);return}let c=t.map(f=>ge(f,".json")),s=new z(c,i.entityDependencies),u=s.validateDependencies();u.length>0&&(console.error("Dependency validation errors:"),u.forEach(f=>console.error(` - ${f}`)),process.exit(1)),i.parallelProcessing.entityConcurrency===1?await Gi(t,l,i):await Wi(t,s,l,i),n.finishProcessing(),console.log(n.generateSummary())}catch(r){console.error("Error:",r),process.exit(1)}});async function Gi(e,r,n){for(let o of e)try{let i=ge(o,".json"),l=he(i,n),t=de(i,n);await r.processEntity(o,l,t)}catch(i){console.warn(`Warning: Could not process ${o}:`,i)}}async function Wi(e,r,n,o){let i=r.resolveExecutionOrder(),l=new Map(e.map(t=>[ge(t,".json"),t]));console.log(`Processing ${i.length} dependency waves...`);for(let t of i){console.log(`Wave ${t.wave+1}: Processing entities [${t.entities.join(", ")}]`);let c=o.parallelProcessing.entityConcurrency,s=Ui(t.entities,c);for(let u of s){let f=u.map(async a=>{let h=l.get(a);if(h)try{let d=he(a,o),m=de(a,o);await n.processEntity(h,d,m)}catch(d){console.warn(`Warning: Could not process ${h}:`,d)}});await Promise.allSettled(f)}}}ye.parse();
45
48
  /*! Bundled license information:
46
49
 
47
50
  js-yaml/dist/js-yaml.mjs:
package/dist/config.d.ts CHANGED
@@ -1,22 +1,32 @@
1
1
  export interface ParallelProcessingConfig {
2
2
  concurrency: number;
3
- enableEntityParallelization: boolean;
3
+ entityConcurrency: number;
4
4
  preserveRowOrder: boolean;
5
- preserveEntityOrder: boolean;
5
+ }
6
+ export interface RetryConfig {
7
+ maxAttempts: number;
8
+ baseDelay: number;
9
+ maxDelay: number;
10
+ exponentialBackoff: boolean;
11
+ retryableStatusCodes: number[];
6
12
  }
7
13
  export interface EntityConfig {
8
14
  concurrency?: number;
9
15
  preserveRowOrder?: boolean;
16
+ retry?: Partial<RetryConfig>;
10
17
  }
11
18
  export interface ProcessingConfig {
19
+ retry: RetryConfig;
12
20
  parallelProcessing: ParallelProcessingConfig;
13
21
  entityConfig: Record<string, EntityConfig>;
14
22
  entityDependencies: Record<string, string[]>;
15
23
  }
16
24
  export interface FullConfig extends ProcessingConfig {
17
25
  }
26
+ export declare const DEFAULT_RETRY_CONFIG: RetryConfig;
18
27
  export declare const DEFAULT_PARALLEL_CONFIG: ParallelProcessingConfig;
19
28
  export declare const DEFAULT_CONFIG: ProcessingConfig;
20
29
  export declare function loadConfig(configDir: string): ProcessingConfig;
21
30
  export declare function getEntityConfig(entityName: string, globalConfig: ProcessingConfig): ParallelProcessingConfig;
31
+ export declare function getRetryConfig(entityName: string, globalConfig: ProcessingConfig): RetryConfig;
22
32
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,2BAA2B,EAAE,OAAO,CAAC;IACrC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B,kBAAkB,EAAE,wBAAwB,CAAC;IAC7C,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAC3C,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CAC9C;AAED,MAAM,WAAW,UAAW,SAAQ,gBAAgB;CAEnD;AAED,eAAO,MAAM,uBAAuB,EAAE,wBAKrC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,gBAI5B,CAAC;AAEF,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAmB9D;AAaD,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,gBAAgB,GAC7B,wBAAwB,CAiB1B"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,oBAAoB,EAAE,MAAM,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,WAAW,CAAC;IACnB,kBAAkB,EAAE,wBAAwB,CAAC;IAC7C,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAC3C,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CAC9C;AAED,MAAM,WAAW,UAAW,SAAQ,gBAAgB;CAEnD;AAED,eAAO,MAAM,oBAAoB,EAAE,WAMlC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,wBAIrC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,gBAK5B,CAAC;AAEF,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAmB9D;AAiBD,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,gBAAgB,GAC7B,wBAAwB,CAiB1B;AAED,wBAAgB,cAAc,CAC5B,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,gBAAgB,GAC7B,WAAW,CAOb"}
@@ -1,10 +1,14 @@
1
- import { MetricsCollector } from './metrics';
1
+ import { MetricsCollector } from "./metrics";
2
+ import { RetryConfig } from "./config";
2
3
  export declare class GraphQLClientWrapper {
3
4
  private client;
4
5
  private metrics?;
5
6
  private verbose;
6
7
  constructor(endpoint: string, headers?: Record<string, string>, metrics?: MetricsCollector, verbose?: boolean);
7
- executeMutation(mutation: string, variables: Record<string, any>): Promise<any>;
8
+ executeMutation(mutation: string, variables: Record<string, any>, retryConfig?: RetryConfig): Promise<any>;
9
+ private isRetryableError;
10
+ private calculateDelay;
11
+ private sleep;
8
12
  setHeaders(headers: Record<string, string>): void;
9
13
  }
10
14
  //# sourceMappingURL=graphql-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../src/graphql-client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,OAAO,CAAC,CAAmB;IACnC,OAAO,CAAC,OAAO,CAAU;gBAEb,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,EAAE,OAAO,GAAE,OAAe;IAQ9G,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IA+BrF,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CAG3C"}
1
+ {"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../src/graphql-client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAwB,WAAW,EAAE,MAAM,UAAU,CAAC;AAE7D,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,OAAO,CAAC,CAAmB;IACnC,OAAO,CAAC,OAAO,CAAU;gBAGvB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAChC,OAAO,CAAC,EAAE,gBAAgB,EAC1B,OAAO,GAAE,OAAe;IASpB,eAAe,CACnB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC9B,WAAW,CAAC,EAAE,WAAW,GACxB,OAAO,CAAC,GAAG,CAAC;IA6Ff,OAAO,CAAC,gBAAgB;IAWxB,OAAO,CAAC,cAAc;IAatB,OAAO,CAAC,KAAK;IAIb,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CAG3C"}
package/dist/mapper.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { GraphQLClientWrapper } from "./graphql-client";
2
2
  import { MetricsCollector } from "./metrics";
3
- import { ParallelProcessingConfig } from "./config";
3
+ import { ParallelProcessingConfig, RetryConfig } from "./config";
4
4
  export interface MappingConfig {
5
5
  csvFile: string;
6
6
  graphqlFile: string;
@@ -13,7 +13,7 @@ export declare class DataMapper {
13
13
  private verbose;
14
14
  constructor(client: GraphQLClientWrapper, basePath?: string, metrics?: MetricsCollector, verbose?: boolean);
15
15
  discoverMappings(configDir: string): string[];
16
- processEntity(configPath: string, parallelConfig?: ParallelProcessingConfig): Promise<void>;
16
+ processEntity(configPath: string, parallelConfig?: ParallelProcessingConfig, retryConfig?: RetryConfig): Promise<void>;
17
17
  private processRowsSequentially;
18
18
  private processRowsConcurrently;
19
19
  private chunkArray;
@@ -1 +1 @@
1
- {"version":3,"file":"mapper.d.ts","sourceRoot":"","sources":["../src/mapper.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAEpD,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAED,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,OAAO,CAAmB;IAClC,OAAO,CAAC,OAAO,CAAU;gBAGvB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,GAAE,MAAsB,EAChC,OAAO,CAAC,EAAE,gBAAgB,EAC1B,OAAO,GAAE,OAAe;IAQ1B,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE;IAiBvC,aAAa,CACjB,UAAU,EAAE,MAAM,EAClB,cAAc,CAAC,EAAE,wBAAwB,GACxC,OAAO,CAAC,IAAI,CAAC;YA4CF,uBAAuB;YA8BvB,uBAAuB;IAkErC,OAAO,CAAC,UAAU;IAQlB,OAAO,CAAC,oBAAoB;IAe5B,UAAU,IAAI,gBAAgB;CAG/B"}
1
+ {"version":3,"file":"mapper.d.ts","sourceRoot":"","sources":["../src/mapper.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEjE,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAED,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,OAAO,CAAmB;IAClC,OAAO,CAAC,OAAO,CAAU;gBAGvB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,GAAE,MAAsB,EAChC,OAAO,CAAC,EAAE,gBAAgB,EAC1B,OAAO,GAAE,OAAe;IAQ1B,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE;IAiBvC,aAAa,CACjB,UAAU,EAAE,MAAM,EAClB,cAAc,CAAC,EAAE,wBAAwB,EACzC,WAAW,CAAC,EAAE,WAAW,GACxB,OAAO,CAAC,IAAI,CAAC;YA8CF,uBAAuB;YA+BvB,uBAAuB;IAmErC,OAAO,CAAC,UAAU;IAQlB,OAAO,CAAC,oBAAoB;IAe5B,UAAU,IAAI,gBAAgB;CAG/B"}
package/dist/metrics.d.ts CHANGED
@@ -11,6 +11,9 @@ export interface ProcessingMetrics {
11
11
  totalFailures: number;
12
12
  entityMetrics: Map<string, EntityMetrics>;
13
13
  requestDurations: number[];
14
+ retryAttempts: number;
15
+ retrySuccesses: number;
16
+ retryFailures: number;
14
17
  startTime: number;
15
18
  endTime?: number;
16
19
  }
@@ -26,6 +29,8 @@ export declare class MetricsCollector {
26
29
  getTotalProcessed(): number;
27
30
  getSuccessRate(): number;
28
31
  recordRequestDuration(duration: number): void;
32
+ recordRetrySuccess(attempts: number): void;
33
+ recordRetryFailure(attempts: number): void;
29
34
  getAverageRequestDuration(): number;
30
35
  getDurationMs(): number;
31
36
  generateSummary(): string;
@@ -1 +1 @@
1
- {"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../src/metrics.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAC1C,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,OAAO,CAAoB;;IAanC,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAW/C,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IASvC,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IASvC,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAOhD,gBAAgB,IAAI,iBAAiB;IAKrC,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;IAI/D,iBAAiB,IAAI,MAAM;IAI3B,cAAc,IAAI,MAAM;IAKxB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAI7C,yBAAyB,IAAI,MAAM;IAMnC,aAAa,IAAI,MAAM;IAKvB,eAAe,IAAI,MAAM;CA6B1B"}
1
+ {"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../src/metrics.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAC1C,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,OAAO,CAAoB;;IAgBnC,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAW/C,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IASvC,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IASvC,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAOhD,gBAAgB,IAAI,iBAAiB;IAKrC,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;IAI/D,iBAAiB,IAAI,MAAM;IAI3B,cAAc,IAAI,MAAM;IAKxB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAI7C,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAK1C,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAK1C,yBAAyB,IAAI,MAAM;IAMnC,aAAa,IAAI,MAAM;IAKvB,eAAe,IAAI,MAAM;CAmC1B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jackchuka/gql-ingest",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "A CLI tool for ingesting data from CSV files into a GraphQL API",
5
5
  "type": "module",
6
6
  "main": "dist/cli.js",