samva 0.35.0 → 0.36.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
@@ -37,6 +37,9 @@ export declare const create: (input: {
37
37
  readonly name: string;
38
38
  readonly definition: {
39
39
  readonly trigger: {
40
+ readonly type: "event";
41
+ readonly eventName: string;
42
+ } | {
40
43
  readonly type: "contact.created";
41
44
  } | {
42
45
  readonly type: "contact.tag_added";
@@ -44,19 +47,10 @@ export declare const create: (input: {
44
47
  } | {
45
48
  readonly type: "contact.joined_group";
46
49
  readonly groupId: string;
47
- } | {
48
- readonly type: "event";
49
- readonly eventName: string;
50
50
  };
51
51
  readonly rootNodeId: string;
52
52
  readonly nodes: {
53
53
  readonly [x: string]: {
54
- readonly type: "exit";
55
- readonly config: {
56
- readonly [x: string]: undefined;
57
- };
58
- readonly next: readonly never[];
59
- } | {
60
54
  readonly type: "send_email";
61
55
  readonly config: {
62
56
  readonly template: string;
@@ -93,26 +87,10 @@ export declare const create: (input: {
93
87
  readonly nodeId: string;
94
88
  }[];
95
89
  } | {
96
- readonly type: "wait";
97
- readonly config: {
98
- readonly durationSeconds: number;
99
- };
100
- readonly next: readonly {
101
- readonly nodeId: string;
102
- }[];
103
- } | {
104
- readonly type: "update_tags";
105
- readonly config: {
106
- readonly add: readonly string[];
107
- readonly remove: readonly string[];
108
- };
109
- readonly next: readonly {
110
- readonly nodeId: string;
111
- }[];
112
- } | {
113
- readonly type: "webhook";
90
+ readonly type: "send_whatsapp";
114
91
  readonly config: {
115
- readonly data?: {
92
+ readonly template: string;
93
+ readonly templateData?: {
116
94
  readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | {
117
95
  readonly [x: string]: string | number | boolean | any | any | null | undefined;
118
96
  } | null)[] | {
@@ -139,62 +117,35 @@ export declare const create: (input: {
139
117
  readonly [x: string]: string | number | boolean | any | any | null | undefined;
140
118
  } | null | undefined;
141
119
  } | undefined;
120
+ readonly bindings?: {
121
+ readonly [x: string]: {
122
+ readonly contact: "company" | "displayName" | "email" | "externalId" | "firstName" | "id" | "jobTitle" | "lastName" | "name" | "phone";
123
+ } | {
124
+ readonly customField: string;
125
+ } | undefined;
126
+ } | undefined;
127
+ readonly businessAccountId?: string | undefined;
142
128
  };
143
129
  readonly next: readonly {
144
130
  readonly nodeId: string;
145
131
  }[];
146
132
  } | {
147
- readonly type: "wait_for_event";
133
+ readonly type: "wait";
148
134
  readonly config: {
149
- readonly eventName: string;
150
- readonly timeoutSeconds: number;
135
+ readonly durationSeconds: number;
151
136
  };
152
137
  readonly next: readonly {
153
138
  readonly nodeId: string;
154
- readonly outcome: "matched" | "timed_out";
155
139
  }[];
156
140
  } | {
157
- readonly type: "send_whatsapp";
141
+ readonly type: "wait_for_event";
158
142
  readonly config: {
159
- readonly template: string;
160
- readonly templateData?: {
161
- readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | {
162
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
163
- } | null)[] | {
164
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
165
- } | null)[] | {
166
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
167
- } | null)[] | {
168
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
169
- } | null)[] | {
170
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
171
- } | null)[] | {
172
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
173
- } | null)[] | {
174
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
175
- } | null)[] | {
176
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
177
- } | null)[] | {
178
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
179
- } | null)[] | {
180
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
181
- } | null)[] | {
182
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
183
- } | null)[] | {
184
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
185
- } | null | undefined;
186
- } | undefined;
187
- readonly bindings?: {
188
- readonly [x: string]: {
189
- readonly contact: "company" | "displayName" | "email" | "externalId" | "firstName" | "id" | "jobTitle" | "lastName" | "name" | "phone";
190
- } | {
191
- readonly customField: string;
192
- } | undefined;
193
- } | undefined;
194
- readonly businessAccountId?: string | undefined;
143
+ readonly eventName: string;
144
+ readonly timeoutSeconds: number;
195
145
  };
196
146
  readonly next: readonly {
197
147
  readonly nodeId: string;
148
+ readonly outcome: "matched" | "timed_out";
198
149
  }[];
