ntfy-reverse-proxy 0.0.0 → 2.0.0

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 (199) hide show
  1. package/README.md +48 -0
  2. package/build/src/cli/commands/config-io.d.ts +5 -0
  3. package/build/src/cli/commands/config-io.d.ts.map +1 -0
  4. package/build/src/cli/commands/config-io.js +19 -0
  5. package/build/src/cli/commands/config-io.js.map +1 -0
  6. package/build/src/cli/commands/context.d.ts +9 -0
  7. package/build/src/cli/commands/context.d.ts.map +1 -0
  8. package/build/src/cli/commands/context.js +108 -0
  9. package/build/src/cli/commands/context.js.map +1 -0
  10. package/build/src/cli/commands/deploy.d.ts +4 -0
  11. package/build/src/cli/commands/deploy.d.ts.map +1 -0
  12. package/build/src/cli/commands/deploy.js +496 -0
  13. package/build/src/cli/commands/deploy.js.map +1 -0
  14. package/build/src/cli/commands/generate.d.ts +4 -0
  15. package/build/src/cli/commands/generate.d.ts.map +1 -0
  16. package/build/src/cli/commands/generate.js +68 -0
  17. package/build/src/cli/commands/generate.js.map +1 -0
  18. package/build/src/cli/commands/server.d.ts +7 -0
  19. package/build/src/cli/commands/server.d.ts.map +1 -0
  20. package/build/src/cli/commands/server.js +43 -0
  21. package/build/src/cli/commands/server.js.map +1 -0
  22. package/build/src/cli/commands/settings.d.ts +5 -0
  23. package/build/src/cli/commands/settings.d.ts.map +1 -0
  24. package/build/src/cli/commands/settings.js +16 -0
  25. package/build/src/cli/commands/settings.js.map +1 -0
  26. package/build/src/cli/commands/validate.d.ts +4 -0
  27. package/build/src/cli/commands/validate.d.ts.map +1 -0
  28. package/build/src/cli/commands/validate.js +45 -0
  29. package/build/src/cli/commands/validate.js.map +1 -0
  30. package/build/src/cli/index.d.ts +5 -0
  31. package/build/src/cli/index.d.ts.map +1 -0
  32. package/build/src/cli/index.js +118 -0
  33. package/build/src/cli/index.js.map +1 -0
  34. package/build/src/cli/menu/interactive.d.ts +4 -0
  35. package/build/src/cli/menu/interactive.d.ts.map +1 -0
  36. package/build/src/cli/menu/interactive.js +902 -0
  37. package/build/src/cli/menu/interactive.js.map +1 -0
  38. package/build/src/lib/item.d.ts +3 -0
  39. package/build/src/lib/item.d.ts.map +1 -0
  40. package/build/src/lib/item.js +3 -0
  41. package/build/src/lib/item.js.map +1 -0
  42. package/build/src/lib/regex.d.ts +30 -0
  43. package/build/src/lib/regex.d.ts.map +1 -0
  44. package/build/src/lib/regex.js +30 -0
  45. package/build/src/lib/regex.js.map +1 -0
  46. package/build/src/lib/schema.d.ts +167 -0
  47. package/build/src/lib/schema.d.ts.map +1 -0
  48. package/build/src/lib/schema.js +70 -0
  49. package/build/src/lib/schema.js.map +1 -0
  50. package/build/src/lib/utility.d.ts +4 -0
  51. package/build/src/lib/utility.d.ts.map +1 -0
  52. package/build/src/lib/utility.js +14 -0
  53. package/build/src/lib/utility.js.map +1 -0
  54. package/build/src/types/cli/commands/config-io.d.ts +38 -0
  55. package/build/src/types/cli/commands/context.d.ts +131 -0
  56. package/build/src/types/cli/commands/deploy.d.ts +622 -0
  57. package/build/src/types/cli/commands/generate.d.ts +51 -0
  58. package/build/src/types/cli/commands/server.d.ts +65 -0
  59. package/build/src/types/cli/commands/settings.d.ts +25 -0
  60. package/build/src/types/cli/commands/validate.d.ts +37 -0
  61. package/build/src/types/cli/index.d.ts +55 -0
  62. package/build/src/types/cli/menu/interactive.d.ts +381 -0
  63. package/build/src/types/fetch-response.d.ts +11 -0
  64. package/build/src/types/lib/schema.d.ts +134 -0
  65. package/build/src/types/lib/utility.d.ts +8 -0
  66. package/build/src/types/tests/cli/commands/context.test.d.ts +57 -0
  67. package/build/src/types/tests/cli/commands/generate.test.d.ts +12 -0
  68. package/build/src/types/tests/cli/commands/server.test.d.ts +45 -0
  69. package/build/src/types/tests/cli/commands/settings.test.d.ts +40 -0
  70. package/build/src/types/tests/cli/commands/validate.test.d.ts +19 -0
  71. package/build/src/types/tests/cli/menu/interactive.test.d.ts +6 -0
  72. package/build/src/types/tests/lib/schema.test.d.ts +10 -0
  73. package/build/src/types/tests/type-declarations.test.d.ts +173 -0
  74. package/build/src/types/tests/worker/index.test.d.ts +20 -0
  75. package/build/src/types/tests/worker/interpreters/ntfy-json.test.d.ts +19 -0
  76. package/build/src/types/tests/worker/interpreters/pfsense.test.d.ts +10 -0
  77. package/build/src/types/tests/worker/interpreters/plain-text.test.d.ts +10 -0
  78. package/build/src/types/tests/worker/interpreters/seerr.test.d.ts +8 -0
  79. package/build/src/types/tests/worker/interpreters/statuspage.test.d.ts +58 -0
  80. package/build/src/types/tests/worker/interpreters/synology.test.d.ts +8 -0
  81. package/build/src/types/tests/worker/interpreters/unifi.test.d.ts +8 -0
  82. package/build/src/types/tests/worker/landing/page.test.d.ts +55 -0
  83. package/build/src/types/tests/worker/pipeline/accumulate.test.d.ts +28 -0
  84. package/build/src/types/tests/worker/pipeline/authenticate.test.d.ts +9 -0
  85. package/build/src/types/tests/worker/pipeline/email.test.d.ts +15 -0
  86. package/build/src/types/tests/worker/pipeline/format.test.d.ts +38 -0
  87. package/build/src/types/tests/worker/pipeline/interpret.test.d.ts +43 -0
  88. package/build/src/types/tests/worker/pipeline/parse.test.d.ts +17 -0
  89. package/build/src/types/tests/worker/pipeline/receive.test.d.ts +23 -0
  90. package/build/src/types/tests/worker/pipeline/respond.test.d.ts +20 -0
  91. package/build/src/types/tests/worker/pipeline/route.test.d.ts +80 -0
  92. package/build/src/types/tests/worker/pipeline/send.test.d.ts +37 -0
  93. package/build/src/types/tests/worker/pipeline/split.test.d.ts +17 -0
  94. package/build/src/types/worker/index.d.ts +232 -0
  95. package/build/src/types/worker/interpreters/ntfy-json.d.ts +28 -0
  96. package/build/src/types/worker/interpreters/pfsense.d.ts +97 -0
  97. package/build/src/types/worker/interpreters/plain-text.d.ts +24 -0
  98. package/build/src/types/worker/interpreters/seerr.d.ts +124 -0
  99. package/build/src/types/worker/interpreters/statuspage.d.ts +239 -0
  100. package/build/src/types/worker/interpreters/synology.d.ts +99 -0
  101. package/build/src/types/worker/interpreters/unifi.d.ts +111 -0
  102. package/build/src/types/worker/landing/page.d.ts +44 -0
  103. package/build/src/types/worker/pipeline/accumulate.d.ts +79 -0
  104. package/build/src/types/worker/pipeline/authenticate.d.ts +68 -0
  105. package/build/src/types/worker/pipeline/email.d.ts +108 -0
  106. package/build/src/types/worker/pipeline/format.d.ts +47 -0
  107. package/build/src/types/worker/pipeline/interpret.d.ts +63 -0
  108. package/build/src/types/worker/pipeline/parse.d.ts +39 -0
  109. package/build/src/types/worker/pipeline/receive.d.ts +64 -0
  110. package/build/src/types/worker/pipeline/respond.d.ts +113 -0
  111. package/build/src/types/worker/pipeline/route.d.ts +34 -0
  112. package/build/src/types/worker/pipeline/send.d.ts +143 -0
  113. package/build/src/types/worker/pipeline/shared.d.ts +85 -0
  114. package/build/src/types/worker/pipeline/split.d.ts +35 -0
  115. package/build/src/worker/handlers.d.ts +5 -0
  116. package/build/src/worker/handlers.d.ts.map +1 -0
  117. package/build/src/worker/handlers.js +360 -0
  118. package/build/src/worker/handlers.js.map +1 -0
  119. package/build/src/worker/index.d.ts +4 -0
  120. package/build/src/worker/index.d.ts.map +1 -0
  121. package/build/src/worker/index.js +52 -0
  122. package/build/src/worker/index.js.map +1 -0
  123. package/build/src/worker/interpreters/ntfy-json.d.ts +4 -0
  124. package/build/src/worker/interpreters/ntfy-json.d.ts.map +1 -0
  125. package/build/src/worker/interpreters/ntfy-json.js +49 -0
  126. package/build/src/worker/interpreters/ntfy-json.js.map +1 -0
  127. package/build/src/worker/interpreters/pfsense.d.ts +4 -0
  128. package/build/src/worker/interpreters/pfsense.d.ts.map +1 -0
  129. package/build/src/worker/interpreters/pfsense.js +150 -0
  130. package/build/src/worker/interpreters/pfsense.js.map +1 -0
  131. package/build/src/worker/interpreters/plain-text.d.ts +4 -0
  132. package/build/src/worker/interpreters/plain-text.d.ts.map +1 -0
  133. package/build/src/worker/interpreters/plain-text.js +18 -0
  134. package/build/src/worker/interpreters/plain-text.js.map +1 -0
  135. package/build/src/worker/interpreters/seerr.d.ts +4 -0
  136. package/build/src/worker/interpreters/seerr.d.ts.map +1 -0
  137. package/build/src/worker/interpreters/seerr.js +173 -0
  138. package/build/src/worker/interpreters/seerr.js.map +1 -0
  139. package/build/src/worker/interpreters/statuspage.d.ts +4 -0
  140. package/build/src/worker/interpreters/statuspage.d.ts.map +1 -0
  141. package/build/src/worker/interpreters/statuspage.js +266 -0
  142. package/build/src/worker/interpreters/statuspage.js.map +1 -0
  143. package/build/src/worker/interpreters/synology.d.ts +4 -0
  144. package/build/src/worker/interpreters/synology.d.ts.map +1 -0
  145. package/build/src/worker/interpreters/synology.js +177 -0
  146. package/build/src/worker/interpreters/synology.js.map +1 -0
  147. package/build/src/worker/interpreters/unifi.d.ts +4 -0
  148. package/build/src/worker/interpreters/unifi.d.ts.map +1 -0
  149. package/build/src/worker/interpreters/unifi.js +152 -0
  150. package/build/src/worker/interpreters/unifi.js.map +1 -0
  151. package/build/src/worker/landing/page.d.ts +4 -0
  152. package/build/src/worker/landing/page.d.ts.map +1 -0
  153. package/build/src/worker/landing/page.js +260 -0
  154. package/build/src/worker/landing/page.js.map +1 -0
  155. package/build/src/worker/pipeline/accumulate.d.ts +7 -0
  156. package/build/src/worker/pipeline/accumulate.d.ts.map +1 -0
  157. package/build/src/worker/pipeline/accumulate.js +53 -0
  158. package/build/src/worker/pipeline/accumulate.js.map +1 -0
  159. package/build/src/worker/pipeline/authenticate.d.ts +4 -0
  160. package/build/src/worker/pipeline/authenticate.d.ts.map +1 -0
  161. package/build/src/worker/pipeline/authenticate.js +53 -0
  162. package/build/src/worker/pipeline/authenticate.js.map +1 -0
  163. package/build/src/worker/pipeline/email.d.ts +4 -0
  164. package/build/src/worker/pipeline/email.d.ts.map +1 -0
  165. package/build/src/worker/pipeline/email.js +149 -0
  166. package/build/src/worker/pipeline/email.js.map +1 -0
  167. package/build/src/worker/pipeline/format.d.ts +5 -0
  168. package/build/src/worker/pipeline/format.d.ts.map +1 -0
  169. package/build/src/worker/pipeline/format.js +48 -0
  170. package/build/src/worker/pipeline/format.js.map +1 -0
  171. package/build/src/worker/pipeline/interpret.d.ts +4 -0
  172. package/build/src/worker/pipeline/interpret.d.ts.map +1 -0
  173. package/build/src/worker/pipeline/interpret.js +30 -0
  174. package/build/src/worker/pipeline/interpret.js.map +1 -0
  175. package/build/src/worker/pipeline/parse.d.ts +4 -0
  176. package/build/src/worker/pipeline/parse.d.ts.map +1 -0
  177. package/build/src/worker/pipeline/parse.js +59 -0
  178. package/build/src/worker/pipeline/parse.js.map +1 -0
  179. package/build/src/worker/pipeline/receive.d.ts +4 -0
  180. package/build/src/worker/pipeline/receive.d.ts.map +1 -0
  181. package/build/src/worker/pipeline/receive.js +52 -0
  182. package/build/src/worker/pipeline/receive.js.map +1 -0
  183. package/build/src/worker/pipeline/respond.d.ts +4 -0
  184. package/build/src/worker/pipeline/respond.d.ts.map +1 -0
  185. package/build/src/worker/pipeline/respond.js +48 -0
  186. package/build/src/worker/pipeline/respond.js.map +1 -0
  187. package/build/src/worker/pipeline/route.d.ts +5 -0
  188. package/build/src/worker/pipeline/route.d.ts.map +1 -0
  189. package/build/src/worker/pipeline/route.js +23 -0
  190. package/build/src/worker/pipeline/route.js.map +1 -0
  191. package/build/src/worker/pipeline/send.d.ts +4 -0
  192. package/build/src/worker/pipeline/send.d.ts.map +1 -0
  193. package/build/src/worker/pipeline/send.js +156 -0
  194. package/build/src/worker/pipeline/send.js.map +1 -0
  195. package/build/src/worker/pipeline/split.d.ts +4 -0
  196. package/build/src/worker/pipeline/split.d.ts.map +1 -0
  197. package/build/src/worker/pipeline/split.js +40 -0
  198. package/build/src/worker/pipeline/split.js.map +1 -0
  199. package/package.json +95 -2
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Tests - Worker - Landing - Page.
3
+ *
4
+ * @since 2.0.0
5
+ */
6
+ export type TestsWorkerLandingPageMockConfig = {
7
+ settings: TestsWorkerLandingPageMockSettings;
8
+ servers: TestsWorkerLandingPageMockServer[];
9
+ contexts: TestsWorkerLandingPageMockContext[];
10
+ };
11
+
12
+ export type TestsWorkerLandingPageMockSettings = {
13
+ worker_name: string;
14
+ base_domain: string;
15
+ show_response_output: boolean;
16
+ };
17
+
18
+ export type TestsWorkerLandingPageMockServer = {
19
+ name: string;
20
+ server: string;
21
+ token: string;
22
+ };
23
+
24
+ export type TestsWorkerLandingPageMockContext = {
25
+ id: string;
26
+ name: string;
27
+ type: 'http';
28
+ interpreter: 'plain-text';
29
+ topic: string;
30
+ mode: 'send-once';
31
+ show_visitor_info: boolean;
32
+ primary_server: string;
33
+ servers: string[];
34
+ token?: string | undefined;
35
+ };
36
+
37
+ export type TestsWorkerLandingPageResponse = Response;
38
+
39
+ export type TestsWorkerLandingPageHtml = string;
40
+
41
+ export type TestsWorkerLandingPageContentType = string | null;
42
+
43
+ export type TestsWorkerLandingPageDebugConfig = {
44
+ settings: TestsWorkerLandingPageMockSettings;
45
+ servers: TestsWorkerLandingPageMockServer[];
46
+ contexts: TestsWorkerLandingPageMockContext[];
47
+ };
48
+
49
+ export type TestsWorkerLandingPageContextsStart = number;
50
+
51
+ export type TestsWorkerLandingPageIdIndex = number;
52
+
53
+ export type TestsWorkerLandingPageNameIndex = number;
54
+
55
+ export type TestsWorkerLandingPageTypeIndex = number;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Tests - Worker - Pipeline - Accumulate.
3
+ *
4
+ * @since 2.0.0
5
+ */
6
+ export type TestsWorkerPipelineAccumulatePrevious = Record<string, TestsWorkerPipelineAccumulateComponentState>;
7
+
8
+ export type TestsWorkerPipelineAccumulateCurrent = Record<string, TestsWorkerPipelineAccumulateComponentState>;
9
+
10
+ export type TestsWorkerPipelineAccumulateComponentState = {
11
+ name: string;
12
+ status: string;
13
+ };
14
+
15
+ export type TestsWorkerPipelineAccumulateDiffEntry = {
16
+ name: string;
17
+ oldStatus: string | undefined;
18
+ newStatus: string;
19
+ changed: boolean;
20
+ };
21
+
22
+ export type TestsWorkerPipelineAccumulateDiff = TestsWorkerPipelineAccumulateDiffEntry[];
23
+
24
+ export type TestsWorkerPipelineAccumulateChangedEntries = TestsWorkerPipelineAccumulateDiffEntry[];
25
+
26
+ export type TestsWorkerPipelineAccumulateUnchangedEntries = TestsWorkerPipelineAccumulateDiffEntry[];
27
+
28
+ export type TestsWorkerPipelineAccumulateLines = string[];
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Tests - Worker - Pipeline - Authenticate.
3
+ *
4
+ * @since 2.0.0
5
+ */
6
+ export type TestsWorkerPipelineAuthenticateResult = {
7
+ authenticated: boolean;
8
+ reason?: string;
9
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Tests - Worker - Pipeline - Email.
3
+ *
4
+ * @since 2.0.0
5
+ */
6
+ export type TestsWorkerPipelineEmailRaw = string;
7
+
8
+ export type TestsWorkerPipelineEmailResult = {
9
+ from: string;
10
+ to: string;
11
+ subject: string;
12
+ textBody: string;
13
+ };
14
+
15
+ export type TestsWorkerPipelineEmailBoundary = string;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Tests - Worker - Pipeline - Format.
3
+ *
4
+ * @since 2.0.0
5
+ */
6
+ export type TestsWorkerPipelineFormatBaseNotification = {
7
+ title: string;
8
+ body: string;
9
+ priority: 3;
10
+ tags: string[];
11
+ markdown: boolean;
12
+ };
13
+
14
+ export type TestsWorkerPipelineFormatResult = {
15
+ body: string;
16
+ headers: Record<string, string>;
17
+ };
18
+
19
+ export type TestsWorkerPipelineFormatCfProperties = {
20
+ country: string;
21
+ region: string;
22
+ city: string;
23
+ colo: string;
24
+ latitude: string;
25
+ longitude: string;
26
+ asn: number;
27
+ asOrganization: string;
28
+ };
29
+
30
+ export type TestsWorkerPipelineFormatNotificationWithOptionals = {
31
+ title: string;
32
+ body: string;
33
+ priority: 3;
34
+ tags: string[];
35
+ markdown: boolean;
36
+ icon: string;
37
+ actions: string;
38
+ };
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Tests - Worker - Pipeline - Interpret.
3
+ *
4
+ * @since 2.0.0
5
+ */
6
+ export type TestsWorkerPipelineInterpretResult = {
7
+ notification: TestsWorkerPipelineInterpretResultNotification;
8
+ attachment?: ArrayBuffer | undefined;
9
+ } | null;
10
+
11
+ export type TestsWorkerPipelineInterpretResultNotification = {
12
+ title?: string | undefined;
13
+ body: string;
14
+ priority?: 1 | 2 | 3 | 4 | 5 | undefined;
15
+ tags?: string[] | undefined;
16
+ icon?: string | undefined;
17
+ actions?: string | undefined;
18
+ attach?: string | undefined;
19
+ filename?: string | undefined;
20
+ markdown?: boolean | undefined;
21
+ };
22
+
23
+ export type TestsWorkerPipelineInterpretInput = {
24
+ page: TestsWorkerPipelineInterpretInputPage;
25
+ incident: TestsWorkerPipelineInterpretInputIncident;
26
+ };
27
+
28
+ export type TestsWorkerPipelineInterpretInputPage = {
29
+ name: string;
30
+ };
31
+
32
+ export type TestsWorkerPipelineInterpretInputIncident = {
33
+ name: string;
34
+ status: string;
35
+ impact: string;
36
+ incident_updates: TestsWorkerPipelineInterpretInputIncidentUpdates;
37
+ };
38
+
39
+ export type TestsWorkerPipelineInterpretInputIncidentUpdates = unknown[];
40
+
41
+ export type TestsWorkerPipelineInterpretPromiseResult = Promise<TestsWorkerPipelineInterpretResult>;
42
+
43
+ export type TestsWorkerPipelineInterpretRejectsExpectation = Promise<void>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Tests - Worker - Pipeline - Parse.
3
+ *
4
+ * @since 2.0.0
5
+ */
6
+ export type TestsWorkerPipelineParseBody = Uint8Array;
7
+
8
+ export type TestsWorkerPipelineParseHeaders = Headers;
9
+
10
+ export type TestsWorkerPipelineParseResult = {
11
+ type: string;
12
+ text?: string;
13
+ json?: Record<string, unknown>;
14
+ binary?: ArrayBuffer;
15
+ };
16
+
17
+ export type TestsWorkerPipelineParseEmptyBody = ArrayBuffer;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Tests - Worker - Pipeline - Receive.
3
+ *
4
+ * @since 2.0.0
5
+ */
6
+ export type TestsWorkerPipelineReceiveBaseDomain = string;
7
+
8
+ export type TestsWorkerPipelineReceiveRequest = Request;
9
+
10
+ export type TestsWorkerPipelineReceiveResult = {
11
+ method: string;
12
+ hostname: string;
13
+ url: string;
14
+ headers: Headers;
15
+ rawBody: ArrayBuffer;
16
+ isGet: boolean;
17
+ redirect?: string;
18
+ error?: string;
19
+ };
20
+
21
+ export type TestsWorkerPipelineReceiveBody = string;
22
+
23
+ export type TestsWorkerPipelineReceiveHeaderValue = string | null;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Tests - Worker - Pipeline - Respond.
3
+ *
4
+ * @since 2.0.0
5
+ */
6
+ export type TestsWorkerPipelineRespondSendResult = {
7
+ results: TestsWorkerPipelineRespondServerResult[];
8
+ fallbackUsed: boolean;
9
+ };
10
+
11
+ export type TestsWorkerPipelineRespondServerResult = {
12
+ name: string;
13
+ success: boolean;
14
+ status: number;
15
+ stages: string[];
16
+ };
17
+
18
+ export type TestsWorkerPipelineRespondResponse = Response;
19
+
20
+ export type TestsWorkerPipelineRespondBody = Record<string, unknown>;
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Tests - Worker - Pipeline - Route.
3
+ *
4
+ * @since 2.0.0
5
+ */
6
+ export type TestsWorkerPipelineRouteMockConfig = {
7
+ settings: TestsWorkerPipelineRouteMockSettings;
8
+ servers: TestsWorkerPipelineRouteMockServer[];
9
+ contexts: TestsWorkerPipelineRouteMockContext[];
10
+ };
11
+
12
+ export type TestsWorkerPipelineRouteMockSettings = {
13
+ worker_name: string;
14
+ base_domain: string;
15
+ show_response_output: boolean;
16
+ };
17
+
18
+ export type TestsWorkerPipelineRouteMockServer = {
19
+ name: string;
20
+ server: string;
21
+ token: string;
22
+ };
23
+
24
+ export type TestsWorkerPipelineRouteMockContext = TestsWorkerPipelineRouteMockHttpContext | TestsWorkerPipelineRouteMockEmailContext;
25
+
26
+ export type TestsWorkerPipelineRouteMockHttpContext = {
27
+ id: string;
28
+ name: string;
29
+ type: 'http';
30
+ interpreter: 'plain-text';
31
+ topic: string;
32
+ error_topic?: string | undefined;
33
+ mode: 'send-once';
34
+ show_visitor_info: boolean;
35
+ primary_server: string;
36
+ servers: string[];
37
+ token?: string | undefined;
38
+ };
39
+
40
+ export type TestsWorkerPipelineRouteMockEmailContext = {
41
+ id: string;
42
+ name: string;
43
+ type: 'email';
44
+ interpreter: 'pfsense';
45
+ topic: string;
46
+ error_topic?: string | undefined;
47
+ mode: 'send-once';
48
+ show_visitor_info: boolean;
49
+ primary_server: string;
50
+ servers: string[];
51
+ allowed_from?: string | undefined;
52
+ };
53
+
54
+ export type TestsWorkerPipelineRouteResult = {
55
+ context: TestsWorkerPipelineRouteContextResult | undefined;
56
+ resolvedServers: TestsWorkerPipelineRouteServerResult[] | undefined;
57
+ primaryServer: TestsWorkerPipelineRouteServerResult | undefined;
58
+ error: string | undefined;
59
+ };
60
+
61
+ export type TestsWorkerPipelineRouteContextResult = {
62
+ name: string;
63
+ type: string;
64
+ id: string;
65
+ interpreter: string;
66
+ topic: string;
67
+ error_topic?: string | undefined;
68
+ mode: string;
69
+ show_visitor_info: boolean;
70
+ primary_server: string;
71
+ servers: string[];
72
+ token?: string | undefined;
73
+ allowed_from?: string | undefined;
74
+ };
75
+
76
+ export type TestsWorkerPipelineRouteServerResult = {
77
+ name: string;
78
+ server: string;
79
+ token: string;
80
+ };
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Tests - Worker - Pipeline - Send.
3
+ *
4
+ * @since 2.0.0
5
+ */
6
+ export type TestsWorkerPipelineSendServer = {
7
+ name: string;
8
+ server: string;
9
+ token: string;
10
+ };
11
+
12
+ export type TestsWorkerPipelineSendServers = TestsWorkerPipelineSendServer[];
13
+
14
+ export type TestsWorkerPipelineSendMessage = {
15
+ body: string;
16
+ headers: Record<string, string>;
17
+ };
18
+
19
+ export type TestsWorkerPipelineSendMessages = TestsWorkerPipelineSendMessage[];
20
+
21
+ export type TestsWorkerPipelineSendResult = {
22
+ results: TestsWorkerPipelineSendServerResult[];
23
+ fallbackUsed: boolean;
24
+ fallbackNote?: string | undefined;
25
+ };
26
+
27
+ export type TestsWorkerPipelineSendServerResult = {
28
+ name: string;
29
+ success: boolean;
30
+ status: number;
31
+ stages: string[];
32
+ error?: string | undefined;
33
+ };
34
+
35
+ export type TestsWorkerPipelineSendEveryResult = boolean;
36
+
37
+ export type TestsWorkerPipelineSendAttachment = ArrayBuffer;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Tests - Worker - Pipeline - Split.
3
+ *
4
+ * @since 2.0.0
5
+ */
6
+ export type TestsWorkerPipelineSplitResultPart = {
7
+ body: string;
8
+ headers: Record<string, string>;
9
+ };
10
+
11
+ export type TestsWorkerPipelineSplitResult = TestsWorkerPipelineSplitResultPart[];
12
+
13
+ export type TestsWorkerPipelineSplitLongBody = string;
14
+
15
+ export type TestsWorkerPipelineSplitHeaders = Record<string, string>;
16
+
17
+ export type TestsWorkerPipelineSplitBody = string;
@@ -0,0 +1,232 @@
1
+ import type { z } from 'zod';
2
+
3
+ import type {
4
+ LibSchemaConfigSchema,
5
+ LibSchemaEmailContextConfig,
6
+ LibSchemaHttpContextConfig,
7
+ LibSchemaServerConfig,
8
+ } from '../lib/schema.d.ts';
9
+ import type { WorkerPipelineAuthenticateResult } from './pipeline/authenticate.d.ts';
10
+ import type { WorkerPipelineEmailResult } from './pipeline/email.d.ts';
11
+ import type { WorkerPipelineFormatResult } from './pipeline/format.d.ts';
12
+ import type {
13
+ WorkerPipelineInterpretInput,
14
+ WorkerPipelineInterpretResult,
15
+ } from './pipeline/interpret.d.ts';
16
+ import type { WorkerPipelineParseResult } from './pipeline/parse.d.ts';
17
+ import type { WorkerPipelineReceiveResult } from './pipeline/receive.d.ts';
18
+ import type { WorkerPipelineRouteResult } from './pipeline/route.d.ts';
19
+ import type { WorkerPipelineSendResult } from './pipeline/send.d.ts';
20
+ import type { WorkerPipelineSplitMessagePart } from './pipeline/split.d.ts';
21
+
22
+ /**
23
+ * Worker - Email Handler Variables.
24
+ *
25
+ * @since 2.0.0
26
+ */
27
+ export type WorkerEmailHandlerMessage = {
28
+ from: string;
29
+ to: string;
30
+ headers: Headers;
31
+ raw: ReadableStream;
32
+ };
33
+
34
+ export type WorkerEmailHandlerEnv = Record<string, string | KVNamespace | undefined>;
35
+
36
+ export type WorkerEmailHandlerReturns = Promise<void>;
37
+
38
+ export type WorkerEmailHandlerEnvString = string;
39
+
40
+ export type WorkerEmailHandlerSettings = unknown;
41
+
42
+ export type WorkerEmailHandlerServers = unknown;
43
+
44
+ export type WorkerEmailHandlerContexts = unknown;
45
+
46
+ export type WorkerEmailHandlerResult = z.ZodSafeParseResult<LibSchemaConfigSchema>;
47
+
48
+ export type WorkerEmailHandlerReader = ReadableStreamDefaultReader<Uint8Array>;
49
+
50
+ export type WorkerEmailHandlerChunks = Uint8Array[];
51
+
52
+ export type WorkerEmailHandlerDone = boolean;
53
+
54
+ export type WorkerEmailHandlerReadResult = ReadableStreamReadResult<Uint8Array>;
55
+
56
+ export type WorkerEmailHandlerDecoder = TextDecoder;
57
+
58
+ export type WorkerEmailHandlerRawEmail = string;
59
+
60
+ export type WorkerEmailHandlerKv = KVNamespace | undefined;
61
+
62
+ /**
63
+ * Worker - Fetch Handler Variables.
64
+ *
65
+ * @since 2.0.0
66
+ */
67
+ export type WorkerFetchEnv = Record<string, string | KVNamespace | undefined>;
68
+
69
+ export type WorkerFetchReturns = Promise<Response>;
70
+
71
+ export type WorkerFetchEnvString = string;
72
+
73
+ export type WorkerFetchSettings = unknown;
74
+
75
+ export type WorkerFetchServers = unknown;
76
+
77
+ export type WorkerFetchContexts = unknown;
78
+
79
+ export type WorkerFetchResult = z.ZodSafeParseResult<LibSchemaConfigSchema>;
80
+
81
+ export type WorkerFetchKv = KVNamespace | undefined;
82
+
83
+ /**
84
+ * Worker - Handle Email.
85
+ *
86
+ * @since 2.0.0
87
+ */
88
+ export type WorkerHandleEmailRawEmail = string;
89
+
90
+ export type WorkerHandleEmailFrom = string;
91
+
92
+ export type WorkerHandleEmailConfig = LibSchemaConfigSchema;
93
+
94
+ export type WorkerHandleEmailKv = KVNamespace | undefined;
95
+
96
+ export type WorkerHandleEmailReturn = Promise<void>;
97
+
98
+ /**
99
+ * Worker - Handle Email Variables.
100
+ *
101
+ * @since 2.0.0
102
+ */
103
+ export type WorkerEmailParsed = WorkerPipelineEmailResult;
104
+
105
+ export type WorkerDebugRawEmailStr = string;
106
+
107
+ export type WorkerRecipientLocalPart = string;
108
+
109
+ export type WorkerEmailRouted = WorkerPipelineRouteResult;
110
+
111
+ export type WorkerEmailCtx = LibSchemaEmailContextConfig;
112
+
113
+ export type WorkerEmailResolvedServers = LibSchemaServerConfig[];
114
+
115
+ export type WorkerEmailPrimaryServer = LibSchemaServerConfig;
116
+
117
+ export type WorkerEmailAuthResult = WorkerPipelineAuthenticateResult;
118
+
119
+ export type WorkerEmailErrorFormatted = WorkerPipelineFormatResult;
120
+
121
+ export type WorkerEmailErrorMessages = WorkerPipelineSplitMessagePart[];
122
+
123
+ export type WorkerEmailErrorAttachmentData = Record<string, unknown>;
124
+
125
+ export type WorkerEmailErrorAttachmentJson = string;
126
+
127
+ export type WorkerEmailErrorAttachmentBuffer = ArrayBuffer;
128
+
129
+ export type WorkerEmailInput = Record<string, string>;
130
+
131
+ export type WorkerEmailInterpreted = WorkerPipelineInterpretResult | null | undefined;
132
+
133
+ export type WorkerEmailErrorMessage = string;
134
+
135
+ export type WorkerEmailFormatted = WorkerPipelineFormatResult;
136
+
137
+ export type WorkerEmailMessages = WorkerPipelineSplitMessagePart[];
138
+
139
+ export type WorkerEmailSendResult = WorkerPipelineSendResult;
140
+
141
+ export type WorkerEmailDebugLogStr = string;
142
+
143
+ /**
144
+ * Worker - Handle Request.
145
+ *
146
+ * @since 2.0.0
147
+ */
148
+ export type WorkerHandleRequestRequest = Request;
149
+
150
+ export type WorkerHandleRequestConfig = LibSchemaConfigSchema;
151
+
152
+ export type WorkerHandleRequestKv = KVNamespace | undefined;
153
+
154
+ export type WorkerHandleRequestReturn = Promise<Response>;
155
+
156
+ /**
157
+ * Worker - Handle Request Variables.
158
+ *
159
+ * @since 2.0.0
160
+ */
161
+ export type WorkerReceived = WorkerPipelineReceiveResult;
162
+
163
+ export type WorkerSubdomain = string;
164
+
165
+ export type WorkerRouted = WorkerPipelineRouteResult;
166
+
167
+ export type WorkerCtx = LibSchemaHttpContextConfig;
168
+
169
+ export type WorkerResolvedServers = LibSchemaServerConfig[];
170
+
171
+ export type WorkerPrimaryServer = LibSchemaServerConfig;
172
+
173
+ export type WorkerAuthResult = WorkerPipelineAuthenticateResult;
174
+
175
+ export type WorkerErrorFormatted = WorkerPipelineFormatResult;
176
+
177
+ export type WorkerErrorMessages = WorkerPipelineSplitMessagePart[];
178
+
179
+ export type WorkerErrorAttachmentHeaders = Record<string, string>;
180
+
181
+ export type WorkerErrorAttachmentData = Record<string, unknown>;
182
+
183
+ export type WorkerErrorAttachmentJson = string;
184
+
185
+ export type WorkerErrorAttachmentBuffer = ArrayBuffer;
186
+
187
+ export type WorkerParsed = WorkerPipelineParseResult;
188
+
189
+ export type WorkerRawBodyJsonStr = string;
190
+
191
+ export type WorkerRawBodyText = string | undefined;
192
+
193
+ export type WorkerDebugRawRequestStr = string;
194
+
195
+ export type WorkerInput = WorkerPipelineInterpretInput;
196
+
197
+ export type WorkerInterpreted = WorkerPipelineInterpretResult | null | undefined;
198
+
199
+ export type WorkerErrorMessage = string;
200
+
201
+ export type WorkerErrorNotification = {
202
+ notification: {
203
+ title: string;
204
+ body: string;
205
+ };
206
+ };
207
+
208
+ export type WorkerVisitorIpHeader = string | null;
209
+
210
+ export type WorkerFormatted = WorkerPipelineFormatResult;
211
+
212
+ export type WorkerMessages = WorkerPipelineSplitMessagePart[];
213
+
214
+ export type WorkerSendResult = WorkerPipelineSendResult;
215
+
216
+ export type WorkerResponse = Response;
217
+
218
+ export type WorkerCloned = Response;
219
+
220
+ export type WorkerResponseBody = string;
221
+
222
+ export type WorkerBody = Record<string, string>;
223
+
224
+ /**
225
+ * Worker - Module Exports.
226
+ *
227
+ * @since 2.0.0
228
+ */
229
+ export type WorkerModuleExports = {
230
+ fetch: (request: Request, env: WorkerFetchEnv) => WorkerFetchReturns;
231
+ email: (message: WorkerEmailHandlerMessage, env: WorkerEmailHandlerEnv) => WorkerEmailHandlerReturns;
232
+ };
@@ -0,0 +1,28 @@
1
+ import type {
2
+ WorkerPipelineInterpretInput,
3
+ WorkerPipelineInterpretResult,
4
+ } from '../pipeline/interpret.d.ts';
5
+
6
+ /**
7
+ * Worker - Interpreters - Ntfy JSON.
8
+ *
9
+ * @since 2.0.0
10
+ */
11
+ export type WorkerInterpretersNtfyJsonInput = WorkerPipelineInterpretInput;
12
+
13
+ export type WorkerInterpretersNtfyJsonResult = WorkerPipelineInterpretResult | null;
14
+
15
+ export type WorkerInterpretersNtfyJsonInterpreter = (input: WorkerInterpretersNtfyJsonInput) => WorkerInterpretersNtfyJsonResult;
16
+
17
+ /**
18
+ * Worker - Interpreters - Ntfy JSON - Ntfy JSON Interpreter.
19
+ *
20
+ * @since 2.0.0
21
+ */
22
+ export type WorkerInterpretersNtfyJsonNtfyJsonInterpreterParsed = unknown;
23
+
24
+ export type WorkerInterpretersNtfyJsonNtfyJsonInterpreterDecoder = TextDecoder;
25
+
26
+ export type WorkerInterpretersNtfyJsonNtfyJsonInterpreterDecodedBody = string;
27
+
28
+ export type WorkerInterpretersNtfyJsonNtfyJsonInterpreterNotification = WorkerPipelineInterpretResult['notification'];