@drfed/drfed 0.0.0-stage → 0.1.0-dev.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 (165) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +1198 -2
  3. package/bin/drfed-account.mjs +20 -0
  4. package/bin/drfed-migrate.mjs +20 -0
  5. package/bin/drfed-server.mjs +20 -0
  6. package/bin/drfed-web.mjs +20 -0
  7. package/completions/bash/drfed-account +219 -0
  8. package/completions/bash/drfed-migrate +219 -0
  9. package/completions/bash/drfed-server +219 -0
  10. package/completions/bash/drfed-web +219 -0
  11. package/completions/fish/drfed-account.fish +264 -0
  12. package/completions/fish/drfed-migrate.fish +264 -0
  13. package/completions/fish/drfed-server.fish +264 -0
  14. package/completions/fish/drfed-web.fish +264 -0
  15. package/completions/nu/drfed-account.nu +293 -0
  16. package/completions/nu/drfed-migrate.nu +293 -0
  17. package/completions/nu/drfed-server.nu +293 -0
  18. package/completions/nu/drfed-web.nu +293 -0
  19. package/completions/pwsh/drfed-account.ps1 +183 -0
  20. package/completions/pwsh/drfed-migrate.ps1 +183 -0
  21. package/completions/pwsh/drfed-server.ps1 +183 -0
  22. package/completions/pwsh/drfed-web.ps1 +183 -0
  23. package/completions/zsh/_drfed-account +145 -0
  24. package/completions/zsh/_drfed-migrate +145 -0
  25. package/completions/zsh/_drfed-server +145 -0
  26. package/completions/zsh/_drfed-web +145 -0
  27. package/dist/api-mail-parser.d.mts +106 -0
  28. package/dist/api-mail-parser.d.mts.map +1 -0
  29. package/dist/api-mail-parser.mjs +145 -0
  30. package/dist/api-mail-parser.mjs.map +1 -0
  31. package/dist/api-mail-settings-BcGaqQ9f.d.mts +142 -0
  32. package/dist/api-mail-settings-BcGaqQ9f.d.mts.map +1 -0
  33. package/dist/api-mail-settings.d.mts +2 -0
  34. package/dist/api-mail-settings.mjs +272 -0
  35. package/dist/api-mail-settings.mjs.map +1 -0
  36. package/dist/bounded-mail-runtime.d.mts +9 -0
  37. package/dist/bounded-mail-runtime.d.mts.map +1 -0
  38. package/dist/bounded-mail-runtime.mjs +66 -0
  39. package/dist/bounded-mail-runtime.mjs.map +1 -0
  40. package/dist/commands/account-create.d.mts +37 -0
  41. package/dist/commands/account-create.d.mts.map +1 -0
  42. package/dist/commands/account-create.mjs +87 -0
  43. package/dist/commands/account-create.mjs.map +1 -0
  44. package/dist/commands/account-program.d.mts +223 -0
  45. package/dist/commands/account-program.d.mts.map +1 -0
  46. package/dist/commands/account-program.mjs +116 -0
  47. package/dist/commands/account-program.mjs.map +1 -0
  48. package/dist/commands/account.d.mts +6 -0
  49. package/dist/commands/account.d.mts.map +1 -0
  50. package/dist/commands/account.mjs +91 -0
  51. package/dist/commands/account.mjs.map +1 -0
  52. package/dist/commands/migrate-program.d.mts +219 -0
  53. package/dist/commands/migrate-program.d.mts.map +1 -0
  54. package/dist/commands/migrate-program.mjs +116 -0
  55. package/dist/commands/migrate-program.mjs.map +1 -0
  56. package/dist/commands/migrate.d.mts +6 -0
  57. package/dist/commands/migrate.d.mts.map +1 -0
  58. package/dist/commands/migrate.mjs +85 -0
  59. package/dist/commands/migrate.mjs.map +1 -0
  60. package/dist/commands/web-program.d.mts +213 -0
  61. package/dist/commands/web-program.d.mts.map +1 -0
  62. package/dist/commands/web-program.mjs +112 -0
  63. package/dist/commands/web-program.mjs.map +1 -0
  64. package/dist/commands/web.d.mts +6 -0
  65. package/dist/commands/web.d.mts.map +1 -0
  66. package/dist/commands/web.mjs +184 -0
  67. package/dist/commands/web.mjs.map +1 -0
  68. package/dist/configuration-DVVF7xNv.d.mts +432 -0
  69. package/dist/configuration-DVVF7xNv.d.mts.map +1 -0
  70. package/dist/configuration.d.mts +2 -0
  71. package/dist/configuration.mjs +469 -0
  72. package/dist/configuration.mjs.map +1 -0
  73. package/dist/data-path.d.mts +9 -0
  74. package/dist/data-path.d.mts.map +1 -0
  75. package/dist/data-path.mjs +21 -0
  76. package/dist/data-path.mjs.map +1 -0
  77. package/dist/database-runtime.d.mts +26 -0
  78. package/dist/database-runtime.d.mts.map +1 -0
  79. package/dist/database-runtime.mjs +92 -0
  80. package/dist/database-runtime.mjs.map +1 -0
  81. package/dist/database-settings.d.mts +36 -0
  82. package/dist/database-settings.d.mts.map +1 -0
  83. package/dist/database-settings.mjs +67 -0
  84. package/dist/database-settings.mjs.map +1 -0
  85. package/dist/diagnostics.d.mts +29 -0
  86. package/dist/diagnostics.d.mts.map +1 -0
  87. package/dist/diagnostics.mjs +61 -0
  88. package/dist/diagnostics.mjs.map +1 -0
  89. package/dist/index.d.mts +5 -0
  90. package/dist/index.d.mts.map +1 -0
  91. package/dist/index.mjs +344 -0
  92. package/dist/index.mjs.map +1 -0
  93. package/dist/jmap-parser.d.mts +35 -0
  94. package/dist/jmap-parser.d.mts.map +1 -0
  95. package/dist/jmap-parser.mjs +42 -0
  96. package/dist/jmap-parser.mjs.map +1 -0
  97. package/dist/jmap-runtime.d.mts +10 -0
  98. package/dist/jmap-runtime.d.mts.map +1 -0
  99. package/dist/jmap-runtime.mjs +17 -0
  100. package/dist/jmap-runtime.mjs.map +1 -0
  101. package/dist/jmap-settings-BXNAF1ep.d.mts +41 -0
  102. package/dist/jmap-settings-BXNAF1ep.d.mts.map +1 -0
  103. package/dist/jmap-settings.d.mts +2 -0
  104. package/dist/jmap-settings.mjs +104 -0
  105. package/dist/jmap-settings.mjs.map +1 -0
  106. package/dist/logging.d.mts +33 -0
  107. package/dist/logging.d.mts.map +1 -0
  108. package/dist/logging.mjs +56 -0
  109. package/dist/logging.mjs.map +1 -0
  110. package/dist/mail-parser-DyI4wuQp.d.mts +246 -0
  111. package/dist/mail-parser-DyI4wuQp.d.mts.map +1 -0
  112. package/dist/mail-parser.d.mts +2 -0
  113. package/dist/mail-parser.mjs +100 -0
  114. package/dist/mail-parser.mjs.map +1 -0
  115. package/dist/mail-runtime-YROIQ8up.mjs +314 -0
  116. package/dist/mail-runtime-YROIQ8up.mjs.map +1 -0
  117. package/dist/mail-runtime.d.mts +68 -0
  118. package/dist/mail-runtime.d.mts.map +1 -0
  119. package/dist/mail-runtime.mjs +2 -0
  120. package/dist/mail-settings-BD1TQ0rt.mjs +427 -0
  121. package/dist/mail-settings-BD1TQ0rt.mjs.map +1 -0
  122. package/dist/mail-settings-DjWMAUaE.d.mts +80 -0
  123. package/dist/mail-settings-DjWMAUaE.d.mts.map +1 -0
  124. package/dist/mail-settings.d.mts +2 -0
  125. package/dist/mail-settings.mjs +2 -0
  126. package/dist/operations.d.mts +32 -0
  127. package/dist/operations.d.mts.map +1 -0
  128. package/dist/operations.mjs +55 -0
  129. package/dist/operations.mjs.map +1 -0
  130. package/dist/package-7FOUqcPO.mjs +6 -0
  131. package/dist/package-7FOUqcPO.mjs.map +1 -0
  132. package/dist/parser-DGIQTgS7.mjs +178 -0
  133. package/dist/parser-DGIQTgS7.mjs.map +1 -0
  134. package/dist/parser-TANGHRjL.d.mts +305 -0
  135. package/dist/parser-TANGHRjL.d.mts.map +1 -0
  136. package/dist/postgres-settings.d.mts +20 -0
  137. package/dist/postgres-settings.d.mts.map +1 -0
  138. package/dist/postgres-settings.mjs +60 -0
  139. package/dist/postgres-settings.mjs.map +1 -0
  140. package/dist/query-logger.d.mts +9 -0
  141. package/dist/query-logger.d.mts.map +1 -0
  142. package/dist/query-logger.mjs +17 -0
  143. package/dist/query-logger.mjs.map +1 -0
  144. package/dist/resources.d.mts +20 -0
  145. package/dist/resources.d.mts.map +1 -0
  146. package/dist/resources.mjs +34 -0
  147. package/dist/resources.mjs.map +1 -0
  148. package/dist/secret-source-BeZx72Ue.d.mts +21 -0
  149. package/dist/secret-source-BeZx72Ue.d.mts.map +1 -0
  150. package/dist/secret-source.d.mts +2 -0
  151. package/dist/secret-source.mjs +58 -0
  152. package/dist/secret-source.mjs.map +1 -0
  153. package/dist/serving.d.mts +82 -0
  154. package/dist/serving.d.mts.map +1 -0
  155. package/dist/serving.mjs +138 -0
  156. package/dist/serving.mjs.map +1 -0
  157. package/dist/smtp-settings.d.mts +11 -0
  158. package/dist/smtp-settings.d.mts.map +1 -0
  159. package/dist/smtp-settings.mjs +38 -0
  160. package/dist/smtp-settings.mjs.map +1 -0
  161. package/dist/valueparser.d.mts +46 -0
  162. package/dist/valueparser.d.mts.map +1 -0
  163. package/dist/valueparser.mjs +121 -0
  164. package/dist/valueparser.mjs.map +1 -0
  165. package/package.json +275 -3
