From f8f17067d437cde8a6b9df730c4a0593b4e72b59 Mon Sep 17 00:00:00 2001 From: Harro van der Kroft Date: Tue, 23 Oct 2018 12:27:27 +0200 Subject: [PATCH 1/2] feat: added vscode workspace, added console.logs for pertinent errors, removed coverage --- core/coverage/base.css | 223 ---- core/coverage/block-navigation.js | 63 - core/coverage/index.html | 123 -- core/coverage/lcov.info | 1065 ----------------- core/coverage/prettify.css | 1 - core/coverage/prettify.js | 1 - core/coverage/sort-arrow-sprite.png | Bin 209 -> 0 bytes core/coverage/sorter.js | 158 --- core/coverage/src/index.html | 149 --- core/coverage/src/index.ts.html | 75 -- core/coverage/src/relations/index.html | 123 -- .../relations/relation-configuration.ts.html | 141 --- core/coverage/src/relations/to-many.ts.html | 342 ------ core/coverage/src/relations/to-one.ts.html | 300 ----- .../abstract-adapters.ts.html | 270 ----- .../abstract-builders.ts.html | 375 ------ .../request-handlers/default-adapters.ts.html | 105 -- .../request-handlers/default-builders.ts.html | 153 --- core/coverage/src/request-handlers/index.html | 136 --- core/coverage/src/resource.core.ts.html | 915 -------------- core/coverage/src/resource.decorators.ts.html | 588 --------- core/coverage/src/resource.module.ts.html | 402 ------- core/coverage/src/utils.ts.html | 663 ---------- core/package-lock.json | 2 +- json-api/src/builders.ts | 1 + ngx-api-orm.code-workspace | 7 + 26 files changed, 9 insertions(+), 6372 deletions(-) delete mode 100644 core/coverage/base.css delete mode 100644 core/coverage/block-navigation.js delete mode 100644 core/coverage/index.html delete mode 100644 core/coverage/lcov.info delete mode 100644 core/coverage/prettify.css delete mode 100644 core/coverage/prettify.js delete mode 100644 core/coverage/sort-arrow-sprite.png delete mode 100644 core/coverage/sorter.js delete mode 100644 core/coverage/src/index.html delete mode 100644 core/coverage/src/index.ts.html delete mode 100644 core/coverage/src/relations/index.html delete mode 100644 core/coverage/src/relations/relation-configuration.ts.html delete mode 100644 core/coverage/src/relations/to-many.ts.html delete mode 100644 core/coverage/src/relations/to-one.ts.html delete mode 100644 core/coverage/src/request-handlers/abstract-adapters.ts.html delete mode 100644 core/coverage/src/request-handlers/abstract-builders.ts.html delete mode 100644 core/coverage/src/request-handlers/default-adapters.ts.html delete mode 100644 core/coverage/src/request-handlers/default-builders.ts.html delete mode 100644 core/coverage/src/request-handlers/index.html delete mode 100644 core/coverage/src/resource.core.ts.html delete mode 100644 core/coverage/src/resource.decorators.ts.html delete mode 100644 core/coverage/src/resource.module.ts.html delete mode 100644 core/coverage/src/utils.ts.html create mode 100644 ngx-api-orm.code-workspace diff --git a/core/coverage/base.css b/core/coverage/base.css deleted file mode 100644 index 7090209..0000000 --- a/core/coverage/base.css +++ /dev/null @@ -1,223 +0,0 @@ -body, html { - margin:0; padding: 0; - height: 100%; -} -body { - font-family: Helvetica Neue, Helvetica, Arial; - font-size: 14px; - color:#333; -} -.small { font-size: 12px; } -*, *:after, *:before { - -webkit-box-sizing:border-box; - -moz-box-sizing:border-box; - box-sizing:border-box; - } -h1 { font-size: 20px; margin: 0;} -h2 { font-size: 14px; } -pre { - font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; - margin: 0; - padding: 0; - -moz-tab-size: 2; - -o-tab-size: 2; - tab-size: 2; -} -a { color:#0074D9; text-decoration:none; } -a:hover { text-decoration:underline; } -.strong { font-weight: bold; } -.space-top1 { padding: 10px 0 0 0; } -.pad2y { padding: 20px 0; } -.pad1y { padding: 10px 0; } -.pad2x { padding: 0 20px; } -.pad2 { padding: 20px; } -.pad1 { padding: 10px; } -.space-left2 { padding-left:55px; } -.space-right2 { padding-right:20px; } -.center { text-align:center; } -.clearfix { display:block; } -.clearfix:after { - content:''; - display:block; - height:0; - clear:both; - visibility:hidden; - } -.fl { float: left; } -@media only screen and (max-width:640px) { - .col3 { width:100%; max-width:100%; } - .hide-mobile { display:none!important; } -} - -.quiet { - color: #7f7f7f; - color: rgba(0,0,0,0.5); -} -.quiet a { opacity: 0.7; } - -.fraction { - font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; - font-size: 10px; - color: #555; - background: #E8E8E8; - padding: 4px 5px; - border-radius: 3px; - vertical-align: middle; -} - -div.path a:link, div.path a:visited { color: #333; } -table.coverage { - border-collapse: collapse; - margin: 10px 0 0 0; - padding: 0; -} - -table.coverage td { - margin: 0; - padding: 0; - vertical-align: top; -} -table.coverage td.line-count { - text-align: right; - padding: 0 5px 0 20px; -} -table.coverage td.line-coverage { - text-align: right; - padding-right: 10px; - min-width:20px; -} - -table.coverage td span.cline-any { - display: inline-block; - padding: 0 5px; - width: 100%; -} -.missing-if-branch { - display: inline-block; - margin-right: 5px; - border-radius: 3px; - position: relative; - padding: 0 4px; - background: #333; - color: yellow; -} - -.skip-if-branch { - display: none; - margin-right: 10px; - position: relative; - padding: 0 4px; - background: #ccc; - color: white; -} -.missing-if-branch .typ, .skip-if-branch .typ { - color: inherit !important; -} -.coverage-summary { - border-collapse: collapse; - width: 100%; -} -.coverage-summary tr { border-bottom: 1px solid #bbb; } -.keyline-all { border: 1px solid #ddd; } -.coverage-summary td, .coverage-summary th { padding: 10px; } -.coverage-summary tbody { border: 1px solid #bbb; } -.coverage-summary td { border-right: 1px solid #bbb; } -.coverage-summary td:last-child { border-right: none; } -.coverage-summary th { - text-align: left; - font-weight: normal; - white-space: nowrap; -} -.coverage-summary th.file { border-right: none !important; } -.coverage-summary th.pct { } -.coverage-summary th.pic, -.coverage-summary th.abs, -.coverage-summary td.pct, -.coverage-summary td.abs { text-align: right; } -.coverage-summary td.file { white-space: nowrap; } -.coverage-summary td.pic { min-width: 120px !important; } -.coverage-summary tfoot td { } - -.coverage-summary .sorter { - height: 10px; - width: 7px; - display: inline-block; - margin-left: 0.5em; - background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; -} -.coverage-summary .sorted .sorter { - background-position: 0 -20px; -} -.coverage-summary .sorted-desc .sorter { - background-position: 0 -10px; -} -.status-line { height: 10px; } -/* yellow */ -.cbranch-no { background: yellow !important; color: #111; } -/* dark red */ -.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } -.low .chart { border:1px solid #C21F39 } -.highlighted, -.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{ - background: #C21F39 !important; -} -/* medium red */ -.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } -/* light red */ -.low, .cline-no { background:#FCE1E5 } -/* light green */ -.high, .cline-yes { background:rgb(230,245,208) } -/* medium green */ -.cstat-yes { background:rgb(161,215,106) } -/* dark green */ -.status-line.high, .high .cover-fill { background:rgb(77,146,33) } -.high .chart { border:1px solid rgb(77,146,33) } - -.medium .chart { border:1px solid #666; } -.medium .cover-fill { background: #666; } - -.cstat-skip { background: #ddd; color: #111; } -.fstat-skip { background: #ddd; color: #111 !important; } -.cbranch-skip { background: #ddd !important; color: #111; } - -span.cline-neutral { background: #eaeaea; } -.medium { background: #eaeaea; } - -.coverage-summary td.empty { - opacity: .5; - padding-top: 4px; - padding-bottom: 4px; - line-height: 1; - color: #888; -} - -.cover-fill, .cover-empty { - display:inline-block; - height: 12px; -} -.chart { - line-height: 0; -} -.cover-empty { - background: white; -} -.cover-full { - border-right: none !important; -} -pre.prettyprint { - border: none !important; - padding: 0 !important; - margin: 0 !important; -} -.com { color: #999 !important; } -.ignore-none { color: #999; font-weight: normal; } - -.wrapper { - min-height: 100%; - height: auto !important; - height: 100%; - margin: 0 auto -48px; -} -.footer, .push { - height: 48px; -} diff --git a/core/coverage/block-navigation.js b/core/coverage/block-navigation.js deleted file mode 100644 index 0c71903..0000000 --- a/core/coverage/block-navigation.js +++ /dev/null @@ -1,63 +0,0 @@ -var jumpToCode = (function init () { - // Classes of code we would like to highlight - var missingCoverageClasses = [ '.cbranch-no', '.cstat-no', '.fstat-no' ]; - - // We don't want to select elements that are direct descendants of another match - var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > ` - - // Selecter that finds elements on the page to which we can jump - var selector = notSelector + missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b` - - // The NodeList of matching elements - var missingCoverageElements = document.querySelectorAll(selector); - - var currentIndex; - - function toggleClass(index) { - missingCoverageElements.item(currentIndex).classList.remove('highlighted'); - missingCoverageElements.item(index).classList.add('highlighted'); - } - - function makeCurrent(index) { - toggleClass(index); - currentIndex = index; - missingCoverageElements.item(index) - .scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'center' }); - } - - function goToPrevious() { - var nextIndex = 0; - if (typeof currentIndex !== 'number' || currentIndex === 0) { - nextIndex = missingCoverageElements.length - 1; - } else if (missingCoverageElements.length > 1) { - nextIndex = currentIndex - 1; - } - - makeCurrent(nextIndex); - } - - function goToNext() { - var nextIndex = 0; - - if (typeof currentIndex === 'number' && currentIndex < (missingCoverageElements.length - 1)) { - nextIndex = currentIndex + 1; - } - - makeCurrent(nextIndex); - } - - return function jump(event) { - switch (event.which) { - case 78: // n - case 74: // j - goToNext(); - break; - case 66: // b - case 75: // k - case 80: // p - goToPrevious(); - break; - } - }; -}()); -window.addEventListener('keydown', jumpToCode); diff --git a/core/coverage/index.html b/core/coverage/index.html deleted file mode 100644 index 34e0db3..0000000 --- a/core/coverage/index.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - Code coverage report for All files - - - - - - - -
-
-

- All files -

-
-
- 97.64% - Statements - 578/592 -
-
- 88.63% - Branches - 187/211 -
-
- 99.17% - Functions - 120/121 -
-
- 97.62% - Lines - 492/504 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
src
98.16%320/32688.07%96/109100%53/5397.98%291/297
src/relations
92.45%98/10681.82%36/4493.75%15/1693.33%84/90
src/request-handlers
100%160/16094.83%55/58100%52/52100%117/117
-
-
- - - - - - - - diff --git a/core/coverage/lcov.info b/core/coverage/lcov.info deleted file mode 100644 index 55063a3..0000000 --- a/core/coverage/lcov.info +++ /dev/null @@ -1,1065 +0,0 @@ -TN: -SF:/Users/Moeys/Code/ngx-api-orm/core/src/index.ts -FNF:0 -FNH:0 -DA:1,1 -LF:1 -LH:1 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/Moeys/Code/ngx-api-orm/core/src/resource.core.ts -FN:28,(anonymous_16) -FN:31,(anonymous_18) -FN:119,Resource -FN:46,(anonymous_20) -FN:54,(anonymous_21) -FN:65,(anonymous_22) -FN:67,(anonymous_23) -FN:79,(anonymous_24) -FN:80,(anonymous_25) -FN:88,(anonymous_26) -FN:102,(anonymous_29) -FN:104,(anonymous_30) -FN:170,(anonymous_31) -FN:177,(anonymous_32) -FN:190,(anonymous_35) -FN:202,(anonymous_38) -FN:209,(anonymous_41) -FN:213,(anonymous_42) -FN:215,(anonymous_43) -FN:229,(anonymous_44) -FN:231,(anonymous_45) -FN:247,(anonymous_46) -FN:255,(anonymous_47) -FN:266,(anonymous_48) -FNF:24 -FNH:24 -FNDA:1,(anonymous_16) -FNDA:1,(anonymous_18) -FNDA:168,Resource -FNDA:125,(anonymous_20) -FNDA:124,(anonymous_21) -FNDA:45,(anonymous_22) -FNDA:65,(anonymous_23) -FNDA:96,(anonymous_24) -FNDA:87,(anonymous_25) -FNDA:1,(anonymous_26) -FNDA:31,(anonymous_29) -FNDA:93,(anonymous_30) -FNDA:108,(anonymous_31) -FNDA:1,(anonymous_32) -FNDA:1,(anonymous_35) -FNDA:1,(anonymous_38) -FNDA:255,(anonymous_41) -FNDA:109,(anonymous_42) -FNDA:456,(anonymous_43) -FNDA:108,(anonymous_44) -FNDA:135,(anonymous_45) -FNDA:108,(anonymous_46) -FNDA:1,(anonymous_47) -FNDA:168,(anonymous_48) -DA:2,1 -DA:3,1 -DA:14,1 -DA:15,1 -DA:16,1 -DA:17,1 -DA:19,1 -DA:28,1 -DA:31,1 -DA:46,1 -DA:47,125 -DA:54,1 -DA:55,124 -DA:65,45 -DA:66,45 -DA:67,65 -DA:68,19 -DA:69,19 -DA:71,0 -DA:79,1 -DA:80,96 -DA:88,2 -DA:89,1 -DA:90,1 -DA:91,1 -DA:92,1 -DA:94,1 -DA:95,1 -DA:96,1 -DA:102,1 -DA:103,31 -DA:104,93 -DA:105,31 -DA:128,168 -DA:138,168 -DA:139,168 -DA:140,41 -DA:143,127 -DA:144,31 -DA:146,96 -DA:147,96 -DA:148,96 -DA:149,96 -DA:151,18 -DA:155,109 -DA:156,108 -DA:157,108 -DA:158,108 -DA:159,108 -DA:160,108 -DA:161,108 -DA:162,108 -DA:170,1 -DA:177,2 -DA:178,1 -DA:179,1 -DA:180,1 -DA:181,1 -DA:182,1 -DA:190,2 -DA:191,1 -DA:192,1 -DA:193,1 -DA:194,1 -DA:202,2 -DA:203,1 -DA:204,1 -DA:205,1 -DA:209,1 -DA:210,255 -DA:213,109 -DA:214,109 -DA:215,109 -DA:216,456 -DA:217,456 -DA:218,7 -DA:219,449 -DA:220,448 -DA:221,1 -DA:222,1 -DA:229,1 -DA:230,108 -DA:231,108 -DA:232,135 -DA:233,135 -DA:235,54 -DA:236,54 -DA:238,81 -DA:239,81 -DA:241,0 -DA:247,1 -DA:248,108 -DA:249,75 -DA:250,75 -DA:255,1 -DA:256,1 -DA:257,1 -DA:258,1 -DA:259,1 -DA:260,1 -DA:266,1 -DA:269,168 -DA:270,168 -DA:271,127 -DA:273,168 -DA:274,168 -DA:275,168 -DA:276,168 -DA:277,168 -DA:278,168 -DA:279,168 -DA:280,168 -DA:282,1 -LF:113 -LH:111 -BRDA:139,0,0,41 -BRDA:139,0,1,127 -BRDA:139,1,0,168 -BRDA:139,1,1,41 -BRDA:143,2,0,31 -BRDA:143,2,1,96 -BRDA:147,3,0,96 -BRDA:147,3,1,2 -BRDA:149,4,0,18 -BRDA:149,4,1,78 -BRDA:66,5,0,26 -BRDA:66,5,1,19 -BRDA:68,6,0,19 -BRDA:68,6,1,0 -BRDA:88,7,0,1 -BRDA:88,7,1,0 -BRDA:177,8,0,1 -BRDA:177,8,1,0 -BRDA:190,9,0,1 -BRDA:190,9,1,0 -BRDA:202,10,0,1 -BRDA:202,10,1,0 -BRDA:217,11,0,7 -BRDA:217,11,1,449 -BRDA:217,12,0,456 -BRDA:217,12,1,75 -BRDA:219,13,0,448 -BRDA:219,13,1,1 -BRDA:221,14,0,1 -BRDA:221,14,1,0 -BRDA:234,15,0,54 -BRDA:234,15,1,81 -BRDA:234,15,2,0 -BRDA:248,16,0,75 -BRDA:248,16,1,33 -BRDA:258,17,0,1 -BRDA:258,17,1,0 -BRDA:270,18,0,127 -BRDA:270,18,1,41 -BRF:39 -BRH:31 -end_of_record -TN: -SF:/Users/Moeys/Code/ngx-api-orm/core/src/resource.decorators.ts -FN:52,Model -FN:53,(anonymous_1) -FN:98,Field -FN:99,(anonymous_3) -FN:116,(anonymous_4) -FN:117,(anonymous_5) -FN:150,(anonymous_6) -FN:151,(anonymous_7) -FNF:8 -FNH:8 -FNDA:98,Model -FNDA:97,(anonymous_1) -FNDA:248,Field -FNDA:247,(anonymous_3) -FNDA:44,(anonymous_4) -FNDA:43,(anonymous_5) -FNDA:58,(anonymous_6) -FNDA:57,(anonymous_7) -DA:1,1 -DA:2,1 -DA:3,1 -DA:4,1 -DA:52,194 -DA:53,98 -DA:54,97 -DA:55,97 -DA:57,97 -DA:63,97 -DA:64,97 -DA:66,97 -DA:67,97 -DA:68,97 -DA:70,97 -DA:71,1 -DA:73,97 -DA:88,97 -DA:98,1 -DA:99,248 -DA:100,247 -DA:101,247 -DA:102,247 -DA:103,247 -DA:116,1 -DA:117,44 -DA:120,43 -DA:121,33 -DA:122,10 -DA:123,10 -DA:125,0 -DA:127,43 -DA:128,43 -DA:129,43 -DA:130,43 -DA:131,43 -DA:150,1 -DA:151,58 -DA:154,57 -DA:155,37 -DA:156,20 -DA:157,20 -DA:159,0 -DA:161,57 -DA:162,57 -DA:163,57 -DA:164,57 -DA:165,57 -LF:48 -LH:46 -BRDA:52,0,0,96 -BRDA:52,0,1,2 -BRDA:70,1,0,1 -BRDA:70,1,1,96 -BRDA:120,2,0,33 -BRDA:120,2,1,10 -BRDA:122,3,0,10 -BRDA:122,3,1,0 -BRDA:154,4,0,37 -BRDA:154,4,1,20 -BRDA:156,5,0,20 -BRDA:156,5,1,0 -BRF:12 -BRH:10 -end_of_record -TN: -SF:/Users/Moeys/Code/ngx-api-orm/core/src/resource.module.ts -FN:27,(anonymous_5) -FN:71,ResourceRootModule -FN:28,(anonymous_7) -FN:35,(anonymous_9) -FN:44,(anonymous_10) -FN:49,(anonymous_11) -FN:53,(anonymous_12) -FN:77,(anonymous_13) -FN:78,(anonymous_15) -FNF:9 -FNH:9 -FNDA:1,(anonymous_5) -FNDA:21,ResourceRootModule -FNDA:13,(anonymous_7) -FNDA:130,(anonymous_9) -FNDA:130,(anonymous_10) -FNDA:130,(anonymous_11) -FNDA:204,(anonymous_12) -FNDA:1,(anonymous_13) -FNDA:21,(anonymous_15) -DA:2,1 -DA:3,1 -DA:4,1 -DA:5,1 -DA:6,1 -DA:7,1 -DA:8,1 -DA:9,1 -DA:19,1 -DA:20,1 -DA:21,1 -DA:22,1 -DA:27,1 -DA:28,13 -DA:29,13 -DA:30,13 -DA:31,0 -DA:33,130 -DA:34,130 -DA:35,130 -DA:36,130 -DA:37,130 -DA:38,130 -DA:44,1 -DA:45,130 -DA:46,57 -DA:49,1 -DA:50,130 -DA:51,130 -DA:52,130 -DA:53,130 -DA:54,204 -DA:55,204 -DA:56,110 -DA:59,130 -DA:60,110 -DA:61,20 -DA:62,0 -DA:72,21 -DA:74,1 -DA:77,1 -DA:78,42 -DA:79,21 -DA:80,21 -DA:85,1 -DA:88,1 -DA:89,1 -DA:90,1 -DA:91,1 -DA:92,1 -DA:93,1 -DA:94,1 -DA:95,1 -DA:96,1 -DA:97,1 -DA:98,1 -DA:99,1 -DA:100,1 -DA:101,1 -DA:102,1 -DA:103,1 -DA:104,1 -DA:105,1 -DA:107,1 -DA:108,1 -DA:109,1 -LF:66 -LH:64 -BRDA:30,0,0,0 -BRDA:30,0,1,13 -BRDA:45,1,0,57 -BRDA:45,1,1,73 -BRDA:55,2,0,110 -BRDA:55,2,1,94 -BRDA:59,3,0,110 -BRDA:59,3,1,20 -BRDA:61,4,0,0 -BRDA:61,4,1,20 -BRDA:78,5,0,21 -BRDA:78,5,1,0 -BRDA:82,6,0,21 -BRDA:82,6,1,21 -BRF:14 -BRH:11 -end_of_record -TN: -SF:/Users/Moeys/Code/ngx-api-orm/core/src/utils.ts -FN:13,getPluralAndSingularNames -FN:52,toDash -FN:56,(anonymous_7) -FN:65,getDependencyInjectionEntries -FN:81,(anonymous_9) -FN:90,initMetaData -FN:108,updateInterceptProxyFactory -FN:111,(anonymous_12) -FN:124,readOnlyArrayProxyFactory -FN:127,(anonymous_14) -FN:149,(anonymous_15) -FN:153,(anonymous_17) -FNF:12 -FNH:12 -FNDA:129,getPluralAndSingularNames -FNDA:218,toDash -FNDA:200,(anonymous_7) -FNDA:128,getDependencyInjectionEntries -FNDA:1,(anonymous_9) -FNDA:444,initMetaData -FNDA:108,updateInterceptProxyFactory -FNDA:175,(anonymous_12) -FNDA:125,readOnlyArrayProxyFactory -FNDA:478,(anonymous_14) -FNDA:1,(anonymous_15) -FNDA:1,(anonymous_17) -DA:7,1 -DA:10,1 -DA:11,1 -DA:13,1 -DA:19,129 -DA:20,8 -DA:23,121 -DA:24,2 -DA:26,119 -DA:27,4 -DA:30,115 -DA:31,4 -DA:39,111 -DA:40,2 -DA:41,2 -DA:42,109 -DA:43,8 -DA:44,8 -DA:46,101 -DA:47,101 -DA:49,111 -DA:52,1 -DA:53,218 -DA:54,218 -DA:55,218 -DA:56,218 -DA:57,200 -DA:62,1 -DA:65,1 -DA:66,128 -DA:67,101 -DA:68,101 -DA:69,101 -DA:78,27 -DA:81,1 -DA:82,1 -DA:83,1 -DA:84,1 -DA:85,1 -DA:86,1 -DA:90,1 -DA:91,444 -DA:92,102 -DA:94,444 -DA:95,102 -DA:97,444 -DA:98,102 -DA:100,444 -DA:101,102 -DA:108,1 -DA:109,108 -DA:110,108 -DA:112,175 -DA:113,34 -DA:114,34 -DA:115,34 -DA:117,175 -DA:118,175 -DA:124,1 -DA:125,125 -DA:126,125 -DA:128,478 -DA:129,4 -DA:131,474 -DA:136,1 -DA:149,1 -DA:151,1 -DA:153,1 -DA:158,1 -LF:69 -LH:69 -BRDA:19,0,0,8 -BRDA:19,0,1,121 -BRDA:19,1,0,129 -BRDA:19,1,1,6 -BRDA:19,1,2,127 -BRDA:19,1,3,123 -BRDA:23,2,0,2 -BRDA:23,2,1,119 -BRDA:23,3,0,121 -BRDA:23,3,1,14 -BRDA:23,3,2,2 -BRDA:26,4,0,4 -BRDA:26,4,1,115 -BRDA:26,5,0,119 -BRDA:26,5,1,12 -BRDA:30,6,0,4 -BRDA:30,6,1,111 -BRDA:30,7,0,115 -BRDA:30,7,1,107 -BRDA:30,7,2,107 -BRDA:39,8,0,2 -BRDA:39,8,1,109 -BRDA:39,9,0,111 -BRDA:39,9,1,2 -BRDA:42,10,0,8 -BRDA:42,10,1,101 -BRDA:66,11,0,101 -BRDA:66,11,1,27 -BRDA:81,12,0,1 -BRDA:81,12,1,1 -BRDA:91,13,0,102 -BRDA:91,13,1,342 -BRDA:94,14,0,102 -BRDA:94,14,1,342 -BRDA:97,15,0,102 -BRDA:97,15,1,342 -BRDA:100,16,0,102 -BRDA:100,16,1,342 -BRDA:112,17,0,34 -BRDA:112,17,1,141 -BRDA:115,18,0,34 -BRDA:115,18,1,34 -BRDA:128,19,0,4 -BRDA:128,19,1,474 -BRF:44 -BRH:44 -end_of_record -TN: -SF:/Users/Moeys/Code/ngx-api-orm/core/src/relations/relation-configuration.ts -FN:5,(anonymous_0) -FN:13,(anonymous_1) -FN:15,RelationConfiguration -FNF:3 -FNH:3 -FNDA:1,(anonymous_0) -FNDA:1,(anonymous_1) -FNDA:100,RelationConfiguration -DA:5,1 -DA:6,1 -DA:7,1 -DA:8,1 -DA:13,1 -DA:16,100 -DA:17,100 -DA:18,100 -DA:19,100 -DA:20,100 -DA:24,1 -LF:11 -LH:11 -BRDA:5,0,0,1 -BRDA:5,0,1,1 -BRF:2 -BRH:2 -end_of_record -TN: -SF:/Users/Moeys/Code/ngx-api-orm/core/src/relations/to-many.ts -FN:9,(anonymous_19) -FN:10,ToManyRelation -FN:52,(anonymous_21) -FN:69,(anonymous_24) -FN:73,(anonymous_27) -FN:82,(anonymous_28) -FN:26,(anonymous_29) -FN:31,(anonymous_30) -FNF:8 -FNH:8 -FNDA:1,(anonymous_19) -FNDA:81,ToManyRelation -FNDA:1,(anonymous_21) -FNDA:1,(anonymous_24) -FNDA:1,(anonymous_27) -FNDA:1,(anonymous_28) -FNDA:32,(anonymous_29) -FNDA:32,(anonymous_30) -DA:3,1 -DA:6,1 -DA:9,1 -DA:11,81 -DA:12,81 -DA:13,81 -DA:14,81 -DA:16,81 -DA:17,81 -DA:18,81 -DA:19,18 -DA:21,81 -DA:22,81 -DA:25,17 -DA:26,32 -DA:28,17 -DA:30,17 -DA:31,13 -DA:32,32 -DA:33,32 -DA:34,4 -DA:36,28 -DA:41,17 -DA:52,81 -DA:53,1 -DA:54,1 -DA:56,1 -DA:57,0 -DA:59,1 -DA:60,1 -DA:61,1 -DA:69,81 -DA:70,1 -DA:71,1 -DA:73,1 -DA:74,0 -DA:76,1 -DA:77,1 -DA:78,1 -DA:82,81 -DA:83,1 -DA:84,1 -DA:85,1 -DA:86,1 -DA:91,1 -LF:45 -LH:43 -BRDA:16,0,0,81 -BRDA:16,0,1,0 -BRDA:52,1,0,1 -BRDA:52,1,1,0 -BRDA:56,2,0,0 -BRDA:56,2,1,1 -BRDA:69,3,0,1 -BRDA:69,3,1,0 -BRDA:73,4,0,0 -BRDA:73,4,1,1 -BRDA:84,5,0,1 -BRDA:84,5,1,0 -BRDA:18,6,0,18 -BRDA:18,6,1,63 -BRDA:18,7,0,81 -BRDA:18,7,1,35 -BRDA:22,8,0,64 -BRDA:22,8,1,17 -BRDA:25,9,0,13 -BRDA:25,9,1,4 -BRDA:30,10,0,13 -BRDA:30,10,1,4 -BRDA:33,11,0,4 -BRDA:33,11,1,28 -BRF:24 -BRH:18 -end_of_record -TN: -SF:/Users/Moeys/Code/ngx-api-orm/core/src/relations/to-one.ts -FN:7,(anonymous_12) -FN:10,ToOneRelation -FN:41,(anonymous_14) -FN:55,(anonymous_17) -FN:70,(anonymous_20) -FNF:5 -FNH:4 -FNDA:1,(anonymous_12) -FNDA:54,ToOneRelation -FNDA:0,(anonymous_14) -FNDA:1,(anonymous_17) -FNDA:1,(anonymous_20) -DA:3,1 -DA:7,1 -DA:11,54 -DA:12,54 -DA:13,54 -DA:14,54 -DA:16,54 -DA:19,54 -DA:20,11 -DA:21,11 -DA:24,54 -DA:25,54 -DA:26,11 -DA:27,11 -DA:28,1 -DA:30,10 -DA:41,1 -DA:42,0 -DA:43,0 -DA:45,0 -DA:55,2 -DA:56,0 -DA:57,1 -DA:58,1 -DA:59,1 -DA:60,1 -DA:61,1 -DA:70,2 -DA:71,1 -DA:72,1 -DA:73,1 -DA:74,1 -DA:75,1 -DA:77,1 -LF:34 -LH:30 -BRDA:16,0,0,54 -BRDA:16,0,1,39 -BRDA:19,1,0,11 -BRDA:19,1,1,43 -BRDA:19,2,0,54 -BRDA:19,2,1,28 -BRDA:24,3,0,39 -BRDA:24,3,1,15 -BRDA:25,4,0,11 -BRDA:25,4,1,43 -BRDA:25,5,0,54 -BRDA:25,5,1,11 -BRDA:27,6,0,1 -BRDA:27,6,1,10 -BRDA:55,7,0,1 -BRDA:55,7,1,0 -BRDA:70,8,0,1 -BRDA:70,8,1,0 -BRF:18 -BRH:16 -end_of_record -TN: -SF:/Users/Moeys/Code/ngx-api-orm/core/src/request-handlers/abstract-adapters.ts -FN:9,(anonymous_0) -FN:10,(anonymous_1) -FN:11,(anonymous_3) -FN:14,(anonymous_4) -FN:17,(anonymous_5) -FN:20,(anonymous_6) -FN:28,(anonymous_7) -FN:31,(anonymous_8) -FN:40,(anonymous_9) -FN:45,(anonymous_10) -FN:55,(anonymous_11) -FN:56,(anonymous_13) -FN:59,(anonymous_14) -FN:61,(anonymous_15) -FN:62,(anonymous_17) -FN:65,(anonymous_18) -FNF:16 -FNH:16 -FNDA:1,(anonymous_0) -FNDA:13,(anonymous_1) -FNDA:2,(anonymous_3) -FNDA:2,(anonymous_4) -FNDA:3,(anonymous_5) -FNDA:15,(anonymous_6) -FNDA:14,(anonymous_7) -FNDA:67,(anonymous_8) -FNDA:6,(anonymous_9) -FNDA:151,(anonymous_10) -FNDA:13,(anonymous_11) -FNDA:2,(anonymous_13) -FNDA:2,(anonymous_14) -FNDA:13,(anonymous_15) -FNDA:2,(anonymous_17) -FNDA:2,(anonymous_18) -DA:1,1 -DA:2,1 -DA:9,1 -DA:10,1 -DA:11,1 -DA:12,2 -DA:14,1 -DA:15,2 -DA:17,1 -DA:18,3 -DA:20,1 -DA:21,15 -DA:22,15 -DA:23,5 -DA:25,10 -DA:28,21 -DA:29,14 -DA:30,14 -DA:31,14 -DA:32,67 -DA:33,4 -DA:34,63 -DA:35,6 -DA:36,6 -DA:37,57 -DA:38,9 -DA:39,9 -DA:40,9 -DA:42,48 -DA:45,14 -DA:46,151 -DA:47,151 -DA:48,12 -DA:49,12 -DA:52,14 -DA:54,1 -DA:55,1 -DA:56,1 -DA:57,2 -DA:59,1 -DA:60,1 -DA:61,1 -DA:62,1 -DA:63,2 -DA:65,1 -DA:66,1 -LF:46 -LH:46 -BRDA:22,0,0,5 -BRDA:22,0,1,10 -BRDA:28,1,0,7 -BRDA:28,1,1,7 -BRDA:32,2,0,4 -BRDA:32,2,1,63 -BRDA:32,3,0,67 -BRDA:32,3,1,20 -BRDA:34,4,0,6 -BRDA:34,4,1,57 -BRDA:36,5,0,5 -BRDA:36,5,1,1 -BRDA:37,6,0,9 -BRDA:37,6,1,48 -BRDA:47,7,0,12 -BRDA:47,7,1,139 -BRDA:9,8,0,1 -BRDA:9,8,1,1 -BRF:18 -BRH:18 -end_of_record -TN: -SF:/Users/Moeys/Code/ngx-api-orm/core/src/request-handlers/abstract-builders.ts -FN:4,(anonymous_5) -FN:5,(anonymous_6) -FN:6,BaseBuilder -FN:8,(anonymous_8) -FN:17,(anonymous_9) -FN:18,SimpleBuilder -FN:21,(anonymous_11) -FN:27,(anonymous_12) -FN:31,(anonymous_13) -FN:35,(anonymous_14) -FN:37,(anonymous_15) -FN:39,(anonymous_16) -FN:41,(anonymous_17) -FN:44,(anonymous_18) -FN:45,ToOneBuilder -FN:48,(anonymous_20) -FN:52,(anonymous_21) -FN:60,(anonymous_22) -FN:62,(anonymous_23) -FN:70,(anonymous_24) -FN:73,(anonymous_25) -FN:74,ToManyBuilder -FN:77,(anonymous_27) -FN:81,(anonymous_28) -FN:89,(anonymous_29) -FN:91,(anonymous_30) -FN:99,(anonymous_31) -FNF:27 -FNH:27 -FNDA:1,(anonymous_5) -FNDA:1,(anonymous_6) -FNDA:63,BaseBuilder -FNDA:18,(anonymous_8) -FNDA:1,(anonymous_9) -FNDA:21,SimpleBuilder -FNDA:8,(anonymous_11) -FNDA:4,(anonymous_12) -FNDA:2,(anonymous_13) -FNDA:2,(anonymous_14) -FNDA:1,(anonymous_15) -FNDA:2,(anonymous_16) -FNDA:1,(anonymous_17) -FNDA:1,(anonymous_18) -FNDA:21,ToOneBuilder -FNDA:4,(anonymous_20) -FNDA:2,(anonymous_21) -FNDA:1,(anonymous_22) -FNDA:2,(anonymous_23) -FNDA:1,(anonymous_24) -FNDA:1,(anonymous_25) -FNDA:21,ToManyBuilder -FNDA:4,(anonymous_27) -FNDA:2,(anonymous_28) -FNDA:1,(anonymous_29) -FNDA:2,(anonymous_30) -FNDA:1,(anonymous_31) -DA:1,1 -DA:4,1 -DA:5,1 -DA:6,63 -DA:8,1 -DA:9,18 -DA:10,18 -DA:11,9 -DA:13,18 -DA:15,1 -DA:17,1 -DA:18,21 -DA:19,21 -DA:21,1 -DA:22,8 -DA:23,8 -DA:24,8 -DA:27,1 -DA:28,4 -DA:29,4 -DA:31,1 -DA:32,2 -DA:33,2 -DA:35,1 -DA:36,2 -DA:37,2 -DA:39,1 -DA:40,2 -DA:41,2 -DA:43,1 -DA:44,1 -DA:45,21 -DA:46,21 -DA:48,1 -DA:49,4 -DA:50,4 -DA:52,1 -DA:59,2 -DA:60,2 -DA:62,1 -DA:69,2 -DA:70,2 -DA:72,1 -DA:73,1 -DA:74,21 -DA:75,21 -DA:77,1 -DA:78,4 -DA:79,4 -DA:81,1 -DA:88,2 -DA:89,2 -DA:91,1 -DA:98,2 -DA:99,2 -DA:101,1 -LF:56 -LH:56 -BRDA:10,0,0,9 -BRDA:10,0,1,9 -BRDA:19,1,0,21 -BRDA:19,1,1,21 -BRDA:22,2,0,8 -BRDA:22,2,1,8 -BRDA:23,3,0,4 -BRDA:23,3,1,4 -BRDA:28,4,0,4 -BRDA:28,4,1,2 -BRDA:32,5,0,2 -BRDA:32,5,1,2 -BRDA:36,6,0,2 -BRDA:36,6,1,2 -BRDA:40,7,0,2 -BRDA:40,7,1,2 -BRDA:46,8,0,21 -BRDA:46,8,1,21 -BRDA:49,9,0,4 -BRDA:49,9,1,4 -BRDA:59,10,0,2 -BRDA:59,10,1,2 -BRDA:69,11,0,2 -BRDA:69,11,1,2 -BRDA:75,12,0,21 -BRDA:75,12,1,21 -BRDA:78,13,0,4 -BRDA:78,13,1,4 -BRDA:88,14,0,2 -BRDA:88,14,1,2 -BRDA:98,15,0,2 -BRDA:98,15,1,2 -BRDA:4,16,0,1 -BRDA:4,16,1,1 -BRF:34 -BRH:34 -end_of_record -TN: -SF:/Users/Moeys/Code/ngx-api-orm/core/src/request-handlers/default-adapters.ts -FN:6,(anonymous_6) -FN:9,(anonymous_8) -FN:12,(anonymous_10) -FNF:3 -FNH:3 -FNDA:13,(anonymous_6) -FNDA:13,(anonymous_8) -FNDA:13,(anonymous_10) -DA:1,1 -DA:2,1 -DA:6,1 -DA:9,1 -DA:12,1 -LF:5 -LH:5 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/Moeys/Code/ngx-api-orm/core/src/request-handlers/default-builders.ts -FN:9,(anonymous_7) -FN:10,SimpleBuilder -FN:16,(anonymous_9) -FN:17,ToOneBuilder -FN:23,(anonymous_11) -FN:24,ToManyBuilder -FNF:6 -FNH:6 -FNDA:1,(anonymous_7) -FNDA:21,SimpleBuilder -FNDA:1,(anonymous_9) -FNDA:21,ToOneBuilder -FNDA:1,(anonymous_11) -FNDA:21,ToManyBuilder -DA:1,1 -DA:2,1 -DA:3,1 -DA:5,1 -DA:9,1 -DA:13,1 -DA:16,1 -DA:20,1 -DA:23,1 -DA:27,1 -LF:10 -LH:10 -BRDA:11,0,0,21 -BRDA:11,0,1,0 -BRDA:18,1,0,21 -BRDA:18,1,1,0 -BRDA:25,2,0,21 -BRDA:25,2,1,0 -BRF:6 -BRH:3 -end_of_record diff --git a/core/coverage/prettify.css b/core/coverage/prettify.css deleted file mode 100644 index b317a7c..0000000 --- a/core/coverage/prettify.css +++ /dev/null @@ -1 +0,0 @@ -.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/core/coverage/prettify.js b/core/coverage/prettify.js deleted file mode 100644 index ef51e03..0000000 --- a/core/coverage/prettify.js +++ /dev/null @@ -1 +0,0 @@ -window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/core/coverage/sort-arrow-sprite.png b/core/coverage/sort-arrow-sprite.png deleted file mode 100644 index 03f704a609c6fd0dbfdac63466a7d7c958b5cbf3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^>_9Bd!3HEZxJ@+%Qj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS>Jii$m5978H@?Fn+^JD|Y9yzj{W`447Gxa{7*dM7nnnD-Lb z6^}Hx2)'; - } - } - return cols; - } - // attaches a data attribute to every tr element with an object - // of data values keyed by column name - function loadRowData(tableRow) { - var tableCols = tableRow.querySelectorAll('td'), - colNode, - col, - data = {}, - i, - val; - for (i = 0; i < tableCols.length; i += 1) { - colNode = tableCols[i]; - col = cols[i]; - val = colNode.getAttribute('data-value'); - if (col.type === 'number') { - val = Number(val); - } - data[col.key] = val; - } - return data; - } - // loads all row data - function loadData() { - var rows = getTableBody().querySelectorAll('tr'), - i; - - for (i = 0; i < rows.length; i += 1) { - rows[i].data = loadRowData(rows[i]); - } - } - // sorts the table using the data for the ith column - function sortByIndex(index, desc) { - var key = cols[index].key, - sorter = function (a, b) { - a = a.data[key]; - b = b.data[key]; - return a < b ? -1 : a > b ? 1 : 0; - }, - finalSorter = sorter, - tableBody = document.querySelector('.coverage-summary tbody'), - rowNodes = tableBody.querySelectorAll('tr'), - rows = [], - i; - - if (desc) { - finalSorter = function (a, b) { - return -1 * sorter(a, b); - }; - } - - for (i = 0; i < rowNodes.length; i += 1) { - rows.push(rowNodes[i]); - tableBody.removeChild(rowNodes[i]); - } - - rows.sort(finalSorter); - - for (i = 0; i < rows.length; i += 1) { - tableBody.appendChild(rows[i]); - } - } - // removes sort indicators for current column being sorted - function removeSortIndicators() { - var col = getNthColumn(currentSort.index), - cls = col.className; - - cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); - col.className = cls; - } - // adds sort indicators for current column being sorted - function addSortIndicators() { - getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted'; - } - // adds event listeners for all sorter widgets - function enableUI() { - var i, - el, - ithSorter = function ithSorter(i) { - var col = cols[i]; - - return function () { - var desc = col.defaultDescSort; - - if (currentSort.index === i) { - desc = !currentSort.desc; - } - sortByIndex(i, desc); - removeSortIndicators(); - currentSort.index = i; - currentSort.desc = desc; - addSortIndicators(); - }; - }; - for (i =0 ; i < cols.length; i += 1) { - if (cols[i].sortable) { - // add the click event handler on the th so users - // dont have to click on those tiny arrows - el = getNthColumn(i).querySelector('.sorter').parentElement; - if (el.addEventListener) { - el.addEventListener('click', ithSorter(i)); - } else { - el.attachEvent('onclick', ithSorter(i)); - } - } - } - } - // adds sorting functionality to the UI - return function () { - if (!getTable()) { - return; - } - cols = loadColumns(); - loadData(cols); - addSortIndicators(); - enableUI(); - }; -})(); - -window.addEventListener('load', addSorting); diff --git a/core/coverage/src/index.html b/core/coverage/src/index.html deleted file mode 100644 index 83d11a2..0000000 --- a/core/coverage/src/index.html +++ /dev/null @@ -1,149 +0,0 @@ - - - - Code coverage report for src - - - - - - - -
-
-

- All files src -

-
-
- 98.16% - Statements - 320/326 -
-
- 88.07% - Branches - 96/109 -
-
- 100% - Functions - 53/53 -
-
- 97.98% - Lines - 291/297 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
index.ts
100%1/1100%0/0100%0/0100%1/1
resource.core.ts
98.46%128/13079.49%31/39100%24/2498.23%111/113
resource.decorators.ts
95.92%47/4983.33%10/12100%8/895.83%46/48
resource.module.ts
97.3%72/7478.57%11/14100%9/996.97%64/66
utils.ts
100%72/72100%44/44100%12/12100%69/69
-
-
- - - - - - - - diff --git a/core/coverage/src/index.ts.html b/core/coverage/src/index.ts.html deleted file mode 100644 index 6d0c77d..0000000 --- a/core/coverage/src/index.ts.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - Code coverage report for src/index.ts - - - - - - - -
-
-

- All files / src index.ts -

-
-
- 100% - Statements - 1/1 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 1/1 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
-
1 -2 -31x -  - 
export * from './resource.module';
- 
- 
-
-
- - - - - - - - diff --git a/core/coverage/src/relations/index.html b/core/coverage/src/relations/index.html deleted file mode 100644 index 6679418..0000000 --- a/core/coverage/src/relations/index.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - Code coverage report for src/relations - - - - - - - -
-
-

- All files src/relations -

-
-
- 92.45% - Statements - 98/106 -
-
- 81.82% - Branches - 36/44 -
-
- 93.75% - Functions - 15/16 -
-
- 93.33% - Lines - 84/90 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
relation-configuration.ts
100%12/12100%2/2100%3/3100%11/11
to-many.ts
96.23%51/5375%18/24100%8/895.56%43/45
to-one.ts
85.37%35/4188.89%16/1880%4/588.24%30/34
-
-
- - - - - - - - diff --git a/core/coverage/src/relations/relation-configuration.ts.html b/core/coverage/src/relations/relation-configuration.ts.html deleted file mode 100644 index ee125a5..0000000 --- a/core/coverage/src/relations/relation-configuration.ts.html +++ /dev/null @@ -1,141 +0,0 @@ - - - - Code coverage report for src/relations/relation-configuration.ts - - - - - - - -
-
-

- All files / src/relations relation-configuration.ts -

-
-
- 100% - Statements - 12/12 -
-
- 100% - Branches - 2/2 -
-
- 100% - Functions - 3/3 -
-
- 100% - Lines - 11/11 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25  -  -  -  -1x -1x -1x -1x -  -  -  -  -1x -  -  -100x -100x -100x -100x -100x -  -  -  -1x - 
import { Resource } from '../resource.core';
-import { ResourceType } from '../utils';
- 
-/** @internal */
-export enum RelationType {
-	ToOne = 'toOne',
-	ToMany = 'toMany',
-	None = 'none'
-}
- 
-// @dynamic
-/** @internal */
-export class RelationConfiguration<THost extends Resource, TRelated extends Resource> {
-	public circular: RelationConfiguration<TRelated, THost> | undefined;
-	constructor(
-		public readonly HostResource: ResourceType<THost>,
-		public readonly keyOnInstance: any,
-		public readonly type: RelationType,
-		public RelatedResource: ResourceType<TRelated>,
-		public readonly relatedResourceString?: string,
-	) {
- 
-	}
-}
- 
-
-
- - - - - - - - diff --git a/core/coverage/src/relations/to-many.ts.html b/core/coverage/src/relations/to-many.ts.html deleted file mode 100644 index ca6b7eb..0000000 --- a/core/coverage/src/relations/to-many.ts.html +++ /dev/null @@ -1,342 +0,0 @@ - - - - Code coverage report for src/relations/to-many.ts - - - - - - - -
-
-

- All files / src/relations to-many.ts -

-
-
- 96.23% - Statements - 51/53 -
-
- 75% - Branches - 18/24 -
-
- 100% - Functions - 8/8 -
-
- 95.56% - Lines - 43/45 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92  -  -1x -  -  -1x -  -  -1x -  -81x -81x -81x -81x -  -81x -81x -81x -18x -  -81x -81x -  -  -17x -32x -  -17x -  -17x -13x -32x -32x -4x -  -28x -  -  -  -  -17x -  -  -  -  -  -  -  -  -  -  -81x -1x -1x -  -1x -  -  -1x -1x -1x -  -  -  -  -  -  -  -81x -1x -1x -  -1x -  -  -1x -1x -1x -  -  -  -81x -1x -1x -1x -1x -  -  -  -  -1x - 
import { RelationConfiguration } from './relation-configuration';
-import { Resource } from '../resource.core';
-import { METAKEYS, HttpClientOptions } from '../utils';
-import { ToManyBuilder } from '../request-handlers/default-builders';
-import { ToManyAdapter } from '../request-handlers/default-adapters';
-import { ToOneRelation } from './to-one';
- 
-// @dynamic
-export class ToManyRelation<THost extends Resource, TRelated extends Resource> extends Array<TRelated> {
-	constructor(
-		private readonly _hostInstance: THost,
-		private readonly _configuration: RelationConfiguration<THost, TRelated>,
-		private readonly _adapter: ToManyAdapter,
-		private readonly _builder: ToManyBuilder
-	) {
-		super();
-		let rawObjects: Array<{}> | null = _hostInstance[_configuration.keyOnInstance];
-		if (rawObjects != null && !rawObjects.length) {
-			rawObjects = null;
-		}
-		const backPointingConfig = _configuration.circular;
-		if (rawObjects == null) {
-			return;
-		}
-		if (backPointingConfig) {
-			rawObjects.forEach(ro => (ro[backPointingConfig.keyOnInstance] = null));
-		}
-		const instances = Array.prototype.concat.apply([], [<TRelated[]>_configuration.RelatedResource.factory(rawObjects)]);
- 
-		if (backPointingConfig) {
-			instances.forEach((i: TRelated) => {
-				const relatedInstance = i[backPointingConfig.keyOnInstance];
-				if (relatedInstance instanceof ToOneRelation) {
-					relatedInstance.instance = _hostInstance;
-				} else {
-					relatedInstance.push(_hostInstance);
-				}
-			});
-		}
- 
-		this.push(...instances);
-	}
-	// TODO: IMPLEMENT FETCH (LAZY GETTING OF RELATIONS)
-	// TODO: IMPLEMENT SET (LAZY SYNC OF CHANGES: COMPLETE REPLACE)
- 
-	/*tslint:disable semicolon*/
-	/**
-	 * Runs the add pipeline of your model for a related resource using the To-Many request adapter and builder.
-	 * @param  TRelated relatedInstance
-	 * @param  any={} options
-	 */
-	public add = async (relatedInstance: TRelated, Eoptions: HttpClientOptions = {}): Promise<void> => {
-		const hostName = Reflect.getMetadata(METAKEYS.PLURAL, this._configuration.HostResource);
-		const relatedName = Reflect.getMetadata(METAKEYS.PLURAL, this._configuration.RelatedResource);
- 
-		Iif (!(relatedInstance instanceof this._configuration.RelatedResource)) {
-			throw new TypeError('parameter relatedInstance must be of type ' + relatedName);
-		}
-		const body = this._adapter.add(relatedInstance, this._hostInstance);
-		await this._builder.add(relatedName, hostName, body, this._hostInstance, options);
-		this.push(relatedInstance);
-	};
- 
-	/**
-	 * Runs the delete pipeline of your model for a related resource using the To-Many request adapter and builder.
-	 * @param  TRelated relatedInstance
-	 * @param  any={} options
-	 */
-	public remove = async (relatedInstance: TRelated, Eoptions: HttpClientOptions = {}) => {
-		const hostName = Reflect.getMetadata(METAKEYS.PLURAL, this._configuration.HostResource);
-		const relatedName = Reflect.getMetadata(METAKEYS.PLURAL, this._configuration.RelatedResource);
- 
-		Iif (this.findIndex(ri => ri.id === relatedInstance.id) === -1) {
-			throw new RangeError('parameter relatedInstance not included in this RelatedResourceCollection');
-		}
-		const body = this._adapter.remove(relatedInstance, this._hostInstance);
-		await this._builder.remove(relatedName, hostName, body, this._hostInstance, options);
-		this._removeInstance(relatedInstance);
-	};
- 
-	/** @internal */
-	private _removeInstance = (relatedInstance: TRelated) => {
-		for (let n = 0; n < this.length; n++) {
-			Eif (this[n].id === relatedInstance.id) {
-				this.splice(n, 1);
-				break;
-			}
-		}
-	};
-	/*tslint:enable semicolon*/
-}
- 
-
-
- - - - - - - - diff --git a/core/coverage/src/relations/to-one.ts.html b/core/coverage/src/relations/to-one.ts.html deleted file mode 100644 index 0732c75..0000000 --- a/core/coverage/src/relations/to-one.ts.html +++ /dev/null @@ -1,300 +0,0 @@ - - - - Code coverage report for src/relations/to-one.ts - - - - - - - -
-
-

- All files / src/relations to-one.ts -

-
-
- 85.37% - Statements - 35/41 -
-
- 88.89% - Branches - 16/18 -
-
- 80% - Functions - 4/5 -
-
- 88.24% - Lines - 30/34 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78  -  -1x -  -  -  -1x -  -  -  -54x -54x -54x -54x -  -54x -  -  -54x -11x -11x -  -  -54x -54x -11x -11x -1x -  -10x -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -2x -  -1x -1x -1x -1x -1x -  -  -  -  -  -  -  -  -2x -1x -1x -1x -1x -1x -  -1x - 
import { RelationConfiguration } from './relation-configuration';
-import { Resource } from '../resource.core';
-import { METAKEYS, HttpClientOptions } from '../utils';
-import { ToOneBuilder } from '../request-handlers/default-builders';
-import { ToOneAdapter } from '../request-handlers/default-adapters';
- 
-export class ToOneRelation<THost extends Resource, TRelated extends Resource> {
-	/** The references to the related instance */
-	public instance: TRelated | null;
-	constructor(
-		private readonly _hostInstance: THost,
-		private readonly _configuration: RelationConfiguration<THost, TRelated>,
-		private readonly _adapter: ToOneAdapter,
-		private readonly _builder: ToOneBuilder
-	) {
-		const rawObject: {} = _hostInstance[_configuration.keyOnInstance] || null;
- 
-		let backPointingConfig: RelationConfiguration<TRelated, THost> | undefined;
-		if (_configuration.circular && rawObject != null) {
-			backPointingConfig = _configuration.circular;
-			rawObject[backPointingConfig.keyOnInstance] = null;
-		}
- 
-		this.instance = rawObject === null ? null : _configuration.RelatedResource.factory(rawObject);
-		if (backPointingConfig && this.instance) {
-			const relationWrapper = this.instance[backPointingConfig.keyOnInstance];
-			if (relationWrapper instanceof ToOneRelation) {
-				relationWrapper.instance = _hostInstance;
-			} else {
-				relationWrapper.push(_hostInstance);
-			}
-		}
-	}
- 
-	// TODO: IMPLEMENT FETCH (LAZY GETTING OF RELATIONS)
- 
-	/**
-	 * Synchronize the model without using explicitly using `set` or `add`. This way it is possible to update a relation using e.g. DOM interactions without making premature requests.
-	 * @returns Promise<void>
-	 */
-	public async sync(): Promise<void> {
-		if (this.instance === null) {
-			await this.remove();
-		} else {
-			await this.set(this.instance);
-		}
-	}
- 
-	/**
-	 * Runs the delete pipeline of your model for a related resource using the To-One request adapter and builder.
-	 * @param  TRelated targetInstance
-	 * @param  HttpClientOptions={} options
-	 * @returns Promise
-	 */
-	public async remove(Eoptions: HttpClientOptions = {}): Promise<void> {
-		if (this.instance) {
-			const hostName = Reflect.getMetadata(METAKEYS.PLURAL, this._configuration.HostResource);
-			const relatedName = Reflect.getMetadata(METAKEYS.SINGULAR, this._configuration.RelatedResource);
-			const body = this._adapter.remove(this.instance, this._hostInstance);
-			await this._builder.remove(relatedName, hostName, body, this._hostInstance, options);
-			this.instance = null;
-		}
-	}
-	/**
-	 * Runs the add pipeline of your model for a related resource using the To-One request adapter and builder.
-	 * @param  TRelated targetInstance
-	 * @param  HttpClientOptions={} options
-	 * @returns Promise
-	 */
-	public async set(targetInstance: TRelated, Eoptions: HttpClientOptions = {}): Promise<void> {
-		const hostName = Reflect.getMetadata(METAKEYS.PLURAL, this._configuration.HostResource);
-		const relatedName = Reflect.getMetadata(METAKEYS.SINGULAR, this._configuration.RelatedResource);
-		const body = this._adapter.add(targetInstance, this._hostInstance);
-		await this._builder.add(relatedName, hostName, body, this._hostInstance, options);
-		this.instance = targetInstance;
-	}
-}
- 
-
-
- - - - - - - - diff --git a/core/coverage/src/request-handlers/abstract-adapters.ts.html b/core/coverage/src/request-handlers/abstract-adapters.ts.html deleted file mode 100644 index 610b59b..0000000 --- a/core/coverage/src/request-handlers/abstract-adapters.ts.html +++ /dev/null @@ -1,270 +0,0 @@ - - - - Code coverage report for src/request-handlers/abstract-adapters.ts - - - - - - - -
-
-

- All files / src/request-handlers abstract-adapters.ts -

-
-
- 100% - Statements - 52/52 -
-
- 100% - Branches - 18/18 -
-
- 100% - Functions - 16/16 -
-
- 100% - Lines - 46/46 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -681x -1x -  -  -  -  -  -  -1x -1x -1x -2x -  -1x -2x -  -1x -3x -  -1x -15x -15x -5x -  -10x -  -  -21x -14x -14x -14x -67x -4x -63x -6x -6x -57x -9x -9x -9x -  -48x -  -  -14x -151x -151x -12x -12x -  -  -14x -  -1x -1x -1x -2x -  -1x -1x -1x -1x -2x -  -1x -1x -  - 
import { METAKEYS } from '../utils';
-import { ToOneRelation } from '../relations/to-one';
-import { ToManyRelation } from '../relations/to-many';
- 
-/**
- * request adapters convert incoming bodies and outgoing bodies.
- * They do not touch options (headers and stuff).
- */
-export namespace Abstract {
-	export abstract class SimpleAdapter {
-		public save(instance: any) {
-			return this.convertOutgoing(instance);
-		}
-		public update(instance: any, affectedFields: { [field: string]: string | undefined | null }) {
-			return this.convertOutgoing(instance);
-		}
-		public parseIncoming(rawInstances: Object): Object[] {
-			return <Object[]>rawInstances;
-		}
-		private getBackPointingKey(instance: any) {
-			const circular = instance._configuration.circular;
-			if (circular) {
-				return circular.keyOnInstance;
-			} else {
-				return '';
-			}
-		}
-		protected convertOutgoing(instance: any, skipRelationKey = ''): any {
-			const rv = {};
-			const fields = Reflect.getMetadata(METAKEYS.FIELDS, instance.constructor);
-			fields.forEach((f: string) => {
-				if (skipRelationKey !== '' && f === skipRelationKey) {
-					rv[f] = null;
-				} else if (instance[f] instanceof ToOneRelation) {
-					const backPointingKey = this.getBackPointingKey(instance[f]);
-					rv[f] = instance[f].instance === null ? null : this.convertOutgoing(instance[f].instance, backPointingKey);
-				} else if (instance[f] instanceof Array) {
-					const backPointingKey = this.getBackPointingKey(instance[f]);
-					rv[f] = [];
-					instance[f].forEach((i: any) => rv[f].push(this.convertOutgoing(i, backPointingKey)));
-				} else {
-					rv[f] = instance[f];
-				}
-			});
-			Reflect.ownKeys(instance).forEach(property => {
-				const map = Reflect.getMetadata(METAKEYS.MAP, instance.constructor, <string>property);
-				if (map) {
-					rv[map] = rv[property];
-					delete rv[property];
-				}
-			});
-			return rv;
-		}
-	}
-	export abstract class ToOneAdapter {
-		public add(targetInstance: any, relatedInstance: any): any {
-			return { id: targetInstance.id };
-		}
-		public remove(targetInstance: any, relatedInstance: any): any {}
-	}
-	export abstract class ToManyAdapter {
-		public add(targetInstance: any, relatedInstance: any): any {
-			return { id: targetInstance.id };
-		}
-		public remove(targetInstance: any, relatedInstance: any): any {}
-	}
-}
- 
-
-
- - - - - - - - diff --git a/core/coverage/src/request-handlers/abstract-builders.ts.html b/core/coverage/src/request-handlers/abstract-builders.ts.html deleted file mode 100644 index 34332f5..0000000 --- a/core/coverage/src/request-handlers/abstract-builders.ts.html +++ /dev/null @@ -1,375 +0,0 @@ - - - - Code coverage report for src/request-handlers/abstract-builders.ts - - - - - - - -
-
-

- All files / src/request-handlers abstract-builders.ts -

-
-
- 100% - Statements - 72/72 -
-
- 100% - Branches - 34/34 -
-
- 100% - Functions - 27/27 -
-
- 100% - Lines - 56/56 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -1031x -  -  -1x -1x -63x -  -1x -18x -18x -9x -  -18x -  -1x -  -1x -21x -21x -  -1x -8x -8x -8x -  -  -1x -4x -4x -  -1x -2x -2x -  -1x -2x -2x -  -1x -2x -2x -  -1x -1x -21x -21x -  -1x -4x -4x -  -1x -  -  -  -  -  -  -2x -2x -  -1x -  -  -  -  -  -  -2x -2x -  -1x -1x -21x -21x -  -1x -4x -4x -  -1x -  -  -  -  -  -  -2x -2x -  -1x -  -  -  -  -  -  -2x -2x -  -1x -  - 
import { ResourceModuleConfiguration, HttpClientOptions, HttpVerb } from '../utils';
-import { HttpClient } from '@angular/common/http';
- 
-export namespace Abstract {
-	export abstract class BaseBuilder {
-		constructor(protected readonly _http: HttpClient) {}
- 
-		public request(method: HttpVerb, path: string, options: HttpClientOptions, body?: any): Promise<Object> {
-			delete options.url;
-			if (body) {
-				options.body = body;
-			}
-			return this._http.request(method, path, options).toPromise();
-		}
-	}
- 
-	export abstract class SimpleBuilder extends BaseBuilder {
-		constructor(protected readonly _http: HttpClient, protected readonly config: ResourceModuleConfiguration) {
-			super(_http);
-		}
-		protected buildUrl(targetNamePlural: string, targetInstance?: any): string {
-			let path = (this.config.rootPath || '') + `/${targetNamePlural}/$targetId`;
-			path = path.replace('/$targetId', targetInstance ? `/${targetInstance.id}` : '');
-			return path;
-		}
- 
-		public fetch(targetNamePlural: string, options: HttpClientOptions): Promise<Object> {
-			const path = options.url || this.buildUrl(targetNamePlural);
-			return <Promise<Object[]>>this.request(HttpVerb.GET, path, options);
-		}
-		public save(targetNamePlural: string, body: any, options: HttpClientOptions): Promise<Object> {
-			const path = options.url || this.buildUrl(targetNamePlural);
-			return this.request(HttpVerb.POST, path, options, body);
-		}
-		public update(targetNamePlural: string, body: any, options: HttpClientOptions): Promise<any> {
-			const path = options.url || this.buildUrl(targetNamePlural, body);
-			return this.request(HttpVerb.PATCH, path, options, body).then(() => Promise.resolve());
-		}
-		public delete(targetNamePlural: string, instance: any, options: HttpClientOptions): Promise<any> {
-			const path = options.url || this.buildUrl(targetNamePlural, instance);
-			return this.request(HttpVerb.DELETE, path, options).then(() => Promise.resolve());
-		}
-	}
-	export abstract class ToOneBuilder extends BaseBuilder {
-		constructor(protected readonly _http: HttpClient, protected readonly config: ResourceModuleConfiguration) {
-			super(_http);
-		}
-		protected buildUrl(targetNameSingular: string, relatedNamePlural: string, relatedInstance: any): string {
-			const path = (this.config.rootPath || '') + `/${relatedNamePlural}/${relatedInstance.id}/${targetNameSingular}`;
-			return path;
-		}
-		public add(
-			targetNameSingular: string,
-			relatedNamePlural: string,
-			body: any,
-			relatedInstance: any,
-			options: HttpClientOptions
-		): Promise<void> {
-			const path = options.url || this.buildUrl(targetNameSingular, relatedNamePlural, relatedInstance);
-			return this.request(HttpVerb.PATCH, path, options, body).then(() => Promise.resolve());
-		}
-		public remove(
-			targetNameSingular: string,
-			relatedNamePlural: string,
-			body: any,
-			relatedInstance: any,
-			options: HttpClientOptions
-		): Promise<void> {
-			const path = options.url || this.buildUrl(targetNameSingular, relatedNamePlural, relatedInstance);
-			return this.request(HttpVerb.DELETE, path, options).then(() => Promise.resolve());
-		}
-	}
-	export abstract class ToManyBuilder extends BaseBuilder {
-		constructor(protected readonly _http: HttpClient, protected readonly config: ResourceModuleConfiguration) {
-			super(_http);
-		}
-		protected buildUrl(targetNamePlural: string, relatedNamePlural: string, relatedInstance: any): string {
-			const path = (this.config.rootPath || '') + `/${relatedNamePlural}/${relatedInstance.id}/${targetNamePlural}`;
-			return path;
-		}
-		public add(
-			targetNamePlural: string,
-			relatedNamePlural: string,
-			body: any,
-			relatedInstance: any,
-			options: HttpClientOptions
-		): Promise<void> {
-			const path = options.url || this.buildUrl(targetNamePlural, relatedNamePlural, relatedInstance);
-			return this.request(HttpVerb.POST, path, options, body).then(() => Promise.resolve());
-		}
-		public remove(
-			targetNamePlural: string,
-			relatedNamePlural: string,
-			body: any,
-			relatedInstance: any,
-			options: HttpClientOptions
-		): Promise<void> {
-			const path = options.url || this.buildUrl(targetNamePlural, relatedNamePlural, relatedInstance);
-			return this.request(HttpVerb.DELETE, path, options, body).then(() => Promise.resolve());
-		}
-	}
-}
- 
-
-
- - - - - - - - diff --git a/core/coverage/src/request-handlers/default-adapters.ts.html b/core/coverage/src/request-handlers/default-adapters.ts.html deleted file mode 100644 index decd9c3..0000000 --- a/core/coverage/src/request-handlers/default-adapters.ts.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - Code coverage report for src/request-handlers/default-adapters.ts - - - - - - - -
-
-

- All files / src/request-handlers default-adapters.ts -

-
-
- 100% - Statements - 17/17 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 3/3 -
-
- 100% - Lines - 5/5 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -131x -1x -  -  -  -1x -  -  -1x -  -  -1x - 
import { Injectable } from '@angular/core';
-import { Abstract } from './abstract-adapters';
- 
-	/** @internal */
-@Injectable({ providedIn: 'root' })
-export class SimpleAdapter extends Abstract.SimpleAdapter {}
-	/** @internal */
-@Injectable({ providedIn: 'root' })
-export class ToOneAdapter extends Abstract.ToOneAdapter {}
-	/** @internal */
-@Injectable({ providedIn: 'root' })
-export class ToManyAdapter extends Abstract.ToManyAdapter {}
- 
-
-
- - - - - - - - diff --git a/core/coverage/src/request-handlers/default-builders.ts.html b/core/coverage/src/request-handlers/default-builders.ts.html deleted file mode 100644 index dba3659..0000000 --- a/core/coverage/src/request-handlers/default-builders.ts.html +++ /dev/null @@ -1,153 +0,0 @@ - - - - Code coverage report for src/request-handlers/default-builders.ts - - - - - - - -
-
-

- All files / src/request-handlers default-builders.ts -

-
-
- 100% - Statements - 19/19 -
-
- 50% - Branches - 3/6 -
-
- 100% - Functions - 6/6 -
-
- 100% - Lines - 10/10 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -291x -1x -1x -  -1x -  -  -  -1x -  -  -  -1x -  -  -1x -  -  -  -1x -  -  -1x -  -  -  -1x -  - 
import { Injectable } from '@angular/core';
-import { ResourceModuleConfiguration } from '../utils';
-import { HttpClient } from '@angular/common/http';
- 
-import { Abstract } from './abstract-builders';
- 
-/** @internal */
-@Injectable({ providedIn: 'root' })
-export class SimpleBuilder extends Abstract.SimpleBuilder {
-	constructor(_http: HttpClient, _config: ResourceModuleConfiguration) {
-		super(_http, _config);
-	}
-}
-/** @internal */
-@Injectable({ providedIn: 'root' })
-export class ToOneBuilder extends Abstract.ToOneBuilder {
-	constructor(_http: HttpClient, _config: ResourceModuleConfiguration) {
-		super(_http, _config);
-	}
-}
-/** @internal */
-@Injectable({ providedIn: 'root' })
-export class ToManyBuilder extends Abstract.ToManyBuilder {
-	constructor(_http: HttpClient, _config: ResourceModuleConfiguration) {
-		super(_http, _config);
-	}
-}
- 
- 
-
-
- - - - - - - - diff --git a/core/coverage/src/request-handlers/index.html b/core/coverage/src/request-handlers/index.html deleted file mode 100644 index f10ed9e..0000000 --- a/core/coverage/src/request-handlers/index.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - Code coverage report for src/request-handlers - - - - - - - -
-
-

- All files src/request-handlers -

-
-
- 100% - Statements - 160/160 -
-
- 94.83% - Branches - 55/58 -
-
- 100% - Functions - 52/52 -
-
- 100% - Lines - 117/117 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
abstract-adapters.ts
100%52/52100%18/18100%16/16100%46/46
abstract-builders.ts
100%72/72100%34/34100%27/27100%56/56
default-adapters.ts
100%17/17100%0/0100%3/3100%5/5
default-builders.ts
100%19/1950%3/6100%6/6100%10/10
-
-
- - - - - - - - diff --git a/core/coverage/src/resource.core.ts.html b/core/coverage/src/resource.core.ts.html deleted file mode 100644 index cc2d113..0000000 --- a/core/coverage/src/resource.core.ts.html +++ /dev/null @@ -1,915 +0,0 @@ - - - - Code coverage report for src/resource.core.ts - - - - - - - -
-
-

- All files / src resource.core.ts -

-
-
- 98.46% - Statements - 128/130 -
-
- 79.49% - Branches - 31/39 -
-
- 100% - Functions - 24/24 -
-
- 98.23% - Lines - 111/113 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283  -1x -1x -  -  -  -  -  -  -  -  -  -  -1x -1x -1x -1x -  -1x -  -  -  -  -  -  -  -  -1x -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -125x -  -  -  -  -  -  -1x -124x -  -  -  -  -  -  -  -  -  -45x -45x -65x -19x -19x -  -  -  -  -  -  -  -  -  -1x -96x -  -  -  -  -  -  -  -2x -1x -1x -1x -1x -  -1x -1x -1x -  -  -  -  -  -1x -31x -93x -31x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -168x -  -  -  -  -  -  -  -  -  -168x -168x -41x -  -  -127x -31x -  -96x -96x -96x -96x -  -18x -  -  -  -109x -108x -108x -108x -108x -108x -108x -108x -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -2x -1x -1x -1x -1x -1x -  -  -  -  -  -  -  -2x -1x -1x -1x -1x -  -  -  -  -  -  -  -2x -1x -1x -1x -  -  -  -1x -255x -  -  -109x -109x -109x -456x -456x -7x -449x -448x -1x -1x -  -  -  -  -  -  -1x -108x -108x -135x -135x -  -54x -54x -  -81x -81x -  -  -  -  -  -  -  -1x -108x -75x -75x -  -  -  -  -1x -1x -1x -1x -1x -1x -  -  -  -  -  -1x -  -  -168x -168x -127x -  -168x -168x -168x -168x -168x -168x -168x -168x -  -1x - 
/*tslint:disable:max-line-length*/
-import { Optional } from '@angular/core';
-import {
-	getDependencyInjectionEntries,
-	METAKEYS,
-	updateInterceptProxyFactory,
-	readOnlyArrayProxyFactory,
-	ResourceType,
-	HttpClientOptions,
-	RequestHandlers,
-	UnresolvedRequestHandlers,
-	RawInstanceTemplate
-} from './utils';
-import { ToManyRelation } from './relations/to-many';
-import { RelationType } from './relations/relation-configuration';
-import { ToOneRelation } from './relations/to-one';
-import { ToManyBuilder, ToOneBuilder, SimpleBuilder } from './request-handlers/default-builders';
- 
-import { ToManyAdapter, ToOneAdapter, SimpleAdapter } from './request-handlers/default-adapters';
- 
-/** A dummy class required to allow for an optional argument in the constructor of your model while keeping it compatible with Angular's dependency injection.
- *
- * There is no need to use this type anywhere explicitly.
- *
- * On the other hand, the type {@link RawInstanceTemplate<T>} might come in handy when instantiating instances of your model from plain objects, e.g. when using the [factory method]{@link Resource#factory}.
- *
- */
-export class RawInstance {}
- 
-// @dynamic
-export class Resource {
-	private _adapter: SimpleAdapter;
-	private _builder: SimpleBuilder;
-	private _toOneAdapter: ToOneAdapter;
-	private _toOneBuilder: ToOneBuilder;
-	private _toManyAdapter: ToManyAdapter;
-	private _toManyBuilder: ToManyBuilder;
- 
-	/** Primary key for your model. */
-	public id: string | number;
- 
-	/**
-	 * Used internally for {@link Resource#collection}. Don't use this one, use {@link Resource#collection} instead.
-	 * @returns T[]
-	 */
-	public static get _instances() {
-		return readOnlyArrayProxyFactory(Reflect.getMetadata(METAKEYS.INSTANCES, this));
-	}
- 
-	/**
-	 * Retrieve an immutable list of all of the instances of your model.
-	 * @returns T[]
-	 */
-	public static collection<T extends Resource>(this: ResourceType<T>): T[] {
-		return this._instances;
-	}
- 
-	/**
-	 * Instantiate multiple instances from a collection of templates.
-	 * @param  Array<{}> input
-	 * @returns Array<T> An array of instances of your model.
-	 */
-	public static factory<T extends Resource>(this: ResourceType<T>, input: Array<{}>): Array<T>;
-	public static factory<T extends Resource>(this: ResourceType<T>, input: {}): T;
-	public static factory<T extends Resource>(this: ResourceType<T>, input: {} | Array<{}>): T | Array<T> {
-		if (input instanceof Array) {
-			return <T[]>input.map(ro => new this(ro));
-		} else Eif (input instanceof Object) {
-			return <T>new this(input);
-		} else {
-			throw new TypeError('Overload error');
-		}
-	}
-	/**
-	 * Find a locally available instance of your model by id. Does not make any requests.
-	 * @param  number id
-	 * @returns T
-	 */
-	public static find<T extends Resource>(this: ResourceType<T>, id: number): T | undefined {
-		return this.collection().find((i: any) => i.id === id);
-	}
- 
-	/**
-	 * Runs the fetch pipeline of your model for a single resource using the simple request adapter and builder.
-	 * @param  HttpClientOptions={} options
-	 * @returns Promise<T>
-	 */
-	public static async fetch<T extends Resource>(this: ResourceType<T>, Eoptions: HttpClientOptions = {}): Promise<T[]> {
-		const injections = getDependencyInjectionEntries(this);
-		const adapter = injections[0];
-		const builder = injections[1];
-		const resourceName = Reflect.getMetadata(METAKEYS.PLURAL, this);
- 
-		const response = await builder.fetch(resourceName, options);
-		const rawInstances = adapter.parseIncoming(response);
-		return this.factory<T>(rawInstances);
-	}
-	/**
-	 * Call this method to get an empty template for your model. This can for example be useful to use as a model for forms.
-	 * @returns A raw instance template object.
-	 */
-	public static template<T extends Resource>(this: ResourceType<T>): RawInstanceTemplate<T> {
-		const rawInstance = {};
-		Reflect.getMetadata(METAKEYS.FIELDS, this).forEach((field: string) => (rawInstance[field] = undefined));
-		return (rawInstance as any) as RawInstanceTemplate<T>;
-	}
- 
-	/**
-	 * Do not override the constructor unless you're know what you're doing. If you think you need it, be sure the check out the source code to see make sure your implementation is not messing with anything internally.
-	 *
-	 * @param RawInstance rawInstance A template from which a new instance of your model will be instantiate. If this parameter is omitted, the model will create an instance from the models metadata. If the parameter is included, it **MUST** minimally include all the keys as decorated with {@link Field}, {@link ToOne}, {@link ToMany} in the model definition with. The type `RawInstance` is just a dummy type that is required to make it work with Angular's dependency injection.
-	 * @param SimpleAdapter simpleAdapter The request content adapter for Simple resource requests.
-	 * @param SimpleBuilder simpleBuilder The request builder for Simple resource requests.
-	 * @param ToOneAdapter toOneAdapter The request content adapter for ToOne relationship requests
-	 * @param ToOneBuilder toOneBuilder The request builder for  ToOne relationship requests
-	 * @param ToManyAdapter toManyAdapter The request content adapter for ToMany relationship requests
-	 * @param ToManyBuilder toManyBuilder The request builder for  ToMany relationship requests
-	 */
-	constructor(
-		@Optional() rawInstance?: RawInstance /* need to figure out how to refer to inheriting type here */,
-		simpleAdapter?: SimpleAdapter,
-		simpleBuilder?: SimpleBuilder,
-		toOneAdapter?: ToOneAdapter,
-		toOneBuilder?: ToOneBuilder,
-		toManyAdapter?: ToManyAdapter,
-		toManyBuilder?: ToManyBuilder
-	) {
-		const requestHandlers: UnresolvedRequestHandlers = [
-			simpleAdapter,
-			simpleBuilder,
-			toOneAdapter,
-			toOneBuilder,
-			toManyAdapter,
-			toManyBuilder
-		];
- 
-		/**  The constructor can be called by the dependency injector or by the user. In the former case, assuming that the user did not manually inject the requestHandlers, only the first parameter will be falsy. In the latter case, only the first parameter will be truthy, in which case we will retrieve the injections by getDependencyInjectionEntries (see _handleInjections internal method). */
-		const instantationByAngularDI = this._handleInjections(requestHandlers);
-		if (instantationByAngularDI && rawInstance === null) {
-			return this;
-		}
-		let _rawInstance: any;
-		if (!rawInstance) {
-			_rawInstance = this.ctor.template();
-		} else {
-			_rawInstance = rawInstance;
-			_rawInstance.id = _rawInstance.id || undefined;
-			const alreadyExisting = this.ctor.find(_rawInstance.id);
-			if (alreadyExisting) {
-				// TODO: (OPTIONAL?) LOGIC TO overwrite fields from new source;
-				return alreadyExisting;
-			}
-		}
- 
-		this._populateFields(_rawInstance);
-		const proxyInstance = updateInterceptProxyFactory(this);
-		this._populateRelations(proxyInstance);
-		const init = this.onInit.bind(undefined);
-		init(proxyInstance, _rawInstance);
-		Reflect.defineMetadata(METAKEYS.UPDATED, {}, proxyInstance);
-		this._metaAdd(proxyInstance);
-		return proxyInstance;
-	}
- 
-	/**
-	 * Do some business logic upon initialization. This method is called by the constructor; do not override constructor unless you know what you're doing
-	 * @param rawInstance the raw instance template as consumed by the constructor
-	 * @returns void You cannot return anything from the onInit hook.
-	 */
-	public onInit(instance: this, rawInstance: RawInstanceTemplate<this>): void {}
- 
-	/**
-	 * Runs the save pipeline of your model for a single resource using the simple request adapter and builder.
-	 * @param  HttpClientOptions={} options
-	 * @returns Promise<T>
-	 */
-	public async save(Eoptions: HttpClientOptions = {}): Promise<this> {
-		const name = Reflect.getMetadata(METAKEYS.PLURAL, this.constructor);
-		const body = this._adapter.save(this);
-		const response = await this._builder.save(name, body, options);
-		const rawInstance = this._adapter.parseIncoming(response);
-		return this.ctor.factory(<Object>rawInstance);
-	}
- 
-	/**
-	 * Runs the update pipeline of your model for a single resource using the simple request adapter and builder.
-	 * @param  HttpClientOptions={} options
-	 * @returns Promise<void>
-	 */
-	public async update(Eoptions: HttpClientOptions = {}): Promise<void> {
-		const name = Reflect.getMetadata(METAKEYS.PLURAL, this.constructor);
-		const affectedKeys = Reflect.getMetadata(METAKEYS.UPDATED, this);
-		const body = this._adapter.update(this, affectedKeys);
-		await this._builder.update(name, body, options);
-	}
- 
-	/**
-	 * Runs the delete pipeline of your model for a single resource using the simple request adapter and builder.
-	 * @param  HttpClientOptions={} options
-	 * @returns Promise<void>
-	 */
-	public async delete(Eoptions: HttpClientOptions = {}): Promise<void> {
-		const name = Reflect.getMetadata(METAKEYS.PLURAL, this.constructor);
-		await this._builder.delete(name, this, options);
-		this._metaRemove();
-	}
- 
-	/** @internal */
-	private get ctor(): ResourceType<this> {
-		return <ResourceType<this>>this.constructor;
-	}
-	/** @internal */
-	private _populateFields(rawInstance: any) {
-		const fields = Reflect.getMetadata(METAKEYS.FIELDS, this.constructor) as Array<string>;
-		fields.forEach(field => {
-			const map = Reflect.getMetadata(METAKEYS.MAP, this.constructor, field);
-			if (map && rawInstance.hasOwnProperty(map)) {
-				this[field] = rawInstance[map];
-			} else if (rawInstance.hasOwnProperty(field)) {
-				this[field] = rawInstance[field];
-			} else Eif (!rawInstance.hasOwnProperty(field)) {
-				throw Error(
-					`Expected key ${field} for instance of class ${Reflect.getMetadata(METAKEYS.PLURAL, this.constructor)} but it wasn't included`
-				);
-			}
-		});
-	}
-	/** @internal */
-	private _populateRelations(host: this) {
-		const relations = Reflect.getMetadata(METAKEYS.RELATIONS, host.constructor);
-		Reflect.ownKeys(relations).forEach(key => {
-			const config = relations[key];
-			switch (config.type) {
-				case RelationType.ToOne:
-					host[key] = new ToOneRelation(host, config, host._toOneAdapter, host._toOneBuilder);
-					break;
-				case RelationType.ToMany:
-					host[key] = new ToManyRelation(host, config, host._toManyAdapter, host._toManyBuilder);
-					break;
-				default:
-					throw Error('shouldnt come here');
-			}
-		});
-	}
- 
-	/** @internal add instance to the metadata instance list*/
-	private _metaAdd(instance: this) {
-		if (this.id) {
-			const list = Reflect.getMetadata(METAKEYS.INSTANCES, this.constructor);
-			list.push(instance);
-		}
-	}
- 
-	/** @internal remove instance from the metadata instance list*/
-	private _metaRemove() {
-		const list = Reflect.getMetadata(METAKEYS.INSTANCES, this.constructor);
-		for (let n = 0; n < list.length; n++) {
-			Eif (list[n].id === this.id) {
-				list.splice(n, 1);
-				break;
-			}
-		}
-	}
- 
-	/** @internal */
-	private _handleInjections(dependencies: UnresolvedRequestHandlers) {
-		// the assumption is that if (at least one) of the injections was undefined, the
-		// instantiation was not done by Angulars dependency injection.
-		const instantationByAngularDI = !dependencies.includes(undefined);
-		if (!instantationByAngularDI) {
-			dependencies = getDependencyInjectionEntries(this.ctor) as RequestHandlers;
-		}
-		const filledDependencies = dependencies as RequestHandlers;
-		this._adapter = filledDependencies[0];
-		this._builder = filledDependencies[1];
-		this._toOneAdapter = filledDependencies[2];
-		this._toOneBuilder = filledDependencies[3];
-		this._toManyAdapter = filledDependencies[4];
-		this._toManyBuilder = filledDependencies[5];
-		return instantationByAngularDI;
-	}
-}
- 
-
-
- - - - - - - - diff --git a/core/coverage/src/resource.decorators.ts.html b/core/coverage/src/resource.decorators.ts.html deleted file mode 100644 index a956107..0000000 --- a/core/coverage/src/resource.decorators.ts.html +++ /dev/null @@ -1,588 +0,0 @@ - - - - Code coverage report for src/resource.decorators.ts - - - - - - - -
-
-

