samva 0.35.0 → 0.37.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 (70) hide show
  1. package/AGENTS.md +17 -0
  2. package/README.md +1 -0
  3. package/dist/client/sdk.gen.d.ts +102 -82
  4. package/dist/client/sdk.gen.js +322 -244
  5. package/dist/client/types.gen.d.ts +600 -378
  6. package/dist/effect/agents.d.ts +194 -4
  7. package/dist/effect/agents.js +3 -1
  8. package/dist/effect/analytics.d.ts +6 -0
  9. package/dist/effect/api-keys.d.ts +3 -6
  10. package/dist/effect/campaigns.d.ts +216 -216
  11. package/dist/effect/conversations.d.ts +6 -0
  12. package/dist/effect/errors.d.ts +1 -1
  13. package/dist/effect/errors.js +2 -2
  14. package/dist/effect/extension-installations.d.ts +53 -1
  15. package/dist/effect/generated/agents.d.ts +1803 -81
  16. package/dist/effect/generated/agents.js +92 -26
  17. package/dist/effect/generated/analytics.d.ts +19 -1
  18. package/dist/effect/generated/analytics.js +8 -2
  19. package/dist/effect/generated/api-keys.d.ts +4 -29
  20. package/dist/effect/generated/api-keys.js +5 -6
  21. package/dist/effect/generated/campaigns.d.ts +22 -0
  22. package/dist/effect/generated/campaigns.js +3 -1
  23. package/dist/effect/generated/conversations.d.ts +104 -3
  24. package/dist/effect/generated/conversations.js +12 -2
  25. package/dist/effect/generated/extension-installations.d.ts +845 -68
  26. package/dist/effect/generated/extension-installations.js +22 -26
  27. package/dist/effect/generated/index.d.ts +3 -1
  28. package/dist/effect/generated/mailboxes.d.ts +3423 -1446
  29. package/dist/effect/generated/mailboxes.js +226 -220
  30. package/dist/effect/generated/namespaces.d.ts +7 -31
  31. package/dist/effect/generated/namespaces.js +4 -4
  32. package/dist/effect/generated/policies.d.ts +953 -0
  33. package/dist/effect/generated/policies.js +116 -0
  34. package/dist/effect/generated/scheduled-messages.d.ts +45 -4
  35. package/dist/effect/generated/scheduled-messages.js +8 -3
  36. package/dist/effect/generated/shared.d.ts +893 -224
  37. package/dist/effect/generated/shared.js +194 -60
  38. package/dist/effect/generated/templates.d.ts +474 -668
  39. package/dist/effect/generated/templates.js +65 -45
  40. package/dist/effect/generated/webhooks.d.ts +22 -19
  41. package/dist/effect/generated/webhooks.js +10 -1
  42. package/dist/effect/generated/whoami.d.ts +0 -4
  43. package/dist/effect/generated-metadata.d.ts +36 -32
  44. package/dist/effect/generated-metadata.js +127 -105
  45. package/dist/effect/index.d.ts +1 -0
  46. package/dist/effect/index.js +3 -2
  47. package/dist/effect/internal/operation.js +5 -32
  48. package/dist/effect/journeys.d.ts +146 -146
  49. package/dist/effect/mailboxes.d.ts +575 -129
  50. package/dist/effect/mailboxes.js +1 -11
  51. package/dist/effect/policies.d.ts +65 -0
  52. package/dist/effect/policies.js +16 -0
  53. package/dist/effect/scheduled-messages.d.ts +6 -0
  54. package/dist/effect/templates.d.ts +6 -8
  55. package/dist/effect/templates.js +5 -3
  56. package/dist/effect/topics.d.ts +2 -2
  57. package/dist/effect/webhooks.d.ts +7 -4
  58. package/dist/index.js +2 -2
  59. package/dist/mailbox/test.js +11 -4
  60. package/dist/mailbox/types.d.ts +39 -3
  61. package/dist/package.js +1 -1
  62. package/dist/promises/client.d.ts +3 -1
  63. package/dist/promises/client.js +5 -3
  64. package/dist/promises/errors.gen.d.ts +18 -2
  65. package/dist/promises/errors.gen.js +335 -33
  66. package/dist/promises/index.js +2 -2
  67. package/dist/promises/types.gen.d.ts +1 -1
  68. package/dist/service-map.d.ts +30 -28
  69. package/dist/service-map.js +219 -786
  70. package/package.json +6 -2
