samva 0.18.0 → 0.19.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 (47) hide show
  1. package/README.md +2 -0
  2. package/dist/client/sdk.gen.d.ts +39 -23
  3. package/dist/client/sdk.gen.js +83 -21
  4. package/dist/client/types.gen.d.ts +175 -44
  5. package/dist/effect/contact-groups.d.ts +39 -3
  6. package/dist/effect/contacts.d.ts +216 -13
  7. package/dist/effect/contacts.js +3 -1
  8. package/dist/effect/conversations.d.ts +11 -11
  9. package/dist/effect/extension-installations.d.ts +12 -12
  10. package/dist/effect/extensions.d.ts +3 -3
  11. package/dist/effect/generated/contact-groups.d.ts +33 -3
  12. package/dist/effect/generated/contacts.d.ts +477 -54
  13. package/dist/effect/generated/contacts.js +39 -9
  14. package/dist/effect/generated/conversations.d.ts +25 -25
  15. package/dist/effect/generated/conversations.js +1 -1
  16. package/dist/effect/generated/extension-installations.d.ts +44 -44
  17. package/dist/effect/generated/extension-installations.js +6 -0
  18. package/dist/effect/generated/extensions.d.ts +10 -10
  19. package/dist/effect/generated/extensions.js +2 -0
  20. package/dist/effect/generated/mailboxes.d.ts +310 -0
  21. package/dist/effect/generated/mailboxes.js +37 -4
  22. package/dist/effect/generated/messages.d.ts +31 -0
  23. package/dist/effect/generated/messages.js +7 -1
  24. package/dist/effect/generated/organizations.d.ts +13 -11
  25. package/dist/effect/generated/organizations.js +7 -3
  26. package/dist/effect/generated/shared.d.ts +70 -20
  27. package/dist/effect/generated/shared.js +27 -7
  28. package/dist/effect/generated/unsubscribe-groups.d.ts +173 -78
  29. package/dist/effect/generated/unsubscribe-groups.js +75 -58
  30. package/dist/effect/generated/webhooks.d.ts +19 -19
  31. package/dist/effect/generated/webhooks.js +8 -0
  32. package/dist/effect/generated-metadata.d.ts +7 -2
  33. package/dist/effect/generated-metadata.js +331 -325
  34. package/dist/effect/mailboxes.d.ts +133 -1
  35. package/dist/effect/messages.d.ts +5 -0
  36. package/dist/effect/organizations.d.ts +4 -4
  37. package/dist/effect/unsubscribe-groups.d.ts +29 -18
  38. package/dist/effect/unsubscribe-groups.js +5 -5
  39. package/dist/effect/webhooks.d.ts +8 -8
  40. package/dist/mailbox-events.d.ts +31 -4
  41. package/dist/mailbox-events.js +39 -11
  42. package/dist/package.js +1 -1
  43. package/dist/promises/index.d.ts +1 -1
  44. package/dist/promises/types.gen.d.ts +1 -1
  45. package/dist/service-map.d.ts +9 -4
  46. package/dist/service-map.js +10 -2
  47. package/package.json +2 -2