- All files / src resource.decorators.ts -

-
-
- 95.92% - Statements - 47/49 -
-
- 83.33% - Branches - 10/12 -
-
- 100% - Functions - 8/8 -
-
- 95.83% - Lines - 46/48 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -1741x -1x -1x -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -194x -98x -97x -97x -  -97x -  -  -  -  -  -97x -97x -  -97x -97x -97x -  -97x -1x -  -97x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -97x -  -  -  -  -  -  -  -  -  -1x -248x -247x -247x -247x -247x -  -  -  -  -  -  -  -  -  -  -  -  -1x -44x -  -  -43x -33x -10x -10x -  -  -  -43x -43x -43x -43x -43x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -58x -  -  -57x -37x -20x -20x -  -  -  -57x -57x -57x -57x -57x -  -  -  -  -  -  -  -  - 
import { Injectable } from '@angular/core';
-import { Resource } from './resource.core';
-import { RelationType, RelationConfiguration } from './relations/relation-configuration';
-import { initMetaData, METAKEYS, getPluralAndSingularNames } from './utils';
- 
-/**
- * Options object that can be passed to the {@link Model} when decorating your model. Currently it is only possible to configure `name`, which is used in
- * generating the urls for requests.
- *
- * If you have a custom `uglify.config.js` file in which `mangle` is set to false, you do not need to use this.
- *
- * If you don't, then Angular's AOT will obfuscate `constructor.name`, and this library will not be able to construct URL according to the name of your model.
- * To prevent this from happening, you can pass `name` in the decorator options.
- *
- * Alternatively, you can use `name` to provide for a custom representation in the url.
- *
- * @example
- * // uglify.config.js with mangle = false
- * @Model() // will produce calls to .../my-dummy-models/...
- * class MyDummyModel extends Resource {}
- *
- * // without mangle = false
- * @Model() // will not work!
- * class MyDummyModel extends Resource {}
- *
- * // without mangle = false
- * @Model({name: 'MyDummyModel'}) // will produce calls to .../my-dummy-models/...
- * class MyDummyModel extends Resource {}
- *
- * // without mangle = false
- * @Model({name: 'MyAlternativeName'}) // will produce calls to .../my-alternative-name/...
- * class MyDummyModel extends Resource {}
- *
- * // without mangle = false
- * @Model({name: 'my-alternative-name'}) // will produce calls to .../my-alternative-name/...
- * class MyDummyModel extends Resource {}
- */
-export interface ModelOptions {
-	camelCaseFullModelName?: string;
-	dashedPluralName?: string;
-	dashedSingularName?: string;
-}
-/**
- * Add this class decorator to your model to turn it into a `Resource` model, which means that it is considered as an endpoint on your API.
- *
- * See {@link ModelOptions} on how to configure the name used in URLs.
- *
- * This decorator is responsible for setting metadata, which is used internally, on the constructor of your class.
- *
- * @param  ModelOptions={} options
- */
-export function Model(options: ModelOptions = {}) {
-	return <T extends Resource>(ctor: any) => {
-		ctor = Injectable({ providedIn: 'root' })(ctor);
-		initMetaData(ctor);
- 
-		const names = getPluralAndSingularNames(
-			options.dashedSingularName,
-			options.dashedPluralName,
-			options.camelCaseFullModelName,
-			ctor.name
-		);
-		Reflect.defineMetadata(METAKEYS.SINGULAR, names.singular, ctor);
-		Reflect.defineMetadata(METAKEYS.PLURAL, names.plural, ctor);
- 
-		const fields = Reflect.getMetadata(METAKEYS.FIELDS, ctor);
-		const attributes = Reflect.getMetadata(METAKEYS.ATTRIBUTES, ctor);
-		Reflect.defineMetadata(METAKEYS.FIELDS, fields.concat(attributes), ctor);
- 
-		if (!Reflect.hasOwnMetadata(METAKEYS.RESOURCES, Resource)) {
-			Reflect.defineMetadata(METAKEYS.RESOURCES, new Map(), Resource);
-		}
-		Reflect.getMetadata(METAKEYS.RESOURCES, Resource).set(names.singular, ctor);
- 
-		// // detect circular relations
-		// const relationships = Reflect.getMetadata(METAKEYS.RELATIONS, ctor);
- 
-		// Reflect.ownKeys(relationships).forEach(r => {
-		// 	const config = relationships[r];
-		// 	const foreignRelationships = Reflect.getMetadata(METAKEYS.RELATIONS, config.RelatedResource);
-		// 	// Reflect.ownKeys(foreignRelationships).forEach( fr => {
-		// 	// 	console.log(foreignRelationships[fr]) {
- 
-		// 	// 	}
-		// 	// });
-		// });
- 
-		return ctor;
-	};
-}
- 
-/**
- * Use this field decorator to parse the corresponding field from a json response by your API.
- * @param string mapFrom? An identifier to map keys coming from an incoming json response to keys in your model.
- *  For example: the api response has a key `commentText: 'nice article!` but the key in the model is `commentContent`.
- * Then the decorator should be used as `Field('commentText').
- */
-export function Field(mapFrom?: string) {
-	return <T extends Resource>(target: any, key: string) => {
-		const ctor = target.constructor;
-		initMetaData(ctor);
-		Reflect.defineMetadata(METAKEYS.MAP, mapFrom, ctor, key);
-		Reflect.getMetadata(METAKEYS.ATTRIBUTES, ctor).push(key);
-	};
-}
- 
-/**
- * Use this field decorator to parse the corresponding field from a json response by your API and to identify the key as a To-One relationship.
- * @param Function | string RelatedResource The constructor function of the model that is targeted for the To-One relation.
- * Either pass a direct reference to the constructor function, or pass a string with the name of the model. For the latter:
- * this should be dashed singular form (eg MyFancyModelName => 'my-fancy-model-name'). Use string references to prevent circular references from occuring in your model definitions.
- * @param string mapFrom? An identifier to map keys coming from an incoming json response to keys in your model.
- *  For example: the api response has a key `commentText: 'nice article!` but the key in the model is `commentContent`.
- * Then the decorator should be used as `Field('commentText').
- */
-export const ToOne = function<TRelated extends Resource>(RelatedResource: Function | string, mapFrom?: string) {
-	return (target: any, key: string) => {
-		let relatedResourceString;
-		let relatedResource: any;
-		if (typeof RelatedResource === 'function') {
-			relatedResource = RelatedResource;
-		} else Eif (typeof RelatedResource === 'string') {
-			relatedResourceString = RelatedResource;
-		} else {
-			throw Error();
-		}
-		const ctor = target.constructor;
-		initMetaData(ctor);
-		Reflect.defineMetadata(METAKEYS.MAP, mapFrom, ctor, key);
-		Reflect.getMetadata(METAKEYS.FIELDS, ctor).push(key);
-		Reflect.getMetadata(METAKEYS.RELATIONS, ctor)[key] = new RelationConfiguration(
-			ctor,
-			key,
-			RelationType.ToOne,
-			relatedResource,
-			relatedResourceString
-		);
-	};
-};
- 
-/**
- * Use this field decorator to parse the corresponding field from a json response by your API and to identify the key as a To-Many relationship.
- * @param Function | string RelatedResource The constructor function of the model that is targeted for the To-Many relation.
- * Either pass a direct reference to the constructor function, or pass a string with the name of the model. For the latter:
- * this should be dashed singular form (eg MyFancyModelName => 'my-fancy-model-name'). Use string references to prevent circular references from occuring in your model definitions.
- * @param string mapFrom? An identifier to map keys coming from an incoming json response to keys in your model.
- *  For example: the api response has a key `commentText: 'nice article!` but the key in the model is `commentContent`.
- * Then the decorator should be used as `Field('commentText').
- */
-export const ToMany = function<TRelated extends Resource>(RelatedResource: Function | string, mapFrom?: string) {
-	return (target: any, key: string) => {
-		let relatedResourceString;
-		let relatedResource: any;
-		if (typeof RelatedResource === 'function') {
-			relatedResource = RelatedResource;
-		} else Eif (typeof RelatedResource === 'string') {
-			relatedResourceString = RelatedResource;
-		} else {
-			throw Error();
-		}
-		const ctor = target.constructor;
-		initMetaData(ctor);
-		Reflect.defineMetadata(METAKEYS.MAP, mapFrom, ctor, key);
-		Reflect.getMetadata(METAKEYS.FIELDS, ctor).push(key);
-		Reflect.getMetadata(METAKEYS.RELATIONS, ctor)[key] = new RelationConfiguration(
-			ctor,
-			key,
-			RelationType.ToMany,
-			relatedResource,
-			relatedResourceString
-		);
-	};
-};
- 
-
-
- - - - - - - - diff --git a/core/coverage/src/resource.module.ts.html b/core/coverage/src/resource.module.ts.html deleted file mode 100644 index e47431b..0000000 --- a/core/coverage/src/resource.module.ts.html +++ /dev/null @@ -1,402 +0,0 @@ - - - - Code coverage report for src/resource.module.ts - - - - - - - -
-
-

