tiro-notes 1.0.9 → 1.0.10

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 (214) hide show
  1. package/README.md +75 -0
  2. package/cli.js +308 -2
  3. package/client/appicons/icons/mac/icon.icns +0 -0
  4. package/client/appicons/icons/png/1024x1024.png +0 -0
  5. package/client/appicons/icons/png/128x128.png +0 -0
  6. package/client/appicons/icons/png/16x16.png +0 -0
  7. package/client/appicons/icons/png/24x24.png +0 -0
  8. package/client/appicons/icons/png/256x256.png +0 -0
  9. package/client/appicons/icons/png/32x32.png +0 -0
  10. package/client/appicons/icons/png/48x48.png +0 -0
  11. package/client/appicons/icons/png/512x512.png +0 -0
  12. package/client/appicons/icons/png/64x64.png +0 -0
  13. package/client/appicons/icons/win/icon.ico +0 -0
  14. package/client/appicons/tiro_icon.icns +0 -0
  15. package/client/appicons/tiro_icon.ico +0 -0
  16. package/client/appicons/tiro_icon.png +0 -0
  17. package/client/asset-manifest.json +143 -0
  18. package/client/custom_icons/bottom-left.png +0 -0
  19. package/client/custom_icons/bottom-right.png +0 -0
  20. package/client/custom_icons/bottom.png +0 -0
  21. package/client/custom_icons/check.svg +7 -0
  22. package/client/custom_icons/left.png +0 -0
  23. package/client/custom_icons/line.svg +13 -0
  24. package/client/custom_icons/right.png +0 -0
  25. package/client/custom_icons/top-left.png +0 -0
  26. package/client/custom_icons/top-right.png +0 -0
  27. package/client/custom_icons/top.png +0 -0
  28. package/client/custom_icons/uncheck.svg +7 -0
  29. package/client/custom_icons/view-1.svg +18 -0
  30. package/client/custom_icons/view-2.svg +13 -0
  31. package/client/custom_icons/view-3.svg +13 -0
  32. package/client/custom_icons/view-4.svg +18 -0
  33. package/client/favicon.png +0 -0
  34. package/client/icon-192x192.png +0 -0
  35. package/client/icon-256x256.png +0 -0
  36. package/client/icon-384x384.png +0 -0
  37. package/client/icon-512x512.png +0 -0
  38. package/client/index.html +1 -0
  39. package/client/manifest.json +31 -0
  40. package/client/manifest.webmanifest +31 -0
  41. package/client/service-worker.js +63 -0
  42. package/client/static/css/12.54474f95.chunk.css +5 -0
  43. package/client/static/js/0.8818db75.chunk.js +1 -0
  44. package/client/static/js/1.dc212257.chunk.js +1 -0
  45. package/client/static/js/100.da1920be.chunk.js +1 -0
  46. package/client/static/js/101.2d460d94.chunk.js +1 -0
  47. package/client/static/js/102.f9a16c85.chunk.js +1 -0
  48. package/client/static/js/103.d1ea5ba4.chunk.js +1 -0
  49. package/client/static/js/104.a137d37d.chunk.js +1 -0
  50. package/client/static/js/105.28c03a34.chunk.js +1 -0
  51. package/client/static/js/106.37c81321.chunk.js +1 -0
  52. package/client/static/js/107.3041ab4b.chunk.js +1 -0
  53. package/client/static/js/108.ac4ab4c5.chunk.js +1 -0
  54. package/client/static/js/109.de1a8c92.chunk.js +1 -0
  55. package/client/static/js/110.e0fd9e71.chunk.js +1 -0
  56. package/client/static/js/12.69353b54.chunk.js +2 -0
  57. package/client/static/js/12.69353b54.chunk.js.LICENSE.txt +115 -0
  58. package/client/static/js/13.11233f89.chunk.js +1 -0
  59. package/client/static/js/14.4c6fecc8.chunk.js +1 -0
  60. package/client/static/js/15.54cce0d8.chunk.js +1 -0
  61. package/client/static/js/16.517ad23b.chunk.js +1 -0
  62. package/client/static/js/17.4e6d8e22.chunk.js +1 -0
  63. package/client/static/js/18.99a37042.chunk.js +1 -0
  64. package/client/static/js/19.004342b7.chunk.js +1 -0
  65. package/client/static/js/2.6e78ea89.chunk.js +1 -0
  66. package/client/static/js/20.400635c6.chunk.js +1 -0
  67. package/client/static/js/21.377bde95.chunk.js +1 -0
  68. package/client/static/js/22.97f27129.chunk.js +1 -0
  69. package/client/static/js/23.4ad8d0ec.chunk.js +1 -0
  70. package/client/static/js/24.d47656da.chunk.js +1 -0
  71. package/client/static/js/25.26949283.chunk.js +1 -0
  72. package/client/static/js/26.7e126fb1.chunk.js +1 -0
  73. package/client/static/js/27.85580870.chunk.js +1 -0
  74. package/client/static/js/28.72c93db3.chunk.js +1 -0
  75. package/client/static/js/29.80e40a62.chunk.js +1 -0
  76. package/client/static/js/3.664f336f.chunk.js +1 -0
  77. package/client/static/js/30.763b695b.chunk.js +1 -0
  78. package/client/static/js/31.8eaffd3a.chunk.js +1 -0
  79. package/client/static/js/32.cff2eb9f.chunk.js +1 -0
  80. package/client/static/js/33.70a11c37.chunk.js +1 -0
  81. package/client/static/js/34.ff9d1883.chunk.js +1 -0
  82. package/client/static/js/35.37436f63.chunk.js +1 -0
  83. package/client/static/js/36.83f9e51c.chunk.js +1 -0
  84. package/client/static/js/37.e9b848bc.chunk.js +1 -0
  85. package/client/static/js/38.80412b61.chunk.js +1 -0
  86. package/client/static/js/39.5299241a.chunk.js +1 -0
  87. package/client/static/js/4.328dd658.chunk.js +1 -0
  88. package/client/static/js/40.463e2602.chunk.js +1 -0
  89. package/client/static/js/41.87cc1e1b.chunk.js +1 -0
  90. package/client/static/js/42.9d2aaaf8.chunk.js +1 -0
  91. package/client/static/js/43.f55d6cd8.chunk.js +1 -0
  92. package/client/static/js/44.c769115a.chunk.js +1 -0
  93. package/client/static/js/45.cfaccbdb.chunk.js +1 -0
  94. package/client/static/js/46.04848b38.chunk.js +1 -0
  95. package/client/static/js/47.43108ad8.chunk.js +1 -0
  96. package/client/static/js/48.b0036b11.chunk.js +1 -0
  97. package/client/static/js/49.57012f8f.chunk.js +1 -0
  98. package/client/static/js/5.307b6480.chunk.js +1 -0
  99. package/client/static/js/50.d61bf562.chunk.js +1 -0
  100. package/client/static/js/51.8c2a739c.chunk.js +1 -0
  101. package/client/static/js/52.d60d6518.chunk.js +1 -0
  102. package/client/static/js/53.33e83e10.chunk.js +1 -0
  103. package/client/static/js/54.30726307.chunk.js +1 -0
  104. package/client/static/js/55.7e89444b.chunk.js +1 -0
  105. package/client/static/js/56.ad8541df.chunk.js +1 -0
  106. package/client/static/js/57.9fcc16d5.chunk.js +1 -0
  107. package/client/static/js/58.3a4458c1.chunk.js +1 -0
  108. package/client/static/js/59.d5ea8728.chunk.js +1 -0
  109. package/client/static/js/6.db56389b.chunk.js +1 -0
  110. package/client/static/js/60.96160883.chunk.js +1 -0
  111. package/client/static/js/61.59a3090c.chunk.js +1 -0
  112. package/client/static/js/62.858318f5.chunk.js +1 -0
  113. package/client/static/js/63.443b52f8.chunk.js +1 -0
  114. package/client/static/js/64.f67bbf85.chunk.js +1 -0
  115. package/client/static/js/65.f90a3a33.chunk.js +1 -0
  116. package/client/static/js/66.fcf111a8.chunk.js +1 -0
  117. package/client/static/js/67.f0af4760.chunk.js +1 -0
  118. package/client/static/js/68.4447a6c0.chunk.js +1 -0
  119. package/client/static/js/69.f92b446d.chunk.js +1 -0
  120. package/client/static/js/7.83cb847e.chunk.js +1 -0
  121. package/client/static/js/70.fc10f889.chunk.js +1 -0
  122. package/client/static/js/71.0b66ff83.chunk.js +1 -0
  123. package/client/static/js/72.75b6477f.chunk.js +1 -0
  124. package/client/static/js/73.ba5cd0ec.chunk.js +1 -0
  125. package/client/static/js/74.69ee5648.chunk.js +1 -0
  126. package/client/static/js/75.0ee213ed.chunk.js +1 -0
  127. package/client/static/js/76.03cc8251.chunk.js +1 -0
  128. package/client/static/js/77.9e0c615b.chunk.js +1 -0
  129. package/client/static/js/78.e39822e2.chunk.js +1 -0
  130. package/client/static/js/79.47712414.chunk.js +1 -0
  131. package/client/static/js/8.959dc24d.chunk.js +1 -0
  132. package/client/static/js/80.03d3c44a.chunk.js +1 -0
  133. package/client/static/js/81.3e86dcfc.chunk.js +1 -0
  134. package/client/static/js/82.d04a34d3.chunk.js +1 -0
  135. package/client/static/js/83.ed876d1d.chunk.js +1 -0
  136. package/client/static/js/84.22e9c594.chunk.js +1 -0
  137. package/client/static/js/85.d6790ffd.chunk.js +1 -0
  138. package/client/static/js/86.f5ca5c0b.chunk.js +1 -0
  139. package/client/static/js/87.6dbf41c6.chunk.js +1 -0
  140. package/client/static/js/88.0da244ee.chunk.js +1 -0
  141. package/client/static/js/89.40ea9ef2.chunk.js +1 -0
  142. package/client/static/js/9.d4911eb8.chunk.js +1 -0
  143. package/client/static/js/90.58b50413.chunk.js +1 -0
  144. package/client/static/js/91.d0607983.chunk.js +1 -0
  145. package/client/static/js/92.b1941812.chunk.js +1 -0
  146. package/client/static/js/93.cae75383.chunk.js +1 -0
  147. package/client/static/js/94.babda4ae.chunk.js +1 -0
  148. package/client/static/js/95.0a85c04f.chunk.js +1 -0
  149. package/client/static/js/96.e2d807e4.chunk.js +1 -0
  150. package/client/static/js/97.37813ebb.chunk.js +1 -0
  151. package/client/static/js/98.6df7c8e0.chunk.js +1 -0
  152. package/client/static/js/99.62e4c9c4.chunk.js +1 -0
  153. package/client/static/js/main.abaedb84.chunk.js +1 -0
  154. package/client/static/js/runtime-main.057f2c94.js +1 -0
  155. package/client/static/media/book-solid.87f5b737.svg +1 -0
  156. package/client/static/media/compact-disc-solid.55b6e50c.svg +1 -0
  157. package/client/static/media/deco-bg-map.7ca9103b.png +0 -0
  158. package/client/static/media/fa-brands-400.150de8ea.ttf +0 -0
  159. package/client/static/media/fa-brands-400.e033a13e.woff2 +0 -0
  160. package/client/static/media/fa-regular-400.3223dc79.woff2 +0 -0
  161. package/client/static/media/fa-regular-400.d8747423.ttf +0 -0
  162. package/client/static/media/fa-solid-900.4a2cd718.ttf +0 -0
  163. package/client/static/media/fa-solid-900.bb975c96.woff2 +0 -0
  164. package/client/static/media/fa-v4compatibility.0e3a648b.ttf +0 -0
  165. package/client/static/media/fa-v4compatibility.68577e40.woff2 +0 -0
  166. package/client/static/media/file-audio-solid.a76f99f0.svg +1 -0
  167. package/client/static/media/file-code-solid.62b467ac.svg +1 -0
  168. package/client/static/media/file-excel-solid.217d73db.svg +1 -0
  169. package/client/static/media/file-pdf-solid.0a9d75fe.svg +1 -0
  170. package/client/static/media/file-powerpoint-solid.4d969453.svg +1 -0
  171. package/client/static/media/file-solid.6415173e.svg +1 -0
  172. package/client/static/media/file-video-solid.312288cf.svg +1 -0
  173. package/client/static/media/file-word-solid.9228e1ff.svg +1 -0
  174. package/client/static/media/file-zipper-solid.7db57917.svg +1 -0
  175. package/client/static/media/globe-africa-solid.0ad34146.svg +1 -0
  176. package/client/static/media/link-solid.7b689dbd.svg +1 -0
  177. package/client/static/media/open-sans-all-400-normal.cb2542fc.woff +0 -0
  178. package/client/static/media/open-sans-all-700-normal.105e4309.woff +0 -0
  179. package/client/static/media/open-sans-all-800-normal.86e783c7.woff +0 -0
  180. package/client/static/media/open-sans-cyrillic-400-normal.5a546777.woff2 +0 -0
  181. package/client/static/media/open-sans-cyrillic-700-normal.2cf6253f.woff2 +0 -0
  182. package/client/static/media/open-sans-cyrillic-800-normal.41902933.woff2 +0 -0
  183. package/client/static/media/open-sans-cyrillic-ext-400-normal.01b11c56.woff2 +0 -0
  184. package/client/static/media/open-sans-cyrillic-ext-700-normal.00b4dd17.woff2 +0 -0
  185. package/client/static/media/open-sans-cyrillic-ext-800-normal.2c1c4cc5.woff2 +0 -0
  186. package/client/static/media/open-sans-greek-400-normal.3064bf7e.woff2 +0 -0
  187. package/client/static/media/open-sans-greek-700-normal.a0312547.woff2 +0 -0
  188. package/client/static/media/open-sans-greek-800-normal.d60c6496.woff2 +0 -0
  189. package/client/static/media/open-sans-greek-ext-400-normal.1ed998a4.woff2 +0 -0
  190. package/client/static/media/open-sans-greek-ext-700-normal.8850c90c.woff2 +0 -0
  191. package/client/static/media/open-sans-greek-ext-800-normal.fe3583f2.woff2 +0 -0
  192. package/client/static/media/open-sans-hebrew-400-normal.daafcec8.woff2 +0 -0
  193. package/client/static/media/open-sans-hebrew-700-normal.3befb44d.woff2 +0 -0
  194. package/client/static/media/open-sans-hebrew-800-normal.bfe88fed.woff2 +0 -0
  195. package/client/static/media/open-sans-latin-400-normal.a1535f45.woff2 +0 -0
  196. package/client/static/media/open-sans-latin-700-normal.b245bc85.woff2 +0 -0
  197. package/client/static/media/open-sans-latin-800-normal.185f6b03.woff2 +0 -0
  198. package/client/static/media/open-sans-latin-ext-400-normal.ccfa20f8.woff2 +0 -0
  199. package/client/static/media/open-sans-latin-ext-700-normal.64471a17.woff2 +0 -0
  200. package/client/static/media/open-sans-latin-ext-800-normal.988eae1a.woff2 +0 -0
  201. package/client/static/media/open-sans-vietnamese-400-normal.473f6b09.woff2 +0 -0
  202. package/client/static/media/open-sans-vietnamese-700-normal.b4c5968d.woff2 +0 -0
  203. package/client/static/media/open-sans-vietnamese-800-normal.27b69d87.woff2 +0 -0
  204. package/client/static/media/search-solid.cc51b702.svg +1 -0
  205. package/client/tiro-local.crt +20 -0
  206. package/package.json +26 -11
  207. package/server/ssl/tiro-local.crt +18 -0
  208. package/server/ssl/tiro-local.key +28 -0
  209. package/server/tiro-server.js +2 -0
  210. package/server/tiro-server.js.LICENSE.txt +315 -0
  211. package/shared.helpers.build.js +177 -0
  212. package/index.html +0 -0
  213. package/index.js +0 -4
  214. package/package.json~ +0 -13
