samva 0.49.0 → 0.51.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 (74) hide show
  1. package/AGENTS.md +44 -3
  2. package/README.md +136 -7
  3. package/dist/client/sdk.gen.d.ts +63 -18
  4. package/dist/client/sdk.gen.js +1549 -945
  5. package/dist/client/types.gen.d.ts +269 -31
  6. package/dist/effect/agents.d.ts +4 -4
  7. package/dist/effect/api-keys.d.ts +4 -6
  8. package/dist/effect/campaigns.d.ts +166 -174
  9. package/dist/effect/categories.d.ts +2 -2
  10. package/dist/effect/categories.js +6 -4
  11. package/dist/effect/contact-groups.d.ts +4 -4
  12. package/dist/effect/contacts.d.ts +8 -8
  13. package/dist/effect/conversations.d.ts +4 -4
  14. package/dist/effect/descriptors/mailboxes.d.ts +41 -1
  15. package/dist/effect/descriptors/mailboxes.js +53 -1
  16. package/dist/effect/email.d.ts +17 -16
  17. package/dist/effect/errors.d.ts +1 -0
  18. package/dist/effect/errors.js +2 -1
  19. package/dist/effect/generated/api-keys.d.ts +0 -15
  20. package/dist/effect/generated/api-keys.js +1 -2
  21. package/dist/effect/generated/campaigns.d.ts +0 -62
  22. package/dist/effect/generated/campaigns.js +3 -9
  23. package/dist/effect/generated/email.d.ts +10 -3
  24. package/dist/effect/generated/email.js +3 -2
  25. package/dist/effect/generated/mailboxes.d.ts +780 -77
  26. package/dist/effect/generated/mailboxes.js +135 -12
  27. package/dist/effect/generated/namespaces.js +1 -1
  28. package/dist/effect/generated/policies.js +2 -2
  29. package/dist/effect/generated/scheduled-messages.d.ts +0 -26
  30. package/dist/effect/generated/scheduled-messages.js +1 -3
  31. package/dist/effect/generated/shared.d.ts +28 -31
  32. package/dist/effect/generated/shared.js +12 -19
  33. package/dist/effect/generated/template-registrations.d.ts +6 -6
  34. package/dist/effect/generated/template-registrations.js +3 -3
  35. package/dist/effect/generated-metadata.d.ts +24 -0
  36. package/dist/effect/generated-metadata.js +4 -0
  37. package/dist/effect/index.js +2 -1
  38. package/dist/effect/integrations.d.ts +2 -2
  39. package/dist/effect/internal/client.d.ts +19 -2
  40. package/dist/effect/internal/client.js +10 -2
  41. package/dist/effect/internal/email-sender.d.ts +4 -4
  42. package/dist/effect/internal/email-sender.js +5 -3
  43. package/dist/effect/internal/operation.d.ts +11 -0
  44. package/dist/effect/internal/operation.js +10 -6
  45. package/dist/effect/internal/send.d.ts +4 -0
  46. package/dist/effect/internal/send.js +11 -8
  47. package/dist/effect/internal/timeout.d.ts +16 -0
  48. package/dist/effect/internal/timeout.js +20 -0
  49. package/dist/effect/journeys.d.ts +152 -152
  50. package/dist/effect/mailboxes.d.ts +54 -30
  51. package/dist/effect/mailboxes.js +10 -2
  52. package/dist/effect/messages.d.ts +5 -5
  53. package/dist/effect/namespaces.d.ts +4 -4
  54. package/dist/effect/newsletter-domains.d.ts +2 -2
  55. package/dist/effect/operations.d.ts +2 -2
  56. package/dist/effect/scheduled-messages.d.ts +2 -6
  57. package/dist/effect/templates.d.ts +6 -6
  58. package/dist/effect/topics.d.ts +4 -4
  59. package/dist/effect/webhooks.d.ts +4 -4
  60. package/dist/effect/whatsapp-setup-links.d.ts +2 -2
  61. package/dist/index.js +2 -2
  62. package/dist/package.js +1 -1
  63. package/dist/promises/client.d.ts +5 -0
  64. package/dist/promises/client.js +12 -8
  65. package/dist/promises/errors.gen.d.ts +12 -1
  66. package/dist/promises/errors.gen.js +21 -2
  67. package/dist/promises/index.js +2 -2
  68. package/dist/promises/request.d.ts +31 -2
  69. package/dist/promises/request.js +42 -7
  70. package/dist/promises/types.gen.d.ts +1 -1
  71. package/dist/request-policy.d.ts +9 -0
  72. package/dist/request-policy.js +16 -1
  73. package/dist/service-map.d.ts +22 -2
  74. package/package.json +3 -3
@@ -360,6 +360,7 @@ declare const FromAddressRequiredError_base: Schema.Class<FromAddressRequiredErr
360
360
  readonly _tag: Schema.tag<"FromAddressRequiredError">;
361
361
  readonly message: Schema.String;
362
362
  readonly verifiedDomains: Schema.$Array<Schema.String>;
363
+ readonly addresses: Schema.$Array<Schema.String>;
363
364
  }>, import("effect/Cause").YieldableError>;
364
365
  export declare class FromAddressRequiredError extends FromAddressRequiredError_base {
365
366
  }
@@ -925,10 +926,6 @@ export declare const TemplateFromDefaultInput: Schema.Struct<{
925
926
  readonly email: Schema.String;
926
927
  readonly name: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
927
928
  }>;
928
- export type WhatsAppBusinessAccountId_1 = string;
929
- export declare const WhatsAppBusinessAccountId_1: Schema.String;
930
- export type WhatsAppBusinessAccountId_2 = string;
931
- export declare const WhatsAppBusinessAccountId_2: Schema.String;
932
929
  declare const CredentialsError_base: Schema.Class<CredentialsError, Schema.Struct<{
933
930
  readonly _tag: Schema.tag<"CredentialsError">;
934
931
  readonly message: Schema.String;
@@ -1932,6 +1929,18 @@ export declare const WhatsAppTemplateBinding: Schema.Union<readonly [Schema.Stru
1932
1929
  }>, Schema.Struct<{
1933
1930
  readonly customField: Schema.String;
1934
1931
  }>]>;
1932
+ export type TemplateRegistrationApproval = {
1933
+ readonly publicationId: TemplatePublicationId;
1934
+ readonly businessAccountId: WhatsAppBusinessAccountId;
1935
+ readonly expectedWabaId: string;
1936
+ readonly expectedWorkspaceRevision: string;
1937
+ };
1938
+ export declare const TemplateRegistrationApproval: Schema.Struct<{
1939
+ readonly publicationId: Schema.brand<Schema.String, "TemplatePublicationId">;
1940
+ readonly businessAccountId: Schema.brand<Schema.String, "WhatsAppBusinessAccountId">;
1941
+ readonly expectedWabaId: Schema.String;
1942
+ readonly expectedWorkspaceRevision: Schema.String;
1943
+ }>;
1935
1944
  export type RegisterWhatsAppFlowPayload = {
1936
1945
  readonly businessAccountId?: WhatsAppBusinessAccountId;
1937
1946
  };
@@ -2687,18 +2696,6 @@ export declare const UpdateTemplatePayload: Schema.Struct<{
2687
2696
  readonly shared: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Null]>>;
2688
2697
  }>;
2689
2698
  }>;
2690
- export type TemplateRegistrationApproval = {
2691
- readonly publicationId: TemplatePublicationId;
2692
- readonly businessAccountId: WhatsAppBusinessAccountId_2;
2693
- readonly expectedWabaId: string;
2694
- readonly expectedWorkspaceRevision: string;
2695
- };
2696
- export declare const TemplateRegistrationApproval: Schema.Struct<{
2697
- readonly publicationId: Schema.brand<Schema.String, "TemplatePublicationId">;
2698
- readonly businessAccountId: Schema.String;
2699
- readonly expectedWabaId: Schema.String;
2700
- readonly expectedWorkspaceRevision: Schema.String;
2701
- }>;
2702
2699
  export type CreateWhatsAppSetupLinkPayload = {
2703
2700
  readonly namespaceId: NamespaceId;
2704
2701
  readonly redirectUrl?: WhatsAppSetupLinkRedirectUrl | null;
@@ -3213,6 +3210,21 @@ export declare const WhatsAppTemplateBindings: Schema.$Record<Schema.String, Sch
3213
3210
  }>, Schema.Struct<{
3214
3211
  readonly customField: Schema.String;
3215
3212
  }>]>>;
