samva 0.33.0 → 0.35.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/README.md +1 -1
- package/dist/client/sdk.gen.d.ts +225 -251
- package/dist/client/sdk.gen.js +85 -211
- package/dist/client/types.gen.d.ts +2897 -403
- package/dist/effect/agents.d.ts +28 -13
- package/dist/effect/agents.js +5 -1
- package/dist/effect/analytics.d.ts +15 -15
- package/dist/effect/api-keys.d.ts +27 -18
- package/dist/effect/campaigns.d.ts +721 -65
- package/dist/effect/categories.d.ts +3 -3
- package/dist/effect/contact-groups.d.ts +15 -15
- package/dist/effect/contacts.d.ts +56 -52
- package/dist/effect/conversations.d.ts +45 -45
- package/dist/effect/email.d.ts +82 -82
- package/dist/effect/errors.d.ts +1 -1
- package/dist/effect/errors.js +2 -2
- package/dist/effect/extension-installations.d.ts +11 -11
- package/dist/effect/extensions.d.ts +16 -16
- package/dist/effect/generated/agents.d.ts +1063 -33
- package/dist/effect/generated/agents.js +133 -11
- package/dist/effect/generated/analytics.d.ts +109 -136
- package/dist/effect/generated/analytics.js +65 -36
- package/dist/effect/generated/api-keys.d.ts +240 -19
- package/dist/effect/generated/api-keys.js +24 -8
- package/dist/effect/generated/attachments.d.ts +89 -1
- package/dist/effect/generated/attachments.js +10 -2
- package/dist/effect/generated/brands.d.ts +133 -1
- package/dist/effect/generated/brands.js +22 -10
- package/dist/effect/generated/campaigns.d.ts +1442 -140
- package/dist/effect/generated/campaigns.js +82 -20
- package/dist/effect/generated/contact-events.d.ts +26 -4
- package/dist/effect/generated/contact-events.js +5 -3
- package/dist/effect/generated/contact-groups.d.ts +233 -13
- package/dist/effect/generated/contact-groups.js +33 -17
- package/dist/effect/generated/contacts.d.ts +634 -96
- package/dist/effect/generated/contacts.js +82 -20
- package/dist/effect/generated/conversations.d.ts +398 -106
- package/dist/effect/generated/conversations.js +96 -22
- package/dist/effect/generated/custom-fields.d.ts +89 -1
- package/dist/effect/generated/custom-fields.js +11 -3
- package/dist/effect/generated/email.d.ts +1447 -83
- package/dist/effect/generated/email.js +167 -43
- package/dist/effect/generated/events.d.ts +51 -7
- package/dist/effect/generated/events.js +9 -5
- package/dist/effect/generated/extension-installations.d.ts +208 -10
- package/dist/effect/generated/extension-installations.js +26 -8
- package/dist/effect/generated/extensions.d.ts +123 -13
- package/dist/effect/generated/extensions.js +20 -10
- package/dist/effect/generated/feedback.d.ts +23 -1
- package/dist/effect/generated/feedback.js +6 -4
- package/dist/effect/generated/journeys.d.ts +684 -16
- package/dist/effect/generated/journeys.js +37 -9
- package/dist/effect/generated/mailboxes.d.ts +3085 -627
- package/dist/effect/generated/mailboxes.js +340 -141
- package/dist/effect/generated/media.d.ts +125 -15
- package/dist/effect/generated/media.js +15 -2
- package/dist/effect/generated/messages.d.ts +2036 -117
- package/dist/effect/generated/messages.js +286 -54
- package/dist/effect/generated/namespaces.d.ts +209 -25
- package/dist/effect/generated/namespaces.js +27 -9
- package/dist/effect/generated/newsletter-domains.d.ts +98 -12
- package/dist/effect/generated/newsletter-domains.js +20 -13
- package/dist/effect/generated/newsletter-issues.d.ts +354 -19
- package/dist/effect/generated/newsletter-issues.js +162 -98
- package/dist/effect/generated/newsletters.d.ts +123 -13
- package/dist/effect/generated/newsletters.js +19 -9
- package/dist/effect/generated/operations.d.ts +76 -10
- package/dist/effect/generated/operations.js +12 -6
- package/dist/effect/generated/organizations.d.ts +287 -7
- package/dist/effect/generated/organizations.js +33 -5
- package/dist/effect/generated/scheduled-messages.d.ts +4427 -99
- package/dist/effect/generated/scheduled-messages.js +71 -12
- package/dist/effect/generated/shared.d.ts +2213 -190
- package/dist/effect/generated/shared.js +527 -76
- package/dist/effect/generated/subscriptions.d.ts +23 -1
- package/dist/effect/generated/subscriptions.js +6 -4
- package/dist/effect/generated/templates.d.ts +1718 -136
- package/dist/effect/generated/templates.js +421 -226
- package/dist/effect/generated/topic-forms.d.ts +111 -1
- package/dist/effect/generated/topic-forms.js +23 -13
- package/dist/effect/generated/topics.d.ts +353 -43
- package/dist/effect/generated/topics.js +67 -19
- package/dist/effect/generated/webhooks.d.ts +308 -46
- package/dist/effect/generated/webhooks.js +67 -19
- package/dist/effect/generated/whoami.d.ts +35 -1
- package/dist/effect/generated/whoami.js +4 -2
- package/dist/effect/generated-metadata.d.ts +20 -0
- package/dist/effect/generated-metadata.js +10 -0
- package/dist/effect/index.js +2 -2
- package/dist/effect/internal/client.js +1 -1
- package/dist/effect/internal/email-sender.d.ts +1 -1
- package/dist/effect/internal/send.d.ts +1 -1
- package/dist/effect/journeys.d.ts +105 -19
- package/dist/effect/mailboxes.d.ts +405 -174
- package/dist/effect/media.d.ts +1 -1
- package/dist/effect/messages.d.ts +40 -40
- package/dist/effect/namespaces.d.ts +15 -15
- package/dist/effect/newsletter-domains.d.ts +5 -5
- package/dist/effect/newsletters.d.ts +1 -1
- package/dist/effect/operations.d.ts +11 -11
- package/dist/effect/organizations.d.ts +2 -2
- package/dist/effect/scheduled-messages.d.ts +863 -8
- package/dist/effect/templates.d.ts +37 -37
- package/dist/effect/topics.d.ts +21 -21
- package/dist/effect/webhooks.d.ts +28 -26
- package/dist/index.js +2 -2
- package/dist/normalize.js +13 -1
- package/dist/package.js +1 -1
- package/dist/promises/client.d.ts +1 -1
- package/dist/promises/client.js +2 -2
- package/dist/promises/errors.gen.d.ts +22 -2
- package/dist/promises/errors.gen.js +60 -2
- package/dist/promises/index.js +2 -2
- package/dist/promises/types.gen.d.ts +1 -1
- package/dist/service-map.d.ts +9 -0
- package/dist/service-map.js +5 -0
- package/package.json +9 -8
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
export { CreateTemplatePayload as CreatePayload, UpdateTemplatePayload as UpdatePayload, } from "./generated/shared";
|
|
2
2
|
export declare const list: ((input?: {
|
|
3
3
|
readonly limit?: number | null | undefined;
|
|
4
|
-
readonly cursor?: string |
|
|
5
|
-
readonly category?: "alert" | "marketing" | "notification" | "reminder" | "support" | "transactional" | "verification" |
|
|
6
|
-
readonly channel?: "email" |
|
|
7
|
-
readonly status?: "approved" | "archived" | "draft" | "pending" | "published" | "rejected" |
|
|
8
|
-
readonly search?: string |
|
|
9
|
-
readonly projectId?: string |
|
|
10
|
-
readonly namespaceId?: string |
|
|
4
|
+
readonly cursor?: string | undefined;
|
|
5
|
+
readonly category?: "alert" | "marketing" | "notification" | "reminder" | "support" | "transactional" | "verification" | undefined;
|
|
6
|
+
readonly channel?: "email" | "sms" | "whatsapp" | undefined;
|
|
7
|
+
readonly status?: "approved" | "archived" | "draft" | "pending" | "published" | "rejected" | undefined;
|
|
8
|
+
readonly search?: string | undefined;
|
|
9
|
+
readonly projectId?: string | undefined;
|
|
10
|
+
readonly namespaceId?: string | undefined;
|
|
11
11
|
readonly shared?: boolean | null | undefined;
|
|
12
12
|
} | undefined, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesList">) & {
|
|
13
13
|
readonly pages: (input?: {
|
|
14
14
|
readonly limit?: number | null | undefined;
|
|
15
|
-
readonly cursor?: string |
|
|
16
|
-
readonly category?: "alert" | "marketing" | "notification" | "reminder" | "support" | "transactional" | "verification" |
|
|
17
|
-
readonly channel?: "email" |
|
|
18
|
-
readonly status?: "approved" | "archived" | "draft" | "pending" | "published" | "rejected" |
|
|
19
|
-
readonly search?: string |
|
|
20
|
-
readonly projectId?: string |
|
|
21
|
-
readonly namespaceId?: string |
|
|
15
|
+
readonly cursor?: string | undefined;
|
|
16
|
+
readonly category?: "alert" | "marketing" | "notification" | "reminder" | "support" | "transactional" | "verification" | undefined;
|
|
17
|
+
readonly channel?: "email" | "sms" | "whatsapp" | undefined;
|
|
18
|
+
readonly status?: "approved" | "archived" | "draft" | "pending" | "published" | "rejected" | undefined;
|
|
19
|
+
readonly search?: string | undefined;
|
|
20
|
+
readonly projectId?: string | undefined;
|
|
21
|
+
readonly namespaceId?: string | undefined;
|
|
22
22
|
readonly shared?: boolean | null | undefined;
|
|
23
23
|
} | undefined) => import("effect/Stream").Stream<{
|
|
24
24
|
readonly items: readonly {
|
|
25
25
|
readonly id: string & import("effect/Brand").Brand<"TemplateId">;
|
|
26
26
|
readonly slug: string;
|
|
27
27
|
readonly name: string;
|
|
28
|
-
readonly channel: "email";
|
|
28
|
+
readonly channel: "email" | "sms" | "whatsapp";
|
|
29
29
|
readonly projectId: string & import("effect/Brand").Brand<"TemplateProjectId">;
|
|
30
30
|
readonly namespaceId: (string & import("effect/Brand").Brand<"NamespaceId">) | null;
|
|
31
31
|
readonly shared: boolean;
|
|
@@ -48,22 +48,22 @@ export declare const list: ((input?: {
|
|
|
48
48
|
readonly updatedAt: string;
|
|
49
49
|
}[];
|
|
50
50
|
readonly nextCursor: string | null;
|
|
51
|
-
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
51
|
+
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").MalformedRequestError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
52
52
|
readonly items: (input?: {
|
|
53
53
|
readonly limit?: number | null | undefined;
|
|
54
|
-
readonly cursor?: string |
|
|
55
|
-
readonly category?: "alert" | "marketing" | "notification" | "reminder" | "support" | "transactional" | "verification" |
|
|
56
|
-
readonly channel?: "email" |
|
|
57
|
-
readonly status?: "approved" | "archived" | "draft" | "pending" | "published" | "rejected" |
|
|
58
|
-
readonly search?: string |
|
|
59
|
-
readonly projectId?: string |
|
|
60
|
-
readonly namespaceId?: string |
|
|
54
|
+
readonly cursor?: string | undefined;
|
|
55
|
+
readonly category?: "alert" | "marketing" | "notification" | "reminder" | "support" | "transactional" | "verification" | undefined;
|
|
56
|
+
readonly channel?: "email" | "sms" | "whatsapp" | undefined;
|
|
57
|
+
readonly status?: "approved" | "archived" | "draft" | "pending" | "published" | "rejected" | undefined;
|
|
58
|
+
readonly search?: string | undefined;
|
|
59
|
+
readonly projectId?: string | undefined;
|
|
60
|
+
readonly namespaceId?: string | undefined;
|
|
61
61
|
readonly shared?: boolean | null | undefined;
|
|
62
62
|
} | undefined) => import("effect/Stream").Stream<{
|
|
63
63
|
readonly id: string & import("effect/Brand").Brand<"TemplateId">;
|
|
64
64
|
readonly slug: string;
|
|
65
65
|
readonly name: string;
|
|
66
|
-
readonly channel: "email";
|
|
66
|
+
readonly channel: "email" | "sms" | "whatsapp";
|
|
67
67
|
readonly projectId: string & import("effect/Brand").Brand<"TemplateProjectId">;
|
|
68
68
|
readonly namespaceId: (string & import("effect/Brand").Brand<"NamespaceId">) | null;
|
|
69
69
|
readonly shared: boolean;
|
|
@@ -84,7 +84,7 @@ export declare const list: ((input?: {
|
|
|
84
84
|
readonly lastUsedAt: string | null;
|
|
85
85
|
readonly createdAt: string;
|
|
86
86
|
readonly updatedAt: string;
|
|
87
|
-
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
87
|
+
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").MalformedRequestError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
88
88
|
};
|
|
89
89
|
export declare const create: (input: {
|
|
90
90
|
readonly name: string;
|
|
@@ -113,11 +113,11 @@ export declare const addEntry: (input: {
|
|
|
113
113
|
}, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesAddEntry">;
|
|
114
114
|
export declare const listFamilies: ((input?: {
|
|
115
115
|
readonly limit?: number | null | undefined;
|
|
116
|
-
readonly cursor?: string |
|
|
116
|
+
readonly cursor?: string | undefined;
|
|
117
117
|
} | undefined, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesListFamilies">) & {
|
|
118
118
|
readonly pages: (input?: {
|
|
119
119
|
readonly limit?: number | null | undefined;
|
|
120
|
-
readonly cursor?: string |
|
|
120
|
+
readonly cursor?: string | undefined;
|
|
121
121
|
} | undefined) => import("effect/Stream").Stream<{
|
|
122
122
|
readonly items: readonly {
|
|
123
123
|
readonly id: string & import("effect/Brand").Brand<"TemplateFamilyId">;
|
|
@@ -126,7 +126,7 @@ export declare const listFamilies: ((input?: {
|
|
|
126
126
|
readonly id: string & import("effect/Brand").Brand<"TemplateId">;
|
|
127
127
|
readonly name: string;
|
|
128
128
|
readonly slug: string;
|
|
129
|
-
readonly channel: "email";
|
|
129
|
+
readonly channel: "email" | "sms" | "whatsapp";
|
|
130
130
|
readonly status: "approved" | "archived" | "draft" | "pending" | "published" | "rejected";
|
|
131
131
|
readonly isActive: boolean;
|
|
132
132
|
readonly createdAt: string;
|
|
@@ -136,10 +136,10 @@ export declare const listFamilies: ((input?: {
|
|
|
136
136
|
readonly updatedAt: string;
|
|
137
137
|
}[];
|
|
138
138
|
readonly nextCursor: string | null;
|
|
139
|
-
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
139
|
+
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").MalformedRequestError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
140
140
|
readonly items: (input?: {
|
|
141
141
|
readonly limit?: number | null | undefined;
|
|
142
|
-
readonly cursor?: string |
|
|
142
|
+
readonly cursor?: string | undefined;
|
|
143
143
|
} | undefined) => import("effect/Stream").Stream<{
|
|
144
144
|
readonly id: string & import("effect/Brand").Brand<"TemplateFamilyId">;
|
|
145
145
|
readonly name: string;
|
|
@@ -147,7 +147,7 @@ export declare const listFamilies: ((input?: {
|
|
|
147
147
|
readonly id: string & import("effect/Brand").Brand<"TemplateId">;
|
|
148
148
|
readonly name: string;
|
|
149
149
|
readonly slug: string;
|
|
150
|
-
readonly channel: "email";
|
|
150
|
+
readonly channel: "email" | "sms" | "whatsapp";
|
|
151
151
|
readonly status: "approved" | "archived" | "draft" | "pending" | "published" | "rejected";
|
|
152
152
|
readonly isActive: boolean;
|
|
153
153
|
readonly createdAt: string;
|
|
@@ -155,7 +155,7 @@ export declare const listFamilies: ((input?: {
|
|
|
155
155
|
}[];
|
|
156
156
|
readonly createdAt: string;
|
|
157
157
|
readonly updatedAt: string;
|
|
158
|
-
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
158
|
+
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").MalformedRequestError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
159
159
|
};
|
|
160
160
|
export declare const createFamily: (input: {
|
|
161
161
|
readonly name: string;
|
|
@@ -328,12 +328,12 @@ export declare const renderPublication: (input: {
|
|
|
328
328
|
export declare const listInputContracts: ((input: {
|
|
329
329
|
readonly id: string;
|
|
330
330
|
readonly limit?: number | null | undefined;
|
|
331
|
-
readonly cursor?: string |
|
|
331
|
+
readonly cursor?: string | undefined;
|
|
332
332
|
}, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesListInputContracts">) & {
|
|
333
333
|
readonly pages: (input: {
|
|
334
334
|
readonly id: string;
|
|
335
335
|
readonly limit?: number | null | undefined;
|
|
336
|
-
readonly cursor?: string |
|
|
336
|
+
readonly cursor?: string | undefined;
|
|
337
337
|
}) => import("effect/Stream").Stream<{
|
|
338
338
|
readonly items: readonly {
|
|
339
339
|
readonly id: string & import("effect/Brand").Brand<"TemplateInputContractId">;
|
|
@@ -347,11 +347,11 @@ export declare const listInputContracts: ((input: {
|
|
|
347
347
|
readonly createdAt: string;
|
|
348
348
|
}[];
|
|
349
349
|
readonly nextCursor: string | null;
|
|
350
|
-
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
350
|
+
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").MalformedRequestError | import("./errors").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
351
351
|
readonly items: (input: {
|
|
352
352
|
readonly id: string;
|
|
353
353
|
readonly limit?: number | null | undefined;
|
|
354
|
-
readonly cursor?: string |
|
|
354
|
+
readonly cursor?: string | undefined;
|
|
355
355
|
}) => import("effect/Stream").Stream<{
|
|
356
356
|
readonly id: string & import("effect/Brand").Brand<"TemplateInputContractId">;
|
|
357
357
|
readonly organizationId: string & import("effect/Brand").Brand<"OrganizationId">;
|
|
@@ -362,7 +362,7 @@ export declare const listInputContracts: ((input: {
|
|
|
362
362
|
readonly [x: string]: import("./generated").JsonValue;
|
|
363
363
|
};
|
|
364
364
|
readonly createdAt: string;
|
|
365
|
-
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
365
|
+
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").MalformedRequestError | import("./errors").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
366
366
|
};
|
|
367
367
|
export declare const getInputContract: (input: {
|
|
368
368
|
readonly id: string;
|
package/dist/effect/topics.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const list: (input?: {
|
|
2
|
-
readonly namespaceId?: string |
|
|
2
|
+
readonly namespaceId?: string | undefined;
|
|
3
3
|
} | undefined, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"topicsList">;
|
|
4
4
|
export declare const get: (input: {
|
|
5
5
|
readonly id: string;
|
|
@@ -31,20 +31,20 @@ export declare const setDefault: (input: {
|
|
|
31
31
|
export declare const listSubscriptions: ((input: {
|
|
32
32
|
readonly id: string;
|
|
33
33
|
readonly limit?: number | null | undefined;
|
|
34
|
-
readonly cursor?: string |
|
|
35
|
-
readonly channel?: "email" |
|
|
36
|
-
readonly status?: "subscribed" | "unsubscribed" |
|
|
34
|
+
readonly cursor?: string | undefined;
|
|
35
|
+
readonly channel?: "email" | "sms" | "whatsapp" | undefined;
|
|
36
|
+
readonly status?: "subscribed" | "unsubscribed" | undefined;
|
|
37
37
|
}, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"topicsListSubscriptions">) & {
|
|
38
38
|
readonly pages: (input: {
|
|
39
39
|
readonly id: string;
|
|
40
40
|
readonly limit?: number | null | undefined;
|
|
41
|
-
readonly cursor?: string |
|
|
42
|
-
readonly channel?: "email" |
|
|
43
|
-
readonly status?: "subscribed" | "unsubscribed" |
|
|
41
|
+
readonly cursor?: string | undefined;
|
|
42
|
+
readonly channel?: "email" | "sms" | "whatsapp" | undefined;
|
|
43
|
+
readonly status?: "subscribed" | "unsubscribed" | undefined;
|
|
44
44
|
}) => import("effect/Stream").Stream<{
|
|
45
45
|
readonly items: readonly {
|
|
46
46
|
readonly contactId: string & import("effect/Brand").Brand<"ContactId">;
|
|
47
|
-
readonly channel: "email";
|
|
47
|
+
readonly channel: "email" | "sms" | "whatsapp";
|
|
48
48
|
readonly status: "subscribed" | "unsubscribed";
|
|
49
49
|
readonly source: string;
|
|
50
50
|
readonly subscribedAt: string | null;
|
|
@@ -53,23 +53,23 @@ export declare const listSubscriptions: ((input: {
|
|
|
53
53
|
readonly updatedAt: string;
|
|
54
54
|
}[];
|
|
55
55
|
readonly nextCursor: string | null;
|
|
56
|
-
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
56
|
+
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").MalformedRequestError | import("./errors").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
57
57
|
readonly items: (input: {
|
|
58
58
|
readonly id: string;
|
|
59
59
|
readonly limit?: number | null | undefined;
|
|
60
|
-
readonly cursor?: string |
|
|
61
|
-
readonly channel?: "email" |
|
|
62
|
-
readonly status?: "subscribed" | "unsubscribed" |
|
|
60
|
+
readonly cursor?: string | undefined;
|
|
61
|
+
readonly channel?: "email" | "sms" | "whatsapp" | undefined;
|
|
62
|
+
readonly status?: "subscribed" | "unsubscribed" | undefined;
|
|
63
63
|
}) => import("effect/Stream").Stream<{
|
|
64
64
|
readonly contactId: string & import("effect/Brand").Brand<"ContactId">;
|
|
65
|
-
readonly channel: "email";
|
|
65
|
+
readonly channel: "email" | "sms" | "whatsapp";
|
|
66
66
|
readonly status: "subscribed" | "unsubscribed";
|
|
67
67
|
readonly source: string;
|
|
68
68
|
readonly subscribedAt: string | null;
|
|
69
69
|
readonly unsubscribedAt: string | null;
|
|
70
70
|
readonly createdAt: string;
|
|
71
71
|
readonly updatedAt: string;
|
|
72
|
-
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
72
|
+
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").MalformedRequestError | import("./errors").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
73
73
|
};
|
|
74
74
|
export declare const setSubscriptions: (input: {
|
|
75
75
|
readonly id: string;
|
|
@@ -80,15 +80,15 @@ export declare const setSubscriptions: (input: {
|
|
|
80
80
|
} | {
|
|
81
81
|
readonly contactId: string;
|
|
82
82
|
})[];
|
|
83
|
-
readonly channel: "email";
|
|
83
|
+
readonly channel: "email" | "sms" | "whatsapp";
|
|
84
84
|
readonly status: "subscribed" | "unsubscribed";
|
|
85
85
|
readonly source?: string | null | undefined;
|
|
86
86
|
}, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"topicsSetSubscriptions">;
|
|
87
87
|
export declare const checkSubscription: (input: {
|
|
88
|
-
readonly contactId?: string |
|
|
89
|
-
readonly email?: string |
|
|
90
|
-
readonly phone?: string |
|
|
91
|
-
readonly namespaceId?: string |
|
|
92
|
-
readonly channel: "email";
|
|
93
|
-
readonly topicIds?: string |
|
|
88
|
+
readonly contactId?: string | undefined;
|
|
89
|
+
readonly email?: string | undefined;
|
|
90
|
+
readonly phone?: string | undefined;
|
|
91
|
+
readonly namespaceId?: string | undefined;
|
|
92
|
+
readonly channel: "email" | "sms" | "whatsapp";
|
|
93
|
+
readonly topicIds?: string | undefined;
|
|
94
94
|
}, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"topicsCheckSubscription">;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
export { CreateWebhookPayload as CreatePayload, TestWebhookPayload as TestPayload, UpdateWebhookPayload as UpdatePayload, } from "./generated/shared";
|
|
2
2
|
export declare const list: ((input?: {
|
|
3
3
|
readonly limit?: number | null | undefined;
|
|
4
|
-
readonly cursor?: string |
|
|
5
|
-
readonly search?: string |
|
|
6
|
-
readonly status?: "active" | "disabled" |
|
|
4
|
+
readonly cursor?: string | undefined;
|
|
5
|
+
readonly search?: string | undefined;
|
|
6
|
+
readonly status?: "active" | "disabled" | undefined;
|
|
7
7
|
} | undefined, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"webhooksList">) & {
|
|
8
8
|
readonly pages: (input?: {
|
|
9
9
|
readonly limit?: number | null | undefined;
|
|
10
|
-
readonly cursor?: string |
|
|
11
|
-
readonly search?: string |
|
|
12
|
-
readonly status?: "active" | "disabled" |
|
|
10
|
+
readonly cursor?: string | undefined;
|
|
11
|
+
readonly search?: string | undefined;
|
|
12
|
+
readonly status?: "active" | "disabled" | undefined;
|
|
13
13
|
} | undefined) => import("effect/Stream").Stream<{
|
|
14
14
|
readonly items: readonly {
|
|
15
15
|
readonly id: string & import("effect/Brand").Brand<"WebhookEndpointId">;
|
|
16
16
|
readonly name: string;
|
|
17
17
|
readonly url: string;
|
|
18
18
|
readonly eventTypes: readonly ("contact.consent_changed" | "contact.created" | "contact.deleted" | "contact.resubscribed" | "contact.subscribed" | "contact.unsubscribed" | "contact.updated" | "conversation.archived" | "conversation.created" | "conversation.updated" | "domain.updated" | "domain.warming.updated" | "flow.registration.updated" | "journey.webhook" | "mailbox.action.pending_approval" | "mailbox.action.resolved" | "mailbox.message.delivered" | "mailbox.message.discarded" | "mailbox.message.failed" | "mailbox.message.quarantined" | "mailbox.message.read" | "mailbox.message.received" | "mailbox.message.released" | "mailbox.message.sent" | "message.bounced" | "message.clicked" | "message.complained" | "message.delivered" | "message.failed" | "message.opened" | "message.read" | "message.received" | "message.sent" | "template.registration.updated" | "webhook.created" | "webhook.deleted" | "webhook.test" | "webhook.updated" | "whatsapp.number.connected")[];
|
|
19
|
-
readonly channels: readonly "email"[] | null;
|
|
19
|
+
readonly channels: readonly ("email" | "sms" | "whatsapp")[] | null;
|
|
20
20
|
readonly mailboxIds: readonly (string & import("effect/Brand").Brand<"MailboxId">)[] | null;
|
|
21
21
|
readonly namespaceId: (string & import("effect/Brand").Brand<"NamespaceId">) | null;
|
|
22
22
|
readonly status: "active" | "disabled";
|
|
@@ -34,18 +34,18 @@ export declare const list: ((input?: {
|
|
|
34
34
|
};
|
|
35
35
|
}[];
|
|
36
36
|
readonly nextCursor: string | null;
|
|
37
|
-
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
37
|
+
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").MalformedRequestError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
38
38
|
readonly items: (input?: {
|
|
39
39
|
readonly limit?: number | null | undefined;
|
|
40
|
-
readonly cursor?: string |
|
|
41
|
-
readonly search?: string |
|
|
42
|
-
readonly status?: "active" | "disabled" |
|
|
40
|
+
readonly cursor?: string | undefined;
|
|
41
|
+
readonly search?: string | undefined;
|
|
42
|
+
readonly status?: "active" | "disabled" | undefined;
|
|
43
43
|
} | undefined) => import("effect/Stream").Stream<{
|
|
44
44
|
readonly id: string & import("effect/Brand").Brand<"WebhookEndpointId">;
|
|
45
45
|
readonly name: string;
|
|
46
46
|
readonly url: string;
|
|
47
47
|
readonly eventTypes: readonly ("contact.consent_changed" | "contact.created" | "contact.deleted" | "contact.resubscribed" | "contact.subscribed" | "contact.unsubscribed" | "contact.updated" | "conversation.archived" | "conversation.created" | "conversation.updated" | "domain.updated" | "domain.warming.updated" | "flow.registration.updated" | "journey.webhook" | "mailbox.action.pending_approval" | "mailbox.action.resolved" | "mailbox.message.delivered" | "mailbox.message.discarded" | "mailbox.message.failed" | "mailbox.message.quarantined" | "mailbox.message.read" | "mailbox.message.received" | "mailbox.message.released" | "mailbox.message.sent" | "message.bounced" | "message.clicked" | "message.complained" | "message.delivered" | "message.failed" | "message.opened" | "message.read" | "message.received" | "message.sent" | "template.registration.updated" | "webhook.created" | "webhook.deleted" | "webhook.test" | "webhook.updated" | "whatsapp.number.connected")[];
|
|
48
|
-
readonly channels: readonly "email"[] | null;
|
|
48
|
+
readonly channels: readonly ("email" | "sms" | "whatsapp")[] | null;
|
|
49
49
|
readonly mailboxIds: readonly (string & import("effect/Brand").Brand<"MailboxId">)[] | null;
|
|
50
50
|
readonly namespaceId: (string & import("effect/Brand").Brand<"NamespaceId">) | null;
|
|
51
51
|
readonly status: "active" | "disabled";
|
|
@@ -61,13 +61,13 @@ export declare const list: ((input?: {
|
|
|
61
61
|
readonly exhausted: number;
|
|
62
62
|
readonly cancelled: number;
|
|
63
63
|
};
|
|
64
|
-
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
64
|
+
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").MalformedRequestError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
65
65
|
};
|
|
66
66
|
export declare const create: (input: {
|
|
67
67
|
readonly name: string;
|
|
68
68
|
readonly url: string;
|
|
69
69
|
readonly eventTypes: readonly ("contact.consent_changed" | "contact.created" | "contact.deleted" | "contact.resubscribed" | "contact.subscribed" | "contact.unsubscribed" | "contact.updated" | "conversation.archived" | "conversation.created" | "conversation.updated" | "domain.updated" | "domain.warming.updated" | "flow.registration.updated" | "journey.webhook" | "mailbox.action.pending_approval" | "mailbox.action.resolved" | "mailbox.message.delivered" | "mailbox.message.discarded" | "mailbox.message.failed" | "mailbox.message.quarantined" | "mailbox.message.read" | "mailbox.message.received" | "mailbox.message.released" | "mailbox.message.sent" | "message.bounced" | "message.clicked" | "message.complained" | "message.delivered" | "message.failed" | "message.opened" | "message.read" | "message.received" | "message.sent" | "template.registration.updated" | "webhook.created" | "webhook.deleted" | "webhook.test" | "webhook.updated" | "whatsapp.number.connected")[];
|
|
70
|
-
readonly channels?: readonly "email"[] | null | undefined;
|
|
70
|
+
readonly channels?: readonly ("email" | "sms" | "whatsapp")[] | null | undefined;
|
|
71
71
|
readonly mailboxIds?: readonly string[] | null | undefined;
|
|
72
72
|
readonly namespaceId?: string | null | undefined;
|
|
73
73
|
readonly headers?: {
|
|
@@ -89,7 +89,7 @@ export declare const update: (input: {
|
|
|
89
89
|
readonly name?: string | null | undefined;
|
|
90
90
|
readonly url?: string | null | undefined;
|
|
91
91
|
readonly eventTypes?: readonly ("contact.consent_changed" | "contact.created" | "contact.deleted" | "contact.resubscribed" | "contact.subscribed" | "contact.unsubscribed" | "contact.updated" | "conversation.archived" | "conversation.created" | "conversation.updated" | "domain.updated" | "domain.warming.updated" | "flow.registration.updated" | "journey.webhook" | "mailbox.action.pending_approval" | "mailbox.action.resolved" | "mailbox.message.delivered" | "mailbox.message.discarded" | "mailbox.message.failed" | "mailbox.message.quarantined" | "mailbox.message.read" | "mailbox.message.received" | "mailbox.message.released" | "mailbox.message.sent" | "message.bounced" | "message.clicked" | "message.complained" | "message.delivered" | "message.failed" | "message.opened" | "message.read" | "message.received" | "message.sent" | "template.registration.updated" | "webhook.created" | "webhook.deleted" | "webhook.test" | "webhook.updated" | "whatsapp.number.connected")[] | null | undefined;
|
|
92
|
-
readonly channels?: readonly "email"[] | null | undefined;
|
|
92
|
+
readonly channels?: readonly ("email" | "sms" | "whatsapp")[] | null | undefined;
|
|
93
93
|
readonly mailboxIds?: readonly string[] | null | undefined;
|
|
94
94
|
readonly namespaceId?: string | null | undefined;
|
|
95
95
|
readonly headers?: {
|
|
@@ -130,12 +130,12 @@ export declare const test: (input: {
|
|
|
130
130
|
export declare const getLogs: ((input: {
|
|
131
131
|
readonly id: string;
|
|
132
132
|
readonly limit?: number | null | undefined;
|
|
133
|
-
readonly cursor?: string |
|
|
133
|
+
readonly cursor?: string | undefined;
|
|
134
134
|
}, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"webhooksGetLogs">) & {
|
|
135
135
|
readonly pages: (input: {
|
|
136
136
|
readonly id: string;
|
|
137
137
|
readonly limit?: number | null | undefined;
|
|
138
|
-
readonly cursor?: string |
|
|
138
|
+
readonly cursor?: string | undefined;
|
|
139
139
|
}) => import("effect/Stream").Stream<{
|
|
140
140
|
readonly items: readonly {
|
|
141
141
|
readonly id: string & import("effect/Brand").Brand<"WebhookDeliveryId">;
|
|
@@ -152,9 +152,10 @@ export declare const getLogs: ((input: {
|
|
|
152
152
|
readonly attempts: readonly {
|
|
153
153
|
readonly id: string & import("effect/Brand").Brand<"WebhookAttemptId">;
|
|
154
154
|
readonly deliveryId: string & import("effect/Brand").Brand<"WebhookDeliveryId">;
|
|
155
|
-
readonly kind: "automatic" | "manual";
|
|
155
|
+
readonly kind: "automatic" | "manual" | "replay";
|
|
156
|
+
readonly queueMessageId: string | null;
|
|
156
157
|
readonly attemptNumber: number;
|
|
157
|
-
readonly classification: "cancelled" | "http-error" | "network-error" | "success" | "timeout";
|
|
158
|
+
readonly classification: "cancelled" | "http-error" | "network-error" | "skipped" | "success" | "timeout";
|
|
158
159
|
readonly attemptedAt: string;
|
|
159
160
|
readonly responseStatus: number | null;
|
|
160
161
|
readonly responseHeaders: {
|
|
@@ -167,11 +168,11 @@ export declare const getLogs: ((input: {
|
|
|
167
168
|
}[];
|
|
168
169
|
}[];
|
|
169
170
|
readonly nextCursor: string | null;
|
|
170
|
-
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
171
|
+
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").MalformedRequestError | import("./errors").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
171
172
|
readonly items: (input: {
|
|
172
173
|
readonly id: string;
|
|
173
174
|
readonly limit?: number | null | undefined;
|
|
174
|
-
readonly cursor?: string |
|
|
175
|
+
readonly cursor?: string | undefined;
|
|
175
176
|
}) => import("effect/Stream").Stream<{
|
|
176
177
|
readonly id: string & import("effect/Brand").Brand<"WebhookDeliveryId">;
|
|
177
178
|
readonly eventId: string & import("effect/Brand").Brand<"WebhookEventId">;
|
|
@@ -187,9 +188,10 @@ export declare const getLogs: ((input: {
|
|
|
187
188
|
readonly attempts: readonly {
|
|
188
189
|
readonly id: string & import("effect/Brand").Brand<"WebhookAttemptId">;
|
|
189
190
|
readonly deliveryId: string & import("effect/Brand").Brand<"WebhookDeliveryId">;
|
|
190
|
-
readonly kind: "automatic" | "manual";
|
|
191
|
+
readonly kind: "automatic" | "manual" | "replay";
|
|
192
|
+
readonly queueMessageId: string | null;
|
|
191
193
|
readonly attemptNumber: number;
|
|
192
|
-
readonly classification: "cancelled" | "http-error" | "network-error" | "success" | "timeout";
|
|
194
|
+
readonly classification: "cancelled" | "http-error" | "network-error" | "skipped" | "success" | "timeout";
|
|
193
195
|
readonly attemptedAt: string;
|
|
194
196
|
readonly responseStatus: number | null;
|
|
195
197
|
readonly responseHeaders: {
|
|
@@ -200,12 +202,12 @@ export declare const getLogs: ((input: {
|
|
|
200
202
|
readonly errorMessage: string | null;
|
|
201
203
|
readonly createdAt: string;
|
|
202
204
|
}[];
|
|
203
|
-
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
205
|
+
}, import("./errors").ForbiddenError | import("./errors").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors").InternalError | import("./errors").MalformedRequestError | import("./errors").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors").UnauthorizedError | import("./errors").ValidationError, import("./client").Service>;
|
|
204
206
|
};
|
|
205
207
|
export declare const getStats: (input: {
|
|
206
208
|
readonly id: string;
|
|
207
|
-
readonly after?: string |
|
|
208
|
-
readonly before?: string |
|
|
209
|
+
readonly after?: string | undefined;
|
|
210
|
+
readonly before?: string | undefined;
|
|
209
211
|
}, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"webhooksGetStats">;
|
|
210
212
|
export declare const retryDelivery: (input: {
|
|
211
213
|
readonly id: string;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, DeliveryUnavailableError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, MailboxSendConflictError, MailboxSendRefusedError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTransportError, SenderNotReadyError, ServiceUnavailableError, TemplateSourceError, UnauthorizedError, ValidationError, fromApiError } from "./promises/errors.gen.js";
|
|
1
|
+
import { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, DeliveryUnavailableError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, MailboxSendConflictError, MailboxSendRefusedError, MalformedRequestError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTransportError, SenderNotReadyError, ServiceUnavailableError, TemplateSourceError, UnauthorizedError, ValidationError, WhatsAppServiceWindowClosedError, 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, DeliveryUnavailableError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, MailboxEventStream, MailboxEventStreamError, MailboxSendConflictError, MailboxSendRefusedError, MediaUploadError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTransportError, SenderNotReadyError, ServiceUnavailableError, TemplateSourceError, UnauthorizedError, ValidationError, createClient, fromApiError };
|
|
5
|
+
export { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, DeliveryUnavailableError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, MailboxEventStream, MailboxEventStreamError, MailboxSendConflictError, MailboxSendRefusedError, MalformedRequestError, MediaUploadError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTransportError, SenderNotReadyError, ServiceUnavailableError, TemplateSourceError, UnauthorizedError, ValidationError, WhatsAppServiceWindowClosedError, createClient, fromApiError };
|
package/dist/normalize.js
CHANGED
|
@@ -2,9 +2,21 @@
|
|
|
2
2
|
function toRecipientArray(recipient) {
|
|
3
3
|
return Array.isArray(recipient) ? recipient : [recipient];
|
|
4
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* A caller's recipient, in the ergonomic forms the SDK accepts: an address string, an object with
|
|
7
|
+
* the declared address, a `{ id }` reference to a contact, or a listed contact that carries an
|
|
8
|
+
* address and its own id and profile fields.
|
|
9
|
+
*/
|
|
5
10
|
function normalizeMessageRecipient(recipient) {
|
|
6
11
|
if (typeof recipient === "string") return { email: recipient };
|
|
7
|
-
|
|
12
|
+
const { contactId, email, phone, name, displayName } = recipient;
|
|
13
|
+
if (contactId !== void 0) return recipient;
|
|
14
|
+
if (email !== void 0 || phone !== void 0) return {
|
|
15
|
+
...email === void 0 ? {} : { email },
|
|
16
|
+
...phone === void 0 ? {} : { phone },
|
|
17
|
+
...name === void 0 ? {} : { name },
|
|
18
|
+
...displayName === void 0 ? {} : { displayName }
|
|
19
|
+
};
|
|
8
20
|
return { contactId: recipient.id };
|
|
9
21
|
}
|
|
10
22
|
function normalizeRecipients(recipient) {
|
package/dist/package.js
CHANGED
|
@@ -51,7 +51,7 @@ export type SamvaClientConfig = (SamvaClientConfigBase & {
|
|
|
51
51
|
apiKey?: never;
|
|
52
52
|
});
|
|
53
53
|
type MessageSendBody = MessagesSendData["body"];
|
|
54
|
-
type MessageRecipient =
|
|
54
|
+
type MessageRecipient = EmailMessageSendBody["to"][number];
|
|
55
55
|
type MessageSendRequestOptions<ThrowOnError extends boolean = false> = Omit<NonNullable<Parameters<typeof messages.send<ThrowOnError>>[1]>, "client">;
|
|
56
56
|
type MessageSendOptions<ThrowOnError extends boolean = false> = MessageSendRequestOptions<ThrowOnError> & {
|
|
57
57
|
/** Sent as the `idempotency-key` header; defaults to a fresh UUID per call. */
|
package/dist/promises/client.js
CHANGED
|
@@ -2,7 +2,7 @@ import { CLIENT_ATTRIBUTION_HEADER, clientAttribution } from "../client-attribut
|
|
|
2
2
|
import { mergeHeaders } from "../client/client/utils.gen.js";
|
|
3
3
|
import { createClient as createClient$1 } from "../client/client/client.gen.js";
|
|
4
4
|
import { SamvaOperations } from "../effect/generated-metadata.js";
|
|
5
|
-
import { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, DeliveryUnavailableError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, MailboxSendConflictError, MailboxSendRefusedError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTransportError, SenderNotReadyError, ServiceUnavailableError, TemplateSourceError, UnauthorizedError, ValidationError, fromApiError } from "./errors.gen.js";
|
|
5
|
+
import { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, DeliveryUnavailableError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, MailboxSendConflictError, MailboxSendRefusedError, MalformedRequestError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTransportError, SenderNotReadyError, ServiceUnavailableError, TemplateSourceError, UnauthorizedError, ValidationError, WhatsAppServiceWindowClosedError, fromApiError } from "./errors.gen.js";
|
|
6
6
|
import { configureRequests } from "./request.js";
|
|
7
7
|
import { Agents, Analytics, ApiKeys, Attachments, Brands, Campaigns, ContactEvents, ContactGroups, Contacts, Conversations, CustomFields, Email, Events, ExtensionInstallations, Extensions, Feedback, Journeys, Mailboxes, Media, Messages, Namespaces, Newsletters, Operations, Organizations, ScheduledMessages, Subscriptions, Templates, TopicForms, Topics, Webhooks, Whoami } from "../client/sdk.gen.js";
|
|
8
8
|
import { MediaUploadError, mediaCreateBody, planInlineUploads, withUploadedAttachments } from "../inline-attachments.js";
|
|
@@ -319,6 +319,6 @@ function makeClient(config) {
|
|
|
319
319
|
}));
|
|
320
320
|
return result;
|
|
321
321
|
}
|
|
322
|
-
export { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, DeliveryUnavailableError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, MailboxSendConflictError, MailboxSendRefusedError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTransportError, SenderNotReadyError, ServiceUnavailableError, TemplateSourceError, UnauthorizedError, ValidationError, clientWithIdempotency, createBoundClient, createClient, fromApiError };
|
|
322
|
+
export { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, DeliveryUnavailableError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, MailboxSendConflictError, MailboxSendRefusedError, MalformedRequestError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTransportError, SenderNotReadyError, ServiceUnavailableError, TemplateSourceError, UnauthorizedError, ValidationError, WhatsAppServiceWindowClosedError, clientWithIdempotency, createBoundClient, createClient, fromApiError };
|
|
323
323
|
|
|
324
324
|
//# sourceMappingURL=client.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as Wire from "../client/types.gen";
|
|
2
|
-
export type SamvaApiErrorTag = "AnalyticsQueryError" | "BillingProviderError" | "BrandAddressRequiredError" | "CampaignFooterRequiredError" | "ConflictError" | "DeliveryUnavailableError" | "EmailChannelError" | "ExternalServiceError" | "FlagDisabledError" | "ForbiddenError" | "FromAddressRequiredError" | "GatewayTimeoutError" | "InternalError" | "MailboxSendConflictError" | "MailboxSendRefusedError" | "OnboardingReviewRequiredError" | "PaymentRequiredError" | "RateLimitedError" | "ResourceNotFoundError" | "SenderNotReadyError" | "ServiceUnavailableError" | "TemplateSourceError" | "UnauthorizedError" | "ValidationError";
|
|
2
|
+
export type SamvaApiErrorTag = "AnalyticsQueryError" | "BillingProviderError" | "BrandAddressRequiredError" | "CampaignFooterRequiredError" | "ConflictError" | "DeliveryUnavailableError" | "EmailChannelError" | "ExternalServiceError" | "FlagDisabledError" | "ForbiddenError" | "FromAddressRequiredError" | "GatewayTimeoutError" | "InternalError" | "MailboxSendConflictError" | "MailboxSendRefusedError" | "MalformedRequestError" | "OnboardingReviewRequiredError" | "PaymentRequiredError" | "RateLimitedError" | "ResourceNotFoundError" | "SenderNotReadyError" | "ServiceUnavailableError" | "TemplateSourceError" | "UnauthorizedError" | "ValidationError" | "WhatsAppServiceWindowClosedError";
|
|
3
3
|
export interface SamvaApiErrorContext {
|
|
4
4
|
readonly request?: Request | undefined;
|
|
5
5
|
readonly response?: Response | undefined;
|
|
@@ -167,6 +167,16 @@ export declare class MailboxSendRefusedError extends SamvaApiError<"MailboxSendR
|
|
|
167
167
|
readonly "receipt": Wire.MailboxSendReceipt;
|
|
168
168
|
constructor(payload: Omit<MailboxSendRefusedErrorPayload, "_tag">, context?: SamvaApiErrorContext);
|
|
169
169
|
}
|
|
170
|
+
type MalformedRequestErrorPayload = {
|
|
171
|
+
readonly _tag: "MalformedRequestError";
|
|
172
|
+
readonly fields: Record<string, Array<string>>;
|
|
173
|
+
readonly message: string;
|
|
174
|
+
};
|
|
175
|
+
export declare class MalformedRequestError extends SamvaApiError<"MalformedRequestError"> {
|
|
176
|
+
readonly _tag: "MalformedRequestError";
|
|
177
|
+
readonly "fields": Record<string, Array<string>>;
|
|
178
|
+
constructor(payload: Omit<MalformedRequestErrorPayload, "_tag">, context?: SamvaApiErrorContext);
|
|
179
|
+
}
|
|
170
180
|
type OnboardingReviewRequiredErrorPayload = {
|
|
171
181
|
readonly _tag: "OnboardingReviewRequiredError";
|
|
172
182
|
readonly code: "review_required" | "review_in_progress" | "information_required" | "review_rejected" | "identity_review_required" | "identity_review_rejected" | "identity_changed";
|
|
@@ -317,7 +327,17 @@ export declare class ValidationError extends SamvaApiError<"ValidationError"> {
|
|
|
317
327
|
readonly "fields"?: Record<string, Array<string>> | null;
|
|
318
328
|
constructor(payload: Omit<ValidationErrorPayload, "_tag">, context?: SamvaApiErrorContext);
|
|
319
329
|
}
|
|
320
|
-
|
|
330
|
+
type WhatsAppServiceWindowClosedErrorPayload = {
|
|
331
|
+
readonly _tag: "WhatsAppServiceWindowClosedError";
|
|
332
|
+
readonly closedAt: string | null;
|
|
333
|
+
readonly message: string;
|
|
334
|
+
};
|
|
335
|
+
export declare class WhatsAppServiceWindowClosedError extends SamvaApiError<"WhatsAppServiceWindowClosedError"> {
|
|
336
|
+
readonly _tag: "WhatsAppServiceWindowClosedError";
|
|
337
|
+
readonly "closedAt": string | null;
|
|
338
|
+
constructor(payload: Omit<WhatsAppServiceWindowClosedErrorPayload, "_tag">, context?: SamvaApiErrorContext);
|
|
339
|
+
}
|
|
340
|
+
export type AnySamvaApiError = AnalyticsQueryError | BillingProviderError | BrandAddressRequiredError | CampaignFooterRequiredError | ConflictError | DeliveryUnavailableError | EmailChannelError | ExternalServiceError | FlagDisabledError | ForbiddenError | FromAddressRequiredError | GatewayTimeoutError | InternalError | MailboxSendConflictError | MailboxSendRefusedError | MalformedRequestError | OnboardingReviewRequiredError | PaymentRequiredError | RateLimitedError | ResourceNotFoundError | SenderNotReadyError | ServiceUnavailableError | TemplateSourceError | UnauthorizedError | ValidationError | WhatsAppServiceWindowClosedError;
|
|
321
341
|
/** Convert a decoded error payload into its generated JavaScript error class. */
|
|
322
342
|
export declare function fromApiError(error: unknown, context?: SamvaApiErrorContext): AnySamvaApiError | SamvaTransportError;
|
|
323
343
|
export {};
|