@primitivedotdev/sdk 0.11.0 → 0.13.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.
@@ -136,6 +136,42 @@
136
136
  "summary": "Send an email (simplified, agent-friendly)",
137
137
  "enableJsonFlag": false
138
138
  },
139
+ "whoami": {
140
+ "aliases": [],
141
+ "args": {},
142
+ "description": "Print the account currently authenticated by the API key. Useful as a credentials smoke test: confirms the key is live and shows which account it belongs to.",
143
+ "examples": [
144
+ "<%= config.bin %> whoami",
145
+ "<%= config.bin %> whoami --api-key prim_..."
146
+ ],
147
+ "flags": {
148
+ "api-key": {
149
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
150
+ "env": "PRIMITIVE_API_KEY",
151
+ "name": "api-key",
152
+ "hasDynamicHelp": false,
153
+ "multiple": false,
154
+ "type": "option"
155
+ },
156
+ "base-url": {
157
+ "description": "API base URL (defaults to PRIMITIVE_API_URL or production)",
158
+ "env": "PRIMITIVE_API_URL",
159
+ "name": "base-url",
160
+ "hasDynamicHelp": false,
161
+ "multiple": false,
162
+ "type": "option"
163
+ }
164
+ },
165
+ "hasDynamicHelp": false,
166
+ "hiddenAliases": [],
167
+ "id": "whoami",
168
+ "pluginAlias": "@primitivedotdev/sdk",
169
+ "pluginName": "@primitivedotdev/sdk",
170
+ "pluginType": "core",
171
+ "strict": true,
172
+ "summary": "Print the authenticated account (credentials smoke test)",
173
+ "enableJsonFlag": false
174
+ },
139
175
  "account:get-account": {
140
176
  "aliases": [],
141
177
  "args": {},
@@ -285,15 +321,15 @@
285
321
  "multiple": false,
286
322
  "type": "option"
287
323
  },
