samva 0.49.0 → 0.51.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 (74) hide show
  1. package/AGENTS.md +44 -3
  2. package/README.md +136 -7
  3. package/dist/client/sdk.gen.d.ts +63 -18
  4. package/dist/client/sdk.gen.js +1549 -945
  5. package/dist/client/types.gen.d.ts +269 -31
  6. package/dist/effect/agents.d.ts +4 -4
  7. package/dist/effect/api-keys.d.ts +4 -6
  8. package/dist/effect/campaigns.d.ts +166 -174
  9. package/dist/effect/categories.d.ts +2 -2
  10. package/dist/effect/categories.js +6 -4
  11. package/dist/effect/contact-groups.d.ts +4 -4
  12. package/dist/effect/contacts.d.ts +8 -8
  13. package/dist/effect/conversations.d.ts +4 -4
  14. package/dist/effect/descriptors/mailboxes.d.ts +41 -1
  15. package/dist/effect/descriptors/mailboxes.js +53 -1
  16. package/dist/effect/email.d.ts +17 -16
  17. package/dist/effect/errors.d.ts +1 -0
  18. package/dist/effect/errors.js +2 -1
  19. package/dist/effect/generated/api-keys.d.ts +0 -15
  20. package/dist/effect/generated/api-keys.js +1 -2
  21. package/dist/effect/generated/campaigns.d.ts +0 -62
  22. package/dist/effect/generated/campaigns.js +3 -9
  23. package/dist/effect/generated/email.d.ts +10 -3
  24. package/dist/effect/generated/email.js +3 -2
  25. package/dist/effect/generated/mailboxes.d.ts +780 -77
  26. package/dist/effect/generated/mailboxes.js +135 -12
  27. package/dist/effect/generated/namespaces.js +1 -1
  28. package/dist/effect/generated/policies.js +2 -2
  29. package/dist/effect/generated/scheduled-messages.d.ts +0 -26
  30. package/dist/effect/generated/scheduled-messages.js +1 -3
  31. package/dist/effect/generated/shared.d.ts +28 -31
  32. package/dist/effect/generated/shared.js +12 -19
  33. package/dist/effect/generated/template-registrations.d.ts +6 -6
  34. package/dist/effect/generated/template-registrations.js +3 -3
  35. package/dist/effect/generated-metadata.d.ts +24 -0
  36. package/dist/effect/generated-metadata.js +4 -0
  37. package/dist/effect/index.js +2 -1
  38. package/dist/effect/integrations.d.ts +2 -2
  39. package/dist/effect/internal/client.d.ts +19 -2
  40. package/dist/effect/internal/client.js +10 -2
  41. package/dist/effect/internal/email-sender.d.ts +4 -4
  42. package/dist/effect/internal/email-sender.js +5 -3
  43. package/dist/effect/internal/operation.d.ts +11 -0
  44. package/dist/effect/internal/operation.js +10 -6
  45. package/dist/effect/internal/send.d.ts +4 -0
  46. package/dist/effect/internal/send.js +11 -8
  47. package/dist/effect/internal/timeout.d.ts +16 -0
  48. package/dist/effect/internal/timeout.js +20 -0
  49. package/dist/effect/journeys.d.ts +152 -152
  50. package/dist/effect/mailboxes.d.ts +54 -30
  51. package/dist/effect/mailboxes.js +10 -2
  52. package/dist/effect/messages.d.ts +5 -5
  53. package/dist/effect/namespaces.d.ts +4 -4
  54. package/dist/effect/newsletter-domains.d.ts +2 -2
  55. package/dist/effect/operations.d.ts +2 -2
  56. package/dist/effect/scheduled-messages.d.ts +2 -6
  57. package/dist/effect/templates.d.ts +6 -6
  58. package/dist/effect/topics.d.ts +4 -4
  59. package/dist/effect/webhooks.d.ts +4 -4
  60. package/dist/effect/whatsapp-setup-links.d.ts +2 -2
  61. package/dist/index.js +2 -2
  62. package/dist/package.js +1 -1
  63. package/dist/promises/client.d.ts +5 -0
  64. package/dist/promises/client.js +12 -8
  65. package/dist/promises/errors.gen.d.ts +12 -1
  66. package/dist/promises/errors.gen.js +21 -2
  67. package/dist/promises/index.js +2 -2
  68. package/dist/promises/request.d.ts +31 -2
  69. package/dist/promises/request.js +42 -7
  70. package/dist/promises/types.gen.d.ts +1 -1
  71. package/dist/request-policy.d.ts +9 -0
  72. package/dist/request-policy.js +16 -1
  73. package/dist/service-map.d.ts +22 -2
  74. package/package.json +3 -3