@@ -0,0 +1,145 @@
1
+ #compdef drfed-web
2
+ function _drfed_web () {
3
+ local current="$words[CURRENT]"
4
+ local -a prev
5
+ # Extract previous arguments, skipping empty ones
6
+ prev=()
7
+ local i
8
+ for (( i=2; i < CURRENT; i++ )); do
9
+ if [[ -n "$words[i]" ]]; then
10
+ prev+=("$words[i]")
11
+ fi
12
+ done
13
+
14
+ # Call the completion function and capture output
15
+ local output
16
+ if (( ${#prev[@]} == 0 )); then
17
+ output=$(drfed-web 'completion' 'zsh' "$current" 2>/dev/null)
18
+ else
19
+ output=$(drfed-web 'completion' 'zsh' "${prev[@]}" "$current" 2>/dev/null)
20
+ fi
21
+
22
+ # Split output into lines and process each line
23
+ local -a completions descriptions
24
+ local line value desc
25
+ local has_file_completion=0
26
+
27
+ while IFS= read -r line; do
28
+ if [[ -n "$line" ]]; then
29
+ # Split by null character - first part is value, second is description
30
+ value=${line%%$'\0'*}
31
+ desc=${line#*$'\0'}
32
+ desc=${desc%%$'\0'*}
33
+
34
+ if [[ "$value" == __FILE__:* ]]; then
35
+ # Parse file completion directive: __FILE__:type:extensions:pattern:hidden
36
+ local type extensions pattern hidden
37
+ IFS=':' read -r _ type extensions pattern hidden <<< "$value"
38
+ pattern="${pattern//%3A/:}"; pattern="${pattern//%25/%}"
39
+ has_file_completion=1
40
+
41
+ # Native completion helpers expect normal zsh glob grouping even if
42
+ # the caller enabled SH_GLOB in their shell options.
43
+ local __was_sh_glob=0
44
+ [[ -o sh_glob ]] && __was_sh_glob=1
45
+ unsetopt sh_glob
46
+
47
+ # Enable glob_dots when hidden files are requested so that
48
+ # _files and _directories include dot-prefixed entries
49
+ local __was_glob_dots=0
50
+ [[ -o glob_dots ]] && __was_glob_dots=1
51
+ if [[ "$hidden" == "1" ]]; then setopt glob_dots; fi
52
+
53
+ # When a pattern is specified, override PREFIX so that _files and
54
+ # _directories enumerate the pattern's directory instead of the
55
+ # current word. If the user has already typed beyond the pattern,
56
+ # keep PREFIX unchanged for incremental narrowing.
57
+ local __saved_prefix="$PREFIX"
58
+ if [[ -n "$pattern" ]]; then
59
+ # Normalize leading ./ so that ./src/ma matches pattern src/
60
+ local __norm_prefix="${PREFIX#./}"
61
+ local __norm_pattern="${pattern#./}"
62
+ local __compare_pattern="$__norm_pattern"
63
+ if [[ "$__compare_pattern" == *[*?]* ]]; then
64
+ __compare_pattern="${__compare_pattern%%[*?]*}"
65
+ [[ "$__compare_pattern" == */* ]] && __compare_pattern="${__compare_pattern%/*}/" || __compare_pattern=""
66
+ fi
67
+ if [[ ( -n "$__compare_pattern" || -n "$__norm_prefix" ) && ${#__norm_prefix} -ge ${#__compare_pattern} && "${__norm_prefix[1,${#__compare_pattern}]}" == "$__compare_pattern" && "$PREFIX" != "$pattern" ]]; then
68
+ # User typed an equivalent or extended form—keep PREFIX
69
+ true
70
+ else
71
+ PREFIX="$pattern"
72
+ fi
73
+ fi
74
+
75
+ local ext_pattern=""
76
+ if [[ -n "$extensions" ]]; then
77
+ if [[ "$extensions" == *,* ]]; then
78
+ ext_pattern="*.(${extensions//,/|})"
79
+ else
80
+ ext_pattern="*.$extensions"
81
+ fi
82
+ fi
83
+ # Use zsh's native file completion
84
+ case "$type" in
85
+ file)
86
+ if [[ -n "$ext_pattern" ]]; then
87
+ # Route filtered files through zsh's standard files/directories
88
+ # tags so files-tag styles and tag-order still apply, while
89
+ # avoiding _files' all-files fallback for extension-filtered
90
+ # matches.
91
+ local file_pattern="${ext_pattern}(#q-.)"
92
+ _wanted files expl file _path_files -g "${file_pattern}"
93
+ _wanted directories expl directory _path_files -/
94
+ else
95
+ _files
96
+ fi
97
+ ;;
98
+ directory)
99
+ _directories
100
+ ;;
101
+ any)
102
+ if [[ -n "$ext_pattern" ]]; then
103
+ local file_pattern="${ext_pattern}(#q^-/)"
104
+ _wanted files expl file _path_files -g "${file_pattern}"
105
+ _wanted directories expl directory _path_files -/
106
+ else
107
+ _files
108
+ fi
109
+ ;;
110
+ esac
111
+
112
+ # Restore PREFIX and glob_dots to their previous state
113
+ PREFIX="$__saved_prefix"
114
+ if [[ "$__was_sh_glob" == "1" ]]; then setopt sh_glob; else unsetopt sh_glob; fi
115
+ if [[ "$__was_glob_dots" == "1" ]]; then setopt glob_dots; else unsetopt glob_dots; fi
116
+ else
117
+ # Regular literal completion
118
+ if [[ -n "$value" ]]; then
119
+ completions+=("$value")
120
+ descriptions+=("$desc")
121
+ fi
122
+ fi
123
+ fi
124
+ done <<< "$output"
125
+
126
+ # Add literal completions with descriptions if we have any
127
+ if (( ${#completions[@]} > 0 )); then
128
+ # Prepare completion with descriptions for _describe
129
+ local -a matches
130
+ local -i i
131
+ for (( i=1; i <= ${#completions[@]}; i++ )); do
132
+ if [[ -n "${descriptions[i]}" ]]; then
133
+ matches+=("${completions[i]}:${descriptions[i]}")
134
+ else
135
+ matches+=("${completions[i]}")
136
+ fi
137
+ done
138
+ _describe 'commands' matches
139
+ fi
140
+ }
141
+
142
+ if (( $+functions[compdef] )); then
143
+ compdef _drfed_web drfed-web
144
+ fi
145
+
@@ -0,0 +1,106 @@
1
+ import { m as createConfigurationBindings, s as Sourced } from "./configuration-DVVF7xNv.mjs";
2
+ //#region src/api-mail-parser.d.ts
3
+ /** API service options included in pure metadata argument arity. */
4
+ declare const apiMailValueOptionNames: {
5
+ readonly mailApiKey: readonly ["--mail-api-key"];
6
+ readonly mailApiKeyFile: readonly ["--mail-api-key-file"];
7
+ readonly plunkApiKey: readonly ["--plunk-api-key"];
8
+ readonly plunkApiKeyFile: readonly ["--plunk-api-key-file"];
9
+ readonly plunkBaseUrl: readonly ["--plunk-base-url"];
10
+ readonly plunkTimeout: readonly ["--plunk-timeout"];
11
+ readonly resendApiKey: readonly ["--resend-api-key"];
12
+ readonly resendApiKeyFile: readonly ["--resend-api-key-file"];
13
+ readonly resendBaseUrl: readonly ["--resend-base-url"];
14
+ readonly resendTimeout: readonly ["--resend-timeout"];
15
+ readonly resendRetries: readonly ["--resend-retries"];
16
+ readonly sesAuth: readonly ["--ses-auth"];
17
+ readonly sesAccessKeyId: readonly ["--ses-access-key-id"];
18
+ readonly sesAccessKeyIdFile: readonly ["--ses-access-key-id-file"];
19
+ readonly sesSecretAccessKey: readonly ["--ses-secret-access-key"];
20
+ readonly sesSecretAccessKeyFile: readonly ["--ses-secret-access-key-file"];
21
+ readonly sesSessionToken: readonly ["--ses-session-token"];
22
+ readonly sesSessionTokenFile: readonly ["--ses-session-token-file"];
23
+ readonly sesRegion: readonly ["--ses-region"];
24
+ readonly sesTimeout: readonly ["--ses-timeout"];
25
+ readonly sendgridApiKey: readonly ["--sendgrid-api-key"];
26
+ readonly sendgridApiKeyFile: readonly ["--sendgrid-api-key-file"];
27
+ readonly sendgridBaseUrl: readonly ["--sendgrid-base-url"];
28
+ readonly sendgridTimeout: readonly ["--sendgrid-timeout"];
29
+ readonly mailgunApiKey: readonly ["--mailgun-api-key"];
30
+ readonly mailgunApiKeyFile: readonly ["--mailgun-api-key-file"];
31
+ readonly mailgunDomain: readonly ["--mailgun-domain"];
32
+ readonly mailgunRegion: readonly ["--mailgun-region"];
33
+ readonly mailgunBaseUrl: readonly ["--mailgun-base-url"];
34
+ readonly mailgunTimeout: readonly ["--mailgun-timeout"];
35
+ readonly mailtrapApiToken: readonly ["--mailtrap-api-token"];
36
+ readonly mailtrapApiTokenFile: readonly ["--mailtrap-api-token-file"];
37
+ readonly mailtrapInboxId: readonly ["--mailtrap-inbox-id"];
38
+ readonly mailtrapSendBaseUrl: readonly ["--mailtrap-send-base-url"];
39
+ readonly mailtrapSandboxBaseUrl: readonly ["--mailtrap-sandbox-base-url"];
40
+ readonly mailtrapTimeout: readonly ["--mailtrap-timeout"];
41
+ readonly mailerooApiKey: readonly ["--maileroo-api-key"];
42
+ readonly mailerooApiKeyFile: readonly ["--maileroo-api-key-file"];
43
+ readonly mailerooBaseUrl: readonly ["--maileroo-base-url"];
44
+ readonly mailerooTimeout: readonly ["--maileroo-timeout"];
45
+ readonly lettermintApiToken: readonly ["--lettermint-api-token"];
46
+ readonly lettermintApiTokenFile: readonly ["--lettermint-api-token-file"];
47
+ readonly lettermintBaseUrl: readonly ["--lettermint-base-url"];
48
+ readonly lettermintRoute: readonly ["--lettermint-route"];
49
+ readonly lettermintTimeout: readonly ["--lettermint-timeout"];
50
+ readonly lettermintRetries: readonly ["--lettermint-retries"];
51
+ };
52
+ /** Source-tagged API fields; only the selected service is validated.
53
+ * @returns Fields for composition into the common mail parser.
54
+ */
55
+ declare function createApiMailFields(bindings: ReturnType<typeof createConfigurationBindings>): {
56
+ mailApiKey: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
57
+ mailApiKeyFile: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
58
+ plunkApiKey: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
59
+ plunkApiKeyFile: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
60
+ plunkBaseUrl: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
61
+ plunkTimeout: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<number> | undefined>;
62
+ resendApiKey: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
63
+ resendApiKeyFile: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
64
+ resendBaseUrl: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
65
+ resendTimeout: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<number> | undefined>;
66
+ resendRetries: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<number> | undefined>;
67
+ sesAuth: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
68
+ sesAccessKeyId: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
69
+ sesAccessKeyIdFile: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
70
+ sesSecretAccessKey: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
71
+ sesSecretAccessKeyFile: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
72
+ sesSessionToken: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
73
+ sesSessionTokenFile: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
74
+ sesRegion: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
75
+ sesTimeout: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<number> | undefined>;
76
+ sendgridApiKey: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
77
+ sendgridApiKeyFile: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
78
+ sendgridBaseUrl: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
79
+ sendgridTimeout: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<number> | undefined>;
80
+ mailgunApiKey: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
81
+ mailgunApiKeyFile: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
82
+ mailgunDomain: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
83
+ mailgunRegion: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
84
+ mailgunBaseUrl: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
85
+ mailgunTimeout: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<number> | undefined>;
86
+ mailtrapApiToken: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
87
+ mailtrapApiTokenFile: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
88
+ mailtrapSandbox: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, [0, import("@optique/core/parser").ParserResult<import("@optique/core/valueparser").ValueParserResult<true> | undefined>] | [1, import("@optique/core/parser").ParserResult<import("@optique/core/valueparser").ValueParserResult<true> | undefined>] | undefined>;
89
+ mailtrapInboxId: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
90
+ mailtrapSendBaseUrl: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
91
+ mailtrapSandboxBaseUrl: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
92
+ mailtrapTimeout: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<number> | undefined>;
93
+ mailerooApiKey: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
94
+ mailerooApiKeyFile: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
95
+ mailerooBaseUrl: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
96
+ mailerooTimeout: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<number> | undefined>;
97
+ lettermintApiToken: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
98
+ lettermintApiTokenFile: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
99
+ lettermintBaseUrl: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
100
+ lettermintRoute: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<string> | undefined>;
101
+ lettermintTimeout: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<number> | undefined>;
102
+ lettermintRetries: import("@optique/core/modifiers").FluentParser<"sync", Sourced<string | undefined> | undefined, import("@optique/core/valueparser").ValueParserResult<number> | undefined>;
103
+ };
104
+ //#endregion
105
+ export { apiMailValueOptionNames, createApiMailFields };
106
+ //# sourceMappingURL=api-mail-parser.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-mail-parser.d.mts","names":[],"sources":["../src/api-mail-parser.ts"],"mappings":";;;cA6Ba;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;iBAMc,oBACd,UAAU,kBAAkB;EAG1B,8CAAU,qBAHF,6EAGE;EAYV,kDAAc,qBAZJ,6EAYI;EAQd,+CAAW,qBARG,6EAQH;EAUX,mDAAe,qBAVJ,6EAUI;EAQf,gDAAY,qBARG,6EAQH;EAYZ,gDAAY,qBAZA,6EAYA;EAeZ,gDAAY,qBAfA,6EAeA;EAUZ,oDAAgB,qBAVJ,6EAUI;EAQhB,iDAAa,qBARG,6EAQH;EAUb,iDAAa,qBAVA,6EAUA;EAeb,iDAAa,qBAfA,6EAeA;EAeb,2CAAO,qBAfM,6EAeN;EAYP,kDAAc,qBAZP,6EAYO;EAUd,sDAAkB,qBAVJ,6EAUI;EAQlB,sDAAkB,qBARA,6EAQA;EAUlB,0DAAsB,qBAVJ,6EAUI;EAUtB,mDAAe,qBAVO,6EAUP;EAUf,uDAAmB,qBAVJ,6EAUI;EAQnB,6CAAS,qBARU,6EAQV;EAUT,8CAAU,qBAVD,6EAUC;EAaV,kDAAc,qBAbJ,6EAaI;EAUd,sDAAkB,qBAVJ,6EAUI;EAQlB,mDAAe,qBARG,6EAQH;EAUf,mDAAe,qBAVA,6EAUA;EAef,iDAAa,qBAfE,6EAeF;EAUb,qDAAiB,qBAVJ,6EAUI;EAQjB,iDAAa,qBARI,6EAQJ;EAUb,iDAAa,qBAVA,6EAUA;EAUb,kDAAc,qBAVD,6EAUC;EAUd,kDAAc,qBAVA,6EAUA;EAed,oDAAgB,qBAfF,6EAeE;EAUhB,wDAAoB,qBAVJ,6EAUI;EAQpB,mDAAe,qBARK,4EAQL,iDAAA,2EAAA,iDAAA;EAoBf,mDAAe,qBApBA,6EAoBA;EAUf,uDAAmB,qBAVJ,6EAUI;EAUnB,0DAAsB,qBAVH,6EAUG;EAUtB,mDAAe,qBAVO,6EAUP;EAef,kDAAc,qBAfC,6EAeD;EAUd,sDAAkB,qBAVJ,6EAUI;EAQlB,mDAAe,qBARG,6EAQH;EAUf,mDAAe,qBAVA,6EAUA;EAef,sDAAkB,qBAfH,6EAeG;EAUlB,0DAAsB,qBAVJ,6EAUI;EAUtB,qDAAiB,qBAVK,6EAUL;EAUjB,mDAAe,qBAVE,6EAUF;EAUf,qDAAiB,qBAVF,6EAUE;EAejB,qDAAiB,qBAfA,6EAeA"}
@@ -0,0 +1,145 @@
1
+ import { configurationSettings } from "./configuration.mjs";
2
+ import { suggestedPath, suggestedString } from "./valueparser.mjs";
3
+ import { message } from "@optique/core/message";
4
+ import { map } from "@optique/core/modifiers";
5
+ import { integer, string } from "@optique/core/valueparser";
6
+ import { or } from "@optique/core/constructs";
7
+ import { flag, option } from "@optique/core/primitives";
8
+ //#region src/api-mail-parser.ts
9
+ /** API service options included in pure metadata argument arity. */
10
+ const apiMailValueOptionNames = {
11
+ mailApiKey: ["--mail-api-key"],
12
+ mailApiKeyFile: ["--mail-api-key-file"],
13
+ plunkApiKey: ["--plunk-api-key"],
14
+ plunkApiKeyFile: ["--plunk-api-key-file"],
15
+ plunkBaseUrl: ["--plunk-base-url"],
16
+ plunkTimeout: ["--plunk-timeout"],
17
+ resendApiKey: ["--resend-api-key"],
18
+ resendApiKeyFile: ["--resend-api-key-file"],
19
+ resendBaseUrl: ["--resend-base-url"],
20
+ resendTimeout: ["--resend-timeout"],
21
+ resendRetries: ["--resend-retries"],
22
+ sesAuth: ["--ses-auth"],
23
+ sesAccessKeyId: ["--ses-access-key-id"],
24
+ sesAccessKeyIdFile: ["--ses-access-key-id-file"],
25
+ sesSecretAccessKey: ["--ses-secret-access-key"],
26
+ sesSecretAccessKeyFile: ["--ses-secret-access-key-file"],
27
+ sesSessionToken: ["--ses-session-token"],
28
+ sesSessionTokenFile: ["--ses-session-token-file"],
29
+ sesRegion: ["--ses-region"],
30
+ sesTimeout: ["--ses-timeout"],
31
+ sendgridApiKey: ["--sendgrid-api-key"],
32
+ sendgridApiKeyFile: ["--sendgrid-api-key-file"],
33
+ sendgridBaseUrl: ["--sendgrid-base-url"],
34
+ sendgridTimeout: ["--sendgrid-timeout"],
35
+ mailgunApiKey: ["--mailgun-api-key"],
36
+ mailgunApiKeyFile: ["--mailgun-api-key-file"],
37
+ mailgunDomain: ["--mailgun-domain"],
38
+ mailgunRegion: ["--mailgun-region"],
39
+ mailgunBaseUrl: ["--mailgun-base-url"],
40
+ mailgunTimeout: ["--mailgun-timeout"],
41
+ mailtrapApiToken: ["--mailtrap-api-token"],
42
+ mailtrapApiTokenFile: ["--mailtrap-api-token-file"],
43
+ mailtrapInboxId: ["--mailtrap-inbox-id"],
44
+ mailtrapSendBaseUrl: ["--mailtrap-send-base-url"],
45
+ mailtrapSandboxBaseUrl: ["--mailtrap-sandbox-base-url"],
46
+ mailtrapTimeout: ["--mailtrap-timeout"],
47
+ mailerooApiKey: ["--maileroo-api-key"],
48
+ mailerooApiKeyFile: ["--maileroo-api-key-file"],
49
+ mailerooBaseUrl: ["--maileroo-base-url"],
50
+ mailerooTimeout: ["--maileroo-timeout"],
51
+ lettermintApiToken: ["--lettermint-api-token"],
52
+ lettermintApiTokenFile: ["--lettermint-api-token-file"],
53
+ lettermintBaseUrl: ["--lettermint-base-url"],
54
+ lettermintRoute: ["--lettermint-route"],
55
+ lettermintTimeout: ["--lettermint-timeout"],
56
+ lettermintRetries: ["--lettermint-retries"]
57
+ };
58
+ /** Source-tagged API fields; only the selected service is validated.
59
+ * @returns Fields for composition into the common mail parser.
60
+ */
61
+ function createApiMailFields(bindings) {
62
+ return {
63
+ mailApiKey: bindings.bind(option(...apiMailValueOptionNames.mailApiKey, string({ metavar: "VALUE" }), { description: message`API service credential for the selected mail transport.` }), configurationSettings.mailApiKey, string(), String),
64
+ mailApiKeyFile: bindings.bind(option(...apiMailValueOptionNames.mailApiKeyFile, suggestedPath(), { description: message`File containing the selected mail API service credential.` }), configurationSettings.mailApiKeyFile, string(), String),
65
+ plunkApiKey: bindings.bind(option(...apiMailValueOptionNames.plunkApiKey, string({ metavar: "VALUE" }), { description: message`Plunk sending API key.` }), configurationSettings.plunkApiKey, string(), String),
66
+ plunkApiKeyFile: bindings.bind(option(...apiMailValueOptionNames.plunkApiKeyFile, suggestedPath(), { description: message`File containing the Plunk API key.` }), configurationSettings.plunkApiKeyFile, string(), String),
67
+ plunkBaseUrl: bindings.bind(option(...apiMailValueOptionNames.plunkBaseUrl, string({ metavar: "VALUE" }), { description: message`Plunk API base URL including a self-hosted path.` }), configurationSettings.plunkBaseUrl, string(), String),
68
+ plunkTimeout: bindings.bind(map(option(...apiMailValueOptionNames.plunkTimeout, integer({
69
+ min: 1,
70
+ max: 2147483647
71
+ }), { description: message`Whole Plunk delivery timeout in milliseconds.` }), String), configurationSettings.plunkTimeout, string(), String),
72
+ resendApiKey: bindings.bind(option(...apiMailValueOptionNames.resendApiKey, string({ metavar: "VALUE" }), { description: message`Resend sending API key.` }), configurationSettings.resendApiKey, string(), String),
73
+ resendApiKeyFile: bindings.bind(option(...apiMailValueOptionNames.resendApiKeyFile, suggestedPath(), { description: message`File containing the Resend API key.` }), configurationSettings.resendApiKeyFile, string(), String),
74
+ resendBaseUrl: bindings.bind(option(...apiMailValueOptionNames.resendBaseUrl, string({ metavar: "VALUE" }), { description: message`Resend API base URL including an API path.` }), configurationSettings.resendBaseUrl, string(), String),
75
+ resendTimeout: bindings.bind(map(option(...apiMailValueOptionNames.resendTimeout, integer({
76
+ min: 1,
77
+ max: 2147483647
78
+ }), { description: message`Whole Resend delivery timeout in milliseconds.` }), String), configurationSettings.resendTimeout, string(), String),
79
+ resendRetries: bindings.bind(map(option(...apiMailValueOptionNames.resendRetries, integer({
80
+ min: 0,
81
+ max: 10
82
+ }), { description: message`Resend retries using one idempotency key (0 through 10).` }), String), configurationSettings.resendRetries, string(), String),
83
+ sesAuth: bindings.bind(option(...apiMailValueOptionNames.sesAuth, suggestedString(["credentials", "session"]), { description: message`SES authentication mode (credentials or session).` }), configurationSettings.sesAuth, string(), String),
84
+ sesAccessKeyId: bindings.bind(option(...apiMailValueOptionNames.sesAccessKeyId, string({ metavar: "VALUE" }), { description: message`SES access key ID.` }), configurationSettings.sesAccessKeyId, string(), String),
85
+ sesAccessKeyIdFile: bindings.bind(option(...apiMailValueOptionNames.sesAccessKeyIdFile, suggestedPath(), { description: message`File containing the SES access key ID.` }), configurationSettings.sesAccessKeyIdFile, string(), String),
86
+ sesSecretAccessKey: bindings.bind(option(...apiMailValueOptionNames.sesSecretAccessKey, string({ metavar: "VALUE" }), { description: message`SES secret access key.` }), configurationSettings.sesSecretAccessKey, string(), String),
87
+ sesSecretAccessKeyFile: bindings.bind(option(...apiMailValueOptionNames.sesSecretAccessKeyFile, suggestedPath(), { description: message`File containing the SES secret access key.` }), configurationSettings.sesSecretAccessKeyFile, string(), String),
88
+ sesSessionToken: bindings.bind(option(...apiMailValueOptionNames.sesSessionToken, string({ metavar: "VALUE" }), { description: message`SES temporary session token.` }), configurationSettings.sesSessionToken, string(), String),
89
+ sesSessionTokenFile: bindings.bind(option(...apiMailValueOptionNames.sesSessionTokenFile, suggestedPath(), { description: message`File containing the SES session token.` }), configurationSettings.sesSessionTokenFile, string(), String),
90
+ sesRegion: bindings.bind(option(...apiMailValueOptionNames.sesRegion, string({ metavar: "VALUE" }), { description: message`SES AWS region.` }), configurationSettings.sesRegion, string(), String),
91
+ sesTimeout: bindings.bind(map(option(...apiMailValueOptionNames.sesTimeout, integer({
92
+ min: 1,
93
+ max: 2147483647
94
+ }), { description: message`Whole SES delivery timeout in milliseconds.` }), String), configurationSettings.sesTimeout, string(), String),
95
+ sendgridApiKey: bindings.bind(option(...apiMailValueOptionNames.sendgridApiKey, string({ metavar: "VALUE" }), { description: message`SendGrid sending API key.` }), configurationSettings.sendgridApiKey, string(), String),
96
+ sendgridApiKeyFile: bindings.bind(option(...apiMailValueOptionNames.sendgridApiKeyFile, suggestedPath(), { description: message`File containing the SendGrid API key.` }), configurationSettings.sendgridApiKeyFile, string(), String),
97
+ sendgridBaseUrl: bindings.bind(option(...apiMailValueOptionNames.sendgridBaseUrl, string({ metavar: "VALUE" }), { description: message`SendGrid API base URL including an API path.` }), configurationSettings.sendgridBaseUrl, string(), String),
98
+ sendgridTimeout: bindings.bind(map(option(...apiMailValueOptionNames.sendgridTimeout, integer({
99
+ min: 1,
100
+ max: 2147483647
101
+ }), { description: message`Whole SendGrid delivery timeout in milliseconds.` }), String), configurationSettings.sendgridTimeout, string(), String),
102
+ mailgunApiKey: bindings.bind(option(...apiMailValueOptionNames.mailgunApiKey, string({ metavar: "VALUE" }), { description: message`Mailgun sending API key.` }), configurationSettings.mailgunApiKey, string(), String),
103
+ mailgunApiKeyFile: bindings.bind(option(...apiMailValueOptionNames.mailgunApiKeyFile, suggestedPath(), { description: message`File containing the Mailgun API key.` }), configurationSettings.mailgunApiKeyFile, string(), String),
104
+ mailgunDomain: bindings.bind(option(...apiMailValueOptionNames.mailgunDomain, string({ metavar: "VALUE" }), { description: message`Verified Mailgun sending domain.` }), configurationSettings.mailgunDomain, string(), String),
105
+ mailgunRegion: bindings.bind(option(...apiMailValueOptionNames.mailgunRegion, suggestedString(["us", "eu"]), { description: message`Mailgun API region (us or eu).` }), configurationSettings.mailgunRegion, string(), String),
106
+ mailgunBaseUrl: bindings.bind(option(...apiMailValueOptionNames.mailgunBaseUrl, string({ metavar: "VALUE" }), { description: message`Mailgun API base URL including its path.` }), configurationSettings.mailgunBaseUrl, string(), String),
107
+ mailgunTimeout: bindings.bind(map(option(...apiMailValueOptionNames.mailgunTimeout, integer({
108
+ min: 1,
109
+ max: 2147483647
110
+ }), { description: message`Whole Mailgun delivery timeout in milliseconds.` }), String), configurationSettings.mailgunTimeout, string(), String),
111
+ mailtrapApiToken: bindings.bind(option(...apiMailValueOptionNames.mailtrapApiToken, string({ metavar: "VALUE" }), { description: message`Mailtrap sending API token.` }), configurationSettings.mailtrapApiToken, string(), String),
112
+ mailtrapApiTokenFile: bindings.bind(option(...apiMailValueOptionNames.mailtrapApiTokenFile, suggestedPath(), { description: message`File containing the Mailtrap API token.` }), configurationSettings.mailtrapApiTokenFile, string(), String),
113
+ mailtrapSandbox: bindings.bind(map(or(flag("--mailtrap-sandbox", { description: message`Capture mail in a test inbox.` }), map(flag("--no-mailtrap-sandbox", { description: message`Use the production sending API.` }), () => false)), String), configurationSettings.mailtrapSandbox, string(), String, "false"),
114
+ mailtrapInboxId: bindings.bind(option(...apiMailValueOptionNames.mailtrapInboxId, string({ metavar: "VALUE" }), { description: message`Mailtrap sandbox inbox ID.` }), configurationSettings.mailtrapInboxId, string(), String),
115
+ mailtrapSendBaseUrl: bindings.bind(option(...apiMailValueOptionNames.mailtrapSendBaseUrl, string({ metavar: "VALUE" }), { description: message`Mailtrap sending API base URL.` }), configurationSettings.mailtrapSendBaseUrl, string(), String),
116
+ mailtrapSandboxBaseUrl: bindings.bind(option(...apiMailValueOptionNames.mailtrapSandboxBaseUrl, string({ metavar: "VALUE" }), { description: message`Mailtrap sandbox API base URL.` }), configurationSettings.mailtrapSandboxBaseUrl, string(), String),
117
+ mailtrapTimeout: bindings.bind(map(option(...apiMailValueOptionNames.mailtrapTimeout, integer({
118
+ min: 1,
119
+ max: 2147483647
120
+ }), { description: message`Whole Mailtrap delivery timeout in milliseconds.` }), String), configurationSettings.mailtrapTimeout, string(), String),
121
+ mailerooApiKey: bindings.bind(option(...apiMailValueOptionNames.mailerooApiKey, string({ metavar: "VALUE" }), { description: message`Maileroo API sending key.` }), configurationSettings.mailerooApiKey, string(), String),
122
+ mailerooApiKeyFile: bindings.bind(option(...apiMailValueOptionNames.mailerooApiKeyFile, suggestedPath(), { description: message`File containing the Maileroo API sending key.` }), configurationSettings.mailerooApiKeyFile, string(), String),
123
+ mailerooBaseUrl: bindings.bind(option(...apiMailValueOptionNames.mailerooBaseUrl, string({ metavar: "VALUE" }), { description: message`Maileroo API base URL including its path.` }), configurationSettings.mailerooBaseUrl, string(), String),
124
+ mailerooTimeout: bindings.bind(map(option(...apiMailValueOptionNames.mailerooTimeout, integer({
125
+ min: 1,
126
+ max: 2147483647
127
+ }), { description: message`Whole Maileroo delivery timeout in milliseconds.` }), String), configurationSettings.mailerooTimeout, string(), String),
128
+ lettermintApiToken: bindings.bind(option(...apiMailValueOptionNames.lettermintApiToken, string({ metavar: "VALUE" }), { description: message`Lettermint sending API token.` }), configurationSettings.lettermintApiToken, string(), String),
129
+ lettermintApiTokenFile: bindings.bind(option(...apiMailValueOptionNames.lettermintApiTokenFile, suggestedPath(), { description: message`File containing the Lettermint API token.` }), configurationSettings.lettermintApiTokenFile, string(), String),
130
+ lettermintBaseUrl: bindings.bind(option(...apiMailValueOptionNames.lettermintBaseUrl, string({ metavar: "VALUE" }), { description: message`Lettermint API base origin.` }), configurationSettings.lettermintBaseUrl, string(), String),
131
+ lettermintRoute: bindings.bind(option(...apiMailValueOptionNames.lettermintRoute, string({ metavar: "VALUE" }), { description: message`Lettermint delivery route.` }), configurationSettings.lettermintRoute, string(), String),
132
+ lettermintTimeout: bindings.bind(map(option(...apiMailValueOptionNames.lettermintTimeout, integer({
133
+ min: 1,
134
+ max: 2147483647
135
+ }), { description: message`Whole Lettermint delivery timeout in milliseconds.` }), String), configurationSettings.lettermintTimeout, string(), String),
136
+ lettermintRetries: bindings.bind(map(option(...apiMailValueOptionNames.lettermintRetries, integer({
137
+ min: 0,
138
+ max: 10
139
+ }), { description: message`Lettermint API retries using one idempotency key (0 through 10).` }), String), configurationSettings.lettermintRetries, string(), String)
140
+ };
141
+ }
142
+ //#endregion
143
+ export { apiMailValueOptionNames, createApiMailFields };
144
+
145
+ //# sourceMappingURL=api-mail-parser.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-mail-parser.mjs","names":["settings"],"sources":["../src/api-mail-parser.ts"],"sourcesContent":["// DrFed: A web-based platform for developing and debugging ActivityPub apps\n// Copyright (C) 2026 DrFed team\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see <https://www.gnu.org/licenses/>.\n\nimport { or } from \"@optique/core/constructs\";\nimport { message } from \"@optique/core/message\";\nimport { map } from \"@optique/core/modifiers\";\nimport { flag, option } from \"@optique/core/primitives\";\nimport { integer, string } from \"@optique/core/valueparser\";\n\nimport {\n type createConfigurationBindings,\n configurationSettings as settings,\n} from \"./configuration.ts\";\nimport { suggestedPath, suggestedString } from \"./valueparser.ts\";\n\n/** API service options included in pure metadata argument arity. */\nexport const apiMailValueOptionNames = {\n mailApiKey: [\"--mail-api-key\"],\n mailApiKeyFile: [\"--mail-api-key-file\"],\n plunkApiKey: [\"--plunk-api-key\"],\n plunkApiKeyFile: [\"--plunk-api-key-file\"],\n plunkBaseUrl: [\"--plunk-base-url\"],\n plunkTimeout: [\"--plunk-timeout\"],\n resendApiKey: [\"--resend-api-key\"],\n resendApiKeyFile: [\"--resend-api-key-file\"],\n resendBaseUrl: [\"--resend-base-url\"],\n resendTimeout: [\"--resend-timeout\"],\n resendRetries: [\"--resend-retries\"],\n sesAuth: [\"--ses-auth\"],\n sesAccessKeyId: [\"--ses-access-key-id\"],\n sesAccessKeyIdFile: [\"--ses-access-key-id-file\"],\n sesSecretAccessKey: [\"--ses-secret-access-key\"],\n sesSecretAccessKeyFile: [\"--ses-secret-access-key-file\"],\n sesSessionToken: [\"--ses-session-token\"],\n sesSessionTokenFile: [\"--ses-session-token-file\"],\n sesRegion: [\"--ses-region\"],\n sesTimeout: [\"--ses-timeout\"],\n sendgridApiKey: [\"--sendgrid-api-key\"],\n sendgridApiKeyFile: [\"--sendgrid-api-key-file\"],\n sendgridBaseUrl: [\"--sendgrid-base-url\"],\n sendgridTimeout: [\"--sendgrid-timeout\"],\n mailgunApiKey: [\"--mailgun-api-key\"],\n mailgunApiKeyFile: [\"--mailgun-api-key-file\"],\n mailgunDomain: [\"--mailgun-domain\"],\n mailgunRegion: [\"--mailgun-region\"],\n mailgunBaseUrl: [\"--mailgun-base-url\"],\n mailgunTimeout: [\"--mailgun-timeout\"],\n mailtrapApiToken: [\"--mailtrap-api-token\"],\n mailtrapApiTokenFile: [\"--mailtrap-api-token-file\"],\n mailtrapInboxId: [\"--mailtrap-inbox-id\"],\n mailtrapSendBaseUrl: [\"--mailtrap-send-base-url\"],\n mailtrapSandboxBaseUrl: [\"--mailtrap-sandbox-base-url\"],\n mailtrapTimeout: [\"--mailtrap-timeout\"],\n mailerooApiKey: [\"--maileroo-api-key\"],\n mailerooApiKeyFile: [\"--maileroo-api-key-file\"],\n mailerooBaseUrl: [\"--maileroo-base-url\"],\n mailerooTimeout: [\"--maileroo-timeout\"],\n lettermintApiToken: [\"--lettermint-api-token\"],\n lettermintApiTokenFile: [\"--lettermint-api-token-file\"],\n lettermintBaseUrl: [\"--lettermint-base-url\"],\n lettermintRoute: [\"--lettermint-route\"],\n lettermintTimeout: [\"--lettermint-timeout\"],\n lettermintRetries: [\"--lettermint-retries\"],\n} as const;\n\n/** Source-tagged API fields; only the selected service is validated.\n * @returns Fields for composition into the common mail parser.\n */\nexport function createApiMailFields(\n bindings: ReturnType<typeof createConfigurationBindings>,\n) {\n return {\n mailApiKey: bindings.bind(\n option(\n ...apiMailValueOptionNames.mailApiKey,\n string({ metavar: \"VALUE\" }),\n {\n description: message`API service credential for the selected mail transport.`,\n },\n ),\n settings.mailApiKey,\n string(),\n String,\n ),\n mailApiKeyFile: bindings.bind(\n option(...apiMailValueOptionNames.mailApiKeyFile, suggestedPath(), {\n description: message`File containing the selected mail API service credential.`,\n }),\n settings.mailApiKeyFile,\n string(),\n String,\n ),\n plunkApiKey: bindings.bind(\n option(\n ...apiMailValueOptionNames.plunkApiKey,\n string({ metavar: \"VALUE\" }),\n { description: message`Plunk sending API key.` },\n ),\n settings.plunkApiKey,\n string(),\n String,\n ),\n plunkApiKeyFile: bindings.bind(\n option(...apiMailValueOptionNames.plunkApiKeyFile, suggestedPath(), {\n description: message`File containing the Plunk API key.`,\n }),\n settings.plunkApiKeyFile,\n string(),\n String,\n ),\n plunkBaseUrl: bindings.bind(\n option(\n ...apiMailValueOptionNames.plunkBaseUrl,\n string({ metavar: \"VALUE\" }),\n {\n description: message`Plunk API base URL including a self-hosted path.`,\n },\n ),\n settings.plunkBaseUrl,\n string(),\n String,\n ),\n plunkTimeout: bindings.bind(\n map(\n option(\n ...apiMailValueOptionNames.plunkTimeout,\n integer({ min: 1, max: 2147483647 }),\n {\n description: message`Whole Plunk delivery timeout in milliseconds.`,\n },\n ),\n String,\n ),\n settings.plunkTimeout,\n string(),\n String,\n ),\n resendApiKey: bindings.bind(\n option(\n ...apiMailValueOptionNames.resendApiKey,\n string({ metavar: \"VALUE\" }),\n { description: message`Resend sending API key.` },\n ),\n settings.resendApiKey,\n string(),\n String,\n ),\n resendApiKeyFile: bindings.bind(\n option(...apiMailValueOptionNames.resendApiKeyFile, suggestedPath(), {\n description: message`File containing the Resend API key.`,\n }),\n settings.resendApiKeyFile,\n string(),\n String,\n ),\n resendBaseUrl: bindings.bind(\n option(\n ...apiMailValueOptionNames.resendBaseUrl,\n string({ metavar: \"VALUE\" }),\n { description: message`Resend API base URL including an API path.` },\n ),\n settings.resendBaseUrl,\n string(),\n String,\n ),\n resendTimeout: bindings.bind(\n map(\n option(\n ...apiMailValueOptionNames.resendTimeout,\n integer({ min: 1, max: 2147483647 }),\n {\n description: message`Whole Resend delivery timeout in milliseconds.`,\n },\n ),\n String,\n ),\n settings.resendTimeout,\n string(),\n String,\n ),\n resendRetries: bindings.bind(\n map(\n option(\n ...apiMailValueOptionNames.resendRetries,\n integer({ min: 0, max: 10 }),\n {\n description: message`Resend retries using one idempotency key (0 through 10).`,\n },\n ),\n String,\n ),\n settings.resendRetries,\n string(),\n String,\n ),\n sesAuth: bindings.bind(\n option(\n ...apiMailValueOptionNames.sesAuth,\n suggestedString([\"credentials\", \"session\"]),\n {\n description: message`SES authentication mode (credentials or session).`,\n },\n ),\n settings.sesAuth,\n string(),\n String,\n ),\n sesAccessKeyId: bindings.bind(\n option(\n ...apiMailValueOptionNames.sesAccessKeyId,\n string({ metavar: \"VALUE\" }),\n { description: message`SES access key ID.` },\n ),\n settings.sesAccessKeyId,\n string(),\n String,\n ),\n sesAccessKeyIdFile: bindings.bind(\n option(...apiMailValueOptionNames.sesAccessKeyIdFile, suggestedPath(), {\n description: message`File containing the SES access key ID.`,\n }),\n settings.sesAccessKeyIdFile,\n string(),\n String,\n ),\n sesSecretAccessKey: bindings.bind(\n option(\n ...apiMailValueOptionNames.sesSecretAccessKey,\n string({ metavar: \"VALUE\" }),\n { description: message`SES secret access key.` },\n ),\n settings.sesSecretAccessKey,\n string(),\n String,\n ),\n sesSecretAccessKeyFile: bindings.bind(\n option(\n ...apiMailValueOptionNames.sesSecretAccessKeyFile,\n suggestedPath(),\n { description: message`File containing the SES secret access key.` },\n ),\n settings.sesSecretAccessKeyFile,\n string(),\n String,\n ),\n sesSessionToken: bindings.bind(\n option(\n ...apiMailValueOptionNames.sesSessionToken,\n string({ metavar: \"VALUE\" }),\n { description: message`SES temporary session token.` },\n ),\n settings.sesSessionToken,\n string(),\n String,\n ),\n sesSessionTokenFile: bindings.bind(\n option(...apiMailValueOptionNames.sesSessionTokenFile, suggestedPath(), {\n description: message`File containing the SES session token.`,\n }),\n settings.sesSessionTokenFile,\n string(),\n String,\n ),\n sesRegion: bindings.bind(\n option(\n ...apiMailValueOptionNames.sesRegion,\n string({ metavar: \"VALUE\" }),\n { description: message`SES AWS region.` },\n ),\n settings.sesRegion,\n string(),\n String,\n ),\n sesTimeout: bindings.bind(\n map(\n option(\n ...apiMailValueOptionNames.sesTimeout,\n integer({ min: 1, max: 2147483647 }),\n { description: message`Whole SES delivery timeout in milliseconds.` },\n ),\n String,\n ),\n settings.sesTimeout,\n string(),\n String,\n ),\n sendgridApiKey: bindings.bind(\n option(\n ...apiMailValueOptionNames.sendgridApiKey,\n string({ metavar: \"VALUE\" }),\n { description: message`SendGrid sending API key.` },\n ),\n settings.sendgridApiKey,\n string(),\n String,\n ),\n sendgridApiKeyFile: bindings.bind(\n option(...apiMailValueOptionNames.sendgridApiKeyFile, suggestedPath(), {\n description: message`File containing the SendGrid API key.`,\n }),\n settings.sendgridApiKeyFile,\n string(),\n String,\n ),\n sendgridBaseUrl: bindings.bind(\n option(\n ...apiMailValueOptionNames.sendgridBaseUrl,\n string({ metavar: \"VALUE\" }),\n { description: message`SendGrid API base URL including an API path.` },\n ),\n settings.sendgridBaseUrl,\n string(),\n String,\n ),\n sendgridTimeout: bindings.bind(\n map(\n option(\n ...apiMailValueOptionNames.sendgridTimeout,\n integer({ min: 1, max: 2147483647 }),\n {\n description: message`Whole SendGrid delivery timeout in milliseconds.`,\n },\n ),\n String,\n ),\n settings.sendgridTimeout,\n string(),\n String,\n ),\n mailgunApiKey: bindings.bind(\n option(\n ...apiMailValueOptionNames.mailgunApiKey,\n string({ metavar: \"VALUE\" }),\n { description: message`Mailgun sending API key.` },\n ),\n settings.mailgunApiKey,\n string(),\n String,\n ),\n mailgunApiKeyFile: bindings.bind(\n option(...apiMailValueOptionNames.mailgunApiKeyFile, suggestedPath(), {\n description: message`File containing the Mailgun API key.`,\n }),\n settings.mailgunApiKeyFile,\n string(),\n String,\n ),\n mailgunDomain: bindings.bind(\n option(\n ...apiMailValueOptionNames.mailgunDomain,\n string({ metavar: \"VALUE\" }),\n { description: message`Verified Mailgun sending domain.` },\n ),\n settings.mailgunDomain,\n string(),\n String,\n ),\n mailgunRegion: bindings.bind(\n option(\n ...apiMailValueOptionNames.mailgunRegion,\n suggestedString([\"us\", \"eu\"]),\n { description: message`Mailgun API region (us or eu).` },\n ),\n settings.mailgunRegion,\n string(),\n String,\n ),\n mailgunBaseUrl: bindings.bind(\n option(\n ...apiMailValueOptionNames.mailgunBaseUrl,\n string({ metavar: \"VALUE\" }),\n { description: message`Mailgun API base URL including its path.` },\n ),\n settings.mailgunBaseUrl,\n string(),\n String,\n ),\n mailgunTimeout: bindings.bind(\n map(\n option(\n ...apiMailValueOptionNames.mailgunTimeout,\n integer({ min: 1, max: 2147483647 }),\n {\n description: message`Whole Mailgun delivery timeout in milliseconds.`,\n },\n ),\n String,\n ),\n settings.mailgunTimeout,\n string(),\n String,\n ),\n mailtrapApiToken: bindings.bind(\n option(\n ...apiMailValueOptionNames.mailtrapApiToken,\n string({ metavar: \"VALUE\" }),\n { description: message`Mailtrap sending API token.` },\n ),\n settings.mailtrapApiToken,\n string(),\n String,\n ),\n mailtrapApiTokenFile: bindings.bind(\n option(...apiMailValueOptionNames.mailtrapApiTokenFile, suggestedPath(), {\n description: message`File containing the Mailtrap API token.`,\n }),\n settings.mailtrapApiTokenFile,\n string(),\n String,\n ),\n mailtrapSandbox: bindings.bind(\n map(\n or(\n flag(\"--mailtrap-sandbox\", {\n description: message`Capture mail in a test inbox.`,\n }),\n map(\n flag(\"--no-mailtrap-sandbox\", {\n description: message`Use the production sending API.`,\n }),\n () => false,\n ),\n ),\n String,\n ),\n settings.mailtrapSandbox,\n string(),\n String,\n \"false\",\n ),\n mailtrapInboxId: bindings.bind(\n option(\n ...apiMailValueOptionNames.mailtrapInboxId,\n string({ metavar: \"VALUE\" }),\n { description: message`Mailtrap sandbox inbox ID.` },\n ),\n settings.mailtrapInboxId,\n string(),\n String,\n ),\n mailtrapSendBaseUrl: bindings.bind(\n option(\n ...apiMailValueOptionNames.mailtrapSendBaseUrl,\n string({ metavar: \"VALUE\" }),\n { description: message`Mailtrap sending API base URL.` },\n ),\n settings.mailtrapSendBaseUrl,\n string(),\n String,\n ),\n mailtrapSandboxBaseUrl: bindings.bind(\n option(\n ...apiMailValueOptionNames.mailtrapSandboxBaseUrl,\n string({ metavar: \"VALUE\" }),\n { description: message`Mailtrap sandbox API base URL.` },\n ),\n settings.mailtrapSandboxBaseUrl,\n string(),\n String,\n ),\n mailtrapTimeout: bindings.bind(\n map(\n option(\n ...apiMailValueOptionNames.mailtrapTimeout,\n integer({ min: 1, max: 2147483647 }),\n {\n description: message`Whole Mailtrap delivery timeout in milliseconds.`,\n },\n ),\n String,\n ),\n settings.mailtrapTimeout,\n string(),\n String,\n ),\n mailerooApiKey: bindings.bind(\n option(\n ...apiMailValueOptionNames.mailerooApiKey,\n string({ metavar: \"VALUE\" }),\n { description: message`Maileroo API sending key.` },\n ),\n settings.mailerooApiKey,\n string(),\n String,\n ),\n mailerooApiKeyFile: bindings.bind(\n option(...apiMailValueOptionNames.mailerooApiKeyFile, suggestedPath(), {\n description: message`File containing the Maileroo API sending key.`,\n }),\n settings.mailerooApiKeyFile,\n string(),\n String,\n ),\n mailerooBaseUrl: bindings.bind(\n option(\n ...apiMailValueOptionNames.mailerooBaseUrl,\n string({ metavar: \"VALUE\" }),\n { description: message`Maileroo API base URL including its path.` },\n ),\n settings.mailerooBaseUrl,\n string(),\n String,\n ),\n mailerooTimeout: bindings.bind(\n map(\n option(\n ...apiMailValueOptionNames.mailerooTimeout,\n integer({ min: 1, max: 2147483647 }),\n {\n description: message`Whole Maileroo delivery timeout in milliseconds.`,\n },\n ),\n String,\n ),\n settings.mailerooTimeout,\n string(),\n String,\n ),\n lettermintApiToken: bindings.bind(\n option(\n ...apiMailValueOptionNames.lettermintApiToken,\n string({ metavar: \"VALUE\" }),\n { description: message`Lettermint sending API token.` },\n ),\n settings.lettermintApiToken,\n string(),\n String,\n ),\n lettermintApiTokenFile: bindings.bind(\n option(\n ...apiMailValueOptionNames.lettermintApiTokenFile,\n suggestedPath(),\n { description: message`File containing the Lettermint API token.` },\n ),\n settings.lettermintApiTokenFile,\n string(),\n String,\n ),\n lettermintBaseUrl: bindings.bind(\n option(\n ...apiMailValueOptionNames.lettermintBaseUrl,\n string({ metavar: \"VALUE\" }),\n { description: message`Lettermint API base origin.` },\n ),\n settings.lettermintBaseUrl,\n string(),\n String,\n ),\n lettermintRoute: bindings.bind(\n option(\n ...apiMailValueOptionNames.lettermintRoute,\n string({ metavar: \"VALUE\" }),\n { description: message`Lettermint delivery route.` },\n ),\n settings.lettermintRoute,\n string(),\n String,\n ),\n lettermintTimeout: bindings.bind(\n map(\n option(\n ...apiMailValueOptionNames.lettermintTimeout,\n integer({ min: 1, max: 2147483647 }),\n {\n description: message`Whole Lettermint delivery timeout in milliseconds.`,\n },\n ),\n String,\n ),\n settings.lettermintTimeout,\n string(),\n String,\n ),\n lettermintRetries: bindings.bind(\n map(\n option(\n ...apiMailValueOptionNames.lettermintRetries,\n integer({ min: 0, max: 10 }),\n {\n description: message`Lettermint API retries using one idempotency key (0 through 10).`,\n },\n ),\n String,\n ),\n settings.lettermintRetries,\n string(),\n String,\n ),\n };\n}\n"],"mappings":";;;;;;;;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C3B,QAAQ;GAAE,KAAK;GAAG,KAAK;EAAG,CAAC,GAC3B,EACE,aAAa,OAAO,mEACtB,CACF,GACA,MACF,GACAA,sBAAS,mBACT,OAAO,GACP,MACF;CACF;AACF"}
@@ -0,0 +1,142 @@
1
+ import { s as Sourced } from "./configuration-DVVF7xNv.mjs";
2
+ import { t as RawMailOptions } from "./mail-parser-DyI4wuQp.mjs";
3
+ import { t as SecretSource } from "./secret-source-BeZx72Ue.mjs";
4
+ import { LettermintConfig } from "@upyo/lettermint";
5
+ import { MailerooConfig } from "@upyo/maileroo";
6
+ import { MailgunConfig } from "@upyo/mailgun";
7
+ import { MailtrapConfig } from "@upyo/mailtrap";
8
+ import { PlunkConfig } from "@upyo/plunk";
9
+ import { ResendConfig } from "@upyo/resend";
10
+ import { SendGridConfig } from "@upyo/sendgrid";
11
+ //#region src/api-mail-settings.d.ts
12
+ /** Selected API service configuration before secret files are opened. */
13
+ type ApiMailSettings = {
14
+ readonly transport: "lettermint";
15
+ readonly connection: Omit<LettermintConfig, "apiToken" | "headers" | "tag" | "metadata" | "settings">;
16
+ readonly credential: SecretSource;
17
+ } | {
18
+ readonly transport: "maileroo";
19
+ readonly connection: Omit<MailerooConfig, "apiKey" | "headers" | "tracking" | "tags">;
20
+ readonly credential: SecretSource;
21
+ } | {
22
+ readonly transport: "mailtrap";
23
+ readonly connection: Omit<MailtrapConfig, "apiToken" | "metadata" | "headers" | "defaultCategory" | "userAgent">;
24
+ readonly credential: SecretSource;
25
+ } | {
26
+ readonly transport: "mailgun";
27
+ readonly connection: Omit<MailgunConfig, "apiKey" | "headers" | "tracking" | "clickTracking" | "openTracking">;
28
+ readonly credential: SecretSource;
29
+ } | {
30
+ readonly transport: "plunk";
31
+ readonly connection: Omit<PlunkConfig, "apiKey" | "headers">;
32
+ readonly credential: SecretSource;
33
+ } | {
34
+ readonly transport: "resend";
35
+ readonly connection: Omit<ResendConfig, "apiKey" | "headers">;
36
+ readonly credential: SecretSource;
37
+ } | {
38
+ readonly transport: "sendgrid";
39
+ readonly connection: Omit<SendGridConfig, "apiKey" | "headers" | "clickTracking" | "openTracking" | "subscriptionTracking" | "googleAnalytics">;
40
+ readonly credential: SecretSource;
41
+ };
42
+ type Input = Sourced<string | undefined> | undefined;
43
+ /** Validate API token/key contents without exposing them in errors. */
44
+ declare function validateApiMailCredential(value: string): void;
45
+ /** Resolve only the selected API service; credentials remain unopened.
46
+ * @returns Prepared meaning, safe diagnostic values and effective source tags.
47
+ */
48
+ declare function resolveApiMailSettings(raw: RawMailOptions, cwd: string, provider?: ApiMailSettings["transport"]): {
49
+ mail: {
50
+ readonly transport: "mailtrap";
51
+ readonly connection: Omit<MailtrapConfig, "apiToken" | "metadata" | "headers" | "defaultCategory" | "userAgent">;
52
+ readonly credential: SecretSource;
53
+ };
54
+ sources: {
55
+ mailtrapInboxId?: undefined;
56
+ };
57
+ values: {
58
+ mailtrapSandbox: boolean;
59
+ mailtrapTimeout: number;
60
+ mailtrapInboxId?: string | undefined;
61
+ };
62
+ } | {
63
+ mail: {
64
+ readonly transport: "mailgun";
65
+ readonly connection: Omit<MailgunConfig, "apiKey" | "headers" | "tracking" | "clickTracking" | "openTracking">;
66
+ readonly credential: SecretSource;
67
+ };
68
+ sources: Record<string, Input>;
69
+ values: {
70
+ mailgunDomain: string;
71
+ mailgunRegion: string;
72
+ mailgunBaseUrl: string | undefined;
73
+ mailgunTimeout: number | undefined;
74
+ };
75
+ } | {
76
+ mail: {
77
+ readonly transport: "plunk";
78
+ readonly connection: Omit<PlunkConfig, "apiKey" | "headers">;
79
+ readonly credential: SecretSource;
80
+ };
81
+ sources: Record<string, Input>;
82
+ values: {
83
+ plunkBaseUrl: string;
84
+ plunkTimeout: number;
85
+ };
86
+ } | {
87
+ mail: {
88
+ readonly transport: "resend";
89
+ readonly connection: Omit<ResendConfig, "apiKey" | "headers">;
90
+ readonly credential: SecretSource;
91
+ };
92
+ sources: Record<string, Input>;
93
+ values: {
94
+ resendBaseUrl: string;
95
+ resendTimeout: number;
96
+ resendRetries: number;
97
+ };
98
+ } | {
99
+ mail: {
100
+ readonly transport: "sendgrid";
101
+ readonly connection: Omit<SendGridConfig, "apiKey" | "headers" | "clickTracking" | "openTracking" | "subscriptionTracking" | "googleAnalytics">;
102
+ readonly credential: SecretSource;
103
+ };
104
+ sources: Record<string, Input>;
105
+ values: {
106
+ sendgridBaseUrl: string;
107
+ sendgridTimeout: number;
108
+ };
109
+ } | {
110
+ mail: {
111
+ readonly transport: "maileroo";
112
+ readonly connection: Omit<MailerooConfig, "apiKey" | "headers" | "tracking" | "tags">;
113
+ readonly credential: SecretSource;
114
+ };
115
+ sources: Record<string, Input>;
116
+ values: {
117
+ mailerooBaseUrl: string;
118
+ mailerooTimeout: number;
119
+ lettermintBaseUrl?: never;
120
+ lettermintTimeout?: never;
121
+ lettermintRetries?: never;
122
+ lettermintRoute?: never;
123
+ };
124
+ } | {
125
+ mail: {
126
+ readonly transport: "lettermint";
127
+ readonly connection: Omit<LettermintConfig, "apiToken" | "headers" | "tag" | "metadata" | "settings">;
128
+ readonly credential: SecretSource;
129
+ };
130
+ sources: Record<string, Input>;
131
+ values: {
132
+ mailerooBaseUrl?: never;
133
+ mailerooTimeout?: never;
134
+ lettermintBaseUrl: string;
135
+ lettermintTimeout: number;
136
+ lettermintRetries: number;
137
+ lettermintRoute: string | undefined;
138
+ };
139
+ };
140
+ //#endregion
141
+ export { resolveApiMailSettings as n, validateApiMailCredential as r, ApiMailSettings as t };
142
+ //# sourceMappingURL=api-mail-settings-BcGaqQ9f.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-mail-settings-BcGaqQ9f.d.mts","names":[],"sources":["../src/api-mail-settings.ts"],"mappings":";;;;;;;;;;;;KAiCY;WAEG;WACA,YAAY,KACnB;WAGO,YAAY;;WAGZ;WACA,YAAY,KACnB;WAGO,YAAY;;WAGZ;WACA,YAAY,KACnB;WAGO,YAAY;;WAGZ;WACA,YAAY,KACnB;WAGO,YAAY;;WAGZ;WACA,YAAY,KAAK;WACjB,YAAY;;WAGZ;WACA,YAAY,KAAK;WACjB,YAAY;;WAGZ;WACA,YAAY,KACnB;WAQO,YAAY;;KAGtB,QAAQ;;iBAMG,0BAA0B;;;;iBAyW1B,uBACd,KAAK,gBACL,aACA,WAAU;;aAzZc;aACC,YAAA,KACnB;aAGmB,YAAA;;;;;;;;;;;;aAGD;aACC,YAAA,KACnB;aAGmB,YAAA;;;;;;;;;;;aAGD;aACC,YAAA,KAAK;aACL,YAAA;;;;IAkTrB;IACA;;;;aAhToB;aACC,YAAA,KAAK;aACL,YAAA;;;;IA6UrB;IACA;IACA;;;;aA5UoB;aACC,YAAA,KACnB;aAQmB,YAAA;;;;IAyWrB;IACA;;;;aAtZoB;aACC,YAAA,KACnB;aAGmB,YAAA;;;;;;;;;;;;;aAbD;aACC,YAAA,KACnB;aAGmB,YAAA"}
@@ -0,0 +1,2 @@
1
+ import { n as resolveApiMailSettings, r as validateApiMailCredential, t as ApiMailSettings } from "./api-mail-settings-BcGaqQ9f.mjs";
2
+ export { ApiMailSettings, resolveApiMailSettings, validateApiMailCredential };