@@ -519,6 +519,7 @@ const CreateWebhookPayload = /* @__PURE__ */ Schema.Struct({
519
519
  Schema.Literal("contact.subscribed"),
520
520
  Schema.Literal("contact.unsubscribed"),
521
521
  Schema.Literal("contact.resubscribed"),
522
+ Schema.Literal("contact.consent_changed"),
522
523
  Schema.Literal("conversation.created"),
523
524
  Schema.Literal("conversation.updated"),
524
525
  Schema.Literal("conversation.archived"),
@@ -531,6 +532,7 @@ const CreateWebhookPayload = /* @__PURE__ */ Schema.Struct({
531
532
  Schema.Literal("mailbox.message.received"),
532
533
  Schema.Literal("mailbox.message.sent"),
533
534
  Schema.Literal("mailbox.action.pending_approval"),
535
+ Schema.Literal("mailbox.action.resolved"),
534
536
  Schema.Literal("mailbox.message.quarantined"),
535
537
  Schema.Literal("mailbox.message.released"),
536
538
  Schema.Literal("mailbox.message.discarded"),
@@ -561,6 +563,7 @@ const UpdateWebhookPayload = /* @__PURE__ */ Schema.Struct({
561
563
  Schema.Literal("contact.subscribed"),
562
564
  Schema.Literal("contact.unsubscribed"),
563
565
  Schema.Literal("contact.resubscribed"),
566
+ Schema.Literal("contact.consent_changed"),
564
567
  Schema.Literal("conversation.created"),
565
568
  Schema.Literal("conversation.updated"),
566
569
  Schema.Literal("conversation.archived"),
@@ -573,6 +576,7 @@ const UpdateWebhookPayload = /* @__PURE__ */ Schema.Struct({
573
576
  Schema.Literal("mailbox.message.received"),
574
577
  Schema.Literal("mailbox.message.sent"),
575
578
  Schema.Literal("mailbox.action.pending_approval"),
579
+ Schema.Literal("mailbox.action.resolved"),
576
580
  Schema.Literal("mailbox.message.quarantined"),
577
581
  Schema.Literal("mailbox.message.released"),
578
582
  Schema.Literal("mailbox.message.discarded"),
@@ -631,6 +635,12 @@ const EmailAttachment = /* @__PURE__ */ Schema.Struct({
631
635
  size: Schema.Finite.check(Schema.isInt().annotate({ expected: "an integer" })).check(Schema.isLessThanOrEqualTo(26214400).annotate({ expected: "a value less than or equal to 26214400" })).check(Schema.isGreaterThan(0).annotate({ expected: "a value greater than 0" }))
632
636
  }).annotate({ identifier: "EmailAttachment" });
633
637
  const TemplateData = /* @__PURE__ */ Schema.Union([JsonObject, Schema.Null]).annotate({ identifier: "TemplateData" });
638
+ const ContactConsent = /* @__PURE__ */ Schema.Struct({
639
+ status: Schema.Union([Schema.Literal("opted_in"), Schema.Literal("opted_out")]),
640
+ source: Schema.String,
641
+ capturedAt: Schema.String,
642
+ proof: Schema.Union([JsonObject, Schema.Null])
643
+ }).annotate({ identifier: "ContactConsent" });
634
644
  const JourneyWebhookConfig = /* @__PURE__ */ Schema.Struct({ data: Schema.optionalKey(JsonObject) }).annotate({ identifier: "JourneyWebhookConfig" });
635
645
  const SkippedRecipient = /* @__PURE__ */ Schema.Struct({
636
646
  address: Schema.String,
@@ -678,12 +688,6 @@ const JourneyGroupJoinedTrigger = /* @__PURE__ */ Schema.Struct({
678
688
  type: Schema.Literal("contact.joined_group"),
679
689
  groupId: ContactGroupId
680
690
  }).annotate({ identifier: "JourneyGroupJoinedTrigger" });
681
- const ContactIdentity = /* @__PURE__ */ Schema.Struct({
682
- id: ContactIdentityId,
683
- channel: Schema.Literal("email"),
684
- identifier: Schema.String,
685
- verified: Schema.Boolean
686
- }).annotate({ identifier: "ContactIdentity" });
687
691
  const JourneySendEmailConfig = /* @__PURE__ */ Schema.Struct({
688
692
  template: Schema.Union([TemplateId, Schema.String.check(Schema.isPattern(/* @__PURE__ */ new RegExp("^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$", "u")).annotate({ expected: "a string matching the RegExp ^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$" }))]),
689
693
  senderId: Schema.optionalKey(EmailSenderId),
@@ -845,6 +849,15 @@ const UpdateBrand = /* @__PURE__ */ Schema.Struct({
845
849
  footer: Schema.optionalKey(Schema.Union([BrandFooter, Schema.Null]))
846
850
  }).annotate({ identifier: "UpdateBrand" });
847
851
  const EmailAttachments = /* @__PURE__ */ Schema.Union([Schema.Array(EmailAttachment).check(Schema.isMaxLength(10).annotate({ expected: "a value with a length of at most 10" })), Schema.Null]).annotate({ identifier: "EmailAttachments" });
852
+ const ContactIdentityChannel = /* @__PURE__ */ Schema.Struct({
853
+ channel: Schema.Literal("email"),
854
+ reachability: Schema.Union([
855
+ Schema.Literal("unknown"),
856
+ Schema.Literal("reachable"),
857
+ Schema.Literal("unreachable")
858
+ ]),
859
+ consent: Schema.Union([ContactConsent, Schema.Null])
860
+ }).annotate({ identifier: "ContactIdentityChannel" });
848
861
  const CreateEventPayload = /* @__PURE__ */ Schema.Struct({
849
862
  contact: ContactEventReference,
850
863
  name: Schema.String.check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(255).annotate({ expected: "a string with at most 255 code points" })).check(Schema.isMaxLength(255).annotate({ expected: "a value with a length of at most 255" })).check(Schema.isPattern(/* @__PURE__ */ new RegExp("^(?!(?:[Cc][Oo][Nn][Tt][Aa][Cc][Tt]|[Ss][Aa][Mm][Vv][Aa])\\.)[A-Za-z][A-Za-z0-9_.-]*$")).annotate({ expected: "a string matching the RegExp ^(?!(?:[Cc][Oo][Nn][Tt][Aa][Cc][Tt]|[Ss][Aa][Mm][Vv][Aa])\\.)[A-Za-z][A-Za-z0-9_.-]*$" })),
@@ -984,6 +997,13 @@ const EmailDispatchContent = /* @__PURE__ */ Schema.Struct({
984
997
  tracking: Schema.optionalKey(EmailTrackingOverrideV1),
985
998
  footer: Schema.optionalKey(EmailFooterOverride)
986
999
  }).annotate({ identifier: "EmailDispatchContent" });
1000
+ const ContactIdentity = /* @__PURE__ */ Schema.Struct({
1001
+ id: ContactIdentityId,
1002
+ type: Schema.Union([Schema.Literal("email"), Schema.Literal("phone")]),
1003
+ identifier: Schema.String,
1004
+ verified: Schema.Boolean,
1005
+ channels: Schema.Array(ContactIdentityChannel)
1006
+ }).annotate({ identifier: "ContactIdentity" });
987
1007
  const JourneyWaitForEventNode = /* @__PURE__ */ Schema.Struct({
988
1008
  type: Schema.Literal("wait_for_event"),
989
1009
  config: JourneyWaitForEventConfig,
@@ -1048,6 +1068,6 @@ const ApiKeySecurity = HttpApiSecurity.apiKey({
1048
1068
  });
1049
1069
  var ApiKeySecurityMiddleware = class extends HttpApiMiddleware.Service()("apiKey security", { security: { apiKey: ApiKeySecurity } }) {};
1050
1070
  //#endregion
1051
- export { AnalyticsQueryError, ApiKeyAccess, ApiKeyId, ApiKeyMailboxAccess, ApiKeyResourceAccess, ApiKeySecurity, ApiKeySecurityMiddleware, AttachmentId, BillingProviderError, BrandAddress, BrandAddressRequiredError, BrandAssets, BrandFooter, BrandSocialLink, CampaignFooterRequiredError, ConflictError, ContactEvent, ContactEventReference, ContactGroupId, ContactId, ContactIdentity, ContactIdentityId, ConversationId, CreateBrand, CreateEventPayload, CreateMailboxEndpointPayload, CreateTemplatePayload, CreateWebhookPayload, Cursor, DeliveryUnavailableError, EmailAttachment, EmailAttachments, EmailBccRecipients, EmailCcRecipients, EmailChannelError, EmailContent, EmailDispatchContent, EmailDomainId, EmailFooterOverride, EmailRecipient, EmailRecipients, EmailSender, EmailSenderId, EmailTrackingOverrideV1, ExtensionId, ExtensionVersionId, ExtensionVersionRef, ExternalServiceError, FeedbackContext, FlagDisabledError, ForbiddenError, GatewayTimeoutError, IanaTimezone, InternalError, JourneyBranchEdge, JourneyBranchNode, JourneyComparison, JourneyCondition, JourneyContactCreatedTrigger, JourneyContactProperty, JourneyCustomEventName, JourneyCustomEventTrigger, JourneyCustomFieldPredicate, JourneyDefinition, JourneyEmptyConfig, JourneyEqualityComparison, JourneyEventName, JourneyEventPredicate, JourneyExitNode, JourneyGoal, JourneyGroupJoinedTrigger, JourneyName, JourneyNextEdge, JourneyNode, JourneyNodeId, JourneyNumericComparison, JourneyPredicate, JourneyPresenceComparison, JourneyPropertyPredicate, JourneySendEmailConfig, JourneySendEmailNode, JourneyStringComparison, JourneyTagAddedTrigger, JourneyTagPredicate, JourneyTrigger, JourneyUpdateTagsConfig, JourneyUpdateTagsNode, JourneyWaitConfig, JourneyWaitEventEdge, JourneyWaitForEventConfig, JourneyWaitForEventNode, JourneyWaitNode, JourneyWebhookConfig, JourneyWebhookNode, JsonObject, JsonValue, MailboxActionDecision, MailboxActionId, MailboxChannel, MailboxChannelUnsupportedError, MailboxDraftId, MailboxEndpointId, MailboxGrantRole, MailboxId, MailboxLabelId, MailboxMetadata, MailboxMetadataPatch, MailboxPolicyId, MailboxPolicyOutcomeKind, MailboxSendConflictError, MailboxSendError, MailboxSendMode, MailboxSendOutcome, MailboxSendReceipt, MailboxSendRefusedError, MailboxThreadFolder, MailboxThreadId, MailboxThreadPriority, MediaId, MessageId, MessageMetadata, MessagePage, MessageSummary, NamespaceId, NamespaceMetadata, OnboardingReviewRequiredError, Operation, OperationAccepted, OperationId, OperationResource, OperationResourceLink, OrganizationId, PaymentRequiredError, RateLimitedError, RenderLocale, RenderTimeZone, ReplyToAddresses, ResourceNotFoundError, SendFeedback, SenderNotReadyError, SendsSeries, SkippedRecipient, SuccessResponse, TemplateData, TemplateFromDefault, TemplateId, TemplateInputContractId, TemplatePublicationId, TestWebhookPayload, UnauthorizedError, UnsubscribeId, UpdateBrand, UpdateTemplatePayload, UpdateWebhookPayload, UserId, ValidationError, WebhookEndpointId, AbsoluteInstant as __SamvaRuntimeAbsoluteInstant, SensitiveString as __SamvaRuntimeSensitiveString };
1071
+ export { AnalyticsQueryError, ApiKeyAccess, ApiKeyId, ApiKeyMailboxAccess, ApiKeyResourceAccess, ApiKeySecurity, ApiKeySecurityMiddleware, AttachmentId, BillingProviderError, BrandAddress, BrandAddressRequiredError, BrandAssets, BrandFooter, BrandSocialLink, CampaignFooterRequiredError, ConflictError, ContactConsent, ContactEvent, ContactEventReference, ContactGroupId, ContactId, ContactIdentity, ContactIdentityChannel, ContactIdentityId, ConversationId, CreateBrand, CreateEventPayload, CreateMailboxEndpointPayload, CreateTemplatePayload, CreateWebhookPayload, Cursor, DeliveryUnavailableError, EmailAttachment, EmailAttachments, EmailBccRecipients, EmailCcRecipients, EmailChannelError, EmailContent, EmailDispatchContent, EmailDomainId, EmailFooterOverride, EmailRecipient, EmailRecipients, EmailSender, EmailSenderId, EmailTrackingOverrideV1, ExtensionId, ExtensionVersionId, ExtensionVersionRef, ExternalServiceError, FeedbackContext, FlagDisabledError, ForbiddenError, GatewayTimeoutError, IanaTimezone, InternalError, JourneyBranchEdge, JourneyBranchNode, JourneyComparison, JourneyCondition, JourneyContactCreatedTrigger, JourneyContactProperty, JourneyCustomEventName, JourneyCustomEventTrigger, JourneyCustomFieldPredicate, JourneyDefinition, JourneyEmptyConfig, JourneyEqualityComparison, JourneyEventName, JourneyEventPredicate, JourneyExitNode, JourneyGoal, JourneyGroupJoinedTrigger, JourneyName, JourneyNextEdge, JourneyNode, JourneyNodeId, JourneyNumericComparison, JourneyPredicate, JourneyPresenceComparison, JourneyPropertyPredicate, JourneySendEmailConfig, JourneySendEmailNode, JourneyStringComparison, JourneyTagAddedTrigger, JourneyTagPredicate, JourneyTrigger, JourneyUpdateTagsConfig, JourneyUpdateTagsNode, JourneyWaitConfig, JourneyWaitEventEdge, JourneyWaitForEventConfig, JourneyWaitForEventNode, JourneyWaitNode, JourneyWebhookConfig, JourneyWebhookNode, JsonObject, JsonValue, MailboxActionDecision, MailboxActionId, MailboxChannel, MailboxChannelUnsupportedError, MailboxDraftId, MailboxEndpointId, MailboxGrantRole, MailboxId, MailboxLabelId, MailboxMetadata, MailboxMetadataPatch, MailboxPolicyId, MailboxPolicyOutcomeKind, MailboxSendConflictError, MailboxSendError, MailboxSendMode, MailboxSendOutcome, MailboxSendReceipt, MailboxSendRefusedError, MailboxThreadFolder, MailboxThreadId, MailboxThreadPriority, MediaId, MessageId, MessageMetadata, MessagePage, MessageSummary, NamespaceId, NamespaceMetadata, OnboardingReviewRequiredError, Operation, OperationAccepted, OperationId, OperationResource, OperationResourceLink, OrganizationId, PaymentRequiredError, RateLimitedError, RenderLocale, RenderTimeZone, ReplyToAddresses, ResourceNotFoundError, SendFeedback, SenderNotReadyError, SendsSeries, SkippedRecipient, SuccessResponse, TemplateData, TemplateFromDefault, TemplateId, TemplateInputContractId, TemplatePublicationId, TestWebhookPayload, UnauthorizedError, UnsubscribeId, UpdateBrand, UpdateTemplatePayload, UpdateWebhookPayload, UserId, ValidationError, WebhookEndpointId, AbsoluteInstant as __SamvaRuntimeAbsoluteInstant, SensitiveString as __SamvaRuntimeSensitiveString };
1052
1072
 
1053
1073
  //# sourceMappingURL=shared.js.map
@@ -1,27 +1,20 @@
1
+ import type * as EffectBrand from "effect/Brand";
1
2
  import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
2
3
  import * as Schema from "effect/Schema";
3
- import { ApiKeySecurityMiddleware, ConflictError, Cursor, ForbiddenError, GatewayTimeoutError, InternalError, ResourceNotFoundError, UnauthorizedError, UnsubscribeId, ValidationError } from "./shared";
4
- export type UnsubscribeGroupMemberPage = {
5
- readonly items: ReadonlyArray<{
6
- readonly id: string;
7
- readonly email: string;
8
- readonly contactId: string | null;
9
- readonly source: "link" | "api" | "manual" | "complaint";
10
- readonly unsubscribedAt: string;
11
- readonly createdAt: string;
12
- }>;
13
- readonly nextCursor: string | null;
4
+ import { ApiKeySecurityMiddleware, BillingProviderError, ConflictError, ContactId, Cursor, ForbiddenError, GatewayTimeoutError, InternalError, PaymentRequiredError, ResourceNotFoundError, UnauthorizedError, UnsubscribeId, ValidationError } from "./shared";
5
+ export type UnsubscribeGroupMemberId = string & EffectBrand.Brand<"UnsubscribeGroupMemberId">;
6
+ export declare const UnsubscribeGroupMemberId: Schema.brand<Schema.String, "UnsubscribeGroupMemberId">;
7
+ export type UnsubscribeGroupMemberByEmail = {
8
+ readonly email: string;
14
9
  };
15
- export declare const UnsubscribeGroupMemberPage: Schema.Struct<{
16
- readonly items: Schema.$Array<Schema.Struct<{
17
- readonly id: Schema.String;
18
- readonly email: Schema.String;
19
- readonly contactId: Schema.Union<readonly [Schema.String, Schema.Null]>;
20
- readonly source: Schema.Union<readonly [Schema.Literal<"link">, Schema.Literal<"api">, Schema.Literal<"manual">, Schema.Literal<"complaint">]>;
21
- readonly unsubscribedAt: Schema.String;
22
- readonly createdAt: Schema.String;
23
- }>>;
24
- readonly nextCursor: Schema.Union<readonly [Schema.String, Schema.Null]>;
10
+ export declare const UnsubscribeGroupMemberByEmail: Schema.Struct<{
11
+ readonly email: Schema.String;
12
+ }>;
13
+ export type UnsubscribeGroupMemberByPhone = {
14
+ readonly phone: string;
15
+ };
16
+ export declare const UnsubscribeGroupMemberByPhone: Schema.Struct<{
17
+ readonly phone: Schema.String;
25
18
  }>;
26
19
  export type UnsubscribeGroupList = {
27
20
  readonly items: ReadonlyArray<{
@@ -47,6 +40,40 @@ export declare const UnsubscribeGroupList: Schema.Struct<{
47
40
  readonly updatedAt: Schema.String;
48
41
  }>>;
49
42
  }>;
43
+ export type UnsubscribeGroupMemberByContact = {
44
+ readonly contactId: ContactId;
45
+ };
46
+ export declare const UnsubscribeGroupMemberByContact: Schema.Struct<{
47
+ readonly contactId: Schema.brand<Schema.String, "ContactId">;
48
+ }>;
49
+ export type UnsubscribeGroupMemberPage = {
50
+ readonly items: ReadonlyArray<{
51
+ readonly id: UnsubscribeGroupMemberId;
52
+ readonly contactId: ContactId;
53
+ readonly source: "link" | "api" | "manual" | "complaint";
54
+ readonly unsubscribedAt: string;
55
+ readonly createdAt: string;
56
+ }>;
57
+ readonly nextCursor: string | null;
58
+ };
59
+ export declare const UnsubscribeGroupMemberPage: Schema.Struct<{
60
+ readonly items: Schema.$Array<Schema.Struct<{
61
+ readonly id: Schema.brand<Schema.String, "UnsubscribeGroupMemberId">;
62
+ readonly contactId: Schema.brand<Schema.String, "ContactId">;
63
+ readonly source: Schema.Union<readonly [Schema.Literal<"link">, Schema.Literal<"api">, Schema.Literal<"manual">, Schema.Literal<"complaint">]>;
64
+ readonly unsubscribedAt: Schema.String;
65
+ readonly createdAt: Schema.String;
66
+ }>>;
67
+ readonly nextCursor: Schema.Union<readonly [Schema.String, Schema.Null]>;
68
+ }>;
69
+ export type UnsubscribeGroupMemberRef = UnsubscribeGroupMemberByContact | UnsubscribeGroupMemberByEmail | UnsubscribeGroupMemberByPhone;
70
+ export declare const UnsubscribeGroupMemberRef: Schema.Union<readonly [Schema.Struct<{
71
+ readonly contactId: Schema.brand<Schema.String, "ContactId">;
72
+ }>, Schema.Struct<{
73
+ readonly email: Schema.String;
74
+ }>, Schema.Struct<{
75
+ readonly phone: Schema.String;
76
+ }>]>;
50
77
  export type UnsubscribeList200 = UnsubscribeGroupList;
51
78
  export declare const UnsubscribeList200: Schema.Struct<{
52
79
  readonly items: Schema.$Array<Schema.Struct<{
@@ -237,9 +264,8 @@ export declare const UnsubscribeListMembersQuery: Schema.Struct<{
237
264
  export type UnsubscribeListMembers200 = UnsubscribeGroupMemberPage;
238
265
  export declare const UnsubscribeListMembers200: Schema.Struct<{
239
266
  readonly items: Schema.$Array<Schema.Struct<{
240
- readonly id: Schema.String;
241
- readonly email: Schema.String;
242
- readonly contactId: Schema.Union<readonly [Schema.String, Schema.Null]>;
267
+ readonly id: Schema.brand<Schema.String, "UnsubscribeGroupMemberId">;
268
+ readonly contactId: Schema.brand<Schema.String, "ContactId">;
243
269
  readonly source: Schema.Union<readonly [Schema.Literal<"link">, Schema.Literal<"api">, Schema.Literal<"manual">, Schema.Literal<"complaint">]>;
244
270
  readonly unsubscribedAt: Schema.String;
245
271
  readonly createdAt: Schema.String;
@@ -258,80 +284,100 @@ export type UnsubscribeListMembers500 = InternalError;
258
284
  export declare const UnsubscribeListMembers500: typeof InternalError;
259
285
  export type UnsubscribeListMembers504 = GatewayTimeoutError;
260
286
  export declare const UnsubscribeListMembers504: typeof GatewayTimeoutError;
261
- export type UnsubscribeAddEmailsPathParams = {
287
+ export type UnsubscribeAddMembersPathParams = {
262
288
  readonly id: UnsubscribeId;
263
289
  };
264
- export declare const UnsubscribeAddEmailsPathParams: Schema.Struct<{
290
+ export declare const UnsubscribeAddMembersPathParams: Schema.Struct<{
265
291
  readonly id: Schema.brand<Schema.String, "UnsubscribeId">;
266
292
  }>;
267
- export type UnsubscribeAddEmailsRequestJson = {
268
- readonly emails: ReadonlyArray<string>;
293
+ export type UnsubscribeAddMembersRequestJson = {
294
+ readonly members: ReadonlyArray<UnsubscribeGroupMemberRef>;
269
295
  readonly source?: "link" | "api" | "manual" | "complaint" | null;
270
296
  };
271
- export declare const UnsubscribeAddEmailsRequestJson: Schema.Struct<{
272
- readonly emails: Schema.$Array<Schema.String>;
297
+ export declare const UnsubscribeAddMembersRequestJson: Schema.Struct<{
298
+ readonly members: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
299
+ readonly contactId: Schema.brand<Schema.String, "ContactId">;
300
+ }>, Schema.Struct<{
301
+ readonly email: Schema.String;
302
+ }>, Schema.Struct<{
303
+ readonly phone: Schema.String;
304
+ }>]>>;
273
305
  readonly source: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"link">, Schema.Literal<"api">, Schema.Literal<"manual">, Schema.Literal<"complaint">]>, Schema.Null]>>;
274
306
  }>;
275
- export type UnsubscribeAddEmails200 = {
307
+ export type UnsubscribeAddMembers200 = {
276
308
  readonly added: number;
277
309
  readonly skipped: number;
278
310
  };
279
- export declare const UnsubscribeAddEmails200: Schema.Struct<{
311
+ export declare const UnsubscribeAddMembers200: Schema.Struct<{
280
312
  readonly added: Schema.Finite;
281
313
  readonly skipped: Schema.Finite;
282
314
  }>;
283
- export type UnsubscribeAddEmails401 = UnauthorizedError;
284
- export declare const UnsubscribeAddEmails401: typeof UnauthorizedError;
285
- export type UnsubscribeAddEmails403 = ForbiddenError;
286
- export declare const UnsubscribeAddEmails403: typeof ForbiddenError;
287
- export type UnsubscribeAddEmails404 = ResourceNotFoundError;
288
- export declare const UnsubscribeAddEmails404: typeof ResourceNotFoundError;
289
- export type UnsubscribeAddEmails422 = ValidationError;
290
- export declare const UnsubscribeAddEmails422: typeof ValidationError;
291
- export type UnsubscribeAddEmails500 = InternalError;
292
- export declare const UnsubscribeAddEmails500: typeof InternalError;
293
- export type UnsubscribeAddEmails504 = GatewayTimeoutError;
294
- export declare const UnsubscribeAddEmails504: typeof GatewayTimeoutError;
295
- export type UnsubscribeRemoveEmailsPathParams = {
315
+ export type UnsubscribeAddMembers401 = UnauthorizedError;
316
+ export declare const UnsubscribeAddMembers401: typeof UnauthorizedError;
317
+ export type UnsubscribeAddMembers402 = PaymentRequiredError;
318
+ export declare const UnsubscribeAddMembers402: typeof PaymentRequiredError;
319
+ export type UnsubscribeAddMembers403 = ForbiddenError;
320
+ export declare const UnsubscribeAddMembers403: typeof ForbiddenError;
321
+ export type UnsubscribeAddMembers404 = ResourceNotFoundError;
322
+ export declare const UnsubscribeAddMembers404: typeof ResourceNotFoundError;
323
+ export type UnsubscribeAddMembers422 = ValidationError;
324
+ export declare const UnsubscribeAddMembers422: typeof ValidationError;
325
+ export type UnsubscribeAddMembers500 = InternalError;
326
+ export declare const UnsubscribeAddMembers500: typeof InternalError;
327
+ export type UnsubscribeAddMembers502 = BillingProviderError;
328
+ export declare const UnsubscribeAddMembers502: typeof BillingProviderError;
329
+ export type UnsubscribeAddMembers504 = GatewayTimeoutError;
330
+ export declare const UnsubscribeAddMembers504: typeof GatewayTimeoutError;
331
+ export type UnsubscribeRemoveMembersPathParams = {
296
332
  readonly id: UnsubscribeId;
297
333
  };
298
- export declare const UnsubscribeRemoveEmailsPathParams: Schema.Struct<{
334
+ export declare const UnsubscribeRemoveMembersPathParams: Schema.Struct<{
299
335
  readonly id: Schema.brand<Schema.String, "UnsubscribeId">;
300
336
  }>;
301
- export type UnsubscribeRemoveEmailsRequestJson = {
302
- readonly emails: ReadonlyArray<string>;
337
+ export type UnsubscribeRemoveMembersRequestJson = {
338
+ readonly members: ReadonlyArray<UnsubscribeGroupMemberRef>;
303
339
  };
304
- export declare const UnsubscribeRemoveEmailsRequestJson: Schema.Struct<{
305
- readonly emails: Schema.$Array<Schema.String>;
340
+ export declare const UnsubscribeRemoveMembersRequestJson: Schema.Struct<{
341
+ readonly members: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
342
+ readonly contactId: Schema.brand<Schema.String, "ContactId">;
343
+ }>, Schema.Struct<{
344
+ readonly email: Schema.String;
345
+ }>, Schema.Struct<{
346
+ readonly phone: Schema.String;
347
+ }>]>>;
306
348
  }>;
307
- export type UnsubscribeRemoveEmails200 = {
349
+ export type UnsubscribeRemoveMembers200 = {
308
350
  readonly removed: number;
309
351
  };
310
- export declare const UnsubscribeRemoveEmails200: Schema.Struct<{
352
+ export declare const UnsubscribeRemoveMembers200: Schema.Struct<{
311
353
  readonly removed: Schema.Finite;
312
354
  }>;
313
- export type UnsubscribeRemoveEmails401 = UnauthorizedError;
314
- export declare const UnsubscribeRemoveEmails401: typeof UnauthorizedError;
315
- export type UnsubscribeRemoveEmails403 = ForbiddenError;
316
- export declare const UnsubscribeRemoveEmails403: typeof ForbiddenError;
317
- export type UnsubscribeRemoveEmails404 = ResourceNotFoundError;
318
- export declare const UnsubscribeRemoveEmails404: typeof ResourceNotFoundError;
319
- export type UnsubscribeRemoveEmails422 = ValidationError;
320
- export declare const UnsubscribeRemoveEmails422: typeof ValidationError;
321
- export type UnsubscribeRemoveEmails500 = InternalError;
322
- export declare const UnsubscribeRemoveEmails500: typeof InternalError;
323
- export type UnsubscribeRemoveEmails504 = GatewayTimeoutError;
324
- export declare const UnsubscribeRemoveEmails504: typeof GatewayTimeoutError;
355
+ export type UnsubscribeRemoveMembers401 = UnauthorizedError;
356
+ export declare const UnsubscribeRemoveMembers401: typeof UnauthorizedError;
357
+ export type UnsubscribeRemoveMembers403 = ForbiddenError;
358
+ export declare const UnsubscribeRemoveMembers403: typeof ForbiddenError;
359
+ export type UnsubscribeRemoveMembers404 = ResourceNotFoundError;
360
+ export declare const UnsubscribeRemoveMembers404: typeof ResourceNotFoundError;
361
+ export type UnsubscribeRemoveMembers422 = ValidationError;
362
+ export declare const UnsubscribeRemoveMembers422: typeof ValidationError;
363
+ export type UnsubscribeRemoveMembers500 = InternalError;
364
+ export declare const UnsubscribeRemoveMembers500: typeof InternalError;
365
+ export type UnsubscribeRemoveMembers504 = GatewayTimeoutError;
366
+ export declare const UnsubscribeRemoveMembers504: typeof GatewayTimeoutError;
325
367
  export type UnsubscribeCheckSubscriptionQuery = {
326
- readonly email: string;
368
+ readonly contactId?: ContactId | null;
369
+ readonly email?: string | null;
370
+ readonly phone?: string | null;
327
371
  readonly groupIds?: string | null;
328
372
  };
329
373
  export declare const UnsubscribeCheckSubscriptionQuery: Schema.Struct<{
330
- readonly email: Schema.String;
374
+ readonly contactId: Schema.optionalKey<Schema.Union<readonly [Schema.brand<Schema.String, "ContactId">, Schema.Null]>>;
375
+ readonly email: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
376
+ readonly phone: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
331
377
  readonly groupIds: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
332
378
  }>;
333
379
  export type UnsubscribeCheckSubscription200 = {
334
- readonly email: string;
380
+ readonly contactId: ContactId | null;
335
381
  readonly unsubscribedGroups: ReadonlyArray<{
336
382
  readonly groupId: string;
337
383
  readonly groupName: string;
@@ -339,7 +385,7 @@ export type UnsubscribeCheckSubscription200 = {
339
385
  }>;
340
386
  };
341
387
  export declare const UnsubscribeCheckSubscription200: Schema.Struct<{
342
- readonly email: Schema.String;
388
+ readonly contactId: Schema.Union<readonly [Schema.brand<Schema.String, "ContactId">, Schema.Null]>;
343
389
  readonly unsubscribedGroups: Schema.$Array<Schema.Struct<{
344
390
  readonly groupId: Schema.String;
345
391
  readonly groupName: Schema.String;
@@ -356,15 +402,33 @@ export type UnsubscribeCheckSubscription500 = InternalError;
356
402
  export declare const UnsubscribeCheckSubscription500: typeof InternalError;
357
403
  export type UnsubscribeCheckSubscription504 = GatewayTimeoutError;
358
404
  export declare const UnsubscribeCheckSubscription504: typeof GatewayTimeoutError;
359
- declare const UnsubscribeGroupsGroup_base: HttpApiGroup.HttpApiGroup<"Unsubscribe Groups", HttpApiEndpoint.HttpApiEndpoint<"unsubscribeAddEmails", "POST", "/v1/unsubscribe-groups/:id/members", Schema.toCodecStringTree<Schema.Struct<{
405
+ declare const UnsubscribeGroupsGroup_base: HttpApiGroup.HttpApiGroup<"Unsubscribe Groups", HttpApiEndpoint.HttpApiEndpoint<"unsubscribeAddMembers", "POST", "/v1/unsubscribe-groups/:id/members", Schema.toCodecStringTree<Schema.Struct<{
360
406
  readonly id: Schema.brand<Schema.String, "UnsubscribeId">;
361
407
  }>>, never, Schema.toCodecJson<Schema.Struct<{
362
- readonly emails: Schema.$Array<Schema.String>;
408
+ readonly members: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
409
+ readonly contactId: Schema.brand<Schema.String, "ContactId">;
410
+ }>, Schema.Struct<{
411
+ readonly email: Schema.String;
412
+ }>, Schema.Struct<{
413
+ readonly phone: Schema.String;
414
+ }>]>>;
363
415
  readonly source: Schema.optionalKey<Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"link">, Schema.Literal<"api">, Schema.Literal<"manual">, Schema.Literal<"complaint">]>, Schema.Null]>>;
364
416
  }>>, never, Schema.toCodecJson<Schema.Struct<{
365
417
  readonly added: Schema.Finite;
366
418
  readonly skipped: Schema.Finite;
367
- }>>, Schema.toCodecJson<Schema.decodeTo<Schema.declareConstructor<ForbiddenError, {
419
+ }>>, Schema.toCodecJson<Schema.decodeTo<Schema.declareConstructor<BillingProviderError, {
420
+ readonly _tag: "BillingProviderError";
421
+ readonly message: string;
422
+ }, readonly [Schema.Struct<{
423
+ readonly _tag: Schema.tag<"BillingProviderError">;
424
+ readonly message: Schema.String;
425
+ }>], {
426
+ readonly _tag: "BillingProviderError";
427
+ readonly message: string;
428
+ }>, Schema.Struct<{
429
+ readonly _tag: Schema.tag<"BillingProviderError">;
430
+ readonly message: Schema.String;
431
+ }>, never, never> | Schema.decodeTo<Schema.declareConstructor<ForbiddenError, {
368
432
  readonly _tag: "ForbiddenError";
369
433
  readonly message: string;
370
434
  }, readonly [Schema.Struct<{
@@ -392,6 +456,30 @@ declare const UnsubscribeGroupsGroup_base: HttpApiGroup.HttpApiGroup<"Unsubscrib
392
456
  readonly _tag: Schema.tag<"GatewayTimeoutError">;
393
457
  readonly message: Schema.String;
394
458
  readonly retryAfterSeconds: Schema.Finite;
459
+ }>, never, never> | Schema.decodeTo<Schema.declareConstructor<PaymentRequiredError, {
460
+ readonly _tag: "PaymentRequiredError";
461
+ readonly message: string;
462
+ readonly resource: string;
463
+ readonly currentUsage: number;
464
+ readonly limit: number;
465
+ }, readonly [Schema.Struct<{
466
+ readonly _tag: Schema.tag<"PaymentRequiredError">;
467
+ readonly message: Schema.String;
468
+ readonly resource: Schema.String;
469
+ readonly currentUsage: Schema.Finite;
470
+ readonly limit: Schema.Finite;
471
+ }>], {
472
+ readonly _tag: "PaymentRequiredError";
473
+ readonly message: string;
474
+ readonly resource: string;
475
+ readonly currentUsage: number;
476
+ readonly limit: number;
477
+ }>, Schema.Struct<{
478
+ readonly _tag: Schema.tag<"PaymentRequiredError">;
479
+ readonly message: Schema.String;
480
+ readonly resource: Schema.String;
481
+ readonly currentUsage: Schema.Finite;
482
+ readonly limit: Schema.Finite;
395
483
  }>, never, never> | Schema.decodeTo<Schema.declareConstructor<ResourceNotFoundError, {
396
484
  readonly _tag: "ResourceNotFoundError";
397
485
  readonly resource: string;
@@ -445,10 +533,12 @@ declare const UnsubscribeGroupsGroup_base: HttpApiGroup.HttpApiGroup<"Unsubscrib
445
533
  readonly message: Schema.String;
446
534
  readonly fields: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.$Array<Schema.String>>, Schema.Null]>>;
447
535
  }>, never, never> | typeof InternalError>, ApiKeySecurityMiddleware, never> | HttpApiEndpoint.HttpApiEndpoint<"unsubscribeCheckSubscription", "GET", "/v1/unsubscribe-groups/check", never, Schema.toCodecStringTree<Schema.Struct<{
448
- readonly email: Schema.String;
536
+ readonly contactId: Schema.optionalKey<Schema.Union<readonly [Schema.brand<Schema.String, "ContactId">, Schema.Null]>>;
537
+ readonly email: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
538
+ readonly phone: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
449
539
  readonly groupIds: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
450
540
  }>>, never, never, Schema.toCodecJson<Schema.Struct<{
451
- readonly email: Schema.String;
541
+ readonly contactId: Schema.Union<readonly [Schema.brand<Schema.String, "ContactId">, Schema.Null]>;
452
542
  readonly unsubscribedGroups: Schema.$Array<Schema.Struct<{
453
543
  readonly groupId: Schema.String;
454
544
  readonly groupName: Schema.String;
@@ -684,9 +774,8 @@ declare const UnsubscribeGroupsGroup_base: HttpApiGroup.HttpApiGroup<"Unsubscrib
684
774
  readonly cursor: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
685
775
  }>>, never, never, Schema.toCodecJson<Schema.Struct<{
686
776
  readonly items: Schema.$Array<Schema.Struct<{
687
- readonly id: Schema.String;
688
- readonly email: Schema.String;
689
- readonly contactId: Schema.Union<readonly [Schema.String, Schema.Null]>;
777
+ readonly id: Schema.brand<Schema.String, "UnsubscribeGroupMemberId">;
778
+ readonly contactId: Schema.brand<Schema.String, "ContactId">;
690
779
  readonly source: Schema.Union<readonly [Schema.Literal<"link">, Schema.Literal<"api">, Schema.Literal<"manual">, Schema.Literal<"complaint">]>;
691
780
  readonly unsubscribedAt: Schema.String;
692
781
  readonly createdAt: Schema.String;
@@ -876,10 +965,16 @@ declare const UnsubscribeGroupsGroup_base: HttpApiGroup.HttpApiGroup<"Unsubscrib
876
965
  readonly _tag: Schema.tag<"ValidationError">;
877
966
  readonly message: Schema.String;
878
967
  readonly fields: Schema.optionalKey<Schema.Union<readonly [Schema.$Record<Schema.String, Schema.$Array<Schema.String>>, Schema.Null]>>;
879
- }>, never, never> | typeof InternalError>, ApiKeySecurityMiddleware, never> | HttpApiEndpoint.HttpApiEndpoint<"unsubscribeRemoveEmails", "DELETE", "/v1/unsubscribe-groups/:id/members", Schema.toCodecStringTree<Schema.Struct<{
968
+ }>, never, never> | typeof InternalError>, ApiKeySecurityMiddleware, never> | HttpApiEndpoint.HttpApiEndpoint<"unsubscribeRemoveMembers", "DELETE", "/v1/unsubscribe-groups/:id/members", Schema.toCodecStringTree<Schema.Struct<{
880
969
  readonly id: Schema.brand<Schema.String, "UnsubscribeId">;
881
970
  }>>, never, Schema.toCodecJson<Schema.Struct<{
882
- readonly emails: Schema.$Array<Schema.String>;
971
+ readonly members: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
972
+ readonly contactId: Schema.brand<Schema.String, "ContactId">;
973
+ }>, Schema.Struct<{
974
+ readonly email: Schema.String;
975
+ }>, Schema.Struct<{
976
+ readonly phone: Schema.String;
977
+ }>]>>;
883
978
  }>>, never, Schema.toCodecJson<Schema.Struct<{
884
979
  readonly removed: Schema.Finite;
885
980
  }>>, Schema.toCodecJson<Schema.decodeTo<Schema.declareConstructor<ForbiddenError, {