@@ -1,8 +1,9 @@
1
1
  import { mediaCreateBody, planInlineUploads, withUploadedAttachments } from "../../inline-attachments.js";
2
2
  import { buildEmailSendPayload, buildMessagesSendPayload } from "../../normalize.js";
3
3
  import { generateIdempotencyKey, withRetry } from "../retry.js";
4
+ import { withTimeout } from "./timeout.js";
4
5
  import { Service } from "./client.js";
5
- import { callEndpoint, stripUndefined } from "./operation.js";
6
+ import { attemptTimeout, callEndpoint, stripUndefined } from "./operation.js";
6
7
  import { MediaGroup } from "../generated/media.js";
7
8
  import { MessagesGroup } from "../generated/messages.js";
8
9
  import { Effect } from "effect";
@@ -13,21 +14,22 @@ import { Effect } from "effect";
13
14
  * `mediaId`. The returned payload is the one request every send attempt reuses, so nothing is
14
15
  * uploaded twice.
15
16
  */
16
- const uploadOversizedAttachments = (client, payload) => Effect.gen(function* () {
17
+ const uploadOversizedAttachments = (client, payload, timeoutMs, uploadTimeoutMs) => Effect.gen(function* () {
17
18
  const plan = planInlineUploads(payload);
18
19
  if (plan.length === 0) return payload;
19
20
  const uploaded = /* @__PURE__ */ new Map();
20
21
  for (const upload of plan) {
21
- const created = yield* callEndpoint(MediaGroup, "mediaCreate", { payload: mediaCreateBody(upload) });
22
+ const created = yield* withTimeout(callEndpoint(MediaGroup, "mediaCreate", { payload: mediaCreateBody(upload) }), timeoutMs);
22
23
  yield* client.putUpload({
23
24
  filename: upload.filename,
24
25
  mediaId: created.id,
25
26
  url: created.upload.url,
26
27
  method: created.upload.method,
27
28
  headers: created.upload.headers,
28
- bytes: upload.bytes
29
+ bytes: upload.bytes,
30
+ timeoutMs: uploadTimeoutMs
29
31
  });
30
- yield* callEndpoint(MediaGroup, "mediaComplete", { params: { id: created.id } });
32
+ yield* withTimeout(callEndpoint(MediaGroup, "mediaComplete", { params: { id: created.id } }), timeoutMs);
31
33
  uploaded.set(upload.index, {
32
34
  mediaId: created.id,
33
35
  upload
@@ -37,12 +39,13 @@ const uploadOversizedAttachments = (client, payload) => Effect.gen(function* ()
37
39
  });
38
40
  const sendPayload = (payload, options) => Effect.gen(function* () {
39
41
  const client = yield* Service;
42
+ const timeoutMs = attemptTimeout(options, client);
40
43
  const idempotencyKey = options?.idempotencyKey ?? client.idempotency?.("messagesSend") ?? (yield* generateIdempotencyKey);
41
- const prepared = yield* uploadOversizedAttachments(client, payload);
42
- return yield* withRetry(callEndpoint(MessagesGroup, "messagesSend", {
44
+ const prepared = yield* uploadOversizedAttachments(client, payload, timeoutMs, options?.uploadTimeoutMs);
45
+ return yield* withRetry(withTimeout(callEndpoint(MessagesGroup, "messagesSend", {
43
46
  payload: stripUndefined(prepared),
44
47
  headers: { "idempotency-key": idempotencyKey }
45
- }));
48
+ }), timeoutMs));
46
49
  });
47
50
  const sendMessage = Effect.fn("Messages.send")(function* (input, options) {
48
51
  return yield* sendPayload(buildMessagesSendPayload(input), options);
@@ -0,0 +1,16 @@
1
+ import { Effect, Schema } from "effect";
2
+ declare const SamvaTimeoutError_base: Schema.Class<SamvaTimeoutError, Schema.Struct<{
3
+ readonly _tag: Schema.tag<"SamvaTimeoutError">;
4
+ readonly timeoutMs: Schema.Finite;
5
+ }>, import("effect/Cause").YieldableError>;
6
+ /**
7
+ * A request attempt that did not finish within its `timeoutMs`. The request may still have reached
8
+ * the API, so the default retry policy retries it on retry-safe operations with the same
9
+ * idempotency key, exactly like a transport failure.
10
+ */
11
+ export declare class SamvaTimeoutError extends SamvaTimeoutError_base {
12
+ get message(): string;
13
+ }
14
+ /** Bound one attempt; `null` leaves it unbounded. The losing request is interrupted. */
15
+ export declare const withTimeout: <A, E, R>(effect: Effect.Effect<A, E, R>, timeoutMs: number | null) => Effect.Effect<A, E | SamvaTimeoutError, R>;
16
+ export {};
@@ -0,0 +1,20 @@
1
+ import { Duration, Effect, Schema } from "effect";
2
+ // src/effect/internal/timeout.ts
3
+ /**
4
+ * A request attempt that did not finish within its `timeoutMs`. The request may still have reached
5
+ * the API, so the default retry policy retries it on retry-safe operations with the same
6
+ * idempotency key, exactly like a transport failure.
7
+ */
8
+ var SamvaTimeoutError = class extends Schema.TaggedError()("SamvaTimeoutError", Schema.Struct({ timeoutMs: Schema.Finite })) {
9
+ get message() {
10
+ return `Samva request did not finish within ${this.timeoutMs} ms`;
11
+ }
12
+ };
13
+ /** Bound one attempt; `null` leaves it unbounded. The losing request is interrupted. */
14
+ const withTimeout = (effect, timeoutMs) => timeoutMs === null ? effect : Effect.timeoutOrElse(effect, {
15
+ duration: Duration.millis(timeoutMs),
16
+ orElse: () => Effect.fail(new SamvaTimeoutError({ timeoutMs }))
17
+ });
18
+ export { SamvaTimeoutError, withTimeout };
19
+
20
+ //# sourceMappingURL=timeout.js.map
@@ -18,7 +18,7 @@ export declare const list: ((input?: {
18
18
  readonly updatedAt: string;
19
19
  }[];
20
20
  readonly nextCursor: string | null;
21
- }, import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
21
+ }, import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("./errors.js").SamvaTimeoutError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
22
22
  readonly items: (input?: {
23
23
  readonly status?: "active" | "archived" | "draft" | "paused" | undefined;
24
24
  readonly limit?: number | null | undefined;
@@ -31,15 +31,12 @@ export declare const list: ((input?: {
31
31
  readonly publishedAt: string | null;
32
32
  readonly createdAt: string;
33
33
  readonly updatedAt: string;
34
- }, import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
34
+ }, import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("./errors.js").SamvaTimeoutError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
35
35
  };
36
36
  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
- } | {
43
40
  readonly type: "contact.created";
44
41
  } | {
45
42
  readonly type: "contact.tag_added";
@@ -47,10 +44,19 @@ export declare const create: (input: {
47
44
  } | {
48
45
  readonly type: "contact.joined_group";
49
46
  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
+ } | {
54
60
  readonly type: "send_email";
55
61
  readonly config: {
56
62
  readonly template: string;
@@ -87,6 +93,67 @@ export declare const create: (input: {
87
93
  readonly next: readonly {
88
94
  readonly nodeId: string;
89
95
  }[];
96
+ } | {
97
+ readonly type: "wait";
98
+ readonly config: {
99
+ readonly durationSeconds: number;
100
+ };
101
+ readonly next: readonly {
102
+ readonly nodeId: string;
103
+ }[];
104
+ } | {
105
+ readonly type: "update_tags";
106
+ readonly config: {
107
+ readonly add: readonly string[];
108
+ readonly remove: readonly string[];
109
+ };
110
+ readonly next: readonly {
111
+ readonly nodeId: string;
112
+ }[];
113
+ } | {
114
+ readonly type: "webhook";
115
+ readonly config: {
116
+ readonly data?: {
117
+ 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 | {
118
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
119
+ } | null)[] | {
120
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
121
+ } | null)[] | {
122
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
123
+ } | null)[] | {
124
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
125
+ } | null)[] | {
126
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
127
+ } | null)[] | {
128
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
129
+ } | null)[] | {
130
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
131
+ } | null)[] | {
132
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
133
+ } | null)[] | {
134
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
135
+ } | null)[] | {
136
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
137
+ } | null)[] | {
138
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
139
+ } | null)[] | {
140
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
141
+ } | null | undefined;
142
+ } | undefined;
143
+ };
144
+ readonly next: readonly {
145
+ readonly nodeId: string;
146
+ }[];
147
+ } | {
148
+ readonly type: "wait_for_event";
149
+ readonly config: {
150
+ readonly eventName: string;
151
+ readonly timeoutSeconds: number;
152
+ };
153
+ readonly next: readonly {
154
+ readonly nodeId: string;
155
+ readonly outcome: "matched" | "timed_out";
156
+ }[];
90
157
  } | {
91
158
  readonly type: "send_whatsapp";
92
159
  readonly config: {
@@ -137,24 +204,6 @@ export declare const create: (input: {
137
204
  readonly next: readonly {
138
205
  readonly nodeId: string;
139
206
  }[];
140
- } | {
141
- readonly type: "wait";
142
- readonly config: {
143
- readonly durationSeconds: number;
144
- };
145
- readonly next: readonly {
146
- readonly nodeId: string;
147
- }[];
148
- } | {
149
- readonly type: "wait_for_event";
150
- readonly config: {
151
- readonly eventName: string;
152
- readonly timeoutSeconds: number;
153
- };
154
- readonly next: readonly {
155
- readonly nodeId: string;
156
- readonly outcome: "matched" | "timed_out";
157
- }[];
158
207
  } | {
159
208
  readonly type: "branch";
160
209
  readonly config: {
@@ -168,6 +217,10 @@ export declare const create: (input: {
168
217
  readonly type: "tag";
169
218
  readonly tag: string;
170
219
  readonly present: boolean;
220
+ } | {
221
+ readonly type: "event";
222
+ readonly eventName: string;
223
+ readonly occurred: boolean;
171
224
  } | {
172
225
  readonly type: "property";
173
226
  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";
@@ -198,62 +251,9 @@ export declare const create: (input: {
198
251
  } | {
199
252
  readonly operator: "exists" | "not_exists";
200
253
  };
201
- } | {
202
- readonly type: "event";
203
- readonly eventName: string;
204
- readonly occurred: boolean;
205
254
  })[];
206
255
  } | undefined;
207
256
  }[];
208
- } | {
209
- readonly type: "update_tags";
210
- readonly config: {
211
- readonly add: readonly string[];
212
- readonly remove: readonly string[];
213
- };
214
- readonly next: readonly {
215
- readonly nodeId: string;
216
- }[];
217
- } | {
218
- readonly type: "webhook";
219
- readonly config: {
220
- readonly data?: {
221
- 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 | {
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)[] | {
238
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
239
- } | null)[] | {
240
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
241
- } | null)[] | {
242
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
243
- } | null)[] | {
244
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
245
- } | null | undefined;
246
- } | undefined;
247
- };
248
- readonly next: readonly {
249
- readonly nodeId: string;
250
- }[];
251
- } | {
252
- readonly type: "exit";
253
- readonly config: {
254
- readonly [x: string]: undefined;
255
- };
256
- readonly next: readonly never[];
257
257
  } | undefined;
258
258
  };
259
259
  readonly goal?: {
@@ -281,9 +281,6 @@ export declare const replaceDraft: (input: {
281
281
  readonly revision: string;
282
282
  readonly definition: {
283
283
  readonly trigger: {
284
- readonly type: "event";
285
- readonly eventName: string;
286
- } | {
287
284
  readonly type: "contact.created";
288
285
  } | {
289
286
  readonly type: "contact.tag_added";
@@ -291,10 +288,19 @@ export declare const replaceDraft: (input: {
291
288
  } | {
292
289
  readonly type: "contact.joined_group";
293
290
  readonly groupId: string;
291
+ } | {
292
+ readonly type: "event";
293
+ readonly eventName: string;
294
294
  };
295
295
  readonly rootNodeId: string;
296
296
  readonly nodes: {
297
297
  readonly [x: string]: {
298
+ readonly type: "exit";
299
+ readonly config: {
300
+ readonly [x: string]: undefined;
301
+ };
302
+ readonly next: readonly never[];
303
+ } | {
298
304
  readonly type: "send_email";
299
305
  readonly config: {
300
306
  readonly template: string;
@@ -331,6 +337,67 @@ export declare const replaceDraft: (input: {
331
337
  readonly next: readonly {
332
338
  readonly nodeId: string;
333
339
  }[];
340
+ } | {
341
+ readonly type: "wait";
342
+ readonly config: {
343
+ readonly durationSeconds: number;
344
+ };
345
+ readonly next: readonly {
346
+ readonly nodeId: string;
347
+ }[];
348
+ } | {
349
+ readonly type: "update_tags";
350
+ readonly config: {
351
+ readonly add: readonly string[];
352
+ readonly remove: readonly string[];
353
+ };
354
+ readonly next: readonly {
355
+ readonly nodeId: string;
356
+ }[];
357
+ } | {
358
+ readonly type: "webhook";
359
+ readonly config: {
360
+ readonly data?: {
361
+ 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 | {
362
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
363
+ } | null)[] | {
364
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
365
+ } | null)[] | {
366
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
367
+ } | null)[] | {
368
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
369
+ } | null)[] | {
370
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
371
+ } | null)[] | {
372
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
373
+ } | null)[] | {
374
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
375
+ } | null)[] | {
376
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
377
+ } | null)[] | {
378
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
379
+ } | null)[] | {
380
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
381
+ } | null)[] | {
382
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
383
+ } | null)[] | {
384
+ readonly [x: string]: string | number | boolean | any | any | null | undefined;
385
+ } | null | undefined;
386
+ } | undefined;
387
+ };
388
+ readonly next: readonly {
389
+ readonly nodeId: string;
390
+ }[];
391
+ } | {
392
+ readonly type: "wait_for_event";
393
+ readonly config: {
394
+ readonly eventName: string;
395
+ readonly timeoutSeconds: number;
396
+ };
397
+ readonly next: readonly {
398
+ readonly nodeId: string;
399
+ readonly outcome: "matched" | "timed_out";
400
+ }[];
334
401
  } | {
335
402
  readonly type: "send_whatsapp";
336
403
  readonly config: {
@@ -381,24 +448,6 @@ export declare const replaceDraft: (input: {
381
448
  readonly next: readonly {
382
449
  readonly nodeId: string;
383
450
  }[];
384
- } | {
385
- readonly type: "wait";
386
- readonly config: {
387
- readonly durationSeconds: number;
388
- };
389
- readonly next: readonly {
390
- readonly nodeId: string;
391
- }[];
392
- } | {
393
- readonly type: "wait_for_event";
394
- readonly config: {
395
- readonly eventName: string;
396
- readonly timeoutSeconds: number;
397
- };
398
- readonly next: readonly {
399
- readonly nodeId: string;
400
- readonly outcome: "matched" | "timed_out";
401
- }[];
402
451
  } | {
403
452
  readonly type: "branch";
404
453
  readonly config: {
@@ -412,6 +461,10 @@ export declare const replaceDraft: (input: {
412
461
  readonly type: "tag";
413
462
  readonly tag: string;
414
463
  readonly present: boolean;
464
+ } | {
465
+ readonly type: "event";
466
+ readonly eventName: string;
467
+ readonly occurred: boolean;
415
468
  } | {
416
469
  readonly type: "property";
417
470
  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";
@@ -442,62 +495,9 @@ export declare const replaceDraft: (input: {
442
495
  } | {
443
496
  readonly operator: "exists" | "not_exists";
444
497
  };
445
- } | {
446
- readonly type: "event";
447
- readonly eventName: string;
448
- readonly occurred: boolean;
449
498
  })[];
450
499
  } | undefined;
451
500
  }[];
452
- } | {
453
- readonly type: "update_tags";
454
- readonly config: {
455
- readonly add: readonly string[];
456
- readonly remove: readonly string[];
457
- };
458
- readonly next: readonly {
459
- readonly nodeId: string;
460
- }[];
461
- } | {
462
- readonly type: "webhook";
463
- readonly config: {
464
- readonly data?: {
465
- 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 | {
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)[] | {
470
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
471
- } | null)[] | {
472
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
473
- } | null)[] | {
474
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
475
- } | null)[] | {
476
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
477
- } | null)[] | {
478
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
479
- } | null)[] | {
480
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
481
- } | null)[] | {
482
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
483
- } | null)[] | {
484
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
485
- } | null)[] | {
486
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
487
- } | null)[] | {
488
- readonly [x: string]: string | number | boolean | any | any | null | undefined;
489
- } | null | undefined;
490
- } | undefined;
491
- };
492
- readonly next: readonly {
493
- readonly nodeId: string;
494
- }[];
495
- } | {
496
- readonly type: "exit";
497
- readonly config: {
498
- readonly [x: string]: undefined;
499
- };
500
- readonly next: readonly never[];
501
501
  } | undefined;
502
502
  };
503
503
  readonly goal?: {
@@ -567,7 +567,7 @@ export declare const listRuns: ((input: {
567
567
  readonly endedAt: string | null;
568
568
  }[];
569
569
  readonly nextCursor: string | null;
570
- }, import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("./errors.js").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
570
+ }, import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("./errors.js").ResourceNotFoundError | import("./errors.js").SamvaTimeoutError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
571
571
  readonly items: (input: {
572
572
  readonly id: string;
573
573
  readonly status?: "active" | "exited" | "failed" | "paused" | undefined;
@@ -594,7 +594,7 @@ export declare const listRuns: ((input: {
594
594
  };
595
595
  readonly enteredAt: string;
596
596
  readonly endedAt: string | null;
597
- }, import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("./errors.js").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
597
+ }, import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("./errors.js").ResourceNotFoundError | import("./errors.js").SamvaTimeoutError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
598
598
  };
599
599
  export declare const getRun: (input: {
600
600
  readonly id: string;