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,44 @@
1
+ import type {
2
+ LibSchemaConfigSchema,
3
+ LibSchemaConfigSchemaContexts,
4
+ LibSchemaConfigSchemaServers,
5
+ LibSchemaConfigSchemaSettings,
6
+ } from '../../lib/schema.d.ts';
7
+
8
+ /**
9
+ * Worker - Landing - Page.
10
+ *
11
+ * @since 2.0.0
12
+ */
13
+ export type WorkerLandingPageConfig = LibSchemaConfigSchema;
14
+
15
+ export type WorkerLandingPageResponse = Response;
16
+
17
+ export type WorkerLandingPageSettings = LibSchemaConfigSchemaSettings;
18
+
19
+ export type WorkerLandingPageServers = LibSchemaConfigSchemaServers;
20
+
21
+ export type WorkerLandingPageContexts = LibSchemaConfigSchemaContexts;
22
+
23
+ export type WorkerLandingPageDebugSection = string;
24
+
25
+ export type WorkerLandingPageMaskedServers = Record<string, string>[];
26
+
27
+ export type WorkerLandingPageMaskedContexts = Record<string, unknown>[];
28
+
29
+ export type WorkerLandingPageBase = Record<string, unknown>;
30
+
31
+ export type WorkerLandingPageMaskedConfig = Record<string, unknown>;
32
+
33
+ export type WorkerLandingPageMaskedJson = string;
34
+
35
+ export type WorkerLandingPageHtml = string;
36
+
37
+ /**
38
+ * Worker - Landing - Page - Escape HTML.
39
+ *
40
+ * @since 2.0.0
41
+ */
42
+ export type WorkerLandingPageEscapeHtmlStr = string;
43
+
44
+ export type WorkerLandingPageEscapeHtmlReturns = string;
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Worker - Pipeline - Accumulate.
3
+ *
4
+ * @since 2.0.0
5
+ */
6
+
7
+ import type {
8
+ WorkerPipelineSharedComponentDiff,
9
+ WorkerPipelineSharedComponentsMap,
10
+ WorkerPipelineSharedComponentState,
11
+ WorkerPipelineSharedStoredState,
12
+ } from './shared.d.ts';
13
+
14
+ /**
15
+ * Worker - Pipeline - Accumulate - Delete State.
16
+ *
17
+ * @since 2.0.0
18
+ */
19
+ export type WorkerPipelineAccumulateDeleteStateKv = KVNamespace;
20
+
21
+ export type WorkerPipelineAccumulateDeleteStatePageId = string;
22
+
23
+ export type WorkerPipelineAccumulateDeleteStateReturns = Promise<void>;
24
+
25
+ /**
26
+ * Worker - Pipeline - Accumulate - Diff Components.
27
+ *
28
+ * @since 2.0.0
29
+ */
30
+ export type WorkerPipelineAccumulateDiffComponentsPrevious = WorkerPipelineSharedComponentsMap;
31
+
32
+ export type WorkerPipelineAccumulateDiffComponentsCurrent = WorkerPipelineSharedComponentsMap;
33
+
34
+ export type WorkerPipelineAccumulateDiffComponentsReturns = WorkerPipelineSharedComponentDiff;
35
+
36
+ export type WorkerPipelineAccumulateDiffComponentsCurrentEntry = WorkerPipelineSharedComponentState | undefined;
37
+
38
+ export type WorkerPipelineAccumulateDiffComponentsPreviousEntry = WorkerPipelineSharedComponentState | undefined;
39
+
40
+ /**
41
+ * Worker - Pipeline - Accumulate - Format Component Lines.
42
+ *
43
+ * @since 2.0.0
44
+ */
45
+ export type WorkerPipelineAccumulateFormatComponentLinesDiff = WorkerPipelineSharedComponentDiff;
46
+
47
+ export type WorkerPipelineAccumulateFormatComponentLinesReturns = string[];
48
+
49
+ export type WorkerPipelineAccumulateFormatComponentLinesCleanName = string;
50
+
51
+ export type WorkerPipelineAccumulateFormatComponentLinesHumanized = string;
52
+
53
+ /**
54
+ * Worker - Pipeline - Accumulate - Read State.
55
+ *
56
+ * @since 2.0.0
57
+ */
58
+ export type WorkerPipelineAccumulateReadStateKv = KVNamespace;
59
+
60
+ export type WorkerPipelineAccumulateReadStatePageId = string;
61
+
62
+ export type WorkerPipelineAccumulateReadStateReturns = Promise<WorkerPipelineSharedStoredState | null>;
63
+
64
+ export type WorkerPipelineAccumulateReadStateRaw = string | null;
65
+
66
+ /**
67
+ * Worker - Pipeline - Accumulate - Write State.
68
+ *
69
+ * @since 2.0.0
70
+ */
71
+ export type WorkerPipelineAccumulateWriteStateKv = KVNamespace;
72
+
73
+ export type WorkerPipelineAccumulateWriteStatePageId = string;
74
+
75
+ export type WorkerPipelineAccumulateWriteStateState = WorkerPipelineSharedStoredState;
76
+
77
+ export type WorkerPipelineAccumulateWriteStateReturns = Promise<void>;
78
+
79
+ export type WorkerPipelineAccumulateWriteStateSerializedState = string;
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Worker - Pipeline - Authenticate.
3
+ *
4
+ * @since 2.0.0
5
+ */
6
+ export type WorkerPipelineAuthenticateAuthConfigToken = string;
7
+
8
+ export type WorkerPipelineAuthenticateAuthConfigAllowedFrom = string;
9
+
10
+ export type WorkerPipelineAuthenticateAuthConfigTypeHttp = 'http';
11
+
12
+ export type WorkerPipelineAuthenticateAuthConfigTypeEmail = 'email';
13
+
14
+ export type WorkerPipelineAuthenticateAuthConfig = {
15
+ type: WorkerPipelineAuthenticateAuthConfigTypeHttp;
16
+ token?: WorkerPipelineAuthenticateAuthConfigToken;
17
+ } | {
18
+ type: WorkerPipelineAuthenticateAuthConfigTypeEmail;
19
+ allowed_from?: WorkerPipelineAuthenticateAuthConfigAllowedFrom;
20
+ };
21
+
22
+ export type WorkerPipelineAuthenticateCredentialsAuthorization = string | undefined;
23
+
24
+ export type WorkerPipelineAuthenticateCredentialsFrom = string | undefined;
25
+
26
+ export type WorkerPipelineAuthenticateCredentials = {
27
+ authorization: WorkerPipelineAuthenticateCredentialsAuthorization;
28
+ from: WorkerPipelineAuthenticateCredentialsFrom;
29
+ };
30
+
31
+ export type WorkerPipelineAuthenticateResultSuccessAuthenticated = true;
32
+
33
+ export type WorkerPipelineAuthenticateResultSuccess = {
34
+ authenticated: WorkerPipelineAuthenticateResultSuccessAuthenticated;
35
+ };
36
+
37
+ export type WorkerPipelineAuthenticateResultFailureAuthenticated = false;
38
+
39
+ export type WorkerPipelineAuthenticateResultFailureReason = string;
40
+
41
+ export type WorkerPipelineAuthenticateResultFailure = {
42
+ authenticated: WorkerPipelineAuthenticateResultFailureAuthenticated;
43
+ reason: WorkerPipelineAuthenticateResultFailureReason;
44
+ };
45
+
46
+ export type WorkerPipelineAuthenticateResult = WorkerPipelineAuthenticateResultSuccess | WorkerPipelineAuthenticateResultFailure;
47
+
48
+ export type WorkerPipelineAuthenticateToken = string | undefined;
49
+
50
+ export type WorkerPipelineAuthenticateAuthorization = string | undefined;
51
+
52
+ export type WorkerPipelineAuthenticateIsBearerMatch = boolean;
53
+
54
+ export type WorkerPipelineAuthenticateIsRawMatch = boolean;
55
+
56
+ export type WorkerPipelineAuthenticateAllowedFrom = string | undefined;
57
+
58
+ export type WorkerPipelineAuthenticateFrom = string | undefined;
59
+
60
+ export type WorkerPipelineAuthenticateNormalizedAllowedFrom = string;
61
+
62
+ export type WorkerPipelineAuthenticateNormalizedFrom = string;
63
+
64
+ export type WorkerPipelineAuthenticateAllowedDomain = string;
65
+
66
+ export type WorkerPipelineAuthenticateAtIndex = number;
67
+
68
+ export type WorkerPipelineAuthenticateFromDomain = string;
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Worker - Pipeline - Email - Extract Email Address.
3
+ *
4
+ * @since 2.0.0
5
+ */
6
+ export type WorkerPipelineEmailHeaderValue = string;
7
+
8
+ export type WorkerPipelineEmailExtractEmailAddressMatch = RegExpMatchArray | null;
9
+
10
+ /**
11
+ * Worker - Pipeline - Email - Extract From Multipart.
12
+ *
13
+ * @since 2.0.0
14
+ */
15
+ export type WorkerPipelineEmailBodySection = string;
16
+
17
+ export type WorkerPipelineEmailHeaderSection = string;
18
+
19
+ export type WorkerPipelineEmailExtractFromMultipartResultText = string;
20
+
21
+ export type WorkerPipelineEmailExtractFromMultipartResultHtml = string;
22
+
23
+ export type WorkerPipelineEmailExtractFromMultipartResult = {
24
+ text: WorkerPipelineEmailExtractFromMultipartResultText;
25
+ html: WorkerPipelineEmailExtractFromMultipartResultHtml;
26
+ };
27
+
28
+ export type WorkerPipelineEmailBoundaryMatch = RegExpMatchArray | null;
29
+
30
+ export type WorkerPipelineEmailBoundary = string | undefined;
31
+
32
+ export type WorkerPipelineEmailExtractFromMultipartText = string;
33
+
34
+ export type WorkerPipelineEmailExtractFromMultipartHtml = string;
35
+
36
+ export type WorkerPipelineEmailParts = string[];
37
+
38
+ export type WorkerPipelineEmailPart = string;
39
+
40
+ export type WorkerPipelineEmailExtractFromMultipartSeparator = string;
41
+
42
+ export type WorkerPipelineEmailPartHeaderSeparatorIndex = number;
43
+
44
+ export type WorkerPipelineEmailPartContentType = string;
45
+
46
+ export type WorkerPipelineEmailPartBody = string;
47
+
48
+ /**
49
+ * Worker - Pipeline - Email - Parse Email.
50
+ *
51
+ * @since 2.0.0
52
+ */
53
+ export type WorkerPipelineEmailRawEmail = string;
54
+
55
+ export type WorkerPipelineEmailResultFrom = string;
56
+
57
+ export type WorkerPipelineEmailResultTo = string;
58
+
59
+ export type WorkerPipelineEmailResultSubject = string;
60
+
61
+ export type WorkerPipelineEmailResultTextBody = string;
62
+
63
+ export type WorkerPipelineEmailResult = {
64
+ from: WorkerPipelineEmailResultFrom;
65
+ to: WorkerPipelineEmailResultTo;
66
+ subject: WorkerPipelineEmailResultSubject;
67
+ textBody: WorkerPipelineEmailResultTextBody;
68
+ };
69
+
70
+ export type WorkerPipelineEmailParseEmailReturns = Promise<WorkerPipelineEmailResult>;
71
+
72
+ export type WorkerPipelineEmailParseEmailSeparator = string;
73
+
74
+ export type WorkerPipelineEmailHeaderSeparatorIndex = number;
75
+
76
+ export type WorkerPipelineEmailHeaderLines = string[];
77
+
78
+ export type WorkerPipelineEmailHeaders = Map<string, string>;
79
+
80
+ export type WorkerPipelineEmailHeaderKey = string;
81
+
82
+ export type WorkerPipelineEmailContentType = string;
83
+
84
+ export type WorkerPipelineEmailTextBody = string;
85
+
86
+ export type WorkerPipelineEmailParseEmailNestedPartHeaders = string;
87
+
88
+ export type WorkerPipelineEmailParseEmailNestedResultText = string;
89
+
90
+ export type WorkerPipelineEmailParseEmailNestedResultHtml = string;
91
+
92
+ export type WorkerPipelineEmailParseEmailNestedResult = {
93
+ text: WorkerPipelineEmailParseEmailNestedResultText;
94
+ html: WorkerPipelineEmailParseEmailNestedResultHtml;
95
+ };
96
+
97
+ export type WorkerPipelineEmailParseEmailEmbeddedBoundaryArg = string;
98
+
99
+ export type WorkerPipelineEmailParseEmailEmbeddedResultText = string;
100
+
101
+ export type WorkerPipelineEmailParseEmailEmbeddedResultHtml = string;
102
+
103
+ export type WorkerPipelineEmailParseEmailEmbeddedResult = {
104
+ text: WorkerPipelineEmailParseEmailEmbeddedResultText;
105
+ html: WorkerPipelineEmailParseEmailEmbeddedResultHtml;
106
+ };
107
+
108
+ export type WorkerPipelineEmailParseEmailEmbeddedHtmlStripped = string;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Worker - Pipeline - Format.
3
+ *
4
+ * @since 2.0.0
5
+ */
6
+ export type WorkerPipelineFormatOptionsShowVisitorInfo = boolean;
7
+
8
+ export type WorkerPipelineFormatOptionsVisitorIp = string;
9
+
10
+ export type WorkerPipelineFormatOptionsCfProperties = Record<string, unknown>;
11
+
12
+ export type WorkerPipelineFormatOptions = {
13
+ showVisitorInfo: WorkerPipelineFormatOptionsShowVisitorInfo;
14
+ visitorIp?: WorkerPipelineFormatOptionsVisitorIp;
15
+ cfProperties?: WorkerPipelineFormatOptionsCfProperties;
16
+ };
17
+
18
+ export type WorkerPipelineFormatResultBody = string;
19
+
20
+ export type WorkerPipelineFormatResultHeaders = Record<string, string>;
21
+
22
+ export type WorkerPipelineFormatResult = {
23
+ body: WorkerPipelineFormatResultBody;
24
+ headers: WorkerPipelineFormatResultHeaders;
25
+ };
26
+
27
+ export type WorkerPipelineFormatBody = string;
28
+
29
+ export type WorkerPipelineFormatCf = WorkerPipelineFormatOptionsCfProperties;
30
+
31
+ export type WorkerPipelineFormatIp = string;
32
+
33
+ export type WorkerPipelineFormatSeparator = string;
34
+
35
+ export type WorkerPipelineFormatIsMarkdown = boolean;
36
+
37
+ export type WorkerPipelineFormatBoldFn = (text: string) => string;
38
+
39
+ export type WorkerPipelineFormatLines = string[];
40
+
41
+ export type WorkerPipelineFormatHeaders = Record<string, string>;
42
+
43
+ export type WorkerPipelineFormatPriorityString = string;
44
+
45
+ export type WorkerPipelineFormatTagsString = string;
46
+
47
+ export type WorkerPipelineFormatMarkdownString = string;
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Worker - Pipeline - Interpret.
3
+ *
4
+ * @since 2.0.0
5
+ */
6
+ export type WorkerPipelineInterpretNotificationObjectTitle = string;
7
+
8
+ export type WorkerPipelineInterpretNotificationObjectBody = string;
9
+
10
+ export type WorkerPipelineInterpretNotificationObjectPriority = 1 | 2 | 3 | 4 | 5;
11
+
12
+ export type WorkerPipelineInterpretNotificationObjectTags = string[];
13
+
14
+ export type WorkerPipelineInterpretNotificationObjectIcon = string;
15
+
16
+ export type WorkerPipelineInterpretNotificationObjectActions = string;
17
+
18
+ export type WorkerPipelineInterpretNotificationObjectAttach = string;
19
+
20
+ export type WorkerPipelineInterpretNotificationObjectFilename = string;
21
+
22
+ export type WorkerPipelineInterpretNotificationObjectMarkdown = boolean;
23
+
24
+ export type WorkerPipelineInterpretNotificationObject = {
25
+ title?: WorkerPipelineInterpretNotificationObjectTitle | undefined;
26
+ body: WorkerPipelineInterpretNotificationObjectBody;
27
+ priority?: WorkerPipelineInterpretNotificationObjectPriority | undefined;
28
+ tags?: WorkerPipelineInterpretNotificationObjectTags | undefined;
29
+ icon?: WorkerPipelineInterpretNotificationObjectIcon | undefined;
30
+ actions?: WorkerPipelineInterpretNotificationObjectActions | undefined;
31
+ attach?: WorkerPipelineInterpretNotificationObjectAttach | undefined;
32
+ filename?: WorkerPipelineInterpretNotificationObjectFilename | undefined;
33
+ markdown?: WorkerPipelineInterpretNotificationObjectMarkdown | undefined;
34
+ };
35
+
36
+ export type WorkerPipelineInterpretResultNotification = WorkerPipelineInterpretNotificationObject;
37
+
38
+ export type WorkerPipelineInterpretResultAttachment = ArrayBuffer;
39
+
40
+ export type WorkerPipelineInterpretResult = {
41
+ notification: WorkerPipelineInterpretResultNotification;
42
+ attachment?: WorkerPipelineInterpretResultAttachment;
43
+ };
44
+
45
+ export type WorkerPipelineInterpretInterpreter = (input: WorkerPipelineInterpretInput, context?: WorkerPipelineInterpretContext) => WorkerPipelineInterpretResult | null | Promise<WorkerPipelineInterpretResult | null>;
46
+
47
+ export type WorkerPipelineInterpretInterpreterMap = Record<string, WorkerPipelineInterpretInterpreter>;
48
+
49
+ export type WorkerPipelineInterpretInput = string | object | ArrayBuffer;
50
+
51
+ export type WorkerPipelineInterpretContextKv = KVNamespace;
52
+
53
+ export type WorkerPipelineInterpretContext = {
54
+ kv?: WorkerPipelineInterpretContextKv;
55
+ };
56
+
57
+ export type WorkerPipelineInterpretInterpreterName = string;
58
+
59
+ export type WorkerPipelineInterpretReturns = Promise<WorkerPipelineInterpretResult | null>;
60
+
61
+ export type WorkerPipelineInterpretSelectedInterpreter = WorkerPipelineInterpretInterpreter | undefined;
62
+
63
+ export type WorkerPipelineInterpretInterpreterResult = WorkerPipelineInterpretResult | null;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Worker - Pipeline - Parse.
3
+ *
4
+ * @since 2.0.0
5
+ */
6
+ export type WorkerPipelineParseResultType = 'text' | 'json' | 'binary' | 'unknown';
7
+
8
+ export type WorkerPipelineParseResultText = string;
9
+
10
+ export type WorkerPipelineParseResultJson = Record<string, unknown>;
11
+
12
+ export type WorkerPipelineParseResultBinary = ArrayBuffer;
13
+
14
+ export type WorkerPipelineParseResult = {
15
+ type: WorkerPipelineParseResultType;
16
+ text?: WorkerPipelineParseResultText;
17
+ json?: WorkerPipelineParseResultJson;
18
+ binary?: WorkerPipelineParseResultBinary;
19
+ };
20
+
21
+ export type WorkerPipelineParseContentType = string;
22
+
23
+ export type WorkerPipelineParseContentTypePart = string | undefined;
24
+
25
+ export type WorkerPipelineParseBaseContentType = string;
26
+
27
+ export type WorkerPipelineParseIsBinaryContentType = boolean;
28
+
29
+ export type WorkerPipelineParseBytes = Uint8Array;
30
+
31
+ export type WorkerPipelineParseText = string | undefined;
32
+
33
+ export type WorkerPipelineParseDecoder = TextDecoder;
34
+
35
+ export type WorkerPipelineParseIsJsonContentType = boolean;
36
+
37
+ export type WorkerPipelineParseLooksLikeJson = boolean;
38
+
39
+ export type WorkerPipelineParseJson = Record<string, unknown>;
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Worker - Pipeline - Receive.
3
+ *
4
+ * @since 2.0.0
5
+ */
6
+ export type WorkerPipelineReceiveResultMethod = string;
7
+
8
+ export type WorkerPipelineReceiveResultHostname = string;
9
+
10
+ export type WorkerPipelineReceiveResultUrl = string;
11
+
12
+ export type WorkerPipelineReceiveResultHeaders = Headers;
13
+
14
+ export type WorkerPipelineReceiveResultRawBody = ArrayBuffer;
15
+
16
+ export type WorkerPipelineReceiveResultIsGet = boolean;
17
+
18
+ export type WorkerPipelineReceiveResultRedirect = string;
19
+
20
+ export type WorkerPipelineReceiveResultError = string;
21
+
22
+ export type WorkerPipelineReceiveResultCfProperties = IncomingRequestCfProperties;
23
+
24
+ export type WorkerPipelineReceiveResult = {
25
+ method: WorkerPipelineReceiveResultMethod;
26
+ hostname: WorkerPipelineReceiveResultHostname;
27
+ url: WorkerPipelineReceiveResultUrl;
28
+ headers: WorkerPipelineReceiveResultHeaders;
29
+ rawBody: WorkerPipelineReceiveResultRawBody;
30
+ isGet: WorkerPipelineReceiveResultIsGet;
31
+ redirect?: WorkerPipelineReceiveResultRedirect;
32
+ error?: WorkerPipelineReceiveResultError;
33
+ cfProperties?: WorkerPipelineReceiveResultCfProperties;
34
+ };
35
+
36
+ export type WorkerPipelineReceiveRequest = Request;
37
+
38
+ export type WorkerPipelineReceiveBaseDomain = string;
39
+
40
+ export type WorkerPipelineReceiveReturns = Promise<WorkerPipelineReceiveResult>;
41
+
42
+ export type WorkerPipelineReceiveMethod = string;
43
+
44
+ export type WorkerPipelineReceiveHostname = string;
45
+
46
+ export type WorkerPipelineReceiveProtocol = string;
47
+
48
+ export type WorkerPipelineReceiveUrl = string;
49
+
50
+ export type WorkerPipelineReceiveHeaders = Headers;
51
+
52
+ export type WorkerPipelineReceiveIncludesBaseDomain = boolean;
53
+
54
+ export type WorkerPipelineReceiveRedirect = string;
55
+
56
+ export type WorkerPipelineReceiveRawBody = ArrayBuffer;
57
+
58
+ export type WorkerPipelineReceiveIsGet = boolean;
59
+
60
+ export type WorkerPipelineReceiveCfRequestUnknown = unknown;
61
+
62
+ export type WorkerPipelineReceiveCfRequestRecord = Record<string, unknown>;
63
+
64
+ export type WorkerPipelineReceiveCfProperties = IncomingRequestCfProperties | undefined;
@@ -0,0 +1,113 @@
1
+ import type {
2
+ WorkerPipelineSendResult,
3
+ WorkerPipelineSendResultFallbackNote,
4
+ WorkerPipelineSendResultResults,
5
+ } from './send.d.ts';
6
+
7
+ /**
8
+ * Worker - Pipeline - Respond.
9
+ *
10
+ * @since 2.0.0
11
+ */
12
+ export type WorkerPipelineRespondOptionsShowResponseOutput = boolean;
13
+
14
+ export type WorkerPipelineRespondOptionsContextName = string | undefined;
15
+
16
+ export type WorkerPipelineRespondOptionsInterpreterName = string | undefined;
17
+
18
+ export type WorkerPipelineRespondOptionsMessageTitle = string | undefined;
19
+
20
+ export type WorkerPipelineRespondOptionsBodySize = number | undefined;
21
+
22
+ export type WorkerPipelineRespondOptionsParts = number | undefined;
23
+
24
+ export type WorkerPipelineRespondOptionsHasAttachment = boolean | undefined;
25
+
26
+ export type WorkerPipelineRespondOptions = {
27
+ showResponseOutput: WorkerPipelineRespondOptionsShowResponseOutput;
28
+ contextName?: WorkerPipelineRespondOptionsContextName;
29
+ interpreterName?: WorkerPipelineRespondOptionsInterpreterName;
30
+ messageTitle?: WorkerPipelineRespondOptionsMessageTitle;
31
+ bodySize?: WorkerPipelineRespondOptionsBodySize;
32
+ parts?: WorkerPipelineRespondOptionsParts;
33
+ hasAttachment?: WorkerPipelineRespondOptionsHasAttachment;
34
+ };
35
+
36
+ export type WorkerPipelineRespondSendResult = WorkerPipelineSendResult;
37
+
38
+ export type WorkerPipelineRespondReturn = Response;
39
+
40
+ export type WorkerPipelineRespondResults = WorkerPipelineSendResultResults;
41
+
42
+ export type WorkerPipelineRespondFallbackNote = WorkerPipelineSendResultFallbackNote;
43
+
44
+ export type WorkerPipelineRespondShowResponseOutput = WorkerPipelineRespondOptionsShowResponseOutput;
45
+
46
+ export type WorkerPipelineRespondContextName = WorkerPipelineRespondOptionsContextName;
47
+
48
+ export type WorkerPipelineRespondInterpreterName = WorkerPipelineRespondOptionsInterpreterName;
49
+
50
+ export type WorkerPipelineRespondMessageTitle = WorkerPipelineRespondOptionsMessageTitle;
51
+
52
+ export type WorkerPipelineRespondBodySize = WorkerPipelineRespondOptionsBodySize;
53
+
54
+ export type WorkerPipelineRespondParts = WorkerPipelineRespondOptionsParts;
55
+
56
+ export type WorkerPipelineRespondHasAttachment = WorkerPipelineRespondOptionsHasAttachment;
57
+
58
+ export type WorkerPipelineRespondAnySuccess = boolean;
59
+
60
+ export type WorkerPipelineRespondAllSuccess = boolean;
61
+
62
+ export type WorkerPipelineRespondStatus = 'success' | 'partial' | 'failed';
63
+
64
+ export type WorkerPipelineRespondHttpStatus = number;
65
+
66
+ export type WorkerPipelineRespondBodyStatus = WorkerPipelineRespondStatus;
67
+
68
+ export type WorkerPipelineRespondBodyFallbackNote = string | undefined;
69
+
70
+ export type WorkerPipelineRespondBodyContext = string | undefined;
71
+
72
+ export type WorkerPipelineRespondBodyInterpreter = string | undefined;
73
+
74
+ export type WorkerPipelineRespondBody = {
75
+ status: WorkerPipelineRespondBodyStatus;
76
+ fallback_note?: WorkerPipelineRespondBodyFallbackNote;
77
+ context?: WorkerPipelineRespondBodyContext;
78
+ interpreter?: WorkerPipelineRespondBodyInterpreter;
79
+ servers?: WorkerPipelineRespondBodyServers;
80
+ message?: WorkerPipelineRespondBodyMessage;
81
+ };
82
+
83
+ export type WorkerPipelineRespondBodyServersItemName = string;
84
+
85
+ export type WorkerPipelineRespondBodyServersItemStatus = number;
86
+
87
+ export type WorkerPipelineRespondBodyServersItemSuccess = boolean;
88
+
89
+ export type WorkerPipelineRespondBodyServersItemStages = string[];
90
+
91
+ export type WorkerPipelineRespondBodyServersItem = {
92
+ name: WorkerPipelineRespondBodyServersItemName;
93
+ status: WorkerPipelineRespondBodyServersItemStatus;
94
+ success: WorkerPipelineRespondBodyServersItemSuccess;
95
+ stages: WorkerPipelineRespondBodyServersItemStages;
96
+ };
97
+
98
+ export type WorkerPipelineRespondBodyServers = WorkerPipelineRespondBodyServersItem[] | undefined;
99
+
100
+ export type WorkerPipelineRespondBodyMessageTitle = string | undefined;
101
+
102
+ export type WorkerPipelineRespondBodyMessageBodySize = number | undefined;
103
+
104
+ export type WorkerPipelineRespondBodyMessageParts = number | undefined;
105
+
106
+ export type WorkerPipelineRespondBodyMessageHasAttachment = boolean | undefined;
107
+
108
+ export type WorkerPipelineRespondBodyMessage = {
109
+ title: WorkerPipelineRespondBodyMessageTitle;
110
+ body_size: WorkerPipelineRespondBodyMessageBodySize;
111
+ parts: WorkerPipelineRespondBodyMessageParts;
112
+ has_attachment: WorkerPipelineRespondBodyMessageHasAttachment;
113
+ };
@@ -0,0 +1,34 @@
1
+ import type {
2
+ LibSchemaContextConfig,
3
+ LibSchemaServerConfig,
4
+ } from '../../lib/schema.d.ts';
5
+
6
+ /**
7
+ * Worker - Pipeline - Route.
8
+ *
9
+ * @since 2.0.0
10
+ */
11
+ export type WorkerPipelineRouteType = 'http' | 'email';
12
+
13
+ export type WorkerPipelineRouteIdentifier = string;
14
+
15
+ export type WorkerPipelineRouteResultContext = LibSchemaContextConfig | undefined;
16
+
17
+ export type WorkerPipelineRouteResultResolvedServers = LibSchemaServerConfig[] | undefined;
18
+
19
+ export type WorkerPipelineRouteResultPrimaryServer = LibSchemaServerConfig | undefined;
20
+
21
+ export type WorkerPipelineRouteResultError = string | undefined;
22
+
23
+ export type WorkerPipelineRouteResult = {
24
+ context: WorkerPipelineRouteResultContext;
25
+ resolvedServers: WorkerPipelineRouteResultResolvedServers;
26
+ primaryServer: WorkerPipelineRouteResultPrimaryServer;
27
+ error: WorkerPipelineRouteResultError;
28
+ };
29
+
30
+ export type WorkerPipelineRouteContext = LibSchemaContextConfig | undefined;
31
+
32
+ export type WorkerPipelineRouteResolvedServers = LibSchemaServerConfig[];
33
+
34
+ export type WorkerPipelineRoutePrimaryServer = LibSchemaServerConfig | undefined;