samva 0.51.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 +5 -2
- package/README.md +1 -0
- package/dist/client/sdk.gen.d.ts +67 -28
- package/dist/client/sdk.gen.js +157 -29
- package/dist/client/types.gen.d.ts +520 -281
- package/dist/effect/campaigns.d.ts +56 -56
- 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/generated/agents.js +4 -4
- package/dist/effect/generated/campaigns.d.ts +18 -6
- package/dist/effect/generated/campaigns.js +2 -6
- package/dist/effect/generated/email.js +3 -3
- 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 +20 -20
- package/dist/effect/generated/messages.d.ts +1 -882
- package/dist/effect/generated/messages.js +4 -243
- 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/scheduled-messages.js +1 -1
- package/dist/effect/generated/shared.d.ts +1138 -257
- package/dist/effect/generated/shared.js +321 -82
- 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 +2 -1
- package/dist/effect/integrations-catalog.d.ts +92 -4
- package/dist/effect/integrations.d.ts +40 -8
- package/dist/effect/internal/client.js +25 -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/journeys.d.ts +148 -148
- package/dist/effect/logs.d.ts +149 -0
- package/dist/effect/logs.js +18 -0
- package/dist/effect/mailboxes.d.ts +156 -150
- package/dist/effect/mailboxes.js +1 -1
- package/dist/effect/newsletter-domains.d.ts +2 -2
- package/dist/effect/whatsapp-setup-links.d.ts +2 -2
- package/dist/effect/whatsapp.d.ts +73 -3
- 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 +3 -1
- package/dist/promises/client.js +3 -1
- package/dist/promises/errors.gen.d.ts +2 -0
- package/dist/promises/errors.gen.js +137 -34
- 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/service-map.d.ts +14 -3
- package/package.json +6 -2
package/dist/mailbox-events.js
CHANGED
|
@@ -126,7 +126,7 @@ const decodeFrame = (raw) => {
|
|
|
126
126
|
cursor: parsed.cursor
|
|
127
127
|
};
|
|
128
128
|
if (parsed.kind !== "event" || typeof parsed.id !== "string" || !isRecord(parsed.event)) return;
|
|
129
|
-
const { type, timestamp, data } = parsed.event;
|
|
129
|
+
const { type, timestamp, data, match } = parsed.event;
|
|
130
130
|
if (typeof type !== "string" || typeof timestamp !== "string") return void 0;
|
|
131
131
|
return {
|
|
132
132
|
kind: "event",
|
|
@@ -135,12 +135,13 @@ const decodeFrame = (raw) => {
|
|
|
135
135
|
event: {
|
|
136
136
|
type,
|
|
137
137
|
timestamp,
|
|
138
|
-
data
|
|
138
|
+
data,
|
|
139
|
+
match
|
|
139
140
|
}
|
|
140
141
|
};
|
|
141
142
|
};
|
|
142
143
|
/** The events URL for an API origin: `https://api.samva.dev` → `wss://events.samva.dev/v1/…`. */
|
|
143
|
-
const
|
|
144
|
+
const eventStreamUrl = (connection, options, path = MAILBOX_EVENT_STREAM_PATH) => {
|
|
144
145
|
const invalid = (message) => new MailboxEventStreamError({
|
|
145
146
|
_tag: "StreamClientError",
|
|
146
147
|
message
|
|
@@ -158,7 +159,7 @@ const mailboxEventsUrl = (connection, options) => {
|
|
|
158
159
|
if (url.protocol === "https:") url.protocol = "wss:";
|
|
159
160
|
else if (url.protocol === "http:") url.protocol = "ws:";
|
|
160
161
|
if (url.protocol !== "wss:" && url.protocol !== "ws:") throw invalid("The events origin must be an http, https, ws, or wss URL.");
|
|
161
|
-
url.pathname =
|
|
162
|
+
url.pathname = path;
|
|
162
163
|
url.search = "";
|
|
163
164
|
url.hash = "";
|
|
164
165
|
if (options.cursor !== void 0) url.searchParams.set("cursor", options.cursor);
|
|
@@ -255,7 +256,9 @@ const sleep = (millis, signal) => new Promise((resolve) => {
|
|
|
255
256
|
* A resumable stream of mailbox events. Iterate it with `for await`; break out of the loop or call
|
|
256
257
|
* {@link close} to end it.
|
|
257
258
|
*/
|
|
258
|
-
var
|
|
259
|
+
var EventStream = class {
|
|
260
|
+
path;
|
|
261
|
+
readEvent;
|
|
259
262
|
#connection;
|
|
260
263
|
#options;
|
|
261
264
|
#stop = new AbortController();
|
|
@@ -276,11 +279,13 @@ var MailboxEventStream = class {
|
|
|
276
279
|
#inHand;
|
|
277
280
|
#cursor;
|
|
278
281
|
#unacked = 0;
|
|
279
|
-
constructor(connection, options
|
|
282
|
+
constructor(connection, options, path, readEvent) {
|
|
283
|
+
this.path = path;
|
|
284
|
+
this.readEvent = readEvent;
|
|
280
285
|
this.#connection = connection;
|
|
281
286
|
this.#options = options;
|
|
282
287
|
this.#cursor = options.cursor;
|
|
283
|
-
|
|
288
|
+
eventStreamUrl(connection, options, path);
|
|
284
289
|
if (options.signal?.aborted) this.close();
|
|
285
290
|
else {
|
|
286
291
|
this.#callerSignal = options.signal;
|
|
@@ -484,10 +489,10 @@ var MailboxEventStream = class {
|
|
|
484
489
|
}));
|
|
485
490
|
return resolve({ kind: "stopped" });
|
|
486
491
|
}
|
|
487
|
-
const url =
|
|
492
|
+
const url = eventStreamUrl(this.#connection, {
|
|
488
493
|
...this.#options,
|
|
489
494
|
cursor: this.#resumeCursor()
|
|
490
|
-
});
|
|
495
|
+
}, this.path);
|
|
491
496
|
let opened = false;
|
|
492
497
|
let settled = false;
|
|
493
498
|
let idleTimer;
|
|
@@ -544,13 +549,16 @@ var MailboxEventStream = class {
|
|
|
544
549
|
}
|
|
545
550
|
if (frame.kind === "pong") return;
|
|
546
551
|
if (frame.kind === "event") {
|
|
547
|
-
this
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
552
|
+
const event = this.readEvent(frame);
|
|
553
|
+
if (event === void 0) {
|
|
554
|
+
this.#fail(new MailboxEventStreamError({
|
|
555
|
+
_tag: "StreamProtocolError",
|
|
556
|
+
message: DESCRIPTION.StreamProtocolError,
|
|
557
|
+
cursor: this.#cursor
|
|
558
|
+
}));
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
this.#queue.push(event);
|
|
554
562
|
this.#wake();
|
|
555
563
|
return;
|
|
556
564
|
}
|
|
@@ -580,10 +588,10 @@ var MailboxEventStream = class {
|
|
|
580
588
|
* are worth a retry.
|
|
581
589
|
*/
|
|
582
590
|
async #diagnose() {
|
|
583
|
-
const url =
|
|
591
|
+
const url = eventStreamUrl(this.#connection, {
|
|
584
592
|
...this.#options,
|
|
585
593
|
cursor: this.#resumeCursor()
|
|
586
|
-
});
|
|
594
|
+
}, this.path);
|
|
587
595
|
url.protocol = url.protocol === "wss:" ? "https:" : "http:";
|
|
588
596
|
const deadline = new AbortController();
|
|
589
597
|
const onStop = () => deadline.abort();
|
|
@@ -653,6 +661,17 @@ const readRefusalBody = async (response) => {
|
|
|
653
661
|
return;
|
|
654
662
|
}
|
|
655
663
|
};
|
|
656
|
-
|
|
664
|
+
var MailboxEventStream = class extends EventStream {
|
|
665
|
+
constructor(connection, options = {}) {
|
|
666
|
+
super(connection, options, MAILBOX_EVENT_STREAM_PATH, (frame) => ({
|
|
667
|
+
cursor: frame.cursor,
|
|
668
|
+
id: frame.id,
|
|
669
|
+
type: frame.event.type,
|
|
670
|
+
timestamp: frame.event.timestamp,
|
|
671
|
+
data: isRecord(frame.event.data) ? frame.event.data : {}
|
|
672
|
+
}));
|
|
673
|
+
}
|
|
674
|
+
};
|
|
675
|
+
export { EventStream, MAILBOX_EVENT_STREAM_IDLE_MILLIS, MAILBOX_EVENT_STREAM_PING_MILLIS, MailboxEventStream, MailboxEventStreamCloseCode, MailboxEventStreamError, eventStreamUrl, readRefusalBody, refusalOutcome };
|
|
657
676
|
|
|
658
677
|
//# sourceMappingURL=mailbox-events.js.map
|
package/dist/package.js
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
29
|
import { type Client, type Config } from "../client/client/index.js";
|
|
30
|
-
import { Agents as agents, Accounts as accounts, Integrations as integrations, IntegrationCatalog as integrationCatalog, Whatsapp as whatsapp, WhatsappFlows as whatsappFlows, WhatsappSetupLinks as whatsappSetupLinks, TemplateRegistrations as templateRegistrations, TemplateShareLinks as templateShareLinks, Analytics as analytics, ApiKeys as apiKeys, ApprovalRequests as approvalRequests, Attachments as attachments, Brands as brands, Campaigns as campaigns, ContactGroups as contactGroups, ContactEvents as contactEvents, Contacts as contacts, Conversations as conversations, CustomFields as customFields, Email as email, Events as events, Feedback as feedback, Journeys as journeys, Mailboxes as mailboxes, Media as media, Messages as messages, Namespaces as namespaces, Operations as operations, Organizations as organizations, Policies as policies, ScheduledMessages as scheduledMessages, Subscriptions as subscriptions, Templates as templates, Topics as topics, TopicForms as topicForms, Newsletters as newsletters, Webhooks as webhooks, Whoami as whoami } from "../client/sdk.gen.js";
|
|
30
|
+
import { Agents as agents, Accounts as accounts, Integrations as integrations, IntegrationCatalog as integrationCatalog, Whatsapp as whatsapp, WhatsappFlows as whatsappFlows, WhatsappSetupLinks as whatsappSetupLinks, TemplateRegistrations as templateRegistrations, TemplateShareLinks as templateShareLinks, Analytics as analytics, ApiKeys as apiKeys, ApprovalRequests as approvalRequests, Attachments as attachments, Brands as brands, Campaigns as campaigns, ContactGroups as contactGroups, ContactEvents as contactEvents, Contacts as contacts, Conversations as conversations, CustomFields as customFields, Email as email, Events as events, Feedback as feedback, Journeys as journeys, Logs as logs, Mailboxes as mailboxes, Media as media, Messages as messages, Namespaces as namespaces, Operations as operations, Organizations as organizations, Policies as policies, ScheduledMessages as scheduledMessages, Subscriptions as subscriptions, Templates as templates, Topics as topics, TopicForms as topicForms, Newsletters as newsletters, Webhooks as webhooks, Whoami as whoami } from "../client/sdk.gen.js";
|
|
31
31
|
import type { MessagesSendData } from "../client/types.gen.js";
|
|
32
32
|
import { MailboxEventStream, type MailboxEventStreamOptions } from "../mailbox-events.js";
|
|
33
33
|
import { type RequestPolicy } from "./request.js";
|
|
@@ -170,6 +170,7 @@ export interface SamvaRawClient {
|
|
|
170
170
|
readonly feedback: typeof feedback;
|
|
171
171
|
readonly whoami: typeof whoami;
|
|
172
172
|
readonly journeys: typeof journeys;
|
|
173
|
+
readonly logs: typeof logs;
|
|
173
174
|
readonly mailboxes: typeof mailboxes;
|
|
174
175
|
readonly namespaces: typeof namespaces;
|
|
175
176
|
}
|
|
@@ -184,6 +185,7 @@ export type PromiseMailboxesService = DirectService<typeof mailboxes> & {
|
|
|
184
185
|
export interface SamvaClient {
|
|
185
186
|
/** Bound, unmodified Hey API methods and their original result envelopes. */
|
|
186
187
|
readonly raw: SamvaRawClient;
|
|
188
|
+
readonly logs: DirectService<typeof logs>;
|
|
187
189
|
readonly messages: DirectService<PromiseMessagesTransport>;
|
|
188
190
|
readonly scheduledMessages: DirectService<typeof scheduledMessages>;
|
|
189
191
|
readonly brands: DirectService<typeof brands>;
|
package/dist/promises/client.js
CHANGED
|
@@ -4,7 +4,7 @@ import { createClient as createClient$1 } from "../client/client/client.gen.js";
|
|
|
4
4
|
import { SamvaOperations } from "../effect/generated-metadata.js";
|
|
5
5
|
import { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, CredentialsError, DeliveryUnavailableError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, MailboxSendConflictError, MailboxSendRefusedError, MalformedRequestError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTimeoutError, SamvaTransportError, SenderNotReadyError, ServiceUnavailableError, ShareLinkUnavailable, SlugTaken, TemplateInUseError, TemplateSourceError, UnauthorizedError, ValidationError, WhatsAppChannelError, WhatsAppServiceWindowClosedError, WhatsAppSetupLinkUnavailableError, fromApiError } from "./errors.gen.js";
|
|
6
6
|
import { configureRequests, startAttempt, uploadTimeout } from "./request.js";
|
|
7
|
-
import { Accounts, Agents, Analytics, ApiKeys, ApprovalRequests, Attachments, Brands, Campaigns, ContactEvents, ContactGroups, Contacts, Conversations, CustomFields, Email, Events, Feedback, IntegrationCatalog, Integrations, Journeys, Mailboxes, Media, Messages, Namespaces, Newsletters, Operations, Organizations, Policies, ScheduledMessages, Subscriptions, TemplateRegistrations, TemplateShareLinks, Templates, TopicForms, Topics, Webhooks, Whatsapp, WhatsappFlows, WhatsappSetupLinks, Whoami } from "../client/sdk.gen.js";
|
|
7
|
+
import { Accounts, Agents, Analytics, ApiKeys, ApprovalRequests, Attachments, Brands, Campaigns, ContactEvents, ContactGroups, Contacts, Conversations, CustomFields, Email, Events, Feedback, IntegrationCatalog, Integrations, Journeys, Logs, Mailboxes, Media, Messages, Namespaces, Newsletters, Operations, Organizations, Policies, ScheduledMessages, Subscriptions, TemplateRegistrations, TemplateShareLinks, Templates, TopicForms, Topics, Webhooks, Whatsapp, WhatsappFlows, WhatsappSetupLinks, Whoami } from "../client/sdk.gen.js";
|
|
8
8
|
import { MediaUploadError, mediaCreateBody, planInlineUploads, withUploadedAttachments } from "../inline-attachments.js";
|
|
9
9
|
import { MailboxEventStream } from "../mailbox-events.js";
|
|
10
10
|
import { buildEmailSendPayload, buildMessagesSendPayload, replyToEmailsPayload } from "../normalize.js";
|
|
@@ -286,6 +286,7 @@ function makeClient(config) {
|
|
|
286
286
|
feedback: createBoundService(Feedback, clientInstance),
|
|
287
287
|
whoami: createBoundService(Whoami, clientInstance),
|
|
288
288
|
journeys: createBoundService(Journeys, clientInstance),
|
|
289
|
+
logs: createBoundService(Logs, clientInstance),
|
|
289
290
|
mailboxes: createBoundService(Mailboxes, clientInstance),
|
|
290
291
|
namespaces: createBoundService(Namespaces, clientInstance)
|
|
291
292
|
};
|
|
@@ -298,6 +299,7 @@ function makeClient(config) {
|
|
|
298
299
|
const promiseEmail = createPromiseEmailTransport(clientInstance);
|
|
299
300
|
const result = {
|
|
300
301
|
raw,
|
|
302
|
+
logs: createDirectService(raw.logs),
|
|
301
303
|
messages: createDirectService(promiseMessages),
|
|
302
304
|
scheduledMessages: createDirectService(raw.scheduledMessages),
|
|
303
305
|
brands: createDirectService(raw.brands),
|
|
@@ -10,6 +10,7 @@ export declare abstract class SamvaApiError<Tag extends SamvaApiErrorTag = Samva
|
|
|
10
10
|
readonly request: Request | undefined;
|
|
11
11
|
readonly response: Response | undefined;
|
|
12
12
|
readonly status: number | undefined;
|
|
13
|
+
readonly requestId: string | undefined;
|
|
13
14
|
protected constructor(message: string, context?: SamvaApiErrorContext);
|
|
14
15
|
}
|
|
15
16
|
/** A transport or malformed-response failure that is not part of the API error contract. */
|
|
@@ -18,6 +19,7 @@ export declare class SamvaTransportError extends Error {
|
|
|
18
19
|
readonly request: Request | undefined;
|
|
19
20
|
readonly response: Response | undefined;
|
|
20
21
|
readonly status: number | undefined;
|
|
22
|
+
readonly requestId: string | undefined;
|
|
21
23
|
readonly cause: unknown;
|
|
22
24
|
constructor(cause: unknown, context?: SamvaApiErrorContext);
|
|
23
25
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { samvaRequestId, withRequestIdMessage } from "../request-id.js";
|
|
1
2
|
// src/promises/errors.gen.ts
|
|
2
3
|
const redactRequest = (request) => request === void 0 ? void 0 : new Request(request.url, { method: request.method });
|
|
3
4
|
/** Base class for failures declared by the public Samva OpenAPI contract. */
|
|
@@ -5,12 +6,15 @@ var SamvaApiError = class extends Error {
|
|
|
5
6
|
request;
|
|
6
7
|
response;
|
|
7
8
|
status;
|
|
9
|
+
requestId;
|
|
8
10
|
constructor(message, context = {}) {
|
|
9
|
-
|
|
11
|
+
const requestId = samvaRequestId(context.response?.headers.get("x-samva-request-id"));
|
|
12
|
+
super(withRequestIdMessage(message, requestId));
|
|
10
13
|
this.name = new.target.name;
|
|
11
14
|
this.request = redactRequest(context.request);
|
|
12
15
|
this.response = context.response;
|
|
13
16
|
this.status = context.response?.status;
|
|
17
|
+
this.requestId = requestId;
|
|
14
18
|
}
|
|
15
19
|
};
|
|
16
20
|
/** A transport or malformed-response failure that is not part of the API error contract. */
|
|
@@ -19,14 +23,17 @@ var SamvaTransportError = class extends Error {
|
|
|
19
23
|
request;
|
|
20
24
|
response;
|
|
21
25
|
status;
|
|
26
|
+
requestId;
|
|
22
27
|
cause;
|
|
23
28
|
constructor(cause, context = {}) {
|
|
24
|
-
|
|
29
|
+
const requestId = samvaRequestId(context.response?.headers.get("x-samva-request-id"));
|
|
30
|
+
super(withRequestIdMessage(cause instanceof Error ? cause.message : "Samva request failed", requestId), { cause });
|
|
25
31
|
this.name = "SamvaTransportError";
|
|
26
32
|
this.cause = cause;
|
|
27
33
|
this.request = redactRequest(context.request);
|
|
28
34
|
this.response = context.response;
|
|
29
35
|
this.status = context.response?.status;
|
|
36
|
+
this.requestId = requestId;
|
|
30
37
|
}
|
|
31
38
|
};
|
|
32
39
|
/**
|
|
@@ -51,224 +58,320 @@ var AnalyticsQueryError = class extends SamvaApiError {
|
|
|
51
58
|
_tag = "AnalyticsQueryError";
|
|
52
59
|
constructor(payload, context = {}) {
|
|
53
60
|
super(messageOf("AnalyticsQueryError", payload), context);
|
|
54
|
-
Object.assign(this, payload
|
|
61
|
+
Object.assign(this, payload, {
|
|
62
|
+
message: this.message,
|
|
63
|
+
requestId: this.requestId
|
|
64
|
+
});
|
|
55
65
|
}
|
|
56
66
|
};
|
|
57
67
|
var BillingProviderError = class extends SamvaApiError {
|
|
58
68
|
_tag = "BillingProviderError";
|
|
59
69
|
constructor(payload, context = {}) {
|
|
60
70
|
super(messageOf("BillingProviderError", payload), context);
|
|
61
|
-
Object.assign(this, payload
|
|
71
|
+
Object.assign(this, payload, {
|
|
72
|
+
message: this.message,
|
|
73
|
+
requestId: this.requestId
|
|
74
|
+
});
|
|
62
75
|
}
|
|
63
76
|
};
|
|
64
77
|
var BrandAddressRequiredError = class extends SamvaApiError {
|
|
65
78
|
_tag = "BrandAddressRequiredError";
|
|
66
79
|
constructor(payload, context = {}) {
|
|
67
80
|
super(messageOf("BrandAddressRequiredError", payload), context);
|
|
68
|
-
Object.assign(this, payload
|
|
81
|
+
Object.assign(this, payload, {
|
|
82
|
+
message: this.message,
|
|
83
|
+
requestId: this.requestId
|
|
84
|
+
});
|
|
69
85
|
}
|
|
70
86
|
};
|
|
71
87
|
var CampaignFooterRequiredError = class extends SamvaApiError {
|
|
72
88
|
_tag = "CampaignFooterRequiredError";
|
|
73
89
|
constructor(payload, context = {}) {
|
|
74
90
|
super(messageOf("CampaignFooterRequiredError", payload), context);
|
|
75
|
-
Object.assign(this, payload
|
|
91
|
+
Object.assign(this, payload, {
|
|
92
|
+
message: this.message,
|
|
93
|
+
requestId: this.requestId
|
|
94
|
+
});
|
|
76
95
|
}
|
|
77
96
|
};
|
|
78
97
|
var ConflictError = class extends SamvaApiError {
|
|
79
98
|
_tag = "ConflictError";
|
|
80
99
|
constructor(payload, context = {}) {
|
|
81
100
|
super(messageOf("ConflictError", payload), context);
|
|
82
|
-
Object.assign(this, payload
|
|
101
|
+
Object.assign(this, payload, {
|
|
102
|
+
message: this.message,
|
|
103
|
+
requestId: this.requestId
|
|
104
|
+
});
|
|
83
105
|
}
|
|
84
106
|
};
|
|
85
107
|
var CredentialsError = class extends SamvaApiError {
|
|
86
108
|
_tag = "CredentialsError";
|
|
87
109
|
constructor(payload, context = {}) {
|
|
88
110
|
super(messageOf("CredentialsError", payload), context);
|
|
89
|
-
Object.assign(this, payload
|
|
111
|
+
Object.assign(this, payload, {
|
|
112
|
+
message: this.message,
|
|
113
|
+
requestId: this.requestId
|
|
114
|
+
});
|
|
90
115
|
}
|
|
91
116
|
};
|
|
92
117
|
var DeliveryUnavailableError = class extends SamvaApiError {
|
|
93
118
|
_tag = "DeliveryUnavailableError";
|
|
94
119
|
constructor(payload, context = {}) {
|
|
95
120
|
super(messageOf("DeliveryUnavailableError", payload), context);
|
|
96
|
-
Object.assign(this, payload
|
|
121
|
+
Object.assign(this, payload, {
|
|
122
|
+
message: this.message,
|
|
123
|
+
requestId: this.requestId
|
|
124
|
+
});
|
|
97
125
|
}
|
|
98
126
|
};
|
|
99
127
|
var EmailChannelError = class extends SamvaApiError {
|
|
100
128
|
_tag = "EmailChannelError";
|
|
101
129
|
constructor(payload, context = {}) {
|
|
102
130
|
super(messageOf("EmailChannelError", payload), context);
|
|
103
|
-
Object.assign(this, payload
|
|
131
|
+
Object.assign(this, payload, {
|
|
132
|
+
message: this.message,
|
|
133
|
+
requestId: this.requestId
|
|
134
|
+
});
|
|
104
135
|
}
|
|
105
136
|
};
|
|
106
137
|
var ExternalServiceError = class extends SamvaApiError {
|
|
107
138
|
_tag = "ExternalServiceError";
|
|
108
139
|
constructor(payload, context = {}) {
|
|
109
140
|
super(messageOf("ExternalServiceError", payload), context);
|
|
110
|
-
Object.assign(this, payload
|
|
141
|
+
Object.assign(this, payload, {
|
|
142
|
+
message: this.message,
|
|
143
|
+
requestId: this.requestId
|
|
144
|
+
});
|
|
111
145
|
}
|
|
112
146
|
};
|
|
113
147
|
var FlagDisabledError = class extends SamvaApiError {
|
|
114
148
|
_tag = "FlagDisabledError";
|
|
115
149
|
constructor(payload, context = {}) {
|
|
116
150
|
super(messageOf("FlagDisabledError", payload), context);
|
|
117
|
-
Object.assign(this, payload
|
|
151
|
+
Object.assign(this, payload, {
|
|
152
|
+
message: this.message,
|
|
153
|
+
requestId: this.requestId
|
|
154
|
+
});
|
|
118
155
|
}
|
|
119
156
|
};
|
|
120
157
|
var ForbiddenError = class extends SamvaApiError {
|
|
121
158
|
_tag = "ForbiddenError";
|
|
122
159
|
constructor(payload, context = {}) {
|
|
123
160
|
super(messageOf("ForbiddenError", payload), context);
|
|
124
|
-
Object.assign(this, payload
|
|
161
|
+
Object.assign(this, payload, {
|
|
162
|
+
message: this.message,
|
|
163
|
+
requestId: this.requestId
|
|
164
|
+
});
|
|
125
165
|
}
|
|
126
166
|
};
|
|
127
167
|
var FromAddressRequiredError = class extends SamvaApiError {
|
|
128
168
|
_tag = "FromAddressRequiredError";
|
|
129
169
|
constructor(payload, context = {}) {
|
|
130
170
|
super(messageOf("FromAddressRequiredError", payload), context);
|
|
131
|
-
Object.assign(this, payload
|
|
171
|
+
Object.assign(this, payload, {
|
|
172
|
+
message: this.message,
|
|
173
|
+
requestId: this.requestId
|
|
174
|
+
});
|
|
132
175
|
}
|
|
133
176
|
};
|
|
134
177
|
var GatewayTimeoutError = class extends SamvaApiError {
|
|
135
178
|
_tag = "GatewayTimeoutError";
|
|
136
179
|
constructor(payload, context = {}) {
|
|
137
180
|
super(messageOf("GatewayTimeoutError", payload), context);
|
|
138
|
-
Object.assign(this, payload
|
|
181
|
+
Object.assign(this, payload, {
|
|
182
|
+
message: this.message,
|
|
183
|
+
requestId: this.requestId
|
|
184
|
+
});
|
|
139
185
|
}
|
|
140
186
|
};
|
|
141
187
|
var InternalError = class extends SamvaApiError {
|
|
142
188
|
_tag = "InternalError";
|
|
143
189
|
constructor(payload, context = {}) {
|
|
144
190
|
super(messageOf("InternalError", payload), context);
|
|
145
|
-
Object.assign(this, payload
|
|
191
|
+
Object.assign(this, payload, {
|
|
192
|
+
message: this.message,
|
|
193
|
+
requestId: this.requestId
|
|
194
|
+
});
|
|
146
195
|
}
|
|
147
196
|
};
|
|
148
197
|
var MailboxSendConflictError = class extends SamvaApiError {
|
|
149
198
|
_tag = "MailboxSendConflictError";
|
|
150
199
|
constructor(payload, context = {}) {
|
|
151
200
|
super(messageOf("MailboxSendConflictError", payload), context);
|
|
152
|
-
Object.assign(this, payload
|
|
201
|
+
Object.assign(this, payload, {
|
|
202
|
+
message: this.message,
|
|
203
|
+
requestId: this.requestId
|
|
204
|
+
});
|
|
153
205
|
}
|
|
154
206
|
};
|
|
155
207
|
var MailboxSendRefusedError = class extends SamvaApiError {
|
|
156
208
|
_tag = "MailboxSendRefusedError";
|
|
157
209
|
constructor(payload, context = {}) {
|
|
158
210
|
super(messageOf("MailboxSendRefusedError", payload), context);
|
|
159
|
-
Object.assign(this, payload
|
|
211
|
+
Object.assign(this, payload, {
|
|
212
|
+
message: this.message,
|
|
213
|
+
requestId: this.requestId
|
|
214
|
+
});
|
|
160
215
|
}
|
|
161
216
|
};
|
|
162
217
|
var MalformedRequestError = class extends SamvaApiError {
|
|
163
218
|
_tag = "MalformedRequestError";
|
|
164
219
|
constructor(payload, context = {}) {
|
|
165
220
|
super(messageOf("MalformedRequestError", payload), context);
|
|
166
|
-
Object.assign(this, payload
|
|
221
|
+
Object.assign(this, payload, {
|
|
222
|
+
message: this.message,
|
|
223
|
+
requestId: this.requestId
|
|
224
|
+
});
|
|
167
225
|
}
|
|
168
226
|
};
|
|
169
227
|
var OnboardingReviewRequiredError = class extends SamvaApiError {
|
|
170
228
|
_tag = "OnboardingReviewRequiredError";
|
|
171
229
|
constructor(payload, context = {}) {
|
|
172
230
|
super(messageOf("OnboardingReviewRequiredError", payload), context);
|
|
173
|
-
Object.assign(this, payload
|
|
231
|
+
Object.assign(this, payload, {
|
|
232
|
+
message: this.message,
|
|
233
|
+
requestId: this.requestId
|
|
234
|
+
});
|
|
174
235
|
}
|
|
175
236
|
};
|
|
176
237
|
var PaymentRequiredError = class extends SamvaApiError {
|
|
177
238
|
_tag = "PaymentRequiredError";
|
|
178
239
|
constructor(payload, context = {}) {
|
|
179
240
|
super(messageOf("PaymentRequiredError", payload), context);
|
|
180
|
-
Object.assign(this, payload
|
|
241
|
+
Object.assign(this, payload, {
|
|
242
|
+
message: this.message,
|
|
243
|
+
requestId: this.requestId
|
|
244
|
+
});
|
|
181
245
|
}
|
|
182
246
|
};
|
|
183
247
|
var RateLimitedError = class extends SamvaApiError {
|
|
184
248
|
_tag = "RateLimitedError";
|
|
185
249
|
constructor(payload, context = {}) {
|
|
186
250
|
super(messageOf("RateLimitedError", payload), context);
|
|
187
|
-
Object.assign(this, payload
|
|
251
|
+
Object.assign(this, payload, {
|
|
252
|
+
message: this.message,
|
|
253
|
+
requestId: this.requestId
|
|
254
|
+
});
|
|
188
255
|
}
|
|
189
256
|
};
|
|
190
257
|
var ResourceNotFoundError = class extends SamvaApiError {
|
|
191
258
|
_tag = "ResourceNotFoundError";
|
|
192
259
|
constructor(payload, context = {}) {
|
|
193
260
|
super(messageOf("ResourceNotFoundError", payload), context);
|
|
194
|
-
Object.assign(this, payload
|
|
261
|
+
Object.assign(this, payload, {
|
|
262
|
+
message: this.message,
|
|
263
|
+
requestId: this.requestId
|
|
264
|
+
});
|
|
195
265
|
}
|
|
196
266
|
};
|
|
197
267
|
var SenderNotReadyError = class extends SamvaApiError {
|
|
198
268
|
_tag = "SenderNotReadyError";
|
|
199
269
|
constructor(payload, context = {}) {
|
|
200
270
|
super(messageOf("SenderNotReadyError", payload), context);
|
|
201
|
-
Object.assign(this, payload
|
|
271
|
+
Object.assign(this, payload, {
|
|
272
|
+
message: this.message,
|
|
273
|
+
requestId: this.requestId
|
|
274
|
+
});
|
|
202
275
|
}
|
|
203
276
|
};
|
|
204
277
|
var ServiceUnavailableError = class extends SamvaApiError {
|
|
205
278
|
_tag = "ServiceUnavailableError";
|
|
206
279
|
constructor(payload, context = {}) {
|
|
207
280
|
super(messageOf("ServiceUnavailableError", payload), context);
|
|
208
|
-
Object.assign(this, payload
|
|
281
|
+
Object.assign(this, payload, {
|
|
282
|
+
message: this.message,
|
|
283
|
+
requestId: this.requestId
|
|
284
|
+
});
|
|
209
285
|
}
|
|
210
286
|
};
|
|
211
287
|
var ShareLinkUnavailable = class extends SamvaApiError {
|
|
212
288
|
_tag = "ShareLinkUnavailable";
|
|
213
289
|
constructor(payload, context = {}) {
|
|
214
290
|
super(messageOf("ShareLinkUnavailable", payload), context);
|
|
215
|
-
Object.assign(this, payload
|
|
291
|
+
Object.assign(this, payload, {
|
|
292
|
+
message: this.message,
|
|
293
|
+
requestId: this.requestId
|
|
294
|
+
});
|
|
216
295
|
}
|
|
217
296
|
};
|
|
218
297
|
var SlugTaken = class extends SamvaApiError {
|
|
219
298
|
_tag = "SlugTaken";
|
|
220
299
|
constructor(payload, context = {}) {
|
|
221
300
|
super(messageOf("SlugTaken", payload), context);
|
|
222
|
-
Object.assign(this, payload
|
|
301
|
+
Object.assign(this, payload, {
|
|
302
|
+
message: this.message,
|
|
303
|
+
requestId: this.requestId
|
|
304
|
+
});
|
|
223
305
|
}
|
|
224
306
|
};
|
|
225
307
|
var TemplateInUseError = class extends SamvaApiError {
|
|
226
308
|
_tag = "TemplateInUseError";
|
|
227
309
|
constructor(payload, context = {}) {
|
|
228
310
|
super(messageOf("TemplateInUseError", payload), context);
|
|
229
|
-
Object.assign(this, payload
|
|
311
|
+
Object.assign(this, payload, {
|
|
312
|
+
message: this.message,
|
|
313
|
+
requestId: this.requestId
|
|
314
|
+
});
|
|
230
315
|
}
|
|
231
316
|
};
|
|
232
317
|
var TemplateSourceError = class extends SamvaApiError {
|
|
233
318
|
_tag = "TemplateSourceError";
|
|
234
319
|
constructor(payload, context = {}) {
|
|
235
320
|
super(messageOf("TemplateSourceError", payload), context);
|
|
236
|
-
Object.assign(this, payload
|
|
321
|
+
Object.assign(this, payload, {
|
|
322
|
+
message: this.message,
|
|
323
|
+
requestId: this.requestId
|
|
324
|
+
});
|
|
237
325
|
}
|
|
238
326
|
};
|
|
239
327
|
var UnauthorizedError = class extends SamvaApiError {
|
|
240
328
|
_tag = "UnauthorizedError";
|
|
241
329
|
constructor(payload, context = {}) {
|
|
242
330
|
super(messageOf("UnauthorizedError", payload), context);
|
|
243
|
-
Object.assign(this, payload
|
|
331
|
+
Object.assign(this, payload, {
|
|
332
|
+
message: this.message,
|
|
333
|
+
requestId: this.requestId
|
|
334
|
+
});
|
|
244
335
|
}
|
|
245
336
|
};
|
|
246
337
|
var ValidationError = class extends SamvaApiError {
|
|
247
338
|
_tag = "ValidationError";
|
|
248
339
|
constructor(payload, context = {}) {
|
|
249
340
|
super(messageOf("ValidationError", payload), context);
|
|
250
|
-
Object.assign(this, payload
|
|
341
|
+
Object.assign(this, payload, {
|
|
342
|
+
message: this.message,
|
|
343
|
+
requestId: this.requestId
|
|
344
|
+
});
|
|
251
345
|
}
|
|
252
346
|
};
|
|
253
347
|
var WhatsAppChannelError = class extends SamvaApiError {
|
|
254
348
|
_tag = "WhatsAppChannelError";
|
|
255
349
|
constructor(payload, context = {}) {
|
|
256
350
|
super(messageOf("WhatsAppChannelError", payload), context);
|
|
257
|
-
Object.assign(this, payload
|
|
351
|
+
Object.assign(this, payload, {
|
|
352
|
+
message: this.message,
|
|
353
|
+
requestId: this.requestId
|
|
354
|
+
});
|
|
258
355
|
}
|
|
259
356
|
};
|
|
260
357
|
var WhatsAppServiceWindowClosedError = class extends SamvaApiError {
|
|
261
358
|
_tag = "WhatsAppServiceWindowClosedError";
|
|
262
359
|
constructor(payload, context = {}) {
|
|
263
360
|
super(messageOf("WhatsAppServiceWindowClosedError", payload), context);
|
|
264
|
-
Object.assign(this, payload
|
|
361
|
+
Object.assign(this, payload, {
|
|
362
|
+
message: this.message,
|
|
363
|
+
requestId: this.requestId
|
|
364
|
+
});
|
|
265
365
|
}
|
|
266
366
|
};
|
|
267
367
|
var WhatsAppSetupLinkUnavailableError = class extends SamvaApiError {
|
|
268
368
|
_tag = "WhatsAppSetupLinkUnavailableError";
|
|
269
369
|
constructor(payload, context = {}) {
|
|
270
370
|
super(messageOf("WhatsAppSetupLinkUnavailableError", payload), context);
|
|
271
|
-
Object.assign(this, payload
|
|
371
|
+
Object.assign(this, payload, {
|
|
372
|
+
message: this.message,
|
|
373
|
+
requestId: this.requestId
|
|
374
|
+
});
|
|
272
375
|
}
|
|
273
376
|
};
|
|
274
377
|
const constructors = {
|