samva 0.1.1 → 0.3.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/AGENTS.md +1 -1
- package/README.md +10 -3
- package/dist/client/sdk.gen.d.ts +333 -188
- package/dist/client/types.gen.d.ts +1452 -718
- package/dist/{client-DVALvDUe.js → client-BOghX8fr.js} +1990 -1631
- package/dist/effect/api-keys.d.ts +14 -14
- package/dist/effect/api-keys.js +1 -1
- package/dist/effect/campaigns.d.ts +233 -861
- package/dist/effect/campaigns.js +1 -1
- package/dist/effect/categories.d.ts +1 -1
- package/dist/effect/client.js +1 -1
- package/dist/effect/contacts.d.ts +131 -231
- package/dist/effect/contacts.js +1 -1
- package/dist/effect/conversations.d.ts +91 -208
- package/dist/effect/conversations.js +1 -1
- package/dist/effect/design.d.ts +11 -11
- package/dist/effect/design.js +1 -1
- package/dist/effect/email.d.ts +164 -168
- package/dist/effect/email.js +20 -18
- package/dist/effect/generated.d.ts +13753 -14935
- package/dist/effect/index.d.ts +1 -0
- package/dist/effect/index.js +3 -2
- package/dist/effect/internal/operation.d.ts +15 -113
- package/dist/effect/media.d.ts +80 -0
- package/dist/effect/media.js +19 -0
- package/dist/effect/messages.d.ts +41 -261
- package/dist/effect/messages.js +1 -1
- package/dist/effect/operations.d.ts +10 -10
- package/dist/effect/operations.js +1 -1
- package/dist/effect/organizations.d.ts +24 -42
- package/dist/effect/organizations.js +1 -1
- package/dist/effect/scheduled-messages.d.ts +43 -502
- package/dist/effect/scheduled-messages.js +1 -1
- package/dist/effect/templates.d.ts +312 -1542
- package/dist/effect/templates.js +26 -18
- package/dist/effect/webhooks.d.ts +26 -27
- package/dist/effect/webhooks.js +2 -2
- package/dist/index.js +1 -1
- package/dist/{normalize-LkWl4HUF.js → normalize-BKFjbR9t.js} +5 -13
- package/dist/normalize.d.ts +3 -33
- package/dist/{operation-UtKNITtG.js → operation-C2Q4cFJL.js} +67 -26
- package/dist/promises/index.d.ts +6 -14
- package/dist/promises/index.js +1 -1
- package/dist/promises/types.gen.d.ts +1 -1
- package/dist/{promises-QxEfMTho.js → promises-oiy7mOyu.js} +680 -157
- package/dist/service-map.d.ts +92 -40
- package/package.json +19 -14
package/AGENTS.md
CHANGED
|
@@ -6,7 +6,7 @@ required.
|
|
|
6
6
|
|
|
7
7
|
Effect applications should import Pascal-cased domain modules from focused subpaths such as
|
|
8
8
|
`samva/effect/email` and provide `Client.layerFetch` from `samva/effect/client`. Install the optional
|
|
9
|
-
peer `effect@4.0.0-
|
|
9
|
+
peer `effect@4.0.0-rc.111` when using those entrypoints. Keep that exact release candidate pinned. Tagged API
|
|
10
10
|
failures remain in the Effect error channel and can be handled with `Effect.catchTag`.
|
|
11
11
|
|
|
12
12
|
Treat exported request and response types as the API contract. Do not import package-internal files
|
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ const messages = await client.messages.list({
|
|
|
65
65
|
Install `effect` next to `samva` when using the Effect entrypoint:
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
|
-
bun add samva effect@4.0.0-
|
|
68
|
+
bun add samva effect@4.0.0-rc.111
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
```typescript
|
|
@@ -124,6 +124,7 @@ The Promise client exposes:
|
|
|
124
124
|
- `conversations`
|
|
125
125
|
- `design`
|
|
126
126
|
- `email`
|
|
127
|
+
- `media`
|
|
127
128
|
- `messages`
|
|
128
129
|
- `operations`
|
|
129
130
|
- `organizations`
|
|
@@ -139,6 +140,7 @@ The Effect SDK exposes Pascal-cased domain modules with lower-camel operations:
|
|
|
139
140
|
- `Conversations`
|
|
140
141
|
- `Design`
|
|
141
142
|
- `Email`
|
|
143
|
+
- `Media`
|
|
142
144
|
- `Messages`
|
|
143
145
|
- `Operations`
|
|
144
146
|
- `Organizations`
|
|
@@ -148,6 +150,11 @@ The Effect SDK exposes Pascal-cased domain modules with lower-camel operations:
|
|
|
148
150
|
|
|
149
151
|
Effect operations take direct parameter objects: body, path, and query fields are not wrapped in `payload` or `params` envelopes. Import the modules you use from `samva/effect/<lower-kebab>` and provide `Client.layerFetch` once at the program boundary. `Client.raw` exposes the underlying generated client for advanced access, but ordinary workflows do not require it.
|
|
150
152
|
|
|
153
|
+
Email attachments use organization-owned media. Call `media.create`, upload the bytes with the
|
|
154
|
+
returned instruction, call `media.complete`, and pass the ready `mediaId` to `email.send` or
|
|
155
|
+
`messages.send`. A message accepts at most 10 attachments totaling 25 MiB of raw bytes; the same
|
|
156
|
+
budget covers inline base64 content and owned media references. Remote URL attachments are not.
|
|
157
|
+
|
|
151
158
|
Effect failures carry Samva's real tagged errors (`RateLimitedError`, `ValidationError`, `PaymentRequiredError`, …) directly in the error channel, so `Effect.catchTag("RateLimitedError", …)` works against any operation without enumerating status codes, and each error exposes its own fields (no wrapper `cause`). The SDK also exports category helpers such as `isRetryable`, `isTransient`, `catchAuthError`, and `catchTransient`. Success values decode to domain types: annotated absolute instants become `Date`, sensitive fields become `Redacted`, and unannotated wire timestamps remain strings.
|
|
152
159
|
|
|
153
160
|
### Default-on retry
|
|
@@ -369,8 +376,8 @@ subclass for failures declared by OpenAPI. Network and malformed-response failur
|
|
|
369
376
|
const result = await client.raw.messages.send({
|
|
370
377
|
body: {
|
|
371
378
|
to: [{ contactId: "contact-id" }],
|
|
372
|
-
channel: "
|
|
373
|
-
|
|
379
|
+
channel: "email",
|
|
380
|
+
email: { subject: "Hello", text: "Hello" },
|
|
374
381
|
},
|
|
375
382
|
});
|
|
376
383
|
|