samva 0.46.0 → 0.46.1
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/README.md +1 -1
- package/dist/client/client/client.gen.d.ts +1 -1
- package/dist/client/client/index.d.ts +10 -10
- package/dist/client/client/types.gen.d.ts +4 -4
- package/dist/client/client/utils.gen.d.ts +2 -2
- package/dist/client/client.gen.d.ts +2 -2
- package/dist/client/core/bodySerializer.gen.d.ts +1 -1
- package/dist/client/core/serverSentEvents.gen.d.ts +1 -1
- package/dist/client/core/types.gen.d.ts +2 -2
- package/dist/client/core/utils.gen.d.ts +1 -1
- package/dist/client/sdk.gen.d.ts +2 -2
- package/dist/effect/accounts.d.ts +6 -6
- package/dist/effect/accounts.js +2 -1
- package/dist/effect/agents.d.ts +16 -16
- package/dist/effect/agents.js +2 -1
- package/dist/effect/analytics.d.ts +6 -6
- package/dist/effect/analytics.js +2 -1
- package/dist/effect/api-keys.d.ts +13 -13
- package/dist/effect/api-keys.js +2 -1
- package/dist/effect/approval-requests.d.ts +4 -4
- package/dist/effect/approval-requests.js +2 -1
- package/dist/effect/attachments.d.ts +4 -4
- package/dist/effect/attachments.js +2 -1
- package/dist/effect/brands.d.ts +7 -7
- package/dist/effect/brands.js +2 -1
- package/dist/effect/campaigns.d.ts +45 -45
- package/dist/effect/campaigns.js +2 -1
- package/dist/effect/categories.d.ts +3 -3
- package/dist/effect/client.d.ts +1 -1
- package/dist/effect/contact-groups.d.ts +18 -18
- package/dist/effect/contact-groups.js +2 -1
- package/dist/effect/contacts.d.ts +33 -33
- package/dist/effect/contacts.js +3 -2
- package/dist/effect/conversations.d.ts +17 -17
- package/dist/effect/conversations.js +2 -1
- package/dist/effect/custom-fields.d.ts +4 -4
- package/dist/effect/custom-fields.js +2 -1
- package/dist/effect/descriptors/accounts.d.ts +59 -0
- package/dist/effect/descriptors/accounts.js +57 -0
- package/dist/effect/descriptors/agents.d.ts +119 -0
- package/dist/effect/descriptors/agents.js +117 -0
- package/dist/effect/descriptors/analytics.d.ts +56 -0
- package/dist/effect/descriptors/analytics.js +48 -0
- package/dist/effect/descriptors/api-keys.d.ts +80 -0
- package/dist/effect/descriptors/api-keys.js +80 -0
- package/dist/effect/descriptors/approval-requests.d.ts +41 -0
- package/dist/effect/descriptors/approval-requests.js +43 -0
- package/dist/effect/descriptors/attachments.d.ts +41 -0
- package/dist/effect/descriptors/attachments.js +43 -0
- package/dist/effect/descriptors/brands.d.ts +60 -0
- package/dist/effect/descriptors/brands.js +60 -0
- package/dist/effect/descriptors/campaigns.d.ts +148 -0
- package/dist/effect/descriptors/campaigns.js +144 -0
- package/dist/effect/descriptors/contact-groups.d.ts +99 -0
- package/dist/effect/descriptors/contact-groups.js +97 -0
- package/dist/effect/descriptors/contacts.d.ts +226 -0
- package/dist/effect/descriptors/contacts.js +214 -0
- package/dist/effect/descriptors/conversations.d.ts +130 -0
- package/dist/effect/descriptors/conversations.js +130 -0
- package/dist/effect/descriptors/custom-fields.d.ts +40 -0
- package/dist/effect/descriptors/custom-fields.js +40 -0
- package/dist/effect/descriptors/email.d.ts +607 -0
- package/dist/effect/descriptors/email.js +561 -0
- package/dist/effect/descriptors/events.d.ts +20 -0
- package/dist/effect/descriptors/events.js +20 -0
- package/dist/effect/descriptors/extension-installations.d.ts +90 -0
- package/dist/effect/descriptors/extension-installations.js +90 -0
- package/dist/effect/descriptors/extensions.d.ts +50 -0
- package/dist/effect/descriptors/extensions.js +50 -0
- package/dist/effect/descriptors/feedback.d.ts +11 -0
- package/dist/effect/descriptors/feedback.js +11 -0
- package/dist/effect/descriptors/integrations-catalog.d.ts +29 -0
- package/dist/effect/descriptors/integrations-catalog.js +27 -0
- package/dist/effect/descriptors/integrations.d.ts +70 -0
- package/dist/effect/descriptors/integrations.js +70 -0
- package/dist/effect/descriptors/journeys.d.ts +140 -0
- package/dist/effect/descriptors/journeys.js +140 -0
- package/dist/effect/descriptors/mailboxes.d.ts +724 -0
- package/dist/effect/descriptors/mailboxes.js +728 -0
- package/dist/effect/descriptors/media.d.ts +51 -0
- package/dist/effect/descriptors/media.js +53 -0
- package/dist/effect/descriptors/messages.d.ts +99 -0
- package/dist/effect/descriptors/messages.js +97 -0
- package/dist/effect/descriptors/namespaces.d.ts +110 -0
- package/dist/effect/descriptors/namespaces.js +114 -0
- package/dist/effect/descriptors/newsletter-domains.d.ts +42 -0
- package/dist/effect/descriptors/newsletter-domains.js +46 -0
- package/dist/effect/descriptors/newsletter-issues.d.ts +112 -0
- package/dist/effect/descriptors/newsletter-issues.js +116 -0
- package/dist/effect/descriptors/newsletters.d.ts +51 -0
- package/dist/effect/descriptors/newsletters.js +53 -0
- package/dist/effect/descriptors/operations.d.ts +31 -0
- package/dist/effect/descriptors/operations.js +33 -0
- package/dist/effect/descriptors/organizations.d.ts +111 -0
- package/dist/effect/descriptors/organizations.js +93 -0
- package/dist/effect/descriptors/policies.d.ts +32 -0
- package/dist/effect/descriptors/policies.js +36 -0
- package/dist/effect/descriptors/scheduled-messages.d.ts +50 -0
- package/dist/effect/descriptors/scheduled-messages.js +50 -0
- package/dist/effect/descriptors/subscriptions.d.ts +11 -0
- package/dist/effect/descriptors/subscriptions.js +11 -0
- package/dist/effect/descriptors/template-registrations.d.ts +32 -0
- package/dist/effect/descriptors/template-registrations.js +36 -0
- package/dist/effect/descriptors/template-share-links.d.ts +52 -0
- package/dist/effect/descriptors/template-share-links.js +56 -0
- package/dist/effect/descriptors/templates.d.ts +365 -0
- package/dist/effect/descriptors/templates.js +355 -0
- package/dist/effect/descriptors/topic-forms.d.ts +52 -0
- package/dist/effect/descriptors/topic-forms.js +56 -0
- package/dist/effect/descriptors/topics.d.ts +89 -0
- package/dist/effect/descriptors/topics.js +87 -0
- package/dist/effect/descriptors/webhooks.d.ts +110 -0
- package/dist/effect/descriptors/webhooks.js +110 -0
- package/dist/effect/descriptors/whats-app-flows.d.ts +99 -0
- package/dist/effect/descriptors/whats-app-flows.js +97 -0
- package/dist/effect/descriptors/whats-app-setup-links.d.ts +40 -0
- package/dist/effect/descriptors/whats-app-setup-links.js +40 -0
- package/dist/effect/descriptors/whats-app.d.ts +116 -0
- package/dist/effect/descriptors/whats-app.js +108 -0
- package/dist/effect/descriptors/whoami.d.ts +11 -0
- package/dist/effect/descriptors/whoami.js +11 -0
- package/dist/effect/email.d.ts +78 -78
- package/dist/effect/email.js +2 -1
- package/dist/effect/errors.d.ts +2 -2
- package/dist/effect/events.d.ts +3 -3
- package/dist/effect/events.js +2 -1
- package/dist/effect/extension-installations.d.ts +11 -11
- package/dist/effect/extension-installations.js +2 -1
- package/dist/effect/extensions.d.ts +9 -9
- package/dist/effect/extensions.js +2 -1
- package/dist/effect/feedback.d.ts +2 -2
- package/dist/effect/feedback.js +2 -1
- package/dist/effect/generated/accounts.d.ts +9 -9
- package/dist/effect/generated/agents.d.ts +1 -1
- package/dist/effect/generated/analytics.d.ts +1 -1
- package/dist/effect/generated/api-keys.d.ts +1 -1
- package/dist/effect/generated/approval-requests.d.ts +13 -13
- package/dist/effect/generated/attachments.d.ts +1 -1
- package/dist/effect/generated/brands.d.ts +1 -1
- package/dist/effect/generated/campaigns.d.ts +230 -230
- package/dist/effect/generated/contact-events.d.ts +4 -4
- package/dist/effect/generated/contact-groups.d.ts +1 -1
- package/dist/effect/generated/contacts.d.ts +49 -49
- package/dist/effect/generated/conversations.d.ts +1 -1
- package/dist/effect/generated/custom-fields.d.ts +1 -1
- package/dist/effect/generated/email.d.ts +1 -1
- package/dist/effect/generated/events.d.ts +12 -12
- package/dist/effect/generated/extension-installations.d.ts +1 -1
- package/dist/effect/generated/extensions.d.ts +1 -1
- package/dist/effect/generated/feedback.d.ts +1 -1
- package/dist/effect/generated/index.d.ts +87 -87
- package/dist/effect/generated/integrations-catalog.d.ts +3 -3
- package/dist/effect/generated/integrations.d.ts +15 -15
- package/dist/effect/generated/journeys.d.ts +81 -81
- package/dist/effect/generated/mailboxes.d.ts +1 -1
- package/dist/effect/generated/media.d.ts +1 -1
- package/dist/effect/generated/messages.d.ts +1 -1
- package/dist/effect/generated/namespaces.d.ts +1 -1
- package/dist/effect/generated/newsletter-domains.d.ts +1 -1
- package/dist/effect/generated/newsletter-issues.d.ts +1 -1
- package/dist/effect/generated/newsletters.d.ts +1 -1
- package/dist/effect/generated/operations.d.ts +1 -1
- package/dist/effect/generated/organizations.d.ts +1 -1
- package/dist/effect/generated/policies.d.ts +1 -1
- package/dist/effect/generated/scheduled-messages.d.ts +147 -147
- package/dist/effect/generated/shared.d.ts +1 -1
- package/dist/effect/generated/subscriptions.d.ts +1 -1
- package/dist/effect/generated/template-registrations.d.ts +1 -1
- package/dist/effect/generated/template-share-links.d.ts +1 -1
- package/dist/effect/generated/templates.d.ts +1 -1
- package/dist/effect/generated/topic-forms.d.ts +1 -1
- package/dist/effect/generated/topics.d.ts +1 -1
- package/dist/effect/generated/webhooks.d.ts +1 -1
- package/dist/effect/generated/whats-app-flows.d.ts +1 -1
- package/dist/effect/generated/whats-app-setup-links.d.ts +1 -1
- package/dist/effect/generated/whats-app.d.ts +1 -1
- package/dist/effect/generated/whoami.d.ts +1 -1
- package/dist/effect/index.d.ts +47 -47
- package/dist/effect/integrations-catalog.d.ts +3 -3
- package/dist/effect/integrations-catalog.js +2 -1
- package/dist/effect/integrations.d.ts +11 -11
- package/dist/effect/integrations.js +2 -1
- package/dist/effect/internal/client.d.ts +3 -3
- package/dist/effect/internal/email-sender.d.ts +4 -4
- package/dist/effect/internal/mailbox-events.d.ts +2 -2
- package/dist/effect/internal/operation.d.ts +24 -5
- package/dist/effect/internal/operation.js +21 -21
- package/dist/effect/internal/send.d.ts +4 -4
- package/dist/effect/journeys.d.ts +20 -20
- package/dist/effect/journeys.js +2 -1
- package/dist/effect/mailboxes.d.ts +123 -123
- package/dist/effect/mailboxes.js +2 -1
- package/dist/effect/media.d.ts +5 -5
- package/dist/effect/media.js +2 -1
- package/dist/effect/messages.d.ts +17 -17
- package/dist/effect/messages.js +2 -1
- package/dist/effect/namespaces.d.ts +15 -15
- package/dist/effect/namespaces.js +2 -1
- package/dist/effect/newsletter-domains.d.ts +6 -6
- package/dist/effect/newsletter-domains.js +2 -1
- package/dist/effect/newsletter-issues.d.ts +11 -11
- package/dist/effect/newsletter-issues.js +2 -1
- package/dist/effect/newsletters.d.ts +5 -5
- package/dist/effect/newsletters.js +2 -1
- package/dist/effect/operations.d.ts +5 -5
- package/dist/effect/operations.js +2 -1
- package/dist/effect/organizations.d.ts +12 -12
- package/dist/effect/organizations.js +2 -1
- package/dist/effect/policies.d.ts +3 -3
- package/dist/effect/policies.js +2 -1
- package/dist/effect/scheduled-messages.d.ts +23 -23
- package/dist/effect/scheduled-messages.js +2 -1
- package/dist/effect/subscriptions.d.ts +1 -1
- package/dist/effect/subscriptions.js +2 -1
- package/dist/effect/template-registrations.d.ts +3 -3
- package/dist/effect/template-registrations.js +2 -1
- package/dist/effect/template-share-links.d.ts +5 -5
- package/dist/effect/template-share-links.js +2 -1
- package/dist/effect/templates.d.ts +46 -46
- package/dist/effect/templates.js +2 -1
- package/dist/effect/topic-forms.d.ts +5 -5
- package/dist/effect/topic-forms.js +2 -1
- package/dist/effect/topics.d.ts +11 -11
- package/dist/effect/topics.js +2 -1
- package/dist/effect/webhooks.d.ts +16 -16
- package/dist/effect/webhooks.js +2 -1
- package/dist/effect/whatsapp-flows.d.ts +10 -10
- package/dist/effect/whatsapp-flows.js +2 -1
- package/dist/effect/whatsapp-setup-links.d.ts +6 -6
- package/dist/effect/whatsapp-setup-links.js +2 -1
- package/dist/effect/whatsapp.d.ts +12 -12
- package/dist/effect/whatsapp.js +2 -1
- package/dist/effect/whoami.d.ts +1 -1
- package/dist/effect/whoami.js +2 -1
- package/dist/index.d.ts +1 -1
- package/dist/mailbox/dispatch.d.ts +2 -2
- package/dist/mailbox/index.d.ts +4 -4
- package/dist/mailbox/test.d.ts +2 -2
- package/dist/mailbox/types.d.ts +2 -2
- package/dist/mailbox/webhook.d.ts +2 -2
- package/dist/package.js +1 -1
- package/dist/promises/client.d.ts +10 -10
- package/dist/promises/errors.gen.d.ts +1 -1
- package/dist/promises/index.d.ts +5 -5
- package/dist/promises/request.d.ts +2 -2
- package/dist/promises/request.js +1 -1
- package/dist/promises/types.gen.d.ts +1 -1
- package/dist/request-policy.d.ts +10 -2
- package/dist/request-policy.js +3 -5
- package/package.json +9 -9
- package/dist/service-map.js +0 -830
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type * as EffectBrand from "effect/Brand";
|
|
2
2
|
import { HttpApiMiddleware, HttpApiSecurity } from "effect/http-api";
|
|
3
3
|
import * as Schema from "effect/Schema";
|
|
4
|
-
import { AbsoluteInstant as __SamvaRuntimeAbsoluteInstant, NonEmptySensitiveString as __SamvaRuntimeNonEmptySensitiveString, SensitiveString as __SamvaRuntimeSensitiveString } from "../runtime";
|
|
4
|
+
import { AbsoluteInstant as __SamvaRuntimeAbsoluteInstant, NonEmptySensitiveString as __SamvaRuntimeNonEmptySensitiveString, SensitiveString as __SamvaRuntimeSensitiveString } from "../runtime.js";
|
|
5
5
|
export type JsonValue = string | number | boolean | null | ReadonlyArray<JsonValue> | {
|
|
6
6
|
readonly [x: string]: JsonValue;
|
|
7
7
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
|
|
2
2
|
import * as Schema from "effect/Schema";
|
|
3
|
-
import { ApiKeySecurityMiddleware, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, DeliveryUnavailableError, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, MalformedRequestError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SenderNotReadyError, TopicId, UnauthorizedError, ValidationError } from "./shared";
|
|
3
|
+
import { ApiKeySecurityMiddleware, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, DeliveryUnavailableError, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, MalformedRequestError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SenderNotReadyError, TopicId, UnauthorizedError, ValidationError } from "./shared.js";
|
|
4
4
|
export type SubscribeResult = {
|
|
5
5
|
readonly success: boolean;
|
|
6
6
|
readonly expiresAt: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type * as EffectBrand from "effect/Brand";
|
|
2
2
|
import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
|
|
3
3
|
import * as Schema from "effect/Schema";
|
|
4
|
-
import { ApiKeySecurityMiddleware, ConflictError, CredentialsError, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, MalformedRequestError, ResourceNotFoundError, TemplateId, TemplatePublicationId, UnauthorizedError, ValidationError, WhatsAppBusinessAccountId, WhatsAppChannelError } from "./shared";
|
|
4
|
+
import { ApiKeySecurityMiddleware, ConflictError, CredentialsError, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, MalformedRequestError, ResourceNotFoundError, TemplateId, TemplatePublicationId, UnauthorizedError, ValidationError, WhatsAppBusinessAccountId, WhatsAppChannelError } from "./shared.js";
|
|
5
5
|
export type TemplateRegistrationId = string & EffectBrand.Brand<"TemplateRegistrationId">;
|
|
6
6
|
export declare const TemplateRegistrationId: Schema.brand<Schema.String, "TemplateRegistrationId">;
|
|
7
7
|
export type WhatsAppRegistrationTarget = {
|
|
@@ -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, ForbiddenError, GatewayTimeoutError, InternalError, MalformedRequestError, ResourceNotFoundError, ServiceUnavailableError, SlugTaken, TemplateProjectId, TemplateSourceError, UnauthorizedError, ValidationError } from "./shared";
|
|
3
|
+
import { ApiKeySecurityMiddleware, ConflictError, ForbiddenError, GatewayTimeoutError, InternalError, MalformedRequestError, ResourceNotFoundError, ServiceUnavailableError, SlugTaken, TemplateProjectId, TemplateSourceError, UnauthorizedError, ValidationError } from "./shared.js";
|
|
4
4
|
export type TemplateShareLinksGetPathParams = {
|
|
5
5
|
readonly projectId: TemplateProjectId;
|
|
6
6
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type * as EffectBrand from "effect/Brand";
|
|
2
2
|
import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
|
|
3
3
|
import * as Schema from "effect/Schema";
|
|
4
|
-
import { ApiKeySecurityMiddleware, BrandAssets, BrandFooter, ConflictError, ForbiddenError, GatewayTimeoutError, InternalError, JsonValue, MalformedRequestError, NamespaceId, OrganizationId, RenderLocale, RenderTimeZone, ResourceNotFoundError, ServiceUnavailableError, ShareLinkUnavailable, SuccessResponse, TemplateFromDefaultInput, TemplateId, TemplateInUseError, TemplateInputContractId, TemplateProjectId, TemplatePublicationId, TemplateSourceError, TemplateTrackingDefault, UnauthorizedError, UserId, ValidationError } from "./shared";
|
|
4
|
+
import { ApiKeySecurityMiddleware, BrandAssets, BrandFooter, ConflictError, ForbiddenError, GatewayTimeoutError, InternalError, JsonValue, MalformedRequestError, NamespaceId, OrganizationId, RenderLocale, RenderTimeZone, ResourceNotFoundError, ServiceUnavailableError, ShareLinkUnavailable, SuccessResponse, TemplateFromDefaultInput, TemplateId, TemplateInUseError, TemplateInputContractId, TemplateProjectId, TemplatePublicationId, TemplateSourceError, TemplateTrackingDefault, UnauthorizedError, UserId, ValidationError } from "./shared.js";
|
|
5
5
|
export type TemplatePublicationBrand = {
|
|
6
6
|
readonly slug: string;
|
|
7
7
|
readonly digest: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
|
|
2
2
|
import * as Schema from "effect/Schema";
|
|
3
|
-
import { ApiKeySecurityMiddleware, ForbiddenError, GatewayTimeoutError, InternalError, MalformedRequestError, ResourceNotFoundError, TopicId, UnauthorizedError, ValidationError } from "./shared";
|
|
3
|
+
import { ApiKeySecurityMiddleware, ForbiddenError, GatewayTimeoutError, InternalError, MalformedRequestError, ResourceNotFoundError, TopicId, UnauthorizedError, ValidationError } from "./shared.js";
|
|
4
4
|
export type TopicForm = {
|
|
5
5
|
readonly id: string;
|
|
6
6
|
readonly publicKey: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
|
|
2
2
|
import * as Schema from "effect/Schema";
|
|
3
|
-
import { ApiKeySecurityMiddleware, BillingProviderError, ConflictError, ContactId, EmailSenderId, ForbiddenError, GatewayTimeoutError, InternalError, MailboxId, MalformedRequestError, NamespaceId, PaymentRequiredError, ResourceNotFoundError, TemplateId, TopicContactRef, TopicId, UnauthorizedError, ValidationError } from "./shared";
|
|
3
|
+
import { ApiKeySecurityMiddleware, BillingProviderError, ConflictError, ContactId, EmailSenderId, ForbiddenError, GatewayTimeoutError, InternalError, MailboxId, MalformedRequestError, NamespaceId, PaymentRequiredError, ResourceNotFoundError, TemplateId, TopicContactRef, TopicId, UnauthorizedError, ValidationError } from "./shared.js";
|
|
4
4
|
export type TopicSubscriptionCounts = {
|
|
5
5
|
readonly sms: {
|
|
6
6
|
readonly subscribed: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type * as EffectBrand from "effect/Brand";
|
|
2
2
|
import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
|
|
3
3
|
import * as Schema from "effect/Schema";
|
|
4
|
-
import { ApiKeySecurityMiddleware, BillingProviderError, ConflictError, ForbiddenError, GatewayTimeoutError, InternalError, JsonValue, MailboxId, MalformedRequestError, NamespaceId, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SuccessResponse, UnauthorizedError, ValidationError, WebhookEndpointId, __SamvaRuntimeSensitiveString } from "./shared";
|
|
4
|
+
import { ApiKeySecurityMiddleware, BillingProviderError, ConflictError, ForbiddenError, GatewayTimeoutError, InternalError, JsonValue, MailboxId, MalformedRequestError, NamespaceId, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SuccessResponse, UnauthorizedError, ValidationError, WebhookEndpointId, __SamvaRuntimeSensitiveString } from "./shared.js";
|
|
5
5
|
export type WebhookDeliveryCounts = {
|
|
6
6
|
readonly total: number;
|
|
7
7
|
readonly pending: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type * as EffectBrand from "effect/Brand";
|
|
2
2
|
import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
|
|
3
3
|
import * as Schema from "effect/Schema";
|
|
4
|
-
import { ApiKeySecurityMiddleware, ConflictError, CredentialsError, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, MalformedRequestError, ResourceNotFoundError, ServiceUnavailableError, TemplateProjectId, UnauthorizedError, ValidationError, WhatsAppBusinessAccountId, WhatsAppChannelError, WhatsAppFlowId, WhatsAppFlowVersionId, __SamvaRuntimeSensitiveString } from "./shared";
|
|
4
|
+
import { ApiKeySecurityMiddleware, ConflictError, CredentialsError, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, MalformedRequestError, ResourceNotFoundError, ServiceUnavailableError, TemplateProjectId, UnauthorizedError, ValidationError, WhatsAppBusinessAccountId, WhatsAppChannelError, WhatsAppFlowId, WhatsAppFlowVersionId, __SamvaRuntimeSensitiveString } from "./shared.js";
|
|
5
5
|
export type WhatsAppFlowEndpoint = {
|
|
6
6
|
readonly url: string;
|
|
7
7
|
readonly updatedAt: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type * as EffectBrand from "effect/Brand";
|
|
2
2
|
import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
|
|
3
3
|
import * as Schema from "effect/Schema";
|
|
4
|
-
import { ApiKeySecurityMiddleware, BillingProviderError, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, MalformedRequestError, NamespaceId, OrganizationId, PaymentRequiredError, ResourceNotFoundError, UnauthorizedError, ValidationError, WhatsAppBusinessAccountId, WhatsAppSetupLinkMetadata, WhatsAppSetupLinkRedirectUrl, WhatsAppSetupLinkUnavailableError, __SamvaRuntimeSensitiveString } from "./shared";
|
|
4
|
+
import { ApiKeySecurityMiddleware, BillingProviderError, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, MalformedRequestError, NamespaceId, OrganizationId, PaymentRequiredError, ResourceNotFoundError, UnauthorizedError, ValidationError, WhatsAppBusinessAccountId, WhatsAppSetupLinkMetadata, WhatsAppSetupLinkRedirectUrl, WhatsAppSetupLinkUnavailableError, __SamvaRuntimeSensitiveString } from "./shared.js";
|
|
5
5
|
export type WhatsAppSetupLinkStatus = "pending" | "completed" | "revoked" | "expired";
|
|
6
6
|
export declare const WhatsAppSetupLinkStatus: Schema.Union<readonly [Schema.Literal<"pending">, Schema.Literal<"completed">, Schema.Literal<"revoked">, Schema.Literal<"expired">]>;
|
|
7
7
|
export type WhatsAppSetupLinkId = string & EffectBrand.Brand<"WhatsAppSetupLinkId">;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type * as EffectBrand from "effect/Brand";
|
|
2
2
|
import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
|
|
3
3
|
import * as Schema from "effect/Schema";
|
|
4
|
-
import { ApiKeySecurityMiddleware, BillingProviderError, CampaignId, ConflictError, CredentialsError, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, JourneyId, MalformedRequestError, MessageDeliveryId, NamespaceId, PaymentRequiredError, ResourceNotFoundError, TemplateId, UnauthorizedError, ValidationError, WhatsAppBusinessAccountId, WhatsAppChannelError, __SamvaRuntimeNonEmptySensitiveString, __SamvaRuntimeSensitiveString } from "./shared";
|
|
4
|
+
import { ApiKeySecurityMiddleware, BillingProviderError, CampaignId, ConflictError, CredentialsError, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, JourneyId, MalformedRequestError, MessageDeliveryId, NamespaceId, PaymentRequiredError, ResourceNotFoundError, TemplateId, UnauthorizedError, ValidationError, WhatsAppBusinessAccountId, WhatsAppChannelError, __SamvaRuntimeNonEmptySensitiveString, __SamvaRuntimeSensitiveString } from "./shared.js";
|
|
5
5
|
export type PaginationMeta = {
|
|
6
6
|
readonly page: number;
|
|
7
7
|
readonly limit: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
|
|
2
2
|
import * as Schema from "effect/Schema";
|
|
3
|
-
import { ApiKeyAccess, ApiKeySecurityMiddleware, ForbiddenError, GatewayTimeoutError, InternalError, MalformedRequestError, OrganizationId, UnauthorizedError, ValidationError } from "./shared";
|
|
3
|
+
import { ApiKeyAccess, ApiKeySecurityMiddleware, ForbiddenError, GatewayTimeoutError, InternalError, MalformedRequestError, OrganizationId, UnauthorizedError, ValidationError } from "./shared.js";
|
|
4
4
|
export type WhoamiUser = {
|
|
5
5
|
readonly id: string;
|
|
6
6
|
readonly name: string;
|
package/dist/effect/index.d.ts
CHANGED
|
@@ -16,51 +16,51 @@
|
|
|
16
16
|
* }).pipe(Effect.provide(Client.layerFetch({ apiKey: "<samva-api-key>" })));
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
19
|
-
export * as Accounts from "./accounts";
|
|
20
|
-
export * as IntegrationCatalog from "./integrations-catalog";
|
|
21
|
-
export * as Integrations from "./integrations";
|
|
22
|
-
export * as Agents from "./agents";
|
|
23
|
-
export * as Analytics from "./analytics";
|
|
24
|
-
export * as ApiKeys from "./api-keys";
|
|
25
|
-
export * as ApprovalRequests from "./approval-requests";
|
|
26
|
-
export * as Attachments from "./attachments";
|
|
27
|
-
export * as Brands from "./brands";
|
|
28
|
-
export * as Campaigns from "./campaigns";
|
|
29
|
-
export * as Client from "./client";
|
|
30
|
-
export * as ContactGroups from "./contact-groups";
|
|
31
|
-
export * as Contacts from "./contacts";
|
|
32
|
-
export * as Conversations from "./conversations";
|
|
33
|
-
export * as CustomFields from "./custom-fields";
|
|
34
|
-
export * as Email from "./email";
|
|
35
|
-
export * as ExtensionInstallations from "./extension-installations";
|
|
36
|
-
export * as Extensions from "./extensions";
|
|
37
|
-
export * as Events from "./events";
|
|
38
|
-
export * as Feedback from "./feedback";
|
|
39
|
-
export * as Journeys from "./journeys";
|
|
40
|
-
export * as Mailboxes from "./mailboxes";
|
|
41
|
-
export * as Media from "./media";
|
|
42
|
-
export * as Messages from "./messages";
|
|
43
|
-
export * as Namespaces from "./namespaces";
|
|
44
|
-
export * as Operations from "./operations";
|
|
45
|
-
export * as Organizations from "./organizations";
|
|
46
|
-
export * as Policies from "./policies";
|
|
47
|
-
export * as NewsletterDomains from "./newsletter-domains";
|
|
48
|
-
export * as Retry from "./retry";
|
|
49
|
-
export * as ScheduledMessages from "./scheduled-messages";
|
|
50
|
-
export * as Subscriptions from "./subscriptions";
|
|
51
|
-
export * as Templates from "./templates";
|
|
52
|
-
export * as Topics from "./topics";
|
|
53
|
-
export * as TopicForms from "./topic-forms";
|
|
54
|
-
export * as NewsletterIssues from "./newsletter-issues";
|
|
55
|
-
export * as Webhooks from "./webhooks";
|
|
56
|
-
export * as Whoami from "./whoami";
|
|
57
|
-
export * from "./errors";
|
|
58
|
-
export { type ErrorCategory, categoriesOf, hasCategory, isAuthError, isValidationError, isNotFoundError, isConflictError, isThrottlingError, isBillingError, isTransient, isRetryable, catchCategory, catchAuthError, catchValidationError, catchNotFoundError, catchConflictError, catchThrottlingError, catchBillingError, catchTransient, } from "./categories";
|
|
59
|
-
export type { CursorPageEnvelope } from "./pagination";
|
|
19
|
+
export * as Accounts from "./accounts.js";
|
|
20
|
+
export * as IntegrationCatalog from "./integrations-catalog.js";
|
|
21
|
+
export * as Integrations from "./integrations.js";
|
|
22
|
+
export * as Agents from "./agents.js";
|
|
23
|
+
export * as Analytics from "./analytics.js";
|
|
24
|
+
export * as ApiKeys from "./api-keys.js";
|
|
25
|
+
export * as ApprovalRequests from "./approval-requests.js";
|
|
26
|
+
export * as Attachments from "./attachments.js";
|
|
27
|
+
export * as Brands from "./brands.js";
|
|
28
|
+
export * as Campaigns from "./campaigns.js";
|
|
29
|
+
export * as Client from "./client.js";
|
|
30
|
+
export * as ContactGroups from "./contact-groups.js";
|
|
31
|
+
export * as Contacts from "./contacts.js";
|
|
32
|
+
export * as Conversations from "./conversations.js";
|
|
33
|
+
export * as CustomFields from "./custom-fields.js";
|
|
34
|
+
export * as Email from "./email.js";
|
|
35
|
+
export * as ExtensionInstallations from "./extension-installations.js";
|
|
36
|
+
export * as Extensions from "./extensions.js";
|
|
37
|
+
export * as Events from "./events.js";
|
|
38
|
+
export * as Feedback from "./feedback.js";
|
|
39
|
+
export * as Journeys from "./journeys.js";
|
|
40
|
+
export * as Mailboxes from "./mailboxes.js";
|
|
41
|
+
export * as Media from "./media.js";
|
|
42
|
+
export * as Messages from "./messages.js";
|
|
43
|
+
export * as Namespaces from "./namespaces.js";
|
|
44
|
+
export * as Operations from "./operations.js";
|
|
45
|
+
export * as Organizations from "./organizations.js";
|
|
46
|
+
export * as Policies from "./policies.js";
|
|
47
|
+
export * as NewsletterDomains from "./newsletter-domains.js";
|
|
48
|
+
export * as Retry from "./retry.js";
|
|
49
|
+
export * as ScheduledMessages from "./scheduled-messages.js";
|
|
50
|
+
export * as Subscriptions from "./subscriptions.js";
|
|
51
|
+
export * as Templates from "./templates.js";
|
|
52
|
+
export * as Topics from "./topics.js";
|
|
53
|
+
export * as TopicForms from "./topic-forms.js";
|
|
54
|
+
export * as NewsletterIssues from "./newsletter-issues.js";
|
|
55
|
+
export * as Webhooks from "./webhooks.js";
|
|
56
|
+
export * as Whoami from "./whoami.js";
|
|
57
|
+
export * from "./errors.js";
|
|
58
|
+
export { type ErrorCategory, categoriesOf, hasCategory, isAuthError, isValidationError, isNotFoundError, isConflictError, isThrottlingError, isBillingError, isTransient, isRetryable, catchCategory, catchAuthError, catchValidationError, catchNotFoundError, catchConflictError, catchThrottlingError, catchBillingError, catchTransient, } from "./categories.js";
|
|
59
|
+
export type { CursorPageEnvelope } from "./pagination.js";
|
|
60
60
|
export type { Json as JsonValue } from "effect/Schema";
|
|
61
|
-
export * as Newsletters from "./newsletters";
|
|
62
|
-
export * as WhatsApp from "./whatsapp";
|
|
63
|
-
export * as WhatsAppFlows from "./whatsapp-flows";
|
|
64
|
-
export * as WhatsAppSetupLinks from "./whatsapp-setup-links";
|
|
65
|
-
export * as TemplateRegistrations from "./template-registrations";
|
|
66
|
-
export * as TemplateShareLinks from "./template-share-links";
|
|
61
|
+
export * as Newsletters from "./newsletters.js";
|
|
62
|
+
export * as WhatsApp from "./whatsapp.js";
|
|
63
|
+
export * as WhatsAppFlows from "./whatsapp-flows.js";
|
|
64
|
+
export * as WhatsAppSetupLinks from "./whatsapp-setup-links.js";
|
|
65
|
+
export * as TemplateRegistrations from "./template-registrations.js";
|
|
66
|
+
export * as TemplateShareLinks from "./template-share-links.js";
|
|
@@ -27,12 +27,12 @@ export declare const prepare: (input: {
|
|
|
27
27
|
readonly [x: string]: string | number | boolean | any | any | null | undefined;
|
|
28
28
|
} | null | undefined;
|
|
29
29
|
} | undefined;
|
|
30
|
-
}, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"integrationCatalogPrepare">;
|
|
30
|
+
}, options?: import("./internal/operation.js").OperationOptions) => import("./internal/operation.js").OperationResult<"integrationCatalogPrepare">;
|
|
31
31
|
export declare const search: (input?: {
|
|
32
32
|
readonly key?: string | undefined;
|
|
33
33
|
readonly query?: string | undefined;
|
|
34
34
|
readonly category?: "accounting" | "calendar" | "channel" | "commerce" | "crm" | "dns" | "forms" | "helpdesk" | "knowledge" | "other" | "payments" | "productivity" | "reviews" | "shipping" | undefined;
|
|
35
35
|
readonly offset?: number | undefined;
|
|
36
36
|
readonly limit?: number | undefined;
|
|
37
|
-
} | undefined, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"integrationCatalogSearch">;
|
|
38
|
-
export declare const list: (input?: never, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"integrationCatalogList">;
|
|
37
|
+
} | undefined, options?: import("./internal/operation.js").OperationOptions) => import("./internal/operation.js").OperationResult<"integrationCatalogSearch">;
|
|
38
|
+
export declare const list: (input?: never, options?: import("./internal/operation.js").OperationOptions) => import("./internal/operation.js").OperationResult<"integrationCatalogList">;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { forGroup } from "./internal/operation.js";
|
|
3
|
+
import { integrationCatalogOperations } from "./descriptors/integrations-catalog.js";
|
|
3
4
|
import { IntegrationsCatalogGroup } from "./generated/integrations-catalog.js";
|
|
4
5
|
// src/effect/integrations-catalog.ts
|
|
5
6
|
var integrations_catalog_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -7,7 +8,7 @@ var integrations_catalog_exports = /* @__PURE__ */ __exportAll({
|
|
|
7
8
|
prepare: () => prepare,
|
|
8
9
|
search: () => search
|
|
9
10
|
});
|
|
10
|
-
const make = /* @__PURE__ */ forGroup(IntegrationsCatalogGroup);
|
|
11
|
+
const make = /* @__PURE__ */ forGroup(IntegrationsCatalogGroup, integrationCatalogOperations);
|
|
11
12
|
const prepare = /* @__PURE__ */ make("integrationCatalogPrepare");
|
|
12
13
|
const search = /* @__PURE__ */ make("integrationCatalogSearch");
|
|
13
14
|
const list = /* @__PURE__ */ make("integrationCatalogList");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const list: ((input?: {
|
|
2
2
|
readonly limit?: number | null | undefined;
|
|
3
3
|
readonly cursor?: string | undefined;
|
|
4
|
-
} | undefined, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"integrationsList">) & {
|
|
4
|
+
} | undefined, options?: import("./internal/operation.js").OperationOptions) => import("./internal/operation.js").OperationResult<"integrationsList">) & {
|
|
5
5
|
readonly pages: (input?: {
|
|
6
6
|
readonly limit?: number | null | undefined;
|
|
7
7
|
readonly cursor?: string | undefined;
|
|
@@ -9,7 +9,7 @@ export declare const list: ((input?: {
|
|
|
9
9
|
readonly items: readonly {
|
|
10
10
|
readonly app: string;
|
|
11
11
|
readonly settings: {
|
|
12
|
-
readonly [x: string]: import("./generated").JsonValue;
|
|
12
|
+
readonly [x: string]: import("./generated/index.js").JsonValue;
|
|
13
13
|
};
|
|
14
14
|
readonly id: string & import("effect/Brand").Brand<"IntegrationId">;
|
|
15
15
|
readonly status: "connected" | "needsReconnect" | "pending";
|
|
@@ -39,14 +39,14 @@ export declare const list: ((input?: {
|
|
|
39
39
|
readonly updatedAt: string;
|
|
40
40
|
}[];
|
|
41
41
|
readonly nextCursor: string | null;
|
|
42
|
-
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").MalformedRequestError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
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>;
|
|
43
43
|
readonly items: (input?: {
|
|
44
44
|
readonly limit?: number | null | undefined;
|
|
45
45
|
readonly cursor?: string | undefined;
|
|
46
46
|
} | undefined) => import("effect/Stream").Stream<{
|
|
47
47
|
readonly app: string;
|
|
48
48
|
readonly settings: {
|
|
49
|
-
readonly [x: string]: import("./generated").JsonValue;
|
|
49
|
+
readonly [x: string]: import("./generated/index.js").JsonValue;
|
|
50
50
|
};
|
|
51
51
|
readonly id: string & import("effect/Brand").Brand<"IntegrationId">;
|
|
52
52
|
readonly status: "connected" | "needsReconnect" | "pending";
|
|
@@ -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").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").MalformedRequestError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
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>;
|
|
78
78
|
};
|
|
79
79
|
export declare const install: (input: {
|
|
80
80
|
readonly app: string;
|
|
@@ -108,21 +108,21 @@ export declare const install: (input: {
|
|
|
108
108
|
readonly [x: string]: string | number | boolean | any | any | null | undefined;
|
|
109
109
|
} | null | undefined;
|
|
110
110
|
} | undefined;
|
|
111
|
-
}, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"integrationsInstall">;
|
|
111
|
+
}, options?: import("./internal/operation.js").OperationOptions) => import("./internal/operation.js").OperationResult<"integrationsInstall">;
|
|
112
112
|
export declare const listTools: (input: {
|
|
113
113
|
readonly integrationId: string;
|
|
114
114
|
readonly offset?: number | null | undefined;
|
|
115
115
|
readonly revision?: string | undefined;
|
|
116
|
-
}, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"integrationsListTools">;
|
|
116
|
+
}, options?: import("./internal/operation.js").OperationOptions) => import("./internal/operation.js").OperationResult<"integrationsListTools">;
|
|
117
117
|
export declare const readTool: (input: {
|
|
118
118
|
readonly integrationId: string;
|
|
119
119
|
readonly tool: string;
|
|
120
120
|
readonly offset?: number | null | undefined;
|
|
121
121
|
readonly revision?: string | undefined;
|
|
122
|
-
}, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"integrationsReadTool">;
|
|
122
|
+
}, options?: import("./internal/operation.js").OperationOptions) => import("./internal/operation.js").OperationResult<"integrationsReadTool">;
|
|
123
123
|
export declare const get: (input: {
|
|
124
124
|
readonly integrationId: string;
|
|
125
|
-
}, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"integrationsGet">;
|
|
125
|
+
}, options?: import("./internal/operation.js").OperationOptions) => import("./internal/operation.js").OperationResult<"integrationsGet">;
|
|
126
126
|
export declare const update: (input: {
|
|
127
127
|
readonly integrationId: string;
|
|
128
128
|
readonly answerWithoutApproval?: boolean | undefined;
|
|
@@ -159,7 +159,7 @@ export declare const update: (input: {
|
|
|
159
159
|
readonly [x: string]: string | number | boolean | any | any | null | undefined;
|
|
160
160
|
} | null | undefined;
|
|
161
161
|
} | undefined;
|
|
162
|
-
}, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"integrationsUpdate">;
|
|
162
|
+
}, options?: import("./internal/operation.js").OperationOptions) => import("./internal/operation.js").OperationResult<"integrationsUpdate">;
|
|
163
163
|
export declare const remove: (input: {
|
|
164
164
|
readonly integrationId: string;
|
|
165
|
-
}, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"integrationsRemove">;
|
|
165
|
+
}, options?: import("./internal/operation.js").OperationOptions) => import("./internal/operation.js").OperationResult<"integrationsRemove">;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { forGroup } from "./internal/operation.js";
|
|
3
|
+
import { integrationsOperations } from "./descriptors/integrations.js";
|
|
3
4
|
import { IntegrationsGroup } from "./generated/integrations.js";
|
|
4
5
|
// src/effect/integrations.ts
|
|
5
6
|
var integrations_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -11,7 +12,7 @@ var integrations_exports = /* @__PURE__ */ __exportAll({
|
|
|
11
12
|
remove: () => remove,
|
|
12
13
|
update: () => update
|
|
13
14
|
});
|
|
14
|
-
const make = /* @__PURE__ */ forGroup(IntegrationsGroup);
|
|
15
|
+
const make = /* @__PURE__ */ forGroup(IntegrationsGroup, integrationsOperations);
|
|
15
16
|
const list = /* @__PURE__ */ make("integrationsList");
|
|
16
17
|
const install = /* @__PURE__ */ make("integrationsInstall");
|
|
17
18
|
const listTools = /* @__PURE__ */ make("integrationsListTools");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Context, Effect, Layer, Redacted } from "effect";
|
|
2
2
|
import { HttpApiClient, type HttpApiEndpoint, type HttpApiGroup } from "effect/http-api";
|
|
3
3
|
import * as HttpClient from "effect/http/HttpClient";
|
|
4
|
-
import { MediaUploadError } from "../../inline-attachments";
|
|
5
|
-
import type { MailboxEventStreamConnection } from "../../mailbox-events";
|
|
6
|
-
import type { SamvaApi } from "../generated/index";
|
|
4
|
+
import { MediaUploadError } from "../../inline-attachments.js";
|
|
5
|
+
import type { MailboxEventStreamConnection } from "../../mailbox-events.js";
|
|
6
|
+
import type { SamvaApi } from "../generated/index.js";
|
|
7
7
|
export interface ConfigBase {
|
|
8
8
|
readonly baseUrl?: string;
|
|
9
9
|
/** Generate the key once for each idempotent logical call. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
-
import { type FlatRaw, Service } from "./client";
|
|
3
|
-
import { type RequestArg } from "./operation";
|
|
4
|
-
import type { ErgonomicEmailList, SendOptions } from "./send";
|
|
2
|
+
import { type FlatRaw, Service } from "./client.js";
|
|
3
|
+
import { type RequestArg } from "./operation.js";
|
|
4
|
+
import type { ErgonomicEmailList, SendOptions } 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;
|
|
@@ -13,5 +13,5 @@ export declare const addEmailSender: (input: EmailAddSenderInput, options?: Send
|
|
|
13
13
|
readonly providerLifecycle: "active" | "deleting" | "failed" | "provisioning";
|
|
14
14
|
readonly providerFailureCode: string | null;
|
|
15
15
|
readonly createdAt: string;
|
|
16
|
-
}, import("
|
|
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>;
|
|
17
17
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Stream } from "effect";
|
|
2
|
-
import { type MailboxEvent, type MailboxEventStreamFailure, type MailboxEventStreamOptions } from "../../mailbox-events";
|
|
3
|
-
import { Service } from "./client";
|
|
2
|
+
import { type MailboxEvent, type MailboxEventStreamFailure, type MailboxEventStreamOptions } from "../../mailbox-events.js";
|
|
3
|
+
import { Service } from "./client.js";
|
|
4
4
|
/**
|
|
5
5
|
* The organization's mailbox events as a stream, resuming from `cursor`. An event counts as handled
|
|
6
6
|
* once the stream is pulled again, or once it ends successfully after the event (as `Stream.take`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Brand, Effect, Redacted, Stream } from "effect";
|
|
2
2
|
import type { HttpApiGroup } from "effect/http-api";
|
|
3
|
-
import { SDK_OPERATION_CALLS } from "../../service-map";
|
|
4
|
-
import { type FlatRaw, type Operation, type OperationSuccess, Service } from "./client";
|
|
3
|
+
import type { SDK_OPERATION_CALLS } from "../../service-map.js";
|
|
4
|
+
import { type FlatRaw, type Operation, type OperationSuccess, Service } from "./client.js";
|
|
5
5
|
export type SdkOperation = keyof typeof SDK_OPERATION_CALLS & Operation;
|
|
6
6
|
type MethodReturn<Method> = Method extends (...args: infer _Args) => infer Return ? Return : never;
|
|
7
7
|
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 ? {
|
|
@@ -19,6 +19,25 @@ type Input<Name extends SdkOperation> = Wire<FlattenRequest<NonNullable<RequestA
|
|
|
19
19
|
export interface OperationOptions {
|
|
20
20
|
readonly idempotencyKey?: string | undefined;
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* What one operation wrapper reads at runtime. `codegen/generate-registry.ts` emits a table of these
|
|
24
|
+
* beside each domain, so a focused entry carries its own operations' descriptors and not the API's.
|
|
25
|
+
*/
|
|
26
|
+
export interface OperationDescriptor {
|
|
27
|
+
readonly group: string;
|
|
28
|
+
readonly method: string;
|
|
29
|
+
readonly idempotent: boolean;
|
|
30
|
+
readonly idempotentWhen?: {
|
|
31
|
+
readonly field: string;
|
|
32
|
+
readonly equals: string;
|
|
33
|
+
} | undefined;
|
|
34
|
+
readonly paginated: boolean;
|
|
35
|
+
readonly call: {
|
|
36
|
+
readonly kind: string;
|
|
37
|
+
readonly paths?: ReadonlyArray<string> | undefined;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export type OperationDescriptors = Readonly<Record<string, OperationDescriptor>>;
|
|
22
41
|
export type OperationResult<Name extends SdkOperation> = Effect.Effect<OperationSuccess<Name>, Effect.Error<MethodReturn<FlatRaw[Name]>>, Service>;
|
|
23
42
|
type OperationFunction<Name extends SdkOperation> = (typeof SDK_OPERATION_CALLS)[Name] extends {
|
|
24
43
|
readonly kind: "none";
|
|
@@ -42,10 +61,10 @@ type PaginationCompanions<Parameters, A, E, R> = {} extends Parameters ? {
|
|
|
42
61
|
type WithPagination<Method> = Method extends (input: infer Parameters) => Effect.Effect<infer A, infer E, infer R> ? IsPaginated<A> extends true ? Method & PaginationCompanions<Parameters, A, E, R> : Method : Method;
|
|
43
62
|
export declare const stripUndefined: <Value>(input: Value) => Value;
|
|
44
63
|
/**
|
|
45
|
-
* Operation factory for one API group. Each domain module binds its own group
|
|
46
|
-
* loads that group's schemas and nothing else.
|
|
64
|
+
* Operation factory for one API group. Each domain module binds its own group and descriptor table,
|
|
65
|
+
* so importing it loads that group's schemas and metadata and nothing else.
|
|
47
66
|
*/
|
|
48
|
-
export declare const forGroup: (group: HttpApiGroup.Constraint) => <Name extends SdkOperation>(operationName: Name) => WithPagination<OperationFunction<Name>>;
|
|
67
|
+
export declare const forGroup: (group: HttpApiGroup.Constraint, descriptors: OperationDescriptors) => <Name extends SdkOperation>(operationName: Name) => WithPagination<OperationFunction<Name>>;
|
|
49
68
|
/** Call one endpoint with an already-shaped request, outside the direct-operation adapter. */
|
|
50
69
|
export declare const callEndpoint: (group: HttpApiGroup.Constraint, name: SdkOperation, request: unknown) => Effect.Effect<unknown, unknown, Service>;
|
|
51
70
|
export {};
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { SamvaOperations } from "../generated-metadata.js";
|
|
2
1
|
import { isRetrySafe } from "../../request-policy.js";
|
|
3
|
-
import { SDK_OPERATION_CALLS } from "../../service-map.js";
|
|
4
2
|
import { streamCursorItems, streamCursorPages } from "../pagination.js";
|
|
5
3
|
import { generateIdempotencyKey, withRetry } from "../retry.js";
|
|
6
4
|
import { Service } from "./client.js";
|
|
7
5
|
import { Effect, Predicate } from "effect";
|
|
8
6
|
// src/effect/internal/operation.ts
|
|
9
|
-
const traceName = (operationName) => {
|
|
10
|
-
const moduleName =
|
|
7
|
+
const traceName = (descriptor, operationName) => {
|
|
8
|
+
const moduleName = descriptor.group.split(" ").map((word) => word[0].toUpperCase() + word.slice(1).toLowerCase()).join("");
|
|
11
9
|
const prefix = moduleName[0].toLowerCase() + moduleName.slice(1);
|
|
12
10
|
if (!operationName.startsWith(prefix)) return `Samva.${operationName}`;
|
|
13
11
|
const method = operationName.slice(prefix.length);
|
|
@@ -19,19 +17,19 @@ const stripUndefined = (input) => {
|
|
|
19
17
|
if (Object.getPrototypeOf(input) !== Object.prototype) return input;
|
|
20
18
|
return Object.fromEntries(Object.entries(input).filter(([, value]) => value !== void 0).map(([key, value]) => [key, stripUndefined(value)]));
|
|
21
19
|
};
|
|
22
|
-
const adapt = (operationName, rawCall, input, idempotencyKey) => {
|
|
23
|
-
const
|
|
20
|
+
const adapt = (descriptor, operationName, rawCall, input, idempotencyKey) => {
|
|
21
|
+
const callDescriptor = descriptor.call;
|
|
24
22
|
const call = (request = {}) => {
|
|
25
23
|
const operation = rawCall({
|
|
26
24
|
...request,
|
|
27
25
|
...idempotencyKey === void 0 ? {} : { headers: { "idempotency-key": idempotencyKey } }
|
|
28
26
|
});
|
|
29
|
-
return isRetrySafe(
|
|
27
|
+
return isRetrySafe(descriptor, input) ? withRetry(operation) : operation;
|
|
30
28
|
};
|
|
31
|
-
if (
|
|
32
|
-
if (
|
|
33
|
-
if (
|
|
34
|
-
const pathDescriptor =
|
|
29
|
+
if (callDescriptor.kind === "none") return call();
|
|
30
|
+
if (callDescriptor.kind === "params") return call({ query: stripUndefined(input ?? {}) });
|
|
31
|
+
if (callDescriptor.kind === "payload") return call({ payload: stripUndefined(input ?? {}) });
|
|
32
|
+
const pathDescriptor = callDescriptor;
|
|
35
33
|
const inputRecord = input ?? {};
|
|
36
34
|
const params = {};
|
|
37
35
|
for (const path of pathDescriptor.paths) {
|
|
@@ -47,24 +45,26 @@ const adapt = (operationName, rawCall, input, idempotencyKey) => {
|
|
|
47
45
|
};
|
|
48
46
|
const isCursorPageEnvelope = (value) => Predicate.isObject(value) && Array.isArray(value.items) && (value.nextCursor === null || typeof value.nextCursor === "string");
|
|
49
47
|
/**
|
|
50
|
-
* Operation factory for one API group. Each domain module binds its own group
|
|
51
|
-
* loads that group's schemas and nothing else.
|
|
48
|
+
* Operation factory for one API group. Each domain module binds its own group and descriptor table,
|
|
49
|
+
* so importing it loads that group's schemas and metadata and nothing else.
|
|
52
50
|
*/
|
|
53
|
-
const forGroup = (group) => (operationName) => {
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
const forGroup = (group, descriptors) => (operationName) => {
|
|
52
|
+
const descriptor = descriptors[operationName];
|
|
53
|
+
if (descriptor === void 0) throw new Error(`${operationName} has no descriptor in this entry`);
|
|
54
|
+
if (descriptor.group !== group.identifier) throw new Error(`${operationName} is not an endpoint of ${group.identifier}`);
|
|
55
|
+
return make(group, operationName, descriptor);
|
|
56
56
|
};
|
|
57
57
|
/** Call one endpoint with an already-shaped request, outside the direct-operation adapter. */
|
|
58
58
|
const callEndpoint = (group, name, request) => Effect.flatMap(Service, (client) => Effect.flatMap(client.endpoint(group, name), (call) => call(request)));
|
|
59
|
-
const make = (group, operationName) => {
|
|
60
|
-
const call = Effect.fn(traceName(operationName))(function* (input, options) {
|
|
59
|
+
const make = (group, operationName, descriptor) => {
|
|
60
|
+
const call = Effect.fn(traceName(descriptor, operationName))(function* (input, options) {
|
|
61
61
|
const client = yield* Service;
|
|
62
62
|
const rawCall = yield* client.endpoint(group, operationName);
|
|
63
|
-
const idempotencyKey =
|
|
64
|
-
return yield* adapt(operationName, rawCall, input, idempotencyKey);
|
|
63
|
+
const idempotencyKey = descriptor.idempotent ? options?.idempotencyKey ?? client.idempotency?.(operationName) ?? (yield* generateIdempotencyKey) : void 0;
|
|
64
|
+
return yield* adapt(descriptor, operationName, rawCall, input, idempotencyKey);
|
|
65
65
|
});
|
|
66
66
|
const operation = call;
|
|
67
|
-
if (
|
|
67
|
+
if (descriptor.paginated) {
|
|
68
68
|
const list = (input) => Effect.filterOrElse(call(input), isCursorPageEnvelope, () => Effect.die(/* @__PURE__ */ new Error(`${operationName} did not return a cursor page envelope`)));
|
|
69
69
|
Object.assign(operation, {
|
|
70
70
|
pages: (input) => streamCursorPages(list, input ?? {}),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
-
import { type MediaUploadError } from "../../inline-attachments";
|
|
3
|
-
import type { SendMessagePayload } from "../generated/shared";
|
|
4
|
-
import { Service } from "./client";
|
|
5
|
-
import { type OperationResult } from "./operation";
|
|
2
|
+
import { type MediaUploadError } from "../../inline-attachments.js";
|
|
3
|
+
import type { SendMessagePayload } from "../generated/shared.js";
|
|
4
|
+
import { Service } from "./client.js";
|
|
5
|
+
import { type OperationResult } from "./operation.js";
|
|
6
6
|
type MessagePayload = typeof SendMessagePayload.Encoded;
|
|
7
7
|
export type MessageRecipient = EmailPayload["to"][number];
|
|
8
8
|
type ContactObjectRecipient = {
|