@thzero/library_server 0.18.6 → 0.18.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +93 -93
  2. package/boot/index.js +466 -466
  3. package/boot/plugins/admin/index.js +6 -6
  4. package/boot/plugins/admin/news.js +33 -33
  5. package/boot/plugins/admin/users.js +33 -33
  6. package/boot/plugins/api.js +64 -64
  7. package/boot/plugins/apiFront.js +31 -31
  8. package/boot/plugins/index.js +70 -70
  9. package/boot/plugins/news.js +44 -44
  10. package/boot/plugins/users.js +46 -46
  11. package/boot/plugins/usersExtended.js +32 -32
  12. package/constants.js +45 -45
  13. package/data/baseNews.js +42 -42
  14. package/data/baseSettingsUser.js +9 -9
  15. package/data/baseUser.js +28 -28
  16. package/data/index.js +24 -24
  17. package/data/named.js +20 -20
  18. package/errors/tokenExpired.js +7 -7
  19. package/license.md +8 -8
  20. package/openSource.js +66 -66
  21. package/package.json +38 -38
  22. package/repository/index.js +182 -182
  23. package/repository/usageMetrics/devnull.js +16 -16
  24. package/routes/index.js +76 -76
  25. package/service/admin/baseNews.js +45 -45
  26. package/service/admin/index.js +130 -130
  27. package/service/admin/news.js +6 -6
  28. package/service/admin/users.js +107 -107
  29. package/service/baseSecurity.js +183 -183
  30. package/service/baseUser.js +122 -122
  31. package/service/communication.js +6 -6
  32. package/service/config.js +37 -37
  33. package/service/crypto.js +16 -16
  34. package/service/discovery/index.js +6 -6
  35. package/service/discovery/resources/index.js +101 -101
  36. package/service/external.js +19 -19
  37. package/service/externalRest.js +19 -19
  38. package/service/index.js +20 -20
  39. package/service/monitoring.js +12 -12
  40. package/service/news/base.js +59 -59
  41. package/service/news/index.js +6 -6
  42. package/service/news/validation/index.js +6 -6
  43. package/service/plans.js +31 -31
  44. package/service/restCommunication.js +21 -21
  45. package/service/usageMetrics.js +84 -84
  46. package/service/utility.js +188 -188
  47. package/service/version.js +37 -37
  48. package/utility/injector.js +59 -59
  49. package/utility/internalIp/index.js +48 -48
  50. package/utility/list/doubleLinked.js +88 -88
  51. package/utility/list/priorityQueue.js +109 -109
  52. package/utility/list/queue.js +72 -72
  53. package/utility/os.js +20 -20
