@primitivedotdev/sdk 0.14.0 → 0.16.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.
@@ -51,7 +51,7 @@
51
51
  "required": true
52
52
  }
53
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.",
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 The manifest entry's `responseSchema` carries the inlined JSON Schema for the operation's 200/201 `data` envelope contents (`$ref`s resolved). Use it to look up what specific response fields mean. Examples:\n\n # Which of EmailDetail's sender-shaped fields is canonical?\n primitive describe emails:get-email | jq '.responseSchema.properties | keys'\n primitive describe emails:get-email | jq -r '.responseSchema.properties.from_email.description'\n\n # What does each value of SentEmailStatus mean?\n primitive describe sending:get-sent-email | jq -r '.responseSchema.properties.status.description'\n\n `requestSchema` is the same shape for the request body when one exists. For a single field across many operations at once, use `primitive list-operations | jq` instead.",
55
55
  "examples": [
56
56
  "<%= config.bin %> describe emails:get-email",
57
57
  "<%= config.bin %> describe sending:send-email"
@@ -75,7 +75,8 @@
75
75
  "<%= config.bin %> send --to alice@example.com --body 'Hi Alice!'",
76
76
  "<%= config.bin %> send --to alice@example.com --from support@yourcompany.com --subject 'Quick question' --body 'Are you free Thursday?'",
77
77
  "<%= config.bin %> send --to alice@example.com --html '<p>Hello!</p>'",
78
- "<%= config.bin %> send --to alice@example.com --body 'Confirmed' --wait"
78
+ "<%= config.bin %> send --to alice@example.com --body 'Confirmed' --wait",
79
+ "<%= config.bin %> send --to inbox@your-managed-domain.primitive.email --body 'self-loop smoke test' --wait # any *.primitive.email address routes back to the sending account; useful for proving outbound + inbound work end-to-end"
79
80
  ],
