@naosystem/cf-workers-status-page 0.0.0-stage → 0.1.1

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 (175) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +38 -2
  3. package/dist/admin.html +17 -0
  4. package/dist/auth-cloudflare-access.js +304 -0
  5. package/dist/auth-cloudflare-access.js.map +1 -0
  6. package/dist/chunks/monitor-B2u42off.js +79 -0
  7. package/dist/chunks/monitor-B2u42off.js.map +1 -0
  8. package/dist/chunks/notifier-DODVuFhr.js +158 -0
  9. package/dist/chunks/notifier-DODVuFhr.js.map +1 -0
  10. package/dist/chunks/page-templates-DPZcMlic.js +71 -0
  11. package/dist/chunks/page-templates-DPZcMlic.js.map +1 -0
  12. package/dist/chunks/run-check-bbo3LqI7.js +235 -0
  13. package/dist/chunks/run-check-bbo3LqI7.js.map +1 -0
  14. package/dist/chunks/timeline-YJXjehRf.js +1081 -0
  15. package/dist/chunks/timeline-YJXjehRf.js.map +1 -0
  16. package/dist/client/_headers +10 -0
  17. package/dist/client/assets/admin-BBJxKTF6.js +1 -0
  18. package/dist/client/assets/admin-Be4X0WFj.css +1 -0
  19. package/dist/client/assets/index-BgOspfsy.js +2 -0
  20. package/dist/client/assets/index-xpKyzvog.css +1 -0
  21. package/dist/client/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  22. package/dist/client/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  23. package/dist/client/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  24. package/dist/client/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  25. package/dist/client/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  26. package/dist/client/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  27. package/dist/client/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  28. package/dist/client/assets/ja-BT5brvxP.js +1 -0
  29. package/dist/client/assets/ja-DSSblLff.js +1 -0
  30. package/dist/client/assets/noto-sans-jp-0-wght-normal-vN5ykBQF.woff2 +0 -0
  31. package/dist/client/assets/noto-sans-jp-1-wght-normal-N_EDDt8j.woff2 +0 -0
  32. package/dist/client/assets/noto-sans-jp-10-wght-normal-ChuiXes4.woff2 +0 -0
  33. package/dist/client/assets/noto-sans-jp-100-wght-normal-CrE4HD6k.woff2 +0 -0
  34. package/dist/client/assets/noto-sans-jp-101-wght-normal-DOqEZFXR.woff2 +0 -0
  35. package/dist/client/assets/noto-sans-jp-102-wght-normal-2gFz4V6e.woff2 +0 -0
  36. package/dist/client/assets/noto-sans-jp-103-wght-normal-D9RhXU-z.woff2 +0 -0
  37. package/dist/client/assets/noto-sans-jp-104-wght-normal-OIyZ9iQD.woff2 +0 -0
  38. package/dist/client/assets/noto-sans-jp-105-wght-normal-CqRQAfnb.woff2 +0 -0
  39. package/dist/client/assets/noto-sans-jp-106-wght-normal-D-PO3jqS.woff2 +0 -0
  40. package/dist/client/assets/noto-sans-jp-107-wght-normal-DrykTIAp.woff2 +0 -0
  41. package/dist/client/assets/noto-sans-jp-108-wght-normal-DijBe27A.woff2 +0 -0
  42. package/dist/client/assets/noto-sans-jp-109-wght-normal-DaJwqT__.woff2 +0 -0
  43. package/dist/client/assets/noto-sans-jp-11-wght-normal-DdkFqF_o.woff2 +0 -0
  44. package/dist/client/assets/noto-sans-jp-110-wght-normal-bhh2FQQH.woff2 +0 -0
  45. package/dist/client/assets/noto-sans-jp-111-wght-normal-CuGzYIdC.woff2 +0 -0
  46. package/dist/client/assets/noto-sans-jp-112-wght-normal-DdhK_1vk.woff2 +0 -0
  47. package/dist/client/assets/noto-sans-jp-113-wght-normal-hxVHS2d4.woff2 +0 -0
  48. package/dist/client/assets/noto-sans-jp-114-wght-normal-DUzjAsrP.woff2 +0 -0
  49. package/dist/client/assets/noto-sans-jp-115-wght-normal-BiZ4-5rz.woff2 +0 -0
  50. package/dist/client/assets/noto-sans-jp-116-wght-normal-DkZAcxAY.woff2 +0 -0
  51. package/dist/client/assets/noto-sans-jp-117-wght-normal-CLJPD2y0.woff2 +0 -0
  52. package/dist/client/assets/noto-sans-jp-118-wght-normal-D8DI_HXJ.woff2 +0 -0
  53. package/dist/client/assets/noto-sans-jp-119-wght-normal-BAB3pFaH.woff2 +0 -0
  54. package/dist/client/assets/noto-sans-jp-12-wght-normal-K36fA5_o.woff2 +0 -0
  55. package/dist/client/assets/noto-sans-jp-13-wght-normal-BnYizWno.woff2 +0 -0
  56. package/dist/client/assets/noto-sans-jp-14-wght-normal-BP4IgVC-.woff2 +0 -0
  57. package/dist/client/assets/noto-sans-jp-15-wght-normal-DyhWcoYF.woff2 +0 -0
  58. package/dist/client/assets/noto-sans-jp-16-wght-normal-CXsQLI2j.woff2 +0 -0
  59. package/dist/client/assets/noto-sans-jp-17-wght-normal-C8FU1ZJ4.woff2 +0 -0
  60. package/dist/client/assets/noto-sans-jp-18-wght-normal-Cl0IKBVh.woff2 +0 -0
  61. package/dist/client/assets/noto-sans-jp-19-wght-normal-D3D3JUJm.woff2 +0 -0
  62. package/dist/client/assets/noto-sans-jp-2-wght-normal-CGu8NhtQ.woff2 +0 -0
  63. package/dist/client/assets/noto-sans-jp-20-wght-normal-DxsoeWSt.woff2 +0 -0
  64. package/dist/client/assets/noto-sans-jp-21-wght-normal-CuNsexW5.woff2 +0 -0
  65. package/dist/client/assets/noto-sans-jp-22-wght-normal-DVX3OFQM.woff2 +0 -0
  66. package/dist/client/assets/noto-sans-jp-23-wght-normal-BPFuo_yH.woff2 +0 -0
  67. package/dist/client/assets/noto-sans-jp-24-wght-normal-D85Fj66x.woff2 +0 -0
  68. package/dist/client/assets/noto-sans-jp-25-wght-normal-DdOOVuSz.woff2 +0 -0
  69. package/dist/client/assets/noto-sans-jp-26-wght-normal-BRB1GnUq.woff2 +0 -0
  70. package/dist/client/assets/noto-sans-jp-27-wght-normal-BxZFF8JU.woff2 +0 -0
  71. package/dist/client/assets/noto-sans-jp-28-wght-normal-VUlviaYI.woff2 +0 -0
  72. package/dist/client/assets/noto-sans-jp-29-wght-normal-CalQqRwB.woff2 +0 -0
  73. package/dist/client/assets/noto-sans-jp-3-wght-normal-cncaCaM8.woff2 +0 -0
  74. package/dist/client/assets/noto-sans-jp-30-wght-normal-CHLg85G9.woff2 +0 -0
  75. package/dist/client/assets/noto-sans-jp-31-wght-normal-BUoF9dl9.woff2 +0 -0
  76. package/dist/client/assets/noto-sans-jp-32-wght-normal-C5ZTiBNw.woff2 +0 -0
  77. package/dist/client/assets/noto-sans-jp-33-wght-normal-C6XNJsfA.woff2 +0 -0
  78. package/dist/client/assets/noto-sans-jp-34-wght-normal-DHkM837w.woff2 +0 -0
  79. package/dist/client/assets/noto-sans-jp-35-wght-normal-QMtEjDIl.woff2 +0 -0
  80. package/dist/client/assets/noto-sans-jp-36-wght-normal-CUyF0GqZ.woff2 +0 -0
  81. package/dist/client/assets/noto-sans-jp-37-wght-normal-EORmNjxA.woff2 +0 -0
  82. package/dist/client/assets/noto-sans-jp-38-wght-normal-C8ERbMNG.woff2 +0 -0
  83. package/dist/client/assets/noto-sans-jp-39-wght-normal-ChUfpJbl.woff2 +0 -0
  84. package/dist/client/assets/noto-sans-jp-4-wght-normal-DtWqs3EP.woff2 +0 -0
  85. package/dist/client/assets/noto-sans-jp-40-wght-normal-MgP8JEEE.woff2 +0 -0
  86. package/dist/client/assets/noto-sans-jp-41-wght-normal-3ctF9abM.woff2 +0 -0
  87. package/dist/client/assets/noto-sans-jp-42-wght-normal-CQtg6UZe.woff2 +0 -0
  88. package/dist/client/assets/noto-sans-jp-43-wght-normal-D1Pmm9aG.woff2 +0 -0
  89. package/dist/client/assets/noto-sans-jp-44-wght-normal-Cp9dHeXI.woff2 +0 -0
  90. package/dist/client/assets/noto-sans-jp-45-wght-normal-D2b1osBj.woff2 +0 -0
  91. package/dist/client/assets/noto-sans-jp-46-wght-normal-CGIA-Vlo.woff2 +0 -0
  92. package/dist/client/assets/noto-sans-jp-47-wght-normal-C4EEGqDS.woff2 +0 -0
  93. package/dist/client/assets/noto-sans-jp-48-wght-normal-D2iBztXa.woff2 +0 -0
  94. package/dist/client/assets/noto-sans-jp-49-wght-normal-DxqRVik_.woff2 +0 -0
  95. package/dist/client/assets/noto-sans-jp-5-wght-normal-CFiyVtll.woff2 +0 -0
  96. package/dist/client/assets/noto-sans-jp-50-wght-normal-CMseszwo.woff2 +0 -0
  97. package/dist/client/assets/noto-sans-jp-51-wght-normal-Cqc-9wfi.woff2 +0 -0
  98. package/dist/client/assets/noto-sans-jp-52-wght-normal-BVLZTbqC.woff2 +0 -0
  99. package/dist/client/assets/noto-sans-jp-53-wght-normal-DTyNOJaY.woff2 +0 -0
  100. package/dist/client/assets/noto-sans-jp-54-wght-normal-_mxGq_et.woff2 +0 -0
  101. package/dist/client/assets/noto-sans-jp-55-wght-normal-Bvndync8.woff2 +0 -0
  102. package/dist/client/assets/noto-sans-jp-56-wght-normal-0MmMqroR.woff2 +0 -0
  103. package/dist/client/assets/noto-sans-jp-57-wght-normal-BdRnjDYs.woff2 +0 -0
  104. package/dist/client/assets/noto-sans-jp-58-wght-normal-BYGgVeN_.woff2 +0 -0
  105. package/dist/client/assets/noto-sans-jp-59-wght-normal-Bdv8mdje.woff2 +0 -0
  106. package/dist/client/assets/noto-sans-jp-6-wght-normal-M-pWkj3J.woff2 +0 -0
  107. package/dist/client/assets/noto-sans-jp-60-wght-normal-DC6FEqsM.woff2 +0 -0
  108. package/dist/client/assets/noto-sans-jp-61-wght-normal-CYIuK5Lr.woff2 +0 -0
  109. package/dist/client/assets/noto-sans-jp-62-wght-normal-DeHy8p7w.woff2 +0 -0
  110. package/dist/client/assets/noto-sans-jp-63-wght-normal-B4M6eMmD.woff2 +0 -0
  111. package/dist/client/assets/noto-sans-jp-64-wght-normal-DLyOXBrC.woff2 +0 -0
  112. package/dist/client/assets/noto-sans-jp-65-wght-normal-X7SsA1bs.woff2 +0 -0
  113. package/dist/client/assets/noto-sans-jp-66-wght-normal-VScDM-_N.woff2 +0 -0
  114. package/dist/client/assets/noto-sans-jp-67-wght-normal-Dg2D3DZB.woff2 +0 -0
  115. package/dist/client/assets/noto-sans-jp-68-wght-normal-BB0AR8UN.woff2 +0 -0
  116. package/dist/client/assets/noto-sans-jp-69-wght-normal-CucwpUnQ.woff2 +0 -0
  117. package/dist/client/assets/noto-sans-jp-7-wght-normal-DzOz8Ryd.woff2 +0 -0
  118. package/dist/client/assets/noto-sans-jp-70-wght-normal-BZId6-Tb.woff2 +0 -0
  119. package/dist/client/assets/noto-sans-jp-71-wght-normal-CzPU0NF7.woff2 +0 -0
  120. package/dist/client/assets/noto-sans-jp-72-wght-normal-DrNRYXnT.woff2 +0 -0
  121. package/dist/client/assets/noto-sans-jp-73-wght-normal-DF2BdR6a.woff2 +0 -0
  122. package/dist/client/assets/noto-sans-jp-74-wght-normal-BMlOw_5y.woff2 +0 -0
  123. package/dist/client/assets/noto-sans-jp-75-wght-normal-DKq84hLG.woff2 +0 -0
  124. package/dist/client/assets/noto-sans-jp-76-wght-normal-CTb-2MFr.woff2 +0 -0
  125. package/dist/client/assets/noto-sans-jp-77-wght-normal-DfIVi-wf.woff2 +0 -0
  126. package/dist/client/assets/noto-sans-jp-78-wght-normal-_-z1Vrir.woff2 +0 -0
  127. package/dist/client/assets/noto-sans-jp-79-wght-normal-D8kGlXda.woff2 +0 -0
  128. package/dist/client/assets/noto-sans-jp-8-wght-normal-BfWoBb3q.woff2 +0 -0
  129. package/dist/client/assets/noto-sans-jp-80-wght-normal-BOEztZwY.woff2 +0 -0
  130. package/dist/client/assets/noto-sans-jp-81-wght-normal-h5VC8QpU.woff2 +0 -0
  131. package/dist/client/assets/noto-sans-jp-82-wght-normal-DJ4QkvX0.woff2 +0 -0
  132. package/dist/client/assets/noto-sans-jp-83-wght-normal-DANtuAZG.woff2 +0 -0
  133. package/dist/client/assets/noto-sans-jp-84-wght-normal-DjZ8Sp6m.woff2 +0 -0
  134. package/dist/client/assets/noto-sans-jp-85-wght-normal-kpU7kbMF.woff2 +0 -0
  135. package/dist/client/assets/noto-sans-jp-86-wght-normal-DRPTa-bf.woff2 +0 -0
  136. package/dist/client/assets/noto-sans-jp-87-wght-normal-CFM472wD.woff2 +0 -0
  137. package/dist/client/assets/noto-sans-jp-88-wght-normal-2rLLwelj.woff2 +0 -0
  138. package/dist/client/assets/noto-sans-jp-89-wght-normal-DUIF9ybW.woff2 +0 -0
  139. package/dist/client/assets/noto-sans-jp-9-wght-normal-WLs1HgG6.woff2 +0 -0
  140. package/dist/client/assets/noto-sans-jp-90-wght-normal-B0n_tL-y.woff2 +0 -0
  141. package/dist/client/assets/noto-sans-jp-91-wght-normal-BishDeFy.woff2 +0 -0
  142. package/dist/client/assets/noto-sans-jp-92-wght-normal-DoIdukLp.woff2 +0 -0
  143. package/dist/client/assets/noto-sans-jp-93-wght-normal-DMCycan_.woff2 +0 -0
  144. package/dist/client/assets/noto-sans-jp-94-wght-normal-DlyoTk-A.woff2 +0 -0
  145. package/dist/client/assets/noto-sans-jp-95-wght-normal-D0L1aiGf.woff2 +0 -0
  146. package/dist/client/assets/noto-sans-jp-96-wght-normal-CjJ0kYkQ.woff2 +0 -0
  147. package/dist/client/assets/noto-sans-jp-97-wght-normal-CJ8uP04H.woff2 +0 -0
  148. package/dist/client/assets/noto-sans-jp-98-wght-normal-CjEDrQIY.woff2 +0 -0
  149. package/dist/client/assets/noto-sans-jp-99-wght-normal-DaQ3GEVf.woff2 +0 -0
  150. package/dist/client/assets/noto-sans-jp-cyrillic-wght-normal-BbS1Q_ZO.woff2 +0 -0
  151. package/dist/client/assets/noto-sans-jp-latin-ext-wght-normal-IaSo_s9d.woff2 +0 -0
  152. package/dist/client/assets/noto-sans-jp-latin-wght-normal-Bnnzbixe.woff2 +0 -0
  153. package/dist/client/assets/noto-sans-jp-vietnamese-wght-normal-CjvP4Ahz.woff2 +0 -0
  154. package/dist/client/assets/src-BDi4qpij.js +9 -0
  155. package/dist/client/assets/src-C6ZFz-Gu.css +1 -0
  156. package/dist/client/assets/views-CSeX_2-u.css +1 -0
  157. package/dist/client/assets/views-DHTTEaNV.js +1 -0
  158. package/dist/client/index.html +15 -0
  159. package/dist/client/licenses/fonts.txt +104 -0
  160. package/dist/client/licenses/third-party.txt +349 -0
  161. package/dist/index.js +18 -0
  162. package/dist/index.js.map +1 -0
  163. package/dist/notifier-discord.js +153 -0
  164. package/dist/notifier-discord.js.map +1 -0
  165. package/dist/notifier-slack.js +98 -0
  166. package/dist/notifier-slack.js.map +1 -0
  167. package/dist/notifier-webhook.js +215 -0
  168. package/dist/notifier-webhook.js.map +1 -0
  169. package/dist/provider-http.js +177 -0
  170. package/dist/provider-http.js.map +1 -0
  171. package/dist/vite.js +224 -0
  172. package/dist/vite.js.map +1 -0
  173. package/dist/worker.js +8616 -0
  174. package/dist/worker.js.map +1 -0
  175. package/package.json +58 -5