- All files / src resource.module.ts -

-
-
- 97.3% - Statements - 72/74 -
-
- 78.57% - Branches - 11/14 -
-
- 100% - Functions - 9/9 -
-
- 96.97% - Lines - 64/66 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112  -1x -1x -1x -1x -1x -1x -1x -1x -  -  -  -  -  -  -  -  -  -1x -1x -1x -1x -  -  -  -  -1x -13x -13x -13x -  -  -130x -130x -130x -130x -130x -130x -  -  -  -  -  -1x -130x -57x -  -  -1x -130x -130x -130x -130x -204x -204x -110x -  -  -130x -110x -20x -  -  -  -  -  -  -  -  -  -  -21x -  -1x -  -  -1x -42x -21x -21x -  -  -  -  -1x -  -  -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -  -1x -1x -1x -  -  - 
/*tslint:disable:no-non-null-assertion*/
-import 'reflect-metadata';
-import { NgModule, ModuleWithProviders, Injector, Provider } from '@angular/core';
-import { HttpClientModule } from '@angular/common/http';
-import { Resource } from './resource.core';
-import { Field, ToMany, ToOne, Model } from './resource.decorators';
-import { ToManyRelation } from './relations/to-many';
-import { ToOneRelation } from './relations/to-one';
-import {
-	InjectorContainer,
-	ResourceModuleConfiguration,
-	ResourceModuleConfigurationWithProviders,
-	HttpClientOptions,
-	toDash,
-	HttpVerb,
-	METAKEYS,
-	ResourceType
-} from './utils';
-import { Abstract as AbstractAdapters } from './request-handlers/abstract-adapters';
-import { Abstract as AbstractBuilders } from './request-handlers/abstract-builders';
-import { ToManyAdapter, ToOneAdapter, SimpleAdapter } from './request-handlers/default-adapters';
-import { ToManyBuilder, ToOneBuilder, SimpleBuilder } from './request-handlers/default-builders';
-import { RelationConfiguration } from './relations/relation-configuration';
- 
-/** @internal */
-@NgModule({ imports: [HttpClientModule] })
-export class ResourceRootModule {
-	public static processRelationships() {
-		const resources = Reflect.getMetadata(METAKEYS.RESOURCES, Resource);
-		Iif (!resources) {
-			return;
-		} else {
-			for (const [singularName, ctor] of resources.entries()) {
-				const relations = Reflect.getMetadata(METAKEYS.RELATIONS, ctor);
-				Reflect.ownKeys(relations).forEach(r => {
-					const config = relations[r];
-					this.setRelatedConstructors(config, resources);
-					this.setCircularRelations(config, resources);
-				});
-			}
-		}
-	}
- 
-	private static setRelatedConstructors(config: RelationConfiguration<any, any>, resources: Map<string, ResourceType<any>>) {
-		if (config.relatedResourceString) {
-			config.RelatedResource = resources.get(config.relatedResourceString)!;
-		}
-	}
-	private static setCircularRelations(config: RelationConfiguration<any, any>, resources: Map<string, ResourceType<any>>) {
-		const hostResource = config.HostResource;
-		const relationsOfRelated = Reflect.getMetadata(METAKEYS.RELATIONS, config.RelatedResource);
-		const potentialCircularMatches: RelationConfiguration<any, any>[] = [];
-		Reflect.ownKeys(relationsOfRelated).forEach(rot => {
-			const relatedRelationConfig = relationsOfRelated[rot];
-			if (relatedRelationConfig.RelatedResource === hostResource) {
-				potentialCircularMatches.push(relatedRelationConfig);
-			}
-		});
-		if (potentialCircularMatches.length === 1) {
-			config.circular = potentialCircularMatches[0];
-		} else Iif (potentialCircularMatches.length > 1) {
-			throw Error(
-				'It seems that there is a model X for which a model Y has multiple foreign keys directed to it. This is not yet implemented'
-			);
-			// if (!config.relatedNavigationProperty) {
-			// 	throw Error(`There is a problem with a circular relation. If model X has multiple foreign keys to model Y, then you need to supply
-			// 	 a navigation property to tell the ORM which of the foreign keys belongs to which relation.`);
-			// }
-		}
-	}
-	constructor(injector: Injector) {
-		InjectorContainer.instance = injector;
-	}
-}
- 
-@NgModule({ imports: [HttpClientModule] })
-class ResourceModule {
-	static forRoot(Eoptions: ResourceModuleConfigurationWithProviders = {}): ModuleWithProviders {
-		const config: Provider[] = [{ provide: ResourceModuleConfiguration, useValue: { rootPath: options.rootPath } }];
-		return {
-			ngModule: ResourceRootModule,
-			providers: config.concat(options.requestHandler || [])
-		};
-	}
-}
- 
-export {
-	ResourceModule,
-	Resource,
-	Field,
-	ToOne,
-	ToMany,
-	Model,
-	ToManyRelation,
-	ToOneRelation,
-	AbstractAdapters,
-	AbstractBuilders,
-	ResourceModuleConfigurationWithProviders,
-	ToManyAdapter,
-	ToOneAdapter,
-	SimpleAdapter,
-	ToManyBuilder,
-	ToOneBuilder,
-	SimpleBuilder,
-	ResourceModuleConfiguration,
-	HttpClientOptions,
-	toDash,
-	HttpVerb,
-	METAKEYS,
-	ResourceType
-};
- 
-
-
- - - - - - - - diff --git a/core/coverage/src/utils.ts.html b/core/coverage/src/utils.ts.html deleted file mode 100644 index c8e511c..0000000 --- a/core/coverage/src/utils.ts.html +++ /dev/null @@ -1,663 +0,0 @@ - - - - Code coverage report for src/utils.ts - - - - - - - -
-
-