3213
+ export type SubmitTemplateRegistrationPayload = {
3214
+ readonly provider: "whatsapp";
3215
+ readonly businessAccountId?: WhatsAppBusinessAccountId;
3216
+ readonly approval?: TemplateRegistrationApproval;
3217
+ };
3218
+ export declare const SubmitTemplateRegistrationPayload: Schema.Struct<{
3219
+ readonly provider: Schema.Literal<"whatsapp">;
3220
+ readonly businessAccountId: Schema.optionalKey<Schema.brand<Schema.String, "WhatsAppBusinessAccountId">>;
3221
+ readonly approval: Schema.optionalKey<Schema.Struct<{
3222
+ readonly publicationId: Schema.brand<Schema.String, "TemplatePublicationId">;
3223
+ readonly businessAccountId: Schema.brand<Schema.String, "WhatsAppBusinessAccountId">;
3224
+ readonly expectedWabaId: Schema.String;
3225
+ readonly expectedWorkspaceRevision: Schema.String;
3226
+ }>>;
3227
+ }>;
3216
3228
  export type MessagePage = {
3217
3229
  readonly items: ReadonlyArray<MessageSummary>;
3218
3230
  readonly nextCursor: string | null;
@@ -3586,21 +3598,6 @@ export declare const OperationAccepted: Schema.Struct<{
3586
3598
  }>;
3587
3599
  }>;
3588
3600
  }>;
3589
- export type SubmitTemplateRegistrationPayload = {
3590
- readonly provider: "whatsapp";
3591
- readonly businessAccountId?: WhatsAppBusinessAccountId_1;
3592
- readonly approval?: TemplateRegistrationApproval;
3593
- };
3594
- export declare const SubmitTemplateRegistrationPayload: Schema.Struct<{
3595
- readonly provider: Schema.Literal<"whatsapp">;
3596
- readonly businessAccountId: Schema.optionalKey<Schema.String>;
3597
- readonly approval: Schema.optionalKey<Schema.Struct<{
3598
- readonly publicationId: Schema.brand<Schema.String, "TemplatePublicationId">;
3599
- readonly businessAccountId: Schema.String;
3600
- readonly expectedWabaId: Schema.String;
3601
- readonly expectedWorkspaceRevision: Schema.String;
3602
- }>>;
3603
- }>;
3604
3601
  export type SmsCampaignContentInput = {
3605
3602
  readonly channel: "sms";
3606
3603
  readonly sms: SmsDispatchContent;
@@ -334,7 +334,8 @@ var TemplateSourceError = class extends Schema.TaggedError()("TemplateSourceErro
334
334
  })) {};
335
335
  var FromAddressRequiredError = class extends Schema.TaggedError()("FromAddressRequiredError", Schema.Struct({
336
336
  message: Schema.String,
337
- verifiedDomains: Schema.Array(Schema.String)
337
+ verifiedDomains: Schema.Array(Schema.String),
338
+ addresses: Schema.Array(Schema.String)
338
339
  })) {};
