samva 0.1.1 → 0.3.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.
Files changed (47) hide show
  1. package/AGENTS.md +1 -1
  2. package/README.md +10 -3
  3. package/dist/client/sdk.gen.d.ts +333 -188
  4. package/dist/client/types.gen.d.ts +1452 -718
  5. package/dist/{client-DVALvDUe.js → client-BOghX8fr.js} +1990 -1631
  6. package/dist/effect/api-keys.d.ts +14 -14
  7. package/dist/effect/api-keys.js +1 -1
  8. package/dist/effect/campaigns.d.ts +233 -861
  9. package/dist/effect/campaigns.js +1 -1
  10. package/dist/effect/categories.d.ts +1 -1
  11. package/dist/effect/client.js +1 -1
  12. package/dist/effect/contacts.d.ts +131 -231
  13. package/dist/effect/contacts.js +1 -1
  14. package/dist/effect/conversations.d.ts +91 -208
  15. package/dist/effect/conversations.js +1 -1
  16. package/dist/effect/design.d.ts +11 -11
  17. package/dist/effect/design.js +1 -1
  18. package/dist/effect/email.d.ts +164 -168
  19. package/dist/effect/email.js +20 -18
  20. package/dist/effect/generated.d.ts +13753 -14935
  21. package/dist/effect/index.d.ts +1 -0
  22. package/dist/effect/index.js +3 -2
  23. package/dist/effect/internal/operation.d.ts +15 -113
  24. package/dist/effect/media.d.ts +80 -0
  25. package/dist/effect/media.js +19 -0
  26. package/dist/effect/messages.d.ts +41 -261
  27. package/dist/effect/messages.js +1 -1
  28. package/dist/effect/operations.d.ts +10 -10
  29. package/dist/effect/operations.js +1 -1
  30. package/dist/effect/organizations.d.ts +24 -42
  31. package/dist/effect/organizations.js +1 -1
  32. package/dist/effect/scheduled-messages.d.ts +43 -502
  33. package/dist/effect/scheduled-messages.js +1 -1
  34. package/dist/effect/templates.d.ts +312 -1542
  35. package/dist/effect/templates.js +26 -18
  36. package/dist/effect/webhooks.d.ts +26 -27
  37. package/dist/effect/webhooks.js +2 -2
  38. package/dist/index.js +1 -1
  39. package/dist/{normalize-LkWl4HUF.js → normalize-BKFjbR9t.js} +5 -13
  40. package/dist/normalize.d.ts +3 -33
  41. package/dist/{operation-UtKNITtG.js → operation-C2Q4cFJL.js} +67 -26
  42. package/dist/promises/index.d.ts +6 -14
  43. package/dist/promises/index.js +1 -1
  44. package/dist/promises/types.gen.d.ts +1 -1
  45. package/dist/{promises-QxEfMTho.js → promises-oiy7mOyu.js} +680 -157
  46. package/dist/service-map.d.ts +92 -40
  47. package/package.json +19 -14
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.js";
2
- import { n as make } from "../operation-UtKNITtG.js";
3
- import { s as CreateTemplatePayload, x as UpdateTemplatePayload } from "../client-DVALvDUe.js";
2
+ import { n as make } from "../operation-C2Q4cFJL.js";
3
+ import { s as CreateTemplatePayload, x as UpdateTemplatePayload } from "../client-BOghX8fr.js";
4
4
  //#region src/effect/templates.ts
