text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE eagle SYSTEM "eagle.dtd">
<eagle version="6.5.0">
<drawing>
<settings>
<setting alwaysvectorfont="no"/>
<setting verticaltext="up"/>
</settings>
<grid distance="0.000003125" unitdist="mm" unit="mm" style="dots" multiple="1" display="yes" altdistance="0.005" altunitdist="inch" altunit="inch"/>
<layers>
<layer number="1" name="Top" color="4" fill="1" visible="yes" active="yes"/>
<layer number="16" name="Bottom" color="1" fill="1" visible="yes" active="yes"/>
<layer number="17" name="Pads" color="2" fill="1" visible="yes" active="yes"/>
<layer number="18" name="Vias" color="2" fill="1" visible="yes" active="yes"/>
<layer number="19" name="Unrouted" color="6" fill="1" visible="yes" active="yes"/>
<layer number="20" name="Dimension" color="15" fill="1" visible="yes" active="yes"/>
<layer number="21" name="tPlace" color="16" fill="1" visible="yes" active="yes"/>
<layer number="22" name="bPlace" color="14" fill="1" visible="yes" active="yes"/>
<layer number="23" name="tOrigins" color="15" fill="1" visible="yes" active="yes"/>
<layer number="24" name="bOrigins" color="15" fill="1" visible="yes" active="yes"/>
<layer number="25" name="tNames" color="7" fill="1" visible="yes" active="yes"/>
<layer number="26" name="bNames" color="7" fill="1" visible="yes" active="yes"/>
<layer number="27" name="tValues" color="7" fill="1" visible="yes" active="yes"/>
<layer number="28" name="bValues" color="7" fill="1" visible="yes" active="yes"/>
<layer number="29" name="tStop" color="7" fill="3" visible="yes" active="yes"/>
<layer number="30" name="bStop" color="7" fill="6" visible="yes" active="yes"/>
<layer number="31" name="tCream" color="7" fill="4" visible="yes" active="yes"/>
<layer number="32" name="bCream" color="7" fill="5" visible="yes" active="yes"/>
<layer number="33" name="tFinish" color="6" fill="3" visible="yes" active="yes"/>
<layer number="34" name="bFinish" color="6" fill="6" visible="yes" active="yes"/>
<layer number="35" name="tGlue" color="7" fill="4" visible="yes" active="yes"/>
<layer number="36" name="bGlue" color="7" fill="5" visible="yes" active="yes"/>
<layer number="37" name="tTest" color="7" fill="1" visible="yes" active="yes"/>
<layer number="38" name="bTest" color="7" fill="1" visible="yes" active="yes"/>
<layer number="39" name="tKeepout" color="4" fill="11" visible="yes" active="yes"/>
<layer number="40" name="bKeepout" color="1" fill="11" visible="yes" active="yes"/>
<layer number="41" name="tRestrict" color="4" fill="10" visible="yes" active="yes"/>
<layer number="42" name="bRestrict" color="1" fill="10" visible="yes" active="yes"/>
<layer number="43" name="vRestrict" color="2" fill="10" visible="yes" active="yes"/>
<layer number="44" name="Drills" color="7" fill="1" visible="yes" active="yes"/>
<layer number="45" name="Holes" color="7" fill="1" visible="yes" active="yes"/>
<layer number="46" name="Milling" color="3" fill="1" visible="yes" active="yes"/>
<layer number="47" name="Measures" color="7" fill="1" visible="yes" active="yes"/>
<layer number="48" name="Document" color="7" fill="1" visible="yes" active="yes"/>
<layer number="49" name="Reference" color="7" fill="1" visible="yes" active="yes"/>
<layer number="51" name="tDocu" color="6" fill="1" visible="yes" active="yes"/>
<layer number="52" name="bDocu" color="7" fill="1" visible="yes" active="yes"/>
<layer number="91" name="Nets" color="2" fill="1" visible="no" active="no"/>
<layer number="92" name="Busses" color="1" fill="1" visible="no" active="no"/>
<layer number="93" name="Pins" color="2" fill="1" visible="no" active="no"/>
<layer number="94" name="Symbols" color="4" fill="1" visible="no" active="no"/>
<layer number="95" name="Names" color="7" fill="1" visible="no" active="no"/>
<layer number="96" name="Values" color="7" fill="1" visible="no" active="no"/>
<layer number="97" name="Info" color="7" fill="1" visible="no" active="no"/>
<layer number="98" name="Guide" color="6" fill="1" visible="no" active="no"/>
</layers>
<board>
<plain>
<wire x1="1" y1="1" x2="39" y2="1" width="0" layer="20"/>
<wire x1="39" y1="1" x2="39" y2="29" width="0" layer="20"/>
<wire x1="39" y1="29" x2="1" y2="29" width="0" layer="20"/>
<wire x1="1" y1="29" x2="1" y2="1" width="0" layer="20"/>
<text x="7" y="9" size="1.778" layer="26" font="vector" ratio="15" rot="MR0">+VE</text>
<text x="7" y="19" size="1.778" layer="26" font="vector" ratio="15" rot="MR0">GND</text>
<text x="29.6186125" y="23.687353125" size="1.778" layer="26" font="vector" ratio="15" rot="MR0">+</text>
<text x="27.0786125" y="23.687353125" size="1.778" layer="26" font="vector" ratio="15" rot="MR0">-</text>
<text x="24.5386125" y="23.687353125" size="1.778" layer="26" font="vector" ratio="15" rot="MR0">5</text>
<text x="21.9986125" y="23.687353125" size="1.778" layer="26" font="vector" ratio="15" rot="MR0">4</text>
<text x="19.4586125" y="23.687353125" size="1.778" layer="26" font="vector" ratio="15" rot="MR0">3</text>
<text x="16.9186125" y="23.687353125" size="1.778" layer="26" font="vector" ratio="15" rot="MR0">2</text>
<text x="14.3786125" y="23.687353125" size="1.778" layer="26" font="vector" ratio="15" rot="MR0">1</text>
<text x="11.8386125" y="23.687353125" size="1.778" layer="26" font="vector" ratio="15" rot="MR0">0</text>
<text x="11.14380625" y="14.34846875" size="1.6" layer="25" font="vector" ratio="15">BaseBot Power</text>
<text x="23.52060625" y="1.60485625" size="1.778" layer="26" font="vector" ratio="15" rot="MR0">12 Jun '14</text>
<text x="24.007515625" y="12.038865625" size="1.778" layer="25" font="vector" ratio="15">v1.1</text>
</plain>
<libraries>
<library name="con-lstb">
<description>Pin Headers

Naming:

MA = male

# contacts - # rows

W = angled

<author>Created by librarian@cadsoft.de</author></description>
<packages>
<package name="MA03-2">
<description>PIN HEADER</description>
<wire x1="-3.175" y1="2.54" x2="-1.905" y2="2.54" width="0.1524" layer="21"/>
<wire x1="-1.905" y1="2.54" x2="-1.27" y2="1.905" width="0.1524" layer="21"/>
<wire x1="-1.27" y1="1.905" x2="-0.635" y2="2.54" width="0.1524" layer="21"/>
<wire x1="-0.635" y1="2.54" x2="0.635" y2="2.54" width="0.1524" layer="21"/>
<wire x1="0.635" y1="2.54" x2="1.27" y2="1.905" width="0.1524" layer="21"/>
<wire x1="-3.175" y1="2.54" x2="-3.81" y2="1.905" width="0.1524" layer="21"/>
<wire x1="1.27" y1="1.905" x2="1.905" y2="2.54" width="0.1524" layer="21"/>
<wire x1="1.905" y1="2.54" x2="3.175" y2="2.54" width="0.1524" layer="21"/>
<wire x1="3.175" y1="2.54" x2="3.81" y2="1.905" width="0.1524" layer="21"/>
<wire x1="3.81" y1="1.905" x2="3.81" y2="-1.905" width="0.1524" layer="21"/>
<wire x1="-1.27" y1="-1.905" x2="-1.905" y2="-2.54" width="0.1524" layer="21"/>
<wire x1="1.27" y1="-1.905" x2="0.635" y2="-2.54" width="0.1524" layer="21"/>
<wire x1="0.635" y1="-2.54" x2="-0.635" y2="-2.54" width="0.1524" layer="21"/>
<wire x1="-0.635" y1="-2.54" x2="-1.27" y2="-1.905" width="0.1524" layer="21"/>
<wire x1="-3.81" y1="1.905" x2="-3.81" y2="-1.905" width="0.1524" layer="21"/>
<wire x1="-3.81" y1="-1.905" x2="-3.175" y2="-2.54" width="0.1524" layer="21"/>
<wire x1="-1.905" y1="-2.54" x2="-3.175" y2="-2.54" width="0.1524" layer="21"/>
<wire x1="3.81" y1="-1.905" x2="3.175" y2="-2.54" width="0.1524" layer="21"/>
<wire x1="3.175" y1="-2.54" x2="1.905" y2="-2.54" width="0.1524" layer="21"/>
<wire x1="1.905" y1="-2.54" x2="1.27" y2="-1.905" width="0.1524" layer="21"/>
<pad name="1" x="-2.54" y="-1.27" drill="1.016"/>
<pad name="3" x="0" y="-1.27" drill="1.016" shape="octagon"/>
<pad name="5" x="2.54" y="-1.27" drill="1.016" shape="octagon"/>
<pad name="2" x="-2.54" y="1.27" drill="1.016" shape="octagon"/>
<pad name="4" x="0" y="1.27" drill="1.016" shape="octagon"/>
<pad name="6" x="2.54" y="1.27" drill="1.016" shape="octagon"/>
<text x="-3.175" y="-4.191" size="1.27" layer="21" ratio="10">1</text>
<text x="-3.81" y="2.921" size="1.27" layer="25" ratio="10">>NAME</text>
<text x="4.064" y="0.635" size="1.27" layer="21" ratio="10">6</text>
<text x="-1.27" y="-4.191" size="1.27" layer="27" ratio="10">>VALUE</text>
<rectangle x1="-0.254" y1="-1.524" x2="0.254" y2="-1.016" layer="51"/>
<rectangle x1="-2.794" y1="-1.524" x2="-2.286" y2="-1.016" layer="51"/>
<rectangle x1="2.286" y1="-1.524" x2="2.794" y2="-1.016" layer="51"/>
<rectangle x1="-2.794" y1="1.016" x2="-2.286" y2="1.524" layer="51"/>
<rectangle x1="-0.254" y1="1.016" x2="0.254" y2="1.524" layer="51"/>
<rectangle x1="2.286" y1="1.016" x2="2.794" y2="1.524" layer="51"/>
</package>
</packages>
</library>
<library name="con-jack">
<description>Jacks

