@primitivedotdev/sdk 0.13.0 → 0.14.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/dist/api/generated/index.js +1 -1
- package/dist/api/generated/sdk.gen.js +43 -0
- package/dist/api/index.d.ts +2 -2
- package/dist/{api-DvJpdOJ8.js → api-DH-YKt7a.js} +52 -1
- package/dist/{index-ChLFXxTa.d.ts → index-Cts9r1sL.d.ts} +372 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/oclif/commands/emails-latest.js +118 -0
- package/dist/oclif/commands/send.js +9 -1
- package/dist/oclif/index.js +69 -3
- package/dist/openapi/openapi.generated.js +362 -0
- package/dist/openapi/operations.generated.js +92 -0
- package/oclif.manifest.json +200 -3
- package/package.json +3 -3
|
@@ -769,6 +769,98 @@ export const operationManifest = [
|
|
|
769
769
|
"tag": "Sending",
|
|
770
770
|
"tagCommand": "sending"
|
|
771
771
|
},
|
|
772
|
+
{
|
|
773
|
+
"binaryResponse": false,
|
|
774
|
+
"bodyRequired": false,
|
|
775
|
+
"command": "get-sent-email",
|
|
776
|
+
"description": "Returns the full sent-email record by id, including\n`body_text` and `body_html` (omitted from the listing\nendpoint to keep paginated responses small). Use this when\ndiagnosing a specific send, e.g. inspecting the receiver's\nSMTP response on a `bounced` row or pulling the gate\ndenial detail on a `gate_denied` row.\n",
|
|
777
|
+
"hasJsonBody": false,
|
|
778
|
+
"method": "GET",
|
|
779
|
+
"operationId": "getSentEmail",
|
|
780
|
+
"path": "/sent-emails/{id}",
|
|
781
|
+
"pathParams": [
|
|
782
|
+
{
|
|
783
|
+
"description": "Resource UUID",
|
|
784
|
+
"enum": null,
|
|
785
|
+
"name": "id",
|
|
786
|
+
"required": true,
|
|
787
|
+
"type": "string"
|
|
788
|
+
}
|
|
789
|
+
],
|
|
790
|
+
"queryParams": [],
|
|
791
|
+
"requestSchema": null,
|
|
792
|
+
"sdkName": "getSentEmail",
|
|
793
|
+
"summary": "Get a sent email by id",
|
|
794
|
+
"tag": "Sending",
|
|
795
|
+
"tagCommand": "sending"
|
|
796
|
+
},
|
|
797
|
+
{
|
|
798
|
+
"binaryResponse": false,
|
|
799
|
+
"bodyRequired": false,
|
|
800
|
+
"command": "list-sent-emails",
|
|
801
|
+
"description": "Returns a paginated list of OUTBOUND emails the caller's\norg has sent via /send-mail (and /emails/{id}/reply, which\nforwards through /send-mail). Includes every recorded\nattempt, including gate-denied attempts that the agent\nnever called and rows still in `queued` state.\n\nFor inbound mail received at your verified domains, see\n/emails. There is no unified send/receive history endpoint;\nthe two surfaces are intentionally separate because the\nunderlying tables, statuses, and lifecycle differ.\n\nEmail bodies (`body_text`, `body_html`) are NOT included on\nlist rows so a 50-row page can't balloon into a multi-MB\nresponse when sends are near the 5MB body cap. Use\n/sent-emails/{id} to fetch a single row with bodies, or\ncross-reference by `client_idempotency_key` if the caller\nalready has the body locally.\n",
|
|
802
|
+
"hasJsonBody": false,
|
|
803
|
+
"method": "GET",
|
|
804
|
+
"operationId": "listSentEmails",
|
|
805
|
+
"path": "/sent-emails",
|
|
806
|
+
"pathParams": [],
|
|
807
|
+
"queryParams": [
|
|
808
|
+
{
|
|
809
|
+
"description": "Pagination cursor from a previous response's `meta.cursor` field.\nFormat: `{ISO-datetime}|{id}`\n",
|
|
810
|
+
"enum": null,
|
|
811
|
+
"name": "cursor",
|
|
812
|
+
"required": false,
|
|
813
|
+
"type": "string"
|
|
814
|
+
},
|
|
815
|
+
{
|
|
816
|
+
"description": "Number of results per page",
|
|
817
|
+
"enum": null,
|
|
818
|
+
"name": "limit",
|
|
819
|
+
"required": false,
|
|
820
|
+
"type": "integer"
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
"description": "Filter to rows in this status. Useful for polling\nqueued rows that haven't transitioned, auditing\ngate-denied attempts, or listing only successful\ndeliveries.\n",
|
|
824
|
+
"enum": null,
|
|
825
|
+
"name": "status",
|
|
826
|
+
"required": false,
|
|
827
|
+
"type": "string"
|
|
828
|
+
},
|
|
829
|
+
{
|
|
830
|
+
"description": "Filter to the row matching a specific server-issued\n`request_id`. The /send-mail response surfaces\n`request_id` on every send; this lookup lets the\ncaller find the historical row for a given live call\nwithout remembering its `id`.\n",
|
|
831
|
+
"enum": null,
|
|
832
|
+
"name": "request_id",
|
|
833
|
+
"required": false,
|
|
834
|
+
"type": "string"
|
|
835
|
+
},
|
|
836
|
+
{
|
|
837
|
+
"description": "Filter to rows with the given `client_idempotency_key`.\nMultiple rows can share a key (a retry that hit the\nidempotent-replay path returns the same row, but a\nretry with a DIFFERENT canonical payload under the\nsame key is rejected by /send-mail before the row is\nwritten, so duplicates are bounded).\n",
|
|
838
|
+
"enum": null,
|
|
839
|
+
"name": "idempotency_key",
|
|
840
|
+
"required": false,
|
|
841
|
+
"type": "string"
|
|
842
|
+
},
|
|
843
|
+
{
|
|
844
|
+
"description": "Inclusive lower bound on `created_at`.",
|
|
845
|
+
"enum": null,
|
|
846
|
+
"name": "date_from",
|
|
847
|
+
"required": false,
|
|
848
|
+
"type": "string"
|
|
849
|
+
},
|
|
850
|
+
{
|
|
851
|
+
"description": "Inclusive upper bound on `created_at`.",
|
|
852
|
+
"enum": null,
|
|
853
|
+
"name": "date_to",
|
|
854
|
+
"required": false,
|
|
855
|
+
"type": "string"
|
|
856
|
+
}
|
|
857
|
+
],
|
|
858
|
+
"requestSchema": null,
|
|
859
|
+
"sdkName": "listSentEmails",
|
|
860
|
+
"summary": "List outbound sent emails",
|
|
861
|
+
"tag": "Sending",
|
|
862
|
+
"tagCommand": "sending"
|
|
863
|
+
},
|
|
772
864
|
{
|
|
773
865
|
"binaryResponse": false,
|
|
774
866
|
"bodyRequired": true,
|
package/oclif.manifest.json
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"list-operations": {
|
|
31
31
|
"aliases": [],
|
|
32
32
|
"args": {},
|
|
33
|
-
"description": "List all generated API operations",
|
|
33
|
+
"description": "List all generated API operations as JSON. Useful for piping to `jq` to discover available commands, their request/response schemas, and per-field descriptions. For inspecting a single operation in detail, prefer `primitive describe <command>`.",
|
|
34
34
|
"flags": {},
|
|
35
35
|
"hasDynamicHelp": false,
|
|
36
36
|
"hiddenAliases": [],
|
|
@@ -39,7 +39,32 @@
|
|
|
39
39
|
"pluginName": "@primitivedotdev/sdk",
|
|
40
40
|
"pluginType": "core",
|
|
41
41
|
"strict": true,
|
|
42
|
-
"summary": "List all generated API operations",
|
|
42
|
+
"summary": "List all generated API operations (JSON)",
|
|
43
|
+
"enableJsonFlag": false
|
|
44
|
+
},
|
|
45
|
+
"describe": {
|
|
46
|
+
"aliases": [],
|
|
47
|
+
"args": {
|
|
48
|
+
"command": {
|
|
49
|
+
"description": "Command id to describe, in `<topic>:<command>` form (e.g. `emails:get-email`). Run `primitive list-operations | jq -r '.[] | \"\\(.tagCommand):\\(.command)\"'` to enumerate.",
|
|
50
|
+
"name": "command",
|
|
51
|
+
"required": true
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"description": "Print the full operation manifest entry for a single API command, including the path, request schema, response schema, and per-field descriptions sourced from the OpenAPI spec.\n\n Useful for clarifying response field meanings (e.g. on inbound EmailDetail, which of `sender`, `from_email`, `from_header`, and `smtp_mail_from` to read), confirming required body fields, or checking a path's parameter shape before composing a request.",
|
|
55
|
+
"examples": [
|
|
56
|
+
"<%= config.bin %> describe emails:get-email",
|
|
57
|
+
"<%= config.bin %> describe sending:send-email"
|
|
58
|
+
],
|
|
59
|
+
"flags": {},
|
|
60
|
+
"hasDynamicHelp": false,
|
|
61
|
+
"hiddenAliases": [],
|
|
62
|
+
"id": "describe",
|
|
63
|
+
"pluginAlias": "@primitivedotdev/sdk",
|
|
64
|
+
"pluginName": "@primitivedotdev/sdk",
|
|
65
|
+
"pluginType": "core",
|
|
66
|
+
"strict": true,
|
|
67
|
+
"summary": "Describe a single API operation in detail",
|
|
43
68
|
"enableJsonFlag": false
|
|
44
69
|
},
|
|
45
70
|
"send": {
|
|
@@ -172,6 +197,50 @@
|
|
|
172
197
|
"summary": "Print the authenticated account (credentials smoke test)",
|
|
173
198
|
"enableJsonFlag": false
|
|
174
199
|
},
|
|
200
|
+
"emails:latest": {
|
|
201
|
+
"aliases": [],
|
|
202
|
+
"args": {},
|
|
203
|
+
"description": "Print the N most recent inbound emails as a one-line-per-row text table. Designed for quick triage and visual scanning. For programmatic access, use `primitive emails:list-emails` (full JSON envelope, cursor pagination, filters).\n\n The displayed id is the first 8 characters of the email's UUID; pass the full UUID (from `emails:list-emails` or `emails:get-email`) to operations that need it.",
|
|
204
|
+
"examples": [
|
|
205
|
+
"<%= config.bin %> emails:latest",
|
|
206
|
+
"<%= config.bin %> emails:latest --limit 25"
|
|
207
|
+
],
|
|
208
|
+
"flags": {
|
|
209
|
+
"api-key": {
|
|
210
|
+
"description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
|
|
211
|
+
"env": "PRIMITIVE_API_KEY",
|
|
212
|
+
"name": "api-key",
|
|
213
|
+
"hasDynamicHelp": false,
|
|
214
|
+
"multiple": false,
|
|
215
|
+
"type": "option"
|
|
216
|
+
},
|
|
217
|
+
"base-url": {
|
|
218
|
+
"description": "API base URL (defaults to PRIMITIVE_API_URL or production)",
|
|
219
|
+
"env": "PRIMITIVE_API_URL",
|
|
220
|
+
"name": "base-url",
|
|
221
|
+
"hasDynamicHelp": false,
|
|
222
|
+
"multiple": false,
|
|
223
|
+
"type": "option"
|
|
224
|
+
},
|
|
225
|
+
"limit": {
|
|
226
|
+
"description": "Number of rows to print (1-100, default 10).",
|
|
227
|
+
"name": "limit",
|
|
228
|
+
"default": 10,
|
|
229
|
+
"hasDynamicHelp": false,
|
|
230
|
+
"multiple": false,
|
|
231
|
+
"type": "option"
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
"hasDynamicHelp": false,
|
|
235
|
+
"hiddenAliases": [],
|
|
236
|
+
"id": "emails:latest",
|
|
237
|
+
"pluginAlias": "@primitivedotdev/sdk",
|
|
238
|
+
"pluginName": "@primitivedotdev/sdk",
|
|
239
|
+
"pluginType": "core",
|
|
240
|
+
"strict": true,
|
|
241
|
+
"summary": "Show the most recent inbound emails as a compact table",
|
|
242
|
+
"enableJsonFlag": false
|
|
243
|
+
},
|
|
175
244
|
"account:get-account": {
|
|
176
245
|
"aliases": [],
|
|
177
246
|
"args": {},
|
|
@@ -1402,6 +1471,134 @@
|
|
|
1402
1471
|
"summary": "List send-permission rules",
|
|
1403
1472
|
"enableJsonFlag": false
|
|
1404
1473
|
},
|
|
1474
|
+
"sending:get-sent-email": {
|
|
1475
|
+
"aliases": [],
|
|
1476
|
+
"args": {},
|
|
1477
|
+
"description": "Returns the full sent-email record by id, including\n`body_text` and `body_html` (omitted from the listing\nendpoint to keep paginated responses small). Use this when\ndiagnosing a specific send, e.g. inspecting the receiver's\nSMTP response on a `bounced` row or pulling the gate\ndenial detail on a `gate_denied` row.\n",
|
|
1478
|
+
"flags": {
|
|
1479
|
+
"api-key": {
|
|
1480
|
+
"description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
|
|
1481
|
+
"env": "PRIMITIVE_API_KEY",
|
|
1482
|
+
"name": "api-key",
|
|
1483
|
+
"hasDynamicHelp": false,
|
|
1484
|
+
"multiple": false,
|
|
1485
|
+
"type": "option"
|
|
1486
|
+
},
|
|
1487
|
+
"base-url": {
|
|
1488
|
+
"description": "API base URL (defaults to PRIMITIVE_API_URL or production)",
|
|
1489
|
+
"env": "PRIMITIVE_API_URL",
|
|
1490
|
+
"name": "base-url",
|
|
1491
|
+
"hasDynamicHelp": false,
|
|
1492
|
+
"multiple": false,
|
|
1493
|
+
"type": "option"
|
|
1494
|
+
},
|
|
1495
|
+
"id": {
|
|
1496
|
+
"description": "Resource UUID",
|
|
1497
|
+
"name": "id",
|
|
1498
|
+
"required": true,
|
|
1499
|
+
"hasDynamicHelp": false,
|
|
1500
|
+
"multiple": false,
|
|
1501
|
+
"type": "option"
|
|
1502
|
+
}
|
|
1503
|
+
},
|
|
1504
|
+
"hasDynamicHelp": false,
|
|
1505
|
+
"hiddenAliases": [],
|
|
1506
|
+
"id": "sending:get-sent-email",
|
|
1507
|
+
"pluginAlias": "@primitivedotdev/sdk",
|
|
1508
|
+
"pluginName": "@primitivedotdev/sdk",
|
|
1509
|
+
"pluginType": "core",
|
|
1510
|
+
"strict": true,
|
|
1511
|
+
"summary": "Get a sent email by id",
|
|
1512
|
+
"enableJsonFlag": false
|
|
1513
|
+
},
|
|
1514
|
+
"sending:list-sent-emails": {
|
|
1515
|
+
"aliases": [],
|
|
1516
|
+
"args": {},
|
|
1517
|
+
"description": "Returns a paginated list of OUTBOUND emails the caller's\norg has sent via /send-mail (and /emails/{id}/reply, which\nforwards through /send-mail). Includes every recorded\nattempt, including gate-denied attempts that the agent\nnever called and rows still in `queued` state.\n\nFor inbound mail received at your verified domains, see\n/emails. There is no unified send/receive history endpoint;\nthe two surfaces are intentionally separate because the\nunderlying tables, statuses, and lifecycle differ.\n\nEmail bodies (`body_text`, `body_html`) are NOT included on\nlist rows so a 50-row page can't balloon into a multi-MB\nresponse when sends are near the 5MB body cap. Use\n/sent-emails/{id} to fetch a single row with bodies, or\ncross-reference by `client_idempotency_key` if the caller\nalready has the body locally.\n",
|
|
1518
|
+
"flags": {
|
|
1519
|
+
"api-key": {
|
|
1520
|
+
"description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
|
|
1521
|
+
"env": "PRIMITIVE_API_KEY",
|
|
1522
|
+
"name": "api-key",
|
|
1523
|
+
"hasDynamicHelp": false,
|
|
1524
|
+
"multiple": false,
|
|
1525
|
+
"type": "option"
|
|
1526
|
+
},
|
|
1527
|
+
"base-url": {
|
|
1528
|
+
"description": "API base URL (defaults to PRIMITIVE_API_URL or production)",
|
|
1529
|
+
"env": "PRIMITIVE_API_URL",
|
|
1530
|
+
"name": "base-url",
|
|
1531
|
+
"hasDynamicHelp": false,
|
|
1532
|
+
"multiple": false,
|
|
1533
|
+
"type": "option"
|
|
1534
|
+
},
|
|
1535
|
+
"cursor": {
|
|
1536
|
+
"description": "Pagination cursor from a previous response's `meta.cursor` field.\nFormat: `{ISO-datetime}|{id}`\n",
|
|
1537
|
+
"name": "cursor",
|
|
1538
|
+
"required": false,
|
|
1539
|
+
"hasDynamicHelp": false,
|
|
1540
|
+
"multiple": false,
|
|
1541
|
+
"type": "option"
|
|
1542
|
+
},
|
|
1543
|
+
"limit": {
|
|
1544
|
+
"description": "Number of results per page",
|
|
1545
|
+
"name": "limit",
|
|
1546
|
+
"required": false,
|
|
1547
|
+
"hasDynamicHelp": false,
|
|
1548
|
+
"multiple": false,
|
|
1549
|
+
"type": "option"
|
|
1550
|
+
},
|
|
1551
|
+
"status": {
|
|
1552
|
+
"description": "Filter to rows in this status. Useful for polling\nqueued rows that haven't transitioned, auditing\ngate-denied attempts, or listing only successful\ndeliveries.\n",
|
|
1553
|
+
"name": "status",
|
|
1554
|
+
"required": false,
|
|
1555
|
+
"hasDynamicHelp": false,
|
|
1556
|
+
"multiple": false,
|
|
1557
|
+
"type": "option"
|
|
1558
|
+
},
|
|
1559
|
+
"request-id": {
|
|
1560
|
+
"description": "Filter to the row matching a specific server-issued\n`request_id`. The /send-mail response surfaces\n`request_id` on every send; this lookup lets the\ncaller find the historical row for a given live call\nwithout remembering its `id`.\n",
|
|
1561
|
+
"name": "request-id",
|
|
1562
|
+
"required": false,
|
|
1563
|
+
"hasDynamicHelp": false,
|
|
1564
|
+
"multiple": false,
|
|
1565
|
+
"type": "option"
|
|
1566
|
+
},
|
|
1567
|
+
"idempotency-key": {
|
|
1568
|
+
"description": "Filter to rows with the given `client_idempotency_key`.\nMultiple rows can share a key (a retry that hit the\nidempotent-replay path returns the same row, but a\nretry with a DIFFERENT canonical payload under the\nsame key is rejected by /send-mail before the row is\nwritten, so duplicates are bounded).\n",
|
|
1569
|
+
"name": "idempotency-key",
|
|
1570
|
+
"required": false,
|
|
1571
|
+
"hasDynamicHelp": false,
|
|
1572
|
+
"multiple": false,
|
|
1573
|
+
"type": "option"
|
|
1574
|
+
},
|
|
1575
|
+
"date-from": {
|
|
1576
|
+
"description": "Inclusive lower bound on `created_at`.",
|
|
1577
|
+
"name": "date-from",
|
|
1578
|
+
"required": false,
|
|
1579
|
+
"hasDynamicHelp": false,
|
|
1580
|
+
"multiple": false,
|
|
1581
|
+
"type": "option"
|
|
1582
|
+
},
|
|
1583
|
+
"date-to": {
|
|
1584
|
+
"description": "Inclusive upper bound on `created_at`.",
|
|
1585
|
+
"name": "date-to",
|
|
1586
|
+
"required": false,
|
|
1587
|
+
"hasDynamicHelp": false,
|
|
1588
|
+
"multiple": false,
|
|
1589
|
+
"type": "option"
|
|
1590
|
+
}
|
|
1591
|
+
},
|
|
1592
|
+
"hasDynamicHelp": false,
|
|
1593
|
+
"hiddenAliases": [],
|
|
1594
|
+
"id": "sending:list-sent-emails",
|
|
1595
|
+
"pluginAlias": "@primitivedotdev/sdk",
|
|
1596
|
+
"pluginName": "@primitivedotdev/sdk",
|
|
1597
|
+
"pluginType": "core",
|
|
1598
|
+
"strict": true,
|
|
1599
|
+
"summary": "List outbound sent emails",
|
|
1600
|
+
"enableJsonFlag": false
|
|
1601
|
+
},
|
|
1405
1602
|
"sending:reply-to-email": {
|
|
1406
1603
|
"aliases": [],
|
|
1407
1604
|
"args": {},
|
|
@@ -1711,5 +1908,5 @@
|
|
|
1711
1908
|
"enableJsonFlag": false
|
|
1712
1909
|
}
|
|
1713
1910
|
},
|
|
1714
|
-
"version": "0.
|
|
1911
|
+
"version": "0.14.0"
|
|
1715
1912
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primitivedotdev/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "Official Primitive Node.js SDK — webhook, api, openapi, contract, and parser modules",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -66,10 +66,10 @@
|
|
|
66
66
|
"description": "Claim, verify, and manage email domains"
|
|
67
67
|
},
|
|
68
68
|
"emails": {
|
|
69
|
-
"description": "List, inspect, and manage received emails"
|
|
69
|
+
"description": "List, inspect, and manage received emails. Use `primitive emails:latest` for a one-line-per-email summary of recent inbound mail."
|
|
70
70
|
},
|
|
71
71
|
"sending": {
|
|
72
|
-
"description": "Send outbound emails
|
|
72
|
+
"description": "Send outbound emails. For replies to inbound mail, use `sending:reply-to-email --id <inbound-id>` (threading and Re: subject derived server-side); for fresh sends, use `sending:send-email` or the `primitive send` shortcut."
|
|
73
73
|
},
|
|
74
74
|
"endpoints": {
|
|
75
75
|
"description": "Manage webhook endpoints that receive email events"
|