samva 0.2.0 → 0.4.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 (51) hide show
  1. package/AGENTS.md +1 -1
  2. package/README.md +14 -3
  3. package/dist/client/sdk.gen.d.ts +321 -129
  4. package/dist/client/types.gen.d.ts +1818 -777
  5. package/dist/{client-BqkU-sFv.js → client-BmZK_uCt.js} +2699 -1839
  6. package/dist/client-attribution-BslSOa_8.js +9 -0
  7. package/dist/client-attribution.d.ts +2 -0
  8. package/dist/effect/api-keys.d.ts +51 -51
  9. package/dist/effect/api-keys.js +1 -1
  10. package/dist/effect/campaigns.d.ts +320 -1005
  11. package/dist/effect/campaigns.js +1 -1
  12. package/dist/effect/categories.d.ts +6 -6
  13. package/dist/effect/client.js +1 -1
  14. package/dist/effect/contacts.d.ts +292 -314
  15. package/dist/effect/contacts.js +1 -1
  16. package/dist/effect/conversations.d.ts +305 -437
  17. package/dist/effect/conversations.js +1 -1
  18. package/dist/effect/design.d.ts +74 -74
  19. package/dist/effect/design.js +1 -1
  20. package/dist/effect/email.d.ts +233 -265
  21. package/dist/effect/email.js +2 -2
  22. package/dist/effect/generated.d.ts +13410 -14526
  23. package/dist/effect/index.d.ts +1 -0
  24. package/dist/effect/index.js +3 -2
  25. package/dist/effect/internal/client.d.ts +1 -1
  26. package/dist/effect/internal/operation.d.ts +32 -129
  27. package/dist/effect/media.d.ts +80 -0
  28. package/dist/effect/media.js +19 -0
  29. package/dist/effect/messages.d.ts +90 -307
  30. package/dist/effect/messages.js +1 -1
  31. package/dist/effect/operations.d.ts +17 -17
  32. package/dist/effect/operations.js +1 -1
  33. package/dist/effect/organizations.d.ts +162 -180
  34. package/dist/effect/organizations.js +1 -1
  35. package/dist/effect/runtime.d.ts +0 -2
  36. package/dist/effect/scheduled-messages.d.ts +242 -639
  37. package/dist/effect/scheduled-messages.js +1 -1
  38. package/dist/effect/templates.d.ts +1376 -2033
  39. package/dist/effect/templates.js +40 -30
  40. package/dist/effect/webhooks.d.ts +53 -54
  41. package/dist/effect/webhooks.js +2 -2
  42. package/dist/index.js +1 -1
  43. package/dist/{normalize-LkWl4HUF.js → normalize-BiIJnycv.js} +6 -15
  44. package/dist/normalize.d.ts +3 -33
  45. package/dist/{operation-Ccqh_yxb.js → operation-B1knNlxk.js} +83 -38
  46. package/dist/promises/index.d.ts +13 -21
  47. package/dist/promises/index.js +1 -1
  48. package/dist/promises/types.gen.d.ts +1 -1
  49. package/dist/{promises-Dgv8UmCC.js → promises-n1opem5V.js} +572 -184
  50. package/dist/service-map.d.ts +96 -44
  51. package/package.json +23 -19
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.112` 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.112
69
69
  ```
70
70
 
71
71
  ```typescript
@@ -114,6 +114,10 @@ const client = createClient({
114
114
 
115
115
  For terminal workflows (`samva login`, `samva org use`, `samva email send --dry-run`), see the [`@samva/cli` README](https://github.com/AryaLabsHQ/samva/tree/main/packages/cli).
116
116
 
117
+ The Promise and Effect clients identify their public SDK surface and package version with the
118
+ advisory `x-samva-client` request header. Supply your own value in `headers`, or set the header to
119
+ `null` in Promise request options or `undefined` in Effect client configuration to omit it.
120
+
117
121
  ## Service Surface
118
122
 
119
123
  The Promise client exposes:
@@ -124,6 +128,7 @@ The Promise client exposes:
124
128
  - `conversations`
125
129
  - `design`
126
130
  - `email`
131
+ - `media`
127
132
  - `messages`
128
133
  - `operations`
129
134
  - `organizations`
@@ -139,6 +144,7 @@ The Effect SDK exposes Pascal-cased domain modules with lower-camel operations:
139
144
  - `Conversations`
140
145
  - `Design`
141
146
  - `Email`
147
+ - `Media`
142
148
  - `Messages`
143
149
  - `Operations`
144
150
  - `Organizations`
@@ -148,6 +154,11 @@ The Effect SDK exposes Pascal-cased domain modules with lower-camel operations:
148
154
 
149
155
  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
156
 
157
+ Email attachments use organization-owned media. Call `media.create`, upload the bytes with the
158
+ returned instruction, call `media.complete`, and pass the ready `mediaId` to `email.send` or
159
+ `messages.send`. A message accepts at most 10 attachments totaling 25 MiB of raw bytes; the same
160
+ budget covers inline base64 content and owned media references. Remote URL attachments are not.
161
+
151
162
  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
163
 
153
164
  ### Default-on retry
@@ -369,8 +380,8 @@ subclass for failures declared by OpenAPI. Network and malformed-response failur
369
380
  const result = await client.raw.messages.send({
370
381
  body: {
371
382
  to: [{ contactId: "contact-id" }],
372
- channel: "sms",
373
- sms: { text: "Hello" },
383
+ channel: "email",
384
+ email: { subject: "Hello", text: "Hello" },
374
385
  },
375
386
  });
376
387