@primitivedotdev/sdk 0.27.0 → 0.28.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/index.d.ts +5 -3
- package/dist/api/index.js +4 -3
- package/dist/{api-CnUa6o4r.js → api-3znV8SSN.js} +176 -99
- package/dist/contract/index.d.ts +8 -2
- package/dist/contract/index.js +7 -2
- package/dist/{errors-x91I_yEt.js → errors-BPJGp9I6.js} +1 -1
- package/dist/{errors-C53fe686.d.ts → errors-CO-rv_nK.d.ts} +1 -1
- package/dist/{index-BbEVpN5e.d.ts → index-BKeS9sOb.d.ts} +294 -92
- package/dist/{index-Dbx9udpX.d.ts → index-D_v8-0zX.d.ts} +19 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/openapi/index.d.ts +1 -52
- package/dist/openapi/index.js +1 -7631
- package/dist/operations.generated-BJERV_56.d.ts +53 -0
- package/dist/operations.generated-x1Go1Xkb.js +8106 -0
- package/dist/parser/index.d.ts +2 -1
- package/dist/parser/index.js +3 -1
- package/dist/{types-9vXGZjPd.d.ts → types-BRWDMD7H.d.ts} +8 -0
- package/dist/webhook/index.d.ts +3 -3
- package/dist/webhook/index.js +2 -2
- package/dist/{webhook-DJkfUnFZ.js → webhook-D4FTpj38.js} +644 -461
- package/package.json +5 -8
- /package/dist/{address-parser-BYn8oW5r.js → address-parser-CQbFjgRC.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as WebhookEvent, j as ValidateEmailAuthResult, l as EmailAuth, u as EmailReceivedEvent } from "./types-
|
|
2
|
-
import { m as ReceivedEmail, u as WebhookValidationError } from "./errors-
|
|
1
|
+
import { N as WebhookEvent, j as ValidateEmailAuthResult, l as EmailAuth, u as EmailReceivedEvent } from "./types-BRWDMD7H.js";
|
|
2
|
+
import { m as ReceivedEmail, u as WebhookValidationError } from "./errors-CO-rv_nK.js";
|
|
3
3
|
|
|
4
4
|
//#region src/validation.d.ts
|
|
5
5
|
interface ValidationSuccess<T> {
|
|
@@ -566,6 +566,17 @@ declare const emailReceivedEventJsonSchema: {
|
|
|
566
566
|
}];
|
|
567
567
|
readonly description: "Parsed BCC header addresses. Null if the email had no BCC header. Note: BCC is only available for outgoing emails or when explicitly provided.";
|
|
568
568
|
};
|
|
569
|
+
readonly to_addresses: {
|
|
570
|
+
readonly anyOf: [{
|
|
571
|
+
readonly type: "array";
|
|
572
|
+
readonly items: {
|
|
573
|
+
readonly $ref: "#/definitions/EmailAddress";
|
|
574
|
+
};
|
|
575
|
+
}, {
|
|
576
|
+
readonly type: "null";
|
|
577
|
+
}];
|
|
578
|
+
readonly description: "Parsed To header addresses. Null if the email had no To header.";
|
|
579
|
+
};
|
|
569
580
|
readonly in_reply_to: {
|
|
570
581
|
readonly anyOf: [{
|
|
571
582
|
readonly type: "array";
|
|
@@ -604,7 +615,7 @@ declare const emailReceivedEventJsonSchema: {
|
|
|
604
615
|
readonly description: "URL to download all attachments as a tar.gz archive. Null if the email had no attachments. Managed Primitive always issues HTTPS. Self-host deployments may issue HTTP URLs that resolve inside the operator's network. URL expires - check the expiration before downloading.";
|
|
605
616
|
};
|
|
606
617
|
};
|
|
607
|
-
readonly required: ["status", "error", "body_text", "body_html", "reply_to", "cc", "bcc", "in_reply_to", "references", "attachments", "attachments_download_url"];
|
|
618
|
+
readonly required: ["status", "error", "body_text", "body_html", "reply_to", "cc", "bcc", "to_addresses", "in_reply_to", "references", "attachments", "attachments_download_url"];
|
|
608
619
|
readonly description: "Parsed email content when parsing succeeded.\n\nUse the discriminant `status: \"complete\"` to narrow from {@link ParsedData } .";
|
|
609
620
|
};
|
|
610
621
|
readonly EmailAddress: {
|
|
@@ -688,6 +699,10 @@ declare const emailReceivedEventJsonSchema: {
|
|
|
688
699
|
readonly type: "null";
|
|
689
700
|
readonly description: "Always null when parsing fails.";
|
|
690
701
|
};
|
|
702
|
+
readonly to_addresses: {
|
|
703
|
+
readonly type: "null";
|
|
704
|
+
readonly description: "Always null when parsing fails.";
|
|
705
|
+
};
|
|
691
706
|
readonly in_reply_to: {
|
|
692
707
|
readonly type: "null";
|
|
693
708
|
readonly description: "Always null when parsing fails.";
|
|
@@ -708,7 +723,7 @@ declare const emailReceivedEventJsonSchema: {
|
|
|
708
723
|
readonly description: "Always null when parsing fails.";
|
|
709
724
|
};
|
|
710
725
|
};
|
|
711
|
-
readonly required: ["status", "error", "body_text", "body_html", "reply_to", "cc", "bcc", "in_reply_to", "references", "attachments", "attachments_download_url"];
|
|
726
|
+
readonly required: ["status", "error", "body_text", "body_html", "reply_to", "cc", "bcc", "to_addresses", "in_reply_to", "references", "attachments", "attachments_download_url"];
|
|
712
727
|
readonly description: "Parsed email content when parsing failed.\n\nUse the discriminant `status: \"failed\"` to narrow from {@link ParsedData } .";
|
|
713
728
|
};
|
|
714
729
|
readonly ParsedError: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as
|
|
3
|
-
import { _ as
|
|
4
|
-
import { A as VerifyOptions, C as signStandardWebhooksPayload, D as PRIMITIVE_CONFIRMED_HEADER, E as LEGACY_SIGNATURE_HEADER, F as VerifyDownloadTokenResult, I as generateDownloadToken, L as verifyDownloadToken, M as verifyWebhookSignature, N as GenerateDownloadTokenOptions, O as PRIMITIVE_SIGNATURE_HEADER, P as VerifyDownloadTokenOptions, R as safeValidateEmailReceivedEvent, S as StandardWebhooksVerifyOptions, T as LEGACY_CONFIRMED_HEADER, _ as emailReceivedEventJsonSchema, a as confirmedHeaders, b as STANDARD_WEBHOOK_TIMESTAMP_HEADER, c as handleWebhook, d as isRawIncluded, f as parseWebhookEvent, g as validateEmailAuth, h as WEBHOOK_VERSION, i as WebhookHeaders, j as signWebhookPayload, k as SignResult, l as isDownloadExpired, m as verifyRawEmailDownload, n as HandleWebhookOptions, o as decodeRawEmail, p as receive, r as ReceiveRequestOptions, s as getDownloadTimeRemaining, t as DecodeRawEmailOptions, u as isEmailReceivedEvent, v as STANDARD_WEBHOOK_ID_HEADER, w as verifyStandardWebhooksSignature, x as StandardWebhooksSignResult, y as STANDARD_WEBHOOK_SIGNATURE_HEADER, z as validateEmailReceivedEvent } from "./index-
|
|
1
|
+
import { c as SendThreadInput, i as ReplyInput, l as client, n as PrimitiveClient, o as SendInput, r as PrimitiveClientOptions, s as SendResult, t as ForwardInput, u as createPrimitiveClient, v as PrimitiveApiError } from "./index-BKeS9sOb.js";
|
|
2
|
+
import { A as UnknownEvent, C as ParsedDataFailed, D as RawContentDownloadOnly, E as RawContent, M as WebhookAttachment, N as WebhookEvent, O as RawContentInline, S as ParsedDataComplete, T as ParsedStatus, _ as ForwardResultInline, a as DmarcPolicy, b as KnownWebhookEvent, c as EmailAnalysis, d as EventType, f as ForwardAnalysis, g as ForwardResultAttachmentSkipped, h as ForwardResultAttachmentAnalyzed, i as DkimSignature, j as ValidateEmailAuthResult, k as SpfResult, l as EmailAuth, m as ForwardResult, n as AuthVerdict, o as DmarcResult, p as ForwardOriginalSender, r as DkimResult, s as EmailAddress, t as AuthConfidence, u as EmailReceivedEvent, v as ForwardVerdict, w as ParsedError, x as ParsedData, y as ForwardVerification } from "./types-BRWDMD7H.js";
|
|
3
|
+
import { _ as buildForwardSubject, a as RawEmailDecodeErrorCode, b as normalizeReceivedEmail, c as WebhookPayloadError, d as WebhookValidationErrorCode, f as WebhookVerificationError, g as ReceivedEmailThread, h as ReceivedEmailAddress, i as RawEmailDecodeError, l as WebhookPayloadErrorCode, m as ReceivedEmail, n as PrimitiveWebhookError, o as VERIFICATION_ERRORS, p as WebhookVerificationErrorCode, r as RAW_EMAIL_ERRORS, s as WebhookErrorCode, t as PAYLOAD_ERRORS, u as WebhookValidationError, v as buildReplySubject, x as parseHeaderAddress, y as formatAddress } from "./errors-CO-rv_nK.js";
|
|
4
|
+
import { A as VerifyOptions, C as signStandardWebhooksPayload, D as PRIMITIVE_CONFIRMED_HEADER, E as LEGACY_SIGNATURE_HEADER, F as VerifyDownloadTokenResult, I as generateDownloadToken, L as verifyDownloadToken, M as verifyWebhookSignature, N as GenerateDownloadTokenOptions, O as PRIMITIVE_SIGNATURE_HEADER, P as VerifyDownloadTokenOptions, R as safeValidateEmailReceivedEvent, S as StandardWebhooksVerifyOptions, T as LEGACY_CONFIRMED_HEADER, _ as emailReceivedEventJsonSchema, a as confirmedHeaders, b as STANDARD_WEBHOOK_TIMESTAMP_HEADER, c as handleWebhook, d as isRawIncluded, f as parseWebhookEvent, g as validateEmailAuth, h as WEBHOOK_VERSION, i as WebhookHeaders, j as signWebhookPayload, k as SignResult, l as isDownloadExpired, m as verifyRawEmailDownload, n as HandleWebhookOptions, o as decodeRawEmail, p as receive, r as ReceiveRequestOptions, s as getDownloadTimeRemaining, t as DecodeRawEmailOptions, u as isEmailReceivedEvent, v as STANDARD_WEBHOOK_ID_HEADER, w as verifyStandardWebhooksSignature, x as StandardWebhooksSignResult, y as STANDARD_WEBHOOK_SIGNATURE_HEADER, z as validateEmailReceivedEvent } from "./index-D_v8-0zX.js";
|
|
5
5
|
|
|
6
6
|
//#region src/index.d.ts
|
|
7
7
|
declare const primitive: {
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
import { A as PRIMITIVE_CONFIRMED_HEADER, C as STANDARD_WEBHOOK_ID_HEADER, D as verifyStandardWebhooksSignature, E as signStandardWebhooksPayload, F as verifyDownloadToken, I as safeValidateEmailReceivedEvent, L as validateEmailReceivedEvent, M as signWebhookPayload, N as verifyWebhookSignature, O as LEGACY_CONFIRMED_HEADER, P as generateDownloadToken, S as emailReceivedEventJsonSchema, T as STANDARD_WEBHOOK_TIMESTAMP_HEADER, _ as DmarcResult, a as isDownloadExpired, b as ParsedStatus, c as parseWebhookEvent, d as WEBHOOK_VERSION, f as validateEmailAuth, g as DmarcPolicy, h as DkimResult, i as handleWebhook, j as PRIMITIVE_SIGNATURE_HEADER, k as LEGACY_SIGNATURE_HEADER, l as receive, m as AuthVerdict, n as decodeRawEmail, o as isEmailReceivedEvent, p as AuthConfidence, r as getDownloadTimeRemaining, s as isRawIncluded, t as confirmedHeaders, u as verifyRawEmailDownload, v as EventType, w as STANDARD_WEBHOOK_SIGNATURE_HEADER, x as SpfResult, y as ForwardVerdict } from "./webhook-
|
|
1
|
+
import { l as PrimitiveApiError, n as client, r as createPrimitiveClient, t as PrimitiveClient } from "./api-3znV8SSN.js";
|
|
2
|
+
import { a as VERIFICATION_ERRORS, c as WebhookVerificationError, d as formatAddress, f as normalizeReceivedEmail, i as RawEmailDecodeError, l as buildForwardSubject, n as PrimitiveWebhookError, o as WebhookPayloadError, p as parseHeaderAddress, r as RAW_EMAIL_ERRORS, s as WebhookValidationError, t as PAYLOAD_ERRORS, u as buildReplySubject } from "./errors-BPJGp9I6.js";
|
|
3
|
+
import { A as PRIMITIVE_CONFIRMED_HEADER, C as STANDARD_WEBHOOK_ID_HEADER, D as verifyStandardWebhooksSignature, E as signStandardWebhooksPayload, F as verifyDownloadToken, I as safeValidateEmailReceivedEvent, L as validateEmailReceivedEvent, M as signWebhookPayload, N as verifyWebhookSignature, O as LEGACY_CONFIRMED_HEADER, P as generateDownloadToken, S as emailReceivedEventJsonSchema, T as STANDARD_WEBHOOK_TIMESTAMP_HEADER, _ as DmarcResult, a as isDownloadExpired, b as ParsedStatus, c as parseWebhookEvent, d as WEBHOOK_VERSION, f as validateEmailAuth, g as DmarcPolicy, h as DkimResult, i as handleWebhook, j as PRIMITIVE_SIGNATURE_HEADER, k as LEGACY_SIGNATURE_HEADER, l as receive, m as AuthVerdict, n as decodeRawEmail, o as isEmailReceivedEvent, p as AuthConfidence, r as getDownloadTimeRemaining, s as isRawIncluded, t as confirmedHeaders, u as verifyRawEmailDownload, v as EventType, w as STANDARD_WEBHOOK_SIGNATURE_HEADER, x as SpfResult, y as ForwardVerdict } from "./webhook-D4FTpj38.js";
|
|
4
4
|
//#region src/index.ts
|
|
5
5
|
const primitive = {
|
|
6
6
|
client,
|
package/dist/openapi/index.d.ts
CHANGED
|
@@ -1,53 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* OpenAPI document for the Primitive API.
|
|
4
|
-
*
|
|
5
|
-
* AUTO-GENERATED - DO NOT EDIT
|
|
6
|
-
* Run `pnpm generate:openapi` to regenerate.
|
|
7
|
-
*/
|
|
8
|
-
declare const openapiDocument: Record<string, unknown>;
|
|
9
|
-
//#endregion
|
|
10
|
-
//#region src/openapi/operations.generated.d.ts
|
|
11
|
-
/**
|
|
12
|
-
* Generated operation metadata for the Primitive API CLI and SDK tooling.
|
|
13
|
-
*
|
|
14
|
-
* AUTO-GENERATED - DO NOT EDIT
|
|
15
|
-
* Run `pnpm generate:openapi` to regenerate.
|
|
16
|
-
*/
|
|
17
|
-
type PrimitiveParameterManifest = {
|
|
18
|
-
description: string | null;
|
|
19
|
-
enum: string[] | null;
|
|
20
|
-
name: string;
|
|
21
|
-
required: boolean;
|
|
22
|
-
type: string;
|
|
23
|
-
};
|
|
24
|
-
type PrimitiveOperationManifest = {
|
|
25
|
-
binaryResponse: boolean;
|
|
26
|
-
bodyRequired: boolean;
|
|
27
|
-
command: string;
|
|
28
|
-
description: string | null;
|
|
29
|
-
hasJsonBody: boolean;
|
|
30
|
-
method: string;
|
|
31
|
-
operationId: string;
|
|
32
|
-
path: string;
|
|
33
|
-
pathParams: PrimitiveParameterManifest[];
|
|
34
|
-
queryParams: PrimitiveParameterManifest[];
|
|
35
|
-
/**
|
|
36
|
-
* Resolved JSON Schema for the request body when `hasJsonBody` is
|
|
37
|
-
* true. `$ref`s into the OpenAPI components are inlined.
|
|
38
|
-
*/
|
|
39
|
-
requestSchema: Record<string, unknown> | null;
|
|
40
|
-
/**
|
|
41
|
-
* Resolved JSON Schema for the 200/201 response body's `data`
|
|
42
|
-
* envelope contents. Same shape as `requestSchema`: `$ref`s
|
|
43
|
-
* inlined. Null on operations without a 200/201 JSON response.
|
|
44
|
-
*/
|
|
45
|
-
responseSchema: Record<string, unknown> | null;
|
|
46
|
-
sdkName: string;
|
|
47
|
-
summary: string | null;
|
|
48
|
-
tag: string;
|
|
49
|
-
tagCommand: string;
|
|
50
|
-
};
|
|
51
|
-
declare const operationManifest: PrimitiveOperationManifest[];
|
|
52
|
-
//#endregion
|
|
1
|
+
import { i as openapiDocument, n as PrimitiveParameterManifest, r as operationManifest, t as PrimitiveOperationManifest } from "../operations.generated-BJERV_56.js";
|
|
53
2
|
export { type PrimitiveOperationManifest, type PrimitiveParameterManifest, openapiDocument, operationManifest };
|