Skip to content

Commit

Permalink
Added basic Validation Rules
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidValin committed Oct 13, 2018
1 parent cab9d31 commit 35d49a9
Show file tree
Hide file tree
Showing 37 changed files with 3,983 additions and 114 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Build Status](https://travis-ci.org/howerest/sdkzer.svg?branch=master)](https://travis-ci.org/howerest/sdkzer)

# Full API docs
Current v0.6.4 - [Read full API docs](http://www.howerest.com/sdkzer/docs/0.6.4/classes/_howerest_sdkzer_.sdkzer.html)
Current v0.6.5 - [Read full API docs](http://www.howerest.com/sdkzer/docs/0.6.5/classes/_howerest_sdkzer_.sdkzer.html)

## Introduction ##
sdkzer implements a dev-friendly javascript API to interact with http services implemented as RESTful which implement CRUD operations: Create, Read, Update and Delete. You create entities that extend Sdkzer class and those will automatically be connected to your restful backend endpoints. A class like User will allow you to deal with your http://yourdomain.com/api/v1/users endpoint.
Expand Down
1 change: 0 additions & 1 deletion __test__/sdkzer_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,6 @@ describe('Sdkzer', () => {

test("should retrieve the attributes in xml format when 'xml' format is specified", () => {
let sdkzer = new Sdkzer(initialAttributes);
console.log('sdkzer.attrs', sdkzer.attrs);
spyOn(Sdkzer.prototype, "toOriginXML");
sdkzer.toOrigin('xml');
expect(sdkzer.toOriginXML).toHaveBeenCalled();
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sdkzer",
"version": "0.6.4",
"version": "0.6.5",
"description": "Implements a simple API to deal with RESTful web services (endpoints) from Javascript.",
"main": "dist/howerest.sdkzer.js",
"authors": [
Expand Down
440 changes: 440 additions & 0 deletions dist/doc/classes/allowedvalueswitchvalidator.html

Large diffs are not rendered by default.

440 changes: 440 additions & 0 deletions dist/doc/classes/emailvalidator.html

Large diffs are not rendered by default.

440 changes: 440 additions & 0 deletions dist/doc/classes/lengthvalidator.html

Large diffs are not rendered by default.

440 changes: 440 additions & 0 deletions dist/doc/classes/minmaxnumbervalidator.html

Large diffs are not rendered by default.

440 changes: 440 additions & 0 deletions dist/doc/classes/regexpvalidator.html

Large diffs are not rendered by default.

440 changes: 440 additions & 0 deletions dist/doc/classes/requiredvalidator.html

Large diffs are not rendered by default.

180 changes: 102 additions & 78 deletions dist/doc/classes/sdkzer.html

Large diffs are not rendered by default.

62 changes: 53 additions & 9 deletions dist/doc/classes/validationrule.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,26 @@ <h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<span class="target">ValidationRule</span>
<ul class="tsd-hierarchy">
<li>
<a href="requiredvalidator.html" class="tsd-signature-type">RequiredValidator</a>
</li>
<li>
<a href="regexpvalidator.html" class="tsd-signature-type">RegExpValidator</a>
</li>
<li>
<a href="minmaxnumbervalidator.html" class="tsd-signature-type">MinMaxNumberValidator</a>
</li>
<li>
<a href="lengthvalidator.html" class="tsd-signature-type">LengthValidator</a>
</li>
<li>
<a href="emailvalidator.html" class="tsd-signature-type">EmailValidator</a>
</li>
<li>
<a href="allowedvalueswitchvalidator.html" class="tsd-signature-type">AllowedValueSwitchValidator</a>
</li>
</ul>
</li>
</ul>
</section>
Expand Down Expand Up @@ -128,7 +148,7 @@ <h3>constructor</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/howerest/sdkzer/blob/e5b4d33/src/validation_rule.ts#L17">validation_rule.ts:17</a></li>
<li>Defined in <a href="https://github.com/howerest/sdkzer/blob/4f2e876/src/validation_rule.ts#L17">validation_rule.ts:17</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -150,7 +170,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> _invalid<wbr>Message</h
<div class="tsd-signature tsd-kind-icon">_invalid<wbr>Message<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> =&nbsp;&quot;Invalid&quot;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/howerest/sdkzer/blob/e5b4d33/src/validation_rule.ts#L17">validation_rule.ts:17</a></li>
<li>Defined in <a href="https://github.com/howerest/sdkzer/blob/4f2e876/src/validation_rule.ts#L17">validation_rule.ts:17</a></li>
</ul>
</aside>
</section>
Expand All @@ -160,7 +180,7 @@ <h3><span class="tsd-flag ts-flagProtected">Protected</span> conditions</h3>
<div class="tsd-signature tsd-kind-icon">conditions<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Array</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol"> =&nbsp;[]</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/howerest/sdkzer/blob/e5b4d33/src/validation_rule.ts#L13">validation_rule.ts:13</a></li>
<li>Defined in <a href="https://github.com/howerest/sdkzer/blob/4f2e876/src/validation_rule.ts#L13">validation_rule.ts:13</a></li>
</ul>
</aside>
</section>
Expand All @@ -170,7 +190,7 @@ <h3>from<wbr>Value</h3>
<div class="tsd-signature tsd-kind-icon">from<wbr>Value<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/howerest/sdkzer/blob/e5b4d33/src/validation_rule.ts#L14">validation_rule.ts:14</a></li>
<li>Defined in <a href="https://github.com/howerest/sdkzer/blob/4f2e876/src/validation_rule.ts#L14">validation_rule.ts:14</a></li>
</ul>
</aside>
</section>
Expand All @@ -181,7 +201,7 @@ <h3>params</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/ivalidationrule.html">IValidationRule</a>.<a href="../interfaces/ivalidationrule.html#params">params</a></p>
<ul>
<li>Defined in <a href="https://github.com/howerest/sdkzer/blob/e5b4d33/src/validation_rule.ts#L16">validation_rule.ts:16</a></li>
<li>Defined in <a href="https://github.com/howerest/sdkzer/blob/4f2e876/src/validation_rule.ts#L16">validation_rule.ts:16</a></li>
</ul>
</aside>
</section>
Expand All @@ -191,7 +211,7 @@ <h3>to<wbr>Value</h3>
<div class="tsd-signature tsd-kind-icon">to<wbr>Value<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/howerest/sdkzer/blob/e5b4d33/src/validation_rule.ts#L15">validation_rule.ts:15</a></li>
<li>Defined in <a href="https://github.com/howerest/sdkzer/blob/4f2e876/src/validation_rule.ts#L15">validation_rule.ts:15</a></li>
</ul>
</aside>
</section>
Expand All @@ -208,7 +228,7 @@ <h3>invalid<wbr>Message</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/howerest/sdkzer/blob/e5b4d33/src/validation_rule.ts#L27">validation_rule.ts:27</a></li>
<li>Defined in <a href="https://github.com/howerest/sdkzer/blob/4f2e876/src/validation_rule.ts#L27">validation_rule.ts:27</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -233,7 +253,7 @@ <h3>add<wbr>Invalid<wbr>Message</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/howerest/sdkzer/blob/e5b4d33/src/validation_rule.ts#L52">validation_rule.ts:52</a></li>
<li>Defined in <a href="https://github.com/howerest/sdkzer/blob/4f2e876/src/validation_rule.ts#L52">validation_rule.ts:52</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -262,7 +282,7 @@ <h3>is<wbr>Valid</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/ivalidationrule.html">IValidationRule</a>.<a href="../interfaces/ivalidationrule.html#isvalid">isValid</a></p>
<ul>
<li>Defined in <a href="https://github.com/howerest/sdkzer/blob/e5b4d33/src/validation_rule.ts#L34">validation_rule.ts:34</a></li>
<li>Defined in <a href="https://github.com/howerest/sdkzer/blob/4f2e876/src/validation_rule.ts#L34">validation_rule.ts:34</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -295,6 +315,24 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Boolean</
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
<li class=" tsd-kind-class tsd-is-external">
<a href="allowedvalueswitchvalidator.html" class="tsd-kind-icon">Allowed<wbr>Value<wbr>Switch<wbr>Validator</a>
</li>
<li class=" tsd-kind-class tsd-is-external">
<a href="emailvalidator.html" class="tsd-kind-icon">Email<wbr>Validator</a>
</li>
<li class=" tsd-kind-class tsd-is-external">
<a href="lengthvalidator.html" class="tsd-kind-icon">Length<wbr>Validator</a>
</li>
<li class=" tsd-kind-class tsd-is-external">
<a href="minmaxnumbervalidator.html" class="tsd-kind-icon">Min<wbr>Max<wbr>Number<wbr>Validator</a>
</li>
<li class=" tsd-kind-class tsd-is-external">
<a href="regexpvalidator.html" class="tsd-kind-icon">Reg<wbr>Exp<wbr>Validator</a>
</li>
<li class=" tsd-kind-class tsd-is-external">
<a href="requiredvalidator.html" class="tsd-kind-icon">Required<wbr>Validator</a>
</li>
<li class=" tsd-kind-class">
<a href="sdkzer.html" class="tsd-kind-icon">Sdkzer</a>
</li>
Expand Down Expand Up @@ -343,6 +381,12 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Boolean</
<li class=" tsd-kind-interface">
<a href="../interfaces/ivalidationrule.html" class="tsd-kind-icon">IValidation<wbr>Rule</a>
</li>
<li class=" tsd-kind-interface tsd-is-external tsd-is-not-exported">
<a href="../interfaces/lengthvalidatorparams.html" class="tsd-kind-icon">Length<wbr>Validator<wbr>Params</a>
</li>
<li class=" tsd-kind-interface tsd-is-external tsd-is-not-exported">
<a href="../interfaces/minmaxnumbervalidatorparams.html" class="tsd-kind-icon">Min<wbr>Max<wbr>Number<wbr>Validator<wbr>Params</a>
</li>
</ul>
</nav>
</div>
Expand Down
32 changes: 32 additions & 0 deletions dist/doc/globals.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ <h2>Index</h2>
<section class="tsd-index-section ">
<h3>Classes</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-class tsd-is-external"><a href="classes/allowedvalueswitchvalidator.html" class="tsd-kind-icon">Allowed<wbr>Value<wbr>Switch<wbr>Validator</a></li>
<li class="tsd-kind-class tsd-is-external"><a href="classes/emailvalidator.html" class="tsd-kind-icon">Email<wbr>Validator</a></li>
<li class="tsd-kind-class tsd-is-external"><a href="classes/lengthvalidator.html" class="tsd-kind-icon">Length<wbr>Validator</a></li>
<li class="tsd-kind-class tsd-is-external"><a href="classes/minmaxnumbervalidator.html" class="tsd-kind-icon">Min<wbr>Max<wbr>Number<wbr>Validator</a></li>
<li class="tsd-kind-class tsd-is-external"><a href="classes/regexpvalidator.html" class="tsd-kind-icon">Reg<wbr>Exp<wbr>Validator</a></li>
<li class="tsd-kind-class tsd-is-external"><a href="classes/requiredvalidator.html" class="tsd-kind-icon">Required<wbr>Validator</a></li>
<li class="tsd-kind-class"><a href="classes/sdkzer.html" class="tsd-kind-icon">Sdkzer</a></li>
<li class="tsd-kind-class"><a href="classes/validationrule.html" class="tsd-kind-icon">Validation<wbr>Rule</a></li>
</ul>
Expand All @@ -80,6 +86,8 @@ <h3>Interfaces</h3>
<li class="tsd-kind-interface"><a href="interfaces/ihttpqueryguessconfig.html" class="tsd-kind-icon">IHttp<wbr>Query<wbr>Guess<wbr>Config</a></li>
<li class="tsd-kind-interface"><a href="interfaces/isdkzerconfigoptions.html" class="tsd-kind-icon">ISdkzer<wbr>Config<wbr>Options</a></li>
<li class="tsd-kind-interface"><a href="interfaces/ivalidationrule.html" class="tsd-kind-icon">IValidation<wbr>Rule</a></li>
<li class="tsd-kind-interface tsd-is-external tsd-is-not-exported"><a href="interfaces/lengthvalidatorparams.html" class="tsd-kind-icon">Length<wbr>Validator<wbr>Params</a></li>
<li class="tsd-kind-interface tsd-is-external tsd-is-not-exported"><a href="interfaces/minmaxnumbervalidatorparams.html" class="tsd-kind-icon">Min<wbr>Max<wbr>Number<wbr>Validator<wbr>Params</a></li>
</ul>
</section>
</div>
Expand All @@ -96,6 +104,24 @@ <h3>Interfaces</h3>
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
<li class=" tsd-kind-class tsd-is-external">
<a href="classes/allowedvalueswitchvalidator.html" class="tsd-kind-icon">Allowed<wbr>Value<wbr>Switch<wbr>Validator</a>
</li>
<li class=" tsd-kind-class tsd-is-external">
<a href="classes/emailvalidator.html" class="tsd-kind-icon">Email<wbr>Validator</a>
</li>
<li class=" tsd-kind-class tsd-is-external">
<a href="classes/lengthvalidator.html" class="tsd-kind-icon">Length<wbr>Validator</a>
</li>
<li class=" tsd-kind-class tsd-is-external">
<a href="classes/minmaxnumbervalidator.html" class="tsd-kind-icon">Min<wbr>Max<wbr>Number<wbr>Validator</a>
</li>
<li class=" tsd-kind-class tsd-is-external">
<a href="classes/regexpvalidator.html" class="tsd-kind-icon">Reg<wbr>Exp<wbr>Validator</a>
</li>
<li class=" tsd-kind-class tsd-is-external">
<a href="classes/requiredvalidator.html" class="tsd-kind-icon">Required<wbr>Validator</a>
</li>
<li class=" tsd-kind-class">
<a href="classes/sdkzer.html" class="tsd-kind-icon">Sdkzer</a>
</li>
Expand All @@ -111,6 +137,12 @@ <h3>Interfaces</h3>
<li class=" tsd-kind-interface">
<a href="interfaces/ivalidationrule.html" class="tsd-kind-icon">IValidation<wbr>Rule</a>
</li>
<li class=" tsd-kind-interface tsd-is-external tsd-is-not-exported">
<a href="interfaces/lengthvalidatorparams.html" class="tsd-kind-icon">Length<wbr>Validator<wbr>Params</a>
</li>
<li class=" tsd-kind-interface tsd-is-external tsd-is-not-exported">
<a href="interfaces/minmaxnumbervalidatorparams.html" class="tsd-kind-icon">Min<wbr>Max<wbr>Number<wbr>Validator<wbr>Params</a>
</li>
</ul>
</nav>
</div>
Expand Down
26 changes: 25 additions & 1 deletion dist/doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ <h1> sdkzer</h1>
<h2 id="sdkzer">sdkzer</h2>
<p><a href="https://travis-ci.org/howerest/sdkzer"><img src="https://travis-ci.org/howerest/sdkzer.svg?branch=master" alt="Build Status"></a></p>
<h1 id="full-api-docs">Full API docs</h1>
<p>Current v0.6.4 - <a href="http://www.howerest.com/sdkzer/docs/0.6.4/classes/_howerest_sdkzer_.sdkzer.html">Read full API docs</a></p>
<p>Current v0.6.5 - <a href="http://www.howerest.com/sdkzer/docs/0.6.5/classes/_howerest_sdkzer_.sdkzer.html">Read full API docs</a></p>
<h2 id="introduction">Introduction</h2>
<p>sdkzer implements a dev-friendly javascript API to interact with http services implemented as RESTful which implement CRUD operations: Create, Read, Update and Delete. You create entities that extend Sdkzer class and those will automatically be connected to your restful backend endpoints. A class like User will allow you to deal with your <a href="http://yourdomain.com/api/v1/users">http://yourdomain.com/api/v1/users</a> endpoint.</p>
<p>If you have a RESTful (CRUD) http API, sdkzer will work out of the box allowing you to Create, Read, Update and Delete records from a javascript API that makes sense, along with multiple methods to deal with the record state.</p>
Expand Down Expand Up @@ -275,6 +275,24 @@ <h2 id="inspired-from">Inspired from</h2>
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
<li class=" tsd-kind-class tsd-is-external">
<a href="classes/allowedvalueswitchvalidator.html" class="tsd-kind-icon">Allowed<wbr>Value<wbr>Switch<wbr>Validator</a>
</li>
<li class=" tsd-kind-class tsd-is-external">
<a href="classes/emailvalidator.html" class="tsd-kind-icon">Email<wbr>Validator</a>
</li>
<li class=" tsd-kind-class tsd-is-external">
<a href="classes/lengthvalidator.html" class="tsd-kind-icon">Length<wbr>Validator</a>
</li>
<li class=" tsd-kind-class tsd-is-external">
<a href="classes/minmaxnumbervalidator.html" class="tsd-kind-icon">Min<wbr>Max<wbr>Number<wbr>Validator</a>
</li>
<li class=" tsd-kind-class tsd-is-external">
<a href="classes/regexpvalidator.html" class="tsd-kind-icon">Reg<wbr>Exp<wbr>Validator</a>
</li>
<li class=" tsd-kind-class tsd-is-external">
<a href="classes/requiredvalidator.html" class="tsd-kind-icon">Required<wbr>Validator</a>
</li>
<li class=" tsd-kind-class">
<a href="classes/sdkzer.html" class="tsd-kind-icon">Sdkzer</a>
</li>
Expand All @@ -290,6 +308,12 @@ <h2 id="inspired-from">Inspired from</h2>
<li class=" tsd-kind-interface">
<a href="interfaces/ivalidationrule.html" class="tsd-kind-icon">IValidation<wbr>Rule</a>
</li>
<li class=" tsd-kind-interface tsd-is-external tsd-is-not-exported">
<a href="interfaces/lengthvalidatorparams.html" class="tsd-kind-icon">Length<wbr>Validator<wbr>Params</a>
</li>
<li class=" tsd-kind-interface tsd-is-external tsd-is-not-exported">
<a href="interfaces/minmaxnumbervalidatorparams.html" class="tsd-kind-icon">Min<wbr>Max<wbr>Number<wbr>Validator<wbr>Params</a>
</li>
</ul>
</nav>
</div>
Expand Down
26 changes: 25 additions & 1 deletion dist/doc/interfaces/ihttpqueryguessconfig.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ <h3>restful</h3>
<div class="tsd-signature tsd-kind-icon">restful<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Object</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/howerest/sdkzer/blob/e5b4d33/src/howerest.sdkzer.ts#L584">howerest.sdkzer.ts:584</a></li>
<li>Defined in <a href="https://github.com/howerest/sdkzer/blob/4f2e876/src/howerest.sdkzer.ts#L585">howerest.sdkzer.ts:585</a></li>
</ul>
</aside>
</section>
Expand All @@ -111,6 +111,24 @@ <h3>restful</h3>
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
<li class=" tsd-kind-class tsd-is-external">
<a href="../classes/allowedvalueswitchvalidator.html" class="tsd-kind-icon">Allowed<wbr>Value<wbr>Switch<wbr>Validator</a>
</li>
<li class=" tsd-kind-class tsd-is-external">
<a href="../classes/emailvalidator.html" class="tsd-kind-icon">Email<wbr>Validator</a>
</li>
<li class=" tsd-kind-class tsd-is-external">
<a href="../classes/lengthvalidator.html" class="tsd-kind-icon">Length<wbr>Validator</a>
</li>
<li class=" tsd-kind-class tsd-is-external">
<a href="../classes/minmaxnumbervalidator.html" class="tsd-kind-icon">Min<wbr>Max<wbr>Number<wbr>Validator</a>
</li>
<li class=" tsd-kind-class tsd-is-external">
<a href="../classes/regexpvalidator.html" class="tsd-kind-icon">Reg<wbr>Exp<wbr>Validator</a>
</li>
<li class=" tsd-kind-class tsd-is-external">
<a href="../classes/requiredvalidator.html" class="tsd-kind-icon">Required<wbr>Validator</a>
</li>
<li class=" tsd-kind-class">
<a href="../classes/sdkzer.html" class="tsd-kind-icon">Sdkzer</a>
</li>
Expand All @@ -135,6 +153,12 @@ <h3>restful</h3>
<li class=" tsd-kind-interface">
<a href="ivalidationrule.html" class="tsd-kind-icon">IValidation<wbr>Rule</a>
</li>
<li class=" tsd-kind-interface tsd-is-external tsd-is-not-exported">
<a href="lengthvalidatorparams.html" class="tsd-kind-icon">Length<wbr>Validator<wbr>Params</a>
</li>
<li class=" tsd-kind-interface tsd-is-external tsd-is-not-exported">
<a href="minmaxnumbervalidatorparams.html" class="tsd-kind-icon">Min<wbr>Max<wbr>Number<wbr>Validator<wbr>Params</a>
</li>
</ul>
</nav>
</div>
Expand Down
Loading

0 comments on commit 35d49a9

Please sign in to comment.