@@ -0,0 +1,315 @@
1
+ /*
2
+ object-assign
3
+ (c) Sindre Sorhus
4
+ @license MIT
5
+ */
6
+
7
+ /*!
8
+ * Timm
9
+ *
10
+ * Immutability helpers with fast reads and acceptable writes.
11
+ *
12
+ * @copyright Guillermo Grau Panea 2016
13
+ * @license MIT
14
+ */
15
+
16
+ /*!
17
+ * accepts
18
+ * Copyright(c) 2014 Jonathan Ong
19
+ * Copyright(c) 2015 Douglas Christopher Wilson
20
+ * MIT Licensed
21
+ */
22
+
23
+ /*!
24
+ * base64id v0.1.0
25
+ */
26
+
27
+ /*!
28
+ * body-parser
29
+ * Copyright(c) 2014 Jonathan Ong
30
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
31
+ * MIT Licensed
32
+ */
33
+
34
+ /*!
35
+ * body-parser
36
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
37
+ * MIT Licensed
38
+ */
39
+
40
+ /*!
41
+ * bytes
42
+ * Copyright(c) 2012-2014 TJ Holowaychuk
43
+ * Copyright(c) 2015 Jed Watson
44
+ * MIT Licensed
45
+ */
46
+
47
+ /*!
48
+ * compressible
49
+ * Copyright(c) 2013 Jonathan Ong
50
+ * Copyright(c) 2014 Jeremiah Senkpiel
51
+ * Copyright(c) 2015 Douglas Christopher Wilson
52
+ * MIT Licensed
53
+ */
54
+
55
+ /*!
56
+ * compression
57
+ * Copyright(c) 2010 Sencha Inc.
58
+ * Copyright(c) 2011 TJ Holowaychuk
59
+ * Copyright(c) 2014 Jonathan Ong
60
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
61
+ * MIT Licensed
62
+ */
63
+
64
+ /*!
65
+ * content-disposition
66
+ * Copyright(c) 2014-2017 Douglas Christopher Wilson
67
+ * MIT Licensed
68
+ */
69
+
70
+ /*!
71
+ * content-type
72
+ * Copyright(c) 2015 Douglas Christopher Wilson
73
+ * MIT Licensed
74
+ */
75
+
76
+ /*!
77
+ * cookie
78
+ * Copyright(c) 2012-2014 Roman Shtylman
79
+ * Copyright(c) 2015 Douglas Christopher Wilson
80
+ * MIT Licensed
81
+ */
82
+
83
+ /*!
84
+ * depd
85
+ * Copyright(c) 2014-2018 Douglas Christopher Wilson
86
+ * MIT Licensed
87
+ */
88
+
89
+ /*!
90
+ * destroy
91
+ * Copyright(c) 2014 Jonathan Ong
92
+ * Copyright(c) 2015-2022 Douglas Christopher Wilson
93
+ * MIT Licensed
94
+ */
95
+
96
+ /*!
97
+ * ee-first
98
+ * Copyright(c) 2014 Jonathan Ong
99
+ * MIT Licensed
100
+ */
101
+
102
+ /*!
103
+ * encodeurl
104
+ * Copyright(c) 2016 Douglas Christopher Wilson
105
+ * MIT Licensed
106
+ */
107
+
108
+ /*!
109
+ * escape-html
110
+ * Copyright(c) 2012-2013 TJ Holowaychuk
111
+ * Copyright(c) 2015 Andreas Lubbe
112
+ * Copyright(c) 2015 Tiancheng "Timothy" Gu
113
+ * MIT Licensed
114
+ */
115
+
116
+ /*!
117
+ * etag
118
+ * Copyright(c) 2014-2016 Douglas Christopher Wilson
119
+ * MIT Licensed
120
+ */
121
+
122
+ /*!
123
+ * express
124
+ * Copyright(c) 2009-2013 TJ Holowaychuk
125
+ * Copyright(c) 2013 Roman Shtylman
126
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
127
+ * MIT Licensed
128
+ */
129
+
130
+ /*!
131
+ * express
132
+ * Copyright(c) 2009-2013 TJ Holowaychuk
133
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
134
+ * MIT Licensed
135
+ */
136
+
137
+ /*!
138
+ * finalhandler
139
+ * Copyright(c) 2014-2022 Douglas Christopher Wilson
140
+ * MIT Licensed
141
+ */
142
+
143
+ /*!
144
+ * forwarded
145
+ * Copyright(c) 2014-2017 Douglas Christopher Wilson
146
+ * MIT Licensed
147
+ */
148
+
149
+ /*!
150
+ * fresh
151
+ * Copyright(c) 2012 TJ Holowaychuk
152
+ * Copyright(c) 2016-2017 Douglas Christopher Wilson
153
+ * MIT Licensed
154
+ */
155
+
156
+ /*!
157
+ * http-errors
158
+ * Copyright(c) 2014 Jonathan Ong
159
+ * Copyright(c) 2016 Douglas Christopher Wilson
160
+ * MIT Licensed
161
+ */
162
+
163
+ /*!
164
+ * media-typer
165
+ * Copyright(c) 2014 Douglas Christopher Wilson
166
+ * MIT Licensed
167
+ */
168
+
169
+ /*!
170
+ * merge-descriptors
171
+ * Copyright(c) 2014 Jonathan Ong
172
+ * Copyright(c) 2015 Douglas Christopher Wilson
173
+ * MIT Licensed
174
+ */
175
+
176
+ /*!
177
+ * methods
178
+ * Copyright(c) 2013-2014 TJ Holowaychuk
179
+ * Copyright(c) 2015-2016 Douglas Christopher Wilson
180
+ * MIT Licensed
181
+ */
182
+
183
+ /*!
184
+ * mime-db
185
+ * Copyright(c) 2014 Jonathan Ong
186
+ * Copyright(c) 2015-2022 Douglas Christopher Wilson
187
+ * MIT Licensed
188
+ */
189
+
190
+ /*!
191
+ * mime-types
192
+ * Copyright(c) 2014 Jonathan Ong
193
+ * Copyright(c) 2015 Douglas Christopher Wilson
194
+ * MIT Licensed
195
+ */
196
+
197
+ /*!
198
+ * negotiator
199
+ * Copyright(c) 2012 Federico Romero
200
+ * Copyright(c) 2012-2014 Isaac Z. Schlueter
201
+ * Copyright(c) 2015 Douglas Christopher Wilson
202
+ * MIT Licensed
203
+ */
204
+
205
+ /*!
206
+ * on-finished
207
+ * Copyright(c) 2013 Jonathan Ong
208
+ * Copyright(c) 2014 Douglas Christopher Wilson
209
+ * MIT Licensed
210
+ */
211
+
212
+ /*!
213
+ * on-headers
214
+ * Copyright(c) 2014 Douglas Christopher Wilson
215
+ * MIT Licensed
216
+ */
217
+
218
+ /*!
219
+ * parseurl
220
+ * Copyright(c) 2014 Jonathan Ong
221
+ * Copyright(c) 2014-2017 Douglas Christopher Wilson
222
+ * MIT Licensed
223
+ */
224
+
225
+ /*!
226
+ * proxy-addr
227
+ * Copyright(c) 2014-2016 Douglas Christopher Wilson
228
+ * MIT Licensed
229
+ */
230
+
231
+ /*!
232
+ * range-parser
233
+ * Copyright(c) 2012-2014 TJ Holowaychuk
234
+ * Copyright(c) 2015-2016 Douglas Christopher Wilson
235
+ * MIT Licensed
236
+ */
237
+
238
+ /*!
239
+ * raw-body
240
+ * Copyright(c) 2013-2014 Jonathan Ong
241
+ * Copyright(c) 2014-2022 Douglas Christopher Wilson
242
+ * MIT Licensed
243
+ */
244
+
245
+ /*!
246
+ * send
247
+ * Copyright(c) 2012 TJ Holowaychuk
248
+ * Copyright(c) 2014-2022 Douglas Christopher Wilson
249
+ * MIT Licensed
250
+ */
251
+
252
+ /*!
253
+ * serve-static
254
+ * Copyright(c) 2010 Sencha Inc.
255
+ * Copyright(c) 2011 TJ Holowaychuk
256
+ * Copyright(c) 2014-2016 Douglas Christopher Wilson
257
+ * MIT Licensed
258
+ */
259
+
260
+ /*!
261
+ * statuses
262
+ * Copyright(c) 2014 Jonathan Ong
263
+ * Copyright(c) 2016 Douglas Christopher Wilson
264
+ * MIT Licensed
265
+ */
266
+
267
+ /*!
268
+ * toidentifier
269
+ * Copyright(c) 2016 Douglas Christopher Wilson
270
+ * MIT Licensed
271
+ */
272
+
273
+ /*!
274
+ * type-is
275
+ * Copyright(c) 2014 Jonathan Ong
276
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
277
+ * MIT Licensed
278
+ */
279
+
280
+ /*!
281
+ * unpipe
282
+ * Copyright(c) 2015 Douglas Christopher Wilson
283
+ * MIT Licensed
284
+ */
285
+
286
+ /*!
287
+ * vary
288
+ * Copyright(c) 2014-2017 Douglas Christopher Wilson
289
+ * MIT Licensed
290
+ */
291
+
292
+ /*! http://mths.be/fromcodepoint v0.1.0 by @mathias */
293
+
294
+ /*! https://mths.be/utf8js v2.1.2 by @mathias */
295
+
296
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
297
+
298
+ /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
299
+
300
+ /**
301
+ * @file VerbalExpressions JavaScript Library
302
+ * @version 0.3.0
303
+ * @license MIT
304
+ *
305
+ * @see https://github.com/VerbalExpressions/JSVerbalExpressions
306
+ */
307
+
308
+ /**
309
+ * @license
310
+ * Lodash <https://lodash.com/>
311
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
312
+ * Released under MIT license <https://lodash.com/license>
313
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
314
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
315
+ */
@@ -0,0 +1,177 @@
1
+ // Logging
2
+ const homedir = require('os').homedir();
3
+ const electronLogFile = `${homedir}/.tiro-electron-log.txt`
4
+
5
+ const fs = require('fs')
6
+ const cleanLog = () => {
7
+ fs.writeFile(electronLogFile, '', err => {})
8
+ }
9
+ const writeLog = (p) => (content) => {
10
+ content = `[ELECTRON] ${new Date().getTime()} => ${content} \n\r`
11
+ console.log(content);
12
+ fs.appendFile(electronLogFile, content, err => {})
13
+ }
14
+
15
+ const whichLog = (p) => p.platform === 'electron' ? writeLog : console.log
16
+
17
+
18
+ let hasStarted = false
19
+ const checkAndGetTiroConfig = (str, p) => {
20
+ if (!p) p = {}
21
+ if (!p.platform) p.platform = false
22
+ if (!p.cb) p.cb = () => {}
23
+ const log = whichLog(p);
24
+
25
+ if ( !hasStarted) {
26
+ const successMessage = 'SERVER_LOAD_SUCCESS';
27
+ if (str.includes(successMessage)) {
28
+ hasStarted = true;
29
+ str = str.split(successMessage)[1]
30
+ log(`*** ${str} *** (server success message detected here)`);
31
+ try {
32
+ let objStr = str.match(/\{.*\}/gm);
33
+ let configServerObj = JSON.parse(objStr)
34
+ log(`server config loaded successfully: ${JSON.stringify(configServerObj)}`);
35
+ if (p.cb) p.cb(configServerObj);
36
+ } catch(e){
37
+ log(`ERROR! could not get the server config ${JSON.stringify(e)}`)
38
+ }
39
+
40
+ }
41
+ }
42
+ }
43
+
44
+ // more general exec func
45
+ const execCmd = (cmd, params, p) => {
46
+ if (!p) p = {}
47
+ if (!p.env) p.env = {}
48
+ if (!p.sync) p.sync = false
49
+ if (!p.platform) p.platform = false
50
+
51
+ //log level 0 none / 1 critical / 2 all / 3 performance
52
+ if (!p.logLevel) p.logLevel === 2
53
+
54
+ p.logName = !p.logName ? '' : `${p.logName} `
55
+ const log = whichLog(p);
56
+ log(`[${p.logName}] === ExecCMD ${JSON.stringify({cmd, params, p})}`);
57
+ const outputLog = (str) => {
58
+ if (p.logLevel === 1) {
59
+ if (str.includes("[ERROR]") || str.includes("[CRIT]")) console.log(str)
60
+ } else if (p.logLevel === 2){
61
+ console.log(str)
62
+ } else if (p.logLevel === 3){
63
+ if (str.includes("[ERROR]") || str.includes("[CRIT]") || str.includes("[PERFS]")) console.log(str)
64
+ // console.log(str)
65
+ }
66
+ }
67
+
68
+ let child
69
+ let spawn = p.sync ? require( 'child_process' ).spawnSync : require( 'child_process' ).spawn;
70
+ child = spawn( cmd, params, {env: { ...process.env, ...p.env }});
71
+
72
+ // try {
73
+ child.stdout.on( 'data', data => {
74
+ const str = `[${p.logName}(${cmd})] : ${data}`;
75
+ outputLog(str)
76
+ if (p && p.onLog) p.onLog(str)
77
+ });
78
+ child.stderr.on( 'data', data => {
79
+ const str = `[ERROR][${p.logName} (${cmd})] : ${data}`;
80
+ outputLog(str)
81
+ if (p && p.onLog) p.onLog(str)
82
+ });
83
+ child.on( 'close', data => {
84
+ const str = `[${p.logName} (${cmd}) ON CLOSE] : ${data}`;
85
+ outputLog(str)
86
+ if (p && p.onClose) p.onClose(str)
87
+ });
88
+ return child;
89
+ }
90
+
91
+ const execCmdInFile = async (cmdStr, filePath, p) => {
92
+ if (!p) p = {}
93
+ p.logName = !p.logName ? '' : `${p.logName} `
94
+
95
+ await saveFile(filePath, cmdStr)
96
+
97
+ execCmd(`sh`, [filePath ], {
98
+ logName:`execCmdInFile [${p.logName}]`,
99
+ logLevel: p.logLevel,
100
+ onLog: str => {}
101
+ })
102
+ }
103
+
104
+ const killPreviousInstances = (cb) => {
105
+ if (!cb) cb = () => {}
106
+
107
+ // LINUX / MAC => unix like
108
+ const isWin = process.platform.startsWith('win');
109
+
110
+ if (isWin) {
111
+ cb()
112
+ } else {
113
+ // execCmd('sh', ['-c', "ls"], {
114
+ execCmd('sh', ['-c', "ps -ef | grep \'tiro-server.js\' | grep -v grep | awk \'{print $2}\' | xargs -r kill -9"], {
115
+ // execCmd('sh', ['-c', "kill -9 $(ps aux | grep \'tiro-server.js\' | awk '{print $2}' )"], {
116
+
117
+ logName: 'Kill prev tiroServer',
118
+ onClose: () => {
119
+ cb()
120
+ }
121
+ })
122
+ }
123
+ }
124
+
125
+ // SOME BASIC FILE MANIPULATION FOR CLI BACKUP SYSTEM
126
+ const fileExists = (path) => {
127
+ try {
128
+ return fs.existsSync(path)
129
+ } catch (error) {
130
+ return false
131
+ }
132
+ }
133
+
134
+ const openFile = async (path) => {
135
+ return new Promise((resolve, reject) => {
136
+ fs.readFile(path, 'utf8', (err, data) => {
137
+ if (err) { console.log(`[READFILE] could not read ${path}`); reject('NO_FILE') }
138
+ else resolve(data)
139
+ });
140
+ })
141
+ }
142
+
143
+ const saveFile = async (path, content) => {
144
+ return new Promise((resolve, reject) => {
145
+ fs.writeFile(path, content, (err) => {
146
+ if (err) { console.log(`[SAVEFILE] Error ${err.message} (${path})`); reject() }
147
+ else resolve()
148
+ });
149
+ })
150
+ }
151
+
152
+ const createDir = async (path, mask = 0o775) => {
153
+ return new Promise((resolve, reject) => {
154
+ fs.mkdir(path, 0o775, (err) => {
155
+ if (err) {
156
+ if (err.code == 'EEXIST') resolve(null);
157
+ else reject(err.message);
158
+ } else {
159
+ resolve(null);
160
+ }
161
+ });
162
+ });
163
+ }
164
+
165
+
166
+ const e = {
167
+ checkAndGetTiroConfig,
168
+ killPreviousInstances,
169
+ execCmd,
170
+ execCmdInFile,
171
+ fileExists,
172
+ openFile,
173
+ saveFile,
174
+ createDir,
175
+ }
176
+
177
+ module.exports = e;
package/index.html DELETED
File without changes
package/index.js DELETED
@@ -1,4 +0,0 @@
1
- function testlog () {
2
- console.log("hello world npx");
3
- }
4
- module.exports = testlog;
package/package.json~ DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "name": "@tiro/test-public",
3
- "version": "1.0.7",
4
- "description": "",
5
- "main": "index.js",
6
- "bin": "cli.js",
7
- "scripts": {
8
- "test": "echo \"Error: no test specified\" && exit 1",
9
- "publish": "npm publish --access public"
10
- },
11
- "author": "",
12
- "license": "ISC"
13
- }