@@ -0,0 +1,349 @@
1
+ Third-party software in the status page and the admin UI (their scripts and styles)
2
+ ===================================================================================
3
+
4
+ These bundles include code from the packages below, put in by the build.
5
+ cf-workers-status-page itself is under the MIT license; each of these packages is under its
6
+ own license, copied with it.
7
+
8
+ The fonts of the modern template are also described in fonts.txt, next to this file.
9
+
10
+ - @fontsource-variable/inter 5.3.0 (OFL-1.1)
11
+ - @fontsource-variable/noto-sans-jp 5.3.1 (OFL-1.1)
12
+ - react 19.3.1 (MIT)
13
+ - react-dom 19.3.1 (MIT)
14
+ - rolldown 1.2.19 (MIT)
15
+ - scheduler 0.28.0 (MIT)
16
+ - vite 8.3.8 (MIT)
17
+
18
+ ----------------------------------------------------------------------------------------------------
19
+ @fontsource-variable/inter 5.3.0 (OFL-1.1)
20
+ https://fontsource.org/fonts/inter
21
+
22
+ Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter) Inter-Italic[opsz,wght].ttf: Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter)
23
+
24
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
25
+ This license is copied below, and is also available with a FAQ at:
26
+ http://scripts.sil.org/OFL
27
+
28
+
29
+ -----------------------------------------------------------
30
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
31
+ -----------------------------------------------------------
32
+
33
+ PREAMBLE
34
+ The goals of the Open Font License (OFL) are to stimulate worldwide
35
+ development of collaborative font projects, to support the font creation
36
+ efforts of academic and linguistic communities, and to provide a free and
37
+ open framework in which fonts may be shared and improved in partnership
38
+ with others.
39
+
40
+ The OFL allows the licensed fonts to be used, studied, modified and
41
+ redistributed freely as long as they are not sold by themselves. The
42
+ fonts, including any derivative works, can be bundled, embedded,
43
+ redistributed and/or sold with any software provided that any reserved
44
+ names are not used by derivative works. The fonts and derivatives,
45
+ however, cannot be released under any other type of license. The
46
+ requirement for fonts to remain under this license does not apply
47
+ to any document created using the fonts or their derivatives.
48
+
49
+ DEFINITIONS
50
+ "Font Software" refers to the set of files released by the Copyright
51
+ Holder(s) under this license and clearly marked as such. This may
52
+ include source files, build scripts and documentation.
53
+
54
+ "Reserved Font Name" refers to any names specified as such after the
55
+ copyright statement(s).
56
+
57
+ "Original Version" refers to the collection of Font Software components as
58
+ distributed by the Copyright Holder(s).
59
+
60
+ "Modified Version" refers to any derivative made by adding to, deleting,
61
+ or substituting -- in part or in whole -- any of the components of the
62
+ Original Version, by changing formats or by porting the Font Software to a
63
+ new environment.
64
+
65
+ "Author" refers to any designer, engineer, programmer, technical
66
+ writer or other person who contributed to the Font Software.
67
+
68
+ PERMISSION & CONDITIONS
69
+ Permission is hereby granted, free of charge, to any person obtaining
70
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
71
+ redistribute, and sell modified and unmodified copies of the Font
72
+ Software, subject to the following conditions:
73
+
74
+ 1) Neither the Font Software nor any of its individual components,
75
+ in Original or Modified Versions, may be sold by itself.
76
+
77
+ 2) Original or Modified Versions of the Font Software may be bundled,
78
+ redistributed and/or sold with any software, provided that each copy
79
+ contains the above copyright notice and this license. These can be
80
+ included either as stand-alone text files, human-readable headers or
81
+ in the appropriate machine-readable metadata fields within text or
82
+ binary files as long as those fields can be easily viewed by the user.
83
+
84
+ 3) No Modified Version of the Font Software may use the Reserved Font
85
+ Name(s) unless explicit written permission is granted by the corresponding
86
+ Copyright Holder. This restriction only applies to the primary font name as
87
+ presented to the users.
88
+
89
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
90
+ Software shall not be used to promote, endorse or advertise any
91
+ Modified Version, except to acknowledge the contribution(s) of the
92
+ Copyright Holder(s) and the Author(s) or with their explicit written
93
+ permission.
94
+
95
+ 5) The Font Software, modified or unmodified, in part or in whole,
96
+ must be distributed entirely under this license, and must not be
97
+ distributed under any other license. The requirement for fonts to
98
+ remain under this license does not apply to any document created
99
+ using the Font Software.
100
+
101
+ TERMINATION
102
+ This license becomes null and void if any of the above conditions are
103
+ not met.
104
+
105
+ DISCLAIMER
106
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
107
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
108
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
109
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
110
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
111
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
112
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
113
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
114
+ OTHER DEALINGS IN THE FONT SOFTWARE.
115
+
116
+ ----------------------------------------------------------------------------------------------------
117
+ @fontsource-variable/noto-sans-jp 5.3.1 (OFL-1.1)
118
+ https://fontsource.org/fonts/noto-sans-jp
119
+
120
+ Google Inc.
121
+
122
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
123
+ This license is copied below, and is also available with a FAQ at:
124
+ http://scripts.sil.org/OFL
125
+
126
+
127
+ -----------------------------------------------------------
128
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
129
+ -----------------------------------------------------------
130
+
131
+ PREAMBLE
132
+ The goals of the Open Font License (OFL) are to stimulate worldwide
133
+ development of collaborative font projects, to support the font creation
134
+ efforts of academic and linguistic communities, and to provide a free and
135
+ open framework in which fonts may be shared and improved in partnership
136
+ with others.
137
+
138
+ The OFL allows the licensed fonts to be used, studied, modified and
139
+ redistributed freely as long as they are not sold by themselves. The
140
+ fonts, including any derivative works, can be bundled, embedded,
141
+ redistributed and/or sold with any software provided that any reserved
142
+ names are not used by derivative works. The fonts and derivatives,
143
+ however, cannot be released under any other type of license. The
144
+ requirement for fonts to remain under this license does not apply
145
+ to any document created using the fonts or their derivatives.
146
+
147
+ DEFINITIONS
148
+ "Font Software" refers to the set of files released by the Copyright
149
+ Holder(s) under this license and clearly marked as such. This may
150
+ include source files, build scripts and documentation.
151
+
152
+ "Reserved Font Name" refers to any names specified as such after the
153
+ copyright statement(s).
154
+
155
+ "Original Version" refers to the collection of Font Software components as
156
+ distributed by the Copyright Holder(s).
157
+
158
+ "Modified Version" refers to any derivative made by adding to, deleting,
159
+ or substituting -- in part or in whole -- any of the components of the
160
+ Original Version, by changing formats or by porting the Font Software to a
161
+ new environment.
162
+
163
+ "Author" refers to any designer, engineer, programmer, technical
164
+ writer or other person who contributed to the Font Software.
165
+
166
+ PERMISSION & CONDITIONS
167
+ Permission is hereby granted, free of charge, to any person obtaining
168
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
169
+ redistribute, and sell modified and unmodified copies of the Font
170
+ Software, subject to the following conditions:
171
+
172
+ 1) Neither the Font Software nor any of its individual components,
173
+ in Original or Modified Versions, may be sold by itself.
174
+
175
+ 2) Original or Modified Versions of the Font Software may be bundled,
176
+ redistributed and/or sold with any software, provided that each copy
177
+ contains the above copyright notice and this license. These can be
178
+ included either as stand-alone text files, human-readable headers or
179
+ in the appropriate machine-readable metadata fields within text or
180
+ binary files as long as those fields can be easily viewed by the user.
181
+
182
+ 3) No Modified Version of the Font Software may use the Reserved Font
183
+ Name(s) unless explicit written permission is granted by the corresponding
184
+ Copyright Holder. This restriction only applies to the primary font name as
185
+ presented to the users.
186
+
187
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
188
+ Software shall not be used to promote, endorse or advertise any
189
+ Modified Version, except to acknowledge the contribution(s) of the
190
+ Copyright Holder(s) and the Author(s) or with their explicit written
191
+ permission.
192
+
193
+ 5) The Font Software, modified or unmodified, in part or in whole,
194
+ must be distributed entirely under this license, and must not be
195
+ distributed under any other license. The requirement for fonts to
196
+ remain under this license does not apply to any document created
197
+ using the Font Software.
198
+
199
+ TERMINATION
200
+ This license becomes null and void if any of the above conditions are
201
+ not met.
202
+
203
+ DISCLAIMER
204
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
205
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
206
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
207
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
208
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
209
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
210
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
211
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
212
+ OTHER DEALINGS IN THE FONT SOFTWARE.
213
+
214
+ ----------------------------------------------------------------------------------------------------
215
+ react 19.3.1 (MIT)
216
+ https://react.dev/
217
+
218
+ MIT License
219
+
220
+ Copyright (c) Meta Platforms, Inc. and affiliates.
221
+
222
+ Permission is hereby granted, free of charge, to any person obtaining a copy
223
+ of this software and associated documentation files (the "Software"), to deal
224
+ in the Software without restriction, including without limitation the rights
225
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
226
+ copies of the Software, and to permit persons to whom the Software is
227
+ furnished to do so, subject to the following conditions:
228
+
229
+ The above copyright notice and this permission notice shall be included in all
230
+ copies or substantial portions of the Software.
231
+
232
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
233
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
234
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
235
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
236
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
237
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
238
+ SOFTWARE.
239
+
240
+ ----------------------------------------------------------------------------------------------------
241
+ react-dom 19.3.1 (MIT)
242
+ https://react.dev/
243
+
244
+ MIT License
245
+
246
+ Copyright (c) Meta Platforms, Inc. and affiliates.
247
+
248
+ Permission is hereby granted, free of charge, to any person obtaining a copy
249
+ of this software and associated documentation files (the "Software"), to deal
250
+ in the Software without restriction, including without limitation the rights
251
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
252
+ copies of the Software, and to permit persons to whom the Software is
253
+ furnished to do so, subject to the following conditions:
254
+
255
+ The above copyright notice and this permission notice shall be included in all
256
+ copies or substantial portions of the Software.
257
+
258
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
259
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
260
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
261
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
262
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
263
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
264
+ SOFTWARE.
265
+
266
+ ----------------------------------------------------------------------------------------------------
267
+ rolldown 1.2.19 (MIT)
268
+ https://rolldown.rs/
269
+
270
+ MIT License
271
+
272
+ Copyright (c) 2024-present VoidZero Inc. & Contributors
273
+
274
+ Permission is hereby granted, free of charge, to any person obtaining a copy
275
+ of this software and associated documentation files (the "Software"), to deal
276
+ in the Software without restriction, including without limitation the rights
277
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
278
+ copies of the Software, and to permit persons to whom the Software is
279
+ furnished to do so, subject to the following conditions:
280
+
281
+ The above copyright notice and this permission notice shall be included in all
282
+ copies or substantial portions of the Software.
283
+
284
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
285
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
286
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
287
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
288
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
289
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
290
+ SOFTWARE.
291
+
292
+ end of terms and conditions
293
+
294
+ The licenses of externally maintained libraries from which parts of the Software is derived are listed [here](https://github.com/rolldown/rolldown/blob/main/THIRD-PARTY-LICENSE).
295
+
296
+ ----------------------------------------------------------------------------------------------------
297
+ scheduler 0.28.0 (MIT)
298
+ https://react.dev/
299
+
300
+ MIT License
301
+
302
+ Copyright (c) Meta Platforms, Inc. and affiliates.
303
+
304
+ Permission is hereby granted, free of charge, to any person obtaining a copy
305
+ of this software and associated documentation files (the "Software"), to deal
306
+ in the Software without restriction, including without limitation the rights
307
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
308
+ copies of the Software, and to permit persons to whom the Software is
309
+ furnished to do so, subject to the following conditions:
310
+
311
+ The above copyright notice and this permission notice shall be included in all
312
+ copies or substantial portions of the Software.
313
+
314
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
315
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
316
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
317
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
318
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
319
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
320
+ SOFTWARE.
321
+
322
+ ----------------------------------------------------------------------------------------------------
323
+ vite 8.3.8 (MIT)
324
+ https://vite.dev
325
+
326
+ # Vite core license
327
+ Vite is released under the MIT license:
328
+
329
+ MIT License
330
+
331
+ Copyright (c) 2019-present, VoidZero Inc. and Vite contributors
332
+
333
+ Permission is hereby granted, free of charge, to any person obtaining a copy
334
+ of this software and associated documentation files (the "Software"), to deal
335
+ in the Software without restriction, including without limitation the rights
336
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
337
+ copies of the Software, and to permit persons to whom the Software is
338
+ furnished to do so, subject to the following conditions:
339
+
340
+ The above copyright notice and this permission notice shall be included in all
341
+ copies or substantial portions of the Software.
342
+
343
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
344
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
345
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
346
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
347
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
348
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
349
+ SOFTWARE.
package/dist/index.js ADDED
@@ -0,0 +1,18 @@
1
+ import { A as addDays, C as resolveConfig, D as parseDuration, E as durationSchema, M as localDate, N as recentDays, O as confirmState, P as startOfLocalDay, S as defineConfig, T as LOCATION_HINTS, _ as worseOf, a as excludeWindows, b as INCIDENT_TEMPLATE_PLACEHOLDERS, c as mergeRanges, d as uptimeRatio, f as LATE_GRACE_MS, g as staleAfterMs, h as isCheckState, i as downPeriods, j as calendarDay, k as observationsNeeded, l as monitorTimeline, m as displayState, n as concatSegments, o as lateSpans, p as componentState, r as coverageRatio, s as mergeDownPeriods, t as combineTimelines, u as summarize, v as worstState, w as missingCapabilities, x as component, y as ConfigError } from "./chunks/timeline-YJXjehRf.js";
2
+ import { i as defineProvider, n as RESERVED_MONITOR_KEYS, r as RESERVED_OPTION_KEYS, t as MONITOR_SETTING_KEYS } from "./chunks/monitor-B2u42off.js";
3
+ import { a as pageTemplatesOf, i as formatPageTemplates, n as PAGE_TEMPLATES, o as parsePageTemplates, r as PAGE_TEMPLATES_META, s as withPageTemplates, t as DEFAULT_PAGE_TEMPLATE } from "./chunks/page-templates-DPZcMlic.js";
4
+ import { a as MissingSecretError, c as resolveSecrets, d as secretOr, f as secretRefSchema, i as withheldRedirect, l as secret, n as MAX_REDIRECTS, o as isSecretRef, r as runCheck, s as redactSecrets, t as InsecureSecretError, u as secretNames } from "./chunks/run-check-bbo3LqI7.js";
5
+ import { a as expectSuccess, i as destinationOptionOf, n as NotifierError, o as isPublicHostname, r as defineNotifier, s as retryAfterMs, t as NOTIFICATION_EVENTS } from "./chunks/notifier-DODVuFhr.js";
6
+ // ../core/src/provider.ts
7
+ /**
8
+ * Something a runner can do on behalf of a provider.
9
+ * Runners declare the capabilities they provide; providers declare the ones they require.
10
+ */
11
+ var CAPABILITIES = [
12
+ "fetch",
13
+ "tcp",
14
+ "icmp"
15
+ ];
16
+ export { CAPABILITIES, ConfigError, DEFAULT_PAGE_TEMPLATE, INCIDENT_TEMPLATE_PLACEHOLDERS, InsecureSecretError, LATE_GRACE_MS, LOCATION_HINTS, MAX_REDIRECTS, MONITOR_SETTING_KEYS, MissingSecretError, NOTIFICATION_EVENTS, NotifierError, PAGE_TEMPLATES, PAGE_TEMPLATES_META, RESERVED_MONITOR_KEYS, RESERVED_OPTION_KEYS, addDays, calendarDay, combineTimelines, component, componentState, concatSegments, confirmState, coverageRatio, defineConfig, defineNotifier, defineProvider, destinationOptionOf, displayState, downPeriods, durationSchema, excludeWindows, expectSuccess, formatPageTemplates, isCheckState, isPublicHostname, isSecretRef, lateSpans, localDate, mergeDownPeriods, mergeRanges, missingCapabilities, monitorTimeline, observationsNeeded, pageTemplatesOf, parseDuration, parsePageTemplates, recentDays, redactSecrets, resolveConfig, resolveSecrets, retryAfterMs, runCheck, secret, secretNames, secretOr, secretRefSchema, staleAfterMs, startOfLocalDay, summarize, uptimeRatio, withPageTemplates, withheldRedirect, worseOf, worstState };
17
+
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../core/src/provider.ts"],"sourcesContent":["import type { ZodType } from \"zod\";\nimport type { SecretsResolved } from \"./secret\";\n\n/**\n * Something a runner can do on behalf of a provider.\n * Runners declare the capabilities they provide; providers declare the ones they require.\n */\nexport const CAPABILITIES = [\"fetch\", \"tcp\", \"icmp\"] as const;\nexport type Capability = (typeof CAPABILITIES)[number];\n\n/** States a provider can report. `unknown` is never returned by a provider; it is derived from missing or stale results. */\nexport type CheckState = \"up\" | \"degraded\" | \"down\";\n\nexport interface CheckResult {\n\tstate: CheckState;\n\tlatencyMs?: number;\n\tmessage?: string;\n\t/** Provider-specific data, such as the HTTP status or an external status page's original state. */\n\tdetails?: Record<string, unknown>;\n}\n\n/**\n * A TCP connection opened through the runner. Modelled on the Sockets API proposal\n * (`connect()` returning readable and writable streams) without depending on a specific runtime.\n * Provisional: no built-in provider uses TCP yet.\n */\nexport interface TcpSocket {\n\treadonly readable: ReadableStream<Uint8Array>;\n\treadonly writable: WritableStream<Uint8Array>;\n\treadonly opened: Promise<unknown>;\n\treadonly closed: Promise<void>;\n\tclose(): Promise<void>;\n}\n\nexport type TcpConnect = (\n\taddress: { hostname: string; port: number },\n\toptions?: { secureTransport?: \"off\" | \"on\" | \"starttls\" },\n) => TcpSocket;\n\n/**\n * What a runner hands to a provider for one check. Built by `runCheck`.\n *\n * Providers must use only what is passed here. In particular they must call\n * `ctx.fetch`, never the global `fetch`: the runner's fetch applies the monitor's\n * timeout and the runner's User-Agent, and other runners may not have a global fetch.\n * This is enforced by lint (`.oxlintrc.json`) and by tests, not at run time.\n */\nexport interface CheckContext {\n\t/** Provided by the runner. Requests are aborted with `signal` unless given their own. */\n\tfetch: typeof fetch;\n\t/** Present only when the runner provides the `tcp` capability. */\n\tconnect?: TcpConnect;\n\t/**\n\t * Aborted when the monitor's timeout passes or the runner gives up. Once it is aborted\n\t * a provider may simply throw: `runCheck` turns a timeout into a `down` result.\n\t */\n\tsignal: AbortSignal;\n}\n\n/**\n * A kind of check, such as HTTP.\n *\n * `Options` is the validated option type; `Input` is what users write in\n * `status.config.ts` before defaults are applied. The options schema must be an object\n * schema whose keys do not clash with monitor settings (see `defineProvider`).\n */\nexport interface CheckProvider<Options = unknown, Input = Options> {\n\t/** Identifier such as `\"http\"`. */\n\treadonly type: string;\n\t/**\n\t * Defines and validates the provider's options. Where a value may be secret, accept a\n\t * `secret()` reference with `secretOr()`; `check` then receives the secret's value.\n\t */\n\treadonly options: ZodType<Options, Input>;\n\t/** Capabilities the assigned runner must provide; checked when the configuration is loaded. */\n\treadonly requires: readonly Capability[];\n\t/**\n\t * Runs one check. `options` has secrets already resolved. Anything returned or thrown\n\t * has secret values redacted by `runCheck`, but providers should not echo them anyway.\n\t */\n\tcheck(options: SecretsResolved<Options>, ctx: CheckContext): Promise<CheckResult>;\n}\n"],"mappings":";;;;;;;;;;AAOA,IAAa,eAAe;CAAC;CAAS;CAAO;AAAM"}
@@ -0,0 +1,153 @@
1
+ import { a as expectSuccess, r as defineNotifier } from "./chunks/notifier-DODVuFhr.js";
2
+ import * as z from "zod";
3
+ // ../notifier-discord/src/messages.ts
4
+ /** Texts of the admin UI's form for Discord targets (English is also the schema's `title`/`description`). */
5
+ var messages = {
6
+ en: {
7
+ $kind: "Discord",
8
+ "url.title": "Webhook URL",
9
+ "url.description": "The channel's webhook URL, https://discord.com/api/webhooks/… (channel settings → Integrations → Webhooks).",
10
+ "username.title": "Sender name",
11
+ "username.description": "Shown as the sender of the messages instead of the webhook's name.",
12
+ "threadId.title": "Thread ID",
13
+ "threadId.description": "For a forum or media channel: the ID of the thread (post) to write in."
14
+ },
15
+ ja: {
16
+ $kind: "Discord",
17
+ "url.title": "Webhook の URL",
18
+ "url.description": "チャンネルの Webhook の URL(https://discord.com/api/webhooks/…)。チャンネルの設定 → 連携サービス → ウェブフックで発行します。",
19
+ "username.title": "送信者名",
20
+ "username.description": "Webhook の名前の代わりに、メッセージの送信者として表示します。",
21
+ "threadId.title": "スレッド ID",
22
+ "threadId.description": "フォーラムまたはメディアチャンネルの場合: 書き込むスレッド(投稿)の ID。"
23
+ }
24
+ };
25
+ // ../notifier-discord/src/index.ts
26
+ /**
27
+ * Discord notifications through a channel webhook.
28
+ *
29
+ * Create a webhook in the channel's settings (Integrations → Webhooks) and enter its URL,
30
+ * `https://discord.com/api/webhooks/<id>/<token>`, as the target's `url`. The URL contains
31
+ * the token, so it is a secret option: encrypted at rest and never shown again.
32
+ *
33
+ * Each notification is one "Execute Webhook" POST with a JSON body holding one embed: the
34
+ * title (at most {@link LIMITS}`.title` characters), a description with the text and the
35
+ * links, a colour for the severity and the time it happened as the embed's timestamp.
36
+ * `allowed_mentions` is empty, so no text can ping anyone, and Markdown in the hub's text is
37
+ * escaped. The request asks to `wait` for the message to be created, so that Discord reports
38
+ * a message it could not save (without `wait` it answers 204 whatever happens): it answers 200
39
+ * with the message. 429 (rate limited, with `Retry-After`) and 5xx are retried by the hub, other
40
+ * errors (such as 404 for a deleted webhook) are recorded as failed at once.
41
+ *
42
+ * For a webhook of a forum or media channel, set `threadId` to the thread (post) to write in.
43
+ */
44
+ /** Discord's limits for an embed and for the webhook's display name. */
45
+ var LIMITS = {
46
+ title: 256,
47
+ description: 4096,
48
+ username: 80
49
+ };
50
+ var DISCORD_HOSTS = /* @__PURE__ */ new Set([
51
+ "discord.com",
52
+ "discordapp.com",
53
+ "ptb.discord.com",
54
+ "canary.discord.com"
55
+ ]);
56
+ var WEBHOOK_PATH = /^\/api(?:\/v\d+)?\/webhooks\/\d+\/[A-Za-z0-9_-]+$/;
57
+ /**
58
+ * Discord's rules for a webhook's name: no `@`, `#`, `:` or ```` ``` ````, not containing
59
+ * "discord" or "clyde", and not "everyone" or "here".
60
+ */
61
+ function usernameIssue(name) {
62
+ const lower = name.toLowerCase();
63
+ if (/[@#:]/.test(name) || name.includes("```")) return "must not contain \"@\", \"#\", \":\" or \"```\"";
64
+ if (lower.includes("discord") || lower.includes("clyde")) return "must not contain \"discord\" or \"clyde\"";
65
+ if (lower === "everyone" || lower === "here") return "must not be \"everyone\" or \"here\"";
66
+ return null;
67
+ }
68
+ var discordOptions = z.strictObject({
69
+ /** The webhook's URL. Secret. */
70
+ url: z.url({
71
+ protocol: /^https$/,
72
+ error: "must be an https URL"
73
+ }).refine((value) => {
74
+ const url = new URL(value);
75
+ return DISCORD_HOSTS.has(url.hostname) && WEBHOOK_PATH.test(url.pathname);
76
+ }, "must be a Discord webhook URL, https://discord.com/api/webhooks/…").refine((value) => new URL(value).search === "", "must not have a query: for a forum channel's thread, set threadId instead of ?thread_id=").meta({
77
+ title: messages.en["url.title"],
78
+ description: messages.en["url.description"]
79
+ }),
80
+ /** Overrides the webhook's name for these messages. */
81
+ username: z.string().trim().min(1).max(LIMITS.username).superRefine((name, ctx) => {
82
+ const issue = usernameIssue(name);
83
+ if (issue !== null) ctx.addIssue(issue);
84
+ }).meta({
85
+ title: messages.en["username.title"],
86
+ description: messages.en["username.description"]
87
+ }).optional(),
88
+ /** For a webhook of a forum or media channel: the ID of the thread to post in. */
89
+ threadId: z.string().regex(/^\d{1,20}$/, "must be a thread ID (digits)").meta({
90
+ title: messages.en["threadId.title"],
91
+ description: messages.en["threadId.description"]
92
+ }).optional()
93
+ });
94
+ var COLORS = {
95
+ critical: 15026253,
96
+ warning: 16098596,
97
+ ok: 3187820,
98
+ info: 37119
99
+ };
100
+ /** Escapes Discord Markdown, so that names and messages show as written. */
101
+ function escapeDiscord(text) {
102
+ return text.replace(/[\\*_~`|<>[\]]/g, (character) => `\\${character}`).replace(/^([#-])/gm, "\\$1");
103
+ }
104
+ function truncate(text, max) {
105
+ return text.length <= max ? text : `${text.slice(0, max - 1)}…`;
106
+ }
107
+ /** The JSON body sent to Discord for `notification`. */
108
+ function discordPayload(notification, options) {
109
+ const links = notification.links.map((link) => `[${escapeDiscord(link.label)}](${link.url.replaceAll(")", "%29").replaceAll(" ", "%20")})`);
110
+ const tail = links.length === 0 ? "" : `\n\n${links.join("\n")}`;
111
+ const room = LIMITS.description - tail.length;
112
+ return {
113
+ ...options.username === void 0 ? {} : { username: options.username },
114
+ embeds: [{
115
+ title: truncate(notification.title, LIMITS.title),
116
+ description: `${truncate(escapeDiscord(notification.text), Math.max(0, room))}${tail}`,
117
+ color: COLORS[notification.severity],
118
+ timestamp: new Date(notification.occurredAt).toISOString()
119
+ }],
120
+ allowed_mentions: { parse: [] }
121
+ };
122
+ }
123
+ /** The URL to POST to: the webhook's, asking to wait for the message, in the thread if any. */
124
+ function executeUrl(options) {
125
+ const url = new URL(options.url);
126
+ url.searchParams.set("wait", "true");
127
+ if (options.threadId !== void 0) url.searchParams.set("thread_id", options.threadId);
128
+ return url.toString();
129
+ }
130
+ var kind = defineNotifier({
131
+ type: "discord",
132
+ name: "Discord",
133
+ options: discordOptions,
134
+ secretOptions: ["url"],
135
+ messages,
136
+ async send(notification, options, ctx) {
137
+ const response = await ctx.fetch(executeUrl(options), {
138
+ method: "POST",
139
+ headers: { "Content-Type": "application/json" },
140
+ body: JSON.stringify(discordPayload(notification, options)),
141
+ redirect: "manual",
142
+ signal: ctx.signal
143
+ });
144
+ await expectSuccess(response, "Discord");
145
+ }
146
+ });
147
+ /** The Discord notifier kind, for `notifiers` in status.config.ts. */
148
+ function discord() {
149
+ return kind;
150
+ }
151
+ export { LIMITS, discord, discordOptions, discordPayload, escapeDiscord, executeUrl, messages };
152
+
153
+ //# sourceMappingURL=notifier-discord.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifier-discord.js","names":[],"sources":["../../notifier-discord/src/messages.ts","../../notifier-discord/src/index.ts"],"sourcesContent":["import type { NotifierMessages } from \"@naosystem/cf-workers-status-page-core\";\n\n/** Texts of the admin UI's form for Discord targets (English is also the schema's `title`/`description`). */\nexport const messages = {\n\ten: {\n\t\t$kind: \"Discord\",\n\t\t\"url.title\": \"Webhook URL\",\n\t\t\"url.description\": \"The channel's webhook URL, https://discord.com/api/webhooks/… (channel settings → Integrations → Webhooks).\",\n\t\t\"username.title\": \"Sender name\",\n\t\t\"username.description\": \"Shown as the sender of the messages instead of the webhook's name.\",\n\t\t\"threadId.title\": \"Thread ID\",\n\t\t\"threadId.description\": \"For a forum or media channel: the ID of the thread (post) to write in.\",\n\t},\n\tja: {\n\t\t$kind: \"Discord\",\n\t\t\"url.title\": \"Webhook の URL\",\n\t\t\"url.description\": \"チャンネルの Webhook の URL(https://discord.com/api/webhooks/…)。チャンネルの設定 → 連携サービス → ウェブフックで発行します。\",\n\t\t\"username.title\": \"送信者名\",\n\t\t\"username.description\": \"Webhook の名前の代わりに、メッセージの送信者として表示します。\",\n\t\t\"threadId.title\": \"スレッド ID\",\n\t\t\"threadId.description\": \"フォーラムまたはメディアチャンネルの場合: 書き込むスレッド(投稿)の ID。\",\n\t},\n} as const satisfies NotifierMessages;\n","/**\n * Discord notifications through a channel webhook.\n *\n * Create a webhook in the channel's settings (Integrations → Webhooks) and enter its URL,\n * `https://discord.com/api/webhooks/<id>/<token>`, as the target's `url`. The URL contains\n * the token, so it is a secret option: encrypted at rest and never shown again.\n *\n * Each notification is one \"Execute Webhook\" POST with a JSON body holding one embed: the\n * title (at most {@link LIMITS}`.title` characters), a description with the text and the\n * links, a colour for the severity and the time it happened as the embed's timestamp.\n * `allowed_mentions` is empty, so no text can ping anyone, and Markdown in the hub's text is\n * escaped. The request asks to `wait` for the message to be created, so that Discord reports\n * a message it could not save (without `wait` it answers 204 whatever happens): it answers 200\n * with the message. 429 (rate limited, with `Retry-After`) and 5xx are retried by the hub, other\n * errors (such as 404 for a deleted webhook) are recorded as failed at once.\n *\n * For a webhook of a forum or media channel, set `threadId` to the thread (post) to write in.\n */\nimport {\n\tdefineNotifier,\n\texpectSuccess,\n\ttype Notification,\n\ttype NotificationSeverity,\n} from \"@naosystem/cf-workers-status-page-core\";\nimport * as z from \"zod\";\nimport { messages } from \"./messages\";\n\nexport { messages };\n\n/** Discord's limits for an embed and for the webhook's display name. */\nexport const LIMITS = { title: 256, description: 4_096, username: 80 } as const;\n\nconst DISCORD_HOSTS: ReadonlySet<string> = new Set([\n\t\"discord.com\",\n\t\"discordapp.com\",\n\t\"ptb.discord.com\",\n\t\"canary.discord.com\",\n]);\nconst WEBHOOK_PATH = /^\\/api(?:\\/v\\d+)?\\/webhooks\\/\\d+\\/[A-Za-z0-9_-]+$/;\n\n/**\n * Discord's rules for a webhook's name: no `@`, `#`, `:` or ```` ``` ````, not containing\n * \"discord\" or \"clyde\", and not \"everyone\" or \"here\".\n */\nfunction usernameIssue(name: string): string | null {\n\tconst lower = name.toLowerCase();\n\tif (/[@#:]/.test(name) || name.includes(\"```\")) return 'must not contain \"@\", \"#\", \":\" or \"```\"';\n\tif (lower.includes(\"discord\") || lower.includes(\"clyde\")) return 'must not contain \"discord\" or \"clyde\"';\n\tif (lower === \"everyone\" || lower === \"here\") return 'must not be \"everyone\" or \"here\"';\n\treturn null;\n}\n\nexport const discordOptions = z.strictObject({\n\t/** The webhook's URL. Secret. */\n\turl: z\n\t\t.url({ protocol: /^https$/, error: \"must be an https URL\" })\n\t\t.refine((value) => {\n\t\t\tconst url = new URL(value);\n\t\t\treturn DISCORD_HOSTS.has(url.hostname) && WEBHOOK_PATH.test(url.pathname);\n\t\t}, \"must be a Discord webhook URL, https://discord.com/api/webhooks/…\")\n\t\t.refine(\n\t\t\t(value) => new URL(value).search === \"\",\n\t\t\t\"must not have a query: for a forum channel's thread, set threadId instead of ?thread_id=\",\n\t\t)\n\t\t.meta({ title: messages.en[\"url.title\"], description: messages.en[\"url.description\"] }),\n\t/** Overrides the webhook's name for these messages. */\n\tusername: z\n\t\t.string()\n\t\t.trim()\n\t\t.min(1)\n\t\t.max(LIMITS.username)\n\t\t.superRefine((name, ctx) => {\n\t\t\tconst issue = usernameIssue(name);\n\t\t\tif (issue !== null) ctx.addIssue(issue);\n\t\t})\n\t\t.meta({ title: messages.en[\"username.title\"], description: messages.en[\"username.description\"] })\n\t\t.optional(),\n\t/** For a webhook of a forum or media channel: the ID of the thread to post in. */\n\tthreadId: z\n\t\t.string()\n\t\t.regex(/^\\d{1,20}$/, \"must be a thread ID (digits)\")\n\t\t.meta({ title: messages.en[\"threadId.title\"], description: messages.en[\"threadId.description\"] })\n\t\t.optional(),\n});\nexport type DiscordOptions = z.infer<typeof discordOptions>;\n\nconst COLORS: Readonly<Record<NotificationSeverity, number>> = {\n\tcritical: 0xe5484d,\n\twarning: 0xf5a524,\n\tok: 0x30a46c,\n\tinfo: 0x0090ff,\n};\n\n/** Escapes Discord Markdown, so that names and messages show as written. */\nexport function escapeDiscord(text: string): string {\n\treturn text\n\t\t.replace(/[\\\\*_~`|<>[\\]]/g, (character) => `\\\\${character}`)\n\t\t.replace(/^([#-])/gm, \"\\\\$1\");\n}\n\nfunction truncate(text: string, max: number): string {\n\treturn text.length <= max ? text : `${text.slice(0, max - 1)}…`;\n}\n\nexport interface DiscordPayload {\n\tusername?: string;\n\tembeds: {\n\t\ttitle: string;\n\t\tdescription: string;\n\t\tcolor: number;\n\t\ttimestamp: string;\n\t}[];\n\tallowed_mentions: { parse: never[] };\n}\n\n/** The JSON body sent to Discord for `notification`. */\nexport function discordPayload(notification: Notification, options: Pick<DiscordOptions, \"username\">): DiscordPayload {\n\t// Masked links: the label is escaped, and `)` cannot end the URL early once percent-encoded.\n\tconst links = notification.links.map(\n\t\t(link) => `[${escapeDiscord(link.label)}](${link.url.replaceAll(\")\", \"%29\").replaceAll(\" \", \"%20\")})`,\n\t);\n\tconst tail = links.length === 0 ? \"\" : `\\n\\n${links.join(\"\\n\")}`;\n\tconst room = LIMITS.description - tail.length;\n\treturn {\n\t\t...(options.username === undefined ? {} : { username: options.username }),\n\t\tembeds: [\n\t\t\t{\n\t\t\t\t// Titles are not Markdown in embeds.\n\t\t\t\ttitle: truncate(notification.title, LIMITS.title),\n\t\t\t\tdescription: `${truncate(escapeDiscord(notification.text), Math.max(0, room))}${tail}`,\n\t\t\t\tcolor: COLORS[notification.severity],\n\t\t\t\ttimestamp: new Date(notification.occurredAt).toISOString(),\n\t\t\t},\n\t\t],\n\t\tallowed_mentions: { parse: [] },\n\t};\n}\n\n/** The URL to POST to: the webhook's, asking to wait for the message, in the thread if any. */\nexport function executeUrl(options: Pick<DiscordOptions, \"url\" | \"threadId\">): string {\n\tconst url = new URL(options.url);\n\turl.searchParams.set(\"wait\", \"true\");\n\tif (options.threadId !== undefined) url.searchParams.set(\"thread_id\", options.threadId);\n\treturn url.toString();\n}\n\nconst kind = defineNotifier({\n\ttype: \"discord\",\n\tname: \"Discord\",\n\toptions: discordOptions,\n\tsecretOptions: [\"url\"],\n\tmessages,\n\tasync send(notification, options, ctx) {\n\t\tconst response = await ctx.fetch(executeUrl(options), {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(discordPayload(notification, options)),\n\t\t\tredirect: \"manual\",\n\t\t\tsignal: ctx.signal,\n\t\t});\n\t\tawait expectSuccess(response, \"Discord\");\n\t},\n});\n\n/** The Discord notifier kind, for `notifiers` in status.config.ts. */\nexport function discord() {\n\treturn kind;\n}\n"],"mappings":"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"}
@@ -0,0 +1,98 @@
1
+ import { a as expectSuccess, r as defineNotifier } from "./chunks/notifier-DODVuFhr.js";
2
+ import * as z from "zod";
3
+ // ../notifier-slack/src/messages.ts
4
+ /** Texts of the admin UI's form for Slack targets (English is also the schema's `title`/`description`). */
5
+ var messages = {
6
+ en: {
7
+ $kind: "Slack",
8
+ "url.title": "Webhook URL",
9
+ "url.description": "The incoming webhook's URL, https://hooks.slack.com/services/… (from the Slack app's Incoming Webhooks)."
10
+ },
11
+ ja: {
12
+ $kind: "Slack",
13
+ "url.title": "Webhook の URL",
14
+ "url.description": "Incoming Webhook の URL(https://hooks.slack.com/services/…)。Slack アプリの Incoming Webhooks で発行します。"
15
+ }
16
+ };
17
+ // ../notifier-slack/src/index.ts
18
+ /**
19
+ * Slack notifications through an incoming webhook.
20
+ *
21
+ * Create an incoming webhook for a Slack app (Slack: "Sending messages using incoming
22
+ * webhooks") and enter its URL, `https://hooks.slack.com/services/T…/B…/…`, as the target's
23
+ * `url`. The URL is the credential, so it is a secret option: encrypted at rest and never shown
24
+ * again.
25
+ *
26
+ * Each notification is one POST of `{ "text": … }` as JSON, formatted with Slack's `mrkdwn`:
27
+ * the title in bold after an emoji for its severity, the text (which says when it happened)
28
+ * and the links. `&`, `<` and `>` in the hub's text are escaped, as Slack requires, so that
29
+ * names cannot turn into mentions or links. The message is kept under {@link MAX_TEXT_CHARS}
30
+ * characters (Slack truncates long messages).
31
+ *
32
+ * Slack answers `200 ok`, or an error status with a short code in the body (such as
33
+ * `400 invalid_payload`, `404 no_service`, `410 channel_is_archived`); 429 (rate limited)
34
+ * and 5xx are retried by the hub, other errors are recorded as failed at once.
35
+ */
36
+ /** Slack recommends keeping a message's text under 4,000 characters. */
37
+ var MAX_TEXT_CHARS = 3500;
38
+ var SLACK_HOSTS = /* @__PURE__ */ new Set(["hooks.slack.com", "hooks.slack-gov.com"]);
39
+ var WEBHOOK_PATH = /^\/services\/[A-Za-z0-9]+\/[A-Za-z0-9]+\/[A-Za-z0-9]+$/;
40
+ var slackOptions = z.strictObject({
41
+ /** The incoming webhook's URL. Secret. */
42
+ url: z.url({
43
+ protocol: /^https$/,
44
+ error: "must be an https URL"
45
+ }).refine((value) => {
46
+ const url = new URL(value);
47
+ return SLACK_HOSTS.has(url.hostname) && WEBHOOK_PATH.test(url.pathname) && url.search === "";
48
+ }, "must be a Slack incoming webhook URL, https://hooks.slack.com/services/…").meta({
49
+ title: messages.en["url.title"],
50
+ description: messages.en["url.description"]
51
+ }) });
52
+ var EMOJI = {
53
+ critical: ":red_circle:",
54
+ warning: ":large_yellow_circle:",
55
+ ok: ":large_green_circle:",
56
+ info: ":information_source:"
57
+ };
58
+ /** Escapes the three characters Slack's `mrkdwn` reserves for mentions and links. */
59
+ function escapeSlack(text) {
60
+ return text.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
61
+ }
62
+ function truncate(text, max) {
63
+ return text.length <= max ? text : `${text.slice(0, max - 1)}…`;
64
+ }
65
+ /** The JSON body sent to Slack for `notification`. */
66
+ function slackPayload(notification) {
67
+ const links = notification.links.map((link) => {
68
+ return `<${link.url.replaceAll("|", "%7C").replaceAll(">", "%3E")}|${escapeSlack(link.label)}>`;
69
+ });
70
+ const head = `${EMOJI[notification.severity]} *${escapeSlack(truncate(notification.title, 200))}*`;
71
+ const tail = links.length === 0 ? "" : `\n${links.join(" ")}`;
72
+ const room = MAX_TEXT_CHARS - head.length - tail.length - 1;
73
+ return { text: `${head}\n${truncate(escapeSlack(notification.text), Math.max(0, room))}${tail}` };
74
+ }
75
+ var kind = defineNotifier({
76
+ type: "slack",
77
+ name: "Slack",
78
+ options: slackOptions,
79
+ secretOptions: ["url"],
80
+ messages,
81
+ async send(notification, options, ctx) {
82
+ const response = await ctx.fetch(options.url, {
83
+ method: "POST",
84
+ headers: { "Content-Type": "application/json" },
85
+ body: JSON.stringify(slackPayload(notification)),
86
+ redirect: "manual",
87
+ signal: ctx.signal
88
+ });
89
+ await expectSuccess(response, "Slack");
90
+ }
91
+ });
92
+ /** The Slack notifier kind, for `notifiers` in status.config.ts. */
93
+ function slack() {
94
+ return kind;
95
+ }
96
+ export { MAX_TEXT_CHARS, escapeSlack, messages, slack, slackOptions, slackPayload };
97
+
98
+ //# sourceMappingURL=notifier-slack.js.map