Power Connectors

Phone Connectors

Cinch Connectors

<author>Created by librarian@cadsoft.de</author></description>
<packages>
<package name="DCJ0303">
<description>DC POWER JACK Pad shape changed to LONG 2007.07.26

Source: DCJ0303.pdf</description>
<wire x1="1.65" y1="2.6" x2="-1.65" y2="2.6" width="0" layer="46"/>
<wire x1="-1.65" y1="2.6" x2="-1.65" y2="3.6" width="0" layer="46"/>
<wire x1="-1.65" y1="3.6" x2="1.65" y2="3.6" width="0" layer="46"/>
<wire x1="1.65" y1="3.6" x2="1.65" y2="2.6" width="0" layer="46"/>
<wire x1="5.3" y1="1.4" x2="4.3" y2="1.4" width="0" layer="46"/>
<wire x1="4.3" y1="1.4" x2="4.3" y2="-1.4" width="0" layer="46"/>
<wire x1="4.3" y1="-1.4" x2="5.3" y2="-1.4" width="0" layer="46"/>
<wire x1="5.3" y1="-1.4" x2="5.3" y2="1.4" width="0" layer="46"/>
<wire x1="1.4" y1="-3.5" x2="-1.4" y2="-3.5" width="0" layer="46"/>
<wire x1="-1.4" y1="-3.5" x2="-1.4" y2="-2.5" width="0" layer="46"/>
<wire x1="-1.4" y1="-2.5" x2="1.4" y2="-2.5" width="0" layer="46"/>
<wire x1="1.4" y1="-2.5" x2="1.4" y2="-3.5" width="0" layer="46"/>
<wire x1="-4.3" y1="-10.4" x2="4.3" y2="-10.4" width="0.2032" layer="21"/>
<wire x1="4.3" y1="-10.4" x2="4.3" y2="3.9" width="0.2032" layer="51"/>
<wire x1="4.3" y1="3.9" x2="-4.3" y2="3.9" width="0.2032" layer="51"/>
<wire x1="-4.3" y1="3.9" x2="-4.3" y2="-10.4" width="0.2032" layer="21"/>
<wire x1="-2.7" y1="3.9" x2="-4.3" y2="3.9" width="0.2032" layer="21"/>
<wire x1="4.3" y1="3.9" x2="2.7" y2="3.9" width="0.2032" layer="21"/>
<wire x1="-3" y1="-10.275" x2="-3" y2="-3" width="0.2032" layer="51" style="shortdash"/>
<wire x1="3" y1="-10.3" x2="3" y2="-3" width="0.2032" layer="51" style="shortdash"/>
<wire x1="3" y1="-3" x2="-3" y2="-3" width="0.2032" layer="51" style="shortdash"/>
<wire x1="-0.9" y1="-9" x2="-0.9" y2="-4.5" width="0.2032" layer="51" style="shortdash"/>
<wire x1="0.9" y1="-9" x2="0.9" y2="-4.5" width="0.2032" layer="51" style="shortdash"/>
<wire x1="-0.9" y1="-9" x2="0.9" y2="-9" width="0.2032" layer="51" curve="166.57811"/>
<wire x1="4.3" y1="-10.4" x2="4.3" y2="-2.45" width="0.2032" layer="21"/>
<wire x1="4.3" y1="2.3" x2="4.3" y2="3.9" width="0.2032" layer="21"/>
<pad name="1" x="0" y="3.1" drill="1" diameter="2" shape="long" rot="R180"/>
<pad name="3" x="0" y="-3" drill="1" diameter="2" shape="long" rot="R180"/>
<pad name="2" x="4.8" y="0" drill="1" diameter="2" shape="long" rot="R90"/>
<text x="6.35" y="-10.16" size="1.27" layer="25" rot="R90">>NAME</text>
<text x="-5.08" y="-10.16" size="1.27" layer="27" rot="R90">>VALUE</text>
</package>
</packages>
</library>
<library name="con-wago-500">
<description>Wago Screw Clamps

Grid 5.00 mm

<author>Created by librarian@cadsoft.de</author></description>
<packages>
<package name="W237-102">
<description>WAGO SCREW CLAMP</description>
<wire x1="-3.491" y1="-2.286" x2="-1.484" y2="-0.279" width="0.254" layer="51"/>
<wire x1="1.488" y1="-2.261" x2="3.469" y2="-0.254" width="0.254" layer="51"/>
<wire x1="-4.989" y1="-5.461" x2="4.993" y2="-5.461" width="0.1524" layer="21"/>
<wire x1="4.993" y1="3.734" x2="4.993" y2="3.531" width="0.1524" layer="21"/>
<wire x1="4.993" y1="3.734" x2="-4.989" y2="3.734" width="0.1524" layer="21"/>
<wire x1="-4.989" y1="-5.461" x2="-4.989" y2="-3.073" width="0.1524" layer="21"/>
<wire x1="-4.989" y1="-3.073" x2="-3.389" y2="-3.073" width="0.1524" layer="21"/>
<wire x1="-3.389" y1="-3.073" x2="-1.611" y2="-3.073" width="0.1524" layer="51"/>
<wire x1="-1.611" y1="-3.073" x2="1.615" y2="-3.073" width="0.1524" layer="21"/>
<wire x1="3.393" y1="-3.073" x2="4.993" y2="-3.073" width="0.1524" layer="21"/>
<wire x1="-4.989" y1="-3.073" x2="-4.989" y2="3.531" width="0.1524" layer="21"/>
<wire x1="4.993" y1="-3.073" x2="4.993" y2="-5.461" width="0.1524" layer="21"/>
<wire x1="-4.989" y1="3.531" x2="4.993" y2="3.531" width="0.1524" layer="21"/>
<wire x1="-4.989" y1="3.531" x2="-4.989" y2="3.734" width="0.1524" layer="21"/>
<wire x1="4.993" y1="3.531" x2="4.993" y2="-3.073" width="0.1524" layer="21"/>
<wire x1="1.615" y1="-3.073" x2="3.393" y2="-3.073" width="0.1524" layer="51"/>
<circle x="-2.5" y="-1.27" radius="1.4986" width="0.1524" layer="51"/>
<circle x="-2.5" y="2.2098" radius="0.508" width="0.1524" layer="21"/>
<circle x="2.5038" y="-1.27" radius="1.4986" width="0.1524" layer="51"/>
<circle x="2.5038" y="2.2098" radius="0.508" width="0.1524" layer="21"/>
<pad name="1" x="-2.5" y="-1.27" drill="1.1938" shape="long" rot="R90"/>
<pad name="2" x="2.5" y="-1.27" drill="1.1938" shape="long" rot="R90"/>
<text x="-5.04" y="-7.62" size="1.27" layer="27" ratio="10">>VALUE</text>
<text x="-3.8462" y="-5.0038" size="1.27" layer="25" ratio="10">>NAME</text>
<text x="-4.532" y="0.635" size="1.27" layer="21" ratio="10">1</text>
<text x="0.421" y="0.635" size="1.27" layer="21" ratio="10">2</text>
</package>
</packages>
</library>
<library name="holes">
<description>Mounting Holes and Pads

<author>Created by librarian@cadsoft.de</author></description>
<packages>
<package name="3,0">
<description>MOUNTING HOLE 3.0 mm with drill center</description>
<wire x1="-2.159" y1="0" x2="0" y2="-2.159" width="2.4892" layer="51" curve="90" cap="flat"/>
<wire x1="0" y1="2.159" x2="2.159" y2="0" width="2.4892" layer="51" curve="-90" cap="flat"/>
<circle x="0" y="0" radius="3.429" width="0.1524" layer="21"/>
<circle x="0" y="0" radius="0.762" width="0.4572" layer="51"/>
<circle x="0" y="0" radius="3.048" width="2.032" layer="39"/>
<circle x="0" y="0" radius="3.048" width="2.032" layer="43"/>
<circle x="0" y="0" radius="3.048" width="2.032" layer="40"/>
<circle x="0" y="0" radius="3.048" width="2.032" layer="41"/>
<circle x="0" y="0" radius="3.048" width="2.032" layer="42"/>
<circle x="0" y="0" radius="1.6" width="0.2032" layer="21"/>
<text x="-1.27" y="-3.81" size="1.27" layer="48">3,0</text>
<hole x="0" y="0" drill="3"/>
</package>
</packages>
</library>
<library name="con-lsta">
<description>Female Headers etc.

Naming:

FE = female

# contacts - # rows

W = angled

