@mitumba/sdk 1.30.1 → 1.32.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 +21 -1
- package/dist/index.d.mts +906 -22
- package/dist/index.d.ts +906 -22
- package/dist/index.js +791 -46
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +785 -47
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@ mitumba.setToken('eyJhbGciOiJIUzI1...', 'my-refresh-token-hex')
|
|
|
42
42
|
|
|
43
43
|
## API Overview
|
|
44
44
|
|
|
45
|
-
The SDK
|
|
45
|
+
The SDK exposes typed domain modules for the complete marketplace API.
|
|
46
46
|
|
|
47
47
|
### 1. Auth Module (`mitumba.auth`)
|
|
48
48
|
|
|
@@ -153,6 +153,26 @@ const feed = await mitumba.vazi.getFeed({ limit: 10, offset: 0 })
|
|
|
153
153
|
const { outfits } = await mitumba.vazi.completeOutfit('lst_123')
|
|
154
154
|
```
|
|
155
155
|
|
|
156
|
+
### Messaging (`mitumba.messages`)
|
|
157
|
+
|
|
158
|
+
Use explicit buyer/store perspectives and stable commerce-thread IDs:
|
|
159
|
+
|
|
160
|
+
```typescript
|
|
161
|
+
const perspective = { kind: 'buyer' } as const
|
|
162
|
+
const resolved = await mitumba.messages.resolveThread(
|
|
163
|
+
perspective,
|
|
164
|
+
{ kind: 'listing', store_id: 'store_123', listing_id: 'listing_456' },
|
|
165
|
+
{ idempotencyKey: 'listing-456' },
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
await mitumba.messages.sendThreadMessage(perspective, resolved.thread.id, {
|
|
169
|
+
client_message_id: crypto.randomUUID(),
|
|
170
|
+
body: 'Is this available?',
|
|
171
|
+
})
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Managed realtime uses short-lived one-use tickets and supports an injected `webSocketFactory` for non-browser runtimes. Private attachments are capability-gated. See [the Messaging v2 migration guide](./MESSAGING_V2_MIGRATION.md) and [API reference](./API_REFERENCE.md#messages-module-notify).
|
|
175
|
+
|
|
156
176
|
## Error Handling
|
|
157
177
|
|
|
158
178
|
All API errors are wrapped in a standard `APIError` object.
|