199
150
  } | {
200
151
  readonly type: "branch";
@@ -209,10 +160,6 @@ export declare const create: (input: {
209
160
  readonly type: "tag";
210
161
  readonly tag: string;
211
162
  readonly present: boolean;
212
- } | {
213
- readonly type: "event";
214
- readonly eventName: string;
215
- readonly occurred: boolean;
216
163
  } | {
217
164
  readonly type: "property";
218
165
  readonly field: "displayName" | "externalId" | "name" | "profile.company" | "profile.firstName" | "profile.jobTitle" | "profile.lastName" | "profile.location.city" | "profile.location.country" | "profile.location.state" | "profile.location.timezone" | "profile.source" | "status";
@@ -243,9 +190,62 @@ export declare const create: (input: {
243
190
  } | {
244
191
  readonly operator: "exists" | "not_exists";
245
192
  };
193
+ } | {
194
+ readonly type: "event";
195
+ readonly eventName: string;
196
+ readonly occurred: boolean;
246
197
  })[];
247
198
  } | undefined;
248
199
  }[];
200
+ } | {
201
+ readonly type: "update_tags";
202
+ readonly config: {
203
+ readonly add: readonly string[];
204
+ readonly remove: readonly string[];
205
+ };
206
+ readonly next: readonly {
207
+ readonly nodeId: string;
208
+ }[];
209
+ } | {
210
+ readonly type: "webhook";
211
+ readonly config: {
212
+ readonly data?: {
213
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | {
214
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
215
+ } | null)[] | {
216
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
217
+ } | null)[] | {
218
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
219
+ } | null)[] | {
220
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
221
+ } | null)[] | {
222
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
223
+ } | null)[] | {
224
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
225
+ } | null)[] | {
226
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
227
+ } | null)[] | {
228
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
229
+ } | null)[] | {
230
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
231
+ } | null)[] | {
232
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
233
+ } | null)[] | {
234
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
235
+ } | null)[] | {
236
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
237
+ } | null | undefined;
238
+ } | undefined;
239
+ };
240
+ readonly next: readonly {
241
+ readonly nodeId: string;
242
+ }[];
243
+ } | {
244
+ readonly type: "exit";
245
+ readonly config: {
246
+ readonly [x: string]: undefined;
247
+ };
248
+ readonly next: readonly never[];
249
249
  } | undefined;
250
250
  };