<author>Created by librarian@cadsoft.de</author></description>
<packages>
<package name="FE08">
<description>FEMALE HEADER</description>
<wire x1="-10.16" y1="1.27" x2="-10.16" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-10.16" y1="-1.27" x2="-7.874" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-7.874" y1="-1.27" x2="-7.62" y2="-1.016" width="0.1524" layer="21"/>
<wire x1="-7.62" y1="-1.016" x2="-7.366" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-7.366" y1="-1.27" x2="-5.334" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-5.334" y1="-1.27" x2="-5.08" y2="-1.016" width="0.1524" layer="21"/>
<wire x1="-5.08" y1="-1.016" x2="-4.826" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-4.826" y1="-1.27" x2="-2.794" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-2.794" y1="-1.27" x2="-2.54" y2="-1.016" width="0.1524" layer="21"/>
<wire x1="-2.54" y1="-1.016" x2="-2.286" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-2.286" y1="-1.27" x2="-0.254" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-0.254" y1="-1.27" x2="0" y2="-1.016" width="0.1524" layer="21"/>
<wire x1="0" y1="-1.016" x2="0.254" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="0.254" y1="1.27" x2="0" y2="1.016" width="0.1524" layer="21"/>
<wire x1="0" y1="1.016" x2="-0.254" y2="1.27" width="0.1524" layer="21"/>
<wire x1="-0.254" y1="1.27" x2="-2.286" y2="1.27" width="0.1524" layer="21"/>
<wire x1="-2.286" y1="1.27" x2="-2.54" y2="1.016" width="0.1524" layer="21"/>
<wire x1="-2.54" y1="1.016" x2="-2.794" y2="1.27" width="0.1524" layer="21"/>
<wire x1="-2.794" y1="1.27" x2="-4.826" y2="1.27" width="0.1524" layer="21"/>
<wire x1="-4.826" y1="1.27" x2="-5.08" y2="1.016" width="0.1524" layer="21"/>
<wire x1="-5.08" y1="1.016" x2="-5.334" y2="1.27" width="0.1524" layer="21"/>
<wire x1="-5.334" y1="1.27" x2="-7.366" y2="1.27" width="0.1524" layer="21"/>
<wire x1="-7.366" y1="1.27" x2="-7.62" y2="1.016" width="0.1524" layer="21"/>
<wire x1="-7.62" y1="1.016" x2="-7.874" y2="1.27" width="0.1524" layer="21"/>
<wire x1="-7.874" y1="1.27" x2="-10.16" y2="1.27" width="0.1524" layer="21"/>
<wire x1="-9.144" y1="0.762" x2="-9.144" y2="0.508" width="0.1524" layer="51"/>
<wire x1="-9.144" y1="0.508" x2="-9.398" y2="0.508" width="0.1524" layer="51"/>
<wire x1="-9.398" y1="0.508" x2="-9.398" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="-9.398" y1="-0.508" x2="-9.144" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="-9.144" y1="-0.508" x2="-9.144" y2="-0.762" width="0.1524" layer="51"/>
<wire x1="-9.144" y1="-0.762" x2="-8.636" y2="-0.762" width="0.1524" layer="51"/>
<wire x1="-8.636" y1="-0.762" x2="-8.636" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="-8.636" y1="-0.508" x2="-8.382" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="-8.382" y1="-0.508" x2="-8.382" y2="0.508" width="0.1524" layer="51"/>
<wire x1="-8.382" y1="0.508" x2="-8.636" y2="0.508" width="0.1524" layer="51"/>
<wire x1="-8.636" y1="0.508" x2="-8.636" y2="0.762" width="0.1524" layer="51"/>
<wire x1="-8.636" y1="0.762" x2="-9.144" y2="0.762" width="0.1524" layer="51"/>
<wire x1="-6.604" y1="0.762" x2="-6.604" y2="0.508" width="0.1524" layer="51"/>
<wire x1="-6.604" y1="0.508" x2="-6.858" y2="0.508" width="0.1524" layer="51"/>
<wire x1="-6.858" y1="0.508" x2="-6.858" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="-6.858" y1="-0.508" x2="-6.604" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="-6.604" y1="-0.508" x2="-6.604" y2="-0.762" width="0.1524" layer="51"/>
<wire x1="-6.604" y1="-0.762" x2="-6.096" y2="-0.762" width="0.1524" layer="51"/>
<wire x1="-6.096" y1="-0.762" x2="-6.096" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="-6.096" y1="-0.508" x2="-5.842" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="-5.842" y1="-0.508" x2="-5.842" y2="0.508" width="0.1524" layer="51"/>
<wire x1="-5.842" y1="0.508" x2="-6.096" y2="0.508" width="0.1524" layer="51"/>
<wire x1="-6.096" y1="0.508" x2="-6.096" y2="0.762" width="0.1524" layer="51"/>
<wire x1="-6.096" y1="0.762" x2="-6.604" y2="0.762" width="0.1524" layer="51"/>
<wire x1="-4.064" y1="0.762" x2="-4.064" y2="0.508" width="0.1524" layer="51"/>
<wire x1="-4.064" y1="0.508" x2="-4.318" y2="0.508" width="0.1524" layer="51"/>
<wire x1="-4.318" y1="0.508" x2="-4.318" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="-4.318" y1="-0.508" x2="-4.064" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="-4.064" y1="-0.508" x2="-4.064" y2="-0.762" width="0.1524" layer="51"/>
<wire x1="-4.064" y1="-0.762" x2="-3.556" y2="-0.762" width="0.1524" layer="51"/>
<wire x1="-3.556" y1="-0.762" x2="-3.556" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="-3.556" y1="-0.508" x2="-3.302" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="-3.302" y1="-0.508" x2="-3.302" y2="0.508" width="0.1524" layer="51"/>
<wire x1="-3.302" y1="0.508" x2="-3.556" y2="0.508" width="0.1524" layer="51"/>
<wire x1="-3.556" y1="0.508" x2="-3.556" y2="0.762" width="0.1524" layer="51"/>
<wire x1="-3.556" y1="0.762" x2="-4.064" y2="0.762" width="0.1524" layer="51"/>
<wire x1="-1.524" y1="0.762" x2="-1.524" y2="0.508" width="0.1524" layer="51"/>
<wire x1="-1.524" y1="0.508" x2="-1.778" y2="0.508" width="0.1524" layer="51"/>
<wire x1="-1.778" y1="0.508" x2="-1.778" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="-1.778" y1="-0.508" x2="-1.524" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="-1.524" y1="-0.508" x2="-1.524" y2="-0.762" width="0.1524" layer="51"/>
<wire x1="-1.524" y1="-0.762" x2="-1.016" y2="-0.762" width="0.1524" layer="51"/>
<wire x1="-1.016" y1="-0.762" x2="-1.016" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="-1.016" y1="-0.508" x2="-0.762" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="-0.762" y1="-0.508" x2="-0.762" y2="0.508" width="0.1524" layer="51"/>
<wire x1="-0.762" y1="0.508" x2="-1.016" y2="0.508" width="0.1524" layer="51"/>
<wire x1="-1.016" y1="0.508" x2="-1.016" y2="0.762" width="0.1524" layer="51"/>
<wire x1="-1.016" y1="0.762" x2="-1.524" y2="0.762" width="0.1524" layer="51"/>
<wire x1="1.016" y1="0.762" x2="1.016" y2="0.508" width="0.1524" layer="51"/>
<wire x1="1.016" y1="0.508" x2="0.762" y2="0.508" width="0.1524" layer="51"/>
<wire x1="0.762" y1="0.508" x2="0.762" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="0.762" y1="-0.508" x2="1.016" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="1.016" y1="-0.508" x2="1.016" y2="-0.762" width="0.1524" layer="51"/>
<wire x1="1.016" y1="-0.762" x2="1.524" y2="-0.762" width="0.1524" layer="51"/>
<wire x1="1.524" y1="-0.762" x2="1.524" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="1.524" y1="-0.508" x2="1.778" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="1.778" y1="-0.508" x2="1.778" y2="0.508" width="0.1524" layer="51"/>
<wire x1="1.778" y1="0.508" x2="1.524" y2="0.508" width="0.1524" layer="51"/>
<wire x1="1.524" y1="0.508" x2="1.524" y2="0.762" width="0.1524" layer="51"/>
<wire x1="1.524" y1="0.762" x2="1.016" y2="0.762" width="0.1524" layer="51"/>
<wire x1="0.254" y1="-1.27" x2="2.286" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="2.286" y1="-1.27" x2="2.54" y2="-1.016" width="0.1524" layer="21"/>
<wire x1="2.54" y1="-1.016" x2="2.794" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="2.794" y1="-1.27" x2="4.826" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="4.826" y1="-1.27" x2="5.08" y2="-1.016" width="0.1524" layer="21"/>
<wire x1="5.08" y1="-1.016" x2="5.334" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="5.334" y1="1.27" x2="5.08" y2="1.016" width="0.1524" layer="21"/>
<wire x1="5.08" y1="1.016" x2="4.826" y2="1.27" width="0.1524" layer="21"/>
<wire x1="4.826" y1="1.27" x2="2.794" y2="1.27" width="0.1524" layer="21"/>
<wire x1="2.794" y1="1.27" x2="2.54" y2="1.016" width="0.1524" layer="21"/>
<wire x1="2.54" y1="1.016" x2="2.286" y2="1.27" width="0.1524" layer="21"/>
<wire x1="2.286" y1="1.27" x2="0.254" y2="1.27" width="0.1524" layer="21"/>
<wire x1="3.556" y1="0.762" x2="3.556" y2="0.508" width="0.1524" layer="51"/>
<wire x1="3.556" y1="0.508" x2="3.302" y2="0.508" width="0.1524" layer="51"/>
<wire x1="3.302" y1="0.508" x2="3.302" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="3.302" y1="-0.508" x2="3.556" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="3.556" y1="-0.508" x2="3.556" y2="-0.762" width="0.1524" layer="51"/>
<wire x1="3.556" y1="-0.762" x2="4.064" y2="-0.762" width="0.1524" layer="51"/>
<wire x1="4.064" y1="-0.762" x2="4.064" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="4.064" y1="-0.508" x2="4.318" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="4.318" y1="-0.508" x2="4.318" y2="0.508" width="0.1524" layer="51"/>
<wire x1="4.318" y1="0.508" x2="4.064" y2="0.508" width="0.1524" layer="51"/>
<wire x1="4.064" y1="0.508" x2="4.064" y2="0.762" width="0.1524" layer="51"/>
<wire x1="4.064" y1="0.762" x2="3.556" y2="0.762" width="0.1524" layer="51"/>
<wire x1="6.096" y1="0.762" x2="6.096" y2="0.508" width="0.1524" layer="51"/>
<wire x1="6.096" y1="0.508" x2="5.842" y2="0.508" width="0.1524" layer="51"/>
<wire x1="5.842" y1="0.508" x2="5.842" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="5.842" y1="-0.508" x2="6.096" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="6.096" y1="-0.508" x2="6.096" y2="-0.762" width="0.1524" layer="51"/>
<wire x1="6.096" y1="-0.762" x2="6.604" y2="-0.762" width="0.1524" layer="51"/>
<wire x1="6.604" y1="-0.762" x2="6.604" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="6.604" y1="-0.508" x2="6.858" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="6.858" y1="-0.508" x2="6.858" y2="0.508" width="0.1524" layer="51"/>
<wire x1="6.858" y1="0.508" x2="6.604" y2="0.508" width="0.1524" layer="51"/>
<wire x1="6.604" y1="0.508" x2="6.604" y2="0.762" width="0.1524" layer="51"/>
<wire x1="6.604" y1="0.762" x2="6.096" y2="0.762" width="0.1524" layer="51"/>
<wire x1="10.16" y1="1.27" x2="7.874" y2="1.27" width="0.1524" layer="21"/>
<wire x1="10.16" y1="-1.27" x2="10.16" y2="1.27" width="0.1524" layer="21"/>
<wire x1="7.874" y1="-1.27" x2="10.16" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="7.62" y1="1.016" x2="7.366" y2="1.27" width="0.1524" layer="21"/>
<wire x1="7.874" y1="1.27" x2="7.62" y2="1.016" width="0.1524" layer="21"/>
<wire x1="7.366" y1="1.27" x2="5.334" y2="1.27" width="0.1524" layer="21"/>
<wire x1="7.62" y1="-1.016" x2="7.874" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="7.366" y1="-1.27" x2="7.62" y2="-1.016" width="0.1524" layer="21"/>
<wire x1="5.334" y1="-1.27" x2="7.366" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="8.636" y1="0.762" x2="8.636" y2="0.508" width="0.1524" layer="51"/>
<wire x1="8.636" y1="0.508" x2="8.382" y2="0.508" width="0.1524" layer="51"/>
<wire x1="8.382" y1="0.508" x2="8.382" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="8.382" y1="-0.508" x2="8.636" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="8.636" y1="-0.508" x2="8.636" y2="-0.762" width="0.1524" layer="51"/>
<wire x1="8.636" y1="-0.762" x2="9.144" y2="-0.762" width="0.1524" layer="51"/>
<wire x1="9.144" y1="-0.762" x2="9.144" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="9.144" y1="-0.508" x2="9.398" y2="-0.508" width="0.1524" layer="51"/>
<wire x1="9.398" y1="-0.508" x2="9.398" y2="0.508" width="0.1524" layer="51"/>
<wire x1="9.398" y1="0.508" x2="9.144" y2="0.508" width="0.1524" layer="51"/>
<wire x1="9.144" y1="0.508" x2="9.144" y2="0.762" width="0.1524" layer="51"/>
<wire x1="9.144" y1="0.762" x2="8.636" y2="0.762" width="0.1524" layer="51"/>
<pad name="1" x="-8.89" y="0" drill="0.8128" shape="long" rot="R90"/>
<pad name="2" x="-6.35" y="0" drill="0.8128" shape="long" rot="R90"/>
<pad name="3" x="-3.81" y="0" drill="0.8128" shape="long" rot="R90"/>
<pad name="4" x="-1.27" y="0" drill="0.8128" shape="long" rot="R90"/>
<pad name="5" x="1.27" y="0" drill="0.8128" shape="long" rot="R90"/>
<pad name="6" x="3.81" y="0" drill="0.8128" shape="long" rot="R90"/>
<pad name="7" x="6.35" y="0" drill="0.8128" shape="long" rot="R90"/>
<pad name="8" x="8.89" y="0" drill="0.8128" shape="long" rot="R90"/>
<text x="-6.35" y="1.651" size="1.27" layer="25" ratio="10">>NAME</text>
<text x="-9.398" y="1.524" size="1.27" layer="21" ratio="10">1</text>
<text x="-10.16" y="-2.921" size="1.27" layer="27" ratio="10">>VALUE</text>
<text x="8.382" y="1.524" size="1.27" layer="21" ratio="10">8</text>
<rectangle x1="-9.017" y1="0.254" x2="-8.763" y2="0.762" layer="51"/>
<rectangle x1="-9.017" y1="-0.762" x2="-8.763" y2="-0.254" layer="51"/>
<rectangle x1="-6.477" y1="0.254" x2="-6.223" y2="0.762" layer="51"/>
<rectangle x1="-6.477" y1="-0.762" x2="-6.223" y2="-0.254" layer="51"/>
<rectangle x1="-3.937" y1="0.254" x2="-3.683" y2="0.762" layer="51"/>
<rectangle x1="-3.937" y1="-0.762" x2="-3.683" y2="-0.254" layer="51"/>
<rectangle x1="-1.397" y1="0.254" x2="-1.143" y2="0.762" layer="51"/>
<rectangle x1="-1.397" y1="-0.762" x2="-1.143" y2="-0.254" layer="51"/>
<rectangle x1="1.143" y1="0.254" x2="1.397" y2="0.762" layer="51"/>
<rectangle x1="1.143" y1="-0.762" x2="1.397" y2="-0.254" layer="51"/>
<rectangle x1="3.683" y1="0.254" x2="3.937" y2="0.762" layer="51"/>
<rectangle x1="3.683" y1="-0.762" x2="3.937" y2="-0.254" layer="51"/>
<rectangle x1="6.223" y1="0.254" x2="6.477" y2="0.762" layer="51"/>
<rectangle x1="6.223" y1="-0.762" x2="6.477" y2="-0.254" layer="51"/>
<rectangle x1="8.763" y1="0.254" x2="9.017" y2="0.762" layer="51"/>
<rectangle x1="8.763" y1="-0.762" x2="9.017" y2="-0.254" layer="51"/>
</package>
</packages>
</library>
</libraries>
<attributes>
</attributes>
<variantdefs>
</variantdefs>
<classes>
<class number="0" name="default" width="0.254" drill="0.3048">
<clearance class="0" value="0.254"/>
</class>
<class number="1" name="power" width="0.635" drill="0.3048">
<clearance class="1" value="0.508"/>
</class>
</classes>
<designrules name="default">
<description language="de">EAGLE Design Rules

