samva 0.13.0 → 0.15.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.
Files changed (73) hide show
  1. package/AGENTS.md +9 -0
  2. package/README.md +55 -6
  3. package/dist/{categories-Bcwq5jPV.js → categories-BGUBFdH9.js} +9 -1
  4. package/dist/client/sdk.gen.d.ts +129 -27
  5. package/dist/client/types.gen.d.ts +920 -166
  6. package/dist/{client-DYPNDvVU.js → client-CDg7zJs0.js} +760 -147
  7. package/dist/effect/analytics.d.ts +6 -6
  8. package/dist/effect/analytics.js +1 -1
  9. package/dist/effect/api-keys.d.ts +20 -20
  10. package/dist/effect/api-keys.js +1 -1
  11. package/dist/effect/attachments.js +1 -1
  12. package/dist/effect/brands.js +2 -2
  13. package/dist/effect/campaigns.d.ts +12 -12
  14. package/dist/effect/campaigns.js +1 -1
  15. package/dist/effect/categories.js +1 -1
  16. package/dist/effect/client.js +1 -1
  17. package/dist/effect/contact-groups.d.ts +9 -9
  18. package/dist/effect/contact-groups.js +1 -1
  19. package/dist/effect/contacts.d.ts +126 -73
  20. package/dist/effect/contacts.js +1 -1
  21. package/dist/effect/conversations.d.ts +20 -20
  22. package/dist/effect/conversations.js +1 -1
  23. package/dist/effect/custom-fields.d.ts +1 -1
  24. package/dist/effect/custom-fields.js +1 -1
  25. package/dist/effect/email.d.ts +26 -26
  26. package/dist/effect/email.js +2 -2
  27. package/dist/effect/extension-installations.d.ts +3 -3
  28. package/dist/effect/extension-installations.js +1 -1
  29. package/dist/effect/extensions.d.ts +3 -3
  30. package/dist/effect/extensions.js +1 -1
  31. package/dist/effect/feedback.d.ts +1 -1
  32. package/dist/effect/feedback.js +2 -2
  33. package/dist/effect/generated-metadata.d.ts +8 -0
  34. package/dist/effect/generated.d.ts +6335 -1112
  35. package/dist/effect/index.d.ts +2 -1
  36. package/dist/effect/index.js +6 -5
  37. package/dist/effect/internal/client.d.ts +2 -2
  38. package/dist/effect/internal/operation.d.ts +9 -9
  39. package/dist/effect/mailboxes.d.ts +1775 -109
  40. package/dist/effect/mailboxes.js +3 -3
  41. package/dist/effect/media.d.ts +1 -1
  42. package/dist/effect/media.js +1 -1
  43. package/dist/effect/messages.d.ts +19 -17
  44. package/dist/effect/messages.js +1 -1
  45. package/dist/effect/namespaces.js +1 -1
  46. package/dist/effect/operations.d.ts +6 -6
  47. package/dist/effect/operations.js +1 -1
  48. package/dist/effect/organizations.d.ts +30 -0
  49. package/dist/effect/organizations.js +4 -2
  50. package/dist/effect/retry.js +1 -1
  51. package/dist/effect/scheduled-messages.d.ts +6 -6
  52. package/dist/effect/scheduled-messages.js +1 -1
  53. package/dist/effect/subscriptions.d.ts +15 -0
  54. package/dist/effect/subscriptions.js +9 -0
  55. package/dist/effect/templates.d.ts +52 -14
  56. package/dist/effect/templates.js +5 -3
  57. package/dist/effect/unsubscribe-groups.d.ts +1 -1
  58. package/dist/effect/unsubscribe-groups.js +1 -1
  59. package/dist/effect/webhooks.d.ts +15 -15
  60. package/dist/effect/webhooks.js +2 -2
  61. package/dist/index.js +4 -4
  62. package/dist/{inline-attachments-B56eS0MF.js → inline-attachments-UxLeyytJ.js} +2 -2
  63. package/dist/{mailbox-events-CsbF35vH.js → mailbox-events-VKR4f3qq.js} +6 -4
  64. package/dist/mailbox-events.d.ts +1 -1
  65. package/dist/{mailboxes-D3Kx7elM.js → mailboxes-BH_JPmOE.js} +17 -5
  66. package/dist/{operation-B_Ty1LG-.js → operation-BZ5Xov-x.js} +37 -3
  67. package/dist/promises/errors.gen.d.ts +26 -2
  68. package/dist/promises/index.d.ts +6 -4
  69. package/dist/promises/index.js +4 -4
  70. package/dist/promises/types.gen.d.ts +1 -1
  71. package/dist/{promises-D9FJyU0q.js → promises-Cd6Jamqk.js} +1004 -47
  72. package/dist/service-map.d.ts +45 -0
  73. package/package.json +7 -2