@@ -1,72 +1,72 @@
1
- /*
2
-
3
- Queue.js
4
-
5
- A function to represent a queue
6
-
7
- Created by Kate Morley - http://code.iamkate.com/ - and released under the terms
8
- of the CC0 1.0 Universal legal code:
9
-
10
- http://creativecommons.org/publicdomain/zero/1.0/legalcode
11
-
12
- */
13
-
14
- /* Creates a new queue. A queue is a first-in-first-out (FIFO) data structure -
15
- * items are added to the end of the queue and removed from the front.
16
- */
17
- function Queue(){
18
-
19
- // initialise the queue and offset
20
- var queue = [];
21
- var offset = 0;
22
-
23
- // Returns the length of the queue.
24
- this.length = function(){
25
- return (queue.length - offset);
26
- }
27
-
28
- // Returns true if the queue is empty, and false otherwise.
29
- this.isEmpty = function(){
30
- return (queue.length == 0);
31
- }
32
-
33
- /* Enqueues the specified item. The parameter is:
34
- *
35
- * item - the item to enqueue
36
- */
37
- this.enqueue = function(item){
38
- queue.push(item);
39
- }
40
-
41
- /* Dequeues an item and returns it. If the queue is empty, the value
42
- * 'undefined' is returned.
43
- */
44
- this.dequeue = function(){
45
-
46
- // if the queue is empty, return immediately
47
- if (queue.length == 0) return undefined;
48
-
49
- // store the item at the front of the queue
50
- var item = queue[offset];
51
-
52
- // increment the offset and remove the free space if necessary
53
- if (++ offset * 2 >= queue.length){
54
- queue = queue.slice(offset);
55
- offset = 0;
56
- }
57
-
58
- // return the dequeued item
59
- return item;
60
-
61
- }
62
-
63
- /* Returns the item at the front of the queue (without dequeuing it). If the
64
- * queue is empty then undefined is returned.
65
- */
66
- this.peek = function(){
67
- return (queue.length > 0 ? queue[offset] : undefined);
68
- }
69
-
70
- }
71
-
72
- export default Queue;
1
+ /*
2
+
3
+ Queue.js
4
+
5
+ A function to represent a queue
6
+
7
+ Created by Kate Morley - http://code.iamkate.com/ - and released under the terms
8
+ of the CC0 1.0 Universal legal code:
9
+
10
+ http://creativecommons.org/publicdomain/zero/1.0/legalcode
11
+
12
+ */
13
+
14
+ /* Creates a new queue. A queue is a first-in-first-out (FIFO) data structure -
15
+ * items are added to the end of the queue and removed from the front.
16
+ */
17
+ function Queue(){
18
+
19
+ // initialise the queue and offset
20
+ var queue = [];
21
+ var offset = 0;
22
+
23
+ // Returns the length of the queue.
24
+ this.length = function(){
25
+ return (queue.length - offset);
26
+ }
27
+
28
+ // Returns true if the queue is empty, and false otherwise.
29
+ this.isEmpty = function(){
30
+ return (queue.length == 0);
31
+ }
32
+
33
+ /* Enqueues the specified item. The parameter is:
34
+ *
35
+ * item - the item to enqueue
36
+ */
37
+ this.enqueue = function(item){
38
+ queue.push(item);
39
+ }
40
+
41
+ /* Dequeues an item and returns it. If the queue is empty, the value
42
+ * 'undefined' is returned.
43
+ */
44
+ this.dequeue = function(){
45
+
46
+ // if the queue is empty, return immediately
47
+ if (queue.length == 0) return undefined;
48
+
49
+ // store the item at the front of the queue
50
+ var item = queue[offset];
51
+
52
+ // increment the offset and remove the free space if necessary
53
+ if (++ offset * 2 >= queue.length){
54
+ queue = queue.slice(offset);
55
+ offset = 0;
56
+ }
57
+
58
+ // return the dequeued item
59
+ return item;
60
+
61
+ }
62
+
63
+ /* Returns the item at the front of the queue (without dequeuing it). If the
64
+ * queue is empty then undefined is returned.
65
+ */
66
+ this.peek = function(){
67
+ return (queue.length > 0 ? queue[offset] : undefined);
68
+ }
69
+
70
+ }
71
+
72
+ export default Queue;
package/utility/os.js CHANGED
@@ -1,20 +1,20 @@
1
- import os from 'os';
2
-
3
- class OsUtility {
4
- static get isLinux() {
5
- const type = os.type();
6
- return (/^linux/i.test(type) || /^freebsd/i.test(type) || /^darwin/i.test(type));
7
- }
8
-
9
- static get isMac() {
10
- const type = os.type();
11
- return (/^darwin/i.test(type));
12
- }
13
-
14
- static get isWin() {
15
- const type = os.type();
16
- return (/^win/i.test(type));
17
- }
18
- }
19
-
20
- export default OsUtility;
1
+ import os from 'os';
2
+
3
+ class OsUtility {
4
+ static get isLinux() {
5
+ const type = os.type();
6
+ return (/^linux/i.test(type) || /^freebsd/i.test(type) || /^darwin/i.test(type));
7
+ }
8
+
9
+ static get isMac() {
10
+ const type = os.type();
11
+ return (/^darwin/i.test(type));
12
+ }
13
+
14
+ static get isWin() {
15
+ const type = os.type();
16
+ return (/^win/i.test(type));
17
+ }
18
+ }
19
+
20
+ export default OsUtility;