Die Standard-Design-Rules sind so gewählt, dass sie für
die meisten Anwendungen passen. Sollte ihre Platine
besondere Anforderungen haben, treffen Sie die erforderlichen
Einstellungen hier und speichern die Design Rules unter
einem neuen Namen ab.</description>
<description language="en">EAGLE Design Rules

The default Design Rules have been set to cover
a wide range of applications. Your particular design
may have different requirements, so please make the
necessary adjustments and save your customized
design rules under a new name.</description>
<param name="layerSetup" value="(1*16)"/>
<param name="mtCopper" value="0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm"/>
<param name="mtIsolate" value="1.5mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm"/>
<param name="mdWireWire" value="8mil"/>
<param name="mdWirePad" value="8mil"/>
<param name="mdWireVia" value="8mil"/>
<param name="mdPadPad" value="8mil"/>
<param name="mdPadVia" value="8mil"/>
<param name="mdViaVia" value="8mil"/>
<param name="mdSmdPad" value="8mil"/>
<param name="mdSmdVia" value="8mil"/>
<param name="mdSmdSmd" value="8mil"/>
<param name="mdViaViaSameLayer" value="8mil"/>
<param name="mnLayersViaInSmd" value="2"/>
<param name="mdCopperDimension" value="40mil"/>
<param name="mdDrill" value="8mil"/>
<param name="mdSmdStop" value="0mil"/>
<param name="msWidth" value="10mil"/>
<param name="msDrill" value="24mil"/>
<param name="msMicroVia" value="9.99mm"/>
<param name="msBlindViaRatio" value="0.5"/>
<param name="rvPadTop" value="0.25"/>
<param name="rvPadInner" value="0.25"/>
<param name="rvPadBottom" value="0.25"/>
<param name="rvViaOuter" value="0.25"/>
<param name="rvViaInner" value="0.25"/>
<param name="rvMicroViaOuter" value="0.25"/>
<param name="rvMicroViaInner" value="0.25"/>
<param name="rlMinPadTop" value="10mil"/>
<param name="rlMaxPadTop" value="20mil"/>
<param name="rlMinPadInner" value="10mil"/>
<param name="rlMaxPadInner" value="20mil"/>
<param name="rlMinPadBottom" value="10mil"/>
<param name="rlMaxPadBottom" value="20mil"/>
<param name="rlMinViaOuter" value="8mil"/>
<param name="rlMaxViaOuter" value="20mil"/>
<param name="rlMinViaInner" value="8mil"/>
<param name="rlMaxViaInner" value="20mil"/>
<param name="rlMinMicroViaOuter" value="4mil"/>
<param name="rlMaxMicroViaOuter" value="20mil"/>
<param name="rlMinMicroViaInner" value="4mil"/>
<param name="rlMaxMicroViaInner" value="20mil"/>
<param name="psTop" value="-1"/>
<param name="psBottom" value="-1"/>
<param name="psFirst" value="-1"/>
<param name="psElongationLong" value="100"/>
<param name="psElongationOffset" value="100"/>
<param name="mvStopFrame" value="1"/>
<param name="mvCreamFrame" value="0"/>
<param name="mlMinStopFrame" value="4mil"/>
<param name="mlMaxStopFrame" value="4mil"/>
<param name="mlMinCreamFrame" value="0mil"/>
<param name="mlMaxCreamFrame" value="0mil"/>
<param name="mlViaStopLimit" value="0mil"/>
<param name="srRoundness" value="0"/>
<param name="srMinRoundness" value="0mil"/>
<param name="srMaxRoundness" value="0mil"/>
<param name="slThermalIsolate" value="10mil"/>
<param name="slThermalsForVias" value="0"/>
<param name="dpMaxLengthDifference" value="10mm"/>
<param name="dpGapFactor" value="2.5"/>
<param name="checkGrid" value="0"/>
<param name="checkAngle" value="0"/>
<param name="checkFont" value="1"/>
<param name="checkRestrict" value="1"/>
<param name="useDiameter" value="13"/>
<param name="maxErrors" value="50"/>
</designrules>
<autorouter>
<pass name="Default">
<param name="RoutingGrid" value="10mil"/>
<param name="tpViaShape" value="round"/>
<param name="PrefDir.1" value="|"/>
<param name="PrefDir.2" value="0"/>
<param name="PrefDir.3" value="0"/>
<param name="PrefDir.4" value="0"/>
<param name="PrefDir.5" value="0"/>
<param name="PrefDir.6" value="0"/>
<param name="PrefDir.7" value="0"/>
<param name="PrefDir.8" value="0"/>
<param name="PrefDir.9" value="0"/>
<param name="PrefDir.10" value="0"/>
<param name="PrefDir.11" value="0"/>
<param name="PrefDir.12" value="0"/>
<param name="PrefDir.13" value="0"/>
<param name="PrefDir.14" value="0"/>
<param name="PrefDir.15" value="0"/>
<param name="PrefDir.16" value="-"/>
<param name="cfVia" value="8"/>
<param name="cfNonPref" value="5"/>
<param name="cfChangeDir" value="2"/>
<param name="cfOrthStep" value="2"/>
<param name="cfDiagStep" value="3"/>
<param name="cfExtdStep" value="0"/>
<param name="cfBonusStep" value="1"/>
<param name="cfMalusStep" value="1"/>
<param name="cfPadImpact" value="4"/>
<param name="cfSmdImpact" value="4"/>
<param name="cfBusImpact" value="0"/>
<param name="cfHugging" value="3"/>
<param name="cfAvoid" value="4"/>
<param name="cfPolygon" value="10"/>
<param name="cfBase.1" value="0"/>
<param name="cfBase.2" value="1"/>
<param name="cfBase.3" value="1"/>
<param name="cfBase.4" value="1"/>
<param name="cfBase.5" value="1"/>
<param name="cfBase.6" value="1"/>
<param name="cfBase.7" value="1"/>
<param name="cfBase.8" value="1"/>
<param name="cfBase.9" value="1"/>
<param name="cfBase.10" value="1"/>
<param name="cfBase.11" value="1"/>
<param name="cfBase.12" value="1"/>
<param name="cfBase.13" value="1"/>
<param name="cfBase.14" value="1"/>
<param name="cfBase.15" value="1"/>
<param name="cfBase.16" value="0"/>
<param name="mnVias" value="20"/>
<param name="mnSegments" value="9999"/>
<param name="mnExtdSteps" value="9999"/>
<param name="mnRipupLevel" value="10"/>
<param name="mnRipupSteps" value="100"/>
<param name="mnRipupTotal" value="100"/>
</pass>
<pass name="Follow-me" refer="Default" active="yes">
</pass>
<pass name="Busses" refer="Default" active="yes">
<param name="cfNonPref" value="4"/>
<param name="cfBusImpact" value="4"/>
<param name="cfHugging" value="0"/>
<param name="mnVias" value="0"/>
</pass>
<pass name="Route" refer="Default" active="yes">
</pass>
<pass name="Optimize1" refer="Default" active="yes">
<param name="cfVia" value="99"/>
<param name="cfExtdStep" value="10"/>
<param name="cfHugging" value="1"/>
<param name="mnExtdSteps" value="1"/>
<param name="mnRipupLevel" value="0"/>
</pass>
<pass name="Optimize2" refer="Optimize1" active="yes">
<param name="cfNonPref" value="0"/>
<param name="cfChangeDir" value="6"/>
<param name="cfExtdStep" value="0"/>
<param name="cfBonusStep" value="2"/>
<param name="cfMalusStep" value="2"/>
<param name="cfPadImpact" value="2"/>
<param name="cfSmdImpact" value="2"/>
<param name="cfHugging" value="0"/>
</pass>
<pass name="Optimize3" refer="Optimize2" active="yes">
<param name="cfChangeDir" value="8"/>
<param name="cfPadImpact" value="0"/>
<param name="cfSmdImpact" value="0"/>
</pass>
<pass name="Optimize4" refer="Optimize3" active="yes">
<param name="cfChangeDir" value="25"/>
</pass>
</autorouter>
<elements>
<element name="SRV23" library="con-lstb" package="MA03-2" value="" x="13" y="20" smashed="yes" rot="R90">
<attribute name="OC_NEWARK" value="unknown" x="34.59" y="49.21" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="MPN" value="" x="34.59" y="49.21" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="MF" value="" x="34.59" y="49.21" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="OC_FARNELL" value="unknown" x="34.59" y="49.21" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="VALUE" x="17.191" y="18.73" size="1.27" layer="27" ratio="10" rot="R90"/>
</element>
<element name="SRV01" library="con-lstb" package="MA03-2" value="" x="19" y="20" smashed="yes" rot="R90">
<attribute name="OC_NEWARK" value="unknown" x="40.59" y="39.05" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="MPN" value="" x="40.59" y="39.05" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="MF" value="" x="40.59" y="39.05" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="OC_FARNELL" value="unknown" x="40.59" y="39.05" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="VALUE" x="23.191" y="18.73" size="1.27" layer="27" ratio="10" rot="R90"/>
</element>
<element name="CHRG" library="con-jack" package="DCJ0303" value="" x="15" y="10" smashed="yes">
<attribute name="OC_NEWARK" value="unknown" x="35.32" y="-1.43" size="1.778" layer="27" display="off"/>
<attribute name="MPN" value="" x="35.32" y="-1.43" size="1.778" layer="27" display="off"/>
<attribute name="MF" value="" x="35.32" y="-1.43" size="1.778" layer="27" display="off"/>
<attribute name="OC_FARNELL" value="unknown" x="35.32" y="-1.43" size="1.778" layer="27" display="off"/>
<attribute name="NAME" x="10" y="2" size="1.27" layer="25" rot="R90"/>
<attribute name="VALUE" x="9.92" y="-0.16" size="1.27" layer="27" rot="R90"/>
</element>
<element name="BAT" library="con-wago-500" package="W237-102" value="" x="6.24" y="14.81" smashed="yes" rot="R270">
<attribute name="OC_NEWARK" value="70K9898" x="-0.11" y="-15.669996875" size="1.778" layer="27" rot="R270" display="off"/>
<attribute name="MPN" value="237-102" x="-0.11" y="-15.669996875" size="1.778" layer="27" rot="R270" display="off"/>
<attribute name="MF" value="" x="-0.11" y="-15.669996875" size="1.778" layer="27" rot="R270" display="off"/>
<attribute name="OC_FARNELL" value="unknown" x="-0.11" y="-15.669996875" size="1.778" layer="27" rot="R270" display="off"/>
<attribute name="VALUE" x="-1.38" y="19.85" size="1.27" layer="27" ratio="10" rot="R270"/>
<attribute name="NAME" x="1" y="20" size="1.27" layer="25" ratio="10"/>
</element>
<element name="U$2" library="holes" package="3,0" value="" x="5" y="25"/>
<element name="U$3" library="holes" package="3,0" value="" x="35" y="5"/>
<element name="U$4" library="holes" package="3,0" value="" x="35" y="25"/>
<element name="U$1" library="holes" package="3,0" value="" x="5" y="5"/>
<element name="SV1" library="con-lsta" package="FE08" value="" x="19.40845" y="27.276240625" smashed="yes" rot="R180">
<attribute name="OC_NEWARK" value="unknown" x="19.40845" y="27.276240625" size="1.778" layer="27" font="vector" ratio="15" rot="R180" display="off"/>
<attribute name="MPN" value="" x="19.40845" y="27.276240625" size="1.778" layer="27" font="vector" ratio="15" rot="R180" display="off"/>
<attribute name="MF" value="" x="19.40845" y="27.276240625" size="1.778" layer="27" font="vector" ratio="15" rot="R180" display="off"/>
<attribute name="OC_FARNELL" value="unknown" x="19.40845" y="27.276240625" size="1.778" layer="27" font="vector" ratio="15" rot="R180" display="off"/>
<attribute name="VALUE" x="29.56845" y="30.197240625" size="1.27" layer="27" ratio="10" rot="R180"/>
</element>
<element name="SRV45" library="con-lstb" package="MA03-2" value="" x="25" y="20" smashed="yes" rot="R90">
<attribute name="OC_NEWARK" value="unknown" x="25" y="20" size="1.778" layer="27" font="vector" ratio="15" rot="R90" display="off"/>
<attribute name="MPN" value="" x="25" y="20" size="1.778" layer="27" font="vector" ratio="15" rot="R90" display="off"/>
<attribute name="MF" value="" x="25" y="20" size="1.778" layer="27" font="vector" ratio="15" rot="R90" display="off"/>
<attribute name="OC_FARNELL" value="unknown" x="25" y="20" size="1.778" layer="27" font="vector" ratio="15" rot="R90" display="off"/>
<attribute name="VALUE" x="29.191" y="18.73" size="1.27" layer="27" ratio="10" rot="R90"/>
</element>
<element name="SW1" library="con-wago-500" package="W237-102" value="" x="26" y="6" smashed="yes">
<attribute name="OC_NEWARK" value="70K9898" x="26" y="6" size="1.778" layer="27" font="vector" ratio="15" display="off"/>
<attribute name="MPN" value="237-102" x="26" y="6" size="1.778" layer="27" font="vector" ratio="15" display="off"/>
<attribute name="MF" value="" x="26" y="6" size="1.778" layer="27" font="vector" ratio="15" display="off"/>
<attribute name="OC_FARNELL" value="unknown" x="26" y="6" size="1.778" layer="27" font="vector" ratio="15" display="off"/>
<attribute name="VALUE" x="20.96" y="-1.62" size="1.27" layer="27" ratio="10"/>
<attribute name="NAME" x="21.1538" y="9.9962" size="1.27" layer="25" ratio="10"/>
</element>
<element name="SW2" library="con-wago-500" package="W237-102" value="" x="34" y="15.63398125" smashed="yes" rot="R90">
<attribute name="OC_NEWARK" value="70K9898" x="34" y="15.63398125" size="1.778" layer="27" font="vector" ratio="15" rot="R90" display="off"/>
<attribute name="MPN" value="237-102" x="34" y="15.63398125" size="1.778" layer="27" font="vector" ratio="15" rot="R90" display="off"/>
<attribute name="MF" value="" x="34" y="15.63398125" size="1.778" layer="27" font="vector" ratio="15" rot="R90" display="off"/>
<attribute name="OC_FARNELL" value="unknown" x="34" y="15.63398125" size="1.778" layer="27" font="vector" ratio="15" rot="R90" display="off"/>
<attribute name="VALUE" x="41.62" y="10.59398125" size="1.27" layer="27" ratio="10" rot="R90"/>
<attribute name="NAME" x="38.856921875" y="10.4547375" size="1.27" layer="25" ratio="10" rot="R180"/>
</element>
</elements>
<signals>
<signal name="N$2" class="1">
<contactref element="CHRG" pad="3"/>
<contactref element="BAT" pad="2"/>
<wire x1="4.97" y1="12.31" x2="10.69" y2="12.31" width="0.635" layer="16"/>
<wire x1="10.69" y1="12.31" x2="15" y2="7" width="0.635" layer="16"/>
<contactref element="SW1" pad="1"/>
<wire x1="15" y1="7" x2="21.23" y2="7" width="0.635" layer="16"/>
<wire x1="21.23" y1="7" x2="23.5" y2="4.73" width="0.635" layer="16"/>
</signal>
<signal name="GND" class="1">
<contactref element="BAT" pad="1"/>
<contactref element="CHRG" pad="1"/>
<contactref element="SV1" pad="2"/>
<wire x1="29" y1="20" x2="29" y2="23.35" width="0.635" layer="16"/>
<wire x1="29" y1="23.35" x2="27" y2="25" width="0.635" layer="16"/>
<wire x1="27" y1="25" x2="26.35" y2="25.65" width="0.635" layer="16"/>
<wire x1="26.35" y1="25.65" x2="25.75845" y2="27.276240625" width="0.635" layer="16"/>
<contactref element="SRV45" pad="2"/>
<contactref element="SRV45" pad="1"/>
<contactref element="SRV01" pad="2"/>
<contactref element="SRV01" pad="1"/>
<contactref element="SRV23" pad="2"/>
<contactref element="SRV23" pad="1"/>
<wire x1="26.27" y1="17.46" x2="23.73" y2="17.46" width="0.635" layer="16"/>
<wire x1="23.73" y1="17.46" x2="20.27" y2="17.46" width="0.635" layer="16"/>
<wire x1="20.27" y1="17.46" x2="17.73" y2="17.46" width="0.635" layer="16"/>
<wire x1="17.73" y1="17.46" x2="14.27" y2="17.46" width="0.635" layer="16"/>
<wire x1="14.27" y1="17.46" x2="11.73" y2="17.46" width="0.635" layer="16"/>
<wire x1="11.73" y1="17.46" x2="5.12" y2="17.46" width="0.635" layer="16"/>
<wire x1="5.12" y1="17.46" x2="4.97" y2="17.31" width="0.635" layer="16"/>
<wire x1="17.73" y1="17.46" x2="17.73" y2="14.83" width="0.635" layer="16"/>
<wire x1="17.73" y1="14.83" x2="15" y2="13.1" width="0.635" layer="16"/>
<wire x1="26.27" y1="17.46" x2="26.46" y2="17.46" width="0.254" layer="16"/>
<wire x1="26.46" y1="17.46" x2="29" y2="20" width="0.635" layer="16"/>
</signal>
<signal name="SERVOPWR" class="1">
<contactref element="SV1" pad="1"/>
<contactref element="SW2" pad="1"/>
<contactref element="SW1" pad="2"/>
<wire x1="28.29845" y1="27.276240625" x2="30" y2="26" width="0.635" layer="16"/>
<wire x1="30" y1="26" x2="31" y2="22" width="0.635" layer="16"/>
<wire x1="31" y1="22" x2="31" y2="15" width="0.635" layer="16"/>
<wire x1="31" y1="15" x2="35.27" y2="13.13398125" width="0.635" layer="16"/>
<wire x1="31" y1="15" x2="31" y2="9" width="0.635" layer="16"/>
<wire x1="31" y1="9" x2="28.5" y2="4.73" width="0.635" layer="16"/>
</signal>
<signal name="N$5">
<contactref element="SRV45" pad="6"/>
<contactref element="SV1" pad="4"/>
<wire x1="20.67845" y1="27.276240625" x2="21.27" y2="25" width="0.254" layer="1"/>
<wire x1="21.27" y1="25" x2="23.73" y2="22.54" width="0.254" layer="1"/>
</signal>
<signal name="N$6">
<contactref element="SRV45" pad="5"/>
<contactref element="SV1" pad="3"/>
<wire x1="23.21845" y1="27.276240625" x2="23.81" y2="25" width="0.254" layer="1"/>
<wire x1="23.81" y1="25" x2="26.27" y2="22.54" width="0.254" layer="1"/>
</signal>
<signal name="N$7">
<contactref element="SRV01" pad="6"/>
<contactref element="SV1" pad="6"/>
<wire x1="15.59845" y1="27.276240625" x2="16.19" y2="24.08" width="0.254" layer="1"/>
<wire x1="16.19" y1="24.08" x2="17.73" y2="22.54" width="0.254" layer="1"/>
</signal>
<signal name="N$9">
<contactref element="SRV01" pad="5"/>
<contactref element="SV1" pad="5"/>
<wire x1="18.13845" y1="27.276240625" x2="18.73" y2="24.08" width="0.254" layer="1"/>
<wire x1="18.73" y1="24.08" x2="20.27" y2="22.54" width="0.254" layer="1"/>
</signal>
<signal name="N$3">
<contactref element="SRV23" pad="6"/>
<contactref element="SV1" pad="8"/>
<wire x1="10.51845" y1="27.276240625" x2="11.11" y2="23.16" width="0.254" layer="1"/>
<wire x1="11.11" y1="23.16" x2="11.73" y2="22.54" width="0.254" layer="1"/>
</signal>
<signal name="N$4">
<contactref element="SRV23" pad="5"/>
<contactref element="SV1" pad="7"/>
<wire x1="13.05845" y1="27.276240625" x2="13.65" y2="23.16" width="0.254" layer="1"/>
<wire x1="13.65" y1="23.16" x2="14.27" y2="22.54" width="0.254" layer="1"/>
</signal>
<signal name="N$12" class="1">
<contactref element="SRV45" pad="4"/>
<contactref element="SRV45" pad="3"/>
<contactref element="SRV01" pad="4"/>
<contactref element="SRV01" pad="3"/>
<contactref element="SRV23" pad="4"/>
<contactref element="SRV23" pad="3"/>
<wire x1="11.73" y1="20" x2="14.27" y2="20" width="0.635" layer="1"/>
<wire x1="14.27" y1="20" x2="17.73" y2="20" width="0.635" layer="1"/>
<wire x1="17.73" y1="20" x2="20.27" y2="20" width="0.635" layer="1"/>
<wire x1="20.27" y1="20" x2="23.73" y2="20" width="0.635" layer="1"/>
<wire x1="23.73" y1="20" x2="26.27" y2="20" width="0.635" layer="1"/>
<wire x1="26.27" y1="20" x2="33.81" y2="20" width="0.635" layer="1"/>
<contactref element="SW2" pad="2"/>
<wire x1="35.27" y1="18.13398125" x2="35.27" y2="18.54" width="0.635" layer="1"/>
<wire x1="35.27" y1="18.54" x2="33.81" y2="20" width="0.635" layer="1"/>
</signal>
</signals>
</board>
</drawing>
</eagle>

