@plitzi/sdk-server 0.35.6 → 0.35.7
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.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @plitzi/sdk-server
|
|
2
2
|
|
|
3
|
+
## 0.35.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- An SMTP failure says which credential it was, and a credential's values can be replaced from the builder.
|
|
8
|
+
|
|
9
|
+
- **`email.send` names the credential it could not send through:** `Could not send through the SMTP credential
|
|
10
|
+
"ceniza-smtp": its SMTP host is on a private network…`. The host used to be in the sentence, and a run's trace
|
|
11
|
+
redacts every value of a credential it resolved, so the message read `The SMTP host "«redacted»"…`.
|
|
12
|
+
- **Credentials can be edited in the builder.** A pencil on each row opens the form with the name and the provider
|
|
13
|
+
fixed and nothing it holds shown: every value is entered again, and saving replaces all of them. SMTP credentials
|
|
14
|
+
are also labelled in the list.
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
- @plitzi/plitzi-sdk@0.35.7
|
|
18
|
+
- @plitzi/sdk-shared@0.35.7
|
|
19
|
+
|
|
3
20
|
## 0.35.6
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -63,11 +63,11 @@ var createEmailSender = ({ kv, dailyLimitPerSpace = 200, allowPrivateHosts = fal
|
|
|
63
63
|
try {
|
|
64
64
|
addresses = await lookup(smtp.host);
|
|
65
65
|
} catch {
|
|
66
|
-
throw new Error(
|
|
66
|
+
throw new Error("its SMTP host does not resolve");
|
|
67
67
|
}
|
|
68
68
|
const [first] = addresses;
|
|
69
|
-
if (addresses.length === 0) throw new Error(
|
|
70
|
-
if (!allowPrivateHosts && (isBlockedHost(smtp.host) || addresses.some(({ address }) => isBlockedHost(address)))) throw new Error(
|
|
69
|
+
if (addresses.length === 0) throw new Error("its SMTP host does not resolve");
|
|
70
|
+
if (!allowPrivateHosts && (isBlockedHost(smtp.host) || addresses.some(({ address }) => isBlockedHost(address)))) throw new Error("its SMTP host is on a private network, which this server does not connect to");
|
|
71
71
|
return (delivery) => deliver({
|
|
72
72
|
address: first.address,
|
|
73
73
|
smtp: delivery.smtp,
|
|
@@ -54,12 +54,17 @@ var emailTasks = [{
|
|
|
54
54
|
if (!stored) throw new Error(`This space has no SMTP credential called "${identifier}" — add it in Credentials`);
|
|
55
55
|
const reading = readSmtpCredential(stored);
|
|
56
56
|
if (!("settings" in reading)) throw new Error(`Credential "${identifier}" is not a usable SMTP server: ${reading.problems.map((problem) => `${problem.key} — ${problem.message}`).join("; ")}`);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
try {
|
|
58
|
+
await ctx.email.send(ctx.spaceId, reading.settings, {
|
|
59
|
+
to: recipient,
|
|
60
|
+
subject: title,
|
|
61
|
+
text,
|
|
62
|
+
...answerTo === "" ? {} : { replyTo: answerTo }
|
|
63
|
+
}, ctx.signal);
|
|
64
|
+
} catch (error) {
|
|
65
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
66
|
+
throw new Error(`Could not send through the SMTP credential "${identifier}": ${reason}`, { cause: error });
|
|
67
|
+
}
|
|
63
68
|
return { sent: true };
|
|
64
69
|
}
|
|
65
70
|
}];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/sdk-server",
|
|
3
|
-
"version": "0.35.
|
|
3
|
+
"version": "0.35.7",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"type": "module",
|
|
59
59
|
"sideEffects": false,
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@plitzi/plitzi-sdk": "0.35.
|
|
62
|
-
"@plitzi/sdk-shared": "0.35.
|
|
61
|
+
"@plitzi/plitzi-sdk": "0.35.7",
|
|
62
|
+
"@plitzi/sdk-shared": "0.35.7",
|
|
63
63
|
"ejs": "^6.0.1",
|
|
64
64
|
"esbuild": "^0.28.2",
|
|
65
65
|
"jsonwebtoken": "^9.0.3",
|