samva 0.50.0 → 0.52.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 +49 -5
- package/README.md +137 -7
- package/dist/client/sdk.gen.d.ts +78 -38
- package/dist/client/sdk.gen.js +1554 -967
- package/dist/client/types.gen.d.ts +541 -291
- package/dist/effect/agents.d.ts +4 -4
- package/dist/effect/api-keys.d.ts +4 -6
- package/dist/effect/campaigns.d.ts +222 -230
- package/dist/effect/categories.d.ts +2 -2
- package/dist/effect/categories.js +6 -4
- package/dist/effect/contact-groups.d.ts +4 -4
- package/dist/effect/contacts.d.ts +8 -8
- package/dist/effect/conversations.d.ts +4 -4
- package/dist/effect/descriptors/integrations-catalog.d.ts +1 -1
- package/dist/effect/descriptors/integrations-catalog.js +1 -1
- package/dist/effect/descriptors/integrations.d.ts +1 -1
- package/dist/effect/descriptors/integrations.js +1 -1
- package/dist/effect/descriptors/logs.d.ts +21 -0
- package/dist/effect/descriptors/logs.js +23 -0
- package/dist/effect/descriptors/whats-app.d.ts +1 -1
- package/dist/effect/descriptors/whats-app.js +1 -1
- package/dist/effect/email.d.ts +17 -16
- package/dist/effect/errors.d.ts +1 -0
- package/dist/effect/errors.js +2 -1
- package/dist/effect/generated/agents.js +4 -4
- package/dist/effect/generated/api-keys.d.ts +0 -15
- package/dist/effect/generated/api-keys.js +1 -2
- package/dist/effect/generated/campaigns.d.ts +18 -68
- package/dist/effect/generated/campaigns.js +5 -15
- package/dist/effect/generated/email.d.ts +10 -3
- package/dist/effect/generated/email.js +6 -5
- package/dist/effect/generated/index.d.ts +3 -1
- package/dist/effect/generated/integrations-catalog.d.ts +93 -49
- package/dist/effect/generated/integrations-catalog.js +17 -28
- package/dist/effect/generated/integrations.d.ts +20 -40
- package/dist/effect/generated/integrations.js +9 -13
- package/dist/effect/generated/journeys.d.ts +61 -13
- package/dist/effect/generated/journeys.js +5 -5
- package/dist/effect/generated/logs.d.ts +2311 -0
- package/dist/effect/generated/logs.js +312 -0
- package/dist/effect/generated/mailboxes.d.ts +30 -24
- package/dist/effect/generated/mailboxes.js +25 -25
- package/dist/effect/generated/messages.d.ts +1 -882
- package/dist/effect/generated/messages.js +4 -243
- package/dist/effect/generated/namespaces.js +1 -1
- package/dist/effect/generated/newsletter-domains.d.ts +61 -13
- package/dist/effect/generated/newsletter-domains.js +5 -5
- package/dist/effect/generated/newsletter-issues.d.ts +166 -34
- package/dist/effect/generated/newsletter-issues.js +12 -12
- package/dist/effect/generated/newsletters.d.ts +76 -16
- package/dist/effect/generated/newsletters.js +6 -6
- package/dist/effect/generated/organizations.js +1 -1
- package/dist/effect/generated/policies.js +2 -2
- package/dist/effect/generated/scheduled-messages.d.ts +0 -26
- package/dist/effect/generated/scheduled-messages.js +2 -4
- package/dist/effect/generated/shared.d.ts +1139 -257
- package/dist/effect/generated/shared.js +323 -83
- package/dist/effect/generated/subscriptions.d.ts +4 -4
- package/dist/effect/generated/subscriptions.js +2 -6
- package/dist/effect/generated/template-registrations.d.ts +46 -10
- package/dist/effect/generated/template-registrations.js +4 -4
- package/dist/effect/generated/templates.js +2 -2
- package/dist/effect/generated/whats-app-flows.d.ts +151 -31
- package/dist/effect/generated/whats-app-flows.js +11 -11
- package/dist/effect/generated/whats-app-setup-links.d.ts +61 -13
- package/dist/effect/generated/whats-app-setup-links.js +5 -5
- package/dist/effect/generated/whats-app.d.ts +187 -65
- package/dist/effect/generated/whats-app.js +18 -24
- package/dist/effect/generated-metadata.d.ts +15 -3
- package/dist/effect/generated-metadata.js +375 -349
- package/dist/effect/index.d.ts +1 -0
- package/dist/effect/index.js +3 -1
- package/dist/effect/integrations-catalog.d.ts +92 -4
- package/dist/effect/integrations.d.ts +42 -10
- package/dist/effect/internal/client.d.ts +19 -2
- package/dist/effect/internal/client.js +35 -5
- package/dist/effect/internal/email-sender.d.ts +4 -4
- package/dist/effect/internal/email-sender.js +5 -3
- package/dist/effect/internal/log-events.d.ts +19 -0
- package/dist/effect/internal/log-events.js +53 -0
- package/dist/effect/internal/mailbox-events.d.ts +6 -2
- package/dist/effect/internal/mailbox-events.js +4 -3
- package/dist/effect/internal/operation.d.ts +11 -0
- package/dist/effect/internal/operation.js +10 -6
- package/dist/effect/internal/send.d.ts +4 -0
- package/dist/effect/internal/send.js +11 -8
- package/dist/effect/internal/timeout.d.ts +16 -0
- package/dist/effect/internal/timeout.js +20 -0
- package/dist/effect/journeys.d.ts +4 -4
- package/dist/effect/logs.d.ts +149 -0
- package/dist/effect/logs.js +18 -0
- package/dist/effect/mailboxes.d.ts +184 -178
- package/dist/effect/mailboxes.js +1 -1
- package/dist/effect/messages.d.ts +5 -5
- package/dist/effect/namespaces.d.ts +4 -4
- package/dist/effect/newsletter-domains.d.ts +2 -2
- package/dist/effect/operations.d.ts +2 -2
- package/dist/effect/scheduled-messages.d.ts +2 -6
- package/dist/effect/templates.d.ts +6 -6
- package/dist/effect/topics.d.ts +4 -4
- package/dist/effect/webhooks.d.ts +4 -4
- package/dist/effect/whatsapp-setup-links.d.ts +2 -2
- package/dist/effect/whatsapp.d.ts +73 -3
- package/dist/index.js +2 -2
- package/dist/mailbox-events.d.ts +50 -3
- package/dist/mailbox-events.js +38 -19
- package/dist/package.js +1 -1
- package/dist/promises/client.d.ts +8 -1
- package/dist/promises/client.js +15 -9
- package/dist/promises/errors.gen.d.ts +14 -1
- package/dist/promises/errors.gen.js +158 -36
- package/dist/promises/index.js +2 -2
- package/dist/promises/request.d.ts +31 -2
- package/dist/promises/request.js +42 -7
- package/dist/promises/types.gen.d.ts +1 -1
- package/dist/request-id.d.ts +3 -0
- package/dist/request-id.js +7 -0
- package/dist/request-policy.d.ts +9 -0
- package/dist/request-policy.js +16 -1
- package/dist/service-map.d.ts +14 -3
- package/package.json +6 -2
|
@@ -19,6 +19,10 @@ type ErgonomicEmailContent = Omit<EmailPayload["email"], "replyTo"> & {
|
|
|
19
19
|
};
|
|
20
20
|
export interface SendOptions {
|
|
21
21
|
readonly idempotencyKey?: string;
|
|
22
|
+
/** Per-attempt bound on the send and its media requests; `null` disables it. */
|
|
23
|
+
readonly timeoutMs?: number | null | undefined;
|
|
24
|
+
/** Per-put bound on oversized attachment bytes; `null` disables it. */
|
|
25
|
+
readonly uploadTimeoutMs?: number | null | undefined;
|
|
22
26
|
}
|
|
23
27
|
export type MessageSendInput = Omit<EmailPayload, "to" | "cc" | "bcc" | "email"> & {
|
|
24
28
|
readonly to: ErgonomicMessageRecipient | ReadonlyArray<ErgonomicMessageRecipient>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { mediaCreateBody, planInlineUploads, withUploadedAttachments } from "../../inline-attachments.js";
|
|
2
2
|
import { buildEmailSendPayload, buildMessagesSendPayload } from "../../normalize.js";
|
|
3
3
|
import { generateIdempotencyKey, withRetry } from "../retry.js";
|
|
4
|
+
import { withTimeout } from "./timeout.js";
|
|
4
5
|
import { Service } from "./client.js";
|
|
5
|
-
import { callEndpoint, stripUndefined } from "./operation.js";
|
|
6
|
+
import { attemptTimeout, callEndpoint, stripUndefined } from "./operation.js";
|
|
6
7
|
import { MediaGroup } from "../generated/media.js";
|
|
7
8
|
import { MessagesGroup } from "../generated/messages.js";
|
|
8
9
|
import { Effect } from "effect";
|
|
@@ -13,21 +14,22 @@ import { Effect } from "effect";
|
|
|
13
14
|
* `mediaId`. The returned payload is the one request every send attempt reuses, so nothing is
|
|
14
15
|
* uploaded twice.
|
|
15
16
|
*/
|
|
16
|
-
const uploadOversizedAttachments = (client, payload) => Effect.gen(function* () {
|
|
17
|
+
const uploadOversizedAttachments = (client, payload, timeoutMs, uploadTimeoutMs) => Effect.gen(function* () {
|
|
17
18
|
const plan = planInlineUploads(payload);
|
|
18
19
|
if (plan.length === 0) return payload;
|
|
19
20
|
const uploaded = /* @__PURE__ */ new Map();
|
|
20
21
|
for (const upload of plan) {
|
|
21
|
-
const created = yield* callEndpoint(MediaGroup, "mediaCreate", { payload: mediaCreateBody(upload) });
|
|
22
|
+
const created = yield* withTimeout(callEndpoint(MediaGroup, "mediaCreate", { payload: mediaCreateBody(upload) }), timeoutMs);
|
|
22
23
|
yield* client.putUpload({
|
|
23
24
|
filename: upload.filename,
|
|
24
25
|
mediaId: created.id,
|
|
25
26
|
url: created.upload.url,
|
|
26
27
|
method: created.upload.method,
|
|
27
28
|
headers: created.upload.headers,
|
|
28
|
-
bytes: upload.bytes
|
|
29
|
+
bytes: upload.bytes,
|
|
30
|
+
timeoutMs: uploadTimeoutMs
|
|
29
31
|
});
|
|
30
|
-
yield* callEndpoint(MediaGroup, "mediaComplete", { params: { id: created.id } });
|
|
32
|
+
yield* withTimeout(callEndpoint(MediaGroup, "mediaComplete", { params: { id: created.id } }), timeoutMs);
|
|
31
33
|
uploaded.set(upload.index, {
|
|
32
34
|
mediaId: created.id,
|
|
33
35
|
upload
|
|
@@ -37,12 +39,13 @@ const uploadOversizedAttachments = (client, payload) => Effect.gen(function* ()
|
|
|
37
39
|
});
|
|
38
40
|
const sendPayload = (payload, options) => Effect.gen(function* () {
|
|
39
41
|
const client = yield* Service;
|
|
42
|
+
const timeoutMs = attemptTimeout(options, client);
|
|
40
43
|
const idempotencyKey = options?.idempotencyKey ?? client.idempotency?.("messagesSend") ?? (yield* generateIdempotencyKey);
|
|
41
|
-
const prepared = yield* uploadOversizedAttachments(client, payload);
|
|
42
|
-
return yield* withRetry(callEndpoint(MessagesGroup, "messagesSend", {
|
|
44
|
+
const prepared = yield* uploadOversizedAttachments(client, payload, timeoutMs, options?.uploadTimeoutMs);
|
|
45
|
+
return yield* withRetry(withTimeout(callEndpoint(MessagesGroup, "messagesSend", {
|
|
43
46
|
payload: stripUndefined(prepared),
|
|
44
47
|
headers: { "idempotency-key": idempotencyKey }
|
|
45
|
-
}));
|
|
48
|
+
}), timeoutMs));
|
|
46
49
|
});
|
|
47
50
|
const sendMessage = Effect.fn("Messages.send")(function* (input, options) {
|
|
48
51
|
return yield* sendPayload(buildMessagesSendPayload(input), options);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Effect, Schema } from "effect";
|
|
2
|
+
declare const SamvaTimeoutError_base: Schema.Class<SamvaTimeoutError, Schema.Struct<{
|
|
3
|
+
readonly _tag: Schema.tag<"SamvaTimeoutError">;
|
|
4
|
+
readonly timeoutMs: Schema.Finite;
|
|
5
|
+
}>, import("effect/Cause").YieldableError>;
|
|
6
|
+
/**
|
|
7
|
+
* A request attempt that did not finish within its `timeoutMs`. The request may still have reached
|
|
8
|
+
* the API, so the default retry policy retries it on retry-safe operations with the same
|
|
9
|
+
* idempotency key, exactly like a transport failure.
|
|
10
|
+
*/
|
|
11
|
+
export declare class SamvaTimeoutError extends SamvaTimeoutError_base {
|
|
12
|
+
get message(): string;
|
|
13
|
+
}
|
|
14
|
+
/** Bound one attempt; `null` leaves it unbounded. The losing request is interrupted. */
|
|
15
|
+
export declare const withTimeout: <A, E, R>(effect: Effect.Effect<A, E, R>, timeoutMs: number | null) => Effect.Effect<A, E | SamvaTimeoutError, R>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Duration, Effect, Schema } from "effect";
|
|
2
|
+
// src/effect/internal/timeout.ts
|
|
3
|
+
/**
|
|
4
|
+
* A request attempt that did not finish within its `timeoutMs`. The request may still have reached
|
|
5
|
+
* the API, so the default retry policy retries it on retry-safe operations with the same
|
|
6
|
+
* idempotency key, exactly like a transport failure.
|
|
7
|
+
*/
|
|
8
|
+
var SamvaTimeoutError = class extends Schema.TaggedError()("SamvaTimeoutError", Schema.Struct({ timeoutMs: Schema.Finite })) {
|
|
9
|
+
get message() {
|
|
10
|
+
return `Samva request did not finish within ${this.timeoutMs} ms`;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
/** Bound one attempt; `null` leaves it unbounded. The losing request is interrupted. */
|
|
14
|
+
const withTimeout = (effect, timeoutMs) => timeoutMs === null ? effect : Effect.timeoutOrElse(effect, {
|
|
15
|
+
duration: Duration.millis(timeoutMs),
|
|
16
|
+
orElse: () => Effect.fail(new SamvaTimeoutError({ timeoutMs }))
|
|
17
|
+
});
|
|
18
|
+
export { SamvaTimeoutError, withTimeout };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=timeout.js.map
|
|
@@ -18,7 +18,7 @@ export declare const list: ((input?: {
|
|
|
18
18
|
readonly updatedAt: string;
|
|
19
19
|
}[];
|
|
20
20
|
readonly nextCursor: string | null;
|
|
21
|
-
}, 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>;
|
|
21
|
+
}, import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("./errors.js").SamvaTimeoutError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
|
|
22
22
|
readonly items: (input?: {
|
|
23
23
|
readonly status?: "active" | "archived" | "draft" | "paused" | undefined;
|
|
24
24
|
readonly limit?: number | null | undefined;
|
|
@@ -31,7 +31,7 @@ export declare const list: ((input?: {
|
|
|
31
31
|
readonly publishedAt: string | null;
|
|
32
32
|
readonly createdAt: string;
|
|
33
33
|
readonly updatedAt: string;
|
|
34
|
-
}, 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>;
|
|
34
|
+
}, import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("./errors.js").SamvaTimeoutError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
|
|
35
35
|
};
|
|
36
36
|
export declare const create: (input: {
|
|
37
37
|
readonly name: string;
|
|
@@ -567,7 +567,7 @@ export declare const listRuns: ((input: {
|
|
|
567
567
|
readonly endedAt: string | null;
|
|
568
568
|
}[];
|
|
569
569
|
readonly nextCursor: string | null;
|
|
570
|
-
}, import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("./errors.js").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
|
|
570
|
+
}, import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("./errors.js").ResourceNotFoundError | import("./errors.js").SamvaTimeoutError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
|
|
571
571
|
readonly items: (input: {
|
|
572
572
|
readonly id: string;
|
|
573
573
|
readonly status?: "active" | "exited" | "failed" | "paused" | undefined;
|
|
@@ -594,7 +594,7 @@ export declare const listRuns: ((input: {
|
|
|
594
594
|
};
|
|
595
595
|
readonly enteredAt: string;
|
|
596
596
|
readonly endedAt: string | null;
|
|
597
|
-
}, import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("./errors.js").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
|
|
597
|
+
}, import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("./errors.js").ResourceNotFoundError | import("./errors.js").SamvaTimeoutError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
|
|
598
598
|
};
|
|
599
599
|
export declare const getRun: (input: {
|
|
600
600
|
readonly id: string;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
export { events, streamCursor, type LogEvent, type LogEventStreamOptions, } from "./internal/log-events.js";
|
|
2
|
+
export declare const list: ((input?: {
|
|
3
|
+
readonly limit?: number | null | undefined;
|
|
4
|
+
readonly cursor?: string | undefined;
|
|
5
|
+
readonly after?: string | undefined;
|
|
6
|
+
readonly orderBy?: "recorded" | "timestamp" | undefined;
|
|
7
|
+
readonly order?: "asc" | "desc" | undefined;
|
|
8
|
+
readonly since?: Date | undefined;
|
|
9
|
+
readonly until?: Date | undefined;
|
|
10
|
+
readonly status?: string | undefined;
|
|
11
|
+
readonly event?: string | undefined;
|
|
12
|
+
readonly channel?: "email" | "sms" | "whatsapp" | undefined;
|
|
13
|
+
readonly direction?: "inbound" | "outbound" | undefined;
|
|
14
|
+
readonly origin?: "businessApp" | "campaign" | "direct" | "forwarding" | "journey" | "mailbox" | "scheduled" | undefined;
|
|
15
|
+
readonly credential?: string | undefined;
|
|
16
|
+
readonly from?: string | undefined;
|
|
17
|
+
readonly messageId?: string | undefined;
|
|
18
|
+
readonly mailboxId?: string | undefined;
|
|
19
|
+
readonly requestId?: string | undefined;
|
|
20
|
+
} | undefined, options?: import("./internal/operation.js").OperationOptions) => import("./internal/client.js").OperationResult<"logsList">) & {
|
|
21
|
+
readonly pages: (input?: {
|
|
22
|
+
readonly limit?: number | null | undefined;
|
|
23
|
+
readonly cursor?: string | undefined;
|
|
24
|
+
readonly after?: string | undefined;
|
|
25
|
+
readonly orderBy?: "recorded" | "timestamp" | undefined;
|
|
26
|
+
readonly order?: "asc" | "desc" | undefined;
|
|
27
|
+
readonly since?: Date | undefined;
|
|
28
|
+
readonly until?: Date | undefined;
|
|
29
|
+
readonly status?: string | undefined;
|
|
30
|
+
readonly event?: string | undefined;
|
|
31
|
+
readonly channel?: "email" | "sms" | "whatsapp" | undefined;
|
|
32
|
+
readonly direction?: "inbound" | "outbound" | undefined;
|
|
33
|
+
readonly origin?: "businessApp" | "campaign" | "direct" | "forwarding" | "journey" | "mailbox" | "scheduled" | undefined;
|
|
34
|
+
readonly credential?: string | undefined;
|
|
35
|
+
readonly from?: string | undefined;
|
|
36
|
+
readonly messageId?: string | undefined;
|
|
37
|
+
readonly mailboxId?: string | undefined;
|
|
38
|
+
readonly requestId?: string | undefined;
|
|
39
|
+
} | undefined) => import("effect/Stream").Stream<{
|
|
40
|
+
readonly items: readonly {
|
|
41
|
+
readonly id: string;
|
|
42
|
+
readonly cursor: string;
|
|
43
|
+
readonly timestamp: string;
|
|
44
|
+
readonly event: "accepted" | "agent_escalation" | "agent_handoff" | "agent_processing_completed" | "agent_processing_started" | "archived" | "bounced" | "clicked" | "complained" | "cost_calculated" | "created" | "deleted" | "delivered" | "failed" | "forwarded" | "marked_spam" | "opened" | "processing" | "queued" | "read" | "received" | "rejected" | "replied" | "retry_attempted" | "retry_scheduled" | "sent" | "unsubscribed" | "waiting" | "whatsapp_deleted" | "whatsapp_read";
|
|
45
|
+
readonly messageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
|
|
46
|
+
readonly channel: "email" | "sms" | "whatsapp" | null;
|
|
47
|
+
readonly direction: "inbound" | "outbound";
|
|
48
|
+
readonly origin: "businessApp" | "campaign" | "direct" | "forwarding" | "journey" | "mailbox" | "scheduled" | null;
|
|
49
|
+
readonly from: {
|
|
50
|
+
readonly address: string;
|
|
51
|
+
readonly name: string | null;
|
|
52
|
+
} | null;
|
|
53
|
+
readonly recipient: string | null;
|
|
54
|
+
readonly subject: string | null;
|
|
55
|
+
readonly submission: {
|
|
56
|
+
readonly origin: "businessApp" | "campaign" | "direct" | "forwarding" | "journey" | "mailbox" | "scheduled";
|
|
57
|
+
readonly transport: "http" | "smtp" | null;
|
|
58
|
+
readonly credential: {
|
|
59
|
+
readonly kind: "api_key";
|
|
60
|
+
readonly apiKeyId: (string & import("effect/Brand").Brand<"ApiKeyId">) | null;
|
|
61
|
+
readonly name: string | null;
|
|
62
|
+
} | {
|
|
63
|
+
readonly kind: "oauth";
|
|
64
|
+
readonly clientId: string | null;
|
|
65
|
+
readonly name: string | null;
|
|
66
|
+
} | {
|
|
67
|
+
readonly kind: "session";
|
|
68
|
+
} | null;
|
|
69
|
+
readonly user?: {
|
|
70
|
+
readonly id: string & import("effect/Brand").Brand<"UserId">;
|
|
71
|
+
readonly email: string;
|
|
72
|
+
readonly name: string;
|
|
73
|
+
} | null;
|
|
74
|
+
readonly client: {
|
|
75
|
+
readonly surface: "cli" | "mcp" | "typescript-effect" | "typescript-promise";
|
|
76
|
+
readonly version: string;
|
|
77
|
+
} | null;
|
|
78
|
+
} | null;
|
|
79
|
+
readonly requestId: string | null;
|
|
80
|
+
readonly reason: string | null;
|
|
81
|
+
readonly errorTag: string | null;
|
|
82
|
+
}[];
|
|
83
|
+
readonly nextCursor: string | null;
|
|
84
|
+
}, import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("./errors.js").SamvaTimeoutError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
|
|
85
|
+
readonly items: (input?: {
|
|
86
|
+
readonly limit?: number | null | undefined;
|
|
87
|
+
readonly cursor?: string | undefined;
|
|
88
|
+
readonly after?: string | undefined;
|
|
89
|
+
readonly orderBy?: "recorded" | "timestamp" | undefined;
|
|
90
|
+
readonly order?: "asc" | "desc" | undefined;
|
|
91
|
+
readonly since?: Date | undefined;
|
|
92
|
+
readonly until?: Date | undefined;
|
|
93
|
+
readonly status?: string | undefined;
|
|
94
|
+
readonly event?: string | undefined;
|
|
95
|
+
readonly channel?: "email" | "sms" | "whatsapp" | undefined;
|
|
96
|
+
readonly direction?: "inbound" | "outbound" | undefined;
|
|
97
|
+
readonly origin?: "businessApp" | "campaign" | "direct" | "forwarding" | "journey" | "mailbox" | "scheduled" | undefined;
|
|
98
|
+
readonly credential?: string | undefined;
|
|
99
|
+
readonly from?: string | undefined;
|
|
100
|
+
readonly messageId?: string | undefined;
|
|
101
|
+
readonly mailboxId?: string | undefined;
|
|
102
|
+
readonly requestId?: string | undefined;
|
|
103
|
+
} | undefined) => import("effect/Stream").Stream<{
|
|
104
|
+
readonly id: string;
|
|
105
|
+
readonly cursor: string;
|
|
106
|
+
readonly timestamp: string;
|
|
107
|
+
readonly event: "accepted" | "agent_escalation" | "agent_handoff" | "agent_processing_completed" | "agent_processing_started" | "archived" | "bounced" | "clicked" | "complained" | "cost_calculated" | "created" | "deleted" | "delivered" | "failed" | "forwarded" | "marked_spam" | "opened" | "processing" | "queued" | "read" | "received" | "rejected" | "replied" | "retry_attempted" | "retry_scheduled" | "sent" | "unsubscribed" | "waiting" | "whatsapp_deleted" | "whatsapp_read";
|
|
108
|
+
readonly messageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
|
|
109
|
+
readonly channel: "email" | "sms" | "whatsapp" | null;
|
|
110
|
+
readonly direction: "inbound" | "outbound";
|
|
111
|
+
readonly origin: "businessApp" | "campaign" | "direct" | "forwarding" | "journey" | "mailbox" | "scheduled" | null;
|
|
112
|
+
readonly from: {
|
|
113
|
+
readonly address: string;
|
|
114
|
+
readonly name: string | null;
|
|
115
|
+
} | null;
|
|
116
|
+
readonly recipient: string | null;
|
|
117
|
+
readonly subject: string | null;
|
|
118
|
+
readonly submission: {
|
|
119
|
+
readonly origin: "businessApp" | "campaign" | "direct" | "forwarding" | "journey" | "mailbox" | "scheduled";
|
|
120
|
+
readonly transport: "http" | "smtp" | null;
|
|
121
|
+
readonly credential: {
|
|
122
|
+
readonly kind: "api_key";
|
|
123
|
+
readonly apiKeyId: (string & import("effect/Brand").Brand<"ApiKeyId">) | null;
|
|
124
|
+
readonly name: string | null;
|
|
125
|
+
} | {
|
|
126
|
+
readonly kind: "oauth";
|
|
127
|
+
readonly clientId: string | null;
|
|
128
|
+
readonly name: string | null;
|
|
129
|
+
} | {
|
|
130
|
+
readonly kind: "session";
|
|
131
|
+
} | null;
|
|
132
|
+
readonly user?: {
|
|
133
|
+
readonly id: string & import("effect/Brand").Brand<"UserId">;
|
|
134
|
+
readonly email: string;
|
|
135
|
+
readonly name: string;
|
|
136
|
+
} | null;
|
|
137
|
+
readonly client: {
|
|
138
|
+
readonly surface: "cli" | "mcp" | "typescript-effect" | "typescript-promise";
|
|
139
|
+
readonly version: string;
|
|
140
|
+
} | null;
|
|
141
|
+
} | null;
|
|
142
|
+
readonly requestId: string | null;
|
|
143
|
+
readonly reason: string | null;
|
|
144
|
+
readonly errorTag: string | null;
|
|
145
|
+
}, import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("./errors.js").SamvaTimeoutError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
|
|
146
|
+
};
|
|
147
|
+
export declare const get: (input: {
|
|
148
|
+
readonly id: string;
|
|
149
|
+
}, options?: import("./internal/operation.js").OperationOptions) => import("./internal/client.js").OperationResult<"logsGet">;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { forGroup } from "./internal/operation.js";
|
|
3
|
+
import { logsOperations } from "./descriptors/logs.js";
|
|
4
|
+
import { LogsGroup } from "./generated/logs.js";
|
|
5
|
+
import { events, streamCursor } from "./internal/log-events.js";
|
|
6
|
+
// src/effect/logs.ts
|
|
7
|
+
var logs_exports = /* @__PURE__ */ __exportAll({
|
|
8
|
+
events: () => events,
|
|
9
|
+
get: () => get,
|
|
10
|
+
list: () => list,
|
|
11
|
+
streamCursor: () => streamCursor
|
|
12
|
+
});
|
|
13
|
+
const make = /* @__PURE__ */ forGroup(LogsGroup, logsOperations);
|
|
14
|
+
const list = /* @__PURE__ */ make("logsList");
|
|
15
|
+
const get = /* @__PURE__ */ make("logsGet");
|
|
16
|
+
export { events, get, list, logs_exports, streamCursor };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=logs.js.map
|