samva 0.29.1 → 0.30.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 (185) hide show
  1. package/AGENTS.md +23 -5
  2. package/README.md +166 -133
  3. package/dist/_virtual/_rolldown/runtime.js +1 -2
  4. package/dist/client/client/client.gen.js +1 -2
  5. package/dist/client/client/utils.gen.js +1 -2
  6. package/dist/client/client.gen.js +1 -2
  7. package/dist/client/core/auth.gen.js +1 -2
  8. package/dist/client/core/bodySerializer.gen.js +1 -2
  9. package/dist/client/core/params.gen.js +1 -2
  10. package/dist/client/core/pathSerializer.gen.js +1 -2
  11. package/dist/client/core/serverSentEvents.gen.js +1 -2
  12. package/dist/client/core/utils.gen.js +1 -2
  13. package/dist/client/sdk.gen.d.ts +216 -191
  14. package/dist/client/sdk.gen.js +2392 -1153
  15. package/dist/client/types.gen.d.ts +766 -376
  16. package/dist/client-attribution.js +1 -2
  17. package/dist/effect/agents.d.ts +33 -11
  18. package/dist/effect/agents.js +1 -2
  19. package/dist/effect/analytics.d.ts +6 -6
  20. package/dist/effect/analytics.js +1 -2
  21. package/dist/effect/api-keys.d.ts +8 -8
  22. package/dist/effect/api-keys.js +1 -2
  23. package/dist/effect/attachments.d.ts +4 -4
  24. package/dist/effect/attachments.js +1 -2
  25. package/dist/effect/brands.d.ts +6 -6
  26. package/dist/effect/brands.js +1 -2
  27. package/dist/effect/campaigns.d.ts +15 -16
  28. package/dist/effect/campaigns.js +1 -2
  29. package/dist/effect/categories.js +1 -2
  30. package/dist/effect/client.js +1 -2
  31. package/dist/effect/contact-groups.d.ts +10 -10
  32. package/dist/effect/contact-groups.js +1 -2
  33. package/dist/effect/contacts.d.ts +23 -24
  34. package/dist/effect/contacts.js +1 -2
  35. package/dist/effect/conversations.d.ts +13 -13
  36. package/dist/effect/conversations.js +1 -2
  37. package/dist/effect/custom-fields.d.ts +4 -4
  38. package/dist/effect/custom-fields.js +1 -2
  39. package/dist/effect/email.d.ts +61 -63
  40. package/dist/effect/email.js +1 -2
  41. package/dist/effect/events.d.ts +2 -4
  42. package/dist/effect/events.js +1 -2
  43. package/dist/effect/extension-installations.d.ts +9 -9
  44. package/dist/effect/extension-installations.js +1 -2
  45. package/dist/effect/extensions.d.ts +5 -5
  46. package/dist/effect/extensions.js +1 -2
  47. package/dist/effect/feedback.d.ts +1 -1
  48. package/dist/effect/feedback.js +1 -2
  49. package/dist/effect/generated/agents.d.ts +264 -22
  50. package/dist/effect/generated/agents.js +2 -3
  51. package/dist/effect/generated/analytics.js +1 -2
  52. package/dist/effect/generated/api-keys.js +1 -2
  53. package/dist/effect/generated/attachments.js +1 -2
  54. package/dist/effect/generated/brands.js +1 -2
  55. package/dist/effect/generated/campaigns.d.ts +160 -155
  56. package/dist/effect/generated/campaigns.js +7 -9
  57. package/dist/effect/generated/contact-events.js +1 -2
  58. package/dist/effect/generated/contact-groups.d.ts +26 -26
  59. package/dist/effect/generated/contact-groups.js +22 -19
  60. package/dist/effect/generated/contacts.d.ts +119 -90
  61. package/dist/effect/generated/contacts.js +32 -32
  62. package/dist/effect/generated/conversations.d.ts +22 -22
  63. package/dist/effect/generated/conversations.js +7 -8
  64. package/dist/effect/generated/custom-fields.d.ts +6 -6
  65. package/dist/effect/generated/custom-fields.js +3 -4
  66. package/dist/effect/generated/email.d.ts +38 -38
  67. package/dist/effect/generated/email.js +13 -14
  68. package/dist/effect/generated/events.d.ts +18 -9
  69. package/dist/effect/generated/events.js +8 -6
  70. package/dist/effect/generated/extension-installations.d.ts +2 -2
  71. package/dist/effect/generated/extension-installations.js +6 -3
  72. package/dist/effect/generated/extensions.js +1 -2
  73. package/dist/effect/generated/feedback.js +1 -2
  74. package/dist/effect/generated/index.d.ts +7 -5
  75. package/dist/effect/generated/journeys.js +1 -2
  76. package/dist/effect/generated/mailboxes.d.ts +44 -44
  77. package/dist/effect/generated/mailboxes.js +17 -18
  78. package/dist/effect/generated/media.js +1 -2
  79. package/dist/effect/generated/messages.d.ts +42 -42
  80. package/dist/effect/generated/messages.js +3 -4
  81. package/dist/effect/generated/namespaces.js +1 -2
  82. package/dist/effect/generated/{publication-domains.d.ts → newsletter-domains.d.ts} +304 -80
  83. package/dist/effect/generated/newsletter-domains.js +218 -0
  84. package/dist/effect/generated/{topic-issues.d.ts → newsletter-issues.d.ts} +330 -288
  85. package/dist/effect/generated/{topic-issues.js → newsletter-issues.js} +255 -246
  86. package/dist/effect/generated/newsletters.d.ts +741 -0
  87. package/dist/effect/generated/newsletters.js +143 -0
  88. package/dist/effect/generated/operations.js +1 -2
  89. package/dist/effect/generated/organizations.d.ts +9 -9
  90. package/dist/effect/generated/organizations.js +4 -5
  91. package/dist/effect/generated/scheduled-messages.d.ts +174 -169
  92. package/dist/effect/generated/scheduled-messages.js +7 -7
  93. package/dist/effect/generated/shared.d.ts +276 -208
  94. package/dist/effect/generated/shared.js +50 -36
  95. package/dist/effect/generated/subscriptions.js +1 -2
  96. package/dist/effect/generated/templates.d.ts +118 -67
  97. package/dist/effect/generated/templates.js +43 -35
  98. package/dist/effect/generated/topic-forms.d.ts +79 -19
  99. package/dist/effect/generated/topic-forms.js +13 -14
  100. package/dist/effect/generated/topics.d.ts +27 -65
  101. package/dist/effect/generated/topics.js +13 -20
  102. package/dist/effect/generated/webhooks.d.ts +9 -9
  103. package/dist/effect/generated/webhooks.js +4 -5
  104. package/dist/effect/generated/whoami.js +1 -2
  105. package/dist/effect/generated-metadata.d.ts +475 -70
  106. package/dist/effect/generated-metadata.js +642 -432
  107. package/dist/effect/index.d.ts +3 -2
  108. package/dist/effect/index.js +4 -3
  109. package/dist/effect/internal/client.d.ts +5 -0
  110. package/dist/effect/internal/client.js +9 -5
  111. package/dist/effect/internal/email-sender.d.ts +1 -1
  112. package/dist/effect/internal/email-sender.js +4 -3
  113. package/dist/effect/internal/mailbox-events.js +1 -2
  114. package/dist/effect/internal/operation.d.ts +4 -15
  115. package/dist/effect/internal/operation.js +21 -33
  116. package/dist/effect/internal/send.js +2 -3
  117. package/dist/effect/journeys.d.ts +14 -14
  118. package/dist/effect/journeys.js +1 -2
  119. package/dist/effect/mailboxes.d.ts +60 -70
  120. package/dist/effect/mailboxes.js +1 -2
  121. package/dist/effect/media.d.ts +5 -5
  122. package/dist/effect/media.js +1 -2
  123. package/dist/effect/messages.d.ts +9 -9
  124. package/dist/effect/messages.js +1 -2
  125. package/dist/effect/namespaces.d.ts +8 -8
  126. package/dist/effect/namespaces.js +1 -2
  127. package/dist/effect/newsletter-domains.d.ts +71 -0
  128. package/dist/effect/newsletter-domains.js +18 -0
  129. package/dist/effect/{topic-issues.d.ts → newsletter-issues.d.ts} +11 -15
  130. package/dist/effect/newsletter-issues.js +32 -0
  131. package/dist/effect/newsletters.d.ts +22 -0
  132. package/dist/effect/newsletters.js +20 -0
  133. package/dist/effect/operations.d.ts +3 -3
  134. package/dist/effect/operations.js +1 -2
  135. package/dist/effect/organizations.d.ts +8 -10
  136. package/dist/effect/organizations.js +1 -2
  137. package/dist/effect/pagination.js +1 -2
  138. package/dist/effect/retry.d.ts +4 -4
  139. package/dist/effect/retry.js +5 -6
  140. package/dist/effect/runtime.js +1 -2
  141. package/dist/effect/scheduled-messages.d.ts +5 -6
  142. package/dist/effect/scheduled-messages.js +1 -2
  143. package/dist/effect/subscriptions.d.ts +1 -1
  144. package/dist/effect/subscriptions.js +1 -2
  145. package/dist/effect/templates.d.ts +34 -43
  146. package/dist/effect/templates.js +1 -2
  147. package/dist/effect/topic-forms.d.ts +5 -5
  148. package/dist/effect/topic-forms.js +1 -2
  149. package/dist/effect/topics.d.ts +9 -13
  150. package/dist/effect/topics.js +1 -2
  151. package/dist/effect/webhooks.d.ts +11 -11
  152. package/dist/effect/webhooks.js +1 -2
  153. package/dist/effect/whoami.d.ts +1 -1
  154. package/dist/effect/whoami.js +1 -2
  155. package/dist/index.js +2 -2
  156. package/dist/inline-attachments.js +1 -2
  157. package/dist/mailbox/dispatch.d.ts +10 -0
  158. package/dist/mailbox/dispatch.js +66 -0
  159. package/dist/mailbox/index.d.ts +17 -0
  160. package/dist/mailbox/index.js +30 -0
  161. package/dist/mailbox/test.d.ts +25 -0
  162. package/dist/mailbox/test.js +174 -0
  163. package/dist/mailbox/types.d.ts +184 -0
  164. package/dist/mailbox/webhook.d.ts +10 -0
  165. package/dist/mailbox/webhook.js +41 -0
  166. package/dist/mailbox-events.js +1 -2
  167. package/dist/normalize.js +1 -2
  168. package/dist/package.js +2 -3
  169. package/dist/promises/client.d.ts +215 -0
  170. package/dist/promises/client.js +324 -0
  171. package/dist/promises/errors.gen.js +1 -2
  172. package/dist/promises/index.d.ts +2 -196
  173. package/dist/promises/index.js +3 -295
  174. package/dist/promises/request.d.ts +15 -0
  175. package/dist/promises/request.js +75 -0
  176. package/dist/promises/types.gen.d.ts +1 -1
  177. package/dist/request-policy.d.ts +3 -0
  178. package/dist/request-policy.js +16 -0
  179. package/dist/service-map.d.ts +78 -47
  180. package/dist/service-map.js +52 -32
  181. package/package.json +34 -18
  182. package/dist/effect/generated/publication-domains.js +0 -163
  183. package/dist/effect/publication-domains.d.ts +0 -14
  184. package/dist/effect/publication-domains.js +0 -17
  185. package/dist/effect/topic-issues.js +0 -33