339
340
  var BrandAddressRequiredError = class extends Schema.TaggedError()("BrandAddressRequiredError", Schema.Struct({
340
341
  message: Schema.String,
@@ -824,14 +825,6 @@ const TemplateFromDefaultInput = /* @__PURE__ */ (() => Schema.Struct({
824
825
  email: Schema.String,
825
826
  name: Schema.optionalKey(Schema.Union([Schema.String.check(Schema.isMaxCodePoints(120).annotate({ expected: "a string with at most 120 code points" })).check(Schema.isMaxLength(120).annotate({ expected: "a value with a length of at most 120" })), Schema.Null]))
826
827
  }).annotate({ identifier: "TemplateFromDefaultInput" }))();
827
- const WhatsAppBusinessAccountId_1 = /* @__PURE__ */ (() => Schema.String.annotate({ description: "For an immediate submission, the connected number to register on. Defaults to the number for the template's scope." }).check(Schema.isPattern(new globalThis.RegExp("^waba_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
828
- expected: "a string matching the RegExp ^waba_[0-9a-hjkmnp-tv-z]{16,24}$",
829
- identifier: "WhatsAppBusinessAccountId_1"
830
- })))();
831
- const WhatsAppBusinessAccountId_2 = /* @__PURE__ */ (() => Schema.String.annotate({ description: "The connected WhatsApp number selected for this submission." }).check(Schema.isPattern(new globalThis.RegExp("^waba_[0-9a-hjkmnp-tv-z]{16,24}$", "u")).annotate({
832
- expected: "a string matching the RegExp ^waba_[0-9a-hjkmnp-tv-z]{16,24}$",
833
- identifier: "WhatsAppBusinessAccountId_2"
834
- })))();
835
828
  var CredentialsError = class extends Schema.TaggedError()("CredentialsError", Schema.Struct({
836
829
  message: Schema.String,
837
830
  retryable: Schema.Boolean
@@ -1187,6 +1180,15 @@ const SkippedRecipient = /* @__PURE__ */ (() => Schema.Struct({
1187
1180
  }).annotate({ identifier: "SkippedRecipient" }))();
1188
1181
  const CampaignConversationRef = /* @__PURE__ */ (() => Schema.Union([ConversationId, Schema.Null]).annotate({ identifier: "CampaignConversationRef" }))();
1189
1182
  const WhatsAppTemplateBinding = /* @__PURE__ */ (() => Schema.Union([WhatsAppTemplateContactBinding, WhatsAppTemplateCustomFieldBinding]).annotate({ identifier: "WhatsAppTemplateBinding" }))();
1183
+ const TemplateRegistrationApproval = /* @__PURE__ */ (() => Schema.Struct({
1184
+ publicationId: TemplatePublicationId,
1185
+ businessAccountId: WhatsAppBusinessAccountId,
1186
+ expectedWabaId: Schema.String.annotate({ description: "The Meta business account ID shown for the selected number before approval." }).check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(128).annotate({ expected: "a string with at most 128 code points" })).check(Schema.isMaxLength(128).annotate({ expected: "a value with a length of at most 128" })),
1187
+ expectedWorkspaceRevision: Schema.String.annotate({ description: "The workspace revision reviewed for this submission." }).check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(128).annotate({ expected: "a string with at most 128 code points" })).check(Schema.isMaxLength(128).annotate({ expected: "a value with a length of at most 128" }))
1188
+ }).annotate({
1189
+ description: "For a reviewed submission, the exact publication, workspace revision, number and Meta business account. Omit the separate businessAccountId when supplying approval.",
1190
+ identifier: "TemplateRegistrationApproval"
1191
+ }))();
1190
1192
  const CampaignAudience = /* @__PURE__ */ (() => Schema.Struct({
1191
1193
  topicId: TopicId,
1192
1194
  includeTags: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
@@ -1476,15 +1478,6 @@ const UpdateTemplatePayload = /* @__PURE__ */ (() => Schema.Struct({ data: Schem
1476
1478
  trackingDefault: Schema.optionalKey(Schema.Union([TemplateTrackingDefault, Schema.Null]).annotate({ description: "Engagement tracking for sends of this template: `opens` and `clicks`, each inherited from the domain and organization defaults when omitted. A send request's own `tracking` still wins. Null clears the template's default." })),
1477
1479
  shared: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null]).annotate({ description: "Share the template's project with every namespace, or stop sharing it. Applies to every entry in the project. Only an organization-level project is shared." }))
1478
1480
  }) }).annotate({ identifier: "UpdateTemplatePayload" }))();
1479
- const TemplateRegistrationApproval = /* @__PURE__ */ (() => Schema.Struct({
1480
- publicationId: TemplatePublicationId,
1481
- businessAccountId: WhatsAppBusinessAccountId_2,
1482
- expectedWabaId: Schema.String.annotate({ description: "The Meta business account ID shown for the selected number before approval." }).check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(128).annotate({ expected: "a string with at most 128 code points" })).check(Schema.isMaxLength(128).annotate({ expected: "a value with a length of at most 128" })),
1483
- expectedWorkspaceRevision: Schema.String.annotate({ description: "The workspace revision reviewed for this submission." }).check(Schema.isMinLength(1).annotate({ expected: "a value with a length of at least 1" })).check(Schema.isMaxCodePoints(128).annotate({ expected: "a string with at most 128 code points" })).check(Schema.isMaxLength(128).annotate({ expected: "a value with a length of at most 128" }))
1484
- }).annotate({
1485
- description: "For a reviewed submission, the exact publication, workspace revision, number and Meta business account. Omit the separate businessAccountId when supplying approval.",
1486
- identifier: "TemplateRegistrationApproval"
1487
- }))();
1488
1481
  const SmsContent = /* @__PURE__ */ (() => Schema.Struct({
1489
1482
  text: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
1490
1483
  templateId: Schema.optionalKey(Schema.Union([TemplateId, Schema.Null])),
@@ -2031,6 +2024,6 @@ const ApiKeySecurity = HttpApiSecurity.apiKey({
2031
2024
  in: "header"
2032
2025
  });
2033
2026
  var ApiKeySecurityMiddleware = class extends HttpApiMiddleware.Service()("apiKey security", { security: { apiKey: ApiKeySecurity } }) {};
2034
- export { AccountLinks, AccountStatus, AgentDefinition, AgentId, AgentIntegrationGrant, AgentModel, AgentModelChoice, AgentModuleBundle, AgentModuleManifest, AgentModuleTool, AgentName, AgentReasoning, AgentSetupJob, AgentToolScope, AnalyticsQueryError, AnswerWithoutApproval, ApiKeyAccess, ApiKeyId, ApiKeyMailboxAccess, ApiKeyResourceAccess, ApiKeySecurity, ApiKeySecurityMiddleware, AttachmentId, BillingProviderError, BrandAddress, BrandAddressRequiredError, BrandAssets, BrandFooter, BrandSocialLink, CampaignAudience, CampaignContentInput, CampaignContentMetadata, CampaignConversationRef, CampaignEmailInput, CampaignFooterRequiredError, CampaignFromInput, CampaignId, CampaignLatestRun, CampaignReplyMailbox, CampaignRunId, CatalogModelId, ClockTime, ConflictError, ContactConsent, ContactEvent, ContactEventReference, ContactGroupId, ContactId, ContactIdentity, ContactIdentityChannel, ContactIdentityId, ConversationId, CreateBrand, CreateEventPayload, CreateMailboxChatDraftPayload, CreateMailboxEmailDraftPayload, CreateMailboxEndpointPayload, CreateTemplatePayload, CreateWebhookPayload, CredentialsError, DeliveryUnavailableError, EmailAttachment, EmailAttachments, EmailBccRecipients, EmailCampaignContentInput, EmailCcRecipients, EmailChannelError, EmailContent, EmailCustomHeaders, EmailDomainId, EmailFooterOverride, EmailRecipient, EmailRecipients, EmailSendMessagePayload, EmailSender, EmailSenderId, EmailTrackingOverrideV1, ExtensionInstallationId, ExternalServiceError, FeedbackContext, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, IanaTimezone, IntegrationAccountId, IntegrationId, IntegrationKey, IntegrationReturnTo, IntegrationStatus, IntegrationTool, InternalError, JourneyBranchEdge, JourneyBranchNode, JourneyComparison, JourneyCondition, JourneyContactCreatedTrigger, JourneyContactProperty, JourneyCustomEventName, JourneyCustomEventTrigger, JourneyCustomFieldPredicate, JourneyDefinition, JourneyEmptyConfig, JourneyEqualityComparison, JourneyEventName, JourneyEventPredicate, JourneyExitNode, JourneyGoal, JourneyGroupJoinedTrigger, JourneyId, JourneyName, JourneyNextEdge, JourneyNode, JourneyNodeId, JourneyNumericComparison, JourneyPredicate, JourneyPresenceComparison, JourneyPropertyPredicate, JourneySendEmailConfig, JourneySendEmailNode, JourneySendWhatsAppConfig, JourneyStatus, JourneyStringComparison, JourneyTagAddedTrigger, JourneyTagPredicate, JourneyTrigger, JourneyUpdateTagsConfig, JourneyUpdateTagsNode, JourneyWaitConfig, JourneyWaitEventEdge, JourneyWaitForEventConfig, JourneyWaitForEventNode, JourneyWaitNode, JourneyWebhookConfig, JourneyWebhookNode, JsonObject, JsonValue, KnowledgeSourceId, MailboxActionDecision, MailboxActionId, MailboxChannel, MailboxDraftId, MailboxEndpointId, MailboxGrantRole, MailboxId, MailboxLabelId, MailboxMetadata, MailboxMetadataPatch, MailboxSendConflictError, MailboxSendError, MailboxSendOutcome, MailboxSendReceipt, MailboxSendRefusedError, MailboxThreadFolder, MailboxThreadId, MailboxThreadPriority, MalformedRequestError, MediaId, MessageDeliveryId, MessageId, MessageMetadata, MessagePage, MessageSummary, MonthlySpendCapDollars, NamespaceId, NamespaceMetadata, NamespacePortalLinkMetadata, NamespaceResourceType, NewsletterId, OnboardingReviewRequiredError, Operation, OperationAccepted, OperationId, OperationResource, OperationResourceLink, OrganizationId, PaymentRequiredError, PolicyConfiguration, PolicyDecider, PolicyDecisionId, PolicyEffect, PolicyRequirement, PolicyReviewRound, PolicyRule, PolicyRuleMatch, PolicySubject, PolicyVersion, RateLimitedError, RecipeSetupReferences, RenderLocale, RenderTimeZone, ReplyMailboxChatPayload, ReplyMailboxEmailPayload, ReplyToAddresses, ResourceNotFoundError, SendFeedback, SendMailboxChatPayload, SendMailboxEmailPayload, SenderNotReadyError, SendsSeries, ServiceUnavailableError, ShareLinkUnavailable, ShopifyShop, SkippedRecipient, SlugTaken, SmsCampaignContentInput, SmsContent, SmsDispatchContent, SmsRecipient, SmsRecipients, SmsSendMessagePayload, SmsTemplateData, StoredEmailAttachments, StoredReplyToAddresses, SuccessResponse, TemplateChannelVariantId, TemplateData, TemplateFamilyId, TemplateFromDefaultInput, TemplateId, TemplateInUseError, TemplateInputContractId, TemplateProjectId, TemplatePublicationId, TemplateRegistrationApproval, TemplateRegistrationId, TemplateSourceError, TemplateTrackingDefault, TestWebhookPayload, TimeZone, TopicContactByEmail, TopicContactById, TopicContactByPhone, TopicContactRef, TopicId, UnauthorizedError, UpdateBrand, UpdateTemplatePayload, UpdateWebhookPayload, UserId, ValidationError, WebhookEndpointId, Weekday, WhatsAppAudio, WhatsAppAudioLink, WhatsAppAudioUpload, WhatsAppBusinessAccountId, WhatsAppBusinessAccountId_1, WhatsAppBusinessAccountId_2, WhatsAppButtonsMessage, WhatsAppCampaignContentInput, WhatsAppChannelError, WhatsAppContactCard, WhatsAppContactsContent, WhatsAppContent, WhatsAppCtaUrlMessage, WhatsAppDocument, WhatsAppDocumentHeader, WhatsAppDocumentHeaderLink, WhatsAppDocumentHeaderUpload, WhatsAppDocumentLink, WhatsAppDocumentUpload, WhatsAppFlowId, WhatsAppFlowMessage, WhatsAppFlowVersionId, WhatsAppImage, WhatsAppImageHeader, WhatsAppImageHeaderLink, WhatsAppImageHeaderUpload, WhatsAppImageLink, WhatsAppImageUpload, WhatsAppInteractive, WhatsAppInteractiveContent, WhatsAppInteractiveHeader, WhatsAppJourneySendNode, WhatsAppListMessage, WhatsAppListRow, WhatsAppListSection, WhatsAppLocation, WhatsAppLocationContent, WhatsAppMediaContent, WhatsAppOutboundMedia, WhatsAppReaction, WhatsAppReactionContent, WhatsAppRecipient, WhatsAppRecipients, WhatsAppReplyButton, WhatsAppSendMessagePayload, WhatsAppServiceWindowClosedError, WhatsAppSetupLinkMetadata, WhatsAppSetupLinkRedirectUrl, WhatsAppSetupLinkUnavailableError, WhatsAppSticker, WhatsAppStickerLink, WhatsAppStickerUpload, WhatsAppTemplateBinding, WhatsAppTemplateBindings, WhatsAppTemplateContactBinding, WhatsAppTemplateCustomFieldBinding, WhatsAppTemplateData, WhatsAppTemplateDispatch, WhatsAppTemplateDispatchData, WhatsAppTemplateIdContent, WhatsAppTemplateSlugContent, WhatsAppTextContent, WhatsAppTextHeader, WhatsAppVideo, WhatsAppVideoHeader, WhatsAppVideoHeaderLink, WhatsAppVideoHeaderUpload, WhatsAppVideoLink, WhatsAppVideoUpload, WorkingHours, WorkingHoursRange, AbsoluteInstant as __SamvaRuntimeAbsoluteInstant, NonEmptySensitiveString as __SamvaRuntimeNonEmptySensitiveString, SensitiveString as __SamvaRuntimeSensitiveString };
2027
+ export { AccountLinks, AccountStatus, AgentDefinition, AgentId, AgentIntegrationGrant, AgentModel, AgentModelChoice, AgentModuleBundle, AgentModuleManifest, AgentModuleTool, AgentName, AgentReasoning, AgentSetupJob, AgentToolScope, AnalyticsQueryError, AnswerWithoutApproval, ApiKeyAccess, ApiKeyId, ApiKeyMailboxAccess, ApiKeyResourceAccess, ApiKeySecurity, ApiKeySecurityMiddleware, AttachmentId, BillingProviderError, BrandAddress, BrandAddressRequiredError, BrandAssets, BrandFooter, BrandSocialLink, CampaignAudience, CampaignContentInput, CampaignContentMetadata, CampaignConversationRef, CampaignEmailInput, CampaignFooterRequiredError, CampaignFromInput, CampaignId, CampaignLatestRun, CampaignReplyMailbox, CampaignRunId, CatalogModelId, ClockTime, ConflictError, ContactConsent, ContactEvent, ContactEventReference, ContactGroupId, ContactId, ContactIdentity, ContactIdentityChannel, ContactIdentityId, ConversationId, CreateBrand, CreateEventPayload, CreateMailboxChatDraftPayload, CreateMailboxEmailDraftPayload, CreateMailboxEndpointPayload, CreateTemplatePayload, CreateWebhookPayload, CredentialsError, DeliveryUnavailableError, EmailAttachment, EmailAttachments, EmailBccRecipients, EmailCampaignContentInput, EmailCcRecipients, EmailChannelError, EmailContent, EmailCustomHeaders, EmailDomainId, EmailFooterOverride, EmailRecipient, EmailRecipients, EmailSendMessagePayload, EmailSender, EmailSenderId, EmailTrackingOverrideV1, ExtensionInstallationId, ExternalServiceError, FeedbackContext, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, IanaTimezone, IntegrationAccountId, IntegrationId, IntegrationKey, IntegrationReturnTo, IntegrationStatus, IntegrationTool, InternalError, JourneyBranchEdge, JourneyBranchNode, JourneyComparison, JourneyCondition, JourneyContactCreatedTrigger, JourneyContactProperty, JourneyCustomEventName, JourneyCustomEventTrigger, JourneyCustomFieldPredicate, JourneyDefinition, JourneyEmptyConfig, JourneyEqualityComparison, JourneyEventName, JourneyEventPredicate, JourneyExitNode, JourneyGoal, JourneyGroupJoinedTrigger, JourneyId, JourneyName, JourneyNextEdge, JourneyNode, JourneyNodeId, JourneyNumericComparison, JourneyPredicate, JourneyPresenceComparison, JourneyPropertyPredicate, JourneySendEmailConfig, JourneySendEmailNode, JourneySendWhatsAppConfig, JourneyStatus, JourneyStringComparison, JourneyTagAddedTrigger, JourneyTagPredicate, JourneyTrigger, JourneyUpdateTagsConfig, JourneyUpdateTagsNode, JourneyWaitConfig, JourneyWaitEventEdge, JourneyWaitForEventConfig, JourneyWaitForEventNode, JourneyWaitNode, JourneyWebhookConfig, JourneyWebhookNode, JsonObject, JsonValue, KnowledgeSourceId, MailboxActionDecision, MailboxActionId, MailboxChannel, MailboxDraftId, MailboxEndpointId, MailboxGrantRole, MailboxId, MailboxLabelId, MailboxMetadata, MailboxMetadataPatch, MailboxSendConflictError, MailboxSendError, MailboxSendOutcome, MailboxSendReceipt, MailboxSendRefusedError, MailboxThreadFolder, MailboxThreadId, MailboxThreadPriority, MalformedRequestError, MediaId, MessageDeliveryId, MessageId, MessageMetadata, MessagePage, MessageSummary, MonthlySpendCapDollars, NamespaceId, NamespaceMetadata, NamespacePortalLinkMetadata, NamespaceResourceType, NewsletterId, OnboardingReviewRequiredError, Operation, OperationAccepted, OperationId, OperationResource, OperationResourceLink, OrganizationId, PaymentRequiredError, PolicyConfiguration, PolicyDecider, PolicyDecisionId, PolicyEffect, PolicyRequirement, PolicyReviewRound, PolicyRule, PolicyRuleMatch, PolicySubject, PolicyVersion, RateLimitedError, RecipeSetupReferences, RenderLocale, RenderTimeZone, ReplyMailboxChatPayload, ReplyMailboxEmailPayload, ReplyToAddresses, ResourceNotFoundError, SendFeedback, SendMailboxChatPayload, SendMailboxEmailPayload, SenderNotReadyError, SendsSeries, ServiceUnavailableError, ShareLinkUnavailable, ShopifyShop, SkippedRecipient, SlugTaken, SmsCampaignContentInput, SmsContent, SmsDispatchContent, SmsRecipient, SmsRecipients, SmsSendMessagePayload, SmsTemplateData, StoredEmailAttachments, StoredReplyToAddresses, SuccessResponse, TemplateChannelVariantId, TemplateData, TemplateFamilyId, TemplateFromDefaultInput, TemplateId, TemplateInUseError, TemplateInputContractId, TemplateProjectId, TemplatePublicationId, TemplateRegistrationApproval, TemplateRegistrationId, TemplateSourceError, TemplateTrackingDefault, TestWebhookPayload, TimeZone, TopicContactByEmail, TopicContactById, TopicContactByPhone, TopicContactRef, TopicId, UnauthorizedError, UpdateBrand, UpdateTemplatePayload, UpdateWebhookPayload, UserId, ValidationError, WebhookEndpointId, Weekday, WhatsAppAudio, WhatsAppAudioLink, WhatsAppAudioUpload, WhatsAppBusinessAccountId, WhatsAppButtonsMessage, WhatsAppCampaignContentInput, WhatsAppChannelError, WhatsAppContactCard, WhatsAppContactsContent, WhatsAppContent, WhatsAppCtaUrlMessage, WhatsAppDocument, WhatsAppDocumentHeader, WhatsAppDocumentHeaderLink, WhatsAppDocumentHeaderUpload, WhatsAppDocumentLink, WhatsAppDocumentUpload, WhatsAppFlowId, WhatsAppFlowMessage, WhatsAppFlowVersionId, WhatsAppImage, WhatsAppImageHeader, WhatsAppImageHeaderLink, WhatsAppImageHeaderUpload, WhatsAppImageLink, WhatsAppImageUpload, WhatsAppInteractive, WhatsAppInteractiveContent, WhatsAppInteractiveHeader, WhatsAppJourneySendNode, WhatsAppListMessage, WhatsAppListRow, WhatsAppListSection, WhatsAppLocation, WhatsAppLocationContent, WhatsAppMediaContent, WhatsAppOutboundMedia, WhatsAppReaction, WhatsAppReactionContent, WhatsAppRecipient, WhatsAppRecipients, WhatsAppReplyButton, WhatsAppSendMessagePayload, WhatsAppServiceWindowClosedError, WhatsAppSetupLinkMetadata, WhatsAppSetupLinkRedirectUrl, WhatsAppSetupLinkUnavailableError, WhatsAppSticker, WhatsAppStickerLink, WhatsAppStickerUpload, WhatsAppTemplateBinding, WhatsAppTemplateBindings, WhatsAppTemplateContactBinding, WhatsAppTemplateCustomFieldBinding, WhatsAppTemplateData, WhatsAppTemplateDispatch, WhatsAppTemplateDispatchData, WhatsAppTemplateIdContent, WhatsAppTemplateSlugContent, WhatsAppTextContent, WhatsAppTextHeader, WhatsAppVideo, WhatsAppVideoHeader, WhatsAppVideoHeaderLink, WhatsAppVideoHeaderUpload, WhatsAppVideoLink, WhatsAppVideoUpload, WorkingHours, WorkingHoursRange, AbsoluteInstant as __SamvaRuntimeAbsoluteInstant, NonEmptySensitiveString as __SamvaRuntimeNonEmptySensitiveString, SensitiveString as __SamvaRuntimeSensitiveString };
2035
2028
 
2036
2029
  //# sourceMappingURL=shared.js.map
@@ -1,6 +1,6 @@
1
1
  import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
2
2
  import * as Schema from "effect/Schema";
3
- import { ApiKeySecurityMiddleware, ConflictError, CredentialsError, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, MalformedRequestError, ResourceNotFoundError, ServiceUnavailableError, TemplateChannelVariantId, TemplateId, TemplatePublicationId, TemplateRegistrationApproval, TemplateRegistrationId, UnauthorizedError, ValidationError, WhatsAppBusinessAccountId_1, WhatsAppChannelError } from "./shared.js";
3
+ import { ApiKeySecurityMiddleware, ConflictError, CredentialsError, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, MalformedRequestError, ResourceNotFoundError, ServiceUnavailableError, TemplateChannelVariantId, TemplateId, TemplatePublicationId, TemplateRegistrationApproval, TemplateRegistrationId, UnauthorizedError, ValidationError, WhatsAppBusinessAccountId, WhatsAppChannelError } from "./shared.js";
4
4
  export type WhatsAppRegistrationTarget = {
5
5
  readonly provider: "whatsapp";
6
6
  readonly wabaId: string;
@@ -161,15 +161,15 @@ export declare const TemplateRegistrationsSubmitPathParams: Schema.Struct<{
161
161
  }>;
162
162
  export type TemplateRegistrationsSubmitRequestJson = {
163
163
  readonly provider: "whatsapp";
164
- readonly businessAccountId?: WhatsAppBusinessAccountId_1;
164
+ readonly businessAccountId?: WhatsAppBusinessAccountId;
165
165
  readonly approval?: TemplateRegistrationApproval;
166
166
  };
167
167
  export declare const TemplateRegistrationsSubmitRequestJson: Schema.Struct<{
168
168
  readonly provider: Schema.Literal<"whatsapp">;
169
- readonly businessAccountId: Schema.optionalKey<Schema.String>;
169
+ readonly businessAccountId: Schema.optionalKey<Schema.brand<Schema.String, "WhatsAppBusinessAccountId">>;
170
170
  readonly approval: Schema.optionalKey<Schema.Struct<{
171
171
  readonly publicationId: Schema.brand<Schema.String, "TemplatePublicationId">;
172
- readonly businessAccountId: Schema.String;
172
+ readonly businessAccountId: Schema.brand<Schema.String, "WhatsAppBusinessAccountId">;
173
173
  readonly expectedWabaId: Schema.String;
174
174
  readonly expectedWorkspaceRevision: Schema.String;
175
175
  }>>;
@@ -507,10 +507,10 @@ declare const TemplateRegistrationsGroup_base: HttpApiGroup.HttpApiGroup<"Templa
507
507
  readonly id: Schema.brand<Schema.String, "TemplateId">;
508
508
  }>>, never, Schema.toCodecJson<Schema.Struct<{
509
509
  readonly provider: Schema.Literal<"whatsapp">;
510
- readonly businessAccountId: Schema.optionalKey<Schema.String>;
510
+ readonly businessAccountId: Schema.optionalKey<Schema.brand<Schema.String, "WhatsAppBusinessAccountId">>;
511
511
  readonly approval: Schema.optionalKey<Schema.Struct<{
512
512
  readonly publicationId: Schema.brand<Schema.String, "TemplatePublicationId">;
513
- readonly businessAccountId: Schema.String;
513
+ readonly businessAccountId: Schema.brand<Schema.String, "WhatsAppBusinessAccountId">;
514
514
  readonly expectedWabaId: Schema.String;
515
515
  readonly expectedWorkspaceRevision: Schema.String;
516
516
  }>>;
@@ -1,4 +1,4 @@
1
- import { ApiKeySecurityMiddleware, ConflictError, CredentialsError, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, MalformedRequestError, ResourceNotFoundError, ServiceUnavailableError, TemplateChannelVariantId, TemplateId, TemplatePublicationId, TemplateRegistrationApproval, TemplateRegistrationId, UnauthorizedError, ValidationError, WhatsAppBusinessAccountId_1, WhatsAppChannelError } from "./shared.js";
1
+ import { ApiKeySecurityMiddleware, ConflictError, CredentialsError, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, MalformedRequestError, ResourceNotFoundError, ServiceUnavailableError, TemplateChannelVariantId, TemplateId, TemplatePublicationId, TemplateRegistrationApproval, TemplateRegistrationId, UnauthorizedError, ValidationError, WhatsAppBusinessAccountId, WhatsAppChannelError } from "./shared.js";
2
2
  import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
3
3
  import * as Schema from "effect/Schema";
4
4
  // src/effect/generated/template-registrations.ts
@@ -70,9 +70,9 @@ const TemplateRegistrationsList504 = GatewayTimeoutError;
70
70
  const TemplateRegistrationsSubmitPathParams = /* @__PURE__ */ (() => Schema.Struct({ id: TemplateId }))();
71
71
  const TemplateRegistrationsSubmitRequestJson = /* @__PURE__ */ (() => Schema.Struct({
72
72
  provider: Schema.Literal("whatsapp"),
73
- businessAccountId: Schema.optionalKey(WhatsAppBusinessAccountId_1),
73
+ businessAccountId: Schema.optionalKey(WhatsAppBusinessAccountId),
74
74
  approval: Schema.optionalKey(TemplateRegistrationApproval)
75
- }))();
75
+ }).annotate({ description: "For an immediate submission, `businessAccountId` is the connected number to register on and defaults to the number for the template's scope." }))();
76
76
  const TemplateRegistrationsSubmit201 = TemplateRegistration;
77
77
  const TemplateRegistrationsSubmit400 = MalformedRequestError;
78
78
  const TemplateRegistrationsSubmit401 = UnauthorizedError;
@@ -1680,12 +1680,36 @@ export declare const SamvaOperations: {
1680
1680
  readonly idempotent: false;
1681
1681
  readonly paginated: false;
1682
1682
  };
1683
+ readonly mailboxesDiscardImport: {
1684
+ readonly group: "Mailboxes";
1685
+ readonly method: "DELETE";
1686
+ readonly idempotent: false;
1687
+ readonly paginated: false;
1688
+ };
1683
1689
  readonly mailboxesStartImport: {
1684
1690
  readonly group: "Mailboxes";
1685
1691
  readonly method: "POST";
1686
1692
  readonly idempotent: false;
1687
1693
  readonly paginated: false;
1688
1694
  };
1695
+ readonly mailboxesDiscardImportUpload: {
1696
+ readonly group: "Mailboxes";
1697
+ readonly method: "DELETE";
1698
+ readonly idempotent: false;
1699
+ readonly paginated: false;
1700
+ };
1701
+ readonly mailboxesCompleteImportUpload: {
1702
+ readonly group: "Mailboxes";
1703
+ readonly method: "POST";
1704
+ readonly idempotent: false;
1705
+ readonly paginated: false;
1706
+ };
1707
+ readonly mailboxesSignImportUploadParts: {
1708
+ readonly group: "Mailboxes";
1709
+ readonly method: "POST";
1710
+ readonly idempotent: false;
1711
+ readonly paginated: false;
1712
+ };
1689
1713
  readonly mailboxesCreateImportUpload: {
1690
1714
  readonly group: "Mailboxes";
1691
1715
  readonly method: "POST";
@@ -1371,7 +1371,11 @@ const SamvaOperations = {
1371
1371
  mailboxesUpdateGrant: operationMetadata76,
1372
1372
  mailboxesListImports: operationMetadata74,
1373
1373
  mailboxesGetImport: operationMetadata74,
1374
+ mailboxesDiscardImport: operationMetadata75,
1374
1375
  mailboxesStartImport: operationMetadata77,
1376
+ mailboxesDiscardImportUpload: operationMetadata75,
1377
+ mailboxesCompleteImportUpload: operationMetadata77,
1378
+ mailboxesSignImportUploadParts: operationMetadata77,
1375
1379
  mailboxesCreateImportUpload: operationMetadata77,
1376
1380
  mailboxesListLabels: operationMetadata74,
1377
1381
  mailboxesCreateLabel: operationMetadata77,
@@ -2,6 +2,7 @@ import { MediaUploadError } from "../inline-attachments.js";
2
2
  import { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, CredentialsError, DeliveryUnavailableError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, MailboxSendConflictError, MailboxSendRefusedError, MalformedRequestError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SenderNotReadyError, ServiceUnavailableError, TemplateInUseError, TemplateSourceError, UnauthorizedError, ValidationError, WhatsAppChannelError, WhatsAppServiceWindowClosedError, WhatsAppSetupLinkUnavailableError } from "./generated/shared.js";
3
3
  import { catchAuthError, catchBillingError, catchCategory, catchConflictError, catchNotFoundError, catchThrottlingError, catchTransient, catchValidationError, categoriesOf, hasCategory, isAuthError, isBillingError, isConflictError, isNotFoundError, isRetryable, isThrottlingError, isTransient, isValidationError } from "./categories.js";
4
4
  import { retry_exports } from "./retry.js";
5
+ import { SamvaTimeoutError } from "./internal/timeout.js";
5
6
  import { accounts_exports } from "./accounts.js";
6
7
  import { integrations_catalog_exports } from "./integrations-catalog.js";
7
8
  import { integrations_exports } from "./integrations.js";
@@ -43,4 +44,4 @@ import { whatsapp_flows_exports } from "./whatsapp-flows.js";
43
44
  import { whatsapp_setup_links_exports } from "./whatsapp-setup-links.js";
44
45
  import { template_registrations_exports } from "./template-registrations.js";
45
46
  import { template_share_links_exports } from "./template-share-links.js";
46
- export { accounts_exports as Accounts, agents_exports as Agents, analytics_exports as Analytics, AnalyticsQueryError, api_keys_exports as ApiKeys, approval_requests_exports as ApprovalRequests, attachments_exports as Attachments, BillingProviderError, BrandAddressRequiredError, brands_exports as Brands, CampaignFooterRequiredError, campaigns_exports as Campaigns, client_exports as Client, ConflictError, contact_groups_exports as ContactGroups, contacts_exports as Contacts, conversations_exports as Conversations, CredentialsError, custom_fields_exports as CustomFields, DeliveryUnavailableError, email_exports as Email, EmailChannelError, events_exports as Events, ExternalServiceError, feedback_exports as Feedback, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, integrations_catalog_exports as IntegrationCatalog, integrations_exports as Integrations, InternalError, journeys_exports as Journeys, MailboxSendConflictError, MailboxSendRefusedError, mailboxes_exports as Mailboxes, MalformedRequestError, media_exports as Media, MediaUploadError, messages_exports as Messages, namespaces_exports as Namespaces, newsletter_domains_exports as NewsletterDomains, newsletter_issues_exports as NewsletterIssues, newsletters_exports as Newsletters, OnboardingReviewRequiredError, operations_exports as Operations, organizations_exports as Organizations, PaymentRequiredError, policies_exports as Policies, RateLimitedError, ResourceNotFoundError, retry_exports as Retry, scheduled_messages_exports as ScheduledMessages, SenderNotReadyError, ServiceUnavailableError, subscriptions_exports as Subscriptions, TemplateInUseError, template_registrations_exports as TemplateRegistrations, template_share_links_exports as TemplateShareLinks, TemplateSourceError, templates_exports as Templates, topic_forms_exports as TopicForms, topics_exports as Topics, UnauthorizedError, ValidationError, webhooks_exports as Webhooks, whatsapp_exports as WhatsApp, WhatsAppChannelError, whatsapp_flows_exports as WhatsAppFlows, WhatsAppServiceWindowClosedError, WhatsAppSetupLinkUnavailableError, whatsapp_setup_links_exports as WhatsAppSetupLinks, whoami_exports as Whoami, catchAuthError, catchBillingError, catchCategory, catchConflictError, catchNotFoundError, catchThrottlingError, catchTransient, catchValidationError, categoriesOf, hasCategory, isAuthError, isBillingError, isConflictError, isNotFoundError, isRetryable, isThrottlingError, isTransient, isValidationError };
47
+ export { accounts_exports as Accounts, agents_exports as Agents, analytics_exports as Analytics, AnalyticsQueryError, api_keys_exports as ApiKeys, approval_requests_exports as ApprovalRequests, attachments_exports as Attachments, BillingProviderError, BrandAddressRequiredError, brands_exports as Brands, CampaignFooterRequiredError, campaigns_exports as Campaigns, client_exports as Client, ConflictError, contact_groups_exports as ContactGroups, contacts_exports as Contacts, conversations_exports as Conversations, CredentialsError, custom_fields_exports as CustomFields, DeliveryUnavailableError, email_exports as Email, EmailChannelError, events_exports as Events, ExternalServiceError, feedback_exports as Feedback, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, integrations_catalog_exports as IntegrationCatalog, integrations_exports as Integrations, InternalError, journeys_exports as Journeys, MailboxSendConflictError, MailboxSendRefusedError, mailboxes_exports as Mailboxes, MalformedRequestError, media_exports as Media, MediaUploadError, messages_exports as Messages, namespaces_exports as Namespaces, newsletter_domains_exports as NewsletterDomains, newsletter_issues_exports as NewsletterIssues, newsletters_exports as Newsletters, OnboardingReviewRequiredError, operations_exports as Operations, organizations_exports as Organizations, PaymentRequiredError, policies_exports as Policies, RateLimitedError, ResourceNotFoundError, retry_exports as Retry, SamvaTimeoutError, scheduled_messages_exports as ScheduledMessages, SenderNotReadyError, ServiceUnavailableError, subscriptions_exports as Subscriptions, TemplateInUseError, template_registrations_exports as TemplateRegistrations, template_share_links_exports as TemplateShareLinks, TemplateSourceError, templates_exports as Templates, topic_forms_exports as TopicForms, topics_exports as Topics, UnauthorizedError, ValidationError, webhooks_exports as Webhooks, whatsapp_exports as WhatsApp, WhatsAppChannelError, whatsapp_flows_exports as WhatsAppFlows, WhatsAppServiceWindowClosedError, WhatsAppSetupLinkUnavailableError, whatsapp_setup_links_exports as WhatsAppSetupLinks, whoami_exports as Whoami, catchAuthError, catchBillingError, catchCategory, catchConflictError, catchNotFoundError, catchThrottlingError, catchTransient, catchValidationError, categoriesOf, hasCategory, isAuthError, isBillingError, isConflictError, isNotFoundError, isRetryable, isThrottlingError, isTransient, isValidationError };
@@ -39,7 +39,7 @@ export declare const list: ((input?: {
39
39
  readonly updatedAt: string;
40
40
  }[];
41
41
  readonly nextCursor: string | null;
42
- }, import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
42
+ }, import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("./errors.js").SamvaTimeoutError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
43
43
  readonly items: (input?: {
44
44
  readonly limit?: number | null | undefined;
45
45
  readonly cursor?: string | undefined;
@@ -74,7 +74,7 @@ export declare const list: ((input?: {
74
74
  readonly installedBy: (string & import("effect/Brand").Brand<"UserId">) | null;
75
75
  readonly createdAt: string;
76
76
  readonly updatedAt: string;
77
- }, import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
77
+ }, import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("./errors.js").SamvaTimeoutError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
78
78
  };
79
79
  export declare const install: (input: {
80
80
  readonly app: string;
@@ -3,12 +3,24 @@ import { HttpApiClient, type HttpApiEndpoint, type HttpApiGroup } from "effect/h
3
3
  import * as HttpClient from "effect/http/HttpClient";
4
4
  import { MediaUploadError } from "../../inline-attachments.js";
5
5
  import type { MailboxEventStreamConnection } from "../../mailbox-events.js";
6
+ import { type TimeoutSetting } from "../../request-policy.js";
6
7
  import type { SamvaApi } from "../generated/index.js";
8
+ import { type SamvaTimeoutError } from "./timeout.js";
7
9
  export interface ConfigBase {
8
10
  readonly baseUrl?: string;
9
11
  /** Generate the key once for each idempotent logical call. */
10
12
  readonly idempotency?: ((operation: string) => string | undefined) | undefined;
11
13
  readonly headers?: Readonly<Record<string, string | undefined>>;
14
+ /**
15
+ * Milliseconds each request attempt may take before it fails with `SamvaTimeoutError`
16
+ * (default 30 000). `null` disables the bound.
17
+ */
18
+ readonly timeoutMs?: number | null | undefined;
19
+ /**
20
+ * Milliseconds each put of attachment bytes to storage may take (default 300 000). `null`
21
+ * disables the bound.
22
+ */
23
+ readonly uploadTimeoutMs?: number | null | undefined;
12
24
  }
13
25
  export type Config = (ConfigBase & {
14
26
  readonly apiKey: string | Redacted.Redacted<string>;
@@ -34,11 +46,13 @@ type OperationSuccess<Name extends Operation> = HttpApiClient.SuccessType<HttpAp
34
46
  }>>>;
35
47
  type MethodReturn<Method> = Method extends (...args: infer _Args) => infer Return ? Return : never;
36
48
  /** What one operation wrapper returns: the endpoint's decoded success and typed failure. */
37
- export type OperationResult<Name extends Operation> = Effect.Effect<OperationSuccess<Name>, Effect.Error<MethodReturn<FlatRaw[Name]>>, Service>;
49
+ export type OperationResult<Name extends Operation> = Effect.Effect<OperationSuccess<Name>, Effect.Error<MethodReturn<FlatRaw[Name]>> | SamvaTimeoutError, Service>;
38
50
  /** The generated call for one endpoint, with its decoded success and typed failure. */
39
51
  type OperationCall<Name extends Operation> = (request?: unknown) => OperationResult<Name>;
40
52
  export interface Interface {
41
53
  readonly idempotency?: ((operation: string) => string | undefined) | undefined;
54
+ /** The client's per-attempt request bound; `undefined` means the default, `null` none. */
55
+ readonly timeoutMs?: number | null | undefined;
42
56
  /**
43
57
  * The generated call for one endpoint. A group's client is built on the first call to any of its
44
58
  * endpoints and reused, so a group the program never calls costs nothing.
@@ -49,7 +63,8 @@ export interface Interface {
49
63
  /**
50
64
  * Put bytes at a presigned storage URL through the configured transport, replaying the
51
65
  * instruction's headers exactly and sending no API credentials. Fails with the response status
52
- * (or the transport error) as `MediaUploadError`.
66
+ * (or the transport error, or a `SamvaTimeoutError` past the upload bound) as
67
+ * `MediaUploadError`. `timeoutMs` overrides the client's `uploadTimeoutMs`.
53
68
  */
54
69
  readonly putUpload: (input: {
55
70
  readonly filename: string;
@@ -58,11 +73,13 @@ export interface Interface {
58
73
  readonly method: string;
59
74
  readonly headers: Readonly<Record<string, string>>;
60
75
  readonly bytes: Uint8Array;
76
+ readonly timeoutMs?: TimeoutSetting;
61
77
  }) => Effect.Effect<void, MediaUploadError>;
62
78
  }
63
79
  declare const Service_base: Context.ServiceClass<Service, "samva/Client", Interface>;
64
80
  export declare class Service extends Service_base {
65
81
  }
82
+ /** Throws a `RangeError` for an invalid `timeoutMs` or `uploadTimeoutMs`, as the Promise client does. */
66
83
  export declare const layer: (config: Config) => Layer.Layer<Service, never, HttpClient.HttpClient>;
67
84
  export declare const layerFetch: (config: Config) => Layer.Layer<Service>;
68
85
  export {};
@@ -1,6 +1,8 @@
1
1
  import { CLIENT_ATTRIBUTION_HEADER, clientAttribution } from "../../client-attribution.js";
2
+ import { DEFAULT_UPLOAD_TIMEOUT_MS, resolveTimeout, validateTimeout } from "../../request-policy.js";
2
3
  import { MediaUploadError, uploadContentType } from "../../inline-attachments.js";
3
4
  import { ApiKeySecurityMiddleware } from "../generated/shared.js";
5
+ import { withTimeout } from "./timeout.js";
4
6
  import { Context, Effect, Layer, Redacted } from "effect";
5
7
  import { HttpApi, HttpApiClient, HttpApiMiddleware } from "effect/http-api";
6
8
  import * as FetchHttpClient from "effect/http/FetchHttpClient";
@@ -41,7 +43,7 @@ const make = (config) => Effect.gen(function* () {
41
43
  };
42
44
  const headers = removesAttribution ? {} : { [CLIENT_ATTRIBUTION_HEADER]: clientAttribution("typescript-effect") };
43
45
  for (const [name, value] of Object.entries(requestHeaders)) if (value !== void 0) headers[name] = value;
44
- const putUpload = (input) => storage.execute(HttpClientRequest.make(input.method)(input.url).pipe(HttpClientRequest.bodyUint8Array(input.bytes, uploadContentType(input.headers)), HttpClientRequest.setHeaders(input.headers))).pipe(Effect.mapError((cause) => new MediaUploadError({
46
+ const putUpload = (input) => withTimeout(storage.execute(HttpClientRequest.make(input.method)(input.url).pipe(HttpClientRequest.bodyUint8Array(input.bytes, uploadContentType(input.headers)), HttpClientRequest.setHeaders(input.headers))), resolveTimeout("uploadTimeoutMs", input.timeoutMs, config.uploadTimeoutMs, DEFAULT_UPLOAD_TIMEOUT_MS)).pipe(Effect.mapError((cause) => new MediaUploadError({
45
47
  filename: input.filename,
46
48
  mediaId: input.mediaId,
47
49
  cause
@@ -52,6 +54,7 @@ const make = (config) => Effect.gen(function* () {
52
54
  }))));
53
55
  return Service.of({
54
56
  idempotency: config.idempotency,
57
+ timeoutMs: config.timeoutMs,
55
58
  putUpload,
56
59
  endpoint: (group, name) => Effect.flatMap(groupClient(group), (client) => {
57
60
  const call = client[name];
@@ -66,7 +69,12 @@ const make = (config) => Effect.gen(function* () {
66
69
  }
67
70
  });
68
71
  });
69
- const layer = (config) => Layer.effect(Service, make(config));
72
+ /** Throws a `RangeError` for an invalid `timeoutMs` or `uploadTimeoutMs`, as the Promise client does. */
73
+ const layer = (config) => {
74
+ validateTimeout("timeoutMs", config.timeoutMs);
75
+ validateTimeout("uploadTimeoutMs", config.uploadTimeoutMs);
76
+ return Layer.effect(Service, make(config));
77
+ };
70
78
  const layerFetch = (config) => layer(config).pipe(Layer.provide(FetchHttpClient.layer));
71
79
  export { Service, layer, layerFetch };
72
80
 
@@ -1,17 +1,17 @@
1
1
  import { Effect } from "effect";
2
2
  import { type FlatRaw, Service } from "./client.js";
3
- import { type RequestArg } from "./operation.js";
4
- import type { ErgonomicEmailList, SendOptions } from "./send.js";
3
+ import { type OperationOptions, type RequestArg } from "./operation.js";
4
+ import type { ErgonomicEmailList } from "./send.js";
5
5
  type AddSenderRequest = NonNullable<RequestArg<FlatRaw["emailAddSender"]>>;
6
6
  export type EmailAddSenderInput = Omit<AddSenderRequest["payload"], "replyToEmails"> & {
7
7
  readonly replyToEmails?: ErgonomicEmailList | null | undefined;
8
8
  };
9
- export declare const addEmailSender: (input: EmailAddSenderInput, options?: SendOptions | undefined) => Effect.Effect<{
9
+ export declare const addEmailSender: (input: EmailAddSenderInput, options?: OperationOptions | undefined) => Effect.Effect<{
10
10
  readonly id: string & import("effect/Brand").Brand<"EmailSenderId">;
11
11
  readonly email: string;
12
12
  readonly status: "failed" | "pending" | "verified";
13
13
  readonly providerLifecycle: "active" | "deleting" | "failed" | "provisioning";
14
14
  readonly providerFailureCode: string | null;
15
15
  readonly createdAt: string;
16
- }, import("../index.js").ConflictError | import("../index.js").ExternalServiceError | import("../index.js").ForbiddenError | import("../index.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("../index.js").InternalError | import("../index.js").MalformedRequestError | import("../index.js").ResourceNotFoundError | import("effect/Schema").SchemaError | import("../index.js").UnauthorizedError | import("../index.js").ValidationError, Service>;
16
+ }, import("../index.js").ConflictError | import("../index.js").ExternalServiceError | import("../index.js").ForbiddenError | import("../index.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("../index.js").InternalError | import("../index.js").MalformedRequestError | import("../index.js").ResourceNotFoundError | import("./timeout.js").SamvaTimeoutError | import("effect/Schema").SchemaError | import("../index.js").UnauthorizedError | import("../index.js").ValidationError, Service>;
17
17
  export {};
@@ -1,21 +1,23 @@
1
1
  import { replyToEmailsPayload } from "../../normalize.js";
2
2
  import { generateIdempotencyKey, withRetry } from "../retry.js";
3
+ import { withTimeout } from "./timeout.js";
3
4
  import { Service } from "./client.js";
4
- import { callEndpoint, stripUndefined } from "./operation.js";
5
+ import { attemptTimeout, callEndpoint, stripUndefined } from "./operation.js";
5
6
  import { EmailGroup } from "../generated/email.js";
6
7
  import { Effect } from "effect";
7
8
  // src/effect/internal/email-sender.ts
8
9
  const addEmailSender = Effect.fn("Email.addSender")(function* (input, options) {
9
10
  const client = yield* Service;
11
+ const timeoutMs = attemptTimeout(options, client);
10
12
  const idempotencyKey = options?.idempotencyKey ?? client.idempotency?.("emailAddSender") ?? (yield* generateIdempotencyKey);
11
13
  const { replyToEmails, ...sender } = input;
12
- return yield* withRetry(callEndpoint(EmailGroup, "emailAddSender", {
14
+ return yield* withRetry(withTimeout(callEndpoint(EmailGroup, "emailAddSender", {
13
15
  headers: { "idempotency-key": idempotencyKey },
14
16
  payload: stripUndefined({
15
17
  ...sender,
16
18
  ...replyToEmailsPayload(replyToEmails)
17
19
  })
18
- }));
20
+ }), timeoutMs));
19
21
  });
20
22
  export { addEmailSender };
21
23
 
@@ -24,7 +24,18 @@ type Input<Name extends SdkOperation> = Wire<FlattenRequest<NonNullable<RequestA
24
24
  */
25
25
  export interface OperationOptions {
26
26
  readonly idempotencyKey?: string | undefined;
27
+ /**
28
+ * Milliseconds each attempt may take before it fails with `SamvaTimeoutError`; `null` disables
29
+ * the bound, `undefined` inherits the client's `timeoutMs` (default 30 000).
30
+ */
31
+ readonly timeoutMs?: number | null | undefined;
27
32
  }
33
+ /** The call's bound, else the client's, else the default; throws a `RangeError` when invalid. */
34
+ export declare const attemptTimeout: (options: {
35
+ readonly timeoutMs?: number | null | undefined;
36
+ } | undefined, client: {
37
+ readonly timeoutMs?: number | null | undefined;
38
+ }) => number | null;
28
39
  /**
29
40
  * What one operation wrapper reads at runtime. `codegen/generate-registry.ts` emits a table of these
30
41
  * beside each domain, so a focused entry carries its own operations' descriptors and not the API's.
@@ -1,9 +1,12 @@
1
- import { isRetrySafe } from "../../request-policy.js";
1
+ import { DEFAULT_TIMEOUT_MS, isRetrySafe, resolveTimeout } from "../../request-policy.js";
2
2
  import { streamCursorItems, streamCursorPages } from "../pagination.js";
3
3
  import { generateIdempotencyKey, withRetry } from "../retry.js";
4
+ import { withTimeout } from "./timeout.js";
4
5
  import { Service } from "./client.js";
5
6
  import { Effect, Predicate } from "effect";
6
7
  // src/effect/internal/operation.ts
8
+ /** The call's bound, else the client's, else the default; throws a `RangeError` when invalid. */
9
+ const attemptTimeout = (options, client) => resolveTimeout("timeoutMs", options?.timeoutMs, client.timeoutMs, DEFAULT_TIMEOUT_MS);
7
10
  const traceName = (descriptor, operationName) => {
8
11
  const moduleName = descriptor.group.split(" ").map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join("");
9
12
  const prefix = moduleName.charAt(0).toLowerCase() + moduleName.slice(1);
@@ -17,16 +20,16 @@ const stripUndefined = (input) => {
17
20
  if (Object.getPrototypeOf(input) !== Object.prototype) return input;
18
21
  return Object.fromEntries(Object.entries(input).filter(([, value]) => value !== void 0).map(([key, value]) => [key, stripUndefined(value)]));
19
22
  };
20
- const adapt = (descriptor, operationName, rawCall, input, idempotencyKey) => {
23
+ const adapt = (descriptor, operationName, rawCall, input, idempotencyKey, timeoutMs) => {
21
24
  const callDescriptor = descriptor.call;
22
25
  const call = (request = {}) => {
23
- const operation = rawCall({
26
+ const operation = withTimeout(rawCall({
24
27
  ...request,
25
28
  headers: {
26
29
  ...request["headers"],
27
30
  ...idempotencyKey === void 0 ? {} : { "idempotency-key": idempotencyKey }
28
31
  }
29
- });
32
+ }), timeoutMs);
30
33
  return isRetrySafe(descriptor, input) ? withRetry(operation) : operation;
31
34
  };
32
35
  if (callDescriptor.kind === "none") return call();
@@ -62,9 +65,10 @@ const callEndpoint = (group, name, request) => Effect.flatMap(Service, (client)
62
65
  const make = (group, operationName, descriptor) => {
63
66
  const call = Effect.fn(traceName(descriptor, operationName))(function* (input, options) {
64
67
  const client = yield* Service;
68
+ const timeoutMs = attemptTimeout(options, client);
65
69
  const rawCall = yield* client.endpoint(group, operationName);
66
70
  const idempotencyKey = descriptor.idempotent ? options?.idempotencyKey ?? client.idempotency?.(operationName) ?? (yield* generateIdempotencyKey) : void 0;
67
- return yield* adapt(descriptor, operationName, rawCall, input, idempotencyKey);
71
+ return yield* adapt(descriptor, operationName, rawCall, input, idempotencyKey, timeoutMs);
68
72
  });
69
73
  const operation = call;
70
74
  if (descriptor.paginated) {
@@ -76,6 +80,6 @@ const make = (group, operationName, descriptor) => {
76
80
  }
77
81
  return operation;
78
82
  };
79
- export { callEndpoint, forGroup, stripUndefined };
83
+ export { attemptTimeout, callEndpoint, forGroup, stripUndefined };
80
84
 
81
85
  //# sourceMappingURL=operation.js.map
@@ -19,6 +19,10 @@ type ErgonomicEmailContent = Omit<EmailPayload["email"], "replyTo"> & {
19
19
  };
20
20
  export interface SendOptions {
21
21
  readonly idempotencyKey?: string;
22
+ /** Per-attempt bound on the send and its media requests; `null` disables it. */
23
+ readonly timeoutMs?: number | null | undefined;
24
+ /** Per-put bound on oversized attachment bytes; `null` disables it. */
25
+ readonly uploadTimeoutMs?: number | null | undefined;
22
26
  }
23
27
  export type MessageSendInput = Omit<EmailPayload, "to" | "cc" | "bcc" | "email"> & {
24
28
  readonly to: ErgonomicMessageRecipient | ReadonlyArray<ErgonomicMessageRecipient>;