repository: swipswaps/basebot

repo_name: swipswaps/basebot


text:
package leaseutil

import "github.com/scjalliance/resourceful/strategy"

// CanActivate returns true if a lease can be made active under the specified
// resource counting strategy.
//
// Active is the number of active leases for the consumer requesting a lease.
// Consumed is the total number of consumed resources according to strategy.
// Limit is the resource allocation limit.
func CanActivate(strat strategy.Strategy, active, consumed, limit uint) bool {
	if limit == 0 {
		return false
	}
	if consumed > limit {
		return false
	}
	if strat == strategy.Consumer {
		if active > 0 {
			return true
		}
	}
	return consumed < limit
}

license: MIT

repository: scjalliance/resourceful

license_type: permissive

repo_name: scjalliance/resourceful

branch_name: refs/heads/main

extension: go


text:
SECTION = "kernel"
DESCRIPTION = "handhelds.org Linux kernel 2.6 for PocketPCs and other consumer handheld devices."
LICENSE = "GPL"
PR = "r1"

DEFAULT_PREFERENCE = "-1"

# Override where to look for defconfigs and patches,
# we have per-kernel-release sets.
FILESPATH = "${FILE_DIRNAME}/linux-handhelds-2.6-2.6.20/${MACHINE}:${FILE_DIRNAME}/linux-handhelds-2.6-2.6.20"

