@primitivedotdev/sdk 1.22.0 → 1.23.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 +12 -12
- package/dist/api/index.d.ts +5 -5
- package/dist/api/index.js +4 -4
- package/dist/{api-Oi6Mo4Us.js → api-mauNzbhi.js} +237 -11
- package/dist/contract/index.d.ts +2 -2
- package/dist/contract/index.js +1 -1
- package/dist/{errors-DAHv2kWU.d.ts → errors-BgI9FKHK.d.ts} +1 -1
- package/dist/{errors-D6WjisrD.js → errors-Bo0f7eId.js} +1 -1
- package/dist/{index-CAwgOxWk.d.ts → index-C11B41Hb.d.ts} +982 -12
- package/dist/{index-DJeUuGUn.d.ts → index-fS1gVNuX.d.ts} +3 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/openapi/index.d.ts +1 -1
- package/dist/openapi/index.js +1 -1
- package/dist/{operations.generated-CqlK_7LO.js → operations.generated-COaLBzbH.js} +5318 -2388
- package/dist/parser/address.d.ts +1 -1
- package/dist/parser/address.js +1 -1
- package/dist/parser/index.d.ts +2 -2
- package/dist/parser/index.js +1 -1
- package/dist/payloads/index.js +1 -391
- package/dist/payloads-CQtSsUT6.js +409 -0
- package/dist/{types-DVjBmOg0.d.ts → types-DcXtFARL.d.ts} +1 -1
- package/dist/webhook/index.d.ts +3 -3
- package/dist/webhook/index.js +2 -2
- package/dist/{webhook-1cz088XC.js → webhook-BtyuJtUF.js} +2 -2
- package/package.json +7 -6
- /package/dist/{address-parser-CQbFjgRC.js → address-parser-C2JJzLdA.js} +0 -0
- /package/dist/{address-parser-CA6G7R-h.d.ts → address-parser-CJqzx713.d.ts} +0 -0
- /package/dist/{operations.generated-BAniFZK9.d.ts → operations.generated-DJS4dWr7.d.ts} +0 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./chunk-pbuEa-1d.js";
|
|
2
|
-
import { pushBytes,
|
|
3
|
-
import { S as formatAddress, c as WebhookVerificationError } from "./errors-
|
|
4
|
-
import { readFile, stat } from "node:fs/promises";
|
|
2
|
+
import { a as pushFile, i as pushBytes, o as loadNodeFsPromises } from "./payloads-CQtSsUT6.js";
|
|
3
|
+
import { S as formatAddress, c as WebhookVerificationError } from "./errors-Bo0f7eId.js";
|
|
5
4
|
//#region ../packages/api-core/src/api/core/bodySerializer.gen.ts
|
|
6
5
|
const jsonBodySerializer = { bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value) };
|
|
7
6
|
//#endregion
|
|
@@ -607,7 +606,11 @@ const client$1 = createClient(createConfig({ baseUrl: "https://api.primitive.dev
|
|
|
607
606
|
//#region ../packages/api-core/src/api/sdk.gen.ts
|
|
608
607
|
var sdk_gen_exports = /* @__PURE__ */ __exportAll({
|
|
609
608
|
addDomain: () => addDomain,
|
|
609
|
+
awaitReply: () => awaitReply,
|
|
610
|
+
cancelSentEmail: () => cancelSentEmail,
|
|
611
|
+
checkDomainDns: () => checkDomainDns,
|
|
610
612
|
cliLogout: () => cliLogout,
|
|
613
|
+
completeWebhookEvent: () => completeWebhookEvent,
|
|
611
614
|
createAgentAccount: () => createAgentAccount,
|
|
612
615
|
createAgentClaimLink: () => createAgentClaimLink,
|
|
613
616
|
createChallenge: () => createChallenge,
|
|
@@ -650,6 +653,7 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
|
|
|
650
653
|
getInboxStatus: () => getInboxStatus,
|
|
651
654
|
getMemory: () => getMemory,
|
|
652
655
|
getOrgRoutingTopology: () => getOrgRoutingTopology,
|
|
656
|
+
getOutboundStatus: () => getOutboundStatus,
|
|
653
657
|
getRegistry: () => getRegistry,
|
|
654
658
|
getSendPermissions: () => getSendPermissions,
|
|
655
659
|
getSentEmail: () => getSentEmail,
|
|
@@ -684,11 +688,13 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
|
|
|
684
688
|
payChallenge: () => payChallenge,
|
|
685
689
|
pollCliLogin: () => pollCliLogin,
|
|
686
690
|
publishAgent: () => publishAgent,
|
|
691
|
+
pullWebhookEvent: () => pullWebhookEvent,
|
|
687
692
|
registerPayoutAddress: () => registerPayoutAddress,
|
|
688
693
|
reorderRoutes: () => reorderRoutes,
|
|
689
694
|
replayDelivery: () => replayDelivery,
|
|
690
695
|
replayEmailWebhooks: () => replayEmailWebhooks,
|
|
691
696
|
replyToEmail: () => replyToEmail,
|
|
697
|
+
rescheduleSentEmail: () => rescheduleSentEmail,
|
|
692
698
|
resendAgentSignupVerification: () => resendAgentSignupVerification,
|
|
693
699
|
resendCliSignupVerification: () => resendCliSignupVerification,
|
|
694
700
|
resolveRegistryHandle: () => resolveRegistryHandle,
|
|
@@ -708,6 +714,7 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
|
|
|
708
714
|
startCliLogin: () => startCliLogin,
|
|
709
715
|
startCliSignup: () => startCliSignup,
|
|
710
716
|
testEndpoint: () => testEndpoint,
|
|
717
|
+
testEndpointRules: () => testEndpointRules,
|
|
711
718
|
testFunction: () => testFunction,
|
|
712
719
|
unpublishAgent: () => unpublishAgent,
|
|
713
720
|
unsetFunctionRoute: () => unsetFunctionRoute,
|
|
@@ -1148,6 +1155,34 @@ const verifyDomain = (options) => (options.client ?? client$1).post({
|
|
|
1148
1155
|
...options
|
|
1149
1156
|
});
|
|
1150
1157
|
/**
|
|
1158
|
+
* Run an on-demand DNS health check
|
|
1159
|
+
*
|
|
1160
|
+
* Re-checks the domain's DNS records and persists the result as
|
|
1161
|
+
* the domain's current DNS health state. This is the on-demand
|
|
1162
|
+
* counterpart of the scheduled background checker: the response
|
|
1163
|
+
* mirrors what the checker records, broken down per scope
|
|
1164
|
+
* (`ownership`, `inbound`, `outbound`) with the exact records
|
|
1165
|
+
* inspected and each record's individual status.
|
|
1166
|
+
*
|
|
1167
|
+
* Unlike /domains/{id}/verify, this call never promotes an
|
|
1168
|
+
* unverified domain; it only re-evaluates and records health for
|
|
1169
|
+
* an existing claim. Managed (Primitive-operated) domains are
|
|
1170
|
+
* rejected with a validation error because their DNS is not
|
|
1171
|
+
* customer-published.
|
|
1172
|
+
*
|
|
1173
|
+
* Rate limited per organization; a `Retry-After` header
|
|
1174
|
+
* accompanies 429 responses.
|
|
1175
|
+
*
|
|
1176
|
+
*/
|
|
1177
|
+
const checkDomainDns = (options) => (options.client ?? client$1).post({
|
|
1178
|
+
security: [{
|
|
1179
|
+
scheme: "bearer",
|
|
1180
|
+
type: "http"
|
|
1181
|
+
}],
|
|
1182
|
+
url: "/domains/{id}/dns/check",
|
|
1183
|
+
...options
|
|
1184
|
+
});
|
|
1185
|
+
/**
|
|
1151
1186
|
* Download domain DNS zone file
|
|
1152
1187
|
*
|
|
1153
1188
|
* Downloads a BIND-format DNS zone file containing the DNS records
|
|
@@ -1460,6 +1495,8 @@ const listEndpoints = (options) => (options?.client ?? client$1).get({
|
|
|
1460
1495
|
* it via `POST /endpoints/{id}/test` to confirm your verifier
|
|
1461
1496
|
* accepts the signature.
|
|
1462
1497
|
*
|
|
1498
|
+
*
|
|
1499
|
+
* For local receiving, use kind=pull and a stable name, without url, function_id or domain_id. Named creation resumes the same active destination; omitted filters preserve its selection, while conflicting supplied configuration returns 409. New unfiltered destinations receive all subsequently ready eligible event types. Pull destinations do not occupy HTTP routing slots. Signing-secret setup and a test HTTP delivery are not required for pull receiving.
|
|
1463
1500
|
*/
|
|
1464
1501
|
const createEndpoint = (options) => (options.client ?? client$1).post({
|
|
1465
1502
|
security: [{
|
|
@@ -1495,6 +1532,8 @@ const deleteEndpoint = (options) => (options.client ?? client$1).delete({
|
|
|
1495
1532
|
* endpoint is deactivated and a new one is created (or an existing
|
|
1496
1533
|
* deactivated endpoint with the new URL is reactivated).
|
|
1497
1534
|
*
|
|
1535
|
+
*
|
|
1536
|
+
* Pull destinations cannot be assigned a URL, function or recipient-routing domain. Existing endpoint deletion disconnects the destination; creating a new destination does not backfill historical events.
|
|
1498
1537
|
*/
|
|
1499
1538
|
const updateEndpoint = (options) => (options.client ?? client$1).patch({
|
|
1500
1539
|
security: [{
|
|
@@ -1509,6 +1548,40 @@ const updateEndpoint = (options) => (options.client ?? client$1).patch({
|
|
|
1509
1548
|
}
|
|
1510
1549
|
});
|
|
1511
1550
|
/**
|
|
1551
|
+
* Receive a pending webhook event without a public endpoint
|
|
1552
|
+
*
|
|
1553
|
+
* Wait up to 30 seconds for one existing event. The body string preserves the exact webhook serialization; headers and canonical occurrence/type metadata travel alongside it. A fixed lease protects the attempt while a short handler accepts input. Retry may redeliver an occurrence: deduplicate event_id. Empty delivery means no offer now, not proof all input was delivered; inspect backlog and persistent gap_count/last_gap_reason. Queue retention is 24 hours and does not extend source-content retention. Disconnecting preserves pending work. Same named destination shares consumption; different destinations get independent copies.
|
|
1554
|
+
*/
|
|
1555
|
+
const pullWebhookEvent = (options) => (options.client ?? client$1).post({
|
|
1556
|
+
security: [{
|
|
1557
|
+
scheme: "bearer",
|
|
1558
|
+
type: "http"
|
|
1559
|
+
}],
|
|
1560
|
+
url: "/endpoints/{id}/pull",
|
|
1561
|
+
...options,
|
|
1562
|
+
headers: {
|
|
1563
|
+
...options.body !== void 0 && { "Content-Type": "application/json" },
|
|
1564
|
+
...options.headers
|
|
1565
|
+
}
|
|
1566
|
+
});
|
|
1567
|
+
/**
|
|
1568
|
+
* Report the outcome of a local webhook delivery attempt
|
|
1569
|
+
*
|
|
1570
|
+
* Report normalized handling evidence for the queue, attempt and lease. Required JSON fields: queue_id, delivery_id, lease_token, mode, duration_ms. For mode=exec include exit_code; stdout includes write_succeeded; http includes status_code and optional transport_error, error_code, confirmed. Supply this discriminated request with --raw-body in the generated CLI. The server classifies success and retry. Duplicate identical completion is idempotent; a stale lease cannot finish a newer attempt. Exec success means durable input acceptance, not completion of agent reasoning. Only successful HTTP handling with recognized confirmation evidence can confirm content discard. Never send arbitrary handler output or HTTP response bodies.
|
|
1571
|
+
*/
|
|
1572
|
+
const completeWebhookEvent = (options) => (options.client ?? client$1).post({
|
|
1573
|
+
security: [{
|
|
1574
|
+
scheme: "bearer",
|
|
1575
|
+
type: "http"
|
|
1576
|
+
}],
|
|
1577
|
+
url: "/endpoints/{id}/complete",
|
|
1578
|
+
...options,
|
|
1579
|
+
headers: {
|
|
1580
|
+
...options.body !== void 0 && { "Content-Type": "application/json" },
|
|
1581
|
+
...options.headers
|
|
1582
|
+
}
|
|
1583
|
+
});
|
|
1584
|
+
/**
|
|
1512
1585
|
* Send a test webhook
|
|
1513
1586
|
*
|
|
1514
1587
|
* Sends a sample `email.received` event to the endpoint. The request
|
|
@@ -1527,6 +1600,43 @@ const testEndpoint = (options) => (options.client ?? client$1).post({
|
|
|
1527
1600
|
...options
|
|
1528
1601
|
});
|
|
1529
1602
|
/**
|
|
1603
|
+
* Dry-run endpoint rules against a received email
|
|
1604
|
+
*
|
|
1605
|
+
* Evaluates the endpoint's filtering rules against an
|
|
1606
|
+
* already-received email WITHOUT delivering anything. The same
|
|
1607
|
+
* shared matcher the live delivery paths use produces the
|
|
1608
|
+
* verdict, so the response explains exactly why a webhook fired
|
|
1609
|
+
* or was suppressed for that message.
|
|
1610
|
+
*
|
|
1611
|
+
* When delivery would be suppressed, `rule` names the failing
|
|
1612
|
+
* rule and `reason` carries a human-readable explanation; both
|
|
1613
|
+
* are null when the message matches. `evaluated` echoes the
|
|
1614
|
+
* message metadata the matcher compared (size, attachments, and
|
|
1615
|
+
* the authenticated From identity versus the raw envelope
|
|
1616
|
+
* sender), so a surprising verdict can be traced to its inputs.
|
|
1617
|
+
*
|
|
1618
|
+
* Two independent gates are surfaced separately:
|
|
1619
|
+
* `subscribed_to_event` reports the endpoint's event-type
|
|
1620
|
+
* subscription (checked before message matching), and
|
|
1621
|
+
* `rules_valid` reports whether the stored rules blob parsed at
|
|
1622
|
+
* all. Delivery fails OPEN on an invalid blob (the message is
|
|
1623
|
+
* delivered as if unfiltered), so `rules_valid: false` exposes a
|
|
1624
|
+
* misconfiguration that is otherwise silent.
|
|
1625
|
+
*
|
|
1626
|
+
*/
|
|
1627
|
+
const testEndpointRules = (options) => (options.client ?? client$1).post({
|
|
1628
|
+
security: [{
|
|
1629
|
+
scheme: "bearer",
|
|
1630
|
+
type: "http"
|
|
1631
|
+
}],
|
|
1632
|
+
url: "/endpoints/{id}/rules/test",
|
|
1633
|
+
...options,
|
|
1634
|
+
headers: {
|
|
1635
|
+
...options.body !== void 0 && { "Content-Type": "application/json" },
|
|
1636
|
+
...options.headers
|
|
1637
|
+
}
|
|
1638
|
+
});
|
|
1639
|
+
/**
|
|
1530
1640
|
* List filter rules
|
|
1531
1641
|
*
|
|
1532
1642
|
* Returns all whitelist and blocklist filter rules.
|
|
@@ -1975,10 +2085,6 @@ const sendEmail = (options) => (options.client ?? client$1).post({
|
|
|
1975
2085
|
* Requires the Pro plan and the `semantic_search_enabled`
|
|
1976
2086
|
* entitlement; callers without them receive `403`.
|
|
1977
2087
|
*
|
|
1978
|
-
* Host routing: this operation is served only by the search host
|
|
1979
|
-
* (`https://api.primitive.dev/v1`). The typed SDKs route it there
|
|
1980
|
-
* automatically.
|
|
1981
|
-
*
|
|
1982
2088
|
*/
|
|
1983
2089
|
const semanticSearch = (options) => (options.client ?? client$1).post({
|
|
1984
2090
|
security: [{
|
|
@@ -1993,6 +2099,33 @@ const semanticSearch = (options) => (options.client ?? client$1).post({
|
|
|
1993
2099
|
}
|
|
1994
2100
|
});
|
|
1995
2101
|
/**
|
|
2102
|
+
* Get outbound sending readiness
|
|
2103
|
+
*
|
|
2104
|
+
* The "what can I send From?" bootstrap, the outbound mirror of
|
|
2105
|
+
* /inbox/status. Returns per-domain sending readiness for every
|
|
2106
|
+
* domain in the caller's org, plus the flat `sendable_domains`
|
|
2107
|
+
* list of From-domains the org may send from right now. That
|
|
2108
|
+
* list is the same set echoed in a `cannot_send_from_domain`
|
|
2109
|
+
* error's details, so orienting here before a send and
|
|
2110
|
+
* recovering from that error use identical data.
|
|
2111
|
+
*
|
|
2112
|
+
* Each domain's `status` collapses the sending prerequisites
|
|
2113
|
+
* into one actionable state: `sendable`, `pending_ownership`
|
|
2114
|
+
* (ownership TXT not verified), `pending_outbound_dns`
|
|
2115
|
+
* (SPF/DKIM/DMARC not verified), or `inactive` (domain
|
|
2116
|
+
* deactivated). `next_actions` lists concrete remediation steps,
|
|
2117
|
+
* each with a suggested CLI command where one exists.
|
|
2118
|
+
*
|
|
2119
|
+
*/
|
|
2120
|
+
const getOutboundStatus = (options) => (options?.client ?? client$1).get({
|
|
2121
|
+
security: [{
|
|
2122
|
+
scheme: "bearer",
|
|
2123
|
+
type: "http"
|
|
2124
|
+
}],
|
|
2125
|
+
url: "/outbound/status",
|
|
2126
|
+
...options
|
|
2127
|
+
});
|
|
2128
|
+
/**
|
|
1996
2129
|
* List outbound sent emails
|
|
1997
2130
|
*
|
|
1998
2131
|
* Returns a paginated list of OUTBOUND emails the caller's
|
|
@@ -2042,6 +2175,90 @@ const getSentEmail = (options) => (options.client ?? client$1).get({
|
|
|
2042
2175
|
...options
|
|
2043
2176
|
});
|
|
2044
2177
|
/**
|
|
2178
|
+
* Reschedule a scheduled send
|
|
2179
|
+
*
|
|
2180
|
+
* Moves a STILL-SCHEDULED send (status `scheduled`) to a new
|
|
2181
|
+
* execution time. The new `scheduled_at` must be in the future
|
|
2182
|
+
* and at most 30 days out, the same bounds as the create-time
|
|
2183
|
+
* field on /send-mail.
|
|
2184
|
+
*
|
|
2185
|
+
* The update is a compare-and-swap on `status = 'scheduled'`:
|
|
2186
|
+
* once the scheduler has claimed the row for execution, or it
|
|
2187
|
+
* was already canceled or executed, the update loses and the
|
|
2188
|
+
* call returns a 409 `not_scheduled` conflict naming the row's
|
|
2189
|
+
* current status. A due send can therefore never be moved out
|
|
2190
|
+
* from under an in-progress execution.
|
|
2191
|
+
*
|
|
2192
|
+
* Returns the full updated sent-email record on success.
|
|
2193
|
+
*
|
|
2194
|
+
*/
|
|
2195
|
+
const rescheduleSentEmail = (options) => (options.client ?? client$1).patch({
|
|
2196
|
+
security: [{
|
|
2197
|
+
scheme: "bearer",
|
|
2198
|
+
type: "http"
|
|
2199
|
+
}],
|
|
2200
|
+
url: "/sent-emails/{id}",
|
|
2201
|
+
...options,
|
|
2202
|
+
headers: {
|
|
2203
|
+
...options.body !== void 0 && { "Content-Type": "application/json" },
|
|
2204
|
+
...options.headers
|
|
2205
|
+
}
|
|
2206
|
+
});
|
|
2207
|
+
/**
|
|
2208
|
+
* Cancel a scheduled send
|
|
2209
|
+
*
|
|
2210
|
+
* Cancels a STILL-SCHEDULED send (status `scheduled`), moving it
|
|
2211
|
+
* to the terminal `canceled` status. Nothing is dispatched and
|
|
2212
|
+
* the row is kept for historical lookup with `canceled_at` set.
|
|
2213
|
+
*
|
|
2214
|
+
* Uses the same compare-and-swap guard as reschedule: once the
|
|
2215
|
+
* scheduler has claimed the row for execution, or it was already
|
|
2216
|
+
* canceled or executed, the call returns a 409 `not_scheduled`
|
|
2217
|
+
* conflict naming the row's current status. Canceling can
|
|
2218
|
+
* therefore never race an in-progress execution; a send that
|
|
2219
|
+
* reports `canceled` was never handed to the delivery path.
|
|
2220
|
+
*
|
|
2221
|
+
* Returns the full updated sent-email record on success.
|
|
2222
|
+
*
|
|
2223
|
+
*/
|
|
2224
|
+
const cancelSentEmail = (options) => (options.client ?? client$1).post({
|
|
2225
|
+
security: [{
|
|
2226
|
+
scheme: "bearer",
|
|
2227
|
+
type: "http"
|
|
2228
|
+
}],
|
|
2229
|
+
url: "/sent-emails/{id}/cancel",
|
|
2230
|
+
...options
|
|
2231
|
+
});
|
|
2232
|
+
/**
|
|
2233
|
+
* Get (or wait for) the reply to a sent email
|
|
2234
|
+
*
|
|
2235
|
+
* Returns the first threaded inbound reply to a send, keyed by
|
|
2236
|
+
* the inbound email's `reply_to_sent_email_id`. This is the
|
|
2237
|
+
* canonical "did a reply arrive for this send?" call: after
|
|
2238
|
+
* /send-mail, poll (or long-poll) here instead of hand-rolling
|
|
2239
|
+
* an /emails/search loop.
|
|
2240
|
+
*
|
|
2241
|
+
* By default the call returns immediately with `reply: null`
|
|
2242
|
+
* when nothing has arrived yet. Set `wait=true` to long-poll:
|
|
2243
|
+
* the server holds the request up to `wait_timeout_ms`
|
|
2244
|
+
* (default 10000, max 30000), returning as soon as the first
|
|
2245
|
+
* reply lands. On a wait that elapses with no reply, the
|
|
2246
|
+
* response has `reply: null` and `timed_out: true`.
|
|
2247
|
+
*
|
|
2248
|
+
* The reply object is compact (headers plus bodies); fetch
|
|
2249
|
+
* `/emails/{id}` with `reply.id` for the fully parsed record,
|
|
2250
|
+
* or `/threads/{thread_id}` for the whole back-and-forth.
|
|
2251
|
+
*
|
|
2252
|
+
*/
|
|
2253
|
+
const awaitReply = (options) => (options.client ?? client$1).get({
|
|
2254
|
+
security: [{
|
|
2255
|
+
scheme: "bearer",
|
|
2256
|
+
type: "http"
|
|
2257
|
+
}],
|
|
2258
|
+
url: "/sent-emails/{id}/reply",
|
|
2259
|
+
...options
|
|
2260
|
+
});
|
|
2261
|
+
/**
|
|
2045
2262
|
* Get a conversation thread by id
|
|
2046
2263
|
*
|
|
2047
2264
|
* Returns a conversation thread: its metadata plus the inbound
|
|
@@ -3282,6 +3499,11 @@ function validateSendInput(input) {
|
|
|
3282
3499
|
if (!Number.isInteger(input.waitTimeoutMs)) throw new TypeError("waitTimeoutMs must be an integer");
|
|
3283
3500
|
if (input.waitTimeoutMs < 1e3 || input.waitTimeoutMs > 3e4) throw new TypeError("waitTimeoutMs must be between 1000 and 30000");
|
|
3284
3501
|
}
|
|
3502
|
+
if (input.scheduledAt !== void 0) {
|
|
3503
|
+
if (Number.isNaN(Date.parse(input.scheduledAt))) throw new TypeError("scheduledAt must be an ISO 8601 date-time string");
|
|
3504
|
+
if (input.wait === true) throw new TypeError("wait cannot be combined with scheduledAt (a scheduled send resolves after this request completes)");
|
|
3505
|
+
if (input.attachments?.length || input.payloadAttachments?.length) throw new TypeError("attachments are not supported on scheduled sends yet; use an immediate send");
|
|
3506
|
+
}
|
|
3285
3507
|
}
|
|
3286
3508
|
function validateForwardInput(input) {
|
|
3287
3509
|
validateEmailAddress("to", input.to);
|
|
@@ -3705,7 +3927,8 @@ var PrimitiveClient = class extends PrimitiveApiClient {
|
|
|
3705
3927
|
...ref.contentType !== void 0 ? { content_type: ref.contentType } : {}
|
|
3706
3928
|
})) } : {},
|
|
3707
3929
|
...input.wait !== void 0 ? { wait: input.wait } : {},
|
|
3708
|
-
...input.waitTimeoutMs !== void 0 ? { wait_timeout_ms: input.waitTimeoutMs } : {}
|
|
3930
|
+
...input.waitTimeoutMs !== void 0 ? { wait_timeout_ms: input.waitTimeoutMs } : {},
|
|
3931
|
+
...input.scheduledAt !== void 0 ? { scheduled_at: input.scheduledAt } : {}
|
|
3709
3932
|
},
|
|
3710
3933
|
...resolveRequestOptions(options),
|
|
3711
3934
|
client: this.client,
|
|
@@ -3738,6 +3961,7 @@ var PrimitiveClient = class extends PrimitiveApiClient {
|
|
|
3738
3961
|
};
|
|
3739
3962
|
if (attachment.content !== void 0) return attachment.content.length <= threshold ? this.#sendInline(rest, meta, attachment.content, options) : this.#sendByReference(rest, meta, await pushBytes(attachment.content, this.#pushOptions()), options);
|
|
3740
3963
|
if (attachment.path !== void 0) {
|
|
3964
|
+
const { readFile, stat } = await loadNodeFsPromises("sendAttachment with attachment.path");
|
|
3741
3965
|
const { size } = await stat(attachment.path);
|
|
3742
3966
|
return size <= threshold ? this.#sendInline(rest, meta, await readFile(attachment.path), options) : this.#sendByReference(rest, meta, await pushFile(attachment.path, this.#pushOptions()), options);
|
|
3743
3967
|
}
|
|
@@ -3813,7 +4037,8 @@ var PrimitiveClient = class extends PrimitiveApiClient {
|
|
|
3813
4037
|
from: input.from ?? email.receivedBy,
|
|
3814
4038
|
to: input.to,
|
|
3815
4039
|
subject: input.subject ?? email.forwardSubject,
|
|
3816
|
-
bodyText: buildForwardText(email, input.bodyText)
|
|
4040
|
+
bodyText: buildForwardText(email, input.bodyText),
|
|
4041
|
+
...input.scheduledAt !== void 0 ? { scheduledAt: input.scheduledAt } : {}
|
|
3817
4042
|
}, options);
|
|
3818
4043
|
}
|
|
3819
4044
|
};
|
|
@@ -3872,7 +4097,8 @@ function mapSendResult(result) {
|
|
|
3872
4097
|
idempotentReplay: result.idempotent_replay ?? false,
|
|
3873
4098
|
...result.delivery_status !== void 0 ? { deliveryStatus: result.delivery_status } : {},
|
|
3874
4099
|
...result.smtp_response_code !== void 0 ? { smtpResponseCode: result.smtp_response_code } : {},
|
|
3875
|
-
...result.smtp_response_text !== void 0 ? { smtpResponseText: result.smtp_response_text } : {}
|
|
4100
|
+
...result.smtp_response_text !== void 0 ? { smtpResponseText: result.smtp_response_text } : {},
|
|
4101
|
+
...result.scheduled_at !== void 0 ? { scheduledAt: result.scheduled_at } : {}
|
|
3876
4102
|
};
|
|
3877
4103
|
}
|
|
3878
4104
|
function unwrapSemanticSearchResult(result) {
|
|
@@ -3952,4 +4178,4 @@ async function createAgent(options) {
|
|
|
3952
4178
|
};
|
|
3953
4179
|
}
|
|
3954
4180
|
//#endregion
|
|
3955
|
-
export {
|
|
4181
|
+
export { getAccount as $, resendCliSignupVerification as $t, createOrgSecret as A, updateWakeAuthorization as An, listFunctions as At, deleteFilter as B, listWakeDispatches as Bt, createAgentClaimLink as C, updateDomain as Cn, listDeliveries as Ct, createFilter as D, updateRegistry as Dn, listFilters as Dt, createEndpoint as E, updateFunction as En, listEndpoints as Et, decideRegistryRequest as F, verifyDomain as Fn, listRegistryRequests as Ft, deleteRegistry as G, pullWebhookEvent as Gt, deleteFunctionSecret as H, payChallenge as Ht, defineAgent as I, createClient as In, listRoutes as It, deleteWakeSchedule as J, replayDelivery as Jt, deleteRoute as K, registerPayoutAddress as Kt, deleteDomain as L, createConfig as Ln, listSentEmails as Lt, createRoute as M, verifyAgentClaim as Mn, listPayoutAddresses as Mt, createWakeAuthorization as N, verifyAgentSignup as Nn, listRegistries as Nt, createFunction as O, updateRoute as On, listFunctionLogs as Ot, createWakeSchedule as P, verifyCliSignup as Pn, listRegistryAgents as Pt, downloadRawEmail as Q, resendAgentSignupVerification as Qt, deleteEmail as R, listTemplates as Rt, createAgentAccount as S, updateAccount as Sn, listDeclinedPayments as St, createEmailChallenge as T, updateFilter as Tn, listEmails as Tt, deleteMemory as U, pollCliLogin as Ut, deleteFunction as V, listWakeSchedules as Vt, deleteOrgSecret as W, publishAgent as Wt, downloadAttachments as X, replyToEmail as Xt, discardEmailContent as Y, replayEmailWebhooks as Yt, downloadDomainZoneFile as Z, rescheduleSentEmail as Zt, awaitReply as _, testEndpoint as _n, getTemplateInstall as _t, PrimitiveClient as a, searchMemories as an, getFunctionRouting as at, cliLogout as b, unpublishAgent as bn, getWebhookSecret as bt, createPrimitiveClient as c, setFunctionRoute as cn, getMemory as ct, isMemoryJsonValue as d, setOrgSecret as dn, getRegistry as dt, resolveRegistryHandle as en, getAgent as et, DEFAULT_API_BASE_URL as f, simulateRoute as fn, getSendPermissions as ft, addDomain as g, startCliSignup as gn, getTemplate as gt, createPrimitiveApiClient as h, startCliLogin as hn, getStorageStats as ht, MemoriesResource as i, searchEmails as in, getFunction as it, createRegistry as j, updateWakeSchedule as jn, listOrgSecrets as jt, createFunctionSecret as k, updateSpendPolicy as kn, listFunctionSecrets as kt, PRIMITIVE_SIGNATURE_HEADER as l, setFunctionSecret as ln, getOrgRoutingTopology as lt, PrimitiveApiError as m, startAgentSignup as mn, getSpendPolicy as mt, AgentResource as n, runWakeSchedule as nn, getConversation as nt, client as o, semanticSearch as on, getFunctionTestRunTrace as ot, PrimitiveApiClient as p, startAgentClaim as pn, getSentEmail as pt, deleteWakeAuthorization as q, reorderRoutes as qt, InboxResource as r, sdk_gen_exports as rn, getEmail as rt, createAgent as s, sendEmail as sn, getInboxStatus as st, AccountResource as t, rotateWebhookSecret as tn, getChallenge as tt, verifyWebhookSignature as u, setMemory as un, getOutboundStatus as ut, cancelSentEmail as v, testEndpointRules as vn, getThread as vt, createChallenge as w, updateEndpoint as wn, listDomains as wt, completeWebhookEvent as x, unsetFunctionRoute as xn, installTemplate as xt, checkDomainDns as y, testFunction as yn, getWakeSchedule as yt, deleteEndpoint as z, listWakeAuthorizations as zt };
|
package/dist/contract/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as RawContentInline, E as ParsedError, I as WebhookAttachment, T as ParsedDataFailed, d as EmailAuth, f as EmailReceivedEvent, k as RawContentDownloadOnly, l as EmailAddress, u as EmailAnalysis, w as ParsedDataComplete } from "../types-
|
|
2
|
-
import { A as SignResult, M as signWebhookPayload, S as StandardWebhooksSignResult, _ as WEBHOOK_VERSION, w as signStandardWebhooksPayload } from "../index-
|
|
1
|
+
import { A as RawContentInline, E as ParsedError, I as WebhookAttachment, T as ParsedDataFailed, d as EmailAuth, f as EmailReceivedEvent, k as RawContentDownloadOnly, l as EmailAddress, u as EmailAnalysis, w as ParsedDataComplete } from "../types-DcXtFARL.js";
|
|
2
|
+
import { A as SignResult, M as signWebhookPayload, S as StandardWebhooksSignResult, _ as WEBHOOK_VERSION, w as signStandardWebhooksPayload } from "../index-fS1gVNuX.js";
|
|
3
3
|
|
|
4
4
|
//#region src/contract/contract.d.ts
|
|
5
5
|
/** Maximum raw email size for inline inclusion (256 KB). */
|
package/dist/contract/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as WEBHOOK_VERSION, v as signStandardWebhooksPayload, w as signWebhookPayload, z as validateEmailReceivedEvent } from "../webhook-
|
|
1
|
+
import { p as WEBHOOK_VERSION, v as signStandardWebhooksPayload, w as signWebhookPayload, z as validateEmailReceivedEvent } from "../webhook-BtyuJtUF.js";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
//#region src/contract/contract.ts
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as ValidateEmailAuthResult, I as WebhookAttachment, d as EmailAuth, f as EmailReceivedEvent, u as EmailAnalysis } from "./types-
|
|
1
|
+
import { F as ValidateEmailAuthResult, I as WebhookAttachment, d as EmailAuth, f as EmailReceivedEvent, u as EmailAnalysis } from "./types-DcXtFARL.js";
|
|
2
2
|
import { ErrorObject } from "ajv";
|
|
3
3
|
|
|
4
4
|
//#region src/webhook/received-email.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as parseFromHeaderLoose, t as parseFromHeader } from "./address-parser-
|
|
1
|
+
import { n as parseFromHeaderLoose, t as parseFromHeader } from "./address-parser-C2JJzLdA.js";
|
|
2
2
|
import isEmail from "validator/lib/isEmail.js";
|
|
3
3
|
//#region src/webhook/received-email.ts
|
|
4
4
|
const REPLY_PREFIX_RE = /^re\s*:/i;
|