unsakini 0.0.3 → 0.0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -7
- data/angular/README.md +31 -1
- data/angular/dist/inline.map +1 -1
- data/angular/dist/main.bundle.js +64 -110
- data/angular/dist/main.map +1 -1
- data/angular/dist/styles.map +1 -1
- data/angular/package.json +2 -1
- data/app/controllers/api/comments_controller.rb +1 -1
- data/app/controllers/api/posts_controller.rb +1 -1
- data/lib/unsakini/version.rb +1 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/public/app/inline.map +1 -1
- data/spec/dummy/public/app/main.bundle.js +64 -110
- data/spec/dummy/public/app/main.map +1 -1
- data/spec/dummy/public/app/styles.map +1 -1
- data/spec/requests/api/boards/api_boards_pagination_spec.rb +16 -0
- data/spec/requests/api/comments/api_comments_pagination_spec.rb +31 -0
- data/spec/requests/api/comments/api_comments_private_board_spec.rb +197 -0
- data/spec/requests/api/comments/{api_comments_spec.rb → api_comments_shared_board_spec.rb} +0 -180
- data/spec/requests/api/posts/api_posts_pagination_spec.rb +34 -0
- data/spec/requests/api/posts/api_posts_private_board_spec.rb +136 -0
- data/spec/requests/api/posts/{api_posts_spec.rb → api_posts_shared_board_spec.rb} +0 -116
- data/spec/support/scenario_helper.rb +34 -2
- metadata +13 -6
- data/angular/LICENSE +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 094e9d1bc00792c0e37ed0e0b16ee13044d12080
|
4
|
+
data.tar.gz: 32b8e8e90f8944fa979d0e82be2e5ebd319f7342
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 253d932b3584159d99861c81e762a47b331c0a8565c37c9e6ac4d86bd483a696f6e3ef553aec54cb3f2f727c256ab9a412ab1aa1fe1b48543bf742330a52329a
|
7
|
+
data.tar.gz: 79f2005d2ed50ff89327347d029684417d4c8bdd209be565611dd8736c5c7d6767a230e48af6e431a7f5181b91033f528bcb9cf8bb29eb6f1f81a19bb17ea11d
|
data/README.md
CHANGED
@@ -6,19 +6,18 @@ UNSAKINI
|
|
6
6
|
|
7
7
|
**[Unsakini](https://www.unsakini.com)** is an open source encrypted bulletin board created with the aim of evading global information surveillance and spying, preventing data leaks and promoting information confidentiality and integrity.
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
- group discussions on sensitive issues
|
12
|
-
- confidential conversations
|
13
|
-
- storing passwords, liscenses, credit card details, and other sensitive documents
|
9
|
+
Features:
|
14
10
|
|
11
|
+
- encrypted discussions boards
|
12
|
+
- encrypted chat
|
13
|
+
- encrypted file uploads
|
15
14
|
|
16
15
|
-------------------------
|
17
16
|
|
18
17
|
### How it Works
|
19
|
-
Upon using the system, you'll be asked to provide your private key. This key is used to encrypt your data before it is sent to the server.
|
18
|
+
Upon using the system, you'll be asked to provide your private key. This key is used to encrypt your data before it is sent to the server. The key is stored in your computer and is never sent to the server. Only you have access to your private key, thus only you can read your data.
|
20
19
|
|
21
|
-
Hackers, surveillance and spy softwares and even the server host cannot read your data, unless they are able to obtain your private key. Your private key is deleted from your computer
|
20
|
+
Hackers, surveillance and spy softwares and even the server host cannot read your data, unless they are able to obtain your private key. Your private key is deleted from your computer everytime you logout.
|
22
21
|
|
23
22
|
To increase the security, your data is re-encrypted in the backend before being saved to the database, which adds a second layer of protection.
|
24
23
|
|
data/angular/README.md
CHANGED
@@ -1 +1,31 @@
|
|
1
|
-
|
1
|
+
# Angular
|
2
|
+
|
3
|
+
This project was generated with [angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.20-4.
|
4
|
+
|
5
|
+
## Development server
|
6
|
+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
|
7
|
+
|
8
|
+
## Code scaffolding
|
9
|
+
|
10
|
+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive/pipe/service/class`.
|
11
|
+
|
12
|
+
## Build
|
13
|
+
|
14
|
+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
|
15
|
+
|
16
|
+
## Running unit tests
|
17
|
+
|
18
|
+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
19
|
+
|
20
|
+
## Running end-to-end tests
|
21
|
+
|
22
|
+
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
|
23
|
+
Before running the tests make sure you are serving the app via `ng serve`.
|
24
|
+
|
25
|
+
## Deploying to Github Pages
|
26
|
+
|
27
|
+
Run `ng github-pages:deploy` to deploy to Github Pages.
|
28
|
+
|
29
|
+
## Further help
|
30
|
+
|
31
|
+
To get more help on the `angular-cli` use `ng --help` or go check out the [Angular-CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
|
data/angular/dist/inline.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap 85be513a23ff72067b81"],"names":[],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAI;AACJ;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA,YAAI;AACJ;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA,kDAA0C,oBAAoB,WAAW","file":"inline.bundle.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId])\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length)\n \t\t\tresolves.shift()();\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tif(installedChunks[chunkId] === 0)\n \t\t\treturn Promise.resolve();\n\n \t\t// an Promise means \"currently loading\".\n \t\tif(installedChunks[chunkId]) {\n \t\t\treturn installedChunks[chunkId][2];\n \t\t}\n \t\t// start chunk loading\n \t\tvar head = document.getElementsByTagName('head')[0];\n \t\tvar script = document.createElement('script');\n \t\tscript.type = 'text/javascript';\n \t\tscript.charset = 'utf-8';\n \t\tscript.async = true;\n \t\tscript.timeout = 120000;\n\n \t\tscript.src = __webpack_require__.p + \"\" + chunkId + \".chunk.js\";\n \t\tvar timeout = setTimeout(onScriptComplete, 120000);\n \t\tscript.onerror = script.onload = onScriptComplete;\n \t\tfunction onScriptComplete() {\n \t\t\t// avoid mem leaks in IE.\n \t\t\tscript.onerror = script.onload = null;\n \t\t\tclearTimeout(timeout);\n \t\t\tvar chunk = installedChunks[chunkId];\n \t\t\tif(chunk !== 0) {\n \t\t\t\tif(chunk) chunk[1](new Error('Loading chunk ' + chunkId + ' failed.'));\n \t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t}\n \t\t};\n \t\thead.appendChild(script);\n\n \t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\tinstalledChunks[chunkId] = [resolve, reject];\n \t\t});\n \t\treturn installedChunks[chunkId][2] = promise;\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmory imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmory exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tObject.defineProperty(exports, name, {\n \t\t\tconfigurable: false,\n \t\t\tenumerable: true,\n \t\t\tget: getter\n \t\t});\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 85be513a23ff72067b81"],"sourceRoot":""}
|
data/angular/dist/main.bundle.js
CHANGED
@@ -13033,7 +13033,7 @@ var Router = (function () {
|
|
13033
13033
|
// this operation do not result in any side effects
|
13034
13034
|
var urlAndSnapshot$;
|
13035
13035
|
if (!precreatedState) {
|
13036
|
-
var redirectsApplied$ = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_11__apply_redirects__["a" /* applyRedirects */])(_this.injector, _this.configLoader,
|
13036
|
+
var redirectsApplied$ = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_11__apply_redirects__["a" /* applyRedirects */])(_this.injector, _this.configLoader, url, _this.config);
|
13037
13037
|
urlAndSnapshot$ = __WEBPACK_IMPORTED_MODULE_9_rxjs_operator_mergeMap__["mergeMap"].call(redirectsApplied$, function (appliedUrl) {
|
13038
13038
|
return __WEBPACK_IMPORTED_MODULE_8_rxjs_operator_map__["map"].call(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_15__recognize__["a" /* recognize */])(_this.rootComponentType, _this.config, appliedUrl, _this.serializeUrl(appliedUrl)), function (snapshot) {
|
13039
13039
|
_this.routerEvents.next(new RoutesRecognized(id, _this.serializeUrl(url), _this.serializeUrl(appliedUrl), snapshot));
|
@@ -31016,7 +31016,7 @@ var NumberFormatter = (function () {
|
|
31016
31016
|
}());
|
31017
31017
|
var DATE_FORMATS_SPLIT = /((?:[^yMLdHhmsazZEwGjJ']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|J+|j+|m+|s+|a|z|Z|G+|w+))(.*)/;
|
31018
31018
|
var PATTERN_ALIASES = {
|
31019
|
-
|
31019
|
+
yMMMdjms: datePartGetterFactory(combine([
|
31020
31020
|
digitCondition('year', 1),
|
31021
31021
|
nameCondition('month', 3),
|
31022
31022
|
digitCondition('day', 1),
|
@@ -31024,19 +31024,19 @@ var PATTERN_ALIASES = {
|
|
31024
31024
|
digitCondition('minute', 1),
|
31025
31025
|
digitCondition('second', 1),
|
31026
31026
|
])),
|
31027
|
-
|
31027
|
+
yMdjm: datePartGetterFactory(combine([
|
31028
31028
|
digitCondition('year', 1), digitCondition('month', 1), digitCondition('day', 1),
|
31029
31029
|
digitCondition('hour', 1), digitCondition('minute', 1)
|
31030
31030
|
])),
|
31031
|
-
|
31031
|
+
yMMMMEEEEd: datePartGetterFactory(combine([
|
31032
31032
|
digitCondition('year', 1), nameCondition('month', 4), nameCondition('weekday', 4),
|
31033
31033
|
digitCondition('day', 1)
|
31034
31034
|
])),
|
31035
|
-
|
31036
|
-
|
31037
|
-
|
31038
|
-
|
31039
|
-
|
31035
|
+
yMMMMd: datePartGetterFactory(combine([digitCondition('year', 1), nameCondition('month', 4), digitCondition('day', 1)])),
|
31036
|
+
yMMMd: datePartGetterFactory(combine([digitCondition('year', 1), nameCondition('month', 3), digitCondition('day', 1)])),
|
31037
|
+
yMd: datePartGetterFactory(combine([digitCondition('year', 1), digitCondition('month', 1), digitCondition('day', 1)])),
|
31038
|
+
jms: datePartGetterFactory(combine([digitCondition('hour', 1), digitCondition('second', 1), digitCondition('minute', 1)])),
|
31039
|
+
jm: datePartGetterFactory(combine([digitCondition('hour', 1), digitCondition('minute', 1)]))
|
31040
31040
|
};
|
31041
31041
|
var DATE_FORMATS = {
|
31042
31042
|
yyyy: datePartGetterFactory(digitCondition('year', 4)),
|
@@ -56852,31 +56852,27 @@ var NoMatch = (function () {
|
|
56852
56852
|
return NoMatch;
|
56853
56853
|
}());
|
56854
56854
|
var AbsoluteRedirect = (function () {
|
56855
|
-
function AbsoluteRedirect(
|
56856
|
-
this.
|
56855
|
+
function AbsoluteRedirect(segments) {
|
56856
|
+
this.segments = segments;
|
56857
56857
|
}
|
56858
56858
|
return AbsoluteRedirect;
|
56859
56859
|
}());
|
56860
56860
|
function noMatch(segmentGroup) {
|
56861
56861
|
return new __WEBPACK_IMPORTED_MODULE_0_rxjs_Observable__["Observable"](function (obs) { return obs.error(new NoMatch(segmentGroup)); });
|
56862
56862
|
}
|
56863
|
-
function absoluteRedirect(
|
56864
|
-
return new __WEBPACK_IMPORTED_MODULE_0_rxjs_Observable__["Observable"](function (obs) { return obs.error(new AbsoluteRedirect(
|
56865
|
-
}
|
56866
|
-
function namedOutletsRedirect(redirectTo) {
|
56867
|
-
return new __WEBPACK_IMPORTED_MODULE_0_rxjs_Observable__["Observable"](function (obs) { return obs.error(new Error("Only absolute redirects can have named outlets. redirectTo: '" + redirectTo + "'")); });
|
56863
|
+
function absoluteRedirect(segments) {
|
56864
|
+
return new __WEBPACK_IMPORTED_MODULE_0_rxjs_Observable__["Observable"](function (obs) { return obs.error(new AbsoluteRedirect(segments)); });
|
56868
56865
|
}
|
56869
56866
|
function canLoadFails(route) {
|
56870
56867
|
return new __WEBPACK_IMPORTED_MODULE_0_rxjs_Observable__["Observable"](function (obs) { return obs.error(new __WEBPACK_IMPORTED_MODULE_10__shared__["b" /* NavigationCancelingError */]("Cannot load children because the guard of the route \"path: '" + route.path + "'\" returned false")); });
|
56871
56868
|
}
|
56872
|
-
function applyRedirects(injector, configLoader,
|
56873
|
-
return new ApplyRedirects(injector, configLoader,
|
56869
|
+
function applyRedirects(injector, configLoader, urlTree, config) {
|
56870
|
+
return new ApplyRedirects(injector, configLoader, urlTree, config).apply();
|
56874
56871
|
}
|
56875
56872
|
var ApplyRedirects = (function () {
|
56876
|
-
function ApplyRedirects(injector, configLoader,
|
56873
|
+
function ApplyRedirects(injector, configLoader, urlTree, config) {
|
56877
56874
|
this.injector = injector;
|
56878
56875
|
this.configLoader = configLoader;
|
56879
|
-
this.urlSerializer = urlSerializer;
|
56880
56876
|
this.urlTree = urlTree;
|
56881
56877
|
this.config = config;
|
56882
56878
|
this.allowRedirects = true;
|
@@ -56884,13 +56880,14 @@ var ApplyRedirects = (function () {
|
|
56884
56880
|
ApplyRedirects.prototype.apply = function () {
|
56885
56881
|
var _this = this;
|
56886
56882
|
var expanded$ = this.expandSegmentGroup(this.injector, this.config, this.urlTree.root, __WEBPACK_IMPORTED_MODULE_10__shared__["a" /* PRIMARY_OUTLET */]);
|
56887
|
-
var urlTrees$ = __WEBPACK_IMPORTED_MODULE_6_rxjs_operator_map__["map"].call(expanded$, function (rootSegmentGroup) { return _this.createUrlTree(rootSegmentGroup
|
56883
|
+
var urlTrees$ = __WEBPACK_IMPORTED_MODULE_6_rxjs_operator_map__["map"].call(expanded$, function (rootSegmentGroup) { return _this.createUrlTree(rootSegmentGroup); });
|
56888
56884
|
return __WEBPACK_IMPORTED_MODULE_3_rxjs_operator_catch__["_catch"].call(urlTrees$, function (e) {
|
56889
56885
|
if (e instanceof AbsoluteRedirect) {
|
56890
56886
|
// after an absolute redirect we do not apply any more redirects!
|
56891
56887
|
_this.allowRedirects = false;
|
56888
|
+
var group = new __WEBPACK_IMPORTED_MODULE_11__url_tree__["a" /* UrlSegmentGroup */]([], (_a = {}, _a[__WEBPACK_IMPORTED_MODULE_10__shared__["a" /* PRIMARY_OUTLET */]] = new __WEBPACK_IMPORTED_MODULE_11__url_tree__["a" /* UrlSegmentGroup */](e.segments, {}), _a));
|
56892
56889
|
// we need to run matching, so we can fetch all lazy-loaded modules
|
56893
|
-
return _this.match(
|
56890
|
+
return _this.match(group);
|
56894
56891
|
}
|
56895
56892
|
else if (e instanceof NoMatch) {
|
56896
56893
|
throw _this.noMatchError(e);
|
@@ -56898,14 +56895,13 @@ var ApplyRedirects = (function () {
|
|
56898
56895
|
else {
|
56899
56896
|
throw e;
|
56900
56897
|
}
|
56898
|
+
var _a;
|
56901
56899
|
});
|
56902
56900
|
};
|
56903
|
-
ApplyRedirects.prototype.match = function (
|
56901
|
+
ApplyRedirects.prototype.match = function (segmentGroup) {
|
56904
56902
|
var _this = this;
|
56905
|
-
var expanded$ = this.expandSegmentGroup(this.injector, this.config,
|
56906
|
-
var mapped$ = __WEBPACK_IMPORTED_MODULE_6_rxjs_operator_map__["map"].call(expanded$, function (rootSegmentGroup) {
|
56907
|
-
return _this.createUrlTree(rootSegmentGroup, tree.queryParams, tree.fragment);
|
56908
|
-
});
|
56903
|
+
var expanded$ = this.expandSegmentGroup(this.injector, this.config, segmentGroup, __WEBPACK_IMPORTED_MODULE_10__shared__["a" /* PRIMARY_OUTLET */]);
|
56904
|
+
var mapped$ = __WEBPACK_IMPORTED_MODULE_6_rxjs_operator_map__["map"].call(expanded$, function (rootSegmentGroup) { return _this.createUrlTree(rootSegmentGroup); });
|
56909
56905
|
return __WEBPACK_IMPORTED_MODULE_3_rxjs_operator_catch__["_catch"].call(mapped$, function (e) {
|
56910
56906
|
if (e instanceof NoMatch) {
|
56911
56907
|
throw _this.noMatchError(e);
|
@@ -56918,11 +56914,11 @@ var ApplyRedirects = (function () {
|
|
56918
56914
|
ApplyRedirects.prototype.noMatchError = function (e) {
|
56919
56915
|
return new Error("Cannot match any routes. URL Segment: '" + e.segmentGroup + "'");
|
56920
56916
|
};
|
56921
|
-
ApplyRedirects.prototype.createUrlTree = function (rootCandidate
|
56917
|
+
ApplyRedirects.prototype.createUrlTree = function (rootCandidate) {
|
56922
56918
|
var root = rootCandidate.segments.length > 0 ?
|
56923
56919
|
new __WEBPACK_IMPORTED_MODULE_11__url_tree__["a" /* UrlSegmentGroup */]([], (_a = {}, _a[__WEBPACK_IMPORTED_MODULE_10__shared__["a" /* PRIMARY_OUTLET */]] = rootCandidate, _a)) :
|
56924
56920
|
rootCandidate;
|
56925
|
-
return new __WEBPACK_IMPORTED_MODULE_11__url_tree__["b" /* UrlTree */](root, queryParams, fragment);
|
56921
|
+
return new __WEBPACK_IMPORTED_MODULE_11__url_tree__["b" /* UrlTree */](root, this.urlTree.queryParams, this.urlTree.fragment);
|
56926
56922
|
var _a;
|
56927
56923
|
};
|
56928
56924
|
ApplyRedirects.prototype.expandSegmentGroup = function (injector, routes, segmentGroup, outlet) {
|
@@ -56989,31 +56985,25 @@ var ApplyRedirects = (function () {
|
|
56989
56985
|
}
|
56990
56986
|
};
|
56991
56987
|
ApplyRedirects.prototype.expandWildCardWithParamsAgainstRouteUsingRedirect = function (injector, routes, route, outlet) {
|
56992
|
-
var
|
56993
|
-
var newTree = this.applyRedirectCommands([], route.redirectTo, {});
|
56988
|
+
var newSegments = applyRedirectCommands([], route.redirectTo, {});
|
56994
56989
|
if (route.redirectTo.startsWith('/')) {
|
56995
|
-
return absoluteRedirect(
|
56990
|
+
return absoluteRedirect(newSegments);
|
56996
56991
|
}
|
56997
56992
|
else {
|
56998
|
-
|
56999
|
-
|
57000
|
-
return _this.expandSegment(injector, group, routes, newSegments, outlet, false);
|
57001
|
-
});
|
56993
|
+
var group = new __WEBPACK_IMPORTED_MODULE_11__url_tree__["a" /* UrlSegmentGroup */](newSegments, {});
|
56994
|
+
return this.expandSegment(injector, group, routes, newSegments, outlet, false);
|
57002
56995
|
}
|
57003
56996
|
};
|
57004
56997
|
ApplyRedirects.prototype.expandRegularSegmentAgainstRouteUsingRedirect = function (injector, segmentGroup, routes, route, segments, outlet) {
|
57005
|
-
var _this = this;
|
57006
56998
|
var _a = match(segmentGroup, route, segments), matched = _a.matched, consumedSegments = _a.consumedSegments, lastChild = _a.lastChild, positionalParamSegments = _a.positionalParamSegments;
|
57007
56999
|
if (!matched)
|
57008
57000
|
return noMatch(segmentGroup);
|
57009
|
-
var
|
57001
|
+
var newSegments = applyRedirectCommands(consumedSegments, route.redirectTo, positionalParamSegments);
|
57010
57002
|
if (route.redirectTo.startsWith('/')) {
|
57011
|
-
return absoluteRedirect(
|
57003
|
+
return absoluteRedirect(newSegments);
|
57012
57004
|
}
|
57013
57005
|
else {
|
57014
|
-
return
|
57015
|
-
return _this.expandSegment(injector, segmentGroup, routes, newSegments.concat(segments.slice(lastChild)), outlet, false);
|
57016
|
-
});
|
57006
|
+
return this.expandSegment(injector, segmentGroup, routes, newSegments.concat(segments.slice(lastChild)), outlet, false);
|
57017
57007
|
}
|
57018
57008
|
};
|
57019
57009
|
ApplyRedirects.prototype.matchSegmentAgainstRoute = function (injector, rawSegmentGroup, route, segments) {
|
@@ -57080,74 +57070,6 @@ var ApplyRedirects = (function () {
|
|
57080
57070
|
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2_rxjs_observable_of__["of"])(new __WEBPACK_IMPORTED_MODULE_9__router_config_loader__["a" /* LoadedRouterConfig */]([], injector, null, null));
|
57081
57071
|
}
|
57082
57072
|
};
|
57083
|
-
ApplyRedirects.prototype.lineralizeSegments = function (route, urlTree) {
|
57084
|
-
var res = [];
|
57085
|
-
var c = urlTree.root;
|
57086
|
-
while (true) {
|
57087
|
-
res = res.concat(c.segments);
|
57088
|
-
if (c.numberOfChildren === 0) {
|
57089
|
-
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2_rxjs_observable_of__["of"])(res);
|
57090
|
-
}
|
57091
|
-
else if (c.numberOfChildren > 1 || !c.children[__WEBPACK_IMPORTED_MODULE_10__shared__["a" /* PRIMARY_OUTLET */]]) {
|
57092
|
-
return namedOutletsRedirect(route.redirectTo);
|
57093
|
-
}
|
57094
|
-
else {
|
57095
|
-
c = c.children[__WEBPACK_IMPORTED_MODULE_10__shared__["a" /* PRIMARY_OUTLET */]];
|
57096
|
-
}
|
57097
|
-
}
|
57098
|
-
};
|
57099
|
-
ApplyRedirects.prototype.applyRedirectCommands = function (segments, redirectTo, posParams) {
|
57100
|
-
var t = this.urlSerializer.parse(redirectTo);
|
57101
|
-
return this.applyRedirectCreatreUrlTree(redirectTo, this.urlSerializer.parse(redirectTo), segments, posParams);
|
57102
|
-
};
|
57103
|
-
ApplyRedirects.prototype.applyRedirectCreatreUrlTree = function (redirectTo, urlTree, segments, posParams) {
|
57104
|
-
var newRoot = this.createSegmentGroup(redirectTo, urlTree.root, segments, posParams);
|
57105
|
-
return new __WEBPACK_IMPORTED_MODULE_11__url_tree__["b" /* UrlTree */](newRoot, this.createQueryParams(urlTree.queryParams, this.urlTree.queryParams), urlTree.fragment);
|
57106
|
-
};
|
57107
|
-
ApplyRedirects.prototype.createQueryParams = function (redirectToParams, actualParams) {
|
57108
|
-
var res = {};
|
57109
|
-
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_12__utils_collection__["d" /* forEach */])(redirectToParams, function (v, k) {
|
57110
|
-
if (v.startsWith(':')) {
|
57111
|
-
res[k] = actualParams[v.substring(1)];
|
57112
|
-
}
|
57113
|
-
else {
|
57114
|
-
res[k] = v;
|
57115
|
-
}
|
57116
|
-
});
|
57117
|
-
return res;
|
57118
|
-
};
|
57119
|
-
ApplyRedirects.prototype.createSegmentGroup = function (redirectTo, group, segments, posParams) {
|
57120
|
-
var _this = this;
|
57121
|
-
var updatedSegments = this.createSegments(redirectTo, group.segments, segments, posParams);
|
57122
|
-
var children = {};
|
57123
|
-
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_12__utils_collection__["d" /* forEach */])(group.children, function (child, name) {
|
57124
|
-
children[name] = _this.createSegmentGroup(redirectTo, child, segments, posParams);
|
57125
|
-
});
|
57126
|
-
return new __WEBPACK_IMPORTED_MODULE_11__url_tree__["a" /* UrlSegmentGroup */](updatedSegments, children);
|
57127
|
-
};
|
57128
|
-
ApplyRedirects.prototype.createSegments = function (redirectTo, redirectToSegments, actualSegments, posParams) {
|
57129
|
-
var _this = this;
|
57130
|
-
return redirectToSegments.map(function (s) { return s.path.startsWith(':') ? _this.findPosParam(redirectTo, s, posParams) :
|
57131
|
-
_this.findOrReturn(s, actualSegments); });
|
57132
|
-
};
|
57133
|
-
ApplyRedirects.prototype.findPosParam = function (redirectTo, redirectToUrlSegment, posParams) {
|
57134
|
-
var pos = posParams[redirectToUrlSegment.path.substring(1)];
|
57135
|
-
if (!pos)
|
57136
|
-
throw new Error("Cannot redirect to '" + redirectTo + "'. Cannot find '" + redirectToUrlSegment.path + "'.");
|
57137
|
-
return pos;
|
57138
|
-
};
|
57139
|
-
ApplyRedirects.prototype.findOrReturn = function (redirectToUrlSegment, actualSegments) {
|
57140
|
-
var idx = 0;
|
57141
|
-
for (var _i = 0, actualSegments_1 = actualSegments; _i < actualSegments_1.length; _i++) {
|
57142
|
-
var s = actualSegments_1[_i];
|
57143
|
-
if (s.path === redirectToUrlSegment.path) {
|
57144
|
-
actualSegments.splice(idx);
|
57145
|
-
return s;
|
57146
|
-
}
|
57147
|
-
idx++;
|
57148
|
-
}
|
57149
|
-
return redirectToUrlSegment;
|
57150
|
-
};
|
57151
57073
|
return ApplyRedirects;
|
57152
57074
|
}());
|
57153
57075
|
function runGuards(injector, route) {
|
@@ -57186,6 +57108,38 @@ function match(segmentGroup, route, segments) {
|
|
57186
57108
|
positionalParamSegments: res.posParams
|
57187
57109
|
};
|
57188
57110
|
}
|
57111
|
+
function applyRedirectCommands(segments, redirectTo, posParams) {
|
57112
|
+
var r = redirectTo.startsWith('/') ? redirectTo.substring(1) : redirectTo;
|
57113
|
+
if (r === '') {
|
57114
|
+
return [];
|
57115
|
+
}
|
57116
|
+
else {
|
57117
|
+
return createSegments(redirectTo, r.split('/'), segments, posParams);
|
57118
|
+
}
|
57119
|
+
}
|
57120
|
+
function createSegments(redirectTo, parts, segments, posParams) {
|
57121
|
+
return parts.map(function (p) { return p.startsWith(':') ? findPosParam(p, posParams, redirectTo) :
|
57122
|
+
findOrCreateSegment(p, segments); });
|
57123
|
+
}
|
57124
|
+
function findPosParam(part, posParams, redirectTo) {
|
57125
|
+
var paramName = part.substring(1);
|
57126
|
+
var pos = posParams[paramName];
|
57127
|
+
if (!pos)
|
57128
|
+
throw new Error("Cannot redirect to '" + redirectTo + "'. Cannot find '" + part + "'.");
|
57129
|
+
return pos;
|
57130
|
+
}
|
57131
|
+
function findOrCreateSegment(part, segments) {
|
57132
|
+
var idx = 0;
|
57133
|
+
for (var _i = 0, segments_1 = segments; _i < segments_1.length; _i++) {
|
57134
|
+
var s = segments_1[_i];
|
57135
|
+
if (s.path === part) {
|
57136
|
+
segments.splice(idx);
|
57137
|
+
return s;
|
57138
|
+
}
|
57139
|
+
idx++;
|
57140
|
+
}
|
57141
|
+
return new __WEBPACK_IMPORTED_MODULE_11__url_tree__["c" /* UrlSegment */](part, {});
|
57142
|
+
}
|
57189
57143
|
function split(segmentGroup, consumedSegments, slicedSegments, config) {
|
57190
57144
|
if (slicedSegments.length > 0 &&
|
57191
57145
|
containsEmptyPathRedirectsWithNamedOutlets(segmentGroup, slicedSegments, config)) {
|