@primitivedotdev/sdk 0.34.0 → 0.35.1
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 +8 -2
- package/dist/api/index.d.ts +2 -2
- package/dist/api/index.js +3 -3
- package/dist/{api-Ox103I5d.js → api-COmUIWhS.js} +97 -39
- package/dist/{index-Bl9EHMFR.d.ts → index-Imm1lbB_.d.ts} +267 -35
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/openapi/index.js +1 -1
- package/dist/{operations.generated-Cz2SoaH4.js → operations.generated-CgJWP2sH.js} +535 -10
- package/package.json +1 -1
|
@@ -21,11 +21,11 @@ const openapiDocument = {
|
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"servers": [{
|
|
24
|
-
"url": "https://www.primitive.dev/api/v1",
|
|
25
|
-
"description": "Primary API host (PRIMITIVE_API_BASE_URL_1). Carries every operation\nexcept attachment-supporting send. Vercel-backed; request body is\ncapped at 4.5 MB by the platform.\n"
|
|
26
|
-
}, {
|
|
27
24
|
"url": "https://api.primitive.dev/v1",
|
|
28
|
-
"description": "
|
|
25
|
+
"description": "Canonical API host (PRIMITIVE_API_BASE_URL). Carries every public\nAPI operation. Cloudflare Workers-backed; attachment-capable send\noperations can carry up to ~30 MiB raw request bodies before base64\nencoding.\n"
|
|
26
|
+
}, {
|
|
27
|
+
"url": "https://www.primitive.dev/api/v1",
|
|
28
|
+
"description": "Legacy dashboard compatibility host. Requests are forwarded to the\ncanonical API host, but Vercel request body limits still apply before\nproxying. New integrations should use https://api.primitive.dev/v1.\n"
|
|
29
29
|
}],
|
|
30
30
|
"security": [{ "BearerAuth": [] }],
|
|
31
31
|
"tags": [
|
|
@@ -53,6 +53,10 @@ const openapiDocument = {
|
|
|
53
53
|
"name": "Emails",
|
|
54
54
|
"description": "List, inspect, and manage received emails"
|
|
55
55
|
},
|
|
56
|
+
{
|
|
57
|
+
"name": "Search",
|
|
58
|
+
"description": "Semantic and hybrid search across received and sent mail"
|
|
59
|
+
},
|
|
56
60
|
{
|
|
57
61
|
"name": "Sending",
|
|
58
62
|
"description": "Send outbound emails through the Primitive API"
|
|
@@ -1041,7 +1045,14 @@ const openapiDocument = {
|
|
|
1041
1045
|
"post": {
|
|
1042
1046
|
"operationId": "replyToEmail",
|
|
1043
1047
|
"summary": "Reply to an inbound email",
|
|
1044
|
-
"description": "Sends an outbound reply to the inbound email identified by `id`.\nThreading headers (`In-Reply-To`, `References`), recipient\nderivation (Reply-To, then From, then bare sender), and the\n`Re:` subject prefix are all derived server-side from the\nstored inbound row. The request body carries only the message\nbody and optional
|
|
1048
|
+
"description": "Sends an outbound reply to the inbound email identified by `id`.\nThreading headers (`In-Reply-To`, `References`), recipient\nderivation (Reply-To, then From, then bare sender), and the\n`Re:` subject prefix are all derived server-side from the\nstored inbound row. The request body carries only the message\nbody, optional From override, optional attachments, and optional\n`wait` flag; passing any header or recipient override is\nrejected by the schema (`additionalProperties: false`).\n\nForwards through the same gates as `/send-mail`: the response\nstatus, error envelope, and `idempotent_replay` flag mirror\nthe send-mail contract verbatim.\n",
|
|
1049
|
+
"servers": [{
|
|
1050
|
+
"url": "https://api.primitive.dev/v1",
|
|
1051
|
+
"description": "Canonical API host (recommended)"
|
|
1052
|
+
}, {
|
|
1053
|
+
"url": "https://www.primitive.dev/api/v1",
|
|
1054
|
+
"description": "Legacy compatibility host (Vercel body limit applies)"
|
|
1055
|
+
}],
|
|
1045
1056
|
"tags": ["Sending"],
|
|
1046
1057
|
"requestBody": {
|
|
1047
1058
|
"required": true,
|
|
@@ -1449,13 +1460,13 @@ const openapiDocument = {
|
|
|
1449
1460
|
"/send-mail": { "post": {
|
|
1450
1461
|
"operationId": "sendEmail",
|
|
1451
1462
|
"summary": "Send outbound email",
|
|
1452
|
-
"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**Host routing.** /send-mail is served by the
|
|
1463
|
+
"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**Host routing.** /send-mail is served by the canonical API host\n(`https://api.primitive.dev/v1`) so the request body can carry\ninline attachments up to ~30 MiB raw. The legacy dashboard\ncompatibility host (`https://www.primitive.dev/api/v1`) also accepts\n/send-mail, but Vercel request body limits apply before proxying.\nThe typed SDKs route /send-mail to the canonical API host\nautomatically.\n",
|
|
1453
1464
|
"servers": [{
|
|
1454
1465
|
"url": "https://api.primitive.dev/v1",
|
|
1455
|
-
"description": "
|
|
1466
|
+
"description": "Canonical API host (recommended)"
|
|
1456
1467
|
}, {
|
|
1457
1468
|
"url": "https://www.primitive.dev/api/v1",
|
|
1458
|
-
"description": "
|
|
1469
|
+
"description": "Legacy compatibility host (Vercel body limit applies)"
|
|
1459
1470
|
}],
|
|
1460
1471
|
"tags": ["Sending"],
|
|
1461
1472
|
"parameters": [{
|
|
@@ -1491,6 +1502,42 @@ const openapiDocument = {
|
|
|
1491
1502
|
"503": { "$ref": "#/components/responses/ServiceUnavailable" }
|
|
1492
1503
|
}
|
|
1493
1504
|
} },
|
|
1505
|
+
"/semantic-search": { "post": {
|
|
1506
|
+
"operationId": "semanticSearch",
|
|
1507
|
+
"summary": "Semantic search across received and sent mail",
|
|
1508
|
+
"description": "Ranked search across both received and sent mail. The `mode`\nfield selects the ranking strategy:\n\n- `keyword`: lexical full-text matching only (no embeddings).\n- `semantic`: meaning-based matching using vector embeddings.\n- `hybrid` (default): blends the semantic and keyword signals.\n\nResults are ordered by a relevance `score`. Every row reports the\nfields it matched (`matched_fields`), a match-centered excerpt per\nfield (`snippets`), and a `score_breakdown` whose components account\nfor the `score`. Page through results by passing the prior\nresponse's `meta.cursor` back as `cursor`.\n\nRequires the Pro plan and the `semantic_search_enabled`\nentitlement; callers without them receive `403`.\n\nHost routing: this operation is served only by the search host\n(`https://api.primitive.dev/v1`). The typed SDKs route it there\nautomatically.\n",
|
|
1509
|
+
"servers": [{
|
|
1510
|
+
"url": "https://api.primitive.dev/v1",
|
|
1511
|
+
"description": "Search host"
|
|
1512
|
+
}],
|
|
1513
|
+
"tags": ["Search"],
|
|
1514
|
+
"requestBody": {
|
|
1515
|
+
"required": true,
|
|
1516
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/SemanticSearchInput" } } }
|
|
1517
|
+
},
|
|
1518
|
+
"responses": {
|
|
1519
|
+
"200": {
|
|
1520
|
+
"description": "Ranked search results",
|
|
1521
|
+
"content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
|
|
1522
|
+
"type": "object",
|
|
1523
|
+
"properties": {
|
|
1524
|
+
"data": {
|
|
1525
|
+
"type": "array",
|
|
1526
|
+
"items": { "$ref": "#/components/schemas/SemanticSearchResult" }
|
|
1527
|
+
},
|
|
1528
|
+
"meta": { "$ref": "#/components/schemas/SemanticSearchMeta" }
|
|
1529
|
+
},
|
|
1530
|
+
"required": ["data", "meta"]
|
|
1531
|
+
}] } } }
|
|
1532
|
+
},
|
|
1533
|
+
"400": { "$ref": "#/components/responses/ValidationError" },
|
|
1534
|
+
"401": { "$ref": "#/components/responses/Unauthorized" },
|
|
1535
|
+
"403": { "$ref": "#/components/responses/Forbidden" },
|
|
1536
|
+
"429": { "$ref": "#/components/responses/RateLimited" },
|
|
1537
|
+
"500": { "$ref": "#/components/responses/InternalError" },
|
|
1538
|
+
"503": { "$ref": "#/components/responses/ServiceUnavailable" }
|
|
1539
|
+
}
|
|
1540
|
+
} },
|
|
1494
1541
|
"/sent-emails": { "get": {
|
|
1495
1542
|
"operationId": "listSentEmails",
|
|
1496
1543
|
"summary": "List outbound sent emails",
|
|
@@ -4335,6 +4382,236 @@ const openapiDocument = {
|
|
|
4335
4382
|
"body_size_bytes"
|
|
4336
4383
|
]
|
|
4337
4384
|
},
|
|
4385
|
+
"SemanticSearchField": {
|
|
4386
|
+
"type": "string",
|
|
4387
|
+
"enum": [
|
|
4388
|
+
"subject",
|
|
4389
|
+
"headers",
|
|
4390
|
+
"addresses",
|
|
4391
|
+
"body"
|
|
4392
|
+
],
|
|
4393
|
+
"description": "A searchable email field."
|
|
4394
|
+
},
|
|
4395
|
+
"SemanticSearchInput": {
|
|
4396
|
+
"type": "object",
|
|
4397
|
+
"properties": {
|
|
4398
|
+
"query": {
|
|
4399
|
+
"type": "string",
|
|
4400
|
+
"minLength": 1,
|
|
4401
|
+
"maxLength": 2048,
|
|
4402
|
+
"description": "Free-text query. Required for `semantic` and `hybrid` modes;\noptional for `keyword` mode.\n"
|
|
4403
|
+
},
|
|
4404
|
+
"mode": {
|
|
4405
|
+
"type": "string",
|
|
4406
|
+
"enum": [
|
|
4407
|
+
"hybrid",
|
|
4408
|
+
"semantic",
|
|
4409
|
+
"keyword"
|
|
4410
|
+
],
|
|
4411
|
+
"default": "hybrid",
|
|
4412
|
+
"description": "Ranking strategy. `keyword` is lexical only, `semantic` is\nembedding-based, `hybrid` blends both.\n"
|
|
4413
|
+
},
|
|
4414
|
+
"corpus": {
|
|
4415
|
+
"type": "array",
|
|
4416
|
+
"items": {
|
|
4417
|
+
"type": "string",
|
|
4418
|
+
"enum": ["inbound", "outbound"]
|
|
4419
|
+
},
|
|
4420
|
+
"minItems": 1,
|
|
4421
|
+
"maxItems": 2,
|
|
4422
|
+
"description": "Which mail to search. Defaults to both received (`inbound`)\nand sent (`outbound`).\n"
|
|
4423
|
+
},
|
|
4424
|
+
"search_in": {
|
|
4425
|
+
"type": "array",
|
|
4426
|
+
"items": { "$ref": "#/components/schemas/SemanticSearchField" },
|
|
4427
|
+
"description": "Restrict matching to these fields. Defaults to all."
|
|
4428
|
+
},
|
|
4429
|
+
"exclude": {
|
|
4430
|
+
"type": "array",
|
|
4431
|
+
"items": { "$ref": "#/components/schemas/SemanticSearchField" },
|
|
4432
|
+
"description": "Exclude these fields from matching."
|
|
4433
|
+
},
|
|
4434
|
+
"date_from": {
|
|
4435
|
+
"type": "string",
|
|
4436
|
+
"format": "date-time",
|
|
4437
|
+
"description": "Only include mail at or after this timestamp."
|
|
4438
|
+
},
|
|
4439
|
+
"date_to": {
|
|
4440
|
+
"type": "string",
|
|
4441
|
+
"format": "date-time",
|
|
4442
|
+
"description": "Only include mail at or before this timestamp."
|
|
4443
|
+
},
|
|
4444
|
+
"include": {
|
|
4445
|
+
"type": "array",
|
|
4446
|
+
"items": {
|
|
4447
|
+
"type": "string",
|
|
4448
|
+
"enum": ["coverage"]
|
|
4449
|
+
},
|
|
4450
|
+
"description": "Opt-in extras. `coverage` adds an index-coverage snapshot to\n`meta`. Matched fields, snippets, and the score breakdown are\nalways returned regardless of this field.\n"
|
|
4451
|
+
},
|
|
4452
|
+
"limit": {
|
|
4453
|
+
"type": "integer",
|
|
4454
|
+
"minimum": 1,
|
|
4455
|
+
"maximum": 100,
|
|
4456
|
+
"default": 10,
|
|
4457
|
+
"description": "Maximum number of results to return."
|
|
4458
|
+
},
|
|
4459
|
+
"cursor": {
|
|
4460
|
+
"type": "string",
|
|
4461
|
+
"description": "Opaque pagination cursor from a prior response's `meta.cursor`."
|
|
4462
|
+
}
|
|
4463
|
+
}
|
|
4464
|
+
},
|
|
4465
|
+
"SemanticSearchSnippet": {
|
|
4466
|
+
"type": "object",
|
|
4467
|
+
"properties": {
|
|
4468
|
+
"field": {
|
|
4469
|
+
"type": "string",
|
|
4470
|
+
"description": "The field this excerpt came from."
|
|
4471
|
+
},
|
|
4472
|
+
"text": {
|
|
4473
|
+
"type": "string",
|
|
4474
|
+
"description": "Plain-text excerpt centered on the match (no markup)."
|
|
4475
|
+
}
|
|
4476
|
+
},
|
|
4477
|
+
"required": ["field", "text"]
|
|
4478
|
+
},
|
|
4479
|
+
"SemanticSearchScoreBreakdown": {
|
|
4480
|
+
"type": "object",
|
|
4481
|
+
"description": "Additive contributions to `score`. `semantic` and `keyword` are the\nraw signals times the mode's weight (null when not applicable);\nthese plus `field_boost` and `recency` sum to `score` before each\nvalue is independently rounded to 5 decimal places.\n",
|
|
4482
|
+
"properties": {
|
|
4483
|
+
"semantic": { "type": ["number", "null"] },
|
|
4484
|
+
"keyword": { "type": ["number", "null"] },
|
|
4485
|
+
"field_boost": { "type": "number" },
|
|
4486
|
+
"recency": { "type": "number" }
|
|
4487
|
+
},
|
|
4488
|
+
"required": [
|
|
4489
|
+
"semantic",
|
|
4490
|
+
"keyword",
|
|
4491
|
+
"field_boost",
|
|
4492
|
+
"recency"
|
|
4493
|
+
]
|
|
4494
|
+
},
|
|
4495
|
+
"SemanticSearchResult": {
|
|
4496
|
+
"type": "object",
|
|
4497
|
+
"properties": {
|
|
4498
|
+
"source_type": {
|
|
4499
|
+
"type": "string",
|
|
4500
|
+
"enum": ["inbound_email", "sent_email"],
|
|
4501
|
+
"description": "Whether this row is a received or sent message."
|
|
4502
|
+
},
|
|
4503
|
+
"id": {
|
|
4504
|
+
"type": "string",
|
|
4505
|
+
"description": "Message id. Combine with `api_url` to fetch the full record."
|
|
4506
|
+
},
|
|
4507
|
+
"subject": { "type": ["string", "null"] },
|
|
4508
|
+
"from": { "type": ["string", "null"] },
|
|
4509
|
+
"to": { "type": ["string", "null"] },
|
|
4510
|
+
"timestamp": {
|
|
4511
|
+
"type": "string",
|
|
4512
|
+
"description": "Message timestamp (received_at for inbound, created_at for sent)."
|
|
4513
|
+
},
|
|
4514
|
+
"status": {
|
|
4515
|
+
"type": "string",
|
|
4516
|
+
"description": "Lifecycle status of the message."
|
|
4517
|
+
},
|
|
4518
|
+
"score": {
|
|
4519
|
+
"type": "number",
|
|
4520
|
+
"description": "Overall relevance score; the `score_breakdown` components account for it."
|
|
4521
|
+
},
|
|
4522
|
+
"semantic_score": {
|
|
4523
|
+
"type": ["number", "null"],
|
|
4524
|
+
"description": "Raw semantic similarity signal, or null when not applicable."
|
|
4525
|
+
},
|
|
4526
|
+
"keyword_score": {
|
|
4527
|
+
"type": ["number", "null"],
|
|
4528
|
+
"description": "Raw keyword (lexical) signal, or null when not applicable."
|
|
4529
|
+
},
|
|
4530
|
+
"matched_fields": {
|
|
4531
|
+
"type": "array",
|
|
4532
|
+
"items": { "$ref": "#/components/schemas/SemanticSearchField" },
|
|
4533
|
+
"description": "Fields where the query matched."
|
|
4534
|
+
},
|
|
4535
|
+
"snippets": {
|
|
4536
|
+
"type": "array",
|
|
4537
|
+
"items": { "$ref": "#/components/schemas/SemanticSearchSnippet" },
|
|
4538
|
+
"description": "Match-centered excerpts, one per matched field."
|
|
4539
|
+
},
|
|
4540
|
+
"score_breakdown": { "$ref": "#/components/schemas/SemanticSearchScoreBreakdown" },
|
|
4541
|
+
"api_url": {
|
|
4542
|
+
"type": ["string", "null"],
|
|
4543
|
+
"description": "Relative API path to fetch the full message."
|
|
4544
|
+
}
|
|
4545
|
+
},
|
|
4546
|
+
"required": [
|
|
4547
|
+
"source_type",
|
|
4548
|
+
"id",
|
|
4549
|
+
"subject",
|
|
4550
|
+
"from",
|
|
4551
|
+
"to",
|
|
4552
|
+
"timestamp",
|
|
4553
|
+
"status",
|
|
4554
|
+
"score",
|
|
4555
|
+
"semantic_score",
|
|
4556
|
+
"keyword_score",
|
|
4557
|
+
"matched_fields",
|
|
4558
|
+
"snippets",
|
|
4559
|
+
"score_breakdown",
|
|
4560
|
+
"api_url"
|
|
4561
|
+
]
|
|
4562
|
+
},
|
|
4563
|
+
"SemanticSearchCoverage": {
|
|
4564
|
+
"type": "object",
|
|
4565
|
+
"description": "Index-coverage snapshot for the org, returned only when the `coverage` include option is requested.",
|
|
4566
|
+
"properties": {
|
|
4567
|
+
"embedded_chunks": { "type": "integer" },
|
|
4568
|
+
"pending_chunks": { "type": "integer" },
|
|
4569
|
+
"skipped_plan_chunks": { "type": "integer" },
|
|
4570
|
+
"skipped_quota_chunks": { "type": "integer" },
|
|
4571
|
+
"unsupported_attachment_chunks": { "type": "integer" },
|
|
4572
|
+
"failed_chunks": { "type": "integer" }
|
|
4573
|
+
},
|
|
4574
|
+
"required": [
|
|
4575
|
+
"embedded_chunks",
|
|
4576
|
+
"pending_chunks",
|
|
4577
|
+
"skipped_plan_chunks",
|
|
4578
|
+
"skipped_quota_chunks",
|
|
4579
|
+
"unsupported_attachment_chunks",
|
|
4580
|
+
"failed_chunks"
|
|
4581
|
+
]
|
|
4582
|
+
},
|
|
4583
|
+
"SemanticSearchMeta": {
|
|
4584
|
+
"type": "object",
|
|
4585
|
+
"properties": {
|
|
4586
|
+
"limit": {
|
|
4587
|
+
"type": "integer",
|
|
4588
|
+
"description": "Page size used for this request."
|
|
4589
|
+
},
|
|
4590
|
+
"cursor": {
|
|
4591
|
+
"type": ["string", "null"],
|
|
4592
|
+
"description": "Cursor for the next page, or null if there are no more results."
|
|
4593
|
+
},
|
|
4594
|
+
"mode": {
|
|
4595
|
+
"type": "string",
|
|
4596
|
+
"enum": [
|
|
4597
|
+
"hybrid",
|
|
4598
|
+
"semantic",
|
|
4599
|
+
"keyword"
|
|
4600
|
+
],
|
|
4601
|
+
"description": "Ranking mode used for this response."
|
|
4602
|
+
},
|
|
4603
|
+
"coverage": {
|
|
4604
|
+
"oneOf": [{ "$ref": "#/components/schemas/SemanticSearchCoverage" }, { "type": "null" }],
|
|
4605
|
+
"description": "Index-coverage snapshot, present only when requested via\n`include: [coverage]`; otherwise null.\n"
|
|
4606
|
+
}
|
|
4607
|
+
},
|
|
4608
|
+
"required": [
|
|
4609
|
+
"limit",
|
|
4610
|
+
"cursor",
|
|
4611
|
+
"mode",
|
|
4612
|
+
"coverage"
|
|
4613
|
+
]
|
|
4614
|
+
},
|
|
4338
4615
|
"SentEmailDetail": {
|
|
4339
4616
|
"description": "Full sent-email record, including `body_text` and\n`body_html`. Returned by /sent-emails/{id}.\n",
|
|
4340
4617
|
"allOf": [{ "$ref": "#/components/schemas/SentEmailSummary" }, {
|
|
@@ -4373,6 +4650,12 @@ const openapiDocument = {
|
|
|
4373
4650
|
"wait": {
|
|
4374
4651
|
"type": "boolean",
|
|
4375
4652
|
"description": "When true, wait for the first downstream SMTP delivery outcome before returning, mirroring the send-mail `wait` semantics."
|
|
4653
|
+
},
|
|
4654
|
+
"attachments": {
|
|
4655
|
+
"type": "array",
|
|
4656
|
+
"maxItems": 100,
|
|
4657
|
+
"description": "Inline attachments for this reply. Use https://api.primitive.dev/v1 for replies with attachments. Combined raw decoded attachment bytes must be at most 31457280.",
|
|
4658
|
+
"items": { "$ref": "#/components/schemas/SendMailAttachment" }
|
|
4376
4659
|
}
|
|
4377
4660
|
}
|
|
4378
4661
|
},
|
|
@@ -10131,6 +10414,218 @@ const operationManifest = [
|
|
|
10131
10414
|
"tag": "Inbox",
|
|
10132
10415
|
"tagCommand": "inbox"
|
|
10133
10416
|
},
|
|
10417
|
+
{
|
|
10418
|
+
"binaryResponse": false,
|
|
10419
|
+
"bodyRequired": true,
|
|
10420
|
+
"command": "semantic-search",
|
|
10421
|
+
"description": "Ranked search across both received and sent mail. The `mode`\nfield selects the ranking strategy:\n\n- `keyword`: lexical full-text matching only (no embeddings).\n- `semantic`: meaning-based matching using vector embeddings.\n- `hybrid` (default): blends the semantic and keyword signals.\n\nResults are ordered by a relevance `score`. Every row reports the\nfields it matched (`matched_fields`), a match-centered excerpt per\nfield (`snippets`), and a `score_breakdown` whose components account\nfor the `score`. Page through results by passing the prior\nresponse's `meta.cursor` back as `cursor`.\n\nRequires the Pro plan and the `semantic_search_enabled`\nentitlement; callers without them receive `403`.\n\nHost routing: this operation is served only by the search host\n(`https://api.primitive.dev/v1`). The typed SDKs route it there\nautomatically.\n",
|
|
10422
|
+
"hasJsonBody": true,
|
|
10423
|
+
"method": "POST",
|
|
10424
|
+
"operationId": "semanticSearch",
|
|
10425
|
+
"path": "/semantic-search",
|
|
10426
|
+
"pathParams": [],
|
|
10427
|
+
"queryParams": [],
|
|
10428
|
+
"requestSchema": {
|
|
10429
|
+
"type": "object",
|
|
10430
|
+
"properties": {
|
|
10431
|
+
"query": {
|
|
10432
|
+
"type": "string",
|
|
10433
|
+
"minLength": 1,
|
|
10434
|
+
"maxLength": 2048,
|
|
10435
|
+
"description": "Free-text query. Required for `semantic` and `hybrid` modes;\noptional for `keyword` mode.\n"
|
|
10436
|
+
},
|
|
10437
|
+
"mode": {
|
|
10438
|
+
"type": "string",
|
|
10439
|
+
"enum": [
|
|
10440
|
+
"hybrid",
|
|
10441
|
+
"semantic",
|
|
10442
|
+
"keyword"
|
|
10443
|
+
],
|
|
10444
|
+
"default": "hybrid",
|
|
10445
|
+
"description": "Ranking strategy. `keyword` is lexical only, `semantic` is\nembedding-based, `hybrid` blends both.\n"
|
|
10446
|
+
},
|
|
10447
|
+
"corpus": {
|
|
10448
|
+
"type": "array",
|
|
10449
|
+
"items": {
|
|
10450
|
+
"type": "string",
|
|
10451
|
+
"enum": ["inbound", "outbound"]
|
|
10452
|
+
},
|
|
10453
|
+
"minItems": 1,
|
|
10454
|
+
"maxItems": 2,
|
|
10455
|
+
"description": "Which mail to search. Defaults to both received (`inbound`)\nand sent (`outbound`).\n"
|
|
10456
|
+
},
|
|
10457
|
+
"search_in": {
|
|
10458
|
+
"type": "array",
|
|
10459
|
+
"items": {
|
|
10460
|
+
"type": "string",
|
|
10461
|
+
"enum": [
|
|
10462
|
+
"subject",
|
|
10463
|
+
"headers",
|
|
10464
|
+
"addresses",
|
|
10465
|
+
"body"
|
|
10466
|
+
],
|
|
10467
|
+
"description": "A searchable email field."
|
|
10468
|
+
},
|
|
10469
|
+
"description": "Restrict matching to these fields. Defaults to all."
|
|
10470
|
+
},
|
|
10471
|
+
"exclude": {
|
|
10472
|
+
"type": "array",
|
|
10473
|
+
"items": {
|
|
10474
|
+
"type": "string",
|
|
10475
|
+
"enum": [
|
|
10476
|
+
"subject",
|
|
10477
|
+
"headers",
|
|
10478
|
+
"addresses",
|
|
10479
|
+
"body"
|
|
10480
|
+
],
|
|
10481
|
+
"description": "A searchable email field."
|
|
10482
|
+
},
|
|
10483
|
+
"description": "Exclude these fields from matching."
|
|
10484
|
+
},
|
|
10485
|
+
"date_from": {
|
|
10486
|
+
"type": "string",
|
|
10487
|
+
"format": "date-time",
|
|
10488
|
+
"description": "Only include mail at or after this timestamp."
|
|
10489
|
+
},
|
|
10490
|
+
"date_to": {
|
|
10491
|
+
"type": "string",
|
|
10492
|
+
"format": "date-time",
|
|
10493
|
+
"description": "Only include mail at or before this timestamp."
|
|
10494
|
+
},
|
|
10495
|
+
"include": {
|
|
10496
|
+
"type": "array",
|
|
10497
|
+
"items": {
|
|
10498
|
+
"type": "string",
|
|
10499
|
+
"enum": ["coverage"]
|
|
10500
|
+
},
|
|
10501
|
+
"description": "Opt-in extras. `coverage` adds an index-coverage snapshot to\n`meta`. Matched fields, snippets, and the score breakdown are\nalways returned regardless of this field.\n"
|
|
10502
|
+
},
|
|
10503
|
+
"limit": {
|
|
10504
|
+
"type": "integer",
|
|
10505
|
+
"minimum": 1,
|
|
10506
|
+
"maximum": 100,
|
|
10507
|
+
"default": 10,
|
|
10508
|
+
"description": "Maximum number of results to return."
|
|
10509
|
+
},
|
|
10510
|
+
"cursor": {
|
|
10511
|
+
"type": "string",
|
|
10512
|
+
"description": "Opaque pagination cursor from a prior response's `meta.cursor`."
|
|
10513
|
+
}
|
|
10514
|
+
}
|
|
10515
|
+
},
|
|
10516
|
+
"responseSchema": {
|
|
10517
|
+
"type": "array",
|
|
10518
|
+
"items": {
|
|
10519
|
+
"type": "object",
|
|
10520
|
+
"properties": {
|
|
10521
|
+
"source_type": {
|
|
10522
|
+
"type": "string",
|
|
10523
|
+
"enum": ["inbound_email", "sent_email"],
|
|
10524
|
+
"description": "Whether this row is a received or sent message."
|
|
10525
|
+
},
|
|
10526
|
+
"id": {
|
|
10527
|
+
"type": "string",
|
|
10528
|
+
"description": "Message id. Combine with `api_url` to fetch the full record."
|
|
10529
|
+
},
|
|
10530
|
+
"subject": { "type": ["string", "null"] },
|
|
10531
|
+
"from": { "type": ["string", "null"] },
|
|
10532
|
+
"to": { "type": ["string", "null"] },
|
|
10533
|
+
"timestamp": {
|
|
10534
|
+
"type": "string",
|
|
10535
|
+
"description": "Message timestamp (received_at for inbound, created_at for sent)."
|
|
10536
|
+
},
|
|
10537
|
+
"status": {
|
|
10538
|
+
"type": "string",
|
|
10539
|
+
"description": "Lifecycle status of the message."
|
|
10540
|
+
},
|
|
10541
|
+
"score": {
|
|
10542
|
+
"type": "number",
|
|
10543
|
+
"description": "Overall relevance score; the `score_breakdown` components account for it."
|
|
10544
|
+
},
|
|
10545
|
+
"semantic_score": {
|
|
10546
|
+
"type": ["number", "null"],
|
|
10547
|
+
"description": "Raw semantic similarity signal, or null when not applicable."
|
|
10548
|
+
},
|
|
10549
|
+
"keyword_score": {
|
|
10550
|
+
"type": ["number", "null"],
|
|
10551
|
+
"description": "Raw keyword (lexical) signal, or null when not applicable."
|
|
10552
|
+
},
|
|
10553
|
+
"matched_fields": {
|
|
10554
|
+
"type": "array",
|
|
10555
|
+
"items": {
|
|
10556
|
+
"type": "string",
|
|
10557
|
+
"enum": [
|
|
10558
|
+
"subject",
|
|
10559
|
+
"headers",
|
|
10560
|
+
"addresses",
|
|
10561
|
+
"body"
|
|
10562
|
+
],
|
|
10563
|
+
"description": "A searchable email field."
|
|
10564
|
+
},
|
|
10565
|
+
"description": "Fields where the query matched."
|
|
10566
|
+
},
|
|
10567
|
+
"snippets": {
|
|
10568
|
+
"type": "array",
|
|
10569
|
+
"items": {
|
|
10570
|
+
"type": "object",
|
|
10571
|
+
"properties": {
|
|
10572
|
+
"field": {
|
|
10573
|
+
"type": "string",
|
|
10574
|
+
"description": "The field this excerpt came from."
|
|
10575
|
+
},
|
|
10576
|
+
"text": {
|
|
10577
|
+
"type": "string",
|
|
10578
|
+
"description": "Plain-text excerpt centered on the match (no markup)."
|
|
10579
|
+
}
|
|
10580
|
+
},
|
|
10581
|
+
"required": ["field", "text"]
|
|
10582
|
+
},
|
|
10583
|
+
"description": "Match-centered excerpts, one per matched field."
|
|
10584
|
+
},
|
|
10585
|
+
"score_breakdown": {
|
|
10586
|
+
"type": "object",
|
|
10587
|
+
"description": "Additive contributions to `score`. `semantic` and `keyword` are the\nraw signals times the mode's weight (null when not applicable);\nthese plus `field_boost` and `recency` sum to `score` before each\nvalue is independently rounded to 5 decimal places.\n",
|
|
10588
|
+
"properties": {
|
|
10589
|
+
"semantic": { "type": ["number", "null"] },
|
|
10590
|
+
"keyword": { "type": ["number", "null"] },
|
|
10591
|
+
"field_boost": { "type": "number" },
|
|
10592
|
+
"recency": { "type": "number" }
|
|
10593
|
+
},
|
|
10594
|
+
"required": [
|
|
10595
|
+
"semantic",
|
|
10596
|
+
"keyword",
|
|
10597
|
+
"field_boost",
|
|
10598
|
+
"recency"
|
|
10599
|
+
]
|
|
10600
|
+
},
|
|
10601
|
+
"api_url": {
|
|
10602
|
+
"type": ["string", "null"],
|
|
10603
|
+
"description": "Relative API path to fetch the full message."
|
|
10604
|
+
}
|
|
10605
|
+
},
|
|
10606
|
+
"required": [
|
|
10607
|
+
"source_type",
|
|
10608
|
+
"id",
|
|
10609
|
+
"subject",
|
|
10610
|
+
"from",
|
|
10611
|
+
"to",
|
|
10612
|
+
"timestamp",
|
|
10613
|
+
"status",
|
|
10614
|
+
"score",
|
|
10615
|
+
"semantic_score",
|
|
10616
|
+
"keyword_score",
|
|
10617
|
+
"matched_fields",
|
|
10618
|
+
"snippets",
|
|
10619
|
+
"score_breakdown",
|
|
10620
|
+
"api_url"
|
|
10621
|
+
]
|
|
10622
|
+
}
|
|
10623
|
+
},
|
|
10624
|
+
"sdkName": "semanticSearch",
|
|
10625
|
+
"summary": "Semantic search across received and sent mail",
|
|
10626
|
+
"tag": "Search",
|
|
10627
|
+
"tagCommand": "search"
|
|
10628
|
+
},
|
|
10134
10629
|
{
|
|
10135
10630
|
"binaryResponse": false,
|
|
10136
10631
|
"bodyRequired": false,
|
|
@@ -10783,7 +11278,7 @@ const operationManifest = [
|
|
|
10783
11278
|
"binaryResponse": false,
|
|
10784
11279
|
"bodyRequired": true,
|
|
10785
11280
|
"command": "reply-to-email",
|
|
10786
|
-
"description": "Sends an outbound reply to the inbound email identified by `id`.\nThreading headers (`In-Reply-To`, `References`), recipient\nderivation (Reply-To, then From, then bare sender), and the\n`Re:` subject prefix are all derived server-side from the\nstored inbound row. The request body carries only the message\nbody and optional
|
|
11281
|
+
"description": "Sends an outbound reply to the inbound email identified by `id`.\nThreading headers (`In-Reply-To`, `References`), recipient\nderivation (Reply-To, then From, then bare sender), and the\n`Re:` subject prefix are all derived server-side from the\nstored inbound row. The request body carries only the message\nbody, optional From override, optional attachments, and optional\n`wait` flag; passing any header or recipient override is\nrejected by the schema (`additionalProperties: false`).\n\nForwards through the same gates as `/send-mail`: the response\nstatus, error envelope, and `idempotent_replay` flag mirror\nthe send-mail contract verbatim.\n",
|
|
10787
11282
|
"hasJsonBody": true,
|
|
10788
11283
|
"method": "POST",
|
|
10789
11284
|
"operationId": "replyToEmail",
|
|
@@ -10818,6 +11313,36 @@ const operationManifest = [
|
|
|
10818
11313
|
"wait": {
|
|
10819
11314
|
"type": "boolean",
|
|
10820
11315
|
"description": "When true, wait for the first downstream SMTP delivery outcome before returning, mirroring the send-mail `wait` semantics."
|
|
11316
|
+
},
|
|
11317
|
+
"attachments": {
|
|
11318
|
+
"type": "array",
|
|
11319
|
+
"maxItems": 100,
|
|
11320
|
+
"description": "Inline attachments for this reply. Use https://api.primitive.dev/v1 for replies with attachments. Combined raw decoded attachment bytes must be at most 31457280.",
|
|
11321
|
+
"items": {
|
|
11322
|
+
"type": "object",
|
|
11323
|
+
"additionalProperties": false,
|
|
11324
|
+
"properties": {
|
|
11325
|
+
"filename": {
|
|
11326
|
+
"type": "string",
|
|
11327
|
+
"minLength": 1,
|
|
11328
|
+
"maxLength": 255,
|
|
11329
|
+
"description": "Attachment filename. Control characters are rejected."
|
|
11330
|
+
},
|
|
11331
|
+
"content_type": {
|
|
11332
|
+
"type": "string",
|
|
11333
|
+
"minLength": 1,
|
|
11334
|
+
"maxLength": 255,
|
|
11335
|
+
"description": "Optional MIME content type. Control characters are rejected."
|
|
11336
|
+
},
|
|
11337
|
+
"content_base64": {
|
|
11338
|
+
"type": "string",
|
|
11339
|
+
"minLength": 1,
|
|
11340
|
+
"maxLength": 44040192,
|
|
11341
|
+
"description": "Base64-encoded attachment bytes."
|
|
11342
|
+
}
|
|
11343
|
+
},
|
|
11344
|
+
"required": ["filename", "content_base64"]
|
|
11345
|
+
}
|
|
10821
11346
|
}
|
|
10822
11347
|
}
|
|
10823
11348
|
},
|
|
@@ -10918,7 +11443,7 @@ const operationManifest = [
|
|
|
10918
11443
|
"binaryResponse": false,
|
|
10919
11444
|
"bodyRequired": true,
|
|
10920
11445
|
"command": "send-email",
|
|
10921
|
-
"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**Host routing.** /send-mail is served by the
|
|
11446
|
+
"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**Host routing.** /send-mail is served by the canonical API host\n(`https://api.primitive.dev/v1`) so the request body can carry\ninline attachments up to ~30 MiB raw. The legacy dashboard\ncompatibility host (`https://www.primitive.dev/api/v1`) also accepts\n/send-mail, but Vercel request body limits apply before proxying.\nThe typed SDKs route /send-mail to the canonical API host\nautomatically.\n",
|
|
10922
11447
|
"hasJsonBody": true,
|
|
10923
11448
|
"method": "POST",
|
|
10924
11449
|
"operationId": "sendEmail",
|
package/package.json
CHANGED