SRC_URI = "${HANDHELDS_CVS};module=linux/kernel26;tag=${@'K' + bb.data.getVar('PV',d,1).replace('.', '-')} \
           file://defconfig"

require linux-handhelds-2.6.inc

branch_name: refs/heads/master

extension: bb


text:
#include "wave/optimization/ceres/ba.hpp"

namespace wave {

int BundleAdjustment::addCamera(const Mat3 &K,
                                const MatX &features,
                                const std::vector<LandmarkId> &landmark_ids,
                                double *cam_t,
                                double *cam_q,
                                LandmarkMap &landmarks) {
    // create a residual block for each image feature
    for (int i = 0; i < features.rows(); i++) {
        // build residual
        Vec2 feature{features(i, 0), features(i, 1)};
        auto residual = new BAResidual(K, feature);

        // build cost function
        auto cost_func = new ceres::AutoDiffCostFunction<
          BAResidual,  // Residual type
          2,           // size of residual
          4,           // size of 1st parameter - quaternion
          3,           // size of 2nd parameter - camera center (x, y, z)
          3            // size of 3rd parameter - 3d point in world (x, y, z)
          >(residual);

        // add residual block to problem
        this->problem.AddResidualBlock(
          cost_func,                              // cost function
          NULL,                                   // loss function
          cam_q,                                  // camera quaternion
          cam_t,                                  // camera translation
          landmarks.at(landmark_ids[i]).data());  // landmark
    }

    // add quaternion local parameterization
    ceres::LocalParameterization *quat_param;
    quat_param = new ceres::EigenQuaternionParameterization();
    this->problem.SetParameterization(cam_q, quat_param);

    return 0;
}

int BundleAdjustment::solve() {
    // set options
    this->options.max_num_iterations = 200;
    this->options.use_nonmonotonic_steps = false;
    this->options.use_inner_iterations = true;
    this->options.preconditioner_type = ceres::SCHUR_JACOBI;
    this->options.linear_solver_type = ceres::SPARSE_SCHUR;
    this->options.parameter_tolerance = 1e-10;
    this->options.num_threads = 8;
    this->options.num_linear_solver_threads = 8;
    this->options.minimizer_progress_to_stdout = true;

    // solve
    ceres::Solve(this->options, &this->problem, &this->summary);
    std::cout << summary.FullReport() << "\n";

    return 0;
}

}  // namespace wave

repository: wavelab/libwave

repo_name: wavelab/libwave

gha_license_id: MIT

extension: cpp


text:
import axios, { AxiosError, AxiosHeaders, AxiosResponse } from "axios";
import EventSource from "eventsource";
import * as HttpStatus from "http-status-codes";
import { fn, mocked, MockedFunction } from "jest-mock";
import { basicAuthentication, RequestErrorCode, RequestError } from "../src";
import client from "../src/polyfill";

jest.mock("axios");
jest.genMockFromModule("eventsource");
jest.mock("eventsource");

interface IMockAxiosResponse {
    axiosErrorCode?: string;
    data?: any;
    status?: number;
    headers?: any;
    request?: any;
}

interface IMockEventSourceResponse {
    status?: number;
}

function mockAxiosisError() {
    const axiosErrorMock = mocked(axios.isAxiosError).mockImplementation(<T = any, D = any>(payload: any): payload is AxiosError<T, D> => {
        return typeof payload === "object" && payload.isAxiosError === true;
    });

    axiosErrorMock.mockClear();

    return axiosErrorMock.mock;
}