- All files / src utils.ts -

-
-
- 100% - Statements - 72/72 -
-
- 100% - Branches - 44/44 -
-
- 100% - Functions - 12/12 -
-
- 100% - Lines - 69/69 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199  -  -  -  -  -  -1x -  -  -1x -1x -  -1x -  -  -  -  -  -129x -8x -  -  -121x -2x -  -119x -4x -  -  -115x -4x -  -  -  -  -  -  -  -111x -2x -2x -109x -8x -8x -  -101x -101x -  -111x -  -  -1x -218x -218x -218x -218x -200x -  -  -  -  -1x -  -  -1x -128x -101x -101x -101x -  -  -  -  -  -  -  -  -27x -  -  -1x -1x -1x -1x -1x -1x -  -  -  -1x -444x -102x -  -444x -102x -  -444x -102x -  -444x -102x -  -  -  -  -  -  -1x -108x -108x -  -175x -34x -34x -34x -  -175x -175x -  -  -  -  -  -1x -125x -125x -  -478x -4x -  -474x -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -1x -  -1x -  -1x -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
import { Injector, Provider } from '@angular/core';
-import { HttpHeaders, HttpParams } from '@angular/common/http';
-// import { Resource } from './resource.core';
-import { RelationConfiguration, RelationType } from './relations/relation-configuration';
-import { ToManyBuilder, ToOneBuilder, SimpleBuilder } from './request-handlers/default-builders';
-import { ToManyAdapter, ToOneAdapter, SimpleAdapter } from './request-handlers/default-adapters';
-import { plural, singular, isSingular } from 'pluralize';
-import { Resource } from './resource.core';
- 
-export const toPlural = plural;
-export const toSingular = singular;
- 
-export function getPluralAndSingularNames(
-	_singular: string | undefined,
-	_plural: string | undefined,
-	customCtorName: string | undefined,
-	ctorName: string
-): { plural: string; singular: string } {
-	if ((_singular && !_plural) || (!_singular && _plural)) {
-		throw new Error(
-			`Single or plural form is missing. If you supply a custom singular or plural name in @Model decorator, you must use supply BOTH the singular and plural forms.`
-		);
-	} else if (customCtorName && (_singular && _plural)) {
-		throw new Error(`Was singular and/or plural included.
-			If you supply a custom class name, (in this case: ${customCtorName}), you shouldn't also include custom singular and/or plural forms.`);
-	} else if (customCtorName && !isSingular(customCtorName)) {
-		throw new Error(
-			`Custom class name not recognized as singular. If you supply a custom class name, (in this case: ${customCtorName}), it must be in a singular form.`
-		);
-	} else if (!customCtorName && ctorName && !isSingular(ctorName)) {
-		throw new Error(
-			`Class name not recognized as singular. Note: "${ctorName} extends Resource"
-			should be "${toSingular(ctorName)} extends Resource": your class should be named in a singular form.`
-		);
-	}
- 
-	let singularName;
-	let pluralName;
-	if (_singular && _plural) {
-		singularName = _singular;
-		pluralName = _plural;
-	} else if (customCtorName) {
-		singularName = toDash(customCtorName);
-		pluralName = toPlural(toDash(customCtorName));
-	} else {
-		singularName = toDash(ctorName);
-		pluralName = toPlural(toDash(ctorName));
-	}
-	return { singular: singularName, plural: pluralName };
-}
- 
-export function toDash(name: string): string {
-	const split = name.split('');
-	split[0] = split[0].toLowerCase();
-	const splitJoin = split.join('');
-	return splitJoin.replace(/([A-Z])/g, $1 => {
-		return '-' + $1.toLowerCase();
-	});
-}
- 
-/** @internal */
-export let InjectorContainer: { [instance: string]: Injector | undefined } = { instance: undefined };
- 
-/** @internal */
-export function getDependencyInjectionEntries(token: any): RequestHandlers {
-	if (InjectorContainer.instance !== undefined) {
-		const injector = InjectorContainer.instance;
-		const injectedInstance = injector.get(token);
-		return [
-			injectedInstance['_adapter'],
-			injectedInstance['_builder'],
-			injectedInstance['_toOneAdapter'],
-			injectedInstance['_toOneBuilder'],
-			injectedInstance['_toManyAdapter'],
-			injectedInstance['_toManyBuilder']
-		];
-	}
-	return [] as any;
-}
- 
-export enum HttpVerb {
-	GET = 'get',
-	POST = 'post',
-	PUT = 'put',
-	PATCH = 'patch',
-	DELETE = 'delete'
-}
- 
-/** @internal */
-export function initMetaData(ctor: any) {
-	if (!Reflect.hasOwnMetadata(METAKEYS.FIELDS, ctor)) {
-		Reflect.defineMetadata(METAKEYS.FIELDS, [], ctor);
-	}
-	if (!Reflect.hasOwnMetadata(METAKEYS.ATTRIBUTES, ctor)) {
-		Reflect.defineMetadata(METAKEYS.ATTRIBUTES, [], ctor);
-	}
-	if (!Reflect.hasOwnMetadata(METAKEYS.RELATIONS, ctor)) {
-		Reflect.defineMetadata(METAKEYS.RELATIONS, {}, ctor);
-	}
-	if (!Reflect.hasOwnMetadata(METAKEYS.INSTANCES, ctor)) {
-		Reflect.defineMetadata(METAKEYS.INSTANCES, [], ctor);
-	}
-}
- 
- 
- 
-/** @internal */
-export function updateInterceptProxyFactory(targetInstance: Resource) {
-	const attributes = Reflect.getMetadata(METAKEYS.ATTRIBUTES, targetInstance.constructor);
-	return new Proxy(targetInstance, {
-		set(instance: any, key: string, value: any, proxy: any): boolean {
-			if (attributes.indexOf(key) > -1) {
-				const updatedFields = Reflect.getMetadata(METAKEYS.UPDATED, proxy);
-				const map = Reflect.getMetadata(METAKEYS.MAP, instance, key);
-				updatedFields[map || key] = instance[key];
-			}
-			instance[key] = value;
-			return true;
-		}
-	});
-}
- 
-/** @internal */
-export function readOnlyArrayProxyFactory(targetArray: Array<any>) {
-	const forbiddenMethods = ['push', 'pop', 'shift', 'unshift'];
-	return new Proxy(targetArray, {
-		get(instance: any, key: string, proxy: any): boolean {
-			if (forbiddenMethods.indexOf(key) > -1) {
-				throw Error(`Operation ${key} not allowed on this readonly array!`);
-			}
-			return instance[key];
-		}
-	});
-}
- 
-export const METAKEYS = {
-	FIELDS: 'orm:fields',
-	ATTRIBUTES: 'orm:attributes',
-	RELATIONS: 'orm:relations',
-	MAP: 'orm:map',
-	UPDATED: 'orm:updated',
-	INSTANCES: 'orm:instances',
-	PLURAL: 'orm:plural',
-	SINGULAR: 'orm:singular',
-	RESOURCES: 'orm:resources'
-};
- 
-/** @internal */
-export class ResourceModuleConfiguration {
-	rootPath?: string;
-}
- 
-export class ResourceModuleConfigurationWithProviders extends ResourceModuleConfiguration {
-	/** Sets the API root of your app. */
-	rootPath?: string;
-	/** Allows to conveniently register a collection of request handlers. See the guide on extendability on how to use this. Can be set to {@link JsonApiDotOrg}. */
-	requestHandler?: Provider[];
-}
- 
-export interface Instantiable<T> {
-	new (...args: any[]): T;
-}
- 
-export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
-export type RawInstanceTemplate<T extends Resource> = Omit<T, keyof Resource>;
- 
-export interface ResourceType<T> extends Instantiable<T> {
-	_instances: T[];
-	collection<U extends Resource>(this: ResourceType<U>): U[];
-	fetch<U extends Resource>(this: ResourceType<U>): Promise<U[]>;
-	find<U extends Resource>(this: ResourceType<U>, id: number): U | undefined;
-	template<U extends Resource>(this: ResourceType<U>): RawInstanceTemplate<U>;
-	factory<U extends Resource>(this: ResourceType<U>, rawInstance: Array<{}>): Array<U>;
-	factory<U extends Resource>(this: ResourceType<U>, rawInstance: {}): U;
-}
- 
-export interface HttpClientOptions {
-	url?: string;
-	body?: any;
-	headers?: HttpHeaders | { [header: string]: string | string[] };
-	observe?: 'body';
-	params?: HttpParams | { [param: string]: string | string[] };
-	responseType?: 'json';
-	reportProgress?: boolean;
-	withCredentials?: boolean;
-}
-/** @internal */
-export type RequestHandlers = [SimpleAdapter, SimpleBuilder, ToOneAdapter, ToOneBuilder, ToManyAdapter, ToManyBuilder];
- 
-/** @internal */
-export type UnresolvedRequestHandlers = [
-	SimpleAdapter | undefined,
-	SimpleBuilder | undefined,
-	ToOneAdapter | undefined,
-	ToOneBuilder | undefined,
-	ToManyAdapter | undefined,
-	ToManyBuilder | undefined
-];
- 
-
-
- - - - - - - - diff --git a/core/package-lock.json b/core/package-lock.json index 61c6c17..653bcdd 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ngx-api-orm/core", - "version": "0.0.1-beta7", + "version": "0.0.1-beta10", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/json-api/src/builders.ts b/json-api/src/builders.ts index 1c0bab8..37bd3f1 100644 --- a/json-api/src/builders.ts +++ b/json-api/src/builders.ts @@ -9,6 +9,7 @@ export namespace JsonApiBuilders { export class Simple extends Abstract.SimpleBuilder { constructor(_http: HttpClient, _config: ResourceModuleConfiguration) { super(_http, _config); + console.log("wut"); } public update(targetNamePlural: string, body: any, options: HttpClientOptions): Promise { const path = options.url || this.buildUrl(targetNamePlural, { id: body.data.id }); diff --git a/ngx-api-orm.code-workspace b/ngx-api-orm.code-workspace new file mode 100644 index 0000000..362d7c2 --- /dev/null +++ b/ngx-api-orm.code-workspace @@ -0,0 +1,7 @@ +{ + "folders": [ + { + "path": "." + } + ] +} \ No newline at end of file From f7130bc34a7f79082fb06ef14ecf9344628cdb01 Mon Sep 17 00:00:00 2001 From: Harro van der Kroft Date: Tue, 23 Oct 2018 12:34:51 +0200 Subject: [PATCH 2/2] docs: some fixes for readme.md - incorrect links --- README.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 266b979..9f422d7 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,16 @@ -# ngx-api-orm -Also lovingly called NAO +# NAO (ngx-api-orm) Some links to get you started: * [API Documentation](https://maurei.github.io/ngx-api-orm/). -* [NPM Package](https://www.npmjs.com/package/@ngx-api-orm/json-api) + +The NPM packages: + +* [Core package](https://www.npmjs.com/package/@ngx-api-orm/core) - This is the default package needed to start +* Optional packages: + * [Json:api implementation](https://www.npmjs.com/package/@ngx-api-orm/json-api) **Note: docs are still under construction.** -A rest api Object Relationship Mapper (ORM) for Angular. Tested with Angular 6.1.x. Can be use used seamlessly with [JSON:api](JsonApi.org) or easibly be adjusted to work with your own format. +A rest API Object Relationship Mapper (ORM) for Angular. Tested with Angular 6.1.x. Can be used seamlessly with [JSON:api](JsonApi.org) or easily be adjusted to work with your own format. It's aim is to remove as much boilerplate code as possible while allowing for easy extendability. It will empower your models with CRUD functionality and also manages to-one and to-many relationships. @@ -92,8 +96,9 @@ To get started you need the following: Using NPM (link to package [here](https://www.npmjs.com/package/@ngx-api-orm/json-api)): ```console npm install --save @ngx-api-orm/core +npm install --save @ngx-api-orm/json-api ``` -If you wish to install a specific version, you can use the following format: +If you wish to install a specific version, you can use the following format (if you would like to use 0.0.1-beta6 of the core package) ```console npm install --save @ngx-api-orm/core@0.0.1-beta6 ```