samva 0.53.0 → 0.55.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 +1 -1
- package/README.md +1 -0
- package/dist/_virtual/_rolldown/runtime.js +4 -4
- package/dist/agent/index.js +1 -1
- package/dist/client/client/client.gen.js +1 -2
- package/dist/client/client/utils.gen.js +1 -1
- package/dist/client/client.gen.js +1 -1
- package/dist/client/sdk.gen.d.ts +96 -12
- package/dist/client/sdk.gen.js +314 -25
- package/dist/client/types.gen.d.ts +647 -13
- package/dist/client-attribution.js +1 -1
- package/dist/effect/agents.js +1 -1
- package/dist/effect/analytics.js +1 -1
- package/dist/effect/api-keys.js +1 -1
- package/dist/effect/approval-requests.js +1 -1
- package/dist/effect/attachments.js +1 -1
- package/dist/effect/brands.d.ts +8 -1
- package/dist/effect/brands.js +2 -2
- package/dist/effect/campaigns.d.ts +66 -56
- package/dist/effect/campaigns.js +1 -1
- package/dist/effect/categories.js +6 -6
- package/dist/effect/contact-groups.js +1 -1
- package/dist/effect/contacts.js +1 -1
- package/dist/effect/conversations.js +1 -1
- package/dist/effect/custom-fields.js +1 -1
- package/dist/effect/descriptors/brands.d.ts +4 -4
- package/dist/effect/descriptors/brands.js +4 -4
- package/dist/effect/descriptors/email.d.ts +21 -1
- package/dist/effect/descriptors/email.js +21 -1
- package/dist/effect/descriptors/phone-numbers.d.ts +49 -0
- package/dist/effect/descriptors/phone-numbers.js +47 -0
- package/dist/effect/descriptors/topics.d.ts +1 -1
- package/dist/effect/descriptors/topics.js +1 -1
- package/dist/effect/email.d.ts +12 -0
- package/dist/effect/email.js +6 -2
- package/dist/effect/errors.d.ts +1 -1
- package/dist/effect/errors.js +2 -2
- package/dist/effect/events.js +2 -2
- package/dist/effect/feedback.js +2 -2
- package/dist/effect/generated/accounts.d.ts +12 -1
- package/dist/effect/generated/accounts.js +2 -1
- package/dist/effect/generated/agents.js +7 -7
- package/dist/effect/generated/analytics.js +16 -16
- package/dist/effect/generated/api-keys.js +7 -7
- package/dist/effect/generated/approval-requests.js +1 -1
- package/dist/effect/generated/attachments.js +4 -4
- package/dist/effect/generated/brands.d.ts +78 -8
- package/dist/effect/generated/brands.js +21 -12
- package/dist/effect/generated/campaigns.d.ts +17 -1
- package/dist/effect/generated/campaigns.js +15 -14
- package/dist/effect/generated/contact-events.js +1 -1
- package/dist/effect/generated/contact-groups.js +12 -12
- package/dist/effect/generated/contacts.js +50 -50
- package/dist/effect/generated/conversations.js +7 -7
- package/dist/effect/generated/custom-fields.js +6 -6
- package/dist/effect/generated/email.d.ts +473 -2
- package/dist/effect/generated/email.js +143 -44
- package/dist/effect/generated/events.js +5 -5
- package/dist/effect/generated/feedback.js +1 -1
- package/dist/effect/generated/index.d.ts +3 -1
- package/dist/effect/generated/integrations-catalog.d.ts +16 -0
- package/dist/effect/generated/integrations-catalog.js +10 -6
- package/dist/effect/generated/integrations.js +5 -5
- package/dist/effect/generated/journeys.d.ts +158 -1
- package/dist/effect/generated/journeys.js +16 -14
- package/dist/effect/generated/logs.js +2 -2
- package/dist/effect/generated/mailboxes.d.ts +41 -3
- package/dist/effect/generated/mailboxes.js +48 -50
- package/dist/effect/generated/media.js +1 -1
- package/dist/effect/generated/messages.d.ts +6 -0
- package/dist/effect/generated/messages.js +12 -6
- package/dist/effect/generated/namespaces.d.ts +9 -9
- package/dist/effect/generated/namespaces.js +1 -1
- package/dist/effect/generated/newsletter-domains.js +1 -1
- package/dist/effect/generated/newsletter-issues.js +69 -69
- package/dist/effect/generated/newsletters.js +1 -1
- package/dist/effect/generated/operations.js +1 -1
- package/dist/effect/generated/organizations.d.ts +3 -0
- package/dist/effect/generated/organizations.js +2 -1
- package/dist/effect/generated/phone-numbers.d.ts +817 -0
- package/dist/effect/generated/phone-numbers.js +230 -0
- package/dist/effect/generated/policies.js +2 -2
- package/dist/effect/generated/scheduled-messages.js +1 -1
- package/dist/effect/generated/shared.d.ts +75 -14
- package/dist/effect/generated/shared.js +46 -17
- package/dist/effect/generated/subscriptions.js +1 -1
- package/dist/effect/generated/template-registrations.js +1 -1
- package/dist/effect/generated/template-share-links.js +9 -9
- package/dist/effect/generated/templates.d.ts +34 -1
- package/dist/effect/generated/templates.js +136 -121
- package/dist/effect/generated/topic-forms.js +1 -1
- package/dist/effect/generated/topics.d.ts +10 -0
- package/dist/effect/generated/topics.js +20 -13
- package/dist/effect/generated/webhooks.js +18 -18
- package/dist/effect/generated/whats-app-flows.js +5 -5
- package/dist/effect/generated/whats-app-setup-links.js +1 -1
- package/dist/effect/generated/whats-app.d.ts +75 -0
- package/dist/effect/generated/whats-app.js +43 -18
- package/dist/effect/generated/whoami.js +1 -1
- package/dist/effect/generated-metadata.d.ts +47 -1
- package/dist/effect/generated-metadata.js +175 -146
- package/dist/effect/index.d.ts +1 -0
- package/dist/effect/index.js +6 -5
- package/dist/effect/integrations-catalog.js +1 -1
- package/dist/effect/integrations.js +1 -1
- package/dist/effect/internal/client.js +6 -6
- package/dist/effect/internal/email-sender.js +3 -3
- package/dist/effect/internal/log-events.js +2 -2
- package/dist/effect/internal/mailbox-events.js +1 -1
- package/dist/effect/internal/operation.js +2 -2
- package/dist/effect/internal/send.js +4 -4
- package/dist/effect/journeys.d.ts +20 -0
- package/dist/effect/journeys.js +1 -1
- package/dist/effect/logs.js +1 -1
- package/dist/effect/mailboxes.d.ts +191 -191
- package/dist/effect/mailboxes.js +3 -3
- package/dist/effect/media.js +2 -2
- package/dist/effect/messages.js +2 -2
- package/dist/effect/namespaces.d.ts +2 -2
- package/dist/effect/namespaces.js +1 -1
- package/dist/effect/newsletter-domains.js +1 -1
- package/dist/effect/newsletter-issues.js +1 -1
- package/dist/effect/newsletters.js +1 -1
- package/dist/effect/operations.js +1 -1
- package/dist/effect/organizations.js +1 -1
- package/dist/effect/phone-numbers.d.ts +22 -0
- package/dist/effect/phone-numbers.js +21 -0
- package/dist/effect/policies.js +1 -1
- package/dist/effect/retry.js +3 -3
- package/dist/effect/scheduled-messages.d.ts +350 -350
- package/dist/effect/scheduled-messages.js +1 -1
- package/dist/effect/subscriptions.js +1 -1
- package/dist/effect/template-registrations.js +1 -1
- package/dist/effect/template-share-links.js +1 -1
- package/dist/effect/templates.d.ts +1 -0
- package/dist/effect/templates.js +2 -2
- package/dist/effect/topic-forms.js +1 -1
- package/dist/effect/topics.d.ts +70 -2
- package/dist/effect/topics.js +1 -1
- package/dist/effect/webhooks.js +2 -2
- package/dist/effect/whatsapp-flows.js +1 -1
- package/dist/effect/whatsapp-setup-links.js +1 -1
- package/dist/effect/whatsapp.d.ts +10 -0
- package/dist/effect/whatsapp.js +1 -1
- package/dist/effect/whoami.js +1 -1
- package/dist/index.js +2 -2
- package/dist/package.json.js +5 -0
- package/dist/promises/client.d.ts +3 -1
- package/dist/promises/client.js +7 -5
- package/dist/promises/errors.gen.d.ts +16 -2
- package/dist/promises/errors.gen.js +48 -11
- package/dist/promises/index.js +3 -3
- package/dist/promises/types.gen.d.ts +1 -1
- package/dist/request-policy.js +1 -1
- package/dist/service-map.d.ts +40 -5
- package/package.json +9 -5
- package/dist/package.js +0 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { forGroup } from "./internal/operation.js";
|
|
3
2
|
import { scheduledMessagesOperations } from "./descriptors/scheduled-messages.js";
|
|
4
3
|
import { ScheduledMessagesGroup } from "./generated/scheduled-messages.js";
|
|
4
|
+
import { forGroup } from "./internal/operation.js";
|
|
5
5
|
// src/effect/scheduled-messages.ts
|
|
6
6
|
var scheduled_messages_exports = /* @__PURE__ */ __exportAll({
|
|
7
7
|
cancel: () => cancel,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { forGroup } from "./internal/operation.js";
|
|
3
2
|
import { subscriptionsOperations } from "./descriptors/subscriptions.js";
|
|
4
3
|
import { SubscriptionsGroup } from "./generated/subscriptions.js";
|
|
4
|
+
import { forGroup } from "./internal/operation.js";
|
|
5
5
|
// src/effect/subscriptions.ts
|
|
6
6
|
var subscriptions_exports = /* @__PURE__ */ __exportAll({ subscribe: () => subscribe });
|
|
7
7
|
const subscribe = /* @__PURE__ */ (/* @__PURE__ */ forGroup(SubscriptionsGroup, subscriptionsOperations))("subscriptionsSubscribe");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { forGroup } from "./internal/operation.js";
|
|
3
2
|
import { templateRegistrationsOperations } from "./descriptors/template-registrations.js";
|
|
4
3
|
import { TemplateRegistrationsGroup } from "./generated/template-registrations.js";
|
|
4
|
+
import { forGroup } from "./internal/operation.js";
|
|
5
5
|
// src/effect/template-registrations.ts
|
|
6
6
|
var template_registrations_exports = /* @__PURE__ */ __exportAll({
|
|
7
7
|
get: () => get,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { forGroup } from "./internal/operation.js";
|
|
3
2
|
import { templateShareLinksOperations } from "./descriptors/template-share-links.js";
|
|
4
3
|
import { TemplateShareLinksGroup } from "./generated/template-share-links.js";
|
|
4
|
+
import { forGroup } from "./internal/operation.js";
|
|
5
5
|
// src/effect/template-share-links.ts
|
|
6
6
|
var template_share_links_exports = /* @__PURE__ */ __exportAll({
|
|
7
7
|
create: () => create,
|
|
@@ -221,6 +221,7 @@ export declare const addEntry: (input: {
|
|
|
221
221
|
readonly entryPath: string;
|
|
222
222
|
readonly name: string;
|
|
223
223
|
readonly slug: string;
|
|
224
|
+
readonly channel?: "email" | "whatsapp" | undefined;
|
|
224
225
|
readonly description?: string | null | undefined;
|
|
225
226
|
readonly category?: "alert" | "marketing" | "notification" | "reminder" | "support" | "transactional" | "verification" | null | undefined;
|
|
226
227
|
}, options?: import("./internal/operation.js").OperationOptions) => import("./internal/client.js").OperationResult<"templatesAddEntry">;
|
package/dist/effect/templates.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { CreateTemplatePayload, UpdateTemplatePayload } from "./generated/shared.js";
|
|
3
|
-
import { forGroup } from "./internal/operation.js";
|
|
4
2
|
import { templatesOperations } from "./descriptors/templates.js";
|
|
5
3
|
import { TemplatesGroup } from "./generated/templates.js";
|
|
4
|
+
import { forGroup } from "./internal/operation.js";
|
|
5
|
+
import { CreateTemplatePayload, UpdateTemplatePayload } from "./generated/shared.js";
|
|
6
6
|
// src/effect/templates.ts
|
|
7
7
|
var templates_exports = /* @__PURE__ */ __exportAll({
|
|
8
8
|
CreatePayload: () => CreateTemplatePayload,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { forGroup } from "./internal/operation.js";
|
|
3
2
|
import { topicFormsOperations } from "./descriptors/topic-forms.js";
|
|
4
3
|
import { TopicFormsGroup } from "./generated/topic-forms.js";
|
|
4
|
+
import { forGroup } from "./internal/operation.js";
|
|
5
5
|
// src/effect/topic-forms.ts
|
|
6
6
|
var topic_forms_exports = /* @__PURE__ */ __exportAll({
|
|
7
7
|
create: () => create,
|
package/dist/effect/topics.d.ts
CHANGED
|
@@ -1,6 +1,74 @@
|
|
|
1
|
-
export declare const list: (input?: {
|
|
1
|
+
export declare const list: ((input?: {
|
|
2
|
+
readonly limit?: number | null | undefined;
|
|
3
|
+
readonly cursor?: string | undefined;
|
|
2
4
|
readonly namespaceId?: string | undefined;
|
|
3
|
-
} | undefined, options?: import("./internal/operation.js").OperationOptions) => import("./internal/client.js").OperationResult<"topicsList"
|
|
5
|
+
} | undefined, options?: import("./internal/operation.js").OperationOptions) => import("./internal/client.js").OperationResult<"topicsList">) & {
|
|
6
|
+
readonly pages: (input?: {
|
|
7
|
+
readonly limit?: number | null | undefined;
|
|
8
|
+
readonly cursor?: string | undefined;
|
|
9
|
+
readonly namespaceId?: string | undefined;
|
|
10
|
+
} | undefined) => import("effect/Stream").Stream<{
|
|
11
|
+
readonly items: readonly {
|
|
12
|
+
readonly id: string & import("effect/Brand").Brand<"TopicId">;
|
|
13
|
+
readonly namespaceId: (string & import("effect/Brand").Brand<"NamespaceId">) | null;
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly description: string | null;
|
|
16
|
+
readonly default: "opt_in" | "opt_out";
|
|
17
|
+
readonly isDefault: boolean;
|
|
18
|
+
readonly defaultSenderId: (string & import("effect/Brand").Brand<"EmailSenderId">) | null;
|
|
19
|
+
readonly replyMailboxId: (string & import("effect/Brand").Brand<"MailboxId">) | null;
|
|
20
|
+
readonly templateId: (string & import("effect/Brand").Brand<"TemplateId">) | null;
|
|
21
|
+
readonly subscriptions: {
|
|
22
|
+
readonly sms: {
|
|
23
|
+
readonly subscribed: number;
|
|
24
|
+
readonly unsubscribed: number;
|
|
25
|
+
};
|
|
26
|
+
readonly whatsapp: {
|
|
27
|
+
readonly subscribed: number;
|
|
28
|
+
readonly unsubscribed: number;
|
|
29
|
+
};
|
|
30
|
+
readonly email: {
|
|
31
|
+
readonly subscribed: number;
|
|
32
|
+
readonly unsubscribed: number;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
readonly createdAt: string;
|
|
36
|
+
readonly updatedAt: string;
|
|
37
|
+
}[];
|
|
38
|
+
readonly nextCursor: string | null;
|
|
39
|
+
}, 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>;
|
|
40
|
+
readonly items: (input?: {
|
|
41
|
+
readonly limit?: number | null | undefined;
|
|
42
|
+
readonly cursor?: string | undefined;
|
|
43
|
+
readonly namespaceId?: string | undefined;
|
|
44
|
+
} | undefined) => import("effect/Stream").Stream<{
|
|
45
|
+
readonly id: string & import("effect/Brand").Brand<"TopicId">;
|
|
46
|
+
readonly namespaceId: (string & import("effect/Brand").Brand<"NamespaceId">) | null;
|
|
47
|
+
readonly name: string;
|
|
48
|
+
readonly description: string | null;
|
|
49
|
+
readonly default: "opt_in" | "opt_out";
|
|
50
|
+
readonly isDefault: boolean;
|
|
51
|
+
readonly defaultSenderId: (string & import("effect/Brand").Brand<"EmailSenderId">) | null;
|
|
52
|
+
readonly replyMailboxId: (string & import("effect/Brand").Brand<"MailboxId">) | null;
|
|
53
|
+
readonly templateId: (string & import("effect/Brand").Brand<"TemplateId">) | null;
|
|
54
|
+
readonly subscriptions: {
|
|
55
|
+
readonly sms: {
|
|
56
|
+
readonly subscribed: number;
|
|
57
|
+
readonly unsubscribed: number;
|
|
58
|
+
};
|
|
59
|
+
readonly whatsapp: {
|
|
60
|
+
readonly subscribed: number;
|
|
61
|
+
readonly unsubscribed: number;
|
|
62
|
+
};
|
|
63
|
+
readonly email: {
|
|
64
|
+
readonly subscribed: number;
|
|
65
|
+
readonly unsubscribed: number;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
readonly createdAt: string;
|
|
69
|
+
readonly updatedAt: string;
|
|
70
|
+
}, 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>;
|
|
71
|
+
};
|
|
4
72
|
export declare const create: (input: {
|
|
5
73
|
readonly name: string;
|
|
6
74
|
readonly description?: string | null | undefined;
|
package/dist/effect/topics.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { forGroup } from "./internal/operation.js";
|
|
3
2
|
import { topicsOperations } from "./descriptors/topics.js";
|
|
4
3
|
import { TopicsGroup } from "./generated/topics.js";
|
|
4
|
+
import { forGroup } from "./internal/operation.js";
|
|
5
5
|
// src/effect/topics.ts
|
|
6
6
|
var topics_exports = /* @__PURE__ */ __exportAll({
|
|
7
7
|
checkSubscription: () => checkSubscription,
|
package/dist/effect/webhooks.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { CreateWebhookPayload, TestWebhookPayload, UpdateWebhookPayload } from "./generated/shared.js";
|
|
3
|
-
import { forGroup } from "./internal/operation.js";
|
|
4
2
|
import { webhooksOperations } from "./descriptors/webhooks.js";
|
|
5
3
|
import { WebhooksGroup } from "./generated/webhooks.js";
|
|
4
|
+
import { forGroup } from "./internal/operation.js";
|
|
5
|
+
import { CreateWebhookPayload, TestWebhookPayload, UpdateWebhookPayload } from "./generated/shared.js";
|
|
6
6
|
// src/effect/webhooks.ts
|
|
7
7
|
var webhooks_exports = /* @__PURE__ */ __exportAll({
|
|
8
8
|
CreatePayload: () => CreateWebhookPayload,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { forGroup } from "./internal/operation.js";
|
|
3
2
|
import { whatsappFlowsOperations } from "./descriptors/whats-app-flows.js";
|
|
4
3
|
import { WhatsAppFlowsGroup } from "./generated/whats-app-flows.js";
|
|
4
|
+
import { forGroup } from "./internal/operation.js";
|
|
5
5
|
// src/effect/whatsapp-flows.ts
|
|
6
6
|
var whatsapp_flows_exports = /* @__PURE__ */ __exportAll({
|
|
7
7
|
create: () => create,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { forGroup } from "./internal/operation.js";
|
|
3
2
|
import { whatsappSetupLinksOperations } from "./descriptors/whats-app-setup-links.js";
|
|
4
3
|
import { WhatsAppSetupLinksGroup } from "./generated/whats-app-setup-links.js";
|
|
4
|
+
import { forGroup } from "./internal/operation.js";
|
|
5
5
|
// src/effect/whatsapp-setup-links.ts
|
|
6
6
|
var whatsapp_setup_links_exports = /* @__PURE__ */ __exportAll({
|
|
7
7
|
create: () => create,
|
|
@@ -38,11 +38,16 @@ export declare const listBusinessAccounts: ((input?: {
|
|
|
38
38
|
readonly organizationId: string;
|
|
39
39
|
readonly namespaceId: (string & import("effect/Brand").Brand<"NamespaceId">) | null;
|
|
40
40
|
readonly phoneNumber: string;
|
|
41
|
+
readonly phoneNumberDisplay: string;
|
|
41
42
|
readonly phoneNumberId: string;
|
|
42
43
|
readonly displayName: string;
|
|
43
44
|
readonly whatsappBusinessAccountId: string;
|
|
44
45
|
readonly verificationStatus: "failed" | "pending" | "suspended" | "verified";
|
|
45
46
|
readonly credentialStatus: "active" | "reconnect_required";
|
|
47
|
+
readonly sendingLock: {
|
|
48
|
+
readonly lockedAt: string;
|
|
49
|
+
readonly reason: string;
|
|
50
|
+
} | null;
|
|
46
51
|
readonly tokenExpiresAt: string | null;
|
|
47
52
|
readonly isDefault: boolean;
|
|
48
53
|
readonly webhookUrl: string | null;
|
|
@@ -73,11 +78,16 @@ export declare const listBusinessAccounts: ((input?: {
|
|
|
73
78
|
readonly organizationId: string;
|
|
74
79
|
readonly namespaceId: (string & import("effect/Brand").Brand<"NamespaceId">) | null;
|
|
75
80
|
readonly phoneNumber: string;
|
|
81
|
+
readonly phoneNumberDisplay: string;
|
|
76
82
|
readonly phoneNumberId: string;
|
|
77
83
|
readonly displayName: string;
|
|
78
84
|
readonly whatsappBusinessAccountId: string;
|
|
79
85
|
readonly verificationStatus: "failed" | "pending" | "suspended" | "verified";
|
|
80
86
|
readonly credentialStatus: "active" | "reconnect_required";
|
|
87
|
+
readonly sendingLock: {
|
|
88
|
+
readonly lockedAt: string;
|
|
89
|
+
readonly reason: string;
|
|
90
|
+
} | null;
|
|
81
91
|
readonly tokenExpiresAt: string | null;
|
|
82
92
|
readonly isDefault: boolean;
|
|
83
93
|
readonly webhookUrl: string | null;
|
package/dist/effect/whatsapp.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { forGroup } from "./internal/operation.js";
|
|
3
2
|
import { whatsappOperations } from "./descriptors/whats-app.js";
|
|
4
3
|
import { WhatsAppGroup } from "./generated/whats-app.js";
|
|
4
|
+
import { forGroup } from "./internal/operation.js";
|
|
5
5
|
// src/effect/whatsapp.ts
|
|
6
6
|
var whatsapp_exports = /* @__PURE__ */ __exportAll({
|
|
7
7
|
connectBusinessAccount: () => connectBusinessAccount,
|
package/dist/effect/whoami.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { forGroup } from "./internal/operation.js";
|
|
3
2
|
import { whoamiOperations } from "./descriptors/whoami.js";
|
|
4
3
|
import { WhoamiGroup } from "./generated/whoami.js";
|
|
4
|
+
import { forGroup } from "./internal/operation.js";
|
|
5
5
|
// src/effect/whoami.ts
|
|
6
6
|
var whoami_exports = /* @__PURE__ */ __exportAll({ get: () => get });
|
|
7
7
|
const get = /* @__PURE__ */ (/* @__PURE__ */ forGroup(WhoamiGroup, whoamiOperations))("whoamiGet");
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
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 "./promises/errors.gen.js";
|
|
1
|
+
import { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, CredentialsError, DeliveryUnavailableError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, MailboxSendConflictError, MailboxSendRefusedError, MalformedRequestError, OnboardingReviewRequiredError, PaymentRequiredError, PhoneNumberProvisioningError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTimeoutError, SamvaTransportError, SenderNotReadyError, ServiceUnavailableError, ShareLinkUnavailable, SlugTaken, TemplateInUseError, TemplateSourceError, UnauthorizedError, ValidationError, WhatsAppChannelError, WhatsAppServiceWindowClosedError, WhatsAppSetupLinkUnavailableError, fromApiError } from "./promises/errors.gen.js";
|
|
2
2
|
import { MediaUploadError } from "./inline-attachments.js";
|
|
3
3
|
import { MailboxEventStream, MailboxEventStreamError } from "./mailbox-events.js";
|
|
4
4
|
import { createClient } from "./promises/client.js";
|
|
5
|
-
export { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, CredentialsError, DeliveryUnavailableError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, MailboxEventStream, MailboxEventStreamError, MailboxSendConflictError, MailboxSendRefusedError, MalformedRequestError, MediaUploadError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTimeoutError, SamvaTransportError, SenderNotReadyError, ServiceUnavailableError, ShareLinkUnavailable, SlugTaken, TemplateInUseError, TemplateSourceError, UnauthorizedError, ValidationError, WhatsAppChannelError, WhatsAppServiceWindowClosedError, WhatsAppSetupLinkUnavailableError, createClient, fromApiError };
|
|
5
|
+
export { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, CredentialsError, DeliveryUnavailableError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, MailboxEventStream, MailboxEventStreamError, MailboxSendConflictError, MailboxSendRefusedError, MalformedRequestError, MediaUploadError, OnboardingReviewRequiredError, PaymentRequiredError, PhoneNumberProvisioningError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTimeoutError, SamvaTransportError, SenderNotReadyError, ServiceUnavailableError, ShareLinkUnavailable, SlugTaken, TemplateInUseError, TemplateSourceError, UnauthorizedError, ValidationError, WhatsAppChannelError, WhatsAppServiceWindowClosedError, WhatsAppSetupLinkUnavailableError, createClient, fromApiError };
|
|
@@ -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, 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";
|
|
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, PhoneNumbers as phoneNumbers, 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";
|
|
@@ -137,6 +137,7 @@ export interface SamvaRawClient {
|
|
|
137
137
|
readonly messages: typeof messages;
|
|
138
138
|
readonly scheduledMessages: typeof scheduledMessages;
|
|
139
139
|
readonly brands: typeof brands;
|
|
140
|
+
readonly phoneNumbers: typeof phoneNumbers;
|
|
140
141
|
readonly whatsapp: typeof whatsapp;
|
|
141
142
|
readonly whatsappFlows: typeof whatsappFlows;
|
|
142
143
|
readonly whatsappSetupLinks: typeof whatsappSetupLinks;
|
|
@@ -189,6 +190,7 @@ export interface SamvaClient {
|
|
|
189
190
|
readonly messages: DirectService<PromiseMessagesTransport>;
|
|
190
191
|
readonly scheduledMessages: DirectService<typeof scheduledMessages>;
|
|
191
192
|
readonly brands: DirectService<typeof brands>;
|
|
193
|
+
readonly phoneNumbers: DirectService<typeof phoneNumbers>;
|
|
192
194
|
readonly whatsapp: DirectService<typeof whatsapp>;
|
|
193
195
|
readonly whatsappFlows: DirectService<typeof whatsappFlows>;
|
|
194
196
|
readonly whatsappSetupLinks: DirectService<typeof whatsappSetupLinks>;
|
package/dist/promises/client.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { CLIENT_ATTRIBUTION_HEADER, clientAttribution } from "../client-attribution.js";
|
|
2
|
-
import { mergeHeaders } from "../client/client/utils.gen.js";
|
|
3
2
|
import { createClient as createClient$1 } from "../client/client/client.gen.js";
|
|
3
|
+
import { mergeHeaders } from "../client/client/utils.gen.js";
|
|
4
|
+
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, PhoneNumbers, Policies, ScheduledMessages, Subscriptions, TemplateRegistrations, TemplateShareLinks, Templates, TopicForms, Topics, Webhooks, Whatsapp, WhatsappFlows, WhatsappSetupLinks, Whoami } from "../client/sdk.gen.js";
|
|
4
5
|
import { SamvaOperations } from "../effect/generated-metadata.js";
|
|
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
|
-
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, 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
6
|
import { MediaUploadError, mediaCreateBody, planInlineUploads, withUploadedAttachments } from "../inline-attachments.js";
|
|
9
7
|
import { MailboxEventStream } from "../mailbox-events.js";
|
|
10
8
|
import { buildEmailSendPayload, buildMessagesSendPayload, replyToEmailsPayload } from "../normalize.js";
|
|
9
|
+
import { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, CredentialsError, DeliveryUnavailableError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, MailboxSendConflictError, MailboxSendRefusedError, MalformedRequestError, OnboardingReviewRequiredError, PaymentRequiredError, PhoneNumberProvisioningError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTimeoutError, SamvaTransportError, SenderNotReadyError, ServiceUnavailableError, ShareLinkUnavailable, SlugTaken, TemplateInUseError, TemplateSourceError, UnauthorizedError, ValidationError, WhatsAppChannelError, WhatsAppServiceWindowClosedError, WhatsAppSetupLinkUnavailableError, fromApiError } from "./errors.gen.js";
|
|
10
|
+
import { configureRequests, startAttempt, uploadTimeout } from "./request.js";
|
|
11
11
|
// src/promises/client.ts
|
|
12
12
|
/**
|
|
13
13
|
* Samva SDK - TypeScript client for the Samva API.
|
|
@@ -253,6 +253,7 @@ function makeClient(config) {
|
|
|
253
253
|
messages: createBoundService(Messages, clientInstance),
|
|
254
254
|
scheduledMessages: createBoundService(ScheduledMessages, clientInstance),
|
|
255
255
|
brands: createBoundService(Brands, clientInstance),
|
|
256
|
+
phoneNumbers: createBoundService(PhoneNumbers, clientInstance),
|
|
256
257
|
whatsapp: createBoundService(Whatsapp, clientInstance),
|
|
257
258
|
whatsappFlows: createBoundService(WhatsappFlows, clientInstance),
|
|
258
259
|
whatsappSetupLinks: createBoundService(WhatsappSetupLinks, clientInstance),
|
|
@@ -303,6 +304,7 @@ function makeClient(config) {
|
|
|
303
304
|
messages: createDirectService(promiseMessages),
|
|
304
305
|
scheduledMessages: createDirectService(raw.scheduledMessages),
|
|
305
306
|
brands: createDirectService(raw.brands),
|
|
307
|
+
phoneNumbers: createDirectService(raw.phoneNumbers),
|
|
306
308
|
whatsapp: createDirectService(raw.whatsapp),
|
|
307
309
|
whatsappFlows: createDirectService(raw.whatsappFlows),
|
|
308
310
|
whatsappSetupLinks: createDirectService(raw.whatsappSetupLinks),
|
|
@@ -345,6 +347,6 @@ function makeClient(config) {
|
|
|
345
347
|
}));
|
|
346
348
|
return result;
|
|
347
349
|
}
|
|
348
|
-
export { 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, clientWithIdempotency, createBoundClient, createClient, fromApiError };
|
|
350
|
+
export { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, CredentialsError, DeliveryUnavailableError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, MailboxSendConflictError, MailboxSendRefusedError, MalformedRequestError, OnboardingReviewRequiredError, PaymentRequiredError, PhoneNumberProvisioningError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTimeoutError, SamvaTransportError, SenderNotReadyError, ServiceUnavailableError, ShareLinkUnavailable, SlugTaken, TemplateInUseError, TemplateSourceError, UnauthorizedError, ValidationError, WhatsAppChannelError, WhatsAppServiceWindowClosedError, WhatsAppSetupLinkUnavailableError, clientWithIdempotency, createBoundClient, createClient, fromApiError };
|
|
349
351
|
|
|
350
352
|
//# sourceMappingURL=client.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as Wire from "../client/types.gen.js";
|
|
2
|
-
export type SamvaApiErrorTag = "AnalyticsQueryError" | "BillingProviderError" | "BrandAddressRequiredError" | "CampaignFooterRequiredError" | "ConflictError" | "CredentialsError" | "DeliveryUnavailableError" | "EmailChannelError" | "ExternalServiceError" | "FlagDisabledError" | "ForbiddenError" | "FromAddressRequiredError" | "GatewayTimeoutError" | "InternalError" | "MailboxSendConflictError" | "MailboxSendRefusedError" | "MalformedRequestError" | "OnboardingReviewRequiredError" | "PaymentRequiredError" | "RateLimitedError" | "ResourceNotFoundError" | "SenderNotReadyError" | "ServiceUnavailableError" | "ShareLinkUnavailable" | "SlugTaken" | "TemplateInUseError" | "TemplateSourceError" | "UnauthorizedError" | "ValidationError" | "WhatsAppChannelError" | "WhatsAppServiceWindowClosedError" | "WhatsAppSetupLinkUnavailableError";
|
|
2
|
+
export type SamvaApiErrorTag = "AnalyticsQueryError" | "BillingProviderError" | "BrandAddressRequiredError" | "CampaignFooterRequiredError" | "ConflictError" | "CredentialsError" | "DeliveryUnavailableError" | "EmailChannelError" | "ExternalServiceError" | "FlagDisabledError" | "ForbiddenError" | "FromAddressRequiredError" | "GatewayTimeoutError" | "InternalError" | "MailboxSendConflictError" | "MailboxSendRefusedError" | "MalformedRequestError" | "OnboardingReviewRequiredError" | "PaymentRequiredError" | "PhoneNumberProvisioningError" | "RateLimitedError" | "ResourceNotFoundError" | "SenderNotReadyError" | "ServiceUnavailableError" | "ShareLinkUnavailable" | "SlugTaken" | "TemplateInUseError" | "TemplateSourceError" | "UnauthorizedError" | "ValidationError" | "WhatsAppChannelError" | "WhatsAppServiceWindowClosedError" | "WhatsAppSetupLinkUnavailableError";
|
|
3
3
|
export interface SamvaApiErrorContext {
|
|
4
4
|
readonly request?: Request | undefined;
|
|
5
5
|
readonly response?: Response | undefined;
|
|
@@ -232,6 +232,20 @@ export declare class PaymentRequiredError extends SamvaApiError<"PaymentRequired
|
|
|
232
232
|
readonly "resource": string;
|
|
233
233
|
constructor(payload: Omit<PaymentRequiredErrorPayload, "_tag">, context?: SamvaApiErrorContext);
|
|
234
234
|
}
|
|
235
|
+
type PhoneNumberProvisioningErrorPayload = {
|
|
236
|
+
readonly _tag: "PhoneNumberProvisioningError";
|
|
237
|
+
readonly message: string;
|
|
238
|
+
readonly providerCode?: string | null;
|
|
239
|
+
readonly reason: "transport" | "rejected" | "rate_limited" | "auth";
|
|
240
|
+
readonly statusCode?: number | null;
|
|
241
|
+
};
|
|
242
|
+
export declare class PhoneNumberProvisioningError extends SamvaApiError<"PhoneNumberProvisioningError"> {
|
|
243
|
+
readonly _tag: "PhoneNumberProvisioningError";
|
|
244
|
+
readonly "providerCode"?: string | null;
|
|
245
|
+
readonly "reason": "transport" | "rejected" | "rate_limited" | "auth";
|
|
246
|
+
readonly "statusCode"?: number | null;
|
|
247
|
+
constructor(payload: Omit<PhoneNumberProvisioningErrorPayload, "_tag">, context?: SamvaApiErrorContext);
|
|
248
|
+
}
|
|
235
249
|
type RateLimitedErrorPayload = {
|
|
236
250
|
readonly _tag: "RateLimitedError";
|
|
237
251
|
readonly message: string;
|
|
@@ -422,7 +436,7 @@ export declare class WhatsAppSetupLinkUnavailableError extends SamvaApiError<"Wh
|
|
|
422
436
|
readonly "reason": "completed" | "revoked" | "expired";
|
|
423
437
|
constructor(payload: Omit<WhatsAppSetupLinkUnavailableErrorPayload, "_tag">, context?: SamvaApiErrorContext);
|
|
424
438
|
}
|
|
425
|
-
export type AnySamvaApiError = AnalyticsQueryError | BillingProviderError | BrandAddressRequiredError | CampaignFooterRequiredError | ConflictError | CredentialsError | DeliveryUnavailableError | EmailChannelError | ExternalServiceError | FlagDisabledError | ForbiddenError | FromAddressRequiredError | GatewayTimeoutError | InternalError | MailboxSendConflictError | MailboxSendRefusedError | MalformedRequestError | OnboardingReviewRequiredError | PaymentRequiredError | RateLimitedError | ResourceNotFoundError | SenderNotReadyError | ServiceUnavailableError | ShareLinkUnavailable | SlugTaken | TemplateInUseError | TemplateSourceError | UnauthorizedError | ValidationError | WhatsAppChannelError | WhatsAppServiceWindowClosedError | WhatsAppSetupLinkUnavailableError;
|
|
439
|
+
export type AnySamvaApiError = AnalyticsQueryError | BillingProviderError | BrandAddressRequiredError | CampaignFooterRequiredError | ConflictError | CredentialsError | DeliveryUnavailableError | EmailChannelError | ExternalServiceError | FlagDisabledError | ForbiddenError | FromAddressRequiredError | GatewayTimeoutError | InternalError | MailboxSendConflictError | MailboxSendRefusedError | MalformedRequestError | OnboardingReviewRequiredError | PaymentRequiredError | PhoneNumberProvisioningError | RateLimitedError | ResourceNotFoundError | SenderNotReadyError | ServiceUnavailableError | ShareLinkUnavailable | SlugTaken | TemplateInUseError | TemplateSourceError | UnauthorizedError | ValidationError | WhatsAppChannelError | WhatsAppServiceWindowClosedError | WhatsAppSetupLinkUnavailableError;
|
|
426
440
|
/** Convert a decoded error payload into its generated JavaScript error class. */
|
|
427
441
|
export declare function fromApiError(error: unknown, context?: SamvaApiErrorContext): AnySamvaApiError | SamvaTransportError;
|
|
428
442
|
export {};
|
|
@@ -244,6 +244,16 @@ var PaymentRequiredError = class extends SamvaApiError {
|
|
|
244
244
|
});
|
|
245
245
|
}
|
|
246
246
|
};
|
|
247
|
+
var PhoneNumberProvisioningError = class extends SamvaApiError {
|
|
248
|
+
_tag = "PhoneNumberProvisioningError";
|
|
249
|
+
constructor(payload, context = {}) {
|
|
250
|
+
super(messageOf("PhoneNumberProvisioningError", payload), context);
|
|
251
|
+
Object.assign(this, payload, {
|
|
252
|
+
message: this.message,
|
|
253
|
+
requestId: this.requestId
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
};
|
|
247
257
|
var RateLimitedError = class extends SamvaApiError {
|
|
248
258
|
_tag = "RateLimitedError";
|
|
249
259
|
constructor(payload, context = {}) {
|
|
@@ -394,6 +404,7 @@ const constructors = {
|
|
|
394
404
|
MalformedRequestError,
|
|
395
405
|
OnboardingReviewRequiredError,
|
|
396
406
|
PaymentRequiredError,
|
|
407
|
+
PhoneNumberProvisioningError,
|
|
397
408
|
RateLimitedError,
|
|
398
409
|
ResourceNotFoundError,
|
|
399
410
|
SenderNotReadyError,
|
|
@@ -970,7 +981,7 @@ const payloadSchemas = {
|
|
|
970
981
|
},
|
|
971
982
|
reviewRound: {
|
|
972
983
|
type: "integer",
|
|
973
|
-
maximum:
|
|
984
|
+
maximum: 0x1fffffffffffff,
|
|
974
985
|
exclusiveMinimum: 0
|
|
975
986
|
},
|
|
976
987
|
requirement: {
|
|
@@ -1054,7 +1065,7 @@ const payloadSchemas = {
|
|
|
1054
1065
|
index: {
|
|
1055
1066
|
type: "integer",
|
|
1056
1067
|
minimum: 0,
|
|
1057
|
-
maximum:
|
|
1068
|
+
maximum: 0x1fffffffffffff
|
|
1058
1069
|
}
|
|
1059
1070
|
},
|
|
1060
1071
|
required: ["scope", "index"],
|
|
@@ -1439,7 +1450,7 @@ const payloadSchemas = {
|
|
|
1439
1450
|
},
|
|
1440
1451
|
reviewRound: {
|
|
1441
1452
|
type: "integer",
|
|
1442
|
-
maximum:
|
|
1453
|
+
maximum: 0x1fffffffffffff,
|
|
1443
1454
|
exclusiveMinimum: 0
|
|
1444
1455
|
},
|
|
1445
1456
|
requirement: {
|
|
@@ -1523,7 +1534,7 @@ const payloadSchemas = {
|
|
|
1523
1534
|
index: {
|
|
1524
1535
|
type: "integer",
|
|
1525
1536
|
minimum: 0,
|
|
1526
|
-
maximum:
|
|
1537
|
+
maximum: 0x1fffffffffffff
|
|
1527
1538
|
}
|
|
1528
1539
|
},
|
|
1529
1540
|
required: ["scope", "index"],
|
|
@@ -1740,6 +1751,33 @@ const payloadSchemas = {
|
|
|
1740
1751
|
"x-category": ["billing"],
|
|
1741
1752
|
"x-retryable": false
|
|
1742
1753
|
},
|
|
1754
|
+
PhoneNumberProvisioningError: {
|
|
1755
|
+
type: "object",
|
|
1756
|
+
properties: {
|
|
1757
|
+
_tag: {
|
|
1758
|
+
type: "string",
|
|
1759
|
+
enum: ["PhoneNumberProvisioningError"]
|
|
1760
|
+
},
|
|
1761
|
+
reason: {
|
|
1762
|
+
type: "string",
|
|
1763
|
+
enum: [
|
|
1764
|
+
"transport",
|
|
1765
|
+
"rejected",
|
|
1766
|
+
"rate_limited",
|
|
1767
|
+
"auth"
|
|
1768
|
+
]
|
|
1769
|
+
},
|
|
1770
|
+
message: { type: "string" },
|
|
1771
|
+
providerCode: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
1772
|
+
statusCode: { anyOf: [{ type: "number" }, { type: "null" }] }
|
|
1773
|
+
},
|
|
1774
|
+
required: [
|
|
1775
|
+
"_tag",
|
|
1776
|
+
"reason",
|
|
1777
|
+
"message"
|
|
1778
|
+
],
|
|
1779
|
+
additionalProperties: false
|
|
1780
|
+
},
|
|
1743
1781
|
RateLimitedError: {
|
|
1744
1782
|
type: "object",
|
|
1745
1783
|
properties: {
|
|
@@ -1918,12 +1956,12 @@ const payloadSchemas = {
|
|
|
1918
1956
|
lineNumber: {
|
|
1919
1957
|
type: "integer",
|
|
1920
1958
|
minimum: 1,
|
|
1921
|
-
maximum:
|
|
1959
|
+
maximum: 0x1fffffffffffff
|
|
1922
1960
|
},
|
|
1923
1961
|
columnNumber: {
|
|
1924
1962
|
type: "integer",
|
|
1925
1963
|
minimum: 1,
|
|
1926
|
-
maximum:
|
|
1964
|
+
maximum: 0x1fffffffffffff
|
|
1927
1965
|
}
|
|
1928
1966
|
},
|
|
1929
1967
|
required: [
|
|
@@ -1955,12 +1993,12 @@ const payloadSchemas = {
|
|
|
1955
1993
|
lineNumber: {
|
|
1956
1994
|
type: "integer",
|
|
1957
1995
|
minimum: 1,
|
|
1958
|
-
maximum:
|
|
1996
|
+
maximum: 0x1fffffffffffff
|
|
1959
1997
|
},
|
|
1960
1998
|
columnNumber: {
|
|
1961
1999
|
type: "integer",
|
|
1962
2000
|
minimum: 1,
|
|
1963
|
-
maximum:
|
|
2001
|
+
maximum: 0x1fffffffffffff
|
|
1964
2002
|
}
|
|
1965
2003
|
},
|
|
1966
2004
|
required: [
|
|
@@ -2182,8 +2220,7 @@ function fromApiError(error, context = {}) {
|
|
|
2182
2220
|
if (isRecord(error) && typeof error._tag === "string" && Object.hasOwn(constructors, error._tag)) {
|
|
2183
2221
|
const tag = error._tag;
|
|
2184
2222
|
if (!matchesSchema(error, payloadSchemas[tag])) return new SamvaTransportError(error, context);
|
|
2185
|
-
|
|
2186
|
-
return new Constructor(error, context);
|
|
2223
|
+
return new constructors[tag](error, context);
|
|
2187
2224
|
}
|
|
2188
2225
|
if (context.response?.status === 504) {
|
|
2189
2226
|
const retryAfter = Number(context.response.headers.get("retry-after"));
|
|
@@ -2194,6 +2231,6 @@ function fromApiError(error, context = {}) {
|
|
|
2194
2231
|
}
|
|
2195
2232
|
return new SamvaTransportError(error, context);
|
|
2196
2233
|
}
|
|
2197
|
-
export { 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 };
|
|
2234
|
+
export { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, CredentialsError, DeliveryUnavailableError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, MailboxSendConflictError, MailboxSendRefusedError, MalformedRequestError, OnboardingReviewRequiredError, PaymentRequiredError, PhoneNumberProvisioningError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTimeoutError, SamvaTransportError, SenderNotReadyError, ServiceUnavailableError, ShareLinkUnavailable, SlugTaken, TemplateInUseError, TemplateSourceError, UnauthorizedError, ValidationError, WhatsAppChannelError, WhatsAppServiceWindowClosedError, WhatsAppSetupLinkUnavailableError, fromApiError };
|
|
2198
2235
|
|
|
2199
2236
|
//# sourceMappingURL=errors.gen.js.map
|
package/dist/promises/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createClient } from "./client.js";
|
|
2
|
+
import { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, CredentialsError, DeliveryUnavailableError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, MailboxSendConflictError, MailboxSendRefusedError, MalformedRequestError, OnboardingReviewRequiredError, PaymentRequiredError, PhoneNumberProvisioningError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTimeoutError, SamvaTransportError, SenderNotReadyError, ServiceUnavailableError, ShareLinkUnavailable, SlugTaken, TemplateInUseError, TemplateSourceError, UnauthorizedError, ValidationError, WhatsAppChannelError, WhatsAppServiceWindowClosedError, WhatsAppSetupLinkUnavailableError, fromApiError } from "./errors.gen.js";
|
|
2
3
|
import { MediaUploadError } from "../inline-attachments.js";
|
|
3
4
|
import { MailboxEventStream, MailboxEventStreamError } from "../mailbox-events.js";
|
|
4
|
-
|
|
5
|
-
export { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, CredentialsError, DeliveryUnavailableError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, MailboxEventStream, MailboxEventStreamError, MailboxSendConflictError, MailboxSendRefusedError, MalformedRequestError, MediaUploadError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTimeoutError, SamvaTransportError, SenderNotReadyError, ServiceUnavailableError, ShareLinkUnavailable, SlugTaken, TemplateInUseError, TemplateSourceError, UnauthorizedError, ValidationError, WhatsAppChannelError, WhatsAppServiceWindowClosedError, WhatsAppSetupLinkUnavailableError, createClient, fromApiError };
|
|
5
|
+
export { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, CredentialsError, DeliveryUnavailableError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, MailboxEventStream, MailboxEventStreamError, MailboxSendConflictError, MailboxSendRefusedError, MalformedRequestError, MediaUploadError, OnboardingReviewRequiredError, PaymentRequiredError, PhoneNumberProvisioningError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTimeoutError, SamvaTransportError, SenderNotReadyError, ServiceUnavailableError, ShareLinkUnavailable, SlugTaken, TemplateInUseError, TemplateSourceError, UnauthorizedError, ValidationError, WhatsAppChannelError, WhatsAppServiceWindowClosedError, WhatsAppSetupLinkUnavailableError, createClient, fromApiError };
|