288
- "body": {
289
- "description": "Full request body as JSON. Prefer per-field flags (e.g. --to, --from, --body-text) when available; --body is the escape hatch for nested or complex fields.",
290
- "name": "body",
324
+ "raw-body": {
325
+ "description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
326
+ "name": "raw-body",
291
327
  "hasDynamicHelp": false,
292
328
  "multiple": false,
293
329
  "type": "option"
294
330
  },
295
331
  "body-file": {
296
- "description": "Path to a JSON file used as the request body. Same role as --body for callers passing a saved payload.",
332
+ "description": "Path to a JSON file used as the request body. Same role as --raw-body for callers passing a saved payload.",
297
333
  "name": "body-file",
298
334
  "hasDynamicHelp": false,
299
335
  "multiple": false,
@@ -306,7 +342,7 @@
306
342
  "type": "boolean"
307
343
  },
308
344
  "spam-threshold": {
309
- "description": "Global spam score threshold (0-15). Emails scoring above this are rejected. S...",
345
+ "description": "Global spam score threshold (0-15). Emails scoring above this are rejected. Set to null to disable.",
310
346
  "name": "spam-threshold",
311
347
  "hasDynamicHelp": false,
312
348
  "multiple": false,
@@ -344,15 +380,15 @@
344
380
  "multiple": false,
345
381
  "type": "option"
346
382
  },
347
- "body": {
348
- "description": "Full request body as JSON. Prefer per-field flags (e.g. --to, --from, --body-text) when available; --body is the escape hatch for nested or complex fields.",
349
- "name": "body",
383
+ "raw-body": {
384
+ "description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
385
+ "name": "raw-body",
350
386
  "hasDynamicHelp": false,
351
387
  "multiple": false,
352
388
  "type": "option"
353
389
  },
354
390
  "body-file": {
355
- "description": "Path to a JSON file used as the request body. Same role as --body for callers passing a saved payload.",
391
+ "description": "Path to a JSON file used as the request body. Same role as --raw-body for callers passing a saved payload.",
356
392
  "name": "body-file",
357
393
  "hasDynamicHelp": false,
358
394
  "multiple": false,
@@ -477,15 +513,15 @@
477
513
  "multiple": false,
478
514
  "type": "option"
479
515
  },
480
- "body": {
481
- "description": "Full request body as JSON. Prefer per-field flags (e.g. --to, --from, --body-text) when available; --body is the escape hatch for nested or complex fields.",
482
- "name": "body",
516
+ "raw-body": {
517
+ "description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
518
+ "name": "raw-body",
483
519
  "hasDynamicHelp": false,
484
520
  "multiple": false,
485
521
  "type": "option"
486
522
  },
487
523
  "body-file": {
488
- "description": "Path to a JSON file used as the request body. Same role as --body for callers passing a saved payload.",
524
+ "description": "Path to a JSON file used as the request body. Same role as --raw-body for callers passing a saved payload.",
489
525
  "name": "body-file",
490
526
  "hasDynamicHelp": false,
491
527
  "multiple": false,
@@ -748,7 +784,7 @@
748
784
  "emails:list-emails": {
749
785
  "aliases": [],
750
786
  "args": {},
751
- "description": "Returns a paginated list of received emails. Supports filtering by\ndomain, status, date range, and free-text search across subject,\nsender, and recipient fields.\n",
787
+ "description": "Returns a paginated list of INBOUND emails received at your\nverified domains. Outbound messages sent via /send-mail are not\nincluded; this endpoint is the inbox view, not a unified\nsend/receive history.\n\nSupports filtering by domain, status, date range, and free-text\nsearch across subject, sender, and recipient fields.\n",
752
788
  "flags": {
753
789
  "api-key": {
754
790
  "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
@@ -836,7 +872,7 @@
836
872
  "pluginName": "@primitivedotdev/sdk",
837
873
  "pluginType": "core",
838
874
  "strict": true,
839
- "summary": "List emails",
875
+ "summary": "List inbound emails",
840
876
  "enableJsonFlag": false
841
877
  },
842
878
  "emails:replay-email-webhooks": {
@@ -882,7 +918,7 @@
882
918
  "endpoints:create-endpoint": {
883
919
  "aliases": [],
884
920
  "args": {},
885
- "description": "Creates a new webhook endpoint. If a deactivated endpoint with the\nsame URL and domain exists, it is reactivated instead.\nSubject to plan limits on the number of active endpoints.\n\n\nBody fields requiring --body JSON (these are not exposed as flags):\n rules object Endpoint-specific filtering rules\n(* = required. Scalar body fields are exposed as individual --flag-name flags; see FLAGS above.)",
921
+ "description": "Creates a new webhook endpoint. If a deactivated endpoint with the\nsame URL and domain exists, it is reactivated instead.\nSubject to plan limits on the number of active endpoints.\n\n\nBody fields requiring --raw-body JSON (these are not exposed as flags):\n rules object Endpoint-specific filtering rules\n(* = required. Scalar body fields are exposed as individual --flag-name flags; see FLAGS above.)",
886
922
  "flags": {
887
923
  "api-key": {
888
924
  "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
@@ -900,15 +936,15 @@
900
936
  "multiple": false,
901
937
  "type": "option"
902
938
  },
903
- "body": {
904
- "description": "Full request body as JSON. Prefer per-field flags (e.g. --to, --from, --body-text) when available; --body is the escape hatch for nested or complex fields.",
905
- "name": "body",
939
+ "raw-body": {
940
+ "description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
941
+ "name": "raw-body",
906
942
  "hasDynamicHelp": false,
907
943
  "multiple": false,
908
944
  "type": "option"
909
945
  },
910
946
  "body-file": {
911
- "description": "Path to a JSON file used as the request body. Same role as --body for callers passing a saved payload.",
947
+ "description": "Path to a JSON file used as the request body. Same role as --raw-body for callers passing a saved payload.",
912
948
  "name": "body-file",
913
949
  "hasDynamicHelp": false,
914
950
  "multiple": false,
@@ -1060,7 +1096,7 @@
1060
1096
  "endpoints:update-endpoint": {
1061
1097
  "aliases": [],
1062
1098
  "args": {},
1063
- "description": "Updates an active webhook endpoint. If the URL is changed, the old\nendpoint is deactivated and a new one is created (or an existing\ndeactivated endpoint with the new URL is reactivated).\n\n\nBody fields requiring --body JSON (these are not exposed as flags):\n rules object\n(* = required. Scalar body fields are exposed as individual --flag-name flags; see FLAGS above.)",
1099
+ "description": "Updates an active webhook endpoint. If the URL is changed, the old\nendpoint is deactivated and a new one is created (or an existing\ndeactivated endpoint with the new URL is reactivated).\n\n\nBody fields requiring --raw-body JSON (these are not exposed as flags):\n rules object\n(* = required. Scalar body fields are exposed as individual --flag-name flags; see FLAGS above.)",
1064
1100
  "flags": {
1065
1101
  "api-key": {
1066
1102
  "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
@@ -1086,15 +1122,15 @@
1086
1122
  "multiple": false,
1087
1123
  "type": "option"
1088
1124
  },
1089
- "body": {
1090
- "description": "Full request body as JSON. Prefer per-field flags (e.g. --to, --from, --body-text) when available; --body is the escape hatch for nested or complex fields.",
1091
- "name": "body",
1125
+ "raw-body": {
1126
+ "description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
1127
+ "name": "raw-body",
1092
1128
  "hasDynamicHelp": false,
1093
1129
  "multiple": false,
1094
1130
  "type": "option"
1095
1131
  },
1096
1132
  "body-file": {
1097
- "description": "Path to a JSON file used as the request body. Same role as --body for callers passing a saved payload.",
1133
+ "description": "Path to a JSON file used as the request body. Same role as --raw-body for callers passing a saved payload.",
1098
1134
  "name": "body-file",
1099
1135
  "hasDynamicHelp": false,
1100
1136
  "multiple": false,
@@ -1152,15 +1188,15 @@
1152
1188
  "multiple": false,
1153
1189
  "type": "option"
1154
1190
  },
1155
- "body": {
1156
- "description": "Full request body as JSON. Prefer per-field flags (e.g. --to, --from, --body-text) when available; --body is the escape hatch for nested or complex fields.",
1157
- "name": "body",
1191
+ "raw-body": {
1192
+ "description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
1193
+ "name": "raw-body",
1158
1194
  "hasDynamicHelp": false,
1159
1195
  "multiple": false,
1160
1196
  "type": "option"
1161
1197
  },
1162
1198
  "body-file": {
1163
- "description": "Path to a JSON file used as the request body. Same role as --body for callers passing a saved payload.",
1199
+ "description": "Path to a JSON file used as the request body. Same role as --raw-body for callers passing a saved payload.",
1164
1200
  "name": "body-file",
1165
1201
  "hasDynamicHelp": false,
1166
1202
  "multiple": false,
@@ -1303,15 +1339,15 @@
1303
1339
  "multiple": false,
1304
1340
  "type": "option"
1305
1341
  },
1306
- "body": {
1307
- "description": "Full request body as JSON. Prefer per-field flags (e.g. --to, --from, --body-text) when available; --body is the escape hatch for nested or complex fields.",
1308
- "name": "body",
1342
+ "raw-body": {
1343
+ "description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
1344
+ "name": "raw-body",
1309
1345
  "hasDynamicHelp": false,
1310
1346
  "multiple": false,
1311
1347
  "type": "option"
1312
1348
  },
1313
1349
  "body-file": {
1314
- "description": "Path to a JSON file used as the request body. Same role as --body for callers passing a saved payload.",
1350
+ "description": "Path to a JSON file used as the request body. Same role as --raw-body for callers passing a saved payload.",
1315
1351
  "name": "body-file",
1316
1352
  "hasDynamicHelp": false,
1317
1353
  "multiple": false,
@@ -1334,6 +1370,38 @@
1334
1370
  "summary": "Update a filter rule",
1335
1371
  "enableJsonFlag": false
1336
1372
  },
1373
+ "sending:get-send-permissions": {
1374
+ "aliases": [],
1375
+ "args": {},
1376
+ "description": "Returns a flat list of rules describing every recipient the\ncaller may send to. Each rule has a `type`, a kind-specific\npayload, and a human-readable `description`. If any rule\nmatches the recipient, /send-mail will accept the send under\nthe recipient-scope check.\n\nThe endpoint is the answer to \"where can I send\" without\nexposing internal entitlement names. Agents that don't\nrecognize a `type` can still read the `description` prose\nand act on it.\n\nRule kinds, ordered broadest-first so an agent can stop\nscanning at the first match:\n\n 1. `any_recipient` (one entry, only when the org can send\n anywhere): every other rule below it is redundant.\n 2. `managed_zone` (always emitted, one per Primitive-managed\n zone): sends to any address at *.primitive.email or\n *.email.works always succeed; no entitlement required.\n 3. `your_domain` (one per active verified outbound domain\n owned by the org): sends to that domain are approved.\n 4. `address` (one per address that has authenticated\n inbound mail to the org, capped at `meta.address_cap`):\n sends to that exact address are approved.\n\nThe list is informational, not an authorization check.\n/send-mail remains the source of truth on whether an\nindividual send will succeed (it also enforces the\nfrom-address and the `send_mail` entitlement, which are\nnot recipient-scope concerns and are not represented here).\n",
1377
+ "flags": {
1378
+ "api-key": {
1379
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
1380
+ "env": "PRIMITIVE_API_KEY",
1381
+ "name": "api-key",
1382
+ "hasDynamicHelp": false,
1383
+ "multiple": false,
1384
+ "type": "option"
1385
+ },
1386
+ "base-url": {
1387
+ "description": "API base URL (defaults to PRIMITIVE_API_URL or production)",
1388
+ "env": "PRIMITIVE_API_URL",
1389
+ "name": "base-url",
1390
+ "hasDynamicHelp": false,
1391
+ "multiple": false,
1392
+ "type": "option"
1393
+ }
1394
+ },
1395
+ "hasDynamicHelp": false,
1396
+ "hiddenAliases": [],
1397
+ "id": "sending:get-send-permissions",
1398
+ "pluginAlias": "@primitivedotdev/sdk",
1399
+ "pluginName": "@primitivedotdev/sdk",
1400
+ "pluginType": "core",
1401
+ "strict": true,
1402
+ "summary": "List send-permission rules",
1403
+ "enableJsonFlag": false
1404
+ },
1337
1405
  "sending:reply-to-email": {
1338
1406
  "aliases": [],
1339
1407
  "args": {},
@@ -1363,15 +1431,15 @@
1363
1431
  "multiple": false,
1364
1432
  "type": "option"
1365
1433
  },
1366
- "body": {
1367
- "description": "Full request body as JSON. Prefer per-field flags (e.g. --to, --from, --body-text) when available; --body is the escape hatch for nested or complex fields.",
1368
- "name": "body",
1434
+ "raw-body": {
1435
+ "description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
1436
+ "name": "raw-body",
1369
1437
  "hasDynamicHelp": false,
1370
1438
  "multiple": false,
1371
1439
  "type": "option"
1372
1440
  },
1373
1441
  "body-file": {
1374
- "description": "Path to a JSON file used as the request body. Same role as --body for callers passing a saved payload.",
1442
+ "description": "Path to a JSON file used as the request body. Same role as --raw-body for callers passing a saved payload.",
1375
1443
  "name": "body-file",
1376
1444
  "hasDynamicHelp": false,
1377
1445
  "multiple": false,
@@ -1385,21 +1453,21 @@
1385
1453
  "type": "option"
1386
1454
  },
1387
1455
  "body-text": {
1388
- "description": "Plain-text reply body. At least one of body_text or body_html is required. Th...",
1456
+ "description": "Plain-text reply body. At least one of body_text or body_html is required. The combined UTF-8 byte length of body_text and body_html must be at most 262144 bytes (same cap as send-mail).",
1389
1457
  "name": "body-text",
1390
1458
  "hasDynamicHelp": false,
1391
1459
  "multiple": false,
1392
1460
  "type": "option"
1393
1461
  },
1394
1462
  "from": {
1395
- "description": "Optional override for the reply's From header. Defaults to",
1463
+ "description": "Optional override for the reply's From header. Defaults to the inbound's recipient. Use to add a display name (`\"Acme Support\" <agent@company.com>`) or to reply from a different verified outbound address (e.g. multi-team routing where support@ triages to billing@). The from-domain must be a verified outbound domain for your org, same as send-mail.",
1396
1464
  "name": "from",
1397
1465
  "hasDynamicHelp": false,
1398
1466
  "multiple": false,
1399
1467
  "type": "option"
1400
1468
  },
1401
1469
  "wait": {
1402
- "description": "When true, wait for the first downstream SMTP delivery outcome before returni...",
1470
+ "description": "When true, wait for the first downstream SMTP delivery outcome before returning, mirroring the send-mail `wait` semantics.",
1403
1471
  "name": "wait",
1404
1472
  "allowNo": false,
1405
1473
  "type": "boolean"
@@ -1418,7 +1486,7 @@
1418
1486
  "sending:send-email": {
1419
1487
  "aliases": [],
1420
1488
  "args": {},
1421
- "description": "Sends an outbound email through Primitive's outbound relay. By default\nthe request returns once the relay accepts the message for delivery.\nSet `wait: true` to wait for the first downstream SMTP delivery outcome.\n\n\nBody fields requiring --body JSON (these are not exposed as flags):\n references array<string> Full ordered message-id chain for the thread.\n(* = required. Scalar body fields are exposed as individual --flag-name flags; see FLAGS above.)",
1489
+ "description": "Sends an outbound email through Primitive's outbound relay. By default\nthe request returns once the relay accepts the message for delivery.\nSet `wait: true` to wait for the first downstream SMTP delivery outcome.\n\n\nBody fields requiring --raw-body JSON (these are not exposed as flags):\n references array<string> Full ordered message-id chain for the thread.\n(* = required. Scalar body fields are exposed as individual --flag-name flags; see FLAGS above.)",
1422
1490
  "flags": {
1423
1491
  "api-key": {
1424
1492
  "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
@@ -1436,22 +1504,22 @@
1436
1504
  "multiple": false,
1437
1505
  "type": "option"
1438
1506
  },
1439
- "body": {
1440
- "description": "Full request body as JSON. Prefer per-field flags (e.g. --to, --from, --body-text) when available; --body is the escape hatch for nested or complex fields.",
1441
- "name": "body",
1507
+ "raw-body": {
1508
+ "description": "Full request body as raw JSON. Escape hatch for nested or complex fields (e.g. arrays); prefer per-field flags (e.g. --to, --from, --body-text) when available.",
1509
+ "name": "raw-body",
1442
1510
  "hasDynamicHelp": false,
1443
1511
  "multiple": false,
1444
1512
  "type": "option"
1445
1513
  },
1446
1514
  "body-file": {
1447
- "description": "Path to a JSON file used as the request body. Same role as --body for callers passing a saved payload.",
1515
+ "description": "Path to a JSON file used as the request body. Same role as --raw-body for callers passing a saved payload.",
1448
1516
  "name": "body-file",
1449
1517
  "hasDynamicHelp": false,
1450
1518
  "multiple": false,
1451
1519
  "type": "option"
1452
1520
  },
1453
1521
  "from": {
1454
- "description": "RFC 5322 From header. The sender domain must be a verified outbound domain fo...",
1522
+ "description": "RFC 5322 From header. The sender domain must be a verified outbound domain for your organization.",
1455
1523
  "name": "from",
1456
1524
  "hasDynamicHelp": false,
1457
1525
  "multiple": false,
@@ -1465,21 +1533,21 @@
1465
1533
  "type": "option"
1466
1534
  },
1467
1535
  "to": {
1468
- "description": "Recipient address. Recipient eligibility depends on your account's outbound e...",
1536
+ "description": "Recipient address. Recipient eligibility depends on your account's outbound entitlements.",
1469
1537
  "name": "to",
1470
1538
  "hasDynamicHelp": false,
1471
1539
  "multiple": false,
1472
1540
  "type": "option"
1473
1541
  },
1474
1542
  "body-html": {
1475
- "description": "HTML message body. At least one of body_text or body_html is required. The co...",
1543
+ "description": "HTML message body. At least one of body_text or body_html is required. The combined UTF-8 byte length of body_text and body_html must be at most 262144 bytes.",
1476
1544
  "name": "body-html",
1477
1545
  "hasDynamicHelp": false,
1478
1546
  "multiple": false,
1479
1547
  "type": "option"
1480
1548
  },
1481
1549
  "body-text": {
1482
- "description": "Plain-text message body. At least one of body_text or body_html is required. ...",
1550
+ "description": "Plain-text message body. At least one of body_text or body_html is required. The combined UTF-8 byte length of body_text and body_html must be at most 262144 bytes.",
1483
1551
  "name": "body-text",
1484
1552
  "hasDynamicHelp": false,
1485
1553
  "multiple": false,
@@ -1499,7 +1567,7 @@
1499
1567
  "type": "boolean"
1500
1568
  },
1501
1569
  "wait-timeout-ms": {
1502
- "description": "Maximum time to wait for a delivery outcome when wait is true. Defaults to 30...",
1570
+ "description": "Maximum time to wait for a delivery outcome when wait is true. Defaults to 30000.",
1503
1571
  "name": "wait-timeout-ms",
1504
1572
  "hasDynamicHelp": false,
1505
1573
  "multiple": false,
@@ -1643,5 +1711,5 @@
1643
1711
  "enableJsonFlag": false
1644
1712
  }
1645
1713
  },
1646
- "version": "0.11.0"
1714
+ "version": "0.13.0"
1647
1715
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primitivedotdev/sdk",
3
- "version": "0.11.0",
3
+ "version": "0.13.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",