@@ -16,11 +16,9 @@ var mailboxes_exports = /* @__PURE__ */ __exportAll({
16
16
  createGrant: () => createGrant,
17
17
  createLabel: () => createLabel,
18
18
  createNote: () => createNote,
19
- createPolicy: () => createPolicy,
20
19
  deleteDraft: () => deleteDraft,
21
20
  deleteLabel: () => deleteLabel,
22
21
  deleteNote: () => deleteNote,
23
- deletePolicy: () => deletePolicy,
24
22
  denyAction: () => denyAction,
25
23
  discardMessage: () => discardMessage,
26
24
  events: () => events,
@@ -33,7 +31,6 @@ var mailboxes_exports = /* @__PURE__ */ __exportAll({
33
31
  getMessageAttachment: () => getMessageAttachment,
34
32
  getMessageRaw: () => getMessageRaw,
35
33
  getNeedsYou: () => getNeedsYou,
36
- getPolicy: () => getPolicy,
37
34
  getThread: () => getThread,
38
35
  getThreadContent: () => getThreadContent,
39
36
  list: () => list,
@@ -45,7 +42,6 @@ var mailboxes_exports = /* @__PURE__ */ __exportAll({
45
42
  listLabels: () => listLabels,
46
43
  listOrganizationDrafts: () => listOrganizationDrafts,
47
44
  listOrganizationThreads: () => listOrganizationThreads,
48
- listPolicies: () => listPolicies,
49
45
  listQuarantine: () => listQuarantine,
50
46
  listThreadMessages: () => listThreadMessages,
51
47
  listThreadNotes: () => listThreadNotes,
@@ -68,7 +64,6 @@ var mailboxes_exports = /* @__PURE__ */ __exportAll({
68
64
  updateGrant: () => updateGrant,
69
65
  updateLabel: () => updateLabel,
70
66
  updateNote: () => updateNote,
71
- updatePolicy: () => updatePolicy,
72
67
  updateThread: () => updateThread
73
68
  });
74
69
  const make = /* @__PURE__ */ forGroup(MailboxesGroup);
@@ -87,11 +82,6 @@ const listGrants = /* @__PURE__ */ make("mailboxesListGrants");
87
82
  const createGrant = /* @__PURE__ */ make("mailboxesCreateGrant");
88
83
  const updateGrant = /* @__PURE__ */ make("mailboxesUpdateGrant");
89
84
  const revokeGrant = /* @__PURE__ */ make("mailboxesRevokeGrant");
90
- const listPolicies = /* @__PURE__ */ make("mailboxesListPolicies");
91
- const createPolicy = /* @__PURE__ */ make("mailboxesCreatePolicy");
92
- const getPolicy = /* @__PURE__ */ make("mailboxesGetPolicy");
93
- const updatePolicy = /* @__PURE__ */ make("mailboxesUpdatePolicy");
94
- const deletePolicy = /* @__PURE__ */ make("mailboxesDeletePolicy");
95
85
  const listFolders = /* @__PURE__ */ make("mailboxesListFolders");
96
86
  const listLabels = /* @__PURE__ */ make("mailboxesListLabels");
97
87
  const createLabel = /* @__PURE__ */ make("mailboxesCreateLabel");
@@ -135,6 +125,6 @@ const retryAction = /* @__PURE__ */ make("mailboxesRetryAction");
135
125
  const approveAction = /* @__PURE__ */ make("mailboxesApproveAction");
136
126
  const denyAction = /* @__PURE__ */ make("mailboxesDenyAction");
137
127
  const listEvents = /* @__PURE__ */ make("mailboxesListEvents");
138
- export { MailboxEventStreamError, addThreadLabels, approveAction, cancelAction, copyMessageAttachment, create, createDraft, createEndpoint, createGrant, createLabel, createNote, createPolicy, deleteDraft, deleteLabel, deleteNote, deletePolicy, denyAction, discardMessage, events, forward, get, getAction, getAgentActivity, getDraft, getMessage, getMessageAttachment, getMessageRaw, getNeedsYou, getPolicy, getThread, getThreadContent, list, listActions, listDrafts, listEvents, listFolders, listGrants, listLabels, listOrganizationDrafts, listOrganizationThreads, listPolicies, listQuarantine, listThreadMessages, listThreadNotes, listThreads, mailboxes_exports, pause, releaseMessage, remove, removeEndpoint, removeThreadLabels, reply, replyAll, resume, retryAction, revokeGrant, sendDraft, sendMessage, update, updateDraft, updateEndpoint, updateGrant, updateLabel, updateNote, updatePolicy, updateThread };
128
+ export { MailboxEventStreamError, addThreadLabels, approveAction, cancelAction, copyMessageAttachment, create, createDraft, createEndpoint, createGrant, createLabel, createNote, deleteDraft, deleteLabel, deleteNote, denyAction, discardMessage, events, forward, get, getAction, getAgentActivity, getDraft, getMessage, getMessageAttachment, getMessageRaw, getNeedsYou, getThread, getThreadContent, list, listActions, listDrafts, listEvents, listFolders, listGrants, listLabels, listOrganizationDrafts, listOrganizationThreads, listQuarantine, listThreadMessages, listThreadNotes, listThreads, mailboxes_exports, pause, releaseMessage, remove, removeEndpoint, removeThreadLabels, reply, replyAll, resume, retryAction, revokeGrant, sendDraft, sendMessage, update, updateDraft, updateEndpoint, updateGrant, updateLabel, updateNote, updateThread };
139
129
 
140
130
  //# sourceMappingURL=mailboxes.js.map
@@ -0,0 +1,65 @@
1
+ export declare const getPolicy: (input: {
2
+ readonly kind: "agent" | "apiKey" | "mailbox" | "organization";
3
+ readonly id: string;
4
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"policiesGetPolicy">;
5
+ export declare const setPolicy: (input: {
6
+ readonly kind: "agent" | "apiKey" | "mailbox" | "organization";
7
+ readonly id: string;
8
+ readonly presets: readonly string[];
9
+ readonly rules: readonly ({
10
+ readonly match: {
11
+ readonly kind?: "handoff" | "reply" | "send" | "toolCall" | null | undefined;
12
+ readonly effect?: "final" | "read" | "write" | null | undefined;
13
+ readonly channel?: "email" | "sms" | "whatsapp" | null | undefined;
14
+ readonly integration?: string | null | undefined;
15
+ readonly tool?: string | null | undefined;
16
+ readonly subject?: "agent" | "apiKey" | "extension" | "member" | {
17
+ readonly kind: "agent";
18
+ readonly id: string;
19
+ } | {
20
+ readonly kind: "apiKey";
21
+ readonly id: string;
22
+ } | {
23
+ readonly kind: "member";
24
+ readonly userId: string;
25
+ } | {
26
+ readonly kind: "extension";
27
+ readonly id: string;
28
+ } | null | undefined;
29
+ };
30
+ readonly note?: string | null | undefined;
31
+ readonly decide: "model" | "never" | "person" | "run";
32
+ readonly atLeast?: null | undefined;
33
+ } | {
34
+ readonly match: {
35
+ readonly kind?: "handoff" | "reply" | "send" | "toolCall" | null | undefined;
36
+ readonly effect?: "final" | "read" | "write" | null | undefined;
37
+ readonly channel?: "email" | "sms" | "whatsapp" | null | undefined;
38
+ readonly integration?: string | null | undefined;
39
+ readonly tool?: string | null | undefined;
40
+ readonly subject?: "agent" | "apiKey" | "extension" | "member" | {
41
+ readonly kind: "agent";
42
+ readonly id: string;
43
+ } | {
44
+ readonly kind: "apiKey";
45
+ readonly id: string;
46
+ } | {
47
+ readonly kind: "member";
48
+ readonly userId: string;
49
+ } | {
50
+ readonly kind: "extension";
51
+ readonly id: string;
52
+ } | null | undefined;
53
+ };
54
+ readonly note?: string | null | undefined;
55
+ readonly decide?: null | undefined;
56
+ readonly atLeast: "model" | "never" | "person" | "run";
57
+ })[];
58
+ readonly instructions?: string | null | undefined;
59
+ readonly ifVersion: number;
60
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"policiesSetPolicy">;
61
+ export declare const deletePolicy: (input: {
62
+ readonly kind: "agent" | "apiKey" | "mailbox" | "organization";
63
+ readonly id: string;
64
+ readonly ifVersion: number;
65
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"policiesDeletePolicy">;
@@ -0,0 +1,16 @@
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
+ import { forGroup } from "./internal/operation.js";
3
+ import { PoliciesGroup } from "./generated/policies.js";
4
+ // src/effect/policies.ts
5
+ var policies_exports = /* @__PURE__ */ __exportAll({
6
+ deletePolicy: () => deletePolicy,
7
+ getPolicy: () => getPolicy,
8
+ setPolicy: () => setPolicy
9
+ });
10
+ const make = /* @__PURE__ */ forGroup(PoliciesGroup);
11
+ const getPolicy = /* @__PURE__ */ make("policiesGetPolicy");
12
+ const setPolicy = /* @__PURE__ */ make("policiesSetPolicy");
13
+ const deletePolicy = /* @__PURE__ */ make("policiesDeletePolicy");
14
+ export { deletePolicy, getPolicy, policies_exports, setPolicy };
15
+
16
+ //# sourceMappingURL=policies.js.map
@@ -1,15 +1,18 @@
1
1
  export declare const list: ((input?: {
2
2
  readonly limit?: number | null | undefined;
3
3
  readonly cursor?: string | undefined;
4
+ readonly namespaceId?: string | undefined;
4
5
  readonly status?: "cancelled" | "dispatched" | "dispatching" | "failed" | "paused" | "pending" | undefined;
5
6
  } | undefined, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"scheduledMessagesList">) & {
6
7
  readonly pages: (input?: {
7
8
  readonly limit?: number | null | undefined;
8
9
  readonly cursor?: string | undefined;
10
+ readonly namespaceId?: string | undefined;
9
11
  readonly status?: "cancelled" | "dispatched" | "dispatching" | "failed" | "paused" | "pending" | undefined;
10
12
  } | undefined) => import("effect/Stream").Stream<{
11
13
  readonly items: readonly {
12
14
  readonly id: string & import("effect/Brand").Brand<"ScheduledMessageId">;
15
+ readonly namespaceId: (string & import("effect/Brand").Brand<"NamespaceId">) | null;
13
16
  readonly status: "cancelled" | "dispatched" | "dispatching" | "failed" | "paused" | "pending";
14
17
  readonly scheduledFor: string;
15
18
  readonly timezone: string;
@@ -332,9 +335,11 @@ export declare const list: ((input?: {
332
335
  readonly items: (input?: {
333
336
  readonly limit?: number | null | undefined;
334
337
  readonly cursor?: string | undefined;
338
+ readonly namespaceId?: string | undefined;
335
339
  readonly status?: "cancelled" | "dispatched" | "dispatching" | "failed" | "paused" | "pending" | undefined;
336
340
  } | undefined) => import("effect/Stream").Stream<{
337
341
  readonly id: string & import("effect/Brand").Brand<"ScheduledMessageId">;
342
+ readonly namespaceId: (string & import("effect/Brand").Brand<"NamespaceId">) | null;
338
343
  readonly status: "cancelled" | "dispatched" | "dispatching" | "failed" | "paused" | "pending";
339
344
  readonly scheduledFor: string;
340
345
  readonly timezone: string;
@@ -654,6 +659,7 @@ export declare const list: ((input?: {
654
659
  }, 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>;
655
660
  };
656
661
  export declare const create: (input: {
662
+ readonly namespaceId?: string | null | undefined;
657
663
  readonly send: {
658
664
  readonly conversationId?: string | null | undefined;
659
665
  readonly metadata?: {
@@ -31,7 +31,6 @@ export declare const list: ((input?: {
31
31
  readonly shared: boolean;
32
32
  readonly entryPath: string;
33
33
  readonly status: "approved" | "archived" | "draft" | "pending" | "published" | "rejected";
34
- readonly isActive: boolean;
35
34
  readonly publishedAt: string | null;
36
35
  readonly brand: {
37
36
  readonly slug: string;
@@ -69,7 +68,6 @@ export declare const list: ((input?: {
69
68
  readonly shared: boolean;
70
69
  readonly entryPath: string;
71
70
  readonly status: "approved" | "archived" | "draft" | "pending" | "published" | "rejected";
72
- readonly isActive: boolean;
73
71
  readonly publishedAt: string | null;
74
72
  readonly brand: {
75
73
  readonly slug: string;
@@ -94,7 +92,6 @@ export declare const create: (input: {
94
92
  readonly useBrand?: boolean | null | undefined;
95
93
  readonly description?: string | null | undefined;
96
94
  readonly category?: "alert" | "marketing" | "notification" | "reminder" | "support" | "transactional" | "verification" | null | undefined;
97
- readonly isActive?: boolean | null | undefined;
98
95
  readonly namespaceId?: string | null | undefined;
99
96
  readonly shared?: boolean | null | undefined;
100
97
  }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesCreate">;
@@ -128,7 +125,6 @@ export declare const listFamilies: ((input?: {
128
125
  readonly slug: string;
129
126
  readonly channel: "email" | "sms" | "whatsapp";
130
127
  readonly status: "approved" | "archived" | "draft" | "pending" | "published" | "rejected";
131
- readonly isActive: boolean;
132
128
  readonly createdAt: string;
133
129
  readonly updatedAt: string;
134
130
  }[];
@@ -149,7 +145,6 @@ export declare const listFamilies: ((input?: {
149
145
  readonly slug: string;
150
146
  readonly channel: "email" | "sms" | "whatsapp";
151
147
  readonly status: "approved" | "archived" | "draft" | "pending" | "published" | "rejected";
152
- readonly isActive: boolean;
153
148
  readonly createdAt: string;
154
149
  readonly updatedAt: string;
155
150
  }[];
@@ -185,9 +180,13 @@ export declare const detachFamilyMember: (input: {
185
180
  export declare const getById: (input: {
186
181
  readonly id: string;
187
182
  }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesGetById">;
188
- export declare const remove: (input: {
183
+ declare const deleteTemplate: (input: {
189
184
  readonly id: string;
190
- }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesRemove">;
185
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesDelete">;
186
+ export { deleteTemplate as delete };
187
+ export declare const deleteProject: (input: {
188
+ readonly id: string;
189
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesDeleteProject">;
191
190
  export declare const update: (input: {
192
191
  readonly id: string;
193
192
  readonly data: {
@@ -205,7 +204,6 @@ export declare const update: (input: {
205
204
  readonly opens?: boolean | null | undefined;
206
205
  readonly clicks?: boolean | null | undefined;
207
206
  } | null | undefined;
208
- readonly isActive?: boolean | null | undefined;
209
207
  readonly shared?: boolean | null | undefined;
210
208
  };
211
209
  }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesUpdate">;
@@ -14,7 +14,9 @@ var templates_exports = /* @__PURE__ */ __exportAll({
14
14
  createFamily: () => createFamily,
15
15
  createFamilyFromTemplate: () => createFamilyFromTemplate,
16
16
  createFromWebsite: () => createFromWebsite,
17
+ delete: () => deleteTemplate,
17
18
  deleteFamily: () => deleteFamily,
19
+ deleteProject: () => deleteProject,
18
20
  detachFamilyMember: () => detachFamilyMember,
19
21
  diffWorkspace: () => diffWorkspace,
20
22
  getById: () => getById,
@@ -30,7 +32,6 @@ var templates_exports = /* @__PURE__ */ __exportAll({
30
32
  patchWorkspace: () => patchWorkspace,
31
33
  publish: () => publish,
32
34
  putWorkspaceAsset: () => putWorkspaceAsset,
33
- remove: () => remove,
34
35
  removeWorkspaceResource: () => removeWorkspaceResource,
35
36
  renameFamily: () => renameFamily,
36
37
  renderPublication: () => renderPublication,
@@ -55,7 +56,8 @@ const createFamilyFromTemplate = /* @__PURE__ */ make("templatesCreateFamilyFrom
55
56
  const attachFamilyMember = /* @__PURE__ */ make("templatesAttachFamilyMember");
56
57
  const detachFamilyMember = /* @__PURE__ */ make("templatesDetachFamilyMember");
57
58
  const getById = /* @__PURE__ */ make("templatesGetById");
58
- const remove = /* @__PURE__ */ make("templatesRemove");
59
+ const deleteTemplate = /* @__PURE__ */ make("templatesDelete");
60
+ const deleteProject = /* @__PURE__ */ make("templatesDeleteProject");
59
61
  const update = /* @__PURE__ */ make("templatesUpdate");
60
62
  const openWorkspace = /* @__PURE__ */ make("templatesOpenWorkspace");
61
63
  const getGitRepository = /* @__PURE__ */ make("templatesGetGitRepository");
@@ -76,6 +78,6 @@ const listInputContracts = /* @__PURE__ */ make("templatesListInputContracts");
76
78
  const getInputContract = /* @__PURE__ */ make("templatesGetInputContract");
77
79
  const diffWorkspace = /* @__PURE__ */ make("templatesDiffWorkspace");
78
80
  const workspaceHistory = /* @__PURE__ */ make("templatesWorkspaceHistory");
79
- export { CreateTemplatePayload as CreatePayload, UpdateTemplatePayload as UpdatePayload, addEntry, attachFamilyMember, attachWorkspaceResource, checkWorkspace, create, createFamily, createFamilyFromTemplate, createFromWebsite, deleteFamily, detachFamilyMember, diffWorkspace, getById, getFamily, getGitRepository, getInputContract, getPublication, issueGitCredential, list, listFamilies, listInputContracts, openWorkspace, patchWorkspace, publish, putWorkspaceAsset, remove, removeWorkspaceResource, renameFamily, renderPublication, renderWorkspaceFixture, resolveWorkspaceConflict, restoreWorkspace, saveWorkspace, templates_exports, update, workspaceHistory };
81
+ export { CreateTemplatePayload as CreatePayload, UpdateTemplatePayload as UpdatePayload, addEntry, attachFamilyMember, attachWorkspaceResource, checkWorkspace, create, createFamily, createFamilyFromTemplate, createFromWebsite, deleteTemplate as delete, deleteFamily, deleteProject, detachFamilyMember, diffWorkspace, getById, getFamily, getGitRepository, getInputContract, getPublication, issueGitCredential, list, listFamilies, listInputContracts, openWorkspace, patchWorkspace, publish, putWorkspaceAsset, removeWorkspaceResource, renameFamily, renderPublication, renderWorkspaceFixture, resolveWorkspaceConflict, restoreWorkspace, saveWorkspace, templates_exports, update, workspaceHistory };
80
82
 
81
83
  //# sourceMappingURL=templates.js.map
@@ -74,11 +74,11 @@ export declare const listSubscriptions: ((input: {
74
74
  export declare const setSubscriptions: (input: {
75
75
  readonly id: string;
76
76
  readonly contacts: readonly ({
77
+ readonly contactId: string;
78
+ } | {
77
79
  readonly email: string;
78
80
  } | {
79
81
  readonly phone: string;
80
- } | {
81
- readonly contactId: string;
82
82
  })[];
83
83
  readonly channel: "email" | "sms" | "whatsapp";
84
84
  readonly status: "subscribed" | "unsubscribed";
@@ -2,12 +2,14 @@ export { CreateWebhookPayload as CreatePayload, TestWebhookPayload as TestPayloa
2
2
  export declare const list: ((input?: {
3
3
  readonly limit?: number | null | undefined;
4
4
  readonly cursor?: string | undefined;
5
+ readonly namespaceId?: string | undefined;
5
6
  readonly search?: string | undefined;
6
7
  readonly status?: "active" | "disabled" | undefined;
7
8
  } | undefined, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"webhooksList">) & {
8
9
  readonly pages: (input?: {
9
10
  readonly limit?: number | null | undefined;
10
11
  readonly cursor?: string | undefined;
12
+ readonly namespaceId?: string | undefined;
11
13
  readonly search?: string | undefined;
12
14
  readonly status?: "active" | "disabled" | undefined;
13
15
  } | undefined) => import("effect/Stream").Stream<{
@@ -15,7 +17,7 @@ export declare const list: ((input?: {
15
17
  readonly id: string & import("effect/Brand").Brand<"WebhookEndpointId">;
16
18
  readonly name: string;
17
19
  readonly url: string;
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")[];
20
+ 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" | "email.sending.paused" | "email.sending.resumed" | "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
21
  readonly channels: readonly ("email" | "sms" | "whatsapp")[] | null;
20
22
  readonly mailboxIds: readonly (string & import("effect/Brand").Brand<"MailboxId">)[] | null;
21
23
  readonly namespaceId: (string & import("effect/Brand").Brand<"NamespaceId">) | null;
@@ -38,13 +40,14 @@ export declare const list: ((input?: {
38
40
  readonly items: (input?: {
39
41
  readonly limit?: number | null | undefined;
40
42
  readonly cursor?: string | undefined;
43
+ readonly namespaceId?: string | undefined;
41
44
  readonly search?: string | undefined;
42
45
  readonly status?: "active" | "disabled" | undefined;
43
46
  } | undefined) => import("effect/Stream").Stream<{
44
47
  readonly id: string & import("effect/Brand").Brand<"WebhookEndpointId">;
45
48
  readonly name: string;
46
49
  readonly url: string;
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")[];
50
+ 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" | "email.sending.paused" | "email.sending.resumed" | "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
51
  readonly channels: readonly ("email" | "sms" | "whatsapp")[] | null;
49
52
  readonly mailboxIds: readonly (string & import("effect/Brand").Brand<"MailboxId">)[] | null;
50
53
  readonly namespaceId: (string & import("effect/Brand").Brand<"NamespaceId">) | null;
@@ -66,7 +69,7 @@ export declare const list: ((input?: {
66
69
  export declare const create: (input: {
67
70
  readonly name: string;
68
71
  readonly url: string;
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")[];
72
+ 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" | "email.sending.paused" | "email.sending.resumed" | "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
73
  readonly channels?: readonly ("email" | "sms" | "whatsapp")[] | null | undefined;
71
74
  readonly mailboxIds?: readonly string[] | null | undefined;
72
75
  readonly namespaceId?: string | null | undefined;
@@ -88,7 +91,7 @@ export declare const update: (input: {
88
91
  readonly id: string;
89
92
  readonly name?: string | null | undefined;
90
93
  readonly url?: string | null | undefined;
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;
94
+ 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" | "email.sending.paused" | "email.sending.resumed" | "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
95
  readonly channels?: readonly ("email" | "sms" | "whatsapp")[] | null | undefined;
93
96
  readonly mailboxIds?: readonly string[] | null | undefined;
94
97
  readonly namespaceId?: string | null | undefined;
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, MalformedRequestError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTransportError, SenderNotReadyError, ServiceUnavailableError, TemplateSourceError, UnauthorizedError, ValidationError, WhatsAppServiceWindowClosedError, 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, TemplateInUseError, 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, MalformedRequestError, MediaUploadError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTransportError, SenderNotReadyError, ServiceUnavailableError, TemplateSourceError, UnauthorizedError, ValidationError, WhatsAppServiceWindowClosedError, 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, TemplateInUseError, TemplateSourceError, UnauthorizedError, ValidationError, WhatsAppServiceWindowClosedError, createClient, fromApiError };
@@ -85,12 +85,18 @@ const fixtures = {
85
85
  ...common,
86
86
  action: {
87
87
  state: "approvalRequired",
88
+ reviewRound: 1,
88
89
  decision: {
89
- outcome: "requireApproval",
90
+ id: "pdec_0000000000000000",
91
+ reviewRound: 1,
92
+ requirement: "person",
93
+ decider: "person",
94
+ outcome: "hold",
90
95
  reason: "Approval required",
91
- policyId: null,
92
- source: "installation",
93
- decidedAt: timestamp
96
+ scopes: [{
97
+ kind: "mailbox",
98
+ id: common.mailboxId
99
+ }]
94
100
  },
95
101
  id: "mbxact_0000000000000000",
96
102
  type: "sendMessage",
@@ -110,6 +116,7 @@ const fixtures = {
110
116
  action: {
111
117
  id: "mbxact_0000000000000000",
112
118
  type: "sendMessage",
119
+ reviewRound: 1,
113
120
  threadId: message.threadId,
114
121
  proposedBy: actor,
115
122
  createdAt: timestamp
@@ -1,5 +1,4 @@
1
1
  import type { SamvaClient } from "../promises/client";
2
- type SendResult = Awaited<ReturnType<SamvaClient["mailboxes"]["reply"]>>;
3
2
  export type ExtensionManifest = {
4
3
  readonly name: string;
5
4
  readonly displayName: string;
@@ -35,6 +34,41 @@ export type ActionResolution = {
35
34
  /** The denial reason; null for an approval or a cancellation. */
36
35
  readonly reason: string | null;
37
36
  };
37
+ /** Why a mailbox action was allowed, held, or refused. */
38
+ export type ActionDecision = {
39
+ readonly id: string;
40
+ readonly reviewRound: number;
41
+ readonly requirement: "run" | "model" | "person" | "never";
42
+ readonly decider: "rule" | "model" | "person" | "agent";
43
+ readonly outcome: "allow" | "hold" | "refuse";
44
+ readonly reason: string;
45
+ readonly scopes: readonly PolicyScope[];
46
+ readonly rule?: {
47
+ readonly scope: PolicyScope;
48
+ readonly index: number;
49
+ } | undefined;
50
+ readonly guard?: string | undefined;
51
+ readonly guardReason?: string | undefined;
52
+ readonly resolution?: {
53
+ readonly by: string;
54
+ readonly at: string;
55
+ readonly as: "approved" | "edited" | "denied" | "alwaysAllowed";
56
+ readonly diff?: {
57
+ readonly text?: {
58
+ readonly before: string | null;
59
+ readonly after: string | null;
60
+ } | undefined;
61
+ readonly html?: {
62
+ readonly before: string | null;
63
+ readonly after: string | null;
64
+ } | undefined;
65
+ } | undefined;
66
+ } | undefined;
67
+ };
68
+ type PolicyScope = {
69
+ readonly kind: "organization" | "mailbox" | "agent" | "apiKey";
70
+ readonly id: string;
71
+ };
38
72
  export type CampaignAttribution = {
39
73
  readonly campaignId: string;
40
74
  readonly runId: string;
@@ -89,9 +123,10 @@ export type EventData = {
89
123
  "mailbox.action.pending_approval": MailboxEventScope & {
90
124
  readonly action: {
91
125
  readonly state?: "approvalRequired";
92
- readonly decision?: Readonly<NonNullable<SendResult["decision"]>>;
126
+ readonly decision: ActionDecision;
127
+ readonly reviewRound: number;
93
128
  readonly id: string;
94
- readonly type: "sendMessage" | "reply" | "updateDraft" | "createNote" | "assignThread" | "changeThreadState" | "call" | "extensionRequest" | "toolCall";
129
+ readonly type: "sendMessage" | "reply" | "updateDraft" | "createNote" | "assignThread" | "changeThreadState" | "call" | "extensionRequest" | "toolCall" | "handoff";
95
130
  readonly threadId: string | null;
96
131
  readonly reason: string | null;
97
132
  readonly proposedBy: WebhookActor;
@@ -115,6 +150,7 @@ export type EventData = {
115
150
  "mailbox.action.resolved": MailboxEventScope & {
116
151
  readonly action: {
117
152
  readonly id: string;
153
+ readonly reviewRound: number;
118
154
  readonly type: EventData["mailbox.action.pending_approval"]["action"]["type"];
119
155
  readonly threadId: string | null;
120
156
  readonly proposedBy: WebhookActor;
package/dist/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "0.35.0";
2
+ var version = "0.37.0";
3
3
  export { version };
4
4
 
5
5
  //# sourceMappingURL=package.js.map
@@ -27,7 +27,7 @@
27
27
  * ```
28
28
  */
29
29
  import { type Client, type Config } from "../client/client";
30
- import { Agents as agents, Analytics as analytics, ApiKeys as apiKeys, Attachments as attachments, Brands as brands, Campaigns as campaigns, ContactGroups as contactGroups, ContactEvents as contactEvents, Contacts as contacts, Conversations as conversations, CustomFields as customFields, Email as email, ExtensionInstallations as extensionInstallations, Extensions as extensions, Events as events, Feedback as feedback, Journeys as journeys, Mailboxes as mailboxes, Media as media, Messages as messages, Namespaces as namespaces, Operations as operations, Organizations as organizations, ScheduledMessages as scheduledMessages, Subscriptions as subscriptions, Templates as templates, Topics as topics, TopicForms as topicForms, Newsletters as newsletters, Webhooks as webhooks, Whoami as whoami } from "../client/sdk.gen";
30
+ import { Agents as agents, Analytics as analytics, ApiKeys as apiKeys, Attachments as attachments, Brands as brands, Campaigns as campaigns, ContactGroups as contactGroups, ContactEvents as contactEvents, Contacts as contacts, Conversations as conversations, CustomFields as customFields, Email as email, ExtensionInstallations as extensionInstallations, Extensions as extensions, Events as events, Feedback as feedback, Journeys as journeys, Mailboxes as mailboxes, Media as media, Messages as messages, Namespaces as namespaces, Operations as operations, Organizations as organizations, Policies as policies, ScheduledMessages as scheduledMessages, Subscriptions as subscriptions, Templates as templates, Topics as topics, TopicForms as topicForms, Newsletters as newsletters, Webhooks as webhooks, Whoami as whoami } from "../client/sdk.gen";
31
31
  import type { MessagesSendData } from "../client/types.gen";
32
32
  import { MailboxEventStream, type MailboxEventStreamOptions } from "../mailbox-events";
33
33
  import { type RequestPolicy } from "./request";
@@ -143,6 +143,7 @@ export interface SamvaRawClient {
143
143
  readonly operations: typeof operations;
144
144
  readonly apiKeys: typeof apiKeys;
145
145
  readonly organizations: typeof organizations;
146
+ readonly policies: typeof policies;
146
147
  readonly attachments: typeof attachments;
147
148
  readonly contactGroups: typeof contactGroups;
148
149
  readonly customFields: typeof customFields;
@@ -185,6 +186,7 @@ export interface SamvaClient {
185
186
  readonly operations: DirectService<typeof operations>;
186
187
  readonly apiKeys: DirectService<typeof apiKeys>;
187
188
  readonly organizations: DirectService<typeof organizations>;
189
+ readonly policies: DirectService<typeof policies>;
188
190
  readonly attachments: DirectService<typeof attachments>;
189
191
  readonly contactGroups: DirectService<typeof contactGroups>;
190
192
  readonly customFields: DirectService<typeof customFields>;
@@ -2,9 +2,9 @@ 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, MalformedRequestError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTransportError, SenderNotReadyError, ServiceUnavailableError, TemplateSourceError, UnauthorizedError, ValidationError, WhatsAppServiceWindowClosedError, 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, TemplateInUseError, TemplateSourceError, UnauthorizedError, ValidationError, WhatsAppServiceWindowClosedError, fromApiError } from "./errors.gen.js";
6
6
  import { configureRequests } from "./request.js";
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";
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, Policies, ScheduledMessages, Subscriptions, Templates, TopicForms, Topics, Webhooks, Whoami } from "../client/sdk.gen.js";
8
8
  import { MediaUploadError, mediaCreateBody, planInlineUploads, withUploadedAttachments } from "../inline-attachments.js";
9
9
  import { MailboxEventStream } from "../mailbox-events.js";
10
10
  import { buildEmailSendPayload, buildMessagesSendPayload, replyToEmailsPayload } from "../normalize.js";
@@ -256,6 +256,7 @@ function makeClient(config) {
256
256
  operations: createBoundService(Operations, clientInstance),
257
257
  apiKeys: createBoundService(ApiKeys, clientInstance),
258
258
  organizations: createBoundService(Organizations, clientInstance),
259
+ policies: createBoundService(Policies, clientInstance),
259
260
  attachments: createBoundService(Attachments, clientInstance),
260
261
  contactGroups: createBoundService(ContactGroups, clientInstance),
261
262
  customFields: createBoundService(CustomFields, clientInstance),
@@ -296,6 +297,7 @@ function makeClient(config) {
296
297
  operations: createDirectService(raw.operations),
297
298
  apiKeys: createDirectService(raw.apiKeys),
298
299
  organizations: createDirectService(raw.organizations),
300
+ policies: createDirectService(raw.policies),
299
301
  attachments: createDirectService(raw.attachments),
300
302
  contactGroups: createDirectService(raw.contactGroups),
301
303
  customFields: createDirectService(raw.customFields),
@@ -319,6 +321,6 @@ function makeClient(config) {
319
321
  }));
320
322
  return result;
321
323
  }
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 };
324
+ 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, TemplateInUseError, TemplateSourceError, UnauthorizedError, ValidationError, WhatsAppServiceWindowClosedError, clientWithIdempotency, createBoundClient, createClient, fromApiError };
323
325
 
324
326
  //# 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" | "MalformedRequestError" | "OnboardingReviewRequiredError" | "PaymentRequiredError" | "RateLimitedError" | "ResourceNotFoundError" | "SenderNotReadyError" | "ServiceUnavailableError" | "TemplateSourceError" | "UnauthorizedError" | "ValidationError" | "WhatsAppServiceWindowClosedError";
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" | "TemplateInUseError" | "TemplateSourceError" | "UnauthorizedError" | "ValidationError" | "WhatsAppServiceWindowClosedError";
3
3
  export interface SamvaApiErrorContext {
4
4
  readonly request?: Request | undefined;
5
5
  readonly response?: Response | undefined;
@@ -253,6 +253,22 @@ export declare class ServiceUnavailableError extends SamvaApiError<"ServiceUnava
253
253
  readonly "retryAfterSeconds": number;
254
254
  constructor(payload: Omit<ServiceUnavailableErrorPayload, "_tag">, context?: SamvaApiErrorContext);
255
255
  }
256
+ type TemplateInUseErrorPayload = {
257
+ readonly _tag: "TemplateInUseError";
258
+ readonly message: string;
259
+ readonly references: Array<{
260
+ readonly kind: string;
261
+ readonly id: string;
262
+ }>;
263
+ };
264
+ export declare class TemplateInUseError extends SamvaApiError<"TemplateInUseError"> {
265
+ readonly _tag: "TemplateInUseError";
266
+ readonly "references": Array<{
267
+ readonly kind: string;
268
+ readonly id: string;
269
+ }>;
270
+ constructor(payload: Omit<TemplateInUseErrorPayload, "_tag">, context?: SamvaApiErrorContext);
271
+ }
256
272
  type TemplateSourceErrorPayload = {
257
273
  readonly _tag: "TemplateSourceError";
258
274
  readonly diagnostics: Array<{
@@ -337,7 +353,7 @@ export declare class WhatsAppServiceWindowClosedError extends SamvaApiError<"Wha
337
353
  readonly "closedAt": string | null;
338
354
  constructor(payload: Omit<WhatsAppServiceWindowClosedErrorPayload, "_tag">, context?: SamvaApiErrorContext);
339
355
  }
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;
356
+ 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 | TemplateInUseError | TemplateSourceError | UnauthorizedError | ValidationError | WhatsAppServiceWindowClosedError;
341
357
  /** Convert a decoded error payload into its generated JavaScript error class. */
342
358
  export declare function fromApiError(error: unknown, context?: SamvaApiErrorContext): AnySamvaApiError | SamvaTransportError;
343
359
  export {};