@samva/email-sdk 0.10.0 → 0.11.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.
- package/README.md +3 -3
- package/dist/index.d.mts +3 -5
- package/dist/index.mjs +3 -6
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# `@samva/email-sdk`
|
|
2
2
|
|
|
3
3
|
Provider-owned Samva community adapter for
|
|
4
|
-
[Email SDK](https://email-sdk.dev). It targets `@opencoredev/email-sdk@^
|
|
5
|
-
and `samva@^0.
|
|
4
|
+
[Email SDK](https://email-sdk.dev). It targets `@opencoredev/email-sdk@^3.0.1`
|
|
5
|
+
and `samva@^0.27.0`.
|
|
6
6
|
|
|
7
7
|
This adapter is maintained by Samva as a community integration; it is not an
|
|
8
8
|
official built-in Email SDK adapter.
|
|
@@ -10,7 +10,7 @@ official built-in Email SDK adapter.
|
|
|
10
10
|
## Install
|
|
11
11
|
|
|
12
12
|
```sh
|
|
13
|
-
bun add @samva/email-sdk @opencoredev/email-sdk samva
|
|
13
|
+
bun add @samva/email-sdk @opencoredev/email-sdk@^3.0.1 samva
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
## Register the adapter
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { EmailAdapter, EmailPlugin } from "@opencoredev/email-sdk";
|
|
2
2
|
import { SamvaClient } from "samva";
|
|
3
|
-
//#region src/samva.d.ts
|
|
4
3
|
/** Factory options for the provider-owned Samva community adapter. */
|
|
5
4
|
type SamvaAdapterOptions = {
|
|
6
5
|
/** Samva API key. Required unless `client` is injected. */
|
|
@@ -19,9 +18,8 @@ type SamvaSendResult = Awaited<ReturnType<SamvaClient["email"]["send"]>>;
|
|
|
19
18
|
/** The literal Email SDK adapter type returned by {@link samva}. */
|
|
20
19
|
type SamvaEmailAdapter = EmailAdapter<"samva", SamvaClient, SamvaSendResult>;
|
|
21
20
|
/** Create an Email SDK adapter backed by the Samva Promise client. */
|
|
22
|
-
declare function samva(options: SamvaAdapterOptions): SamvaEmailAdapter;
|
|
21
|
+
export declare function samva(options: SamvaAdapterOptions): SamvaEmailAdapter;
|
|
23
22
|
/** Register a single Samva adapter through Email SDK's plugin interface. */
|
|
24
|
-
declare function samvaPlugin(options: SamvaAdapterOptions): EmailPlugin;
|
|
25
|
-
|
|
26
|
-
export { type SamvaAdapterOptions, type SamvaEmailAdapter, type SamvaSendResult, samva, samvaPlugin };
|
|
23
|
+
export declare function samvaPlugin(options: SamvaAdapterOptions): EmailPlugin;
|
|
24
|
+
export type { SamvaAdapterOptions, SamvaEmailAdapter, SamvaSendResult };
|
|
27
25
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EmailAdapterError, EmailValidationError } from "@opencoredev/email-sdk";
|
|
2
2
|
import { createClient } from "samva";
|
|
3
|
-
|
|
3
|
+
// src/failures.ts
|
|
4
4
|
const knownNotSentTags = /* @__PURE__ */ new Set([
|
|
5
5
|
"ConflictError",
|
|
6
6
|
"DeliveryUnavailableError",
|
|
@@ -62,8 +62,7 @@ function toEmailAdapterError(error) {
|
|
|
62
62
|
delivery: deliveryOf(record)
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
|
-
|
|
66
|
-
//#region src/message.ts
|
|
65
|
+
// src/message.ts
|
|
67
66
|
const ordinaryEmail = /^[^\s@<>,]+@[^\s@<>,]+$/;
|
|
68
67
|
function validationError(field, detail) {
|
|
69
68
|
return new EmailValidationError(`Samva cannot send email with ${field}: ${detail}.`);
|
|
@@ -184,8 +183,7 @@ async function toSamvaMessage(message) {
|
|
|
184
183
|
...attachments.length === 0 ? {} : { attachments }
|
|
185
184
|
};
|
|
186
185
|
}
|
|
187
|
-
|
|
188
|
-
//#region src/samva.ts
|
|
186
|
+
// src/samva.ts
|
|
189
187
|
const capabilities = {
|
|
190
188
|
repeatedHeaders: false,
|
|
191
189
|
idempotency: "native",
|
|
@@ -248,7 +246,6 @@ function samvaPlugin(options) {
|
|
|
248
246
|
adapters: [samva(options)]
|
|
249
247
|
};
|
|
250
248
|
}
|
|
251
|
-
//#endregion
|
|
252
249
|
export { samva, samvaPlugin };
|
|
253
250
|
|
|
254
251
|
//# sourceMappingURL=index.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@samva/email-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Samva community adapter for Email SDK.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"email",
|
|
@@ -39,19 +39,19 @@
|
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
|
-
"build": "tsdown src/index.ts --format esm --dts --
|
|
42
|
+
"build": "tsdown src/index.ts --format esm --dts --deps.never-bundle samva --deps.never-bundle @opencoredev/email-sdk",
|
|
43
43
|
"prepack": "bun run build",
|
|
44
|
-
"dev": "tsdown src/index.ts --format esm --dts --watch --
|
|
44
|
+
"dev": "tsdown src/index.ts --format esm --dts --watch --deps.never-bundle samva --deps.never-bundle @opencoredev/email-sdk",
|
|
45
45
|
"typecheck": "tsgo --noEmit",
|
|
46
46
|
"test": "vitest run --config vitest.config.ts"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@opencoredev/email-sdk": "^
|
|
50
|
-
"samva": "0.
|
|
49
|
+
"@opencoredev/email-sdk": "^3.0.1",
|
|
50
|
+
"samva": "0.27.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"@opencoredev/email-sdk": "^
|
|
54
|
-
"samva": "^0.
|
|
53
|
+
"@opencoredev/email-sdk": "^3.0.1",
|
|
54
|
+
"samva": "^0.27.0"
|
|
55
55
|
},
|
|
56
56
|
"engines": {
|
|
57
57
|
"node": ">=22"
|