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.
Files changed (47) hide show
  1. package/AGENTS.md +1 -1
  2. package/README.md +10 -3
  3. package/dist/client/sdk.gen.d.ts +333 -188
  4. package/dist/client/types.gen.d.ts +1452 -718
  5. package/dist/{client-DVALvDUe.js → client-BOghX8fr.js} +1990 -1631
  6. package/dist/effect/api-keys.d.ts +14 -14
  7. package/dist/effect/api-keys.js +1 -1
  8. package/dist/effect/campaigns.d.ts +233 -861
  9. package/dist/effect/campaigns.js +1 -1
  10. package/dist/effect/categories.d.ts +1 -1
  11. package/dist/effect/client.js +1 -1
  12. package/dist/effect/contacts.d.ts +131 -231
  13. package/dist/effect/contacts.js +1 -1
  14. package/dist/effect/conversations.d.ts +91 -208
  15. package/dist/effect/conversations.js +1 -1
  16. package/dist/effect/design.d.ts +11 -11
  17. package/dist/effect/design.js +1 -1
  18. package/dist/effect/email.d.ts +164 -168
  19. package/dist/effect/email.js +20 -18
  20. package/dist/effect/generated.d.ts +13753 -14935
  21. package/dist/effect/index.d.ts +1 -0
  22. package/dist/effect/index.js +3 -2
  23. package/dist/effect/internal/operation.d.ts +15 -113
  24. package/dist/effect/media.d.ts +80 -0
  25. package/dist/effect/media.js +19 -0
  26. package/dist/effect/messages.d.ts +41 -261
  27. package/dist/effect/messages.js +1 -1
  28. package/dist/effect/operations.d.ts +10 -10
  29. package/dist/effect/operations.js +1 -1
  30. package/dist/effect/organizations.d.ts +24 -42
  31. package/dist/effect/organizations.js +1 -1
  32. package/dist/effect/scheduled-messages.d.ts +43 -502
  33. package/dist/effect/scheduled-messages.js +1 -1
  34. package/dist/effect/templates.d.ts +312 -1542
  35. package/dist/effect/templates.js +26 -18
  36. package/dist/effect/webhooks.d.ts +26 -27
  37. package/dist/effect/webhooks.js +2 -2
  38. package/dist/index.js +1 -1
  39. package/dist/{normalize-LkWl4HUF.js → normalize-BKFjbR9t.js} +5 -13
  40. package/dist/normalize.d.ts +3 -33
  41. package/dist/{operation-UtKNITtG.js → operation-C2Q4cFJL.js} +67 -26
  42. package/dist/promises/index.d.ts +6 -14
  43. package/dist/promises/index.js +1 -1
  44. package/dist/promises/types.gen.d.ts +1 -1
  45. package/dist/{promises-QxEfMTho.js → promises-oiy7mOyu.js} +680 -157
  46. package/dist/service-map.d.ts +92 -40
  47. 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-beta.102` when using those entrypoints. Keep that exact beta pinned. Tagged API
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-beta.102
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: "sms",
373
- sms: { text: "Hello" },
379
+ channel: "email",
380
+ email: { subject: "Hello", text: "Hello" },
374
381
  },
375
382
  });
376
383