251
251
  readonly goal?: {
@@ -269,6 +269,9 @@ export declare const replaceDraft: (input: {
269
269
  readonly revision: string;
270
270
  readonly definition: {
271
271
  readonly trigger: {
272
+ readonly type: "event";
273
+ readonly eventName: string;
274
+ } | {
272
275
  readonly type: "contact.created";
273
276
  } | {
274
277
  readonly type: "contact.tag_added";
@@ -276,19 +279,10 @@ export declare const replaceDraft: (input: {
276
279
  } | {
277
280
  readonly type: "contact.joined_group";
278
281
  readonly groupId: string;
279
- } | {
280
- readonly type: "event";
281
- readonly eventName: string;
282
282
  };
283
283
  readonly rootNodeId: string;
284
284
  readonly nodes: {
285
285
  readonly [x: string]: {
286
- readonly type: "exit";
287
- readonly config: {
288
- readonly [x: string]: undefined;
289
- };
290
- readonly next: readonly never[];
291
- } | {
292
286
  readonly type: "send_email";
293
287
  readonly config: {
294
288
  readonly template: string;
@@ -325,26 +319,10 @@ export declare const replaceDraft: (input: {
325
319
  readonly nodeId: string;
326
320
  }[];
327
321
  } | {
328
- readonly type: "wait";
329
- readonly config: {
330
- readonly durationSeconds: number;
331
- };
332
- readonly next: readonly {
333
- readonly nodeId: string;
334
- }[];
335
- } | {
336
- readonly type: "update_tags";
337
- readonly config: {
338
- readonly add: readonly string[];
339
- readonly remove: readonly string[];
340
- };
341
- readonly next: readonly {
342
- readonly nodeId: string;
343
- }[];
344
- } | {
345
- readonly type: "webhook";
322
+ readonly type: "send_whatsapp";
346
323
  readonly config: {
347
- readonly data?: {
324
+ readonly template: string;
325
+ readonly templateData?: {
348
326
  readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | {
349
327
  readonly [x: string]: string | number | boolean | any | any | null | undefined;
350
328
  } | null)[] | {
@@ -371,62 +349,35 @@ export declare const replaceDraft: (input: {
371
349
  readonly [x: string]: string | number | boolean | any | any | null | undefined;
372
350
  } | null | undefined;
373
351
  } | undefined;
352
+ readonly bindings?: {
353
+ readonly [x: string]: {
354
+ readonly contact: "company" | "displayName" | "email" | "externalId" | "firstName" | "id" | "jobTitle" | "lastName" | "name" | "phone";
355
+ } | {
356
+ readonly customField: string;
357
+ } | undefined;
358
+ } | undefined;
359
+ readonly businessAccountId?: string | undefined;
374
360
  };
375
361
  readonly next: readonly {
376
362
  readonly nodeId: string;
377
363
  }[];
378
364
  } | {
379
- readonly type: "wait_for_event";
365
+ readonly type: "wait";
380
366
  readonly config: {
381
- readonly eventName: string;
382
- readonly timeoutSeconds: number;
367
+ readonly durationSeconds: number;
383
368
  };
384
369
  readonly next: readonly {
385
370
  readonly nodeId: string;
386
- readonly outcome: "matched" | "timed_out";
387
371
  }[];
388
372
  } | {
389
- readonly type: "send_whatsapp";
373
+ readonly type: "wait_for_event";
390
374
  readonly config: {
391
- readonly template: string;
392
- readonly templateData?: {
393
- readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | {
394
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
395
- } | null)[] | {
396
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
397
- } | null)[] | {
398
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
399
- } | null)[] | {
400
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
401
- } | null)[] | {
402
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
403
- } | null)[] | {
404
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
405
- } | null)[] | {
406
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
407
- } | null)[] | {
408
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
409
- } | null)[] | {
410
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
411
- } | null)[] | {
412
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
413
- } | null)[] | {
414
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
415
- } | null)[] | {
416
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
417
- } | null | undefined;
418
- } | undefined;
419
- readonly bindings?: {
420
- readonly [x: string]: {
421
- readonly contact: "company" | "displayName" | "email" | "externalId" | "firstName" | "id" | "jobTitle" | "lastName" | "name" | "phone";
422
- } | {
423
- readonly customField: string;
424
- } | undefined;
425
- } | undefined;
426
- readonly businessAccountId?: string | undefined;
375
+ readonly eventName: string;
376
+ readonly timeoutSeconds: number;
427
377
  };
428
378
  readonly next: readonly {
429
379
  readonly nodeId: string;
380
+ readonly outcome: "matched" | "timed_out";
430
381
  }[];
431
382
  } | {
432
383
  readonly type: "branch";
@@ -441,10 +392,6 @@ export declare const replaceDraft: (input: {
441
392
  readonly type: "tag";
442
393
  readonly tag: string;
443
394
  readonly present: boolean;
444
- } | {
445
- readonly type: "event";
446
- readonly eventName: string;
447
- readonly occurred: boolean;
448
395
  } | {
449
396
  readonly type: "property";
450
397
  readonly field: "displayName" | "externalId" | "name" | "profile.company" | "profile.firstName" | "profile.jobTitle" | "profile.lastName" | "profile.location.city" | "profile.location.country" | "profile.location.state" | "profile.location.timezone" | "profile.source" | "status";
@@ -475,9 +422,62 @@ export declare const replaceDraft: (input: {
475
422
  } | {
476
423
  readonly operator: "exists" | "not_exists";
477
424
  };
425
+ } | {
426
+ readonly type: "event";
427
+ readonly eventName: string;
428
+ readonly occurred: boolean;
478
429
  })[];
479
430
  } | undefined;
480
431
  }[];
432
+ } | {
433
+ readonly type: "update_tags";
434
+ readonly config: {
435
+ readonly add: readonly string[];
436
+ readonly remove: readonly string[];
437
+ };
438
+ readonly next: readonly {
439
+ readonly nodeId: string;
440
+ }[];
441
+ } | {
442
+ readonly type: "webhook";
443
+ readonly config: {
444
+ readonly data?: {
445
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | {
446
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
447
+ } | null)[] | {
448
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
449
+ } | null)[] | {
450
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
451
+ } | null)[] | {
452
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
453
+ } | null)[] | {
454
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
455
+ } | null)[] | {
456
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
457
+ } | null)[] | {
458
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
459
+ } | null)[] | {
460
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
461
+ } | null)[] | {
462
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
463
+ } | null)[] | {
464
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
465
+ } | null)[] | {
466
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
467
+ } | null)[] | {
468
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
469
+ } | null | undefined;
470
+ } | undefined;
471
+ };
472
+ readonly next: readonly {
473
+ readonly nodeId: string;
474
+ }[];
475
+ } | {
476
+ readonly type: "exit";
477
+ readonly config: {
478
+ readonly [x: string]: undefined;
479
+ };
480
+ readonly next: readonly never[];
481
481
  } | undefined;
482
482
  };
483
483
  readonly goal?: {