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.
- package/AGENTS.md +1 -1
- package/README.md +14 -3
- package/dist/client/sdk.gen.d.ts +321 -129
- package/dist/client/types.gen.d.ts +1818 -777
- package/dist/{client-BqkU-sFv.js → client-BmZK_uCt.js} +2699 -1839
- package/dist/client-attribution-BslSOa_8.js +9 -0
- package/dist/client-attribution.d.ts +2 -0
- package/dist/effect/api-keys.d.ts +51 -51
- package/dist/effect/api-keys.js +1 -1
- package/dist/effect/campaigns.d.ts +320 -1005
- package/dist/effect/campaigns.js +1 -1
- package/dist/effect/categories.d.ts +6 -6
- package/dist/effect/client.js +1 -1
- package/dist/effect/contacts.d.ts +292 -314
- package/dist/effect/contacts.js +1 -1
- package/dist/effect/conversations.d.ts +305 -437
- package/dist/effect/conversations.js +1 -1
- package/dist/effect/design.d.ts +74 -74
- package/dist/effect/design.js +1 -1
- package/dist/effect/email.d.ts +233 -265
- package/dist/effect/email.js +2 -2
- package/dist/effect/generated.d.ts +13410 -14526
- package/dist/effect/index.d.ts +1 -0
- package/dist/effect/index.js +3 -2
- package/dist/effect/internal/client.d.ts +1 -1
- package/dist/effect/internal/operation.d.ts +32 -129
- package/dist/effect/media.d.ts +80 -0
- package/dist/effect/media.js +19 -0
- package/dist/effect/messages.d.ts +90 -307
- package/dist/effect/messages.js +1 -1
- package/dist/effect/operations.d.ts +17 -17
- package/dist/effect/operations.js +1 -1
- package/dist/effect/organizations.d.ts +162 -180
- package/dist/effect/organizations.js +1 -1
- package/dist/effect/runtime.d.ts +0 -2
- package/dist/effect/scheduled-messages.d.ts +242 -639
- package/dist/effect/scheduled-messages.js +1 -1
- package/dist/effect/templates.d.ts +1376 -2033
- package/dist/effect/templates.js +40 -30
- package/dist/effect/webhooks.d.ts +53 -54
- package/dist/effect/webhooks.js +2 -2
- package/dist/index.js +1 -1
- package/dist/{normalize-LkWl4HUF.js → normalize-BiIJnycv.js} +6 -15
- package/dist/normalize.d.ts +3 -33
- package/dist/{operation-Ccqh_yxb.js → operation-B1knNlxk.js} +83 -38
- package/dist/promises/index.d.ts +13 -21
- package/dist/promises/index.js +1 -1
- package/dist/promises/types.gen.d.ts +1 -1
- package/dist/{promises-Dgv8UmCC.js → promises-n1opem5V.js} +572 -184
- package/dist/service-map.d.ts +96 -44
- 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-
|
|
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-
|
|
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: "
|
|
373
|
-
|
|
383
|
+
channel: "email",
|
|
384
|
+
email: { subject: "Hello", text: "Hello" },
|
|
374
385
|
},
|
|
375
386
|
});
|
|
376
387
|
|