@@ -9,7 +9,7 @@ export declare const list: ((input?: {
9
9
  readonly projectId?: string | null | undefined;
10
10
  readonly namespaceId?: string | null | undefined;
11
11
  readonly shared?: boolean | null | undefined;
12
- } | undefined) => import("./internal/operation").OperationResult<"templatesList">) & {
12
+ } | undefined, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesList">) & {
13
13
  readonly pages: (input?: {
14
14
  readonly limit?: number | null | undefined;
15
15
  readonly cursor?: string | null | undefined;
@@ -97,14 +97,12 @@ export declare const create: (input: {
97
97
  readonly isActive?: boolean | null | undefined;
98
98
  readonly namespaceId?: string | null | undefined;
99
99
  readonly shared?: boolean | null | undefined;
100
- readonly idempotencyKey: string;
101
- }) => import("./internal/operation").OperationResult<"templatesCreate">;
100
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesCreate">;
102
101
  export declare const createFromWebsite: (input: {
103
102
  readonly url: string;
104
103
  readonly name?: string | null | undefined;
105
104
  readonly namespaceId?: string | null | undefined;
106
- readonly idempotencyKey: string;
107
- }) => import("./internal/operation").OperationResult<"templatesCreateFromWebsite">;
105
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesCreateFromWebsite">;
108
106
  export declare const addEntry: (input: {
109
107
  readonly id: string;
110
108
  readonly entryPath: string;
@@ -112,11 +110,11 @@ export declare const addEntry: (input: {
112
110
  readonly slug: string;
113
111
  readonly description?: string | null | undefined;
114
112
  readonly category?: "alert" | "marketing" | "notification" | "reminder" | "support" | "transactional" | "verification" | null | undefined;
115
- }) => import("./internal/operation").OperationResult<"templatesAddEntry">;
113
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesAddEntry">;
116
114
  export declare const listFamilies: ((input?: {
117
115
  readonly limit?: number | null | undefined;
118
116
  readonly cursor?: string | null | undefined;
119
- } | undefined) => import("./internal/operation").OperationResult<"templatesListFamilies">) & {
117
+ } | undefined, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesListFamilies">) & {
120
118
  readonly pages: (input?: {
121
119
  readonly limit?: number | null | undefined;
122
120
  readonly cursor?: string | null | undefined;
@@ -161,35 +159,35 @@ export declare const listFamilies: ((input?: {
161
159
  };
162
160
  export declare const createFamily: (input: {
163
161
  readonly name: string;
164
- }) => import("./internal/operation").OperationResult<"templatesCreateFamily">;
162
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesCreateFamily">;
165
163
  export declare const getFamily: (input: {
166
164
  readonly id: string;
167
- }) => import("./internal/operation").OperationResult<"templatesGetFamily">;
165
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesGetFamily">;
168
166
  export declare const deleteFamily: (input: {
169
167
  readonly id: string;
170
- }) => import("./internal/operation").OperationResult<"templatesDeleteFamily">;
168
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesDeleteFamily">;
171
169
  export declare const renameFamily: (input: {
172
170
  readonly id: string;
173
171
  readonly name: string;
174
- }) => import("./internal/operation").OperationResult<"templatesRenameFamily">;
172
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesRenameFamily">;
175
173
  export declare const createFamilyFromTemplate: (input: {
176
174
  readonly templateId: string;
177
175
  readonly name: string;
178
- }) => import("./internal/operation").OperationResult<"templatesCreateFamilyFromTemplate">;
176
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesCreateFamilyFromTemplate">;
179
177
  export declare const attachFamilyMember: (input: {
180
178
  readonly id: string;
181
179
  readonly templateId: string;
182
- }) => import("./internal/operation").OperationResult<"templatesAttachFamilyMember">;
180
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesAttachFamilyMember">;
183
181
  export declare const detachFamilyMember: (input: {
184
182
  readonly id: string;
185
183
  readonly templateId: string;
186
- }) => import("./internal/operation").OperationResult<"templatesDetachFamilyMember">;
184
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesDetachFamilyMember">;
187
185
  export declare const getById: (input: {
188
186
  readonly id: string;
189
- }) => import("./internal/operation").OperationResult<"templatesGetById">;
187
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesGetById">;
190
188
  export declare const remove: (input: {
191
189
  readonly id: string;
192
- }) => import("./internal/operation").OperationResult<"templatesRemove">;
190
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesRemove">;
193
191
  export declare const update: (input: {
194
192
  readonly id: string;
195
193
  readonly data: {
@@ -210,17 +208,17 @@ export declare const update: (input: {
210
208
  readonly isActive?: boolean | null | undefined;
211
209
  readonly shared?: boolean | null | undefined;
212
210
  };
213
- }) => import("./internal/operation").OperationResult<"templatesUpdate">;
211
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesUpdate">;
214
212
  export declare const openWorkspace: (input: {
215
213
  readonly id: string;
216
- }) => import("./internal/operation").OperationResult<"templatesOpenWorkspace">;
214
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesOpenWorkspace">;
217
215
  export declare const getGitRepository: (input: {
218
216
  readonly id: string;
219
- }) => import("./internal/operation").OperationResult<"templatesGetGitRepository">;
217
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesGetGitRepository">;
220
218
  export declare const issueGitCredential: (input: {
221
219
  readonly id: string;
222
220
  readonly scope: "read" | "write";
223
- }) => import("./internal/operation").OperationResult<"templatesIssueGitCredential">;
221
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesIssueGitCredential">;
224
222
  export declare const patchWorkspace: (input: {
225
223
  readonly id: string;
226
224
  readonly expectedRevision: string;
@@ -228,16 +226,14 @@ export declare const patchWorkspace: (input: {
228
226
  readonly path: string;
229
227
  readonly content: string | null;
230
228
  }[];
231
- readonly idempotencyKey: string;
232
- }) => import("./internal/operation").OperationResult<"templatesPatchWorkspace">;
229
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesPatchWorkspace">;
233
230
  export declare const putWorkspaceAsset: (input: {
234
231
  readonly id: string;
235
232
  readonly expectedRevision: string;
236
233
  readonly path: string;
237
234
  readonly contentBase64: string;
238
235
  readonly replace: boolean;
239
- readonly idempotencyKey: string;
240
- }) => import("./internal/operation").OperationResult<"templatesPutWorkspaceAsset">;
236
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesPutWorkspaceAsset">;
241
237
  export declare const resolveWorkspaceConflict: (input: {
242
238
  readonly id: string;
243
239
  readonly expectedRevision: string;
@@ -245,8 +241,7 @@ export declare const resolveWorkspaceConflict: (input: {
245
241
  readonly resolution: "draft" | "main" | {
246
242
  readonly content: string | null;
247
243
  };
248
- readonly idempotencyKey: string;
249
- }) => import("./internal/operation").OperationResult<"templatesResolveWorkspaceConflict">;
244
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesResolveWorkspaceConflict">;
250
245
  export declare const attachWorkspaceResource: (input: {
251
246
  readonly id: string;
252
247
  readonly expectedRevision: string;
@@ -259,36 +254,32 @@ export declare const attachWorkspaceResource: (input: {
259
254
  readonly contentBase64: string;
260
255
  }[];
261
256
  };
262
- readonly idempotencyKey: string;
263
- }) => import("./internal/operation").OperationResult<"templatesAttachWorkspaceResource">;
257
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesAttachWorkspaceResource">;
264
258
  export declare const removeWorkspaceResource: (input: {
265
259
  readonly id: string;
266
260
  readonly resourceId: string;
267
261
  readonly expectedRevision: string;
268
- readonly idempotencyKey: string;
269
- }) => import("./internal/operation").OperationResult<"templatesRemoveWorkspaceResource">;
262
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesRemoveWorkspaceResource">;
270
263
  export declare const restoreWorkspace: (input: {
271
264
  readonly id: string;
272
265
  readonly expectedRevision: string;
273
266
  readonly commit: string;
274
- readonly idempotencyKey: string;
275
- }) => import("./internal/operation").OperationResult<"templatesRestoreWorkspace">;
267
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesRestoreWorkspace">;
276
268
  export declare const saveWorkspace: (input: {
277
269
  readonly id: string;
278
270
  readonly expectedRevision: string;
279
271
  readonly expectedHead: string;
280
272
  readonly message: string;
281
- readonly idempotencyKey: string;
282
- }) => import("./internal/operation").OperationResult<"templatesSaveWorkspace">;
273
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesSaveWorkspace">;
283
274
  export declare const checkWorkspace: (input: {
284
275
  readonly id: string;
285
276
  readonly expectedRevision: string;
286
- }) => import("./internal/operation").OperationResult<"templatesCheckWorkspace">;
277
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesCheckWorkspace">;
287
278
  export declare const renderWorkspaceFixture: (input: {
288
279
  readonly id: string;
289
280
  readonly expectedRevision: string;
290
281
  readonly fixture: string;
291
- }) => import("./internal/operation").OperationResult<"templatesRenderWorkspaceFixture">;
282
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesRenderWorkspaceFixture">;
292
283
  export declare const publish: (input: {
293
284
  readonly id: string;
294
285
  readonly projectId: string;
@@ -296,11 +287,11 @@ export declare const publish: (input: {
296
287
  readonly entryPath: string;
297
288
  readonly expectedWorkspaceRevision: string;
298
289
  readonly ifCurrentPublicationId?: string | null | undefined;
299
- }) => import("./internal/operation").OperationResult<"templatesPublish">;
290
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesPublish">;
300
291
  export declare const getPublication: (input: {
301
292
  readonly id: string;
302
293
  readonly publicationId: string;
303
- }) => import("./internal/operation").OperationResult<"templatesGetPublication">;
294
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesGetPublication">;
304
295
  export declare const renderPublication: (input: {
305
296
  readonly id: string;
306
297
  readonly publicationId: string;
@@ -333,12 +324,12 @@ export declare const renderPublication: (input: {
333
324
  };
334
325
  readonly locale?: string | undefined;
335
326
  readonly timeZone?: string | undefined;
336
- }) => import("./internal/operation").OperationResult<"templatesRenderPublication">;
327
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesRenderPublication">;
337
328
  export declare const listInputContracts: ((input: {
338
329
  readonly id: string;
339
330
  readonly limit?: number | null | undefined;
340
331
  readonly cursor?: string | null | undefined;
341
- }) => import("./internal/operation").OperationResult<"templatesListInputContracts">) & {
332
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesListInputContracts">) & {
342
333
  readonly pages: (input: {
343
334
  readonly id: string;
344
335
  readonly limit?: number | null | undefined;
@@ -376,12 +367,12 @@ export declare const listInputContracts: ((input: {
376
367
  export declare const getInputContract: (input: {
377
368
  readonly id: string;
378
369
  readonly inputContractId: string;
379
- }) => import("./internal/operation").OperationResult<"templatesGetInputContract">;
370
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesGetInputContract">;
380
371
  export declare const diffWorkspace: (input: {
381
372
  readonly id: string;
382
373
  readonly expectedRevision: string;
383
- }) => import("./internal/operation").OperationResult<"templatesDiffWorkspace">;
374
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesDiffWorkspace">;
384
375
  export declare const workspaceHistory: (input: {
385
376
  readonly id: string;
386
377
  readonly limit?: number | null | undefined;
387
- }) => import("./internal/operation").OperationResult<"templatesWorkspaceHistory">;
378
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"templatesWorkspaceHistory">;
@@ -2,7 +2,7 @@ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
2
  import { CreateTemplatePayload, UpdateTemplatePayload } from "./generated/shared.js";
3
3
  import { forGroup } from "./internal/operation.js";
4
4
  import { TemplatesGroup } from "./generated/templates.js";
5
- //#region src/effect/templates.ts
5
+ // src/effect/templates.ts
6
6
  var templates_exports = /* @__PURE__ */ __exportAll({
7
7
  CreatePayload: () => CreateTemplatePayload,
8
8
  UpdatePayload: () => UpdateTemplatePayload,
@@ -76,7 +76,6 @@ const listInputContracts = /* @__PURE__ */ make("templatesListInputContracts");
76
76
  const getInputContract = /* @__PURE__ */ make("templatesGetInputContract");
77
77
  const diffWorkspace = /* @__PURE__ */ make("templatesDiffWorkspace");
78
78
  const workspaceHistory = /* @__PURE__ */ make("templatesWorkspaceHistory");
79
- //#endregion
80
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
80
 
82
81
  //# sourceMappingURL=templates.js.map
@@ -1,10 +1,10 @@
1
1
  export declare const list: (input: {
2
2
  readonly id: string;
3
- }) => import("./internal/operation").OperationResult<"topicFormsList">;
3
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"topicFormsList">;
4
4
  export declare const get: (input: {
5
5
  readonly id: string;
6
6
  readonly formId: string;
7
- }) => import("./internal/operation").OperationResult<"topicFormsGet">;
7
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"topicFormsGet">;
8
8
  export declare const create: (input: {
9
9
  readonly id: string;
10
10
  readonly allowedOrigins: readonly string[];
@@ -13,7 +13,7 @@ export declare const create: (input: {
13
13
  readonly successTitle: string;
14
14
  readonly successMessage: string;
15
15
  readonly redirectUrl: string | null;
16
- }) => import("./internal/operation").OperationResult<"topicFormsCreate">;
16
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"topicFormsCreate">;
17
17
  export declare const update: (input: {
18
18
  readonly id: string;
19
19
  readonly formId: string;
@@ -23,8 +23,8 @@ export declare const update: (input: {
23
23
  readonly successTitle?: string | null | undefined;
24
24
  readonly successMessage?: string | null | undefined;
25
25
  readonly redirectUrl?: string | null | undefined;
26
- }) => import("./internal/operation").OperationResult<"topicFormsUpdate">;
26
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"topicFormsUpdate">;
27
27
  export declare const remove: (input: {
28
28
  readonly id: string;
29
29
  readonly formId: string;
30
- }) => import("./internal/operation").OperationResult<"topicFormsRemove">;
30
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"topicFormsRemove">;
@@ -1,7 +1,7 @@
1
1
  import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
2
  import { forGroup } from "./internal/operation.js";
3
3
  import { TopicFormsGroup } from "./generated/topic-forms.js";
4
- //#region src/effect/topic-forms.ts
4
+ // src/effect/topic-forms.ts
5
5
  var topic_forms_exports = /* @__PURE__ */ __exportAll({
6
6
  create: () => create,
7
7
  get: () => get,
@@ -15,7 +15,6 @@ const get = /* @__PURE__ */ make("topicFormsGet");
15
15
  const create = /* @__PURE__ */ make("topicFormsCreate");
16
16
  const update = /* @__PURE__ */ make("topicFormsUpdate");
17
17
  const remove = /* @__PURE__ */ make("topicFormsRemove");
18
- //#endregion
19
18
  export { create, get, list, remove, topic_forms_exports, update };
20
19
 
21
20
  //# sourceMappingURL=topic-forms.js.map
@@ -1,44 +1,40 @@
1
1
  export declare const list: (input?: {
2
2
  readonly namespaceId?: string | null | undefined;
3
- } | undefined) => import("./internal/operation").OperationResult<"topicsList">;
3
+ } | undefined, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"topicsList">;
4
4
  export declare const get: (input: {
5
5
  readonly id: string;
6
- }) => import("./internal/operation").OperationResult<"topicsGet">;
6
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"topicsGet">;
7
7
  export declare const create: (input: {
8
8
  readonly name: string;
9
9
  readonly description?: string | null | undefined;
10
10
  readonly namespaceId?: string | null | undefined;
11
11
  readonly default?: "opt_in" | "opt_out" | null | undefined;
12
- readonly archiveEnabled?: boolean | null | undefined;
13
- readonly publicationSlug?: string | null | undefined;
14
12
  readonly defaultSenderId?: string | null | undefined;
15
13
  readonly replyMailboxId?: string | null | undefined;
16
14
  readonly templateId?: string | null | undefined;
17
- }) => import("./internal/operation").OperationResult<"topicsCreate">;
15
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"topicsCreate">;
18
16
  export declare const update: (input: {
19
17
  readonly id: string;
20
18
  readonly name?: string | null | undefined;
21
19
  readonly description?: string | null | undefined;
22
20
  readonly default?: "opt_in" | "opt_out" | null | undefined;
23
- readonly archiveEnabled?: boolean | null | undefined;
24
- readonly publicationSlug?: string | null | undefined;
25
21
  readonly defaultSenderId?: string | null | undefined;
26
22
  readonly replyMailboxId?: string | null | undefined;
27
23
  readonly templateId?: string | null | undefined;
28
- }) => import("./internal/operation").OperationResult<"topicsUpdate">;
24
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"topicsUpdate">;
29
25
  export declare const remove: (input: {
30
26
  readonly id: string;
31
- }) => import("./internal/operation").OperationResult<"topicsRemove">;
27
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"topicsRemove">;
32
28
  export declare const setDefault: (input: {
33
29
  readonly id: string;
34
- }) => import("./internal/operation").OperationResult<"topicsSetDefault">;
30
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"topicsSetDefault">;
35
31
  export declare const listSubscriptions: ((input: {
36
32
  readonly id: string;
37
33
  readonly limit?: number | null | undefined;
38
34
  readonly cursor?: string | null | undefined;
39
35
  readonly channel?: "email" | null | undefined;
40
36
  readonly status?: "subscribed" | "unsubscribed" | null | undefined;
41
- }) => import("./internal/operation").OperationResult<"topicsListSubscriptions">) & {
37
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"topicsListSubscriptions">) & {
42
38
  readonly pages: (input: {
43
39
  readonly id: string;
44
40
  readonly limit?: number | null | undefined;
@@ -87,7 +83,7 @@ export declare const setSubscriptions: (input: {
87
83
  readonly channel: "email";
88
84
  readonly status: "subscribed" | "unsubscribed";
89
85
  readonly source?: string | null | undefined;
90
- }) => import("./internal/operation").OperationResult<"topicsSetSubscriptions">;
86
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"topicsSetSubscriptions">;
91
87
  export declare const checkSubscription: (input: {
92
88
  readonly contactId?: string | null | undefined;
93
89
  readonly email?: string | null | undefined;
@@ -95,4 +91,4 @@ export declare const checkSubscription: (input: {
95
91
  readonly namespaceId?: string | null | undefined;
96
92
  readonly channel: "email";
97
93
  readonly topicIds?: string | null | undefined;
98
- }) => import("./internal/operation").OperationResult<"topicsCheckSubscription">;
94
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"topicsCheckSubscription">;
@@ -1,7 +1,7 @@
1
1
  import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
2
  import { forGroup } from "./internal/operation.js";
3
3
  import { TopicsGroup } from "./generated/topics.js";
4
- //#region src/effect/topics.ts
4
+ // src/effect/topics.ts
5
5
  var topics_exports = /* @__PURE__ */ __exportAll({
6
6
  checkSubscription: () => checkSubscription,
7
7
  create: () => create,
@@ -23,7 +23,6 @@ const setDefault = /* @__PURE__ */ make("topicsSetDefault");
23
23
  const listSubscriptions = /* @__PURE__ */ make("topicsListSubscriptions");
24
24
  const setSubscriptions = /* @__PURE__ */ make("topicsSetSubscriptions");
25
25
  const checkSubscription = /* @__PURE__ */ make("topicsCheckSubscription");
26
- //#endregion
27
26
  export { checkSubscription, create, get, list, listSubscriptions, remove, setDefault, setSubscriptions, topics_exports, update };
28
27
 
29
28
  //# sourceMappingURL=topics.js.map
@@ -4,7 +4,7 @@ export declare const list: ((input?: {
4
4
  readonly cursor?: string | null | undefined;
5
5
  readonly search?: string | null | undefined;
6
6
  readonly status?: "active" | "disabled" | null | undefined;
7
- } | undefined) => import("./internal/operation").OperationResult<"webhooksList">) & {
7
+ } | undefined, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"webhooksList">) & {
8
8
  readonly pages: (input?: {
9
9
  readonly limit?: number | null | undefined;
10
10
  readonly cursor?: string | null | undefined;
@@ -74,16 +74,16 @@ export declare const create: (input: {
74
74
  readonly [x: string]: string | undefined;
75
75
  } | null | undefined;
76
76
  readonly status?: "active" | "disabled" | null | undefined;
77
- }) => import("./internal/operation").OperationResult<"webhooksCreate">;
77
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"webhooksCreate">;
78
78
  export declare const getSecret: (input: {
79
79
  readonly id: string;
80
- }) => import("./internal/operation").OperationResult<"webhooksGetSecret">;
80
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"webhooksGetSecret">;
81
81
  export declare const get: (input: {
82
82
  readonly id: string;
83
- }) => import("./internal/operation").OperationResult<"webhooksGet">;
83
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"webhooksGet">;
84
84
  export declare const remove: (input: {
85
85
  readonly id: string;
86
- }) => import("./internal/operation").OperationResult<"webhooksRemove">;
86
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"webhooksRemove">;
87
87
  export declare const update: (input: {
88
88
  readonly id: string;
89
89
  readonly name?: string | null | undefined;
@@ -96,7 +96,7 @@ export declare const update: (input: {
96
96
  readonly [x: string]: string | undefined;
97
97
  } | null | undefined;
98
98
  readonly status?: "active" | "disabled" | null | undefined;
99
- }) => import("./internal/operation").OperationResult<"webhooksUpdate">;
99
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"webhooksUpdate">;
100
100
  export declare const test: (input: {
101
101
  readonly id: string;
102
102
  readonly data?: {
@@ -126,12 +126,12 @@ export declare const test: (input: {
126
126
  readonly [x: string]: string | number | boolean | any | any | null | undefined;
127
127
  } | null | undefined;
128
128
  } | null | undefined;
129
- }) => import("./internal/operation").OperationResult<"webhooksTest">;
129
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"webhooksTest">;
130
130
  export declare const getLogs: ((input: {
131
131
  readonly id: string;
132
132
  readonly limit?: number | null | undefined;
133
133
  readonly cursor?: string | null | undefined;
134
- }) => import("./internal/operation").OperationResult<"webhooksGetLogs">) & {
134
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"webhooksGetLogs">) & {
135
135
  readonly pages: (input: {
136
136
  readonly id: string;
137
137
  readonly limit?: number | null | undefined;
@@ -206,11 +206,11 @@ export declare const getStats: (input: {
206
206
  readonly id: string;
207
207
  readonly after?: string | null | undefined;
208
208
  readonly before?: string | null | undefined;
209
- }) => import("./internal/operation").OperationResult<"webhooksGetStats">;
209
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"webhooksGetStats">;
210
210
  export declare const retryDelivery: (input: {
211
211
  readonly id: string;
212
212
  readonly deliveryId: string;
213
- }) => import("./internal/operation").OperationResult<"webhooksRetryDelivery">;
213
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"webhooksRetryDelivery">;
214
214
  export declare const regenerateSecret: (input: {
215
215
  readonly id: string;
216
- }) => import("./internal/operation").OperationResult<"webhooksRegenerateSecret">;
216
+ }, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"webhooksRegenerateSecret">;
@@ -2,7 +2,7 @@ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
2
  import { CreateWebhookPayload, TestWebhookPayload, UpdateWebhookPayload } from "./generated/shared.js";
3
3
  import { forGroup } from "./internal/operation.js";
4
4
  import { WebhooksGroup } from "./generated/webhooks.js";
5
- //#region src/effect/webhooks.ts
5
+ // src/effect/webhooks.ts
6
6
  var webhooks_exports = /* @__PURE__ */ __exportAll({
7
7
  CreatePayload: () => CreateWebhookPayload,
8
8
  TestPayload: () => TestWebhookPayload,
@@ -31,7 +31,6 @@ const getLogs = /* @__PURE__ */ make("webhooksGetLogs");
31
31
  const getStats = /* @__PURE__ */ make("webhooksGetStats");
32
32
  const retryDelivery = /* @__PURE__ */ make("webhooksRetryDelivery");
33
33
  const regenerateSecret = /* @__PURE__ */ make("webhooksRegenerateSecret");
34
- //#endregion
35
34
  export { CreateWebhookPayload as CreatePayload, TestWebhookPayload as TestPayload, UpdateWebhookPayload as UpdatePayload, create, get, getLogs, getSecret, getStats, list, regenerateSecret, remove, retryDelivery, test, update, webhooks_exports };
36
35
 
37
36
  //# sourceMappingURL=webhooks.js.map
@@ -1 +1 @@
1
- export declare const get: (_?: never) => import("./internal/operation").OperationResult<"whoamiGet">;
1
+ export declare const get: (input?: never, options?: import("./internal/operation").OperationOptions) => import("./internal/operation").OperationResult<"whoamiGet">;
@@ -1,10 +1,9 @@
1
1
  import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
2
  import { forGroup } from "./internal/operation.js";
3
3
  import { WhoamiGroup } from "./generated/whoami.js";
4
- //#region src/effect/whoami.ts
4
+ // src/effect/whoami.ts
5
5
  var whoami_exports = /* @__PURE__ */ __exportAll({ get: () => get });
6
6
  const get = /* @__PURE__ */ (/* @__PURE__ */ forGroup(WhoamiGroup))("whoamiGet");
7
- //#endregion
8
7
  export { get, whoami_exports };
9
8
 
10
9
  //# sourceMappingURL=whoami.js.map
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
+ import { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, DeliveryUnavailableError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, MailboxSendConflictError, MailboxSendRefusedError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTransportError, SenderNotReadyError, TemplateSourceError, UnauthorizedError, ValidationError, fromApiError } from "./promises/errors.gen.js";
1
2
  import { MediaUploadError } from "./inline-attachments.js";
2
3
  import { MailboxEventStream, MailboxEventStreamError } from "./mailbox-events.js";
3
- import { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, DeliveryUnavailableError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, MailboxSendConflictError, MailboxSendRefusedError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTransportError, SenderNotReadyError, TemplateSourceError, UnauthorizedError, ValidationError, fromApiError } from "./promises/errors.gen.js";
4
- import { createClient } from "./promises/index.js";
4
+ import { createClient } from "./promises/client.js";
5
5
  export { AnalyticsQueryError, BillingProviderError, BrandAddressRequiredError, CampaignFooterRequiredError, ConflictError, DeliveryUnavailableError, EmailChannelError, ExternalServiceError, FlagDisabledError, ForbiddenError, FromAddressRequiredError, GatewayTimeoutError, InternalError, MailboxEventStream, MailboxEventStreamError, MailboxSendConflictError, MailboxSendRefusedError, MediaUploadError, OnboardingReviewRequiredError, PaymentRequiredError, RateLimitedError, ResourceNotFoundError, SamvaApiError, SamvaTransportError, SenderNotReadyError, TemplateSourceError, UnauthorizedError, ValidationError, createClient, fromApiError };
@@ -1,4 +1,4 @@
1
- //#region src/inline-attachments.ts
1
+ // src/inline-attachments.ts
2
2
  /**
3
3
  * Shared, pure planning for email sends whose inline attachments exceed the API's inline cap.
4
4
  *
@@ -121,7 +121,6 @@ const withUploadedAttachments = (payload, uploaded) => {
121
121
  }
122
122
  };
123
123
  };
124
- //#endregion
125
124
  export { INLINE_ATTACHMENT_MAX_BYTES, MediaUploadError, decodedBase64Bytes, mediaCreateBody, planInlineUploads, uploadContentType, withUploadedAttachments };
126
125
 
127
126
  //# sourceMappingURL=inline-attachments.js.map
@@ -0,0 +1,10 @@
1
+ import { type SamvaClient } from "../promises/client";
2
+ import type { DispatchResult, ExtensionDefinition, Invocation } from "./types";
3
+ declare const errorMessage: (error: unknown) => string;
4
+ export { errorMessage };
5
+ /**
6
+ * A run's log is the lines its handler writes with `log()`. The global console is left alone:
7
+ * patching it would make concurrent runs in one isolate share it, and a handler that never settles
8
+ * would hold it.
9
+ */
10
+ export declare function dispatchEvent(extension: ExtensionDefinition, invocation: Invocation, client: SamvaClient): Promise<DispatchResult>;
@@ -0,0 +1,66 @@
1
+ import { clientWithIdempotency } from "../promises/client.js";
2
+ // src/mailbox/dispatch.ts
3
+ const sendKeyMethods = {
4
+ mailboxesReply: "reply",
5
+ mailboxesReplyAll: "replyAll",
6
+ mailboxesForward: "forward",
7
+ mailboxesSendMessage: "send"
8
+ };
9
+ const errorMessage = (error) => error instanceof Error ? error.message : String(error);
10
+ /**
11
+ * A run's log is the lines its handler writes with `log()`. The global console is left alone:
12
+ * patching it would make concurrent runs in one isolate share it, and a handler that never settles
13
+ * would hold it.
14
+ */
15
+ async function dispatchEvent(extension, invocation, client) {
16
+ const logs = [];
17
+ const log = (...args) => {
18
+ logs.push(args.map((arg) => {
19
+ if (typeof arg === "string") return arg;
20
+ try {
21
+ return JSON.stringify(arg) ?? String(arg);
22
+ } catch {
23
+ return String(arg);
24
+ }
25
+ }).join(" "));
26
+ };
27
+ try {
28
+ if (typeof invocation.eventId !== "string" || !Number.isInteger(invocation.attempt) || invocation.attempt < 1 || typeof invocation.body !== "string") throw new Error("Invalid extension invocation");
29
+ const payload = JSON.parse(invocation.body);
30
+ if (typeof payload !== "object" || payload === null || !("type" in payload) || typeof payload.type !== "string" || !("timestamp" in payload) || typeof payload.timestamp !== "string" || !("data" in payload) || typeof payload.data !== "object" || payload.data === null) throw new Error("Invalid extension event envelope");
31
+ if (!Object.hasOwn(extension.on, payload.type)) return {
32
+ ok: true,
33
+ logs
34
+ };
35
+ const event = {
36
+ ...payload,
37
+ id: invocation.eventId
38
+ };
39
+ const handler = extension.on[event.type];
40
+ const counts = /* @__PURE__ */ new Map();
41
+ await handler?.(event, {
42
+ samva: clientWithIdempotency(client, (operation) => {
43
+ const method = sendKeyMethods[operation] ?? operation;
44
+ const n = (counts.get(method) ?? 0) + 1;
45
+ counts.set(method, n);
46
+ return `${event.id}:${method}:${n}`;
47
+ }),
48
+ log,
49
+ event,
50
+ attempt: invocation.attempt
51
+ });
52
+ return {
53
+ ok: true,
54
+ logs
55
+ };
56
+ } catch (error) {
57
+ return {
58
+ ok: false,
59
+ error: errorMessage(error),
60
+ logs
61
+ };
62
+ }
63
+ }
64
+ export { dispatchEvent, errorMessage };
65
+
66
+ //# sourceMappingURL=dispatch.js.map
@@ -0,0 +1,17 @@
1
+ import { createBoundClient } from "../promises/client";
2
+ import type { ExtensionDefinition, ExtensionManifest } from "./types";
3
+ type Fetch = NonNullable<Parameters<typeof createBoundClient>[0]["fetch"]>;
4
+ export * from "./types";
5
+ export { dispatchEvent } from "./dispatch";
6
+ export declare function defineExtension<const M extends ExtensionManifest>(definition: {
7
+ manifest: M;
8
+ on: ExtensionDefinition<M["events"][number]>["on"];
9
+ }): {
10
+ manifest: M;
11
+ on: ExtensionDefinition<M["events"][number]>["on"];
12
+ fetch(request: Request, env: {
13
+ SAMVA: {
14
+ fetch: Fetch;
15
+ };
16
+ }): Promise<Response>;
17
+ };