80
81
  "flags": {
81
82
  "api-key": {
@@ -200,10 +201,12 @@
200
201
  "emails:latest": {
201
202
  "aliases": [],
202
203
  "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
+ "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) or pass `--json` here for the same raw shape without pagination/filters.\n\n ID display is TTY-aware. When STDOUT is a terminal, the table truncates each row's id to the first 8 characters for readability. When STDOUT is piped or redirected (the row stream is being consumed by another command), the full UUID is printed so the id can be fed straight back into `emails:get-email`, `emails:delete-email`, etc. without a separate `--json` round-trip.\n\n Output streams: the column header line is written to STDERR so the row data on STDOUT stays grep/awk-friendly. `--json` writes everything (including the envelope) to STDOUT and is equivalent to running `emails:list-emails --limit N` for the same N.",
204
205
  "examples": [
205
206
  "<%= config.bin %> emails:latest",
206
- "<%= config.bin %> emails:latest --limit 25"
207
+ "<%= config.bin %> emails:latest --limit 25",
208
+ "<%= config.bin %> emails:latest | head -1 | awk '{print $1}' # full UUID since piped",
209
+ "<%= config.bin %> emails:latest --json | jq '.data[0].id'"
207
210
  ],
208
211
  "flags": {
209
212
  "api-key": {
@@ -229,6 +232,12 @@
229
232
  "hasDynamicHelp": false,
230
233
  "multiple": false,
231
234
  "type": "option"
235
+ },
236
+ "json": {
237
+ "description": "Print the raw response envelope (with full UUIDs and meta) as JSON on STDOUT instead of the text table. Useful for piping into `jq`, capturing ids for follow-up commands, or scripting.",
238
+ "name": "json",
239
+ "allowNo": false,
240
+ "type": "boolean"
232
241
  }
233
242
  },
234
243
  "hasDynamicHelp": false,
@@ -700,6 +709,46 @@
700
709
  "summary": "Delete an email",
701
710
  "enableJsonFlag": false
702
711
  },
712
+ "emails:discard-email-content": {
713
+ "aliases": [],
714
+ "args": {},
715
+ "description": "Permanently deletes the email's raw bytes, parsed body (text + HTML),\nand attachments while preserving metadata (sender, recipient,\nsubject, timestamps, hashes, attachment manifest) for audit logs.\nIdempotent: a second call returns success with\n`already_discarded: true` and does no work.\n\n**Gated** on the customer's discard-content opt-in (managed in the\ndashboard at Settings > Webhooks). When the toggle is off, this\nendpoint returns `403` with code `discard_not_enabled` and a\nmessage pointing the human at the dashboard. There is intentionally\nno API to flip this toggle — opting in to a destructive,\nnon-reversible operation must be a deliberate human click in the\nUI.\n",
716
+ "flags": {
717
+ "api-key": {
718
+ "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
719
+ "env": "PRIMITIVE_API_KEY",
720
+ "name": "api-key",
721
+ "hasDynamicHelp": false,
722
+ "multiple": false,
723
+ "type": "option"
724
+ },
725
+ "base-url": {
726
+ "description": "API base URL (defaults to PRIMITIVE_API_URL or production)",
727
+ "env": "PRIMITIVE_API_URL",
728
+ "name": "base-url",
729
+ "hasDynamicHelp": false,
730
+ "multiple": false,
731
+ "type": "option"
732
+ },
733
+ "id": {
734
+ "description": "Resource UUID",
735
+ "name": "id",
736
+ "required": true,
737
+ "hasDynamicHelp": false,
738
+ "multiple": false,
739
+ "type": "option"
740
+ }
741
+ },
742
+ "hasDynamicHelp": false,
743
+ "hiddenAliases": [],
744
+ "id": "emails:discard-email-content",
745
+ "pluginAlias": "@primitivedotdev/sdk",
746
+ "pluginName": "@primitivedotdev/sdk",
747
+ "pluginType": "core",
748
+ "strict": true,
749
+ "summary": "Discard email content",
750
+ "enableJsonFlag": false
751
+ },
703
752
  "emails:download-attachments": {
704
753
  "aliases": [],
705
754
  "args": {},
@@ -813,7 +862,7 @@
813
862
  "emails:get-email": {
814
863
  "aliases": [],
815
864
  "args": {},
816
- "description": "GET /emails/{id}",
865
+ "description": "Returns the full record for an inbound email received at one\nof your verified domains, including the parsed text and HTML\nbodies, threading metadata, SMTP envelope detail, webhook\ndelivery state, and a `replies` array for any outbound sends\nrecorded as replies to this inbound.\n\nFor listing inbound emails (with cursor pagination, status\nand date filters, and free-text search), use\n`/emails`. Outbound (sent) email records are NOT returned\nhere; use `/sent-emails/{id}` for those.\n\nThe response carries four sender-shaped fields whose\nmeanings overlap. `from_email` is the canonical \"who sent\nthis\" field for most use cases (parsed bare address from\nthe `From:` header, with a `sender` fallback). `from_header`\nis the raw header including any display name. `sender` and\n`smtp_mail_from` both carry the SMTP envelope MAIL FROM\n(return-path) and are equal by construction; `sender` is\nthe older field name retained for compatibility. See\n`primitive describe emails:get-email | jq '.responseSchema.properties'`\nfor per-field detail.\n",
817
866
  "flags": {
818
867
  "api-key": {
819
868
  "description": "Primitive API key (defaults to PRIMITIVE_API_KEY)",
@@ -847,7 +896,7 @@
847
896
  "pluginName": "@primitivedotdev/sdk",
848
897
  "pluginType": "core",
849
898
  "strict": true,
850
- "summary": "Get email details",
899
+ "summary": "Get inbound email by id",
851
900
  "enableJsonFlag": false
852
901
  },
853
902
  "emails:list-emails": {
@@ -896,17 +945,11 @@
896
945
  "type": "option"
897
946
  },
898
947
  "status": {
899
- "description": "Filter by email status",
948
+ "description": "Filter inbound rows by lifecycle status. See `EmailStatus`\nfor what each value means. Note that the webhook delivery\nstate is a SEPARATE lifecycle on the same row; filter by\n`webhook_status` semantics is not currently supported on\nthis endpoint.\n",
900
949
  "name": "status",
901
950
  "required": false,
902
951
  "hasDynamicHelp": false,
903
952
  "multiple": false,
904
- "options": [
905
- "pending",
906
- "accepted",
907
- "completed",
908
- "rejected"
909
- ],
910
953
  "type": "option"
911
954
  },
912
955
  "search": {
@@ -1908,5 +1951,5 @@
1908
1951
  "enableJsonFlag": false
1909
1952
  }
1910
1953
  },
1911
- "version": "0.14.0"
1954
+ "version": "0.16.0"
1912
1955
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primitivedotdev/sdk",
3
- "version": "0.14.0",
3
+ "version": "0.16.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",