samva 0.17.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +5 -0
- package/README.md +18 -3
- package/dist/{rolldown-runtime-D7D4PA-g.js → _virtual/_rolldown/runtime.js} +1 -1
- package/dist/client/client/client.gen.js +174 -0
- package/dist/client/client/utils.gen.js +177 -0
- package/dist/client/client.gen.js +8 -0
- package/dist/client/core/auth.gen.js +12 -0
- package/dist/client/core/bodySerializer.gen.js +6 -0
- package/dist/client/core/params.gen.js +77 -0
- package/dist/client/core/pathSerializer.gen.js +82 -0
- package/dist/client/core/serverSentEvents.gen.js +96 -0
- package/dist/client/core/utils.gen.js +78 -0
- package/dist/client/sdk.gen.d.ts +39 -23
- package/dist/{promises---Kbh-7z.js → client/sdk.gen.js} +87 -2314
- package/dist/client/types.gen.d.ts +175 -44
- package/dist/client-attribution.js +9 -0
- package/dist/effect/analytics.d.ts +6 -6
- package/dist/effect/analytics.js +23 -2
- package/dist/effect/api-keys.d.ts +12 -12
- package/dist/effect/api-keys.js +29 -2
- package/dist/effect/attachments.d.ts +4 -4
- package/dist/effect/attachments.js +19 -2
- package/dist/effect/brands.d.ts +6 -6
- package/dist/effect/brands.js +26 -3
- package/dist/effect/campaigns.d.ts +18 -18
- package/dist/effect/campaigns.js +35 -2
- package/dist/effect/categories.d.ts +2 -2
- package/dist/effect/categories.js +95 -1
- package/dist/effect/client.js +3 -3
- package/dist/effect/contact-groups.d.ts +53 -17
- package/dist/effect/contact-groups.js +31 -2
- package/dist/effect/contacts.d.ts +244 -41
- package/dist/effect/contacts.js +54 -2
- package/dist/effect/conversations.d.ts +28 -28
- package/dist/effect/conversations.js +37 -2
- package/dist/effect/custom-fields.d.ts +4 -4
- package/dist/effect/custom-fields.js +19 -2
- package/dist/effect/email.d.ts +75 -75
- package/dist/effect/email.js +140 -2
- package/dist/effect/errors.d.ts +2 -0
- package/dist/effect/errors.js +3 -0
- package/dist/effect/events.d.ts +2 -2
- package/dist/effect/events.js +17 -3
- package/dist/effect/extension-installations.d.ts +23 -23
- package/dist/effect/extension-installations.js +29 -2
- package/dist/effect/extensions.d.ts +12 -12
- package/dist/effect/extensions.js +21 -2
- package/dist/effect/feedback.d.ts +1 -1
- package/dist/effect/feedback.js +14 -3
- package/dist/{analytics-CaqPRsry.js → effect/generated/analytics.js} +4 -23
- package/dist/{api-keys-Ce1Y4_Ip.js → effect/generated/api-keys.js} +4 -29
- package/dist/{attachments-DYqVIraC.js → effect/generated/attachments.js} +3 -18
- package/dist/{brands-ZwuOGIWO.js → effect/generated/brands.js} +5 -25
- package/dist/{campaigns-DZlz1E9E.js → effect/generated/campaigns.js} +4 -35
- package/dist/effect/generated/contact-events.js +37 -0
- package/dist/effect/generated/contact-groups.d.ts +33 -3
- package/dist/{contact-groups-BLbFXnjq.js → effect/generated/contact-groups.js} +3 -30
- package/dist/effect/generated/contacts.d.ts +477 -54
- package/dist/{contacts-BbsoXXB4.js → effect/generated/contacts.js} +41 -89
- package/dist/effect/generated/conversations.d.ts +25 -25
- package/dist/{conversations-_sRHueML.js → effect/generated/conversations.js} +4 -37
- package/dist/{custom-fields-BHWbwlKn.js → effect/generated/custom-fields.js} +5 -19
- package/dist/{email-R0NAA9PW.js → effect/generated/email.js} +995 -1146
- package/dist/{events-CxbTUHYT.js → effect/generated/events.js} +3 -15
- package/dist/effect/generated/extension-installations.d.ts +44 -44
- package/dist/{extension-installations-CD94LPmk.js → effect/generated/extension-installations.js} +10 -29
- package/dist/effect/generated/extensions.d.ts +10 -10
- package/dist/{extensions-BKyNQLvu.js → effect/generated/extensions.js} +5 -20
- package/dist/{feedback-Bpa09JOS.js → effect/generated/feedback.js} +3 -12
- package/dist/{journeys-CARo_BJT.js → effect/generated/journeys.js} +3 -38
- package/dist/effect/generated/mailboxes.d.ts +310 -0
- package/dist/{mailboxes-BRDn7BIK.js → effect/generated/mailboxes.js} +829 -954
- package/dist/{media-VrrtNnft.js → effect/generated/media.js} +3 -3
- package/dist/effect/generated/messages.d.ts +31 -0
- package/dist/effect/generated/messages.js +677 -0
- package/dist/{namespaces-CcvEbG-y.js → effect/generated/namespaces.js} +3 -20
- package/dist/{operations-CmB3FHwf.js → effect/generated/operations.js} +3 -16
- package/dist/effect/generated/organizations.d.ts +13 -11
- package/dist/{organizations-A-plufWc.js → effect/generated/organizations.js} +9 -26
- package/dist/{scheduled-messages-DkKZRRaN.js → effect/generated/scheduled-messages.js} +4 -21
- package/dist/effect/generated/shared.d.ts +70 -20
- package/dist/effect/generated/shared.js +1073 -0
- package/dist/{subscriptions-DEXYtMXg.js → effect/generated/subscriptions.js} +3 -9
- package/dist/{templates-DZomxsG7.js → effect/generated/templates.js} +3 -78
- package/dist/effect/generated/unsubscribe-groups.d.ts +173 -78
- package/dist/{unsubscribe-groups-Iqk4Isf9.js → effect/generated/unsubscribe-groups.js} +77 -84
- package/dist/effect/generated/webhooks.d.ts +19 -19
- package/dist/{webhooks-CPXuu8Xf.js → effect/generated/webhooks.js} +12 -34
- package/dist/{whoami-Ccz0jwlt.js → effect/generated/whoami.js} +5 -10
- package/dist/effect/generated-metadata.d.ts +7 -2
- package/dist/effect/generated-metadata.js +925 -0
- package/dist/effect/index.d.ts +1 -2
- package/dist/effect/index.js +32 -32
- package/dist/effect/internal/client.js +69 -0
- package/dist/effect/internal/email-sender.js +21 -0
- package/dist/effect/internal/mailbox-events.js +33 -0
- package/dist/effect/internal/operation.js +116 -0
- package/dist/effect/internal/send.js +56 -0
- package/dist/effect/journeys.d.ts +18 -18
- package/dist/effect/journeys.js +39 -2
- package/dist/effect/mailboxes.d.ts +314 -182
- package/dist/effect/mailboxes.js +135 -3
- package/dist/effect/media.d.ts +5 -5
- package/dist/effect/media.js +10 -10
- package/dist/effect/messages.d.ts +19 -14
- package/dist/effect/messages.js +15 -14
- package/dist/effect/namespaces.d.ts +7 -7
- package/dist/effect/namespaces.js +21 -2
- package/dist/effect/operations.d.ts +5 -5
- package/dist/effect/operations.js +17 -2
- package/dist/effect/organizations.d.ts +11 -11
- package/dist/effect/organizations.js +25 -2
- package/dist/effect/pagination.js +39 -0
- package/dist/effect/retry.js +3 -3
- package/dist/{runtime-P0l1_2-C.js → effect/runtime.js} +2 -2
- package/dist/effect/scheduled-messages.d.ts +7 -7
- package/dist/effect/scheduled-messages.js +21 -2
- package/dist/effect/subscriptions.d.ts +1 -1
- package/dist/effect/subscriptions.js +10 -2
- package/dist/effect/templates.d.ts +39 -39
- package/dist/effect/templates.js +80 -3
- package/dist/effect/unsubscribe-groups.d.ts +39 -28
- package/dist/effect/unsubscribe-groups.js +29 -2
- package/dist/effect/webhooks.d.ts +22 -22
- package/dist/effect/webhooks.js +35 -3
- package/dist/effect/whoami.d.ts +9 -9
- package/dist/effect/whoami.js +10 -2
- package/dist/index.js +4 -3
- package/dist/{inline-attachments-Bi1hDltp.js → inline-attachments.js} +13 -7
- package/dist/mailbox-events.d.ts +31 -4
- package/dist/{mailbox-events-VKR4f3qq.js → mailbox-events.js} +41 -13
- package/dist/{normalize-B79uJIeb.js → normalize.js} +2 -2
- package/dist/package.js +6 -0
- package/dist/promises/errors.gen.js +1340 -0
- package/dist/promises/index.d.ts +1 -1
- package/dist/promises/index.js +288 -3
- package/dist/promises/types.gen.d.ts +1 -1
- package/dist/service-map.d.ts +9 -4
- package/dist/{operation-n_IYgNVK.js → service-map.js} +12 -150
- package/package.json +6 -2
- package/dist/categories-CA4XIQAb.js +0 -1011
- package/dist/client-DOzUrdTE.js +0 -1115
- package/dist/send-Bxc0XfGE.js +0 -722
package/dist/effect/index.d.ts
CHANGED
|
@@ -45,8 +45,7 @@ export * as Templates from "./templates";
|
|
|
45
45
|
export * as UnsubscribeGroups from "./unsubscribe-groups";
|
|
46
46
|
export * as Webhooks from "./webhooks";
|
|
47
47
|
export * as Whoami from "./whoami";
|
|
48
|
-
export
|
|
48
|
+
export * from "./errors";
|
|
49
49
|
export { type ErrorCategory, categoriesOf, hasCategory, isAuthError, isValidationError, isNotFoundError, isConflictError, isThrottlingError, isBillingError, isTransient, isRetryable, catchCategory, catchAuthError, catchValidationError, catchNotFoundError, catchConflictError, catchThrottlingError, catchBillingError, catchTransient, } from "./categories";
|
|
50
|
-
export { MediaUploadError } from "../inline-attachments";
|
|
51
50
|
export type { CursorPageEnvelope } from "./pagination";
|
|
52
51
|
export type { Json as JsonValue } from "effect/Schema";
|
package/dist/effect/index.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
1
|
+
import { MediaUploadError } from "../inline-attachments.js";
|
|
2
|
+
import { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, DeliveryUnavailableError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, MailboxChannelUnsupportedError, MailboxSendConflictError, MailboxSendRefusedError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SenderNotReadyError, UnauthorizedError, ValidationError } from "./generated/shared.js";
|
|
3
|
+
import { catchAuthError, catchBillingError, catchCategory, catchConflictError, catchNotFoundError, catchThrottlingError, catchTransient, catchValidationError, categoriesOf, hasCategory, isAuthError, isBillingError, isConflictError, isNotFoundError, isRetryable, isThrottlingError, isTransient, isValidationError } from "./categories.js";
|
|
4
|
+
import { retry_exports } from "./retry.js";
|
|
5
|
+
import { analytics_exports } from "./analytics.js";
|
|
6
|
+
import { api_keys_exports } from "./api-keys.js";
|
|
7
|
+
import { attachments_exports } from "./attachments.js";
|
|
8
|
+
import { brands_exports } from "./brands.js";
|
|
9
|
+
import { campaigns_exports } from "./campaigns.js";
|
|
10
|
+
import { client_exports } from "./client.js";
|
|
11
|
+
import { contact_groups_exports } from "./contact-groups.js";
|
|
12
|
+
import { contacts_exports } from "./contacts.js";
|
|
13
|
+
import { conversations_exports } from "./conversations.js";
|
|
14
|
+
import { custom_fields_exports } from "./custom-fields.js";
|
|
15
|
+
import { email_exports } from "./email.js";
|
|
16
|
+
import { extension_installations_exports } from "./extension-installations.js";
|
|
17
|
+
import { extensions_exports } from "./extensions.js";
|
|
18
|
+
import { events_exports } from "./events.js";
|
|
19
|
+
import { feedback_exports } from "./feedback.js";
|
|
20
|
+
import { journeys_exports } from "./journeys.js";
|
|
21
|
+
import { mailboxes_exports } from "./mailboxes.js";
|
|
22
|
+
import { media_exports } from "./media.js";
|
|
23
|
+
import { messages_exports } from "./messages.js";
|
|
24
|
+
import { namespaces_exports } from "./namespaces.js";
|
|
25
|
+
import { operations_exports } from "./operations.js";
|
|
26
|
+
import { organizations_exports } from "./organizations.js";
|
|
27
|
+
import { scheduled_messages_exports } from "./scheduled-messages.js";
|
|
28
|
+
import { subscriptions_exports } from "./subscriptions.js";
|
|
29
|
+
import { templates_exports } from "./templates.js";
|
|
30
|
+
import { unsubscribe_groups_exports } from "./unsubscribe-groups.js";
|
|
31
|
+
import { webhooks_exports } from "./webhooks.js";
|
|
32
|
+
import { whoami_exports } from "./whoami.js";
|
|
33
33
|
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, events_exports as Events, extension_installations_exports as ExtensionInstallations, extensions_exports as Extensions, ExternalServiceError, feedback_exports as Feedback, FlagDisabledError, ForbiddenError, GatewayTimeoutError, InternalError, journeys_exports as Journeys, MailboxChannelUnsupportedError, 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, whoami_exports as Whoami, catchAuthError, catchBillingError, catchCategory, catchConflictError, catchNotFoundError, catchThrottlingError, catchTransient, catchValidationError, categoriesOf, hasCategory, isAuthError, isBillingError, isConflictError, isNotFoundError, isRetryable, isThrottlingError, isTransient, isValidationError };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { CLIENT_ATTRIBUTION_HEADER, clientAttribution } from "../../client-attribution.js";
|
|
2
|
+
import { MediaUploadError, uploadContentType } from "../../inline-attachments.js";
|
|
3
|
+
import { ApiKeySecurityMiddleware } from "../generated/shared.js";
|
|
4
|
+
import { HttpApi, HttpApiClient, HttpApiMiddleware } from "effect/http-api";
|
|
5
|
+
import { Context, Effect, Layer, Redacted } from "effect";
|
|
6
|
+
import * as FetchHttpClient from "effect/http/FetchHttpClient";
|
|
7
|
+
import * as HttpClient from "effect/http/HttpClient";
|
|
8
|
+
import * as HttpClientRequest from "effect/http/HttpClientRequest";
|
|
9
|
+
//#region src/effect/internal/client.ts
|
|
10
|
+
const DEFAULT_BASE_URL = "https://api.samva.dev";
|
|
11
|
+
var Service = class extends Context.Service()("samva/Client") {};
|
|
12
|
+
const authHeaders = (config) => config.authToken !== void 0 ? { Authorization: `Bearer ${config.authToken}` } : { "x-api-key": Redacted.isRedacted(config.apiKey) ? Redacted.value(config.apiKey) : config.apiKey };
|
|
13
|
+
const AuthorizationClient = HttpApiMiddleware.layerClient(ApiKeySecurityMiddleware, ({ next, request }) => next(request));
|
|
14
|
+
const make = (config) => Effect.gen(function* () {
|
|
15
|
+
const baseUrl = config.baseUrl ?? DEFAULT_BASE_URL;
|
|
16
|
+
const removesAttribution = Object.entries(config.headers ?? {}).some(([name, value]) => name.toLowerCase() === "x-samva-client" && value === void 0);
|
|
17
|
+
const storage = yield* HttpClient.HttpClient;
|
|
18
|
+
const httpClient = storage.pipe(HttpClient.mapRequest((request) => {
|
|
19
|
+
let attributed = HttpClientRequest.setHeader(request, CLIENT_ATTRIBUTION_HEADER, clientAttribution("typescript-effect"));
|
|
20
|
+
if (config.headers !== void 0) attributed = HttpClientRequest.setHeaders(attributed, config.headers);
|
|
21
|
+
if (removesAttribution) attributed = HttpClientRequest.removeHeader(attributed, CLIENT_ATTRIBUTION_HEADER);
|
|
22
|
+
return HttpClientRequest.setHeaders(attributed, authHeaders(config));
|
|
23
|
+
}));
|
|
24
|
+
const groups = /* @__PURE__ */ new Map();
|
|
25
|
+
const groupClient = (group) => {
|
|
26
|
+
const built = groups.get(group.identifier);
|
|
27
|
+
if (built !== void 0) return Effect.succeed(built);
|
|
28
|
+
return HttpApiClient.group(HttpApi.make("SamvaApi").add(group), {
|
|
29
|
+
group: group.identifier,
|
|
30
|
+
httpClient,
|
|
31
|
+
baseUrl
|
|
32
|
+
}).pipe(Effect.provide(AuthorizationClient), Effect.map((client) => {
|
|
33
|
+
const calls = client;
|
|
34
|
+
groups.set(group.identifier, calls);
|
|
35
|
+
return calls;
|
|
36
|
+
}));
|
|
37
|
+
};
|
|
38
|
+
const headers = removesAttribution ? {} : { [CLIENT_ATTRIBUTION_HEADER]: clientAttribution("typescript-effect") };
|
|
39
|
+
for (const [name, value] of Object.entries(config.headers ?? {})) if (value !== void 0) headers[name] = value;
|
|
40
|
+
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({
|
|
41
|
+
filename: input.filename,
|
|
42
|
+
mediaId: input.mediaId,
|
|
43
|
+
cause
|
|
44
|
+
})), Effect.flatMap((response) => response.status >= 200 && response.status < 300 ? Effect.void : Effect.fail(new MediaUploadError({
|
|
45
|
+
filename: input.filename,
|
|
46
|
+
mediaId: input.mediaId,
|
|
47
|
+
status: response.status
|
|
48
|
+
}))));
|
|
49
|
+
return Service.of({
|
|
50
|
+
putUpload,
|
|
51
|
+
endpoint: (group, name) => Effect.flatMap(groupClient(group), (client) => {
|
|
52
|
+
const call = client[name];
|
|
53
|
+
return call === void 0 ? Effect.die(/* @__PURE__ */ new Error(`${name} is not an endpoint of ${group.identifier}`)) : Effect.succeed(call);
|
|
54
|
+
}),
|
|
55
|
+
connection: {
|
|
56
|
+
baseUrl,
|
|
57
|
+
headers: {
|
|
58
|
+
...headers,
|
|
59
|
+
...authHeaders(config)
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
const layer = (config) => Layer.effect(Service, make(config));
|
|
65
|
+
const layerFetch = (config) => layer(config).pipe(Layer.provide(FetchHttpClient.layer));
|
|
66
|
+
//#endregion
|
|
67
|
+
export { Service, layer, layerFetch };
|
|
68
|
+
|
|
69
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { replyToEmailsPayload } from "../../normalize.js";
|
|
2
|
+
import { generateIdempotencyKey, withRetry } from "../retry.js";
|
|
3
|
+
import { callEndpoint, stripUndefined } from "./operation.js";
|
|
4
|
+
import { EmailGroup } from "../generated/email.js";
|
|
5
|
+
import { Effect } from "effect";
|
|
6
|
+
//#region src/effect/internal/email-sender.ts
|
|
7
|
+
const addEmailSender = Effect.fn("Email.addSender")(function* (input, options) {
|
|
8
|
+
const idempotencyKey = options?.idempotencyKey ?? (yield* generateIdempotencyKey);
|
|
9
|
+
const { replyToEmails, ...sender } = input;
|
|
10
|
+
return yield* withRetry(callEndpoint(EmailGroup, "emailAddSender", {
|
|
11
|
+
headers: { "idempotency-key": idempotencyKey },
|
|
12
|
+
payload: stripUndefined({
|
|
13
|
+
...sender,
|
|
14
|
+
...replyToEmailsPayload(replyToEmails)
|
|
15
|
+
})
|
|
16
|
+
}));
|
|
17
|
+
});
|
|
18
|
+
//#endregion
|
|
19
|
+
export { addEmailSender };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=email-sender.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { MailboxEventStream, MailboxEventStreamError } from "../../mailbox-events.js";
|
|
2
|
+
import { Service } from "./client.js";
|
|
3
|
+
import { Cause, Effect, Exit, Stream } from "effect";
|
|
4
|
+
//#region src/effect/internal/mailbox-events.ts
|
|
5
|
+
const toStreamError = (cause) => cause instanceof MailboxEventStreamError ? cause : new MailboxEventStreamError({
|
|
6
|
+
_tag: "StreamDisconnectedError",
|
|
7
|
+
message: String(cause)
|
|
8
|
+
});
|
|
9
|
+
/**
|
|
10
|
+
* The organization's mailbox events as a stream, resuming from `cursor`. An event counts as handled
|
|
11
|
+
* once the stream is pulled again, or once it ends successfully after the event (as `Stream.take`
|
|
12
|
+
* does); a failure or interruption leaves the event in hand unacknowledged, so a resume repeats it.
|
|
13
|
+
* The stream fails with a {@link MailboxEventStreamFailure}, which `Effect.catchTag` narrows by the
|
|
14
|
+
* `_tag` of the host's refusal.
|
|
15
|
+
*/
|
|
16
|
+
const events = (options = {}) => Stream.scoped(Stream.unwrap(Effect.gen(function* () {
|
|
17
|
+
const client = yield* Service;
|
|
18
|
+
const iterator = (yield* Effect.acquireRelease(Effect.try({
|
|
19
|
+
try: () => new MailboxEventStream(client.connection, options),
|
|
20
|
+
catch: toStreamError
|
|
21
|
+
}), (opened, exit) => Effect.sync(() => {
|
|
22
|
+
if (Exit.isSuccess(exit)) opened.markHandled();
|
|
23
|
+
opened.close();
|
|
24
|
+
})))[Symbol.asyncIterator]();
|
|
25
|
+
return Stream.fromEffectRepeat(Effect.tryPromise({
|
|
26
|
+
try: () => iterator.next(),
|
|
27
|
+
catch: toStreamError
|
|
28
|
+
}).pipe(Effect.flatMap((next) => next.done ? Cause.done() : Effect.succeed(next.value))));
|
|
29
|
+
})));
|
|
30
|
+
//#endregion
|
|
31
|
+
export { events };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=mailbox-events.js.map
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { SDK_OPERATION_CALLS } from "../../service-map.js";
|
|
2
|
+
import { SamvaOperations } from "../generated-metadata.js";
|
|
3
|
+
import { streamCursorItems, streamCursorPages } from "../pagination.js";
|
|
4
|
+
import { withRetry } from "../retry.js";
|
|
5
|
+
import { Service } from "./client.js";
|
|
6
|
+
import { Effect, Predicate } from "effect";
|
|
7
|
+
//#region src/effect/internal/operation.ts
|
|
8
|
+
const READ_METHODS = /* @__PURE__ */ new Set(["GET", "HEAD"]);
|
|
9
|
+
const MODULE_NAMES = {
|
|
10
|
+
analytics: "Analytics",
|
|
11
|
+
apiKeys: "ApiKeys",
|
|
12
|
+
attachments: "Attachments",
|
|
13
|
+
brands: "Brands",
|
|
14
|
+
campaigns: "Campaigns",
|
|
15
|
+
contactGroups: "ContactGroups",
|
|
16
|
+
contacts: "Contacts",
|
|
17
|
+
conversations: "Conversations",
|
|
18
|
+
customFields: "CustomFields",
|
|
19
|
+
email: "Email",
|
|
20
|
+
extensions: "Extensions",
|
|
21
|
+
feedback: "Feedback",
|
|
22
|
+
mailboxes: "Mailboxes",
|
|
23
|
+
media: "Media",
|
|
24
|
+
messages: "Messages",
|
|
25
|
+
namespaces: "Namespaces",
|
|
26
|
+
operations: "Operations",
|
|
27
|
+
organizations: "Organizations",
|
|
28
|
+
scheduledMessages: "ScheduledMessages",
|
|
29
|
+
templates: "Templates",
|
|
30
|
+
unsubscribe: "UnsubscribeGroups",
|
|
31
|
+
webhooks: "Webhooks",
|
|
32
|
+
whoami: "Whoami"
|
|
33
|
+
};
|
|
34
|
+
const traceName = (operationName) => {
|
|
35
|
+
for (const [prefix, moduleName] of Object.entries(MODULE_NAMES)) {
|
|
36
|
+
if (!operationName.startsWith(prefix)) continue;
|
|
37
|
+
const method = operationName.slice(prefix.length);
|
|
38
|
+
return `${moduleName}.${method[0].toLowerCase()}${method.slice(1)}`;
|
|
39
|
+
}
|
|
40
|
+
return `Samva.${operationName}`;
|
|
41
|
+
};
|
|
42
|
+
const stripUndefined = (input) => {
|
|
43
|
+
if (!Predicate.isObject(input)) return input;
|
|
44
|
+
if (Array.isArray(input)) return input.map(stripUndefined);
|
|
45
|
+
if (Object.getPrototypeOf(input) !== Object.prototype) return input;
|
|
46
|
+
return Object.fromEntries(Object.entries(input).filter(([, value]) => value !== void 0).map(([key, value]) => [key, stripUndefined(value)]));
|
|
47
|
+
};
|
|
48
|
+
const adapt = (operationName, rawCall, input) => {
|
|
49
|
+
const descriptor = SDK_OPERATION_CALLS[operationName];
|
|
50
|
+
const call = READ_METHODS.has(SamvaOperations[operationName].method) ? (request) => withRetry(rawCall(request)) : rawCall;
|
|
51
|
+
if (descriptor.kind === "none") return call();
|
|
52
|
+
if (descriptor.kind === "params") return call({ query: stripUndefined(input) });
|
|
53
|
+
if (descriptor.kind === "payload") return call({ payload: stripUndefined(input) });
|
|
54
|
+
if (descriptor.kind === "idempotentPayload") {
|
|
55
|
+
const { idempotencyKey, ...payload } = input;
|
|
56
|
+
return call({
|
|
57
|
+
headers: { "idempotency-key": idempotencyKey },
|
|
58
|
+
payload: stripUndefined(payload)
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
const pathDescriptor = descriptor;
|
|
62
|
+
const inputRecord = input ?? {};
|
|
63
|
+
const params = {};
|
|
64
|
+
for (const path of pathDescriptor.paths) {
|
|
65
|
+
if (inputRecord[path] === void 0) return Effect.die(/* @__PURE__ */ new Error(`${operationName} requires path field ${path}`));
|
|
66
|
+
params[path] = inputRecord[path];
|
|
67
|
+
}
|
|
68
|
+
if (pathDescriptor.kind === "path") return call({ params });
|
|
69
|
+
if (pathDescriptor.kind === "idempotentPath") return call({
|
|
70
|
+
params,
|
|
71
|
+
headers: { "idempotency-key": inputRecord.idempotencyKey }
|
|
72
|
+
});
|
|
73
|
+
const optionalKeyHeaders = { headers: inputRecord.idempotencyKey === void 0 ? {} : { "idempotency-key": inputRecord.idempotencyKey } };
|
|
74
|
+
if (pathDescriptor.kind === "optionalIdempotentPath") return call({
|
|
75
|
+
params,
|
|
76
|
+
...optionalKeyHeaders
|
|
77
|
+
});
|
|
78
|
+
const headerKey = pathDescriptor.kind === "optionalIdempotentPathPayload";
|
|
79
|
+
const remainingInput = stripUndefined(Object.fromEntries(Object.entries(inputRecord).filter(([key]) => !pathDescriptor.paths.includes(key) && !(headerKey && key === "idempotencyKey"))));
|
|
80
|
+
if (pathDescriptor.kind === "optionalIdempotentPathPayload") return call({
|
|
81
|
+
params,
|
|
82
|
+
payload: remainingInput,
|
|
83
|
+
...optionalKeyHeaders
|
|
84
|
+
});
|
|
85
|
+
return call({
|
|
86
|
+
params,
|
|
87
|
+
[pathDescriptor.kind === "pathParams" ? "query" : "payload"]: remainingInput
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
const isCursorPageEnvelope = (value) => Predicate.isObject(value) && Array.isArray(value.items) && (value.nextCursor === null || typeof value.nextCursor === "string");
|
|
91
|
+
/**
|
|
92
|
+
* Operation factory for one API group. Each domain module binds its own group, so importing it
|
|
93
|
+
* loads that group's schemas and nothing else.
|
|
94
|
+
*/
|
|
95
|
+
const forGroup = (group) => (operationName) => {
|
|
96
|
+
if (SamvaOperations[operationName].group !== group.identifier) throw new Error(`${operationName} is not an endpoint of ${group.identifier}`);
|
|
97
|
+
return make(group, operationName);
|
|
98
|
+
};
|
|
99
|
+
/** Call one endpoint with an already-shaped request, outside the direct-operation adapter. */
|
|
100
|
+
const callEndpoint = (group, name, request) => Effect.flatMap(Service, (client) => Effect.flatMap(client.endpoint(group, name), (call) => call(request)));
|
|
101
|
+
const make = (group, operationName) => {
|
|
102
|
+
const call = Effect.fn(traceName(operationName))((input) => Effect.flatMap(Service, (client) => Effect.flatMap(client.endpoint(group, operationName), (rawCall) => adapt(operationName, rawCall, input))));
|
|
103
|
+
const operation = call;
|
|
104
|
+
if (SamvaOperations[operationName].paginated) {
|
|
105
|
+
const list = (input) => Effect.filterOrElse(call(input), isCursorPageEnvelope, () => Effect.die(/* @__PURE__ */ new Error(`${operationName} did not return a cursor page envelope`)));
|
|
106
|
+
Object.assign(operation, {
|
|
107
|
+
pages: (input) => streamCursorPages(list, input ?? {}),
|
|
108
|
+
items: (input) => streamCursorItems(list, input ?? {})
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
return operation;
|
|
112
|
+
};
|
|
113
|
+
//#endregion
|
|
114
|
+
export { callEndpoint, forGroup, stripUndefined };
|
|
115
|
+
|
|
116
|
+
//# sourceMappingURL=operation.js.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { mediaCreateBody, planInlineUploads, withUploadedAttachments } from "../../inline-attachments.js";
|
|
2
|
+
import { buildEmailSendPayload, buildMessagesSendPayload } from "../../normalize.js";
|
|
3
|
+
import { generateIdempotencyKey, withRetry } from "../retry.js";
|
|
4
|
+
import { Service } from "./client.js";
|
|
5
|
+
import { callEndpoint, stripUndefined } from "./operation.js";
|
|
6
|
+
import { MediaGroup } from "../generated/media.js";
|
|
7
|
+
import { MessagesGroup } from "../generated/messages.js";
|
|
8
|
+
import { Effect } from "effect";
|
|
9
|
+
//#region src/effect/internal/send.ts
|
|
10
|
+
/**
|
|
11
|
+
* Inline attachment content over the API's request cap travels as media instead: the largest
|
|
12
|
+
* attachments are uploaded (create, put to the presigned URL, complete) and replaced by their
|
|
13
|
+
* `mediaId`. The returned payload is the one request every send attempt reuses, so nothing is
|
|
14
|
+
* uploaded twice.
|
|
15
|
+
*/
|
|
16
|
+
const uploadOversizedAttachments = (client, payload) => Effect.gen(function* () {
|
|
17
|
+
const plan = planInlineUploads(payload);
|
|
18
|
+
if (plan.length === 0) return payload;
|
|
19
|
+
const uploaded = /* @__PURE__ */ new Map();
|
|
20
|
+
for (const upload of plan) {
|
|
21
|
+
const created = yield* callEndpoint(MediaGroup, "mediaCreate", { payload: mediaCreateBody(upload) });
|
|
22
|
+
yield* client.putUpload({
|
|
23
|
+
filename: upload.filename,
|
|
24
|
+
mediaId: created.id,
|
|
25
|
+
url: created.upload.url,
|
|
26
|
+
method: created.upload.method,
|
|
27
|
+
headers: created.upload.headers,
|
|
28
|
+
bytes: upload.bytes
|
|
29
|
+
});
|
|
30
|
+
yield* callEndpoint(MediaGroup, "mediaComplete", { params: { id: created.id } });
|
|
31
|
+
uploaded.set(upload.index, {
|
|
32
|
+
mediaId: created.id,
|
|
33
|
+
upload
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return withUploadedAttachments(payload, uploaded);
|
|
37
|
+
});
|
|
38
|
+
const sendPayload = (payload, options) => Effect.gen(function* () {
|
|
39
|
+
const client = yield* Service;
|
|
40
|
+
const idempotencyKey = options?.idempotencyKey ?? (yield* generateIdempotencyKey);
|
|
41
|
+
const prepared = yield* uploadOversizedAttachments(client, payload);
|
|
42
|
+
return yield* withRetry(callEndpoint(MessagesGroup, "messagesSend", {
|
|
43
|
+
payload: stripUndefined(prepared),
|
|
44
|
+
headers: { "idempotency-key": idempotencyKey }
|
|
45
|
+
}));
|
|
46
|
+
});
|
|
47
|
+
const sendMessage = Effect.fn("Messages.send")(function* (input, options) {
|
|
48
|
+
return yield* sendPayload(buildMessagesSendPayload(input), options);
|
|
49
|
+
});
|
|
50
|
+
const sendEmail = Effect.fn("Email.send")(function* (input, options) {
|
|
51
|
+
return yield* sendPayload(buildEmailSendPayload(input), options);
|
|
52
|
+
});
|
|
53
|
+
//#endregion
|
|
54
|
+
export { sendEmail, sendMessage };
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=send.js.map
|
|
@@ -13,7 +13,7 @@ export declare const list: ((input?: {
|
|
|
13
13
|
readonly updatedAt: string;
|
|
14
14
|
}[];
|
|
15
15
|
readonly nextCursor: string | null;
|
|
16
|
-
}, import("./
|
|
16
|
+
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>) & {
|
|
17
17
|
readonly pages: (input?: {
|
|
18
18
|
readonly status?: "active" | "archived" | "draft" | "paused" | null | undefined;
|
|
19
19
|
readonly limit?: string | null | undefined;
|
|
@@ -29,7 +29,7 @@ export declare const list: ((input?: {
|
|
|
29
29
|
readonly updatedAt: string;
|
|
30
30
|
}[];
|
|
31
31
|
readonly nextCursor: string | null;
|
|
32
|
-
}, import("./
|
|
32
|
+
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
33
33
|
readonly items: (input?: {
|
|
34
34
|
readonly status?: "active" | "archived" | "draft" | "paused" | null | undefined;
|
|
35
35
|
readonly limit?: string | null | undefined;
|
|
@@ -42,7 +42,7 @@ export declare const list: ((input?: {
|
|
|
42
42
|
readonly publishedAt: string | null;
|
|
43
43
|
readonly createdAt: string;
|
|
44
44
|
readonly updatedAt: string;
|
|
45
|
-
}, import("./
|
|
45
|
+
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
46
46
|
};
|
|
47
47
|
export declare const create: (input: {
|
|
48
48
|
readonly name: string;
|
|
@@ -398,7 +398,7 @@ export declare const create: (input: {
|
|
|
398
398
|
readonly publishedAt: string | null;
|
|
399
399
|
readonly createdAt: string;
|
|
400
400
|
readonly updatedAt: string;
|
|
401
|
-
}, import("./
|
|
401
|
+
}, import("./errors").BillingProviderError | import("./errors").ConflictError | import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").PaymentRequiredError | import("./errors").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
402
402
|
export declare const get: (input: {
|
|
403
403
|
readonly id: string;
|
|
404
404
|
}) => import("effect/Effect").Effect<{
|
|
@@ -578,7 +578,7 @@ export declare const get: (input: {
|
|
|
578
578
|
readonly publishedAt: string | null;
|
|
579
579
|
readonly createdAt: string;
|
|
580
580
|
readonly updatedAt: string;
|
|
581
|
-
}, import("./
|
|
581
|
+
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
582
582
|
export declare const update: (input: {
|
|
583
583
|
readonly id: string;
|
|
584
584
|
readonly name: string;
|
|
@@ -759,13 +759,13 @@ export declare const update: (input: {
|
|
|
759
759
|
readonly publishedAt: string | null;
|
|
760
760
|
readonly createdAt: string;
|
|
761
761
|
readonly updatedAt: string;
|
|
762
|
-
}, import("./
|
|
762
|
+
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
763
763
|
export declare const remove: (input: {
|
|
764
764
|
readonly id: string;
|
|
765
765
|
}) => import("effect/Effect").Effect<{
|
|
766
766
|
readonly id: string & import("effect/Brand").Brand<"JourneyId">;
|
|
767
767
|
readonly deleted: true;
|
|
768
|
-
}, import("./
|
|
768
|
+
}, import("./errors").ConflictError | import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
769
769
|
export declare const replaceDraft: (input: {
|
|
770
770
|
readonly id: string;
|
|
771
771
|
readonly revision: string;
|
|
@@ -1121,7 +1121,7 @@ export declare const replaceDraft: (input: {
|
|
|
1121
1121
|
readonly publishedAt: string | null;
|
|
1122
1122
|
readonly createdAt: string;
|
|
1123
1123
|
readonly updatedAt: string;
|
|
1124
|
-
}, import("./
|
|
1124
|
+
}, import("./errors").BillingProviderError | import("./errors").ConflictError | import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").PaymentRequiredError | import("./errors").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
1125
1125
|
export declare const publish: (input: {
|
|
1126
1126
|
readonly id: string;
|
|
1127
1127
|
readonly revision: string;
|
|
@@ -1302,7 +1302,7 @@ export declare const publish: (input: {
|
|
|
1302
1302
|
readonly publishedAt: string | null;
|
|
1303
1303
|
readonly createdAt: string;
|
|
1304
1304
|
readonly updatedAt: string;
|
|
1305
|
-
}, import("./
|
|
1305
|
+
}, import("./errors").BillingProviderError | import("./errors").ConflictError | import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").PaymentRequiredError | import("./errors").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
1306
1306
|
export declare const pause: (input: {
|
|
1307
1307
|
readonly id: string;
|
|
1308
1308
|
}) => import("effect/Effect").Effect<{
|
|
@@ -1482,7 +1482,7 @@ export declare const pause: (input: {
|
|
|
1482
1482
|
readonly publishedAt: string | null;
|
|
1483
1483
|
readonly createdAt: string;
|
|
1484
1484
|
readonly updatedAt: string;
|
|
1485
|
-
}, import("./
|
|
1485
|
+
}, import("./errors").ConflictError | import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
1486
1486
|
export declare const resume: (input: {
|
|
1487
1487
|
readonly id: string;
|
|
1488
1488
|
}) => import("effect/Effect").Effect<{
|
|
@@ -1662,7 +1662,7 @@ export declare const resume: (input: {
|
|
|
1662
1662
|
readonly publishedAt: string | null;
|
|
1663
1663
|
readonly createdAt: string;
|
|
1664
1664
|
readonly updatedAt: string;
|
|
1665
|
-
}, import("./
|
|
1665
|
+
}, import("./errors").BillingProviderError | import("./errors").ConflictError | import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").PaymentRequiredError | import("./errors").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
1666
1666
|
export declare const archive: (input: {
|
|
1667
1667
|
readonly id: string;
|
|
1668
1668
|
}) => import("effect/Effect").Effect<{
|
|
@@ -1842,7 +1842,7 @@ export declare const archive: (input: {
|
|
|
1842
1842
|
readonly publishedAt: string | null;
|
|
1843
1843
|
readonly createdAt: string;
|
|
1844
1844
|
readonly updatedAt: string;
|
|
1845
|
-
}, import("./
|
|
1845
|
+
}, import("./errors").ConflictError | import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
1846
1846
|
export declare const getVersion: (input: {
|
|
1847
1847
|
readonly id: string;
|
|
1848
1848
|
readonly version: string;
|
|
@@ -2018,7 +2018,7 @@ export declare const getVersion: (input: {
|
|
|
2018
2018
|
readonly reentry?: boolean;
|
|
2019
2019
|
};
|
|
2020
2020
|
readonly publishedAt: string;
|
|
2021
|
-
}, import("./
|
|
2021
|
+
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
2022
2022
|
export declare const stats: (input: {
|
|
2023
2023
|
readonly id: string;
|
|
2024
2024
|
readonly version?: string | null | undefined;
|
|
@@ -2036,7 +2036,7 @@ export declare const stats: (input: {
|
|
|
2036
2036
|
readonly current: number;
|
|
2037
2037
|
readonly entered: number;
|
|
2038
2038
|
}[];
|
|
2039
|
-
}, import("./
|
|
2039
|
+
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
2040
2040
|
export declare const listRuns: ((input: {
|
|
2041
2041
|
readonly id: string;
|
|
2042
2042
|
readonly status?: "active" | "exited" | "failed" | "paused" | null | undefined;
|
|
@@ -2064,7 +2064,7 @@ export declare const listRuns: ((input: {
|
|
|
2064
2064
|
readonly endedAt: string | null;
|
|
2065
2065
|
}[];
|
|
2066
2066
|
readonly nextCursor: string | null;
|
|
2067
|
-
}, import("./
|
|
2067
|
+
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>) & {
|
|
2068
2068
|
readonly pages: (input: {
|
|
2069
2069
|
readonly id: string;
|
|
2070
2070
|
readonly status?: "active" | "exited" | "failed" | "paused" | null | undefined;
|
|
@@ -2092,7 +2092,7 @@ export declare const listRuns: ((input: {
|
|
|
2092
2092
|
readonly endedAt: string | null;
|
|
2093
2093
|
}[];
|
|
2094
2094
|
readonly nextCursor: string | null;
|
|
2095
|
-
}, import("./
|
|
2095
|
+
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
2096
2096
|
readonly items: (input: {
|
|
2097
2097
|
readonly id: string;
|
|
2098
2098
|
readonly status?: "active" | "exited" | "failed" | "paused" | null | undefined;
|
|
@@ -2117,7 +2117,7 @@ export declare const listRuns: ((input: {
|
|
|
2117
2117
|
};
|
|
2118
2118
|
readonly enteredAt: string;
|
|
2119
2119
|
readonly endedAt: string | null;
|
|
2120
|
-
}, import("./
|
|
2120
|
+
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
2121
2121
|
};
|
|
2122
2122
|
export declare const getRun: (input: {
|
|
2123
2123
|
readonly id: string;
|
|
@@ -2150,4 +2150,4 @@ export declare const getRun: (input: {
|
|
|
2150
2150
|
readonly messageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
|
|
2151
2151
|
readonly error: string | null;
|
|
2152
2152
|
}[];
|
|
2153
|
-
}, import("./
|
|
2153
|
+
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
package/dist/effect/journeys.js
CHANGED
|
@@ -1,2 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { forGroup } from "./internal/operation.js";
|
|
3
|
+
import { JourneysGroup } from "./generated/journeys.js";
|
|
4
|
+
//#region src/effect/journeys.ts
|
|
5
|
+
var journeys_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
+
archive: () => archive,
|
|
7
|
+
create: () => create,
|
|
8
|
+
get: () => get,
|
|
9
|
+
getRun: () => getRun,
|
|
10
|
+
getVersion: () => getVersion,
|
|
11
|
+
list: () => list,
|
|
12
|
+
listRuns: () => listRuns,
|
|
13
|
+
pause: () => pause,
|
|
14
|
+
publish: () => publish,
|
|
15
|
+
remove: () => remove,
|
|
16
|
+
replaceDraft: () => replaceDraft,
|
|
17
|
+
resume: () => resume,
|
|
18
|
+
stats: () => stats,
|
|
19
|
+
update: () => update
|
|
20
|
+
});
|
|
21
|
+
const make = /* @__PURE__ */ forGroup(JourneysGroup);
|
|
22
|
+
const list = /* @__PURE__ */ make("journeysList");
|
|
23
|
+
const create = /* @__PURE__ */ make("journeysCreate");
|
|
24
|
+
const get = /* @__PURE__ */ make("journeysGet");
|
|
25
|
+
const update = /* @__PURE__ */ make("journeysUpdate");
|
|
26
|
+
const remove = /* @__PURE__ */ make("journeysRemove");
|
|
27
|
+
const replaceDraft = /* @__PURE__ */ make("journeysReplaceDraft");
|
|
28
|
+
const publish = /* @__PURE__ */ make("journeysPublish");
|
|
29
|
+
const pause = /* @__PURE__ */ make("journeysPause");
|
|
30
|
+
const resume = /* @__PURE__ */ make("journeysResume");
|
|
31
|
+
const archive = /* @__PURE__ */ make("journeysArchive");
|
|
32
|
+
const getVersion = /* @__PURE__ */ make("journeysGetVersion");
|
|
33
|
+
const stats = /* @__PURE__ */ make("journeysStats");
|
|
34
|
+
const listRuns = /* @__PURE__ */ make("journeysListRuns");
|
|
35
|
+
const getRun = /* @__PURE__ */ make("journeysGetRun");
|
|
36
|
+
//#endregion
|
|
37
|
+
export { archive, create, get, getRun, getVersion, journeys_exports, list, listRuns, pause, publish, remove, replaceDraft, resume, stats, update };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=journeys.js.map
|