function mockAxiosResponse(response: IMockAxiosResponse) {
    mockAxiosisError();
    const axiosResponseMock = mocked(axios.request).mockImplementation(<T = unknown, R = AxiosResponse<T, any>>() => {
        if (response.axiosErrorCode) {
            const error = new Error("error") as AxiosError;
            (<any>error).isAxiosError = true;
            error.code = response.axiosErrorCode;
            error.request = {};
            error.config = { headers: new AxiosHeaders() };

            return Promise.reject(error);
        }

        const axiosResponse = toAxiosResponse(response);

        if (axiosResponse.status >= 200 && axiosResponse.status < 300) {
            return Promise.resolve(<R>axiosResponse);
        }

        const error = new Error("error") as AxiosError;
        (<any>error).isAxiosError = true;
        error.response = axiosResponse;
        error.request = {};
        error.config = { headers: new AxiosHeaders() };

        return Promise.reject(error);
    });

    axiosResponseMock.mockClear();

    return axiosResponseMock.mock;
}

function mockEventSourceResponse(response?: IMockEventSourceResponse) {
    mockAxiosisError();

    response = response || {};
    response = response.status ? response : { ...response, status: 200 };

    const eventSourceMock = mocked(EventSource).mockImplementation((url, options) => new class implements EventSource {
        private readonly listeners = new Map<string, ((evt: MessageEvent) => void)[]>();

        readonly CLOSED = 2;
        readonly CONNECTING = 0;
        readonly OPEN = 1;
        readonly options = options;
        readonly url = url;
        readonly readyState = 0;
        readonly withCredentials = false;

        onopen = fn<(evt: MessageEvent) => any>();
        onmessage = fn<(evt: MessageEvent) => any>();
        onerror = fn<(evt: MessageEvent) => any>();

        constructor() {
            setTimeout(() => this.connect(), 0);
        }

        addEventListener = <MockedFunction<(type: string, listener: (evt: MessageEvent) => void) => void>>fn<(type: string, listener: (evt: MessageEvent) => void) => void>((type, listener) => {
            const callbacks = this.listeners.get(type) || [];
            this.listeners.set(type, [...callbacks, listener]);
        });

        dispatchEvent = <MockedFunction<(evt: Event) => boolean>>fn<(evt: Event) => boolean>(evt => {
            const callbacks = this.listeners.get(evt.type);
            if (callbacks) {
                callbacks.forEach(callback => callback(<MessageEvent>evt));
            }

            return true;
        });

        removeEventListener = <MockedFunction<(type: string, listener: (evt: MessageEvent) => void) => void>>fn<(type: string, listener: (evt: MessageEvent) => void) => void>((type, listener) => {
            if (!listener) {
                this.listeners.set(type, []);
            }
            else {
                const callbacks = this.listeners.get(type);
                if (callbacks) {
                    for (let i = 0; i < callbacks.length; i++) {
                        if (callbacks[i] === listener) {
                            callbacks.splice(i, 1);
                            break;
                        }
                    }
                }
            }
        });

        close = <MockedFunction<() => void>>fn<() => void>(() => {
            (<any>this).readyState = this.CLOSED;
        });

        private connect(): void {
            if (response!.status === 200) {
                const event = new MessageEvent("open");
                (<any>event).status = response!.status;

                this.dispatchEvent(event);
                if (this.onopen !== null) {
                    this.onopen(event);
                }
            }
            else {
                const event = new MessageEvent("error");
                (<any>event).status = response!.status;

                this.dispatchEvent(event);
                if (this.onerror !== null) {
                    this.onerror(event);
                }
            }
        }
    });

    eventSourceMock.mockClear();

    return eventSourceMock.mock;
}

function toAxiosResponse(response: IMockAxiosResponse): AxiosResponse {
    return {
        data: response.data || {},
        status: response.status || 200,
        statusText: HttpStatus.getStatusText(response.status || 200),
        headers: response.headers || {},
        config: { headers: new AxiosHeaders() },
        request: response.request
    }
}