@@ -3,13 +3,13 @@ export declare const list: ((input?: {
3
3
  readonly limit?: string | null | undefined;
4
4
  readonly cursor?: string | null | undefined;
5
5
  readonly search?: string | null | undefined;
6
- readonly status?: string | null | undefined;
6
+ readonly status?: "active" | "disabled" | null | undefined;
7
7
  } | undefined) => import("effect/Effect").Effect<{
8
8
  readonly items: readonly {
9
9
  readonly id: string & import("effect/Brand").Brand<"WebhookEndpointId">;
10
10
  readonly name: string;
11
11
  readonly url: string;
12
- readonly eventTypes: readonly ("contact.created" | "contact.deleted" | "contact.resubscribed" | "contact.unsubscribed" | "contact.updated" | "conversation.archived" | "conversation.created" | "conversation.updated" | "domain.updated" | "domain.warming.updated" | "mailbox.action.pending_approval" | "mailbox.message.discarded" | "mailbox.message.quarantined" | "mailbox.message.received" | "mailbox.message.released" | "mailbox.message.sent" | "message.bounced" | "message.clicked" | "message.complained" | "message.delivered" | "message.failed" | "message.opened" | "message.read" | "message.received" | "message.sent" | "webhook.created" | "webhook.deleted" | "webhook.test" | "webhook.updated")[];
12
+ readonly eventTypes: readonly ("contact.created" | "contact.deleted" | "contact.resubscribed" | "contact.subscribed" | "contact.unsubscribed" | "contact.updated" | "conversation.archived" | "conversation.created" | "conversation.updated" | "domain.updated" | "domain.warming.updated" | "mailbox.action.pending_approval" | "mailbox.message.discarded" | "mailbox.message.quarantined" | "mailbox.message.received" | "mailbox.message.released" | "mailbox.message.sent" | "message.bounced" | "message.clicked" | "message.complained" | "message.delivered" | "message.failed" | "message.opened" | "message.read" | "message.received" | "message.sent" | "webhook.created" | "webhook.deleted" | "webhook.test" | "webhook.updated")[];
13
13
  readonly channels: readonly "email"[] | null;
14
14
  readonly mailboxIds: readonly (string & import("effect/Brand").Brand<"MailboxId">)[] | null;
15
15
  readonly namespaceId: (string & import("effect/Brand").Brand<"NamespaceId">) | null;
@@ -33,13 +33,13 @@ export declare const list: ((input?: {
33
33
  readonly limit?: string | null | undefined;
34
34
  readonly cursor?: string | null | undefined;
35
35
  readonly search?: string | null | undefined;
36
- readonly status?: string | null | undefined;
36
+ readonly status?: "active" | "disabled" | null | undefined;
37
37
  } | undefined) => import("effect/Stream").Stream<{
38
38
  readonly items: readonly {
39
39
  readonly id: string & import("effect/Brand").Brand<"WebhookEndpointId">;
40
40
  readonly name: string;
41
41
  readonly url: string;
42
- readonly eventTypes: readonly ("contact.created" | "contact.deleted" | "contact.resubscribed" | "contact.unsubscribed" | "contact.updated" | "conversation.archived" | "conversation.created" | "conversation.updated" | "domain.updated" | "domain.warming.updated" | "mailbox.action.pending_approval" | "mailbox.message.discarded" | "mailbox.message.quarantined" | "mailbox.message.received" | "mailbox.message.released" | "mailbox.message.sent" | "message.bounced" | "message.clicked" | "message.complained" | "message.delivered" | "message.failed" | "message.opened" | "message.read" | "message.received" | "message.sent" | "webhook.created" | "webhook.deleted" | "webhook.test" | "webhook.updated")[];
42
+ readonly eventTypes: readonly ("contact.created" | "contact.deleted" | "contact.resubscribed" | "contact.subscribed" | "contact.unsubscribed" | "contact.updated" | "conversation.archived" | "conversation.created" | "conversation.updated" | "domain.updated" | "domain.warming.updated" | "mailbox.action.pending_approval" | "mailbox.message.discarded" | "mailbox.message.quarantined" | "mailbox.message.received" | "mailbox.message.released" | "mailbox.message.sent" | "message.bounced" | "message.clicked" | "message.complained" | "message.delivered" | "message.failed" | "message.opened" | "message.read" | "message.received" | "message.sent" | "webhook.created" | "webhook.deleted" | "webhook.test" | "webhook.updated")[];
43
43
  readonly channels: readonly "email"[] | null;
44
44
  readonly mailboxIds: readonly (string & import("effect/Brand").Brand<"MailboxId">)[] | null;
45
45
  readonly namespaceId: (string & import("effect/Brand").Brand<"NamespaceId">) | null;
@@ -63,12 +63,12 @@ export declare const list: ((input?: {
63
63
  readonly limit?: string | null | undefined;
64
64
  readonly cursor?: string | null | undefined;
65
65
  readonly search?: string | null | undefined;
66
- readonly status?: string | null | undefined;
66
+ readonly status?: "active" | "disabled" | null | undefined;
67
67
  } | undefined) => import("effect/Stream").Stream<{
68
68
  readonly id: string & import("effect/Brand").Brand<"WebhookEndpointId">;
69
69
  readonly name: string;
70
70
  readonly url: string;
71
- readonly eventTypes: readonly ("contact.created" | "contact.deleted" | "contact.resubscribed" | "contact.unsubscribed" | "contact.updated" | "conversation.archived" | "conversation.created" | "conversation.updated" | "domain.updated" | "domain.warming.updated" | "mailbox.action.pending_approval" | "mailbox.message.discarded" | "mailbox.message.quarantined" | "mailbox.message.received" | "mailbox.message.released" | "mailbox.message.sent" | "message.bounced" | "message.clicked" | "message.complained" | "message.delivered" | "message.failed" | "message.opened" | "message.read" | "message.received" | "message.sent" | "webhook.created" | "webhook.deleted" | "webhook.test" | "webhook.updated")[];
71
+ readonly eventTypes: readonly ("contact.created" | "contact.deleted" | "contact.resubscribed" | "contact.subscribed" | "contact.unsubscribed" | "contact.updated" | "conversation.archived" | "conversation.created" | "conversation.updated" | "domain.updated" | "domain.warming.updated" | "mailbox.action.pending_approval" | "mailbox.message.discarded" | "mailbox.message.quarantined" | "mailbox.message.received" | "mailbox.message.released" | "mailbox.message.sent" | "message.bounced" | "message.clicked" | "message.complained" | "message.delivered" | "message.failed" | "message.opened" | "message.read" | "message.received" | "message.sent" | "webhook.created" | "webhook.deleted" | "webhook.test" | "webhook.updated")[];
72
72
  readonly channels: readonly "email"[] | null;
73
73
  readonly mailboxIds: readonly (string & import("effect/Brand").Brand<"MailboxId">)[] | null;
74
74
  readonly namespaceId: (string & import("effect/Brand").Brand<"NamespaceId">) | null;
@@ -90,20 +90,20 @@ export declare const list: ((input?: {
90
90
  export declare const create: (input: {
91
91
  readonly name: string;
92
92
  readonly url: string;
93
- readonly eventTypes: readonly string[];
94
- readonly channels?: readonly string[] | null | undefined;
93
+ readonly eventTypes: readonly ("contact.created" | "contact.deleted" | "contact.resubscribed" | "contact.subscribed" | "contact.unsubscribed" | "contact.updated" | "conversation.archived" | "conversation.created" | "conversation.updated" | "domain.updated" | "domain.warming.updated" | "mailbox.action.pending_approval" | "mailbox.message.discarded" | "mailbox.message.quarantined" | "mailbox.message.received" | "mailbox.message.released" | "mailbox.message.sent" | "message.bounced" | "message.clicked" | "message.complained" | "message.delivered" | "message.failed" | "message.opened" | "message.read" | "message.received" | "message.sent" | "webhook.created" | "webhook.deleted" | "webhook.test" | "webhook.updated")[];
94
+ readonly channels?: readonly "email"[] | null | undefined;
95
95
  readonly mailboxIds?: readonly string[] | null | undefined;
96
96
  readonly namespaceId?: string | null | undefined;
97
97
  readonly headers?: {
98
98
  readonly [x: string]: string | undefined;
99
99
  } | null | undefined;
100
- readonly status?: string | null | undefined;
100
+ readonly status?: "active" | "disabled" | null | undefined;
101
101
  }) => import("effect/Effect").Effect<{
102
102
  readonly endpoint: {
103
103
  readonly id: string & import("effect/Brand").Brand<"WebhookEndpointId">;
104
104
  readonly name: string;
105
105
  readonly url: string;
106
- readonly eventTypes: readonly ("contact.created" | "contact.deleted" | "contact.resubscribed" | "contact.unsubscribed" | "contact.updated" | "conversation.archived" | "conversation.created" | "conversation.updated" | "domain.updated" | "domain.warming.updated" | "mailbox.action.pending_approval" | "mailbox.message.discarded" | "mailbox.message.quarantined" | "mailbox.message.received" | "mailbox.message.released" | "mailbox.message.sent" | "message.bounced" | "message.clicked" | "message.complained" | "message.delivered" | "message.failed" | "message.opened" | "message.read" | "message.received" | "message.sent" | "webhook.created" | "webhook.deleted" | "webhook.test" | "webhook.updated")[];
106
+ readonly eventTypes: readonly ("contact.created" | "contact.deleted" | "contact.resubscribed" | "contact.subscribed" | "contact.unsubscribed" | "contact.updated" | "conversation.archived" | "conversation.created" | "conversation.updated" | "domain.updated" | "domain.warming.updated" | "mailbox.action.pending_approval" | "mailbox.message.discarded" | "mailbox.message.quarantined" | "mailbox.message.received" | "mailbox.message.released" | "mailbox.message.sent" | "message.bounced" | "message.clicked" | "message.complained" | "message.delivered" | "message.failed" | "message.opened" | "message.read" | "message.received" | "message.sent" | "webhook.created" | "webhook.deleted" | "webhook.test" | "webhook.updated")[];
107
107
  readonly channels: readonly "email"[] | null;
108
108
  readonly mailboxIds: readonly (string & import("effect/Brand").Brand<"MailboxId">)[] | null;
109
109
  readonly namespaceId: (string & import("effect/Brand").Brand<"NamespaceId">) | null;
@@ -122,7 +122,7 @@ export declare const get: (input: {
122
122
  readonly id: string & import("effect/Brand").Brand<"WebhookEndpointId">;
123
123
  readonly name: string;
124
124
  readonly url: string;
125
- readonly eventTypes: readonly ("contact.created" | "contact.deleted" | "contact.resubscribed" | "contact.unsubscribed" | "contact.updated" | "conversation.archived" | "conversation.created" | "conversation.updated" | "domain.updated" | "domain.warming.updated" | "mailbox.action.pending_approval" | "mailbox.message.discarded" | "mailbox.message.quarantined" | "mailbox.message.received" | "mailbox.message.released" | "mailbox.message.sent" | "message.bounced" | "message.clicked" | "message.complained" | "message.delivered" | "message.failed" | "message.opened" | "message.read" | "message.received" | "message.sent" | "webhook.created" | "webhook.deleted" | "webhook.test" | "webhook.updated")[];
125
+ readonly eventTypes: readonly ("contact.created" | "contact.deleted" | "contact.resubscribed" | "contact.subscribed" | "contact.unsubscribed" | "contact.updated" | "conversation.archived" | "conversation.created" | "conversation.updated" | "domain.updated" | "domain.warming.updated" | "mailbox.action.pending_approval" | "mailbox.message.discarded" | "mailbox.message.quarantined" | "mailbox.message.received" | "mailbox.message.released" | "mailbox.message.sent" | "message.bounced" | "message.clicked" | "message.complained" | "message.delivered" | "message.failed" | "message.opened" | "message.read" | "message.received" | "message.sent" | "webhook.created" | "webhook.deleted" | "webhook.test" | "webhook.updated")[];
126
126
  readonly channels: readonly "email"[] | null;
127
127
  readonly mailboxIds: readonly (string & import("effect/Brand").Brand<"MailboxId">)[] | null;
128
128
  readonly namespaceId: (string & import("effect/Brand").Brand<"NamespaceId">) | null;
@@ -142,19 +142,19 @@ export declare const update: (input: {
142
142
  readonly id: string;
143
143
  readonly name?: string | null | undefined;
144
144
  readonly url?: string | null | undefined;
145
- readonly eventTypes?: readonly string[] | null | undefined;
146
- readonly channels?: readonly string[] | null | undefined;
145
+ readonly eventTypes?: readonly ("contact.created" | "contact.deleted" | "contact.resubscribed" | "contact.subscribed" | "contact.unsubscribed" | "contact.updated" | "conversation.archived" | "conversation.created" | "conversation.updated" | "domain.updated" | "domain.warming.updated" | "mailbox.action.pending_approval" | "mailbox.message.discarded" | "mailbox.message.quarantined" | "mailbox.message.received" | "mailbox.message.released" | "mailbox.message.sent" | "message.bounced" | "message.clicked" | "message.complained" | "message.delivered" | "message.failed" | "message.opened" | "message.read" | "message.received" | "message.sent" | "webhook.created" | "webhook.deleted" | "webhook.test" | "webhook.updated")[] | null | undefined;
146
+ readonly channels?: readonly "email"[] | null | undefined;
147
147
  readonly mailboxIds?: readonly string[] | null | undefined;
148
148
  readonly namespaceId?: string | null | undefined;
149
149
  readonly headers?: {
150
150
  readonly [x: string]: string | undefined;
151
151
  } | null | undefined;
152
- readonly status?: string | null | undefined;
152
+ readonly status?: "active" | "disabled" | null | undefined;
153
153
  }) => import("effect/Effect").Effect<{
154
154
  readonly id: string & import("effect/Brand").Brand<"WebhookEndpointId">;
155
155
  readonly name: string;
156
156
  readonly url: string;
157
- readonly eventTypes: readonly ("contact.created" | "contact.deleted" | "contact.resubscribed" | "contact.unsubscribed" | "contact.updated" | "conversation.archived" | "conversation.created" | "conversation.updated" | "domain.updated" | "domain.warming.updated" | "mailbox.action.pending_approval" | "mailbox.message.discarded" | "mailbox.message.quarantined" | "mailbox.message.received" | "mailbox.message.released" | "mailbox.message.sent" | "message.bounced" | "message.clicked" | "message.complained" | "message.delivered" | "message.failed" | "message.opened" | "message.read" | "message.received" | "message.sent" | "webhook.created" | "webhook.deleted" | "webhook.test" | "webhook.updated")[];
157
+ readonly eventTypes: readonly ("contact.created" | "contact.deleted" | "contact.resubscribed" | "contact.subscribed" | "contact.unsubscribed" | "contact.updated" | "conversation.archived" | "conversation.created" | "conversation.updated" | "domain.updated" | "domain.warming.updated" | "mailbox.action.pending_approval" | "mailbox.message.discarded" | "mailbox.message.quarantined" | "mailbox.message.received" | "mailbox.message.released" | "mailbox.message.sent" | "message.bounced" | "message.clicked" | "message.complained" | "message.delivered" | "message.failed" | "message.opened" | "message.read" | "message.received" | "message.sent" | "webhook.created" | "webhook.deleted" | "webhook.test" | "webhook.updated")[];
158
158
  readonly channels: readonly "email"[] | null;
159
159
  readonly mailboxIds: readonly (string & import("effect/Brand").Brand<"MailboxId">)[] | null;
160
160
  readonly namespaceId: (string & import("effect/Brand").Brand<"NamespaceId">) | null;
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.js";
2
- import { n as make } from "../operation-B_Ty1LG-.js";
3
- import { E as TestWebhookPayload, f as CreateWebhookPayload, j as UpdateWebhookPayload } from "../client-DYPNDvVU.js";
2
+ import { n as make } from "../operation-BZ5Xov-x.js";
3
+ import { P as UpdateWebhookPayload, f as CreateWebhookPayload, k as TestWebhookPayload } from "../client-CDg7zJs0.js";
4
4
  //#region src/effect/webhooks.ts
5
5
  var webhooks_exports = /* @__PURE__ */ __exportAll({
6
6
  CreatePayload: () => CreateWebhookPayload,
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as MediaUploadError } from "./inline-attachments-B56eS0MF.js";
2
- import { C as fromApiError, S as ValidationError, _ as ResourceNotFoundError, a as CampaignFooterRequiredError, b as SenderNotReadyError, c as EmailChannelError, d as ForbiddenError, f as GatewayTimeoutError, g as RateLimitedError, h as PaymentRequiredError, i as BrandAddressRequiredError, l as ExternalServiceError, m as OnboardingReviewRequiredError, n as AnalyticsQueryError, o as ConflictError, p as InternalError, r as BillingProviderError, s as DeliveryUnavailableError, t as createClient, u as FlagDisabledError, v as SamvaApiError, x as UnauthorizedError, y as SamvaTransportError } from "./promises-D9FJyU0q.js";
3
- import { n as MailboxEventStreamError, t as MailboxEventStream } from "./mailbox-events-CsbF35vH.js";
4
- export { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, DeliveryUnavailableError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, MailboxEventStream, MailboxEventStreamError, MediaUploadError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTransportError, SenderNotReadyError, UnauthorizedError, ValidationError, createClient, fromApiError };
1
+ import { t as MediaUploadError } from "./inline-attachments-UxLeyytJ.js";
2
+ import { C as UnauthorizedError, S as SenderNotReadyError, T as fromApiError, _ as PaymentRequiredError, a as CampaignFooterRequiredError, b as SamvaApiError, c as EmailChannelError, d as ForbiddenError, f as GatewayTimeoutError, g as OnboardingReviewRequiredError, h as MailboxSendRefusedError, i as BrandAddressRequiredError, l as ExternalServiceError, m as MailboxSendConflictError, n as AnalyticsQueryError, o as ConflictError, p as InternalError, r as BillingProviderError, s as DeliveryUnavailableError, t as createClient, u as FlagDisabledError, v as RateLimitedError, w as ValidationError, x as SamvaTransportError, y as ResourceNotFoundError } from "./promises-Cd6Jamqk.js";
3
+ import { n as MailboxEventStreamError, t as MailboxEventStream } from "./mailbox-events-VKR4f3qq.js";
4
+ export { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, DeliveryUnavailableError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, MailboxEventStream, MailboxEventStreamError, MailboxSendConflictError, MailboxSendRefusedError, MediaUploadError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTransportError, SenderNotReadyError, UnauthorizedError, ValidationError, createClient, fromApiError };
@@ -1,6 +1,6 @@
1
1
  //#endregion
2
2
  //#region src/client-attribution.ts
3
- const SDK_VERSION = "0.13.0";
3
+ const SDK_VERSION = "0.15.0";
4
4
  const CLIENT_ATTRIBUTION_HEADER = "x-samva-client";
5
5
  const clientAttribution = (surface) => `${surface}/${SDK_VERSION}`;
6
6
  /** A failed upload of an attachment's bytes to its presigned media URL. */
@@ -118,4 +118,4 @@ const withUploadedAttachments = (payload, uploaded) => {
118
118
  //#endregion
119
119
  export { withUploadedAttachments as a, uploadContentType as i, mediaCreateBody as n, CLIENT_ATTRIBUTION_HEADER as o, planInlineUploads as r, clientAttribution as s, MediaUploadError as t };
120
120
 
121
- //# sourceMappingURL=inline-attachments-B56eS0MF.js.map
121
+ //# sourceMappingURL=inline-attachments-UxLeyytJ.js.map
@@ -441,7 +441,9 @@ var MailboxEventStream = class {
441
441
  });
442
442
  }
443
443
  /** One connection, from upgrade to close. `onLive` runs once replay has caught up. */
444
- #connect(onLive) {
444
+ async #connect(onLive) {
445
+ const headers = typeof this.#connection.headers === "function" ? await this.#connection.headers() : this.#connection.headers;
446
+ if (this.#ended) return { kind: "stopped" };
445
447
  return new Promise((resolve) => {
446
448
  const WebSocketImplementation = this.#options.WebSocket ?? globalWebSocket();
447
449
  if (WebSocketImplementation === void 0) {
@@ -481,7 +483,7 @@ var MailboxEventStream = class {
481
483
  const onStop = () => settle({ kind: "stopped" });
482
484
  let socket;
483
485
  try {
484
- socket = new WebSocketImplementation(url.toString(), { headers: this.#connection.headers });
486
+ socket = new WebSocketImplementation(url.toString(), { headers });
485
487
  } catch (cause) {
486
488
  this.#fail(new MailboxEventStreamError({
487
489
  _tag: "StreamClientError",
@@ -568,7 +570,7 @@ var MailboxEventStream = class {
568
570
  const diagnosis = (async () => {
569
571
  try {
570
572
  const response = await (this.#connection.fetch ?? fetch)(url, {
571
- headers: this.#connection.headers,
573
+ headers: typeof this.#connection.headers === "function" ? await this.#connection.headers() : this.#connection.headers,
572
574
  signal: deadline.signal
573
575
  });
574
576
  if (response.status === 426) {
@@ -626,4 +628,4 @@ const readRefusalBody = async (response) => {
626
628
  //#endregion
627
629
  export { MailboxEventStreamError as n, MailboxEventStream as t };
628
630
 
629
- //# sourceMappingURL=mailbox-events-CsbF35vH.js.map
631
+ //# sourceMappingURL=mailbox-events-VKR4f3qq.js.map
@@ -136,7 +136,7 @@ export interface MailboxEventStreamOptions {
136
136
  export interface MailboxEventStreamConnection {
137
137
  readonly baseUrl: string;
138
138
  /** The credential and attribution headers every request of the client carries. */
139
- readonly headers: Readonly<Record<string, string>>;
139
+ readonly headers: Readonly<Record<string, string>> | (() => Promise<Readonly<Record<string, string>>>);
140
140
  readonly fetch?: typeof fetch | undefined;
141
141
  }
142
142
  /** The frame that asks the events host whether the connection is alive; pinned to the host's by a test. */
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
2
- import { n as MailboxEventStreamError, t as MailboxEventStream } from "./mailbox-events-CsbF35vH.js";
3
- import { n as make } from "./operation-B_Ty1LG-.js";
4
- import { t as Service } from "./client-DYPNDvVU.js";
2
+ import { n as MailboxEventStreamError, t as MailboxEventStream } from "./mailbox-events-VKR4f3qq.js";
3
+ import { n as make } from "./operation-BZ5Xov-x.js";
4
+ import { t as Service } from "./client-CDg7zJs0.js";
5
5
  import { Cause, Effect, Exit, Stream } from "effect";
6
6
  //#region src/effect/internal/mailbox-events.ts
7
7
  const toStreamError = (cause) => cause instanceof MailboxEventStreamError ? cause : new MailboxEventStreamError({
@@ -35,7 +35,10 @@ var mailboxes_exports = /* @__PURE__ */ __exportAll({
35
35
  MailboxEventStreamError: () => MailboxEventStreamError,
36
36
  addThreadLabels: () => addThreadLabels,
37
37
  approveAction: () => approveAction,
38
+ cancelAction: () => cancelAction,
39
+ copyMessageAttachment: () => copyMessageAttachment,
38
40
  create: () => create,
41
+ createAddress: () => createAddress,
39
42
  createDraft: () => createDraft,
40
43
  createGrant: () => createGrant,
41
44
  createLabel: () => createLabel,
@@ -50,6 +53,7 @@ var mailboxes_exports = /* @__PURE__ */ __exportAll({
50
53
  events: () => events,
51
54
  forward: () => forward,
52
55
  get: () => get,
56
+ getAction: () => getAction,
53
57
  getAgentActivity: () => getAgentActivity,
54
58
  getDraft: () => getDraft,
55
59
  getMessage: () => getMessage,
@@ -73,10 +77,12 @@ var mailboxes_exports = /* @__PURE__ */ __exportAll({
73
77
  pause: () => pause,
74
78
  releaseMessage: () => releaseMessage,
75
79
  remove: () => remove,
80
+ removeAddress: () => removeAddress,
76
81
  removeThreadLabels: () => removeThreadLabels,
77
82
  reply: () => reply,
78
83
  replyAll: () => replyAll,
79
84
  resume: () => resume,
85
+ retryAction: () => retryAction,
80
86
  revokeGrant: () => revokeGrant,
81
87
  sendDraft: () => sendDraft,
82
88
  sendMessage: () => sendMessage,
@@ -93,6 +99,8 @@ const create = make("mailboxesCreate");
93
99
  const get = make("mailboxesGet");
94
100
  const update = make("mailboxesUpdate");
95
101
  const remove = make("mailboxesRemove");
102
+ const createAddress = make("mailboxesCreateAddress");
103
+ const removeAddress = make("mailboxesRemoveAddress");
96
104
  const pause = make("mailboxesPause");
97
105
  const resume = make("mailboxesResume");
98
106
  const getAgentActivity = make("mailboxesGetAgentActivity");
@@ -125,6 +133,7 @@ const sendMessage = make("mailboxesSendMessage");
125
133
  const getMessage = make("mailboxesGetMessage");
126
134
  const getMessageRaw = make("mailboxesGetMessageRaw");
127
135
  const getMessageAttachment = make("mailboxesGetMessageAttachment");
136
+ const copyMessageAttachment = make("mailboxesCopyMessageAttachment");
128
137
  const reply = make("mailboxesReply");
129
138
  const replyAll = make("mailboxesReplyAll");
130
139
  const forward = make("mailboxesForward");
@@ -138,10 +147,13 @@ const updateDraft = make("mailboxesUpdateDraft");
138
147
  const deleteDraft = make("mailboxesDeleteDraft");
139
148
  const sendDraft = make("mailboxesSendDraft");
140
149
  const listActions = make("mailboxesListActions");
150
+ const getAction = make("mailboxesGetAction");
151
+ const cancelAction = make("mailboxesCancelAction");
152
+ const retryAction = make("mailboxesRetryAction");
141
153
  const approveAction = make("mailboxesApproveAction");
142
154
  const denyAction = make("mailboxesDenyAction");
143
155
  const listEvents = make("mailboxesListEvents");
144
156
  //#endregion
145
- export { updatePolicy as $, listGrants as A, remove as B, getThread as C, listDrafts as D, listActions as E, listThreadNotes as F, revokeGrant as G, reply as H, listThreads as I, update as J, sendDraft as K, mailboxes_exports as L, listPolicies as M, listQuarantine as N, listEvents as O, listThreadMessages as P, updateNote as Q, pause as R, getPolicy as S, list as T, replyAll as U, removeThreadLabels as V, resume as W, updateGrant as X, updateDraft as Y, updateLabel as Z, getAgentActivity as _, createGrant as a, getMessageAttachment as b, createPolicy as c, deleteNote as d, updateThread as et, deletePolicy as f, get as g, forward as h, createDraft as i, listLabels as j, listFolders as k, deleteDraft as l, discardMessage as m, approveAction as n, createLabel as o, denyAction as p, sendMessage as q, create as r, createNote as s, addThreadLabels as t, events as tt, deleteLabel as u, getDraft as v, getThreadContent as w, getMessageRaw as x, getMessage as y, releaseMessage as z };
157
+ export { sendMessage as $, listActions as A, listThreads as B, getMessage as C, getThread as D, getPolicy as E, listLabels as F, removeAddress as G, pause as H, listPolicies as I, replyAll as J, removeThreadLabels as K, listQuarantine as L, listEvents as M, listFolders as N, getThreadContent as O, listGrants as P, sendDraft as Q, listThreadMessages as R, getDraft as S, getMessageRaw as T, releaseMessage as U, mailboxes_exports as V, remove as W, retryAction as X, resume as Y, revokeGrant as Z, discardMessage as _, create as a, updatePolicy as at, getAction as b, createGrant as c, createPolicy as d, update as et, deleteDraft as f, denyAction as g, deletePolicy as h, copyMessageAttachment as i, updateNote as it, listDrafts as j, list as k, createLabel as l, deleteNote as m, approveAction as n, updateGrant as nt, createAddress as o, updateThread as ot, deleteLabel as p, reply as q, cancelAction as r, updateLabel as rt, createDraft as s, events as st, addThreadLabels as t, updateDraft as tt, createNote as u, forward as v, getMessageAttachment as w, getAgentActivity as x, get as y, listThreadNotes as z };
146
158
 
147
- //# sourceMappingURL=mailboxes-D3Kx7elM.js.map
159
+ //# sourceMappingURL=mailboxes-BH_JPmOE.js.map
@@ -1,6 +1,6 @@
1
- import { a as withUploadedAttachments, n as mediaCreateBody, r as planInlineUploads } from "./inline-attachments-B56eS0MF.js";
1
+ import { a as withUploadedAttachments, n as mediaCreateBody, r as planInlineUploads } from "./inline-attachments-UxLeyytJ.js";
2
2
  import { n as buildMessagesSendPayload, r as replyToEmailsPayload, t as buildEmailSendPayload } from "./normalize-B79uJIeb.js";
3
- import { t as Service, w as SamvaApi } from "./client-DYPNDvVU.js";
3
+ import { E as SamvaApi, t as Service } from "./client-CDg7zJs0.js";
4
4
  import { generateIdempotencyKey, withRetry } from "./effect/retry.js";
5
5
  import { Effect, Option, Predicate, Stream } from "effect";
6
6
  //#region src/service-map.ts
@@ -524,6 +524,10 @@ const SDK_OPERATION_CALLS = {
524
524
  kind: "path",
525
525
  paths: ["id", "publicationId"]
526
526
  },
527
+ templatesRenderPublication: {
528
+ kind: "pathPayload",
529
+ paths: ["id", "publicationId"]
530
+ },
527
531
  templatesListInputContracts: {
528
532
  kind: "pathParams",
529
533
  paths: ["id"]
@@ -569,6 +573,7 @@ const SDK_OPERATION_CALLS = {
569
573
  organizationsCreate: { kind: "payload" },
570
574
  organizationsGet: { kind: "none" },
571
575
  organizationsGetProfile: { kind: "none" },
576
+ organizationsGetTrustTier: { kind: "none" },
572
577
  organizationsUpdate: { kind: "payload" },
573
578
  organizationsGetUsage: { kind: "params" },
574
579
  organizationsDelete: { kind: "idempotentPayload" },
@@ -653,6 +658,7 @@ const SDK_OPERATION_CALLS = {
653
658
  kind: "path",
654
659
  paths: ["id"]
655
660
  },
661
+ subscriptionsSubscribe: { kind: "payload" },
656
662
  unsubscribeList: { kind: "none" },
657
663
  unsubscribeCreate: { kind: "payload" },
658
664
  unsubscribeUpdate: {
@@ -700,6 +706,14 @@ const SDK_OPERATION_CALLS = {
700
706
  kind: "path",
701
707
  paths: ["id"]
702
708
  },
709
+ mailboxesCreateAddress: {
710
+ kind: "pathPayload",
711
+ paths: ["id"]
712
+ },
713
+ mailboxesRemoveAddress: {
714
+ kind: "path",
715
+ paths: ["id", "addressId"]
716
+ },
703
717
  mailboxesPause: {
704
718
  kind: "path",
705
719
  paths: ["id"]
@@ -840,6 +854,14 @@ const SDK_OPERATION_CALLS = {
840
854
  "attachmentId"
841
855
  ]
842
856
  },
857
+ mailboxesCopyMessageAttachment: {
858
+ kind: "path",
859
+ paths: [
860
+ "id",
861
+ "messageId",
862
+ "attachmentId"
863
+ ]
864
+ },
843
865
  mailboxesReply: {
844
866
  kind: "optionalIdempotentPathPayload",
845
867
  paths: ["id", "messageId"]
@@ -892,6 +914,18 @@ const SDK_OPERATION_CALLS = {
892
914
  kind: "pathParams",
893
915
  paths: ["id"]
894
916
  },
917
+ mailboxesGetAction: {
918
+ kind: "path",
919
+ paths: ["id", "actionId"]
920
+ },
921
+ mailboxesCancelAction: {
922
+ kind: "path",
923
+ paths: ["id", "actionId"]
924
+ },
925
+ mailboxesRetryAction: {
926
+ kind: "path",
927
+ paths: ["id", "actionId"]
928
+ },
895
929
  mailboxesApproveAction: {
896
930
  kind: "path",
897
931
  paths: ["id", "actionId"]
@@ -1177,4 +1211,4 @@ const addEmailSender = Effect.fn("Email.addSender")(function* (input, options) {
1177
1211
  //#endregion
1178
1212
  export { sendMessage as i, make as n, sendEmail as r, addEmailSender as t };
1179
1213
 
1180
- //# sourceMappingURL=operation-B_Ty1LG-.js.map
1214
+ //# sourceMappingURL=operation-BZ5Xov-x.js.map
@@ -1,4 +1,4 @@
1
- export type SamvaApiErrorTag = "AnalyticsQueryError" | "BillingProviderError" | "BrandAddressRequiredError" | "CampaignFooterRequiredError" | "ConflictError" | "DeliveryUnavailableError" | "EmailChannelError" | "ExternalServiceError" | "FlagDisabledError" | "ForbiddenError" | "GatewayTimeoutError" | "InternalError" | "OnboardingReviewRequiredError" | "PaymentRequiredError" | "RateLimitedError" | "ResourceNotFoundError" | "SenderNotReadyError" | "UnauthorizedError" | "ValidationError";
1
+ export type SamvaApiErrorTag = "AnalyticsQueryError" | "BillingProviderError" | "BrandAddressRequiredError" | "CampaignFooterRequiredError" | "ConflictError" | "DeliveryUnavailableError" | "EmailChannelError" | "ExternalServiceError" | "FlagDisabledError" | "ForbiddenError" | "GatewayTimeoutError" | "InternalError" | "MailboxSendConflictError" | "MailboxSendRefusedError" | "OnboardingReviewRequiredError" | "PaymentRequiredError" | "RateLimitedError" | "ResourceNotFoundError" | "SenderNotReadyError" | "UnauthorizedError" | "ValidationError";
2
2
  export interface SamvaApiErrorContext {
3
3
  readonly request?: Request | undefined;
4
4
  readonly response?: Response | undefined;
@@ -132,6 +132,30 @@ export declare class InternalError extends SamvaApiError<"InternalError"> {
132
132
  readonly _tag: "InternalError";
133
133
  constructor(payload: Omit<InternalErrorPayload, "_tag">, context?: SamvaApiErrorContext);
134
134
  }
135
+ type MailboxSendConflictErrorPayload = {
136
+ readonly _tag: "MailboxSendConflictError";
137
+ readonly id: string;
138
+ readonly message: string;
139
+ readonly receipt: Record<string, unknown>;
140
+ readonly resource: string;
141
+ };
142
+ export declare class MailboxSendConflictError extends SamvaApiError<"MailboxSendConflictError"> {
143
+ readonly _tag: "MailboxSendConflictError";
144
+ readonly "id": string;
145
+ readonly "receipt": Record<string, unknown>;
146
+ readonly "resource": string;
147
+ constructor(payload: Omit<MailboxSendConflictErrorPayload, "_tag">, context?: SamvaApiErrorContext);
148
+ }
149
+ type MailboxSendRefusedErrorPayload = {
150
+ readonly _tag: "MailboxSendRefusedError";
151
+ readonly message: string;
152
+ readonly receipt: Record<string, unknown>;
153
+ };
154
+ export declare class MailboxSendRefusedError extends SamvaApiError<"MailboxSendRefusedError"> {
155
+ readonly _tag: "MailboxSendRefusedError";
156
+ readonly "receipt": Record<string, unknown>;
157
+ constructor(payload: Omit<MailboxSendRefusedErrorPayload, "_tag">, context?: SamvaApiErrorContext);
158
+ }
135
159
  type OnboardingReviewRequiredErrorPayload = {
136
160
  readonly _tag: "OnboardingReviewRequiredError";
137
161
  readonly code: "review_required" | "review_in_progress" | "information_required" | "review_rejected" | "identity_review_required" | "identity_review_rejected" | "identity_changed";
@@ -216,7 +240,7 @@ export declare class ValidationError extends SamvaApiError<"ValidationError"> {
216
240
  readonly "fields"?: Record<string, Array<string>> | null;
217
241
  constructor(payload: Omit<ValidationErrorPayload, "_tag">, context?: SamvaApiErrorContext);
218
242
  }
219
- export type AnySamvaApiError = AnalyticsQueryError | BillingProviderError | BrandAddressRequiredError | CampaignFooterRequiredError | ConflictError | DeliveryUnavailableError | EmailChannelError | ExternalServiceError | FlagDisabledError | ForbiddenError | GatewayTimeoutError | InternalError | OnboardingReviewRequiredError | PaymentRequiredError | RateLimitedError | ResourceNotFoundError | SenderNotReadyError | UnauthorizedError | ValidationError;
243
+ export type AnySamvaApiError = AnalyticsQueryError | BillingProviderError | BrandAddressRequiredError | CampaignFooterRequiredError | ConflictError | DeliveryUnavailableError | EmailChannelError | ExternalServiceError | FlagDisabledError | ForbiddenError | GatewayTimeoutError | InternalError | MailboxSendConflictError | MailboxSendRefusedError | OnboardingReviewRequiredError | PaymentRequiredError | RateLimitedError | ResourceNotFoundError | SenderNotReadyError | UnauthorizedError | ValidationError;
220
244
  /** Convert a decoded error payload into its generated JavaScript error class. */
221
245
  export declare function fromApiError(error: unknown, context?: SamvaApiErrorContext): AnySamvaApiError | SamvaTransportError;
222
246
  export {};
@@ -12,9 +12,9 @@
12
12
  * const samva = createClient({ apiKey: "<samva-api-key>" });
13
13
  *
14
14
  * try {
15
- * const contact = await samva.contacts.findOrCreate({
16
- * name: "Ada Lovelace",
17
- * email: "ada@example.com",
15
+ * const { contact } = await samva.contacts.findOrCreate({
16
+ * create: { name: "Ada Lovelace" },
17
+ * lookup: { type: "email", value: "ada@example.com" },
18
18
  * });
19
19
  * await samva.email.send({
20
20
  * to: contact,
@@ -27,7 +27,7 @@
27
27
  * ```
28
28
  */
29
29
  import { type Client, type Config } from "../client/client";
30
- import { Analytics as analytics, ApiKeys as apiKeys, Attachments as attachments, Brands as brands, Campaigns as campaigns, ContactGroups as contactGroups, Contacts as contacts, Conversations as conversations, CustomFields as customFields, Email as email, ExtensionInstallations as extensionInstallations, Extensions as extensions, Feedback as feedback, Mailboxes as mailboxes, Media as media, Messages as messages, Namespaces as namespaces, Operations as operations, Organizations as organizations, ScheduledMessages as scheduledMessages, Templates as templates, Unsubscribe as unsubscribeGroups, Webhooks as webhooks } from "../client/sdk.gen";
30
+ import { Analytics as analytics, ApiKeys as apiKeys, Attachments as attachments, Brands as brands, Campaigns as campaigns, ContactGroups as contactGroups, Contacts as contacts, Conversations as conversations, CustomFields as customFields, Email as email, ExtensionInstallations as extensionInstallations, Extensions as extensions, Feedback as feedback, Mailboxes as mailboxes, Media as media, Messages as messages, Namespaces as namespaces, Operations as operations, Organizations as organizations, ScheduledMessages as scheduledMessages, Subscriptions as subscriptions, Templates as templates, Unsubscribe as unsubscribeGroups, Webhooks as webhooks } from "../client/sdk.gen";
31
31
  import type { MessagesSendData } from "../client/types.gen";
32
32
  import { MailboxEventStream, type MailboxEventStreamOptions } from "../mailbox-events";
33
33
  export * from "./errors.gen";
@@ -135,6 +135,7 @@ export interface SamvaRawClient {
135
135
  readonly attachments: typeof attachments;
136
136
  readonly contactGroups: typeof contactGroups;
137
137
  readonly customFields: typeof customFields;
138
+ readonly subscriptions: typeof subscriptions;
138
139
  readonly unsubscribeGroups: typeof unsubscribeGroups;
139
140
  readonly analytics: typeof analytics;
140
141
  readonly feedback: typeof feedback;
@@ -170,6 +171,7 @@ export interface SamvaClient {
170
171
  readonly attachments: DirectService<typeof attachments>;
171
172
  readonly contactGroups: DirectService<typeof contactGroups>;
172
173
  readonly customFields: DirectService<typeof customFields>;
174
+ readonly subscriptions: DirectService<typeof subscriptions>;
173
175
  readonly unsubscribeGroups: DirectService<typeof unsubscribeGroups>;
174
176
  readonly analytics: DirectService<typeof analytics>;
175
177
  readonly feedback: DirectService<typeof feedback>;
@@ -1,4 +1,4 @@
1
- import { t as MediaUploadError } from "../inline-attachments-B56eS0MF.js";
2
- import { C as fromApiError, S as ValidationError, _ as ResourceNotFoundError, a as CampaignFooterRequiredError, b as SenderNotReadyError, c as EmailChannelError, d as ForbiddenError, f as GatewayTimeoutError, g as RateLimitedError, h as PaymentRequiredError, i as BrandAddressRequiredError, l as ExternalServiceError, m as OnboardingReviewRequiredError, n as AnalyticsQueryError, o as ConflictError, p as InternalError, r as BillingProviderError, s as DeliveryUnavailableError, t as createClient, u as FlagDisabledError, v as SamvaApiError, x as UnauthorizedError, y as SamvaTransportError } from "../promises-D9FJyU0q.js";
3
- import { n as MailboxEventStreamError, t as MailboxEventStream } from "../mailbox-events-CsbF35vH.js";
4
- export { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, DeliveryUnavailableError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, MailboxEventStream, MailboxEventStreamError, MediaUploadError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTransportError, SenderNotReadyError, UnauthorizedError, ValidationError, createClient, fromApiError };
1
+ import { t as MediaUploadError } from "../inline-attachments-UxLeyytJ.js";
2
+ import { C as UnauthorizedError, S as SenderNotReadyError, T as fromApiError, _ as PaymentRequiredError, a as CampaignFooterRequiredError, b as SamvaApiError, c as EmailChannelError, d as ForbiddenError, f as GatewayTimeoutError, g as OnboardingReviewRequiredError, h as MailboxSendRefusedError, i as BrandAddressRequiredError, l as ExternalServiceError, m as MailboxSendConflictError, n as AnalyticsQueryError, o as ConflictError, p as InternalError, r as BillingProviderError, s as DeliveryUnavailableError, t as createClient, u as FlagDisabledError, v as RateLimitedError, w as ValidationError, x as SamvaTransportError, y as ResourceNotFoundError } from "../promises-Cd6Jamqk.js";
3
+ import { n as MailboxEventStreamError, t as MailboxEventStream } from "../mailbox-events-VKR4f3qq.js";
4
+ export { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, DeliveryUnavailableError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, MailboxEventStream, MailboxEventStreamError, MailboxSendConflictError, MailboxSendRefusedError, MediaUploadError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTransportError, SenderNotReadyError, UnauthorizedError, ValidationError, createClient, fromApiError };