samva 0.13.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +9 -0
- package/README.md +55 -6
- package/dist/{categories-Bcwq5jPV.js → categories-BGUBFdH9.js} +9 -1
- package/dist/client/sdk.gen.d.ts +129 -27
- package/dist/client/types.gen.d.ts +920 -166
- package/dist/{client-DYPNDvVU.js → client-CDg7zJs0.js} +760 -147
- package/dist/effect/analytics.d.ts +6 -6
- package/dist/effect/analytics.js +1 -1
- package/dist/effect/api-keys.d.ts +20 -20
- package/dist/effect/api-keys.js +1 -1
- package/dist/effect/attachments.js +1 -1
- package/dist/effect/brands.js +2 -2
- package/dist/effect/campaigns.d.ts +12 -12
- package/dist/effect/campaigns.js +1 -1
- package/dist/effect/categories.js +1 -1
- package/dist/effect/client.js +1 -1
- package/dist/effect/contact-groups.d.ts +9 -9
- package/dist/effect/contact-groups.js +1 -1
- package/dist/effect/contacts.d.ts +126 -73
- package/dist/effect/contacts.js +1 -1
- package/dist/effect/conversations.d.ts +20 -20
- package/dist/effect/conversations.js +1 -1
- package/dist/effect/custom-fields.d.ts +1 -1
- package/dist/effect/custom-fields.js +1 -1
- package/dist/effect/email.d.ts +26 -26
- package/dist/effect/email.js +2 -2
- package/dist/effect/extension-installations.d.ts +3 -3
- package/dist/effect/extension-installations.js +1 -1
- package/dist/effect/extensions.d.ts +3 -3
- package/dist/effect/extensions.js +1 -1
- package/dist/effect/feedback.d.ts +1 -1
- package/dist/effect/feedback.js +2 -2
- package/dist/effect/generated-metadata.d.ts +8 -0
- package/dist/effect/generated.d.ts +6335 -1112
- package/dist/effect/index.d.ts +2 -1
- package/dist/effect/index.js +6 -5
- package/dist/effect/internal/client.d.ts +2 -2
- package/dist/effect/internal/operation.d.ts +9 -9
- package/dist/effect/mailboxes.d.ts +1775 -109
- package/dist/effect/mailboxes.js +3 -3
- package/dist/effect/media.d.ts +1 -1
- package/dist/effect/media.js +1 -1
- package/dist/effect/messages.d.ts +19 -17
- package/dist/effect/messages.js +1 -1
- package/dist/effect/namespaces.js +1 -1
- package/dist/effect/operations.d.ts +6 -6
- package/dist/effect/operations.js +1 -1
- package/dist/effect/organizations.d.ts +30 -0
- package/dist/effect/organizations.js +4 -2
- package/dist/effect/retry.js +1 -1
- package/dist/effect/scheduled-messages.d.ts +6 -6
- package/dist/effect/scheduled-messages.js +1 -1
- package/dist/effect/subscriptions.d.ts +15 -0
- package/dist/effect/subscriptions.js +9 -0
- package/dist/effect/templates.d.ts +52 -14
- package/dist/effect/templates.js +5 -3
- package/dist/effect/unsubscribe-groups.d.ts +1 -1
- package/dist/effect/unsubscribe-groups.js +1 -1
- package/dist/effect/webhooks.d.ts +15 -15
- package/dist/effect/webhooks.js +2 -2
- package/dist/index.js +4 -4
- package/dist/{inline-attachments-B56eS0MF.js → inline-attachments-UxLeyytJ.js} +2 -2
- package/dist/{mailbox-events-CsbF35vH.js → mailbox-events-VKR4f3qq.js} +6 -4
- package/dist/mailbox-events.d.ts +1 -1
- package/dist/{mailboxes-D3Kx7elM.js → mailboxes-BH_JPmOE.js} +17 -5
- package/dist/{operation-B_Ty1LG-.js → operation-BZ5Xov-x.js} +37 -3
- package/dist/promises/errors.gen.d.ts +26 -2
- package/dist/promises/index.d.ts +6 -4
- package/dist/promises/index.js +4 -4
- package/dist/promises/types.gen.d.ts +1 -1
- package/dist/{promises-D9FJyU0q.js → promises-Cd6Jamqk.js} +1004 -47
- package/dist/service-map.d.ts +45 -0
- package/package.json +7 -2
package/dist/effect/index.d.ts
CHANGED
|
@@ -38,10 +38,11 @@ export * as Operations from "./operations";
|
|
|
38
38
|
export * as Organizations from "./organizations";
|
|
39
39
|
export * as Retry from "./retry";
|
|
40
40
|
export * as ScheduledMessages from "./scheduled-messages";
|
|
41
|
+
export * as Subscriptions from "./subscriptions";
|
|
41
42
|
export * as Templates from "./templates";
|
|
42
43
|
export * as UnsubscribeGroups from "./unsubscribe-groups";
|
|
43
44
|
export * as Webhooks from "./webhooks";
|
|
44
|
-
export { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, UnauthorizedError, ValidationError, DeliveryUnavailableError, } from "./generated";
|
|
45
|
+
export { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, MailboxSendConflictError, MailboxSendRefusedError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SenderNotReadyError, UnauthorizedError, ValidationError, DeliveryUnavailableError, } from "./generated";
|
|
45
46
|
export { type ErrorCategory, categoriesOf, hasCategory, isAuthError, isValidationError, isNotFoundError, isConflictError, isThrottlingError, isBillingError, isTransient, isRetryable, catchCategory, catchAuthError, catchValidationError, catchNotFoundError, catchConflictError, catchThrottlingError, catchBillingError, catchTransient, } from "./categories";
|
|
46
47
|
export { MediaUploadError } from "../inline-attachments";
|
|
47
48
|
export type { CursorPageEnvelope } from "./pagination";
|
package/dist/effect/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as MediaUploadError } from "../inline-attachments-
|
|
2
|
-
import { C as
|
|
3
|
-
import { _ as isTransient, a as catchNotFoundError, c as catchValidationError, d as isAuthError, f as isBillingError, g as isThrottlingError, h as isRetryable, i as catchConflictError, l as categoriesOf, m as isNotFoundError, n as catchBillingError, o as catchThrottlingError, p as isConflictError, r as catchCategory, s as catchTransient, t as catchAuthError, u as hasCategory, v as isValidationError } from "../categories-
|
|
1
|
+
import { t as MediaUploadError } from "../inline-attachments-UxLeyytJ.js";
|
|
2
|
+
import { C as PaymentRequiredError, F as ValidationError, O as SenderNotReadyError, S as OnboardingReviewRequiredError, T as ResourceNotFoundError, _ as ForbiddenError, a as AnalyticsQueryError, b as MailboxSendConflictError, c as CampaignFooterRequiredError, g as FlagDisabledError, h as ExternalServiceError, j as UnauthorizedError, l as ConflictError, m as EmailChannelError, o as BillingProviderError, p as DeliveryUnavailableError, s as BrandAddressRequiredError, v as GatewayTimeoutError, w as RateLimitedError, x as MailboxSendRefusedError, y as InternalError } from "../client-CDg7zJs0.js";
|
|
3
|
+
import { _ as isTransient, a as catchNotFoundError, c as catchValidationError, d as isAuthError, f as isBillingError, g as isThrottlingError, h as isRetryable, i as catchConflictError, l as categoriesOf, m as isNotFoundError, n as catchBillingError, o as catchThrottlingError, p as isConflictError, r as catchCategory, s as catchTransient, t as catchAuthError, u as hasCategory, v as isValidationError } from "../categories-BGUBFdH9.js";
|
|
4
4
|
import { t as retry_exports } from "./retry.js";
|
|
5
5
|
import { t as analytics_exports } from "./analytics.js";
|
|
6
6
|
import { t as api_keys_exports } from "./api-keys.js";
|
|
@@ -16,14 +16,15 @@ import { t as email_exports } from "./email.js";
|
|
|
16
16
|
import { t as extension_installations_exports } from "./extension-installations.js";
|
|
17
17
|
import { t as extensions_exports } from "./extensions.js";
|
|
18
18
|
import { t as feedback_exports } from "./feedback.js";
|
|
19
|
-
import {
|
|
19
|
+
import { V as mailboxes_exports } from "../mailboxes-BH_JPmOE.js";
|
|
20
20
|
import { t as media_exports } from "./media.js";
|
|
21
21
|
import { t as messages_exports } from "./messages.js";
|
|
22
22
|
import { t as namespaces_exports } from "./namespaces.js";
|
|
23
23
|
import { t as operations_exports } from "./operations.js";
|
|
24
24
|
import { t as organizations_exports } from "./organizations.js";
|
|
25
25
|
import { t as scheduled_messages_exports } from "./scheduled-messages.js";
|
|
26
|
+
import { t as subscriptions_exports } from "./subscriptions.js";
|
|
26
27
|
import { t as templates_exports } from "./templates.js";
|
|
27
28
|
import { t as unsubscribe_groups_exports } from "./unsubscribe-groups.js";
|
|
28
29
|
import { t as webhooks_exports } from "./webhooks.js";
|
|
29
|
-
export { analytics_exports as Analytics, AnalyticsQueryError, api_keys_exports as ApiKeys, 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, custom_fields_exports as CustomFields, DeliveryUnavailableError, email_exports as Email, EmailChannelError, extension_installations_exports as ExtensionInstallations, extensions_exports as Extensions, ExternalServiceError, feedback_exports as Feedback, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, mailboxes_exports as Mailboxes, media_exports as Media, MediaUploadError, messages_exports as Messages, namespaces_exports as Namespaces, OnboardingReviewRequiredError, operations_exports as Operations, organizations_exports as Organizations, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, retry_exports as Retry, scheduled_messages_exports as ScheduledMessages, templates_exports as Templates, UnauthorizedError, unsubscribe_groups_exports as UnsubscribeGroups, ValidationError, webhooks_exports as Webhooks, catchAuthError, catchBillingError, catchCategory, catchConflictError, catchNotFoundError, catchThrottlingError, catchTransient, catchValidationError, categoriesOf, hasCategory, isAuthError, isBillingError, isConflictError, isNotFoundError, isRetryable, isThrottlingError, isTransient, isValidationError };
|
|
30
|
+
export { analytics_exports as Analytics, AnalyticsQueryError, api_keys_exports as ApiKeys, 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, custom_fields_exports as CustomFields, DeliveryUnavailableError, email_exports as Email, EmailChannelError, extension_installations_exports as ExtensionInstallations, extensions_exports as Extensions, ExternalServiceError, feedback_exports as Feedback, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, MailboxSendConflictError, MailboxSendRefusedError, mailboxes_exports as Mailboxes, media_exports as Media, MediaUploadError, messages_exports as Messages, namespaces_exports as Namespaces, OnboardingReviewRequiredError, operations_exports as Operations, organizations_exports as Organizations, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, retry_exports as Retry, scheduled_messages_exports as ScheduledMessages, SenderNotReadyError, subscriptions_exports as Subscriptions, templates_exports as Templates, UnauthorizedError, unsubscribe_groups_exports as UnsubscribeGroups, ValidationError, webhooks_exports as Webhooks, catchAuthError, catchBillingError, catchCategory, catchConflictError, catchNotFoundError, catchThrottlingError, catchTransient, catchValidationError, categoriesOf, hasCategory, isAuthError, isBillingError, isConflictError, isNotFoundError, isRetryable, isThrottlingError, isTransient, isValidationError };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Context, Effect, Layer } from "effect";
|
|
1
|
+
import { Context, Effect, Layer, Redacted } from "effect";
|
|
2
2
|
import { HttpApiClient } from "effect/http-api";
|
|
3
3
|
import * as HttpClient from "effect/http/HttpClient";
|
|
4
4
|
import { MediaUploadError } from "../../inline-attachments";
|
|
@@ -9,7 +9,7 @@ export interface ConfigBase {
|
|
|
9
9
|
readonly headers?: Readonly<Record<string, string | undefined>>;
|
|
10
10
|
}
|
|
11
11
|
export type Config = (ConfigBase & {
|
|
12
|
-
readonly apiKey: string
|
|
12
|
+
readonly apiKey: string | Redacted.Redacted<string>;
|
|
13
13
|
readonly authToken?: never;
|
|
14
14
|
}) | (ConfigBase & {
|
|
15
15
|
readonly authToken: string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Effect, Redacted, Stream } from "effect";
|
|
1
|
+
import { type Brand, Effect, Redacted, Stream } from "effect";
|
|
2
2
|
import { type MediaUploadError } from "../../inline-attachments";
|
|
3
3
|
import { SDK_OPERATION_CALLS } from "../../service-map";
|
|
4
4
|
import { SendMessagePayload } from "../generated";
|
|
5
5
|
import { type FlatRaw, type Operation, Service } from "./client";
|
|
6
6
|
type SdkOperation = keyof typeof SDK_OPERATION_CALLS & Operation;
|
|
7
7
|
type MethodReturn<Method> = Method extends (...args: infer _Args) => infer Return ? Return : never;
|
|
8
|
-
type Wire<Value> = Value extends string ? string : Value extends Redacted.Redacted<infer Raw> ? Raw | Value : Value extends number | boolean | bigint | symbol | null | undefined ? Value : Value extends Date ? Value : Value extends ReadonlyArray<infer Item> ? ReadonlyArray<Wire<Item>> : Value extends object ? {
|
|
8
|
+
type Wire<Value> = Value extends string ? Value extends Brand.Brand<string> ? string : Value : Value extends Redacted.Redacted<infer Raw> ? Raw | Value : Value extends number | boolean | bigint | symbol | null | undefined ? Value : Value extends Date ? Value : Value extends ReadonlyArray<infer Item> ? ReadonlyArray<Wire<Item>> : Value extends object ? {
|
|
9
9
|
readonly [Key in keyof Value]: Wire<Value[Key]> | ({} extends Pick<Value, Key> ? undefined : never);
|
|
10
10
|
} : Value;
|
|
11
11
|
type FlattenRequest<Request> = (Request extends {
|
|
@@ -84,26 +84,26 @@ export type EmailSendInput = Omit<EmailPayload, "channel" | "email" | "to" | "cc
|
|
|
84
84
|
type SendResult = MethodReturn<FlatRaw["messagesSend"]>;
|
|
85
85
|
type UploadFailure = MediaUploadError | Effect.Error<SendResult>;
|
|
86
86
|
export declare const sendMessage: (input: MessageSendInput, options?: SendOptions | undefined) => Effect.Effect<{
|
|
87
|
-
readonly id: string &
|
|
87
|
+
readonly id: string & Brand.Brand<"MessageId">;
|
|
88
88
|
readonly status: "bounced" | "complained" | "delivered" | "failed" | "pending" | "processing" | "queued" | "read" | "scheduled" | "sent";
|
|
89
|
-
readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "sending-paused" | "upstream-unavailable" | null;
|
|
89
|
+
readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "screening-unavailable" | "sending-paused" | "upstream-unavailable" | null;
|
|
90
90
|
readonly reviewExpectedAt: string | null;
|
|
91
91
|
readonly skippedRecipients: readonly {
|
|
92
92
|
readonly address: string;
|
|
93
93
|
readonly reason: "bounce" | "complaint" | "group-unsubscribe" | "manual" | "unsubscribe";
|
|
94
|
-
readonly unsubscribeGroupId?: (string &
|
|
94
|
+
readonly unsubscribeGroupId?: (string & Brand.Brand<"UnsubscribeId">) | null;
|
|
95
95
|
}[];
|
|
96
96
|
readonly createdAt: string;
|
|
97
97
|
}, UploadFailure, Service>;
|
|
98
98
|
export declare const sendEmail: (input: EmailSendInput, options?: SendOptions | undefined) => Effect.Effect<{
|
|
99
|
-
readonly id: string &
|
|
99
|
+
readonly id: string & Brand.Brand<"MessageId">;
|
|
100
100
|
readonly status: "bounced" | "complained" | "delivered" | "failed" | "pending" | "processing" | "queued" | "read" | "scheduled" | "sent";
|
|
101
|
-
readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "sending-paused" | "upstream-unavailable" | null;
|
|
101
|
+
readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "screening-unavailable" | "sending-paused" | "upstream-unavailable" | null;
|
|
102
102
|
readonly reviewExpectedAt: string | null;
|
|
103
103
|
readonly skippedRecipients: readonly {
|
|
104
104
|
readonly address: string;
|
|
105
105
|
readonly reason: "bounce" | "complaint" | "group-unsubscribe" | "manual" | "unsubscribe";
|
|
106
|
-
readonly unsubscribeGroupId?: (string &
|
|
106
|
+
readonly unsubscribeGroupId?: (string & Brand.Brand<"UnsubscribeId">) | null;
|
|
107
107
|
}[];
|
|
108
108
|
readonly createdAt: string;
|
|
109
109
|
}, UploadFailure, Service>;
|
|
@@ -112,7 +112,7 @@ export type EmailAddSenderInput = Omit<AddSenderRequest["payload"], "replyToEmai
|
|
|
112
112
|
readonly replyToEmails?: ErgonomicEmailList | null | undefined;
|
|
113
113
|
};
|
|
114
114
|
export declare const addEmailSender: (input: EmailAddSenderInput, options?: SendOptions | undefined) => Effect.Effect<{
|
|
115
|
-
readonly id: string &
|
|
115
|
+
readonly id: string & Brand.Brand<"EmailSenderId">;
|
|
116
116
|
readonly email: string;
|
|
117
117
|
readonly status: "failed" | "pending" | "verified";
|
|
118
118
|
readonly providerLifecycle: "active" | "deleting" | "failed" | "provisioning";
|