describe("request", () => {
    test("with success status", async () => {
        mockAxiosResponse({ status: 200 });

        const result = await client.request({
            method: "GET",
            url: "http://localhost"
        })
        .invoke();

        expect(result.status).toBe(200);
    });

    test("with header option", async () => {
        mockAxiosResponse({ status: 200 });

        const result = await client.request({
            method: "GET",
            headers: { "Authorization": "Bearer token" },
            url: "http://localhost"
        })
        .invoke();

        expect(result.status).toBe(200);
        expect(result.request.options.headers).toBeDefined();
        expect(result.request.options.headers!["Authorization"]).toBeDefined();
        expect(result.request.options.headers!["Authorization"]).toBe("Bearer token");
    });

    test("with header added using fluent request interface", async () => {
        mockAxiosResponse({ status: 200 });

        const result = await client.request({
            method: "GET",
            url: "http://localhost"
        })
        .withHeader("Authorization", "Bearer token")
        .invoke();

        expect(result.status).toBe(200);
        expect(result.request.options.headers).toBeDefined();
        expect(result.request.options.headers!["Authorization"]).toBeDefined();
        expect(result.request.options.headers!["Authorization"]).toBe("Bearer token");
    });

    test("with multiple headers added by request interceptors and fluent interface", async () => {
        mockAxiosResponse({ status: 200 });

        const result = await client.request({
            method: "GET",
            url: "http://localhost"
        })
        .withHeader("Authorization", "Bearer token")
        .use(context => {
            context.next({
                ...context,
                request: context.request
                    .withHeader("X-Span-ID", "1")
                    .withHeader("X-Trace-ID", "2")
            });
        })
        .invoke();

        expect(result.status).toBe(200);
        expect(result.request.options.headers).toBeDefined();
        expect(result.request.options.headers!["Authorization"]).toBeDefined();
        expect(result.request.options.headers!["Authorization"]).toBe("Bearer token");
        expect(result.request.options.headers!["X-Span-ID"]).toBeDefined();
        expect(result.request.options.headers!["X-Span-ID"]).toBe("1");
        expect(result.request.options.headers!["X-Trace-ID"]).toBeDefined();
        expect(result.request.options.headers!["X-Trace-ID"]).toBe("2");
    });

    test("with auto generated request id", async () => {
        mockAxiosResponse({ status: 200 });

        const request = client.request({
            method: "GET",
            url: "http://localhost"
        });

        const result = await request.invoke();

        expect(request.id).toBeDefined();
        expect(result.request.options.headers!["X-Request-ID"]).toBeDefined();
        expect(result.request.options.headers!["X-Request-ID"]).toBe(request.id);
    });

    test("with custom request id", async () => {
        mockAxiosResponse({ status: 200 });

        const request = client.request({
            method: "GET",
            headers: { "X-Request-ID": "request-id" },
            url: "http://localhost"
        });

        const result = await request.invoke();

        expect(request.id).toBe("request-id");
        expect(result.request.options.headers!["X-Request-ID"]).toBe("request-id");
    });

    test("with bad request status", async () => {
        mockAxiosResponse({ status: 400 });

        try {
            await client.request({
                method: "GET",
                url: "http://localhost"
            })
            .invoke()
            .then(() => fail());

            fail();
        }
        catch(err: any) {
            expect(err.code).toBe(RequestErrorCode.httpError);
            expect(err.response).toBeDefined();
            expect(err.response.status).toBe(400);
        }
    });

    test("with timeout request status", async () => {
        mockAxiosResponse({ status: 408 });

        try {
            await client.request({
                method: "GET",
                url: "http://localhost"
            })
            .invoke();

            fail();
        }
        catch(err: any) {
            expect(err.code).toBe(RequestErrorCode.timeout);
            expect(err.response).toBeDefined();
            expect(err.response!.status).toBe(408);
        }
    });

    test("with axios abort error", async () => {
        mockAxiosResponse({ axiosErrorCode: "ECONNABORTED" });

        try {
            await client.request({
                method: "GET",
                url: "http://localhost"
            })
            .invoke();

            fail();
        }
        catch(err: any) {
            expect(err.code).toBe(RequestErrorCode.timeout);
            expect(err.response).toBeUndefined();
        }
    });

    test("with unknown axios error", async () => {
        mockAxiosResponse({ axiosErrorCode: "UNKNOWN" });

        try {
            await client.request({
                method: "GET",
                url: "http://localhost"
            })
            .invoke();

            fail();
        }
        catch(err: any) {
            expect(err.code).toBe(RequestErrorCode.clientError);
            expect(err.response).toBeUndefined();
        }
    });

    test("with async request interceptor", async () => {
        mockAxiosResponse({ status: 200 });
        let value = "";

        await client.request({
            method: "GET",
            url: "http://localhost"
        })
        .use(() => value += "a")
        .use(context => setTimeout(() => {
            value += "b";
            context.next();
        }, 10))
        .use(context => setTimeout(() => {
            value += "c";
            context.next();
        }, 10))
        .use(() => value += "d")
        .use(() => value += "e")
        .invoke();

        expect(value).toBe("abcde");
    });

    test("with request interceptor that manually resolves", async () => {
        const mock = mockAxiosResponse({ status: 200 });

        const result = await client.request({
            method: "GET",
            url: "http://localhost"
        })
        .use(context => {
            context.resolve({
                status: 201,
                data: {}
            });
        })
        .invoke();

        // make sure axios was not invoked
        expect(mock.calls).toHaveLength(0);
        expect(result.status).toBe(201);
    });

    test("with request interceptor that manually resolves with unexpected status code", async () => {
        const mock = mockAxiosResponse({ status: 200 });

        try {
            await client.request({
                method: "GET",
                url: "http://localhost"
            })
            .use(context => {
                context.resolve({
                    status: 401,
                    data: {}
                });
            })
            .invoke()
            .then(() => fail());

            fail();
        }
        catch(err: any) {
            expect(err.code).toBe(RequestErrorCode.httpError);
            expect(err.response.status).toBe(401);
            // make sure axios was not invoked
            expect(mock.calls).toHaveLength(0);
        }
    });

    test("with request interceptor that manually rejects", async () => {
        mockAxiosResponse({ status: 200 });

        try {
            await client.request({
                method: "GET",
                url: "http://localhost"
            })
            .use(context => {
                context.reject(new RequestError({
                    code: RequestErrorCode.networkUnavailable,
                    message: "",
                    request: context.request
                }));
            })
            .invoke();

            fail();
        }
        catch(err: any) {
            expect(err.code).toBe(RequestErrorCode.networkUnavailable);
        }
    });

    test("with request interceptor that doesn't provide a new context", async () => {
        mockAxiosResponse({ status: 200 });

        const result = await client.request({
            method: "GET",
            url: "http://localhost"
        })
        .use(context => context.next())
        .use(context => context.next({
            ...context,
            request: context.request.withHeader("Test", "foo")
        }))
        .use(context => context.next())
        .invoke();

        expect(result.status).toBe(200);
        expect(result.request.options.headers).toBeDefined();
        expect(result.request.options.headers!["Test"]).toBe("foo");
    });

    test("with response interceptor", async () => {
        mockAxiosResponse({ status: 200 });

        let value = "";
        await client.request({
            method: "GET",
            url: "http://localhost"
        })
        .invoke()
        .thenUse(() => value = "hello");

        expect(value).toBe("hello");
    });

    test("with response interceptor added to request", async () => {
        mockAxiosResponse({ status: 200 });

        let value = "";
        const request = client.request({
            method: "GET",
            url: "http://localhost"
        })
        .withResponseInterceptor(() => value += "hello");

        await request.invoke();
        await request.invoke();

        // make sure the interceptor is invoked each time
        expect(value).toBe("hellohello");
    });

    test("with multiple response interceptors", async () => {
        mockAxiosResponse({ status: 200 });

        let value = "";
        await client.request({
            method: "GET",
            url: "http://localhost"
        })
        .invoke()
        .thenUse(() => value = value + "a")
        .thenUse(() => value = value + "b")
        .thenUse(() => value = value + "c");

        expect(value).toBe("abc");
    });

    test("with multiple response interceptors including an interceptor added to the request", async () => {
        mockAxiosResponse({ status: 200 });

        let value = "";
        await client.request({
            method: "GET",
            url: "http://localhost"
        })
        .withResponseInterceptor(() => value = value + "a")
        .withResponseInterceptor(() => value = value + "b")
        .invoke()
        .thenUse(() => value = value + "c");

        expect(value).toBe("abc");
    });

    test("with response interceptor that breaks interceptor chain", async () => {
        mockAxiosResponse({ status: 200 });

        let value = "";
        let final = "";

        await client.request({
            method: "GET",
            url: "http://localhost"
        })
        .invoke()
        .thenUse(() => value = value + "a")
        .thenUse(() => value = value + "b")
        // calling end skips the rest of the response interceptors
        .thenUse(context => context.end({
            ...context,
            response: {
                ...context.response!,
                data: value
            }
        }))
        .thenUse(() => value = value + "c")
        .then(response => final = response.data);

        expect(value).toBe("ab");
        expect(final).toBe("ab");
    });

    test("with response interceptor added to the request and breaks the interceptor chain", async () => {
        mockAxiosResponse({ status: 200 });

        let value = "";
        let final = "";

        await client.request({
            method: "GET",
            url: "http://localhost"
        })
        .withResponseInterceptor(() => value = value + "a")
        .withResponseInterceptor(() => value = value + "b")
        // calling end skips the rest of the response interceptors
        .withResponseInterceptor(context => context.end({
            ...context,
            response: {
                ...context.response!,
                data: value
            }
        }))
        .invoke()
        .thenUse(() => value = value + "c")
        .then(response => final = response.data);

        expect(value).toBe("ab");
        expect(final).toBe("ab");
    });

    test("with response interceptor that doesn't provide new context", async () => {
        mockAxiosResponse({ status: 200 });

        let value = "";
        let final = "";
        await client.request({
            method: "GET",
            url: "http://localhost"
        })
        .invoke()
        .thenUse(context => context.next())
        .thenUse(context => context.next())
        .thenUse(() => value = "1")
        .thenUse(context => context.next({
            ...context,
            response: {
                ...context.response!,
                data: value
            }
        }))
        .thenUse(context => context.end())
        .thenUse(() => value = value + "2")
        .then(response => final = response.data);

        expect(value).toBe("1");
        expect(final).toBe("1");
    });

    test("with basic authentication header interceptor", async () => {
        mockAxiosResponse({ status: 200 });

        const result = await client.request({
            method: "GET",
            url: "http://localhost"
        })
        .use(basicAuthentication("joe", "password"))
        .invoke();

        expect(result.request.options.headers).toBeDefined();
        expect(result.request.options.headers!["Authorization"]).toBeDefined();
        expect(result.request.options.headers!["Authorization"]!.startsWith("Basic ")).toBeTruthy();
    });

    test("invoke multiple times with request interceptors", async () => {
        mockAxiosResponse({ status: 200 });

        const request = client.request({
            method: "GET",
            url: "http://localhost"
        })
        .use(context => {
            context.next({
                ...context,
                request: context.request.withHeader("X-Span-ID", "1")
            });
        })
        .use(context => {
            context.next({
                ...context,
                request: context.request.withHeader("X-Trace-ID", "2")
            });
        });

        const result1 = await request.invoke();
        const result2 = await request.invoke();

        expect(result1.request.options.headers!["X-Span-ID"]).toBe("1");
        expect(result1.request.options.headers!["X-Trace-ID"]).toBe("2");

        expect(result2.request.options.headers!["X-Span-ID"]).toBe("1");
        expect(result2.request.options.headers!["X-Trace-ID"]).toBe("2");

        expect(result1.request.options.headers!["X-Request-ID"]).toBe(result2.request.options.headers!["X-Request-ID"]);
    });

    test("invoke multiple times with different response interceptors", async () => {
        mockAxiosResponse({ status: 200 });

        const request = client.request({
            method: "GET",
            url: "http://localhost"
        });

        let count1 = 0;
        let count2 = 0;

        await request.invoke().thenUse(context => {
            count1++;
            context.next();
        });

        await request.invoke().thenUse(context => {
            count2++;
            context.next();
        });

        expect(count1).toBe(1);
        expect(count2).toBe(1);
    });

    test("invoke request from response interceptor", async () => {
        mockAxiosResponse({ status: 200 });

        const request = client.request({
            method: "GET",
            url: "http://localhost"
        });

        let flag = false;
        let result = "";
        await request.invoke()
            .thenUse(context => {
                result += "a";
                context.next();
            })
            .thenUse(async context => {
                if (!flag) {
                    flag = true;
                    result += "b";
                    // invoking the request again should retain the response interceptors
                    await context.request.invoke();
                    context.next();
                }
                else {
                    context.end();
                }
            })
            .thenUse(context => {
                result += "c";
                context.next();
            });

        expect(result).toBe("abac");
    });

    test("invoke request from response interceptor added to the request", async () => {
        mockAxiosResponse({ status: 200 });

        const request = client.request({
            method: "GET",
            url: "http://localhost"
        });

        let flag = false;
        let result = "";

        await request
            .withResponseInterceptor(context => {
                result += "a";
                context.next();
            })
            .withResponseInterceptor(async context => {
                if (!flag) {
                    flag = true;
                    result += "b";
                    // invoking the request again should retain the response interceptors
                    await context.request.invoke();
                    context.next();
                }
                else {
                    context.end();
                }
            })
            .withResponseInterceptor(context => {
                result += "c";
                context.next();
            })
            .invoke();

        expect(result).toBe("abac");
    });
});

describe("stream", () => {
    test("with success status", async () => {
        mockEventSourceResponse();

        const result = await client.stream({
            method: "GET",
            url: "http://localhost"
        })
        .invoke();

        expect(result.status).toBe(200);
    });

    test("with header option", async () => {
        mockEventSourceResponse();

        const result = await client.stream({
            method: "GET",
            headers: { "Authorization": "Bearer token" },
            url: "http://localhost"
        })
        .invoke();

        expect(result.status).toBe(200);
        expect(result.request.options.headers).toBeDefined();
        expect(result.request.options.headers!["Authorization"]).toBeDefined();
        expect(result.request.options.headers!["Authorization"]).toBe("Bearer token");

        expect(result.data.options.headers).toBeDefined();
        expect(result.data.options.headers!["Authorization"]).toBeDefined();
        expect(result.data.options.headers!["Authorization"]).toBe("Bearer token");
    });

    test("with multiple headers added by request interceptors and fluent interface", async () => {
        mockEventSourceResponse();

        const result = await client.stream({
            method: "GET",
            url: "http://localhost"
        })
        .withHeader("Authorization", "Bearer token")
        .use(context => {
            context.next({
                ...context,
                request: context.request
                    .withHeader("X-Span-ID", "1")
                    .withHeader("X-Trace-ID", "2")
            });
        })
        .invoke();

        expect(result.status).toBe(200);
        expect(result.request.options.headers).toBeDefined();
        expect(result.request.options.headers!["Authorization"]).toBeDefined();
        expect(result.request.options.headers!["Authorization"]).toBe("Bearer token");
        expect(result.request.options.headers!["X-Span-ID"]).toBeDefined();
        expect(result.request.options.headers!["X-Span-ID"]).toBe("1");
        expect(result.request.options.headers!["X-Trace-ID"]).toBeDefined();
        expect(result.request.options.headers!["X-Trace-ID"]).toBe("2");

        expect(result.data.options.headers).toBeDefined();
        expect(result.data.options.headers!["Authorization"]).toBeDefined();
        expect(result.data.options.headers!["Authorization"]).toBe("Bearer token");
        expect(result.data.options.headers!["X-Span-ID"]).toBeDefined();
        expect(result.data.options.headers!["X-Span-ID"]).toBe("1");
        expect(result.data.options.headers!["X-Trace-ID"]).toBeDefined();
        expect(result.data.options.headers!["X-Trace-ID"]).toBe("2");
    });

    test("with multiple response interceptors", async () => {
        mockEventSourceResponse();

        let value = "";
        await client.stream({
            method: "GET",
            url: "http://localhost"
        })
        .invoke()
        .thenUse(() => value = value + "a")
        .thenUse(() => value = value + "b")
        .thenUse(() => value = value + "c");

        expect(value).toBe("abc");
    });

    test("with failed connection", async () => {
        mockEventSourceResponse({ status: 406 });

        let error: RequestError | undefined;
        await client.stream({
            method: "GET",
            url: "http://localhost"
        })
        .invoke()
        .catch(err => error = err);

        expect(error).toBeDefined();
        expect(error!.code).toBe(RequestErrorCode.httpError);
        expect(error!.response).toBeDefined();
        expect(error!.response!.status).toBe(406);
    });
});

repository: jjvainav/sprig

repo_name: jjvainav/sprig

gha_language: TypeScript

extension: ts


text:
// import Message from "./Message";
// export default class SequenceNumberMessage extends Message {
//   public number: any;
//   constructor(number = 0) {
//     super();
//     this.number = number;
//   }
// }