5
5
  var templates_exports = /* @__PURE__ */ __exportAll({
6
6
  CreatePayload: () => CreateTemplatePayload,
@@ -8,26 +8,30 @@ var templates_exports = /* @__PURE__ */ __exportAll({
8
8
  addFamilyChannel: () => addFamilyChannel,
9
9
  approve: () => approve,
10
10
  attachFamilyMember: () => attachFamilyMember,
11
+ checkDocumentSpam: () => checkDocumentSpam,
11
12
  create: () => create,
12
13
  createFamily: () => createFamily,
13
14
  createFamilyFromTemplate: () => createFamilyFromTemplate,
14
15
  deleteFamily: () => deleteFamily,
15
16
  detachFamilyMember: () => detachFamilyMember,
16
- duplicate: () => duplicate,
17
17
  getById: () => getById,
18
+ getDocument: () => getDocument,
18
19
  getFamily: () => getFamily,
19
20
  list: () => list,
20
21
  listDashboard: () => listDashboard,
22
+ listDocumentVersions: () => listDocumentVersions,
21
23
  listFamilies: () => listFamilies,
22
- publish: () => publish,
24
+ openDocument: () => openDocument,
25
+ publishDocument: () => publishDocument,
23
26
  remove: () => remove,
24
27
  renameFamily: () => renameFamily,
25
- render: () => render,
26
- restoreVersion: () => restoreVersion,
27
- spamCheck: () => spamCheck,
28
- unpublish: () => unpublish,
29
- update: () => update,
30
- versionHistory: () => versionHistory
28
+ renderDocument: () => renderDocument,
29
+ replaceDocument: () => replaceDocument,
30
+ restoreDocument: () => restoreDocument,
31
+ saveDocument: () => saveDocument,
32
+ sendDocumentTest: () => sendDocumentTest,
33
+ unpublishDocument: () => unpublishDocument,
34
+ update: () => update
31
35
  });
32
36
  const list = make("templatesList");
33
37
  const create = make("templatesCreate");
@@ -45,14 +49,18 @@ const getById = make("templatesGetById");
45
49
  const remove = make("templatesRemove");
46
50
  const update = make("templatesUpdate");
47
51
  const approve = make("templatesApprove");
48
- const render = make("templatesRender");
49
- const duplicate = make("templatesDuplicate");
50
- const publish = make("templatesPublish");
51
- const unpublish = make("templatesUnpublish");
52
- const versionHistory = make("templatesVersionHistory");
53
- const restoreVersion = make("templatesRestoreVersion");
54
- const spamCheck = make("templatesSpamCheck");
52
+ const openDocument = make("templateDocumentsBootstrap");
53
+ const getDocument = make("templateDocumentsGet");
54
+ const replaceDocument = make("templateDocumentsReplace");
55
+ const saveDocument = make("templateDocumentsSave");
56
+ const renderDocument = make("templateDocumentsRender");
57
+ const checkDocumentSpam = make("templateDocumentsSpamCheck");
58
+ const sendDocumentTest = make("templateDocumentsTestSend");
59
+ const listDocumentVersions = make("templateDocumentsVersions");
60
+ const publishDocument = make("templateDocumentsPublish");
61
+ const unpublishDocument = make("templateDocumentsUnpublish");
62
+ const restoreDocument = make("templateDocumentsRestore");
55
63
  //#endregion
56
- export { CreateTemplatePayload as CreatePayload, UpdateTemplatePayload as UpdatePayload, addFamilyChannel, approve, attachFamilyMember, create, createFamily, createFamilyFromTemplate, deleteFamily, detachFamilyMember, duplicate, getById, getFamily, list, listDashboard, listFamilies, publish, remove, renameFamily, render, restoreVersion, spamCheck, templates_exports as t, unpublish, update, versionHistory };
64
+ export { CreateTemplatePayload as CreatePayload, UpdateTemplatePayload as UpdatePayload, addFamilyChannel, approve, attachFamilyMember, checkDocumentSpam, create, createFamily, createFamilyFromTemplate, deleteFamily, detachFamilyMember, getById, getDocument, getFamily, list, listDashboard, listDocumentVersions, listFamilies, openDocument, publishDocument, remove, renameFamily, renderDocument, replaceDocument, restoreDocument, saveDocument, sendDocumentTest, templates_exports as t, unpublishDocument, update };
57
65
 
58
66
  //# sourceMappingURL=templates.js.map
@@ -8,8 +8,8 @@ export declare const list: ((input?: {
8
8
  readonly id: string & import("effect/Brand").Brand<"WebhookEndpointId">;
9
9
  readonly name: string;
10
10
  readonly url: string;
11
- readonly eventTypes: readonly ("message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "contact.created" | "contact.updated" | "contact.deleted" | "conversation.started" | "conversation.ended" | "conversation.created" | "conversation.updated" | "conversation.archived" | "template.created" | "template.updated" | "template.deleted" | "template.approved" | "template.rejected" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test")[];
12
- readonly channels: readonly ("sms" | "whatsapp" | "email")[] | null;
11
+ readonly eventTypes: readonly ("message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "contact.created" | "contact.updated" | "contact.deleted" | "conversation.started" | "conversation.ended" | "conversation.created" | "conversation.updated" | "conversation.archived" | "template.created" | "template.updated" | "template.deleted" | "template.approved" | "template.rejected" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test" | "domain.updated")[];
12
+ readonly channels: readonly "email"[] | null;
13
13
  readonly status: "disabled" | "active";
14
14
  readonly hasCustomHeaders: boolean;
15
15
  readonly failureStartedAt: string | null;
@@ -23,7 +23,7 @@ export declare const list: ((input?: {
23
23
  readonly total: number;
24
24
  readonly totalPages: number;
25
25
  };
26
- }, import("effect/SchemaError").SchemaError | import("./generated").ForbiddenError | import("./generated").InternalError | import("./generated").UnauthorizedError | import("effect/unstable/http/HttpClientError").HttpClientError, import("./client").Service>) & {
26
+ }, import("./generated").UnauthorizedError | import("./generated").ForbiddenError | import("./generated").InternalError | import("effect/unstable/http/HttpClientError").HttpClientError | import("effect/Schema").SchemaError, import("./client").Service>) & {
27
27
  readonly pages: (input?: {
28
28
  readonly limit?: string | null | undefined;
29
29
  readonly search?: string | null | undefined;
@@ -33,8 +33,8 @@ export declare const list: ((input?: {
33
33
  readonly id: string & import("effect/Brand").Brand<"WebhookEndpointId">;
34
34
  readonly name: string;
35
35
  readonly url: string;
36
- readonly eventTypes: readonly ("message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "contact.created" | "contact.updated" | "contact.deleted" | "conversation.started" | "conversation.ended" | "conversation.created" | "conversation.updated" | "conversation.archived" | "template.created" | "template.updated" | "template.deleted" | "template.approved" | "template.rejected" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test")[];
37
- readonly channels: readonly ("sms" | "whatsapp" | "email")[] | null;
36
+ readonly eventTypes: readonly ("message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "contact.created" | "contact.updated" | "contact.deleted" | "conversation.started" | "conversation.ended" | "conversation.created" | "conversation.updated" | "conversation.archived" | "template.created" | "template.updated" | "template.deleted" | "template.approved" | "template.rejected" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test" | "domain.updated")[];
37
+ readonly channels: readonly "email"[] | null;
38
38
  readonly status: "disabled" | "active";
39
39
  readonly hasCustomHeaders: boolean;
40
40
  readonly failureStartedAt: string | null;
@@ -48,7 +48,7 @@ export declare const list: ((input?: {
48
48
  readonly total: number;
49
49
  readonly totalPages: number;
50
50
  };
51
- }, import("effect/SchemaError").SchemaError | import("./generated").ForbiddenError | import("./generated").InternalError | import("./generated").UnauthorizedError | import("effect/unstable/http/HttpClientError").HttpClientError, import("./client").Service>;
51
+ }, import("./generated").UnauthorizedError | import("./generated").ForbiddenError | import("./generated").InternalError | import("effect/unstable/http/HttpClientError").HttpClientError | import("effect/Schema").SchemaError, import("./client").Service>;
52
52
  readonly items: (input?: {
53
53
  readonly limit?: string | null | undefined;
54
54
  readonly search?: string | null | undefined;
@@ -57,15 +57,15 @@ export declare const list: ((input?: {
57
57
  readonly id: string & import("effect/Brand").Brand<"WebhookEndpointId">;
58
58
  readonly name: string;
59
59
  readonly url: string;
60
- readonly eventTypes: readonly ("message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "contact.created" | "contact.updated" | "contact.deleted" | "conversation.started" | "conversation.ended" | "conversation.created" | "conversation.updated" | "conversation.archived" | "template.created" | "template.updated" | "template.deleted" | "template.approved" | "template.rejected" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test")[];
61
- readonly channels: readonly ("sms" | "whatsapp" | "email")[] | null;
60
+ readonly eventTypes: readonly ("message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "contact.created" | "contact.updated" | "contact.deleted" | "conversation.started" | "conversation.ended" | "conversation.created" | "conversation.updated" | "conversation.archived" | "template.created" | "template.updated" | "template.deleted" | "template.approved" | "template.rejected" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test" | "domain.updated")[];
61
+ readonly channels: readonly "email"[] | null;
62
62
  readonly status: "disabled" | "active";
63
63
  readonly hasCustomHeaders: boolean;
64
64
  readonly failureStartedAt: string | null;
65
65
  readonly lastSucceededAt: string | null;
66
66
  readonly createdAt: string;
67
67
  readonly updatedAt: string;
68
- }, import("effect/SchemaError").SchemaError | import("./generated").ForbiddenError | import("./generated").InternalError | import("./generated").UnauthorizedError | import("effect/unstable/http/HttpClientError").HttpClientError, import("./client").Service>;
68
+ }, import("./generated").UnauthorizedError | import("./generated").ForbiddenError | import("./generated").InternalError | import("effect/unstable/http/HttpClientError").HttpClientError | import("effect/Schema").SchemaError, import("./client").Service>;
69
69
  };
70
70
  export declare const create: (input: {
71
71
  readonly url: string;
@@ -74,15 +74,15 @@ export declare const create: (input: {
74
74
  readonly headers?: {
75
75
  readonly [x: string]: string | undefined;
76
76
  } | null | undefined;
77
- readonly channels?: readonly string[] | null | undefined;
78
77
  readonly status?: string | null | undefined;
78
+ readonly channels?: readonly string[] | null | undefined;
79
79
  }) => import("effect/Effect").Effect<{
80
80
  readonly endpoint: {
81
81
  readonly id: string & import("effect/Brand").Brand<"WebhookEndpointId">;
82
82
  readonly name: string;
83
83
  readonly url: string;
84
- readonly eventTypes: readonly ("message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "contact.created" | "contact.updated" | "contact.deleted" | "conversation.started" | "conversation.ended" | "conversation.created" | "conversation.updated" | "conversation.archived" | "template.created" | "template.updated" | "template.deleted" | "template.approved" | "template.rejected" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test")[];
85
- readonly channels: readonly ("sms" | "whatsapp" | "email")[] | null;
84
+ readonly eventTypes: readonly ("message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "contact.created" | "contact.updated" | "contact.deleted" | "conversation.started" | "conversation.ended" | "conversation.created" | "conversation.updated" | "conversation.archived" | "template.created" | "template.updated" | "template.deleted" | "template.approved" | "template.rejected" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test" | "domain.updated")[];
85
+ readonly channels: readonly "email"[] | null;
86
86
  readonly status: "disabled" | "active";
87
87
  readonly hasCustomHeaders: boolean;
88
88
  readonly failureStartedAt: string | null;
@@ -91,27 +91,27 @@ export declare const create: (input: {
91
91
  readonly updatedAt: string;
92
92
  };
93
93
  readonly secret: import("effect/Redacted").Redacted<string>;
94
- }, import("effect/SchemaError").SchemaError | import("./generated").BillingProviderError | import("./generated").ConflictError | import("./generated").ForbiddenError | import("./generated").InternalError | import("./generated").PaymentRequiredError | import("./generated").UnauthorizedError | import("effect/unstable/http/HttpClientError").HttpClientError, import("./client").Service>;
94
+ }, import("./generated").UnauthorizedError | import("./generated").ForbiddenError | import("./generated").InternalError | import("./generated").PaymentRequiredError | import("./generated").ValidationError | import("./generated").BillingProviderError | import("./generated").ConflictError | import("effect/unstable/http/HttpClientError").HttpClientError | import("effect/Schema").SchemaError, import("./client").Service>;
95
95
  export declare const get: (input: {
96
96
  readonly id: string;
97
97
  }) => import("effect/Effect").Effect<{
98
98
  readonly id: string & import("effect/Brand").Brand<"WebhookEndpointId">;
99
99
  readonly name: string;
100
100
  readonly url: string;
101
- readonly eventTypes: readonly ("message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "contact.created" | "contact.updated" | "contact.deleted" | "conversation.started" | "conversation.ended" | "conversation.created" | "conversation.updated" | "conversation.archived" | "template.created" | "template.updated" | "template.deleted" | "template.approved" | "template.rejected" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test")[];
102
- readonly channels: readonly ("sms" | "whatsapp" | "email")[] | null;
101
+ readonly eventTypes: readonly ("message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "contact.created" | "contact.updated" | "contact.deleted" | "conversation.started" | "conversation.ended" | "conversation.created" | "conversation.updated" | "conversation.archived" | "template.created" | "template.updated" | "template.deleted" | "template.approved" | "template.rejected" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test" | "domain.updated")[];
102
+ readonly channels: readonly "email"[] | null;
103
103
  readonly status: "disabled" | "active";
104
104
  readonly hasCustomHeaders: boolean;
105
105
  readonly failureStartedAt: string | null;
106
106
  readonly lastSucceededAt: string | null;
107
107
  readonly createdAt: string;
108
108
  readonly updatedAt: string;
109
- }, import("effect/SchemaError").SchemaError | import("./generated").ForbiddenError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("./generated").UnauthorizedError | import("effect/unstable/http/HttpClientError").HttpClientError, import("./client").Service>;
109
+ }, import("./generated").UnauthorizedError | import("./generated").ForbiddenError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("effect/unstable/http/HttpClientError").HttpClientError | import("effect/Schema").SchemaError, import("./client").Service>;
110
110
  export declare const remove: (input: {
111
111
  readonly id: string;
112
112
  }) => import("effect/Effect").Effect<{
113
113
  readonly success: boolean;
114
- }, import("effect/SchemaError").SchemaError | import("./generated").BillingProviderError | import("./generated").ForbiddenError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("./generated").UnauthorizedError | import("effect/unstable/http/HttpClientError").HttpClientError, import("./client").Service>;
114
+ }, import("./generated").UnauthorizedError | import("./generated").ForbiddenError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("./generated").BillingProviderError | import("effect/unstable/http/HttpClientError").HttpClientError | import("effect/Schema").SchemaError, import("./client").Service>;
115
115
  export declare const update: (input: {
116
116
  readonly id: string;
117
117
  readonly headers?: {
@@ -119,22 +119,22 @@ export declare const update: (input: {
119
119
  } | null | undefined;
120
120
  readonly url?: string | null | undefined;
121
121
  readonly name?: string | null | undefined;
122
- readonly channels?: readonly string[] | null | undefined;
123
122
  readonly status?: string | null | undefined;
123
+ readonly channels?: readonly string[] | null | undefined;
124
124
  readonly eventTypes?: readonly string[] | null | undefined;
125
125
  }) => import("effect/Effect").Effect<{
126
126
  readonly id: string & import("effect/Brand").Brand<"WebhookEndpointId">;
127
127
  readonly name: string;
128
128
  readonly url: string;
129
- readonly eventTypes: readonly ("message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "contact.created" | "contact.updated" | "contact.deleted" | "conversation.started" | "conversation.ended" | "conversation.created" | "conversation.updated" | "conversation.archived" | "template.created" | "template.updated" | "template.deleted" | "template.approved" | "template.rejected" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test")[];
130
- readonly channels: readonly ("sms" | "whatsapp" | "email")[] | null;
129
+ readonly eventTypes: readonly ("message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "contact.created" | "contact.updated" | "contact.deleted" | "conversation.started" | "conversation.ended" | "conversation.created" | "conversation.updated" | "conversation.archived" | "template.created" | "template.updated" | "template.deleted" | "template.approved" | "template.rejected" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test" | "domain.updated")[];
130
+ readonly channels: readonly "email"[] | null;
131
131
  readonly status: "disabled" | "active";
132
132
  readonly hasCustomHeaders: boolean;
133
133
  readonly failureStartedAt: string | null;
134
134
  readonly lastSucceededAt: string | null;
135
135
  readonly createdAt: string;
136
136
  readonly updatedAt: string;
137
- }, import("effect/SchemaError").SchemaError | import("./generated").ConflictError | import("./generated").ForbiddenError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("./generated").UnauthorizedError | import("effect/unstable/http/HttpClientError").HttpClientError, import("./client").Service>;
137
+ }, import("./generated").UnauthorizedError | import("./generated").ForbiddenError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("./generated").ValidationError | import("./generated").ConflictError | import("effect/unstable/http/HttpClientError").HttpClientError | import("effect/Schema").SchemaError, import("./client").Service>;
138
138
  export declare const test: (input: {
139
139
  readonly id: string;
140
140
  readonly data?: {
@@ -168,7 +168,7 @@ export declare const test: (input: {
168
168
  readonly accepted: true;
169
169
  readonly eventId: string & import("effect/Brand").Brand<"WebhookEventId">;
170
170
  readonly deliveryId: string & import("effect/Brand").Brand<"WebhookDeliveryId">;
171
- }, import("effect/SchemaError").SchemaError | import("./generated").ForbiddenError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("./generated").UnauthorizedError | import("effect/unstable/http/HttpClientError").HttpClientError, import("./client").Service>;
171
+ }, import("./generated").UnauthorizedError | import("./generated").ForbiddenError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("effect/unstable/http/HttpClientError").HttpClientError | import("effect/Schema").SchemaError, import("./client").Service>;
172
172
  export declare const getLogs: (input: {
173
173
  readonly webhookId: string;
174
174
  readonly limit?: string | null | undefined;
@@ -194,7 +194,6 @@ export declare const getLogs: (input: {
194
194
  readonly responseHeaders: {
195
195
  readonly [x: string]: string;
196
196
  } | null;
197
- readonly responseBody: string | null;
198
197
  readonly durationMs: number | null;
199
198
  readonly errorCode: string | null;
200
199
  readonly errorMessage: string | null;
@@ -202,7 +201,7 @@ export declare const getLogs: (input: {
202
201
  }[];
203
202
  }[];
204
203
  readonly hasMore: boolean;
205
- }, import("effect/SchemaError").SchemaError | import("./generated").ForbiddenError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("./generated").UnauthorizedError | import("effect/unstable/http/HttpClientError").HttpClientError, import("./client").Service>;
204
+ }, import("./generated").UnauthorizedError | import("./generated").ForbiddenError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("effect/unstable/http/HttpClientError").HttpClientError | import("effect/Schema").SchemaError, import("./client").Service>;
206
205
  export declare const getStats: (input: {
207
206
  readonly webhookId: string;
208
207
  }) => import("effect/Effect").Effect<{
@@ -211,7 +210,7 @@ export declare const getStats: (input: {
211
210
  readonly delivered: number;
212
211
  readonly exhausted: number;
213
212
  readonly cancelled: number;
214
- }, import("effect/SchemaError").SchemaError | import("./generated").ForbiddenError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("./generated").UnauthorizedError | import("effect/unstable/http/HttpClientError").HttpClientError, import("./client").Service>;
213
+ }, import("./generated").UnauthorizedError | import("./generated").ForbiddenError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("effect/unstable/http/HttpClientError").HttpClientError | import("effect/Schema").SchemaError, import("./client").Service>;
215
214
  export declare const retryDelivery: (input: {
216
215
  readonly webhookId: string;
217
216
  readonly deliveryId: string;
@@ -220,9 +219,9 @@ export declare const retryDelivery: (input: {
220
219
  readonly deliveryId: string & import("effect/Brand").Brand<"WebhookDeliveryId">;
221
220
  readonly attemptId: string & import("effect/Brand").Brand<"WebhookAttemptId">;
222
221
  readonly outcome: "failed" | "succeeded";
223
- }, import("effect/SchemaError").SchemaError | import("./generated").ForbiddenError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("./generated").UnauthorizedError | import("./generated").ValidationError | import("effect/unstable/http/HttpClientError").HttpClientError, import("./client").Service>;
222
+ }, import("./generated").UnauthorizedError | import("./generated").ForbiddenError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("./generated").ValidationError | import("effect/unstable/http/HttpClientError").HttpClientError | import("effect/Schema").SchemaError, import("./client").Service>;
224
223
  export declare const regenerateSecret: (input: {
225
224
  readonly webhookId: string;
226
225
  }) => import("effect/Effect").Effect<{
227
226
  readonly secret: import("effect/Redacted").Redacted<string>;
228
- }, import("effect/SchemaError").SchemaError | import("./generated").ForbiddenError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("./generated").UnauthorizedError | import("./generated").ValidationError | import("effect/unstable/http/HttpClientError").HttpClientError, import("./client").Service>;
227
+ }, import("./generated").UnauthorizedError | import("./generated").ForbiddenError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("./generated").ValidationError | import("effect/unstable/http/HttpClientError").HttpClientError | import("effect/Schema").SchemaError, import("./client").Service>;
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.js";
2
- import { n as make } from "../operation-UtKNITtG.js";
3
- import { S as UpdateWebhookPayload, c as CreateWebhookPayload, v as TestWebhookPayload } from "../client-DVALvDUe.js";
2
+ import { n as make } from "../operation-C2Q4cFJL.js";
3
+ import { S as UpdateWebhookPayload, c as CreateWebhookPayload, v as TestWebhookPayload } from "../client-BOghX8fr.js";
4
4
  //#region src/effect/webhooks.ts
5
5
  var webhooks_exports = /* @__PURE__ */ __exportAll({
6
6
  CreatePayload: () => CreateWebhookPayload,
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { _ as fromApiError, a as ExternalServiceError, c as InternalError, d as ResourceNotFoundError, f as SamvaApiError, g as WebhookEnqueueError, h as ValidationError, i as EmailChannelError, l as PaymentRequiredError, m as UnauthorizedError, n as BillingProviderError, o as FlagDisabledError, p as SamvaTransportError, r as ConflictError, s as ForbiddenError, t as createClient, u as RateLimitedError } from "./promises-QxEfMTho.js";
1
+ import { _ as fromApiError, a as ExternalServiceError, c as InternalError, d as ResourceNotFoundError, f as SamvaApiError, g as WebhookEnqueueError, h as ValidationError, i as EmailChannelError, l as PaymentRequiredError, m as UnauthorizedError, n as BillingProviderError, o as FlagDisabledError, p as SamvaTransportError, r as ConflictError, s as ForbiddenError, t as createClient, u as RateLimitedError } from "./promises-oiy7mOyu.js";
2
2
  export { BillingProviderError, ConflictError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, InternalError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTransportError, UnauthorizedError, ValidationError, WebhookEnqueueError, createClient, fromApiError };
@@ -3,12 +3,8 @@ function toRecipientArray(recipient) {
3
3
  return Array.isArray(recipient) ? recipient : [recipient];
4
4
  }
5
5
  function normalizeMessageRecipient(recipient, channel) {
6
- if (typeof recipient === "string") switch (channel) {
7
- case "email": return { email: recipient };
8
- case "sms": return { phone: recipient };
9
- case "whatsapp": return { whatsapp: recipient };
10
- }
11
- if ("contactId" in recipient || "email" in recipient || "phone" in recipient || "whatsapp" in recipient) return recipient;
6
+ if (typeof recipient === "string") return { email: recipient };
7
+ if ("contactId" in recipient || "email" in recipient || "phone" in recipient) return recipient;
12
8
  return { contactId: recipient.id };
13
9
  }
14
10
  function normalizeRecipients(recipient, channel) {
@@ -64,19 +60,15 @@ function buildEmailSendPayload(input) {
64
60
  };
65
61
  }
66
62
  function buildMessagesSendPayload(input) {
67
- const base = {
63
+ return {
68
64
  ...input,
69
- to: normalizeRecipients(input.to, input.channel)
70
- };
71
- if (input.channel === "email") return {
72
- ...base,
65
+ to: normalizeRecipients(input.to, input.channel),
73
66
  ...ccBccPayload("cc", input.cc, "email"),
74
67
  ...ccBccPayload("bcc", input.bcc, "email"),
75
68
  email: normalizeEmailContent(input.email ?? {})
76
69
  };
77
- return base;
78
70
  }
79
71
  //#endregion
80
72
  export { buildMessagesSendPayload as n, replyToEmailsPayload as r, buildEmailSendPayload as t };
81
73
 
82
- //# sourceMappingURL=normalize-LkWl4HUF.js.map
74
+ //# sourceMappingURL=normalize-BKFjbR9t.js.map
@@ -13,7 +13,6 @@
13
13
  * to its own generated body type at the call site — the same cast both clients
14
14
  * already performed inline.
15
15
  */
16
- type SendChannel = "email" | "sms" | "whatsapp";
17
16
  /** A recipient the caller may pass in ergonomic form. */
18
17
  type ErgonomicRecipient<Recipient> = Recipient | {
19
18
  readonly id: string;
@@ -42,41 +41,12 @@ export interface EmailSendFields<Recipient> {
42
41
  readonly [key: string]: unknown;
43
42
  }
44
43
  export declare function buildEmailSendPayload<Recipient extends object>(input: EmailSendFields<Recipient>): Record<string, unknown>;
45
- /** @public — staged SMS/WhatsApp channel surface; ships with the channel launch */
46
- export interface SmsSendFields<Recipient> {
47
- readonly to: ErgonomicRecipient<Recipient> | ReadonlyArray<ErgonomicRecipient<Recipient>>;
48
- readonly conversationId?: string | null | undefined;
49
- readonly metadata?: Metadata;
50
- readonly text?: string | null | undefined;
51
- readonly message?: string | undefined;
52
- readonly templateId?: string | null | undefined;
53
- readonly templateSlug?: string | null | undefined;
54
- readonly templateData?: Record<string, unknown> | null | undefined;
55
- }
56
- /** @public — staged SMS/WhatsApp channel surface; ships with the channel launch */
57
- export declare function buildSmsSendPayload<Recipient extends object>(input: SmsSendFields<Recipient>): Record<string, unknown>;
58
- /** @public — staged SMS/WhatsApp channel surface; ships with the channel launch */
59
- export interface WhatsAppSendFields<Recipient> {
60
- readonly to: ErgonomicRecipient<Recipient> | ReadonlyArray<ErgonomicRecipient<Recipient>>;
61
- readonly conversationId?: string | null | undefined;
62
- readonly metadata?: Metadata;
63
- readonly text?: string | null | undefined;
64
- readonly mediaUrl?: string | null | undefined;
65
- readonly mediaType?: "image" | "video" | "audio" | "document" | null | undefined;
66
- readonly templateId?: string | null | undefined;
67
- readonly templateSlug?: string | null | undefined;
68
- readonly templateCategory?: "marketing" | "utility" | "authentication" | null | undefined;
69
- readonly templateData?: Record<string, unknown> | null | undefined;
70
- }
71
- /** @public — staged SMS/WhatsApp channel surface; ships with the channel launch */
72
- export declare function buildWhatsAppSendPayload<Recipient extends object>(input: WhatsAppSendFields<Recipient>): Record<string, unknown>;
73
44
  /**
74
- * Unified `messages.send` payload: the caller already provides a channel-shaped
75
- * body (`sms` / `whatsapp` / `email` sub-object), so only recipients and — for
76
- * email — cc/bcc/email-content are normalized; everything else passes through.
45
+ * Unified `messages.send` payload: the caller provides the email-shaped body,
46
+ * so only recipients and email content are normalized.
77
47
  */
78
48
  export interface MessagesSendFields<Recipient> {
79
- readonly channel: SendChannel;
49
+ readonly channel: "email";
80
50
  readonly to: ErgonomicRecipient<Recipient> | ReadonlyArray<ErgonomicRecipient<Recipient>>;
81
51
  readonly cc?: ErgonomicRecipient<Recipient> | ReadonlyArray<ErgonomicRecipient<Recipient>> | null | undefined;
82
52
  readonly bcc?: ErgonomicRecipient<Recipient> | ReadonlyArray<ErgonomicRecipient<Recipient>> | null | undefined;
@@ -1,5 +1,5 @@
1
- import { n as buildMessagesSendPayload, r as replyToEmailsPayload, t as buildEmailSendPayload } from "./normalize-LkWl4HUF.js";
2
- import { _ as SamvaApi, t as Service } from "./client-DVALvDUe.js";
1
+ import { n as buildMessagesSendPayload, r as replyToEmailsPayload, t as buildEmailSendPayload } from "./normalize-BKFjbR9t.js";
2
+ import { _ as SamvaApi, t as Service } from "./client-BOghX8fr.js";
3
3
  import { generateIdempotencyKey, withRetry } from "./effect/retry.js";
4
4
  import { Effect, Option, Predicate, Stream } from "effect";
5
5
  //#region src/service-map.ts
@@ -38,6 +38,23 @@ const SDK_OPERATION_CALLS = {
38
38
  kind: "path",
39
39
  paths: ["id"]
40
40
  },
41
+ mediaCreate: { kind: "payload" },
42
+ mediaGetById: {
43
+ kind: "path",
44
+ paths: ["mediaId"]
45
+ },
46
+ mediaRemove: {
47
+ kind: "path",
48
+ paths: ["mediaId"]
49
+ },
50
+ mediaComplete: {
51
+ kind: "path",
52
+ paths: ["mediaId"]
53
+ },
54
+ mediaDownloadUrl: {
55
+ kind: "path",
56
+ paths: ["mediaId"]
57
+ },
41
58
  scheduledMessagesList: { kind: "params" },
42
59
  scheduledMessagesCreate: { kind: "payload" },
43
60
  scheduledMessagesGet: {
@@ -96,12 +113,11 @@ const SDK_OPERATION_CALLS = {
96
113
  emailGetRecipientTrackingPreference: { kind: "params" },
97
114
  emailUpdateRecipientTrackingPreference: { kind: "payload" },
98
115
  emailAddDomain: { kind: "payload" },
99
- emailProvisionDomain: { kind: "idempotentPayload" },
100
- emailVerifyDomain: {
116
+ emailGetDomainVerification: {
101
117
  kind: "path",
102
118
  paths: ["id"]
103
119
  },
104
- emailCheckDomainVerification: {
120
+ emailAdvanceDomainVerification: {
105
121
  kind: "path",
106
122
  paths: ["id"]
107
123
  },
@@ -149,19 +165,27 @@ const SDK_OPERATION_CALLS = {
149
165
  kind: "pathPayload",
150
166
  paths: ["id"]
151
167
  },
152
- emailGetDomainStatus: {
168
+ emailEnableCustomTracking: {
169
+ kind: "pathPayload",
170
+ paths: ["id"]
171
+ },
172
+ emailGetCustomTracking: {
153
173
  kind: "path",
154
174
  paths: ["id"]
155
175
  },
156
- emailEnableBrandedTracking: {
157
- kind: "pathPayload",
176
+ emailGetCustomTrackingDomainConnect: {
177
+ kind: "path",
158
178
  paths: ["id"]
159
179
  },
160
- emailGetBrandedTracking: {
180
+ emailBuildCustomTrackingDomainConnectApplyUrl: {
161
181
  kind: "path",
162
182
  paths: ["id"]
163
183
  },
164
- emailDisableBrandedTracking: {
184
+ emailCompleteCustomTrackingDomainConnect: {
185
+ kind: "pathPayload",
186
+ paths: ["id"]
187
+ },
188
+ emailDisableCustomTracking: {
165
189
  kind: "path",
166
190
  paths: ["id"]
167
191
  },
@@ -317,31 +341,47 @@ const SDK_OPERATION_CALLS = {
317
341
  kind: "pathPayload",
318
342
  paths: ["id"]
319
343
  },
320
- templatesRender: {
344
+ templateDocumentsBootstrap: { kind: "payload" },
345
+ templateDocumentsGet: {
346
+ kind: "path",
347
+ paths: ["templateId"]
348
+ },
349
+ templateDocumentsReplace: {
321
350
  kind: "pathPayload",
322
- paths: ["id"]
351
+ paths: ["templateId"]
323
352
  },
324
- templatesDuplicate: {
325
- kind: "path",
326
- paths: ["id"]
353
+ templateDocumentsSave: {
354
+ kind: "pathPayload",
355
+ paths: ["templateId"]
327
356
  },
328
- templatesPublish: {
329
- kind: "path",
330
- paths: ["id"]
357
+ templateDocumentsRender: {
358
+ kind: "pathPayload",
359
+ paths: ["templateId"]
360
+ },
361
+ templateDocumentsSpamCheck: {
362
+ kind: "pathPayload",
363
+ paths: ["templateId"]
331
364
  },
332
- templatesUnpublish: {
365
+ templateDocumentsTestSend: {
366
+ kind: "pathPayload",
367
+ paths: ["templateId"]
368
+ },
369
+ templateDocumentsVersions: {
333
370
  kind: "path",
334
- paths: ["id"]
371
+ paths: ["templateId"]
335
372
  },
336
- templatesVersionHistory: {
373
+ templateDocumentsPublish: {
337
374
  kind: "path",
338
- paths: ["id"]
375
+ paths: ["templateId"]
339
376
  },
340
- templatesRestoreVersion: {
377
+ templateDocumentsUnpublish: {
341
378
  kind: "path",
342
- paths: ["id", "versionId"]
379
+ paths: ["templateId"]
380
+ },
381
+ templateDocumentsRestore: {
382
+ kind: "pathPayload",
383
+ paths: ["templateId", "versionId"]
343
384
  },
344
- templatesSpamCheck: { kind: "payload" },
345
385
  webhooksList: { kind: "params" },
346
386
  webhooksCreate: { kind: "payload" },
347
387
  webhooksGet: {
@@ -485,6 +525,7 @@ const MODULE_NAMES = {
485
525
  conversations: "Conversations",
486
526
  design: "Design",
487
527
  email: "Email",
528
+ media: "Media",
488
529
  messages: "Messages",
489
530
  operations: "Operations",
490
531
  organizations: "Organizations",
@@ -570,4 +611,4 @@ const addEmailSender = Effect.fn("Email.addSender")(function* (input) {
570
611
  //#endregion
571
612
  export { sendMessage as i, make as n, sendEmail as r, addEmailSender as t };
572
613
 
573
- //# sourceMappingURL=operation-UtKNITtG.js.map
614
+ //# sourceMappingURL=operation-C2Q4cFJL.js.map
@@ -27,7 +27,7 @@
27
27
  * ```
28
28
  */
29
29
  import { type Client, type Config } from "../client/client";
30
- import { ApiKeys as apiKeys, Campaigns as campaigns, Contacts as contacts, Conversations as conversations, Design as design, Email as email, Messages as messages, Operations as operations, Organizations as organizations, ScheduledMessages as scheduledMessages, Templates as templates, Webhooks as webhooks } from "../client/sdk.gen";
30
+ import { ApiKeys as apiKeys, Campaigns as campaigns, Contacts as contacts, Conversations as conversations, Design as design, Email as email, Media as media, Messages as messages, Operations as operations, Organizations as organizations, ScheduledMessages as scheduledMessages, TemplateDocuments as templateDocuments, Templates as templates, Webhooks as webhooks } from "../client/sdk.gen";
31
31
  import type { MessagesSendData } from "../client/types.gen";
32
32
  export * from "./errors.gen";
33
33
  export type * from "./types.gen";
@@ -55,12 +55,6 @@ type ErgonomicMessageRecipient = MessageRecipient | ContactObjectRecipient | str
55
55
  type EmailMessageSendBody = Extract<MessageSendBody, {
56
56
  readonly channel: "email";
57
57
  }>;
58
- type SmsMessageSendBody = Extract<MessageSendBody, {
59
- readonly channel: "sms";
60
- }>;
61
- type WhatsAppMessageSendBody = Extract<MessageSendBody, {
62
- readonly channel: "whatsapp";
63
- }>;
64
58
  type ErgonomicReplyTo = string | ReadonlyArray<string>;
65
59
  type ErgonomicEmailList = string | ReadonlyArray<string>;
66
60
  type ErgonomicEmailContent = Omit<EmailMessageSendBody["email"], "replyTo"> & {
@@ -77,13 +71,7 @@ type ErgonomicEmailMessageSendBody = Omit<EmailMessageSendBody, "to" | "cc" | "b
77
71
  readonly bcc?: ErgonomicMessageRecipient | ReadonlyArray<ErgonomicMessageRecipient> | null;
78
72
  readonly email: ErgonomicEmailContent;
79
73
  };
80
- type ErgonomicSmsMessageSendBody = Omit<SmsMessageSendBody, "to"> & {
81
- readonly to: ErgonomicMessageRecipient | ReadonlyArray<ErgonomicMessageRecipient>;
82
- };
83
- type ErgonomicWhatsAppMessageSendBody = Omit<WhatsAppMessageSendBody, "to"> & {
84
- readonly to: ErgonomicMessageRecipient | ReadonlyArray<ErgonomicMessageRecipient>;
85
- };
86
- type ErgonomicMessageSendInput = ErgonomicEmailMessageSendBody | ErgonomicSmsMessageSendBody | ErgonomicWhatsAppMessageSendBody;
74
+ type ErgonomicMessageSendInput = ErgonomicEmailMessageSendBody;
87
75
  type PromiseMessagesTransport = {
88
76
  readonly list: typeof messages.list;
89
77
  readonly remove: typeof messages.remove;
@@ -121,7 +109,9 @@ export interface SamvaRawClient {
121
109
  readonly scheduledMessages: typeof scheduledMessages;
122
110
  readonly campaigns: typeof campaigns;
123
111
  readonly email: typeof email;
112
+ readonly media: typeof media;
124
113
  readonly templates: typeof templates;
114
+ readonly templateDocuments: typeof templateDocuments;
125
115
  readonly contacts: typeof contacts;
126
116
  readonly conversations: typeof conversations;
127
117
  readonly design: typeof design;
@@ -137,7 +127,9 @@ export interface SamvaClient {
137
127
  readonly scheduledMessages: DirectService<typeof scheduledMessages>;
138
128
  readonly campaigns: DirectService<typeof campaigns>;
139
129
  readonly email: DirectService<PromiseEmailTransport>;
130
+ readonly media: DirectService<typeof media>;
140
131
  readonly templates: DirectService<typeof templates>;
132
+ readonly templateDocuments: DirectService<typeof templateDocuments>;
141
133
  readonly contacts: DirectService<typeof contacts>;
142
134
  readonly conversations: DirectService<typeof conversations>;
143
135
  readonly design: DirectService<typeof design>;
@@ -1,2 +1,2 @@
1
- import { _ as fromApiError, a as ExternalServiceError, c as InternalError, d as ResourceNotFoundError, f as SamvaApiError, g as WebhookEnqueueError, h as ValidationError, i as EmailChannelError, l as PaymentRequiredError, m as UnauthorizedError, n as BillingProviderError, o as FlagDisabledError, p as SamvaTransportError, r as ConflictError, s as ForbiddenError, t as createClient, u as RateLimitedError } from "../promises-QxEfMTho.js";
1
+ import { _ as fromApiError, a as ExternalServiceError, c as InternalError, d as ResourceNotFoundError, f as SamvaApiError, g as WebhookEnqueueError, h as ValidationError, i as EmailChannelError, l as PaymentRequiredError, m as UnauthorizedError, n as BillingProviderError, o as FlagDisabledError, p as SamvaTransportError, r as ConflictError, s as ForbiddenError, t as createClient, u as RateLimitedError } from "../promises-oiy7mOyu.js";
2
2
  export { BillingProviderError, ConflictError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, InternalError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTransportError, UnauthorizedError, ValidationError, WebhookEnqueueError, createClient, fromApiError };