getricky 0.1.40 → 0.1.41

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.
@@ -3318,9 +3318,9 @@ export type Workflow = {
3318
3318
  type: 'conversation' | 'scheduled';
3319
3319
  definition: {
3320
3320
  /**
3321
- * `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message that passes `sent_message_filters`, unless the contact replied first. `assigned_to` runs nothing: while a conversation of its channels is assigned to one of `assigned_user_ids` and its `condition` holds, the agent of its only `turn_on_ai` step answers it and no assignee moves; when the hours begin to hold it answers those already waiting for a reply. `call_received` decides who answers a WhatsApp call on its channels (WhatsApp numbers with AI calls on): its flow takes only `answer_call`, `decline_call` and a `branch` on `business_hours`, and the first active one that reaches a call step decides, over whoever holds the conversation.
3321
+ * `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message that passes `sent_message_filters`, unless the contact replied first. `at_time` runs once a day at `at_time.time`, on its weekdays, on each conversation of its channels assigned then to one of `conversation_filters.assigned_user_ids` (open ones only with `conversation_filters.only_open`); it has no `condition`. `conversation_assigned` runs when a conversation of its channels is assigned to a member (any member, or one of `conversation_filters.assigned_user_ids`) while its `condition` holds; the assignment an AI handoff makes does not run it. Both take only `turn_on_ai` and `turn_off_ai` steps, which only they take. `call_received` decides who answers a WhatsApp call on its channels (WhatsApp numbers with AI calls on): its flow takes only `answer_call`, `decline_call` and a `branch` on `business_hours`, and the first active one that reaches a call step decides, over whoever holds the conversation.
3322
3322
  */
3323
- trigger: 'assigned_to' | 'conversation_inactive' | 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'team_message_unanswered' | 'call_received';
3323
+ trigger: 'at_time' | 'conversation_assigned' | 'conversation_inactive' | 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'team_message_unanswered' | 'call_received';
3324
3324
  /**
3325
3325
  * Channels it listens to. See `GET /channels`.
3326
3326
  */
@@ -3360,9 +3360,35 @@ export type Workflow = {
3360
3360
  text_contains?: string;
3361
3361
  };
3362
3362
  /**
3363
- * Members whose conversations an `assigned_to` workflow reaches. See `GET /members`.
3363
+ * When an `at_time` workflow runs; required for it and only for it.
3364
3364
  */
3365
- assigned_user_ids?: Array<string>;
3365
+ at_time?: {
3366
+ /**
3367
+ * Quarter hour it runs, `HH:MM`.
3368
+ */
3369
+ time: string;
3370
+ /**
3371
+ * IANA time zone of `time` and `weekdays`.
3372
+ */
3373
+ timezone: string;
3374
+ /**
3375
+ * Days it runs, 0 for Sunday to 6 for Saturday. Each at most once.
3376
+ */
3377
+ weekdays: Array<number>;
3378
+ };
3379
+ /**
3380
+ * Which conversations `at_time` and `conversation_assigned` reach; only for them.
3381
+ */
3382
+ conversation_filters?: {
3383
+ /**
3384
+ * Members the conversation is assigned to. Required for `at_time`; omitted on `conversation_assigned`, any member. See `GET /members`.
3385
+ */
3386
+ assigned_user_ids?: Array<string>;
3387
+ /**
3388
+ * Only open conversations.
3389
+ */
3390
+ only_open: boolean;
3391
+ };
3366
3392
  /**
3367
3393
  * When it runs; null runs at any hour.
3368
3394
  */
@@ -3382,7 +3408,7 @@ export type Workflow = {
3382
3408
  */
3383
3409
  entry: string;
3384
3410
  /**
3385
- * One step. `close_conversation`, `end`, `answer_call`, `decline_call` and `turn_on_ai` finish the flow; every other step continues at its target.
3411
+ * One step. `close_conversation`, `end`, `answer_call`, `decline_call`, `turn_on_ai` and `turn_off_ai` finish the flow; every other step continues at its target.
3386
3412
  */
3387
3413
  steps: Array<{
3388
3414
  /**
@@ -3580,9 +3606,19 @@ export type Workflow = {
3580
3606
  next: string | null;
3581
3607
  kind: 'turn_on_ai';
3582
3608
  /**
3583
- * The only step of an `assigned_to` workflow: this AI agent answers the chats it reaches while its hours hold. Nobody is reassigned.
3609
+ * Turns the AI on in the conversation with this AI agent; the conversation stays assigned to its member. If the contact wrote last, the agent answers at once. It turns off when a member writes in the conversation.
3584
3610
  */
3585
3611
  agent_id: string;
3612
+ } | {
3613
+ /**
3614
+ * Step ID: letters, digits, `_` or `-`, up to 64.
3615
+ */
3616
+ id: string;
3617
+ /**
3618
+ * Step to run next; null ends the flow.
3619
+ */
3620
+ next: string | null;
3621
+ kind: 'turn_off_ai';
3586
3622
  }>;
3587
3623
  };
3588
3624
  } | {
@@ -4984,9 +5020,9 @@ export type CreateWorkflow = {
4984
5020
  */
4985
5021
  definition: {
4986
5022
  /**
4987
- * `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message that passes `sent_message_filters`, unless the contact replied first. `assigned_to` runs nothing: while a conversation of its channels is assigned to one of `assigned_user_ids` and its `condition` holds, the agent of its only `turn_on_ai` step answers it and no assignee moves; when the hours begin to hold it answers those already waiting for a reply. `call_received` decides who answers a WhatsApp call on its channels (WhatsApp numbers with AI calls on): its flow takes only `answer_call`, `decline_call` and a `branch` on `business_hours`, and the first active one that reaches a call step decides, over whoever holds the conversation.
5023
+ * `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message that passes `sent_message_filters`, unless the contact replied first. `at_time` runs once a day at `at_time.time`, on its weekdays, on each conversation of its channels assigned then to one of `conversation_filters.assigned_user_ids` (open ones only with `conversation_filters.only_open`); it has no `condition`. `conversation_assigned` runs when a conversation of its channels is assigned to a member (any member, or one of `conversation_filters.assigned_user_ids`) while its `condition` holds; the assignment an AI handoff makes does not run it. Both take only `turn_on_ai` and `turn_off_ai` steps, which only they take. `call_received` decides who answers a WhatsApp call on its channels (WhatsApp numbers with AI calls on): its flow takes only `answer_call`, `decline_call` and a `branch` on `business_hours`, and the first active one that reaches a call step decides, over whoever holds the conversation.
4988
5024
  */
4989
- trigger: 'assigned_to' | 'conversation_inactive' | 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'team_message_unanswered' | 'call_received';
5025
+ trigger: 'at_time' | 'conversation_assigned' | 'conversation_inactive' | 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'team_message_unanswered' | 'call_received';
4990
5026
  /**
4991
5027
  * Channels it listens to. See `GET /channels`.
4992
5028
  */
@@ -5026,9 +5062,35 @@ export type CreateWorkflow = {
5026
5062
  text_contains?: string;
5027
5063
  };
5028
5064
  /**
5029
- * Members whose conversations an `assigned_to` workflow reaches. See `GET /members`.
5065
+ * When an `at_time` workflow runs; required for it and only for it.
5030
5066
  */
5031
- assigned_user_ids?: Array<string>;
5067
+ at_time?: {
5068
+ /**
5069
+ * Quarter hour it runs, `HH:MM`.
5070
+ */
5071
+ time: string;
5072
+ /**
5073
+ * IANA time zone of `time` and `weekdays`.
5074
+ */
5075
+ timezone: string;
5076
+ /**
5077
+ * Days it runs, 0 for Sunday to 6 for Saturday. Each at most once.
5078
+ */
5079
+ weekdays: Array<number>;
5080
+ };
5081
+ /**
5082
+ * Which conversations `at_time` and `conversation_assigned` reach; only for them.
5083
+ */
5084
+ conversation_filters?: {
5085
+ /**
5086
+ * Members the conversation is assigned to. Required for `at_time`; omitted on `conversation_assigned`, any member. See `GET /members`.
5087
+ */
5088
+ assigned_user_ids?: Array<string>;
5089
+ /**
5090
+ * Only open conversations.
5091
+ */
5092
+ only_open: boolean;
5093
+ };
5032
5094
  /**
5033
5095
  * When it runs; null runs at any hour.
5034
5096
  */
@@ -5048,7 +5110,7 @@ export type CreateWorkflow = {
5048
5110
  */
5049
5111
  entry: string;
5050
5112
  /**
5051
- * One step. `close_conversation`, `end`, `answer_call`, `decline_call` and `turn_on_ai` finish the flow; every other step continues at its target.
5113
+ * One step. `close_conversation`, `end`, `answer_call`, `decline_call`, `turn_on_ai` and `turn_off_ai` finish the flow; every other step continues at its target.
5052
5114
  */
5053
5115
  steps: Array<{
5054
5116
  /**
@@ -5246,9 +5308,19 @@ export type CreateWorkflow = {
5246
5308
  next: string | null;
5247
5309
  kind: 'turn_on_ai';
5248
5310
  /**
5249
- * The only step of an `assigned_to` workflow: this AI agent answers the chats it reaches while its hours hold. Nobody is reassigned.
5311
+ * Turns the AI on in the conversation with this AI agent; the conversation stays assigned to its member. If the contact wrote last, the agent answers at once. It turns off when a member writes in the conversation.
5250
5312
  */
5251
5313
  agent_id: string;
5314
+ } | {
5315
+ /**
5316
+ * Step ID: letters, digits, `_` or `-`, up to 64.
5317
+ */
5318
+ id: string;
5319
+ /**
5320
+ * Step to run next; null ends the flow.
5321
+ */
5322
+ next: string | null;
5323
+ kind: 'turn_off_ai';
5252
5324
  }>;
5253
5325
  };
5254
5326
  };
@@ -5266,9 +5338,9 @@ export type UpdateWorkflow = {
5266
5338
  */
5267
5339
  definition?: {
5268
5340
  /**
5269
- * `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message that passes `sent_message_filters`, unless the contact replied first. `assigned_to` runs nothing: while a conversation of its channels is assigned to one of `assigned_user_ids` and its `condition` holds, the agent of its only `turn_on_ai` step answers it and no assignee moves; when the hours begin to hold it answers those already waiting for a reply. `call_received` decides who answers a WhatsApp call on its channels (WhatsApp numbers with AI calls on): its flow takes only `answer_call`, `decline_call` and a `branch` on `business_hours`, and the first active one that reaches a call step decides, over whoever holds the conversation.
5341
+ * `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message that passes `sent_message_filters`, unless the contact replied first. `at_time` runs once a day at `at_time.time`, on its weekdays, on each conversation of its channels assigned then to one of `conversation_filters.assigned_user_ids` (open ones only with `conversation_filters.only_open`); it has no `condition`. `conversation_assigned` runs when a conversation of its channels is assigned to a member (any member, or one of `conversation_filters.assigned_user_ids`) while its `condition` holds; the assignment an AI handoff makes does not run it. Both take only `turn_on_ai` and `turn_off_ai` steps, which only they take. `call_received` decides who answers a WhatsApp call on its channels (WhatsApp numbers with AI calls on): its flow takes only `answer_call`, `decline_call` and a `branch` on `business_hours`, and the first active one that reaches a call step decides, over whoever holds the conversation.
5270
5342
  */
5271
- trigger: 'assigned_to' | 'conversation_inactive' | 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'team_message_unanswered' | 'call_received';
5343
+ trigger: 'at_time' | 'conversation_assigned' | 'conversation_inactive' | 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'team_message_unanswered' | 'call_received';
5272
5344
  /**
5273
5345
  * Channels it listens to. See `GET /channels`.
5274
5346
  */
@@ -5308,9 +5380,35 @@ export type UpdateWorkflow = {
5308
5380
  text_contains?: string;
5309
5381
  };
5310
5382
  /**
5311
- * Members whose conversations an `assigned_to` workflow reaches. See `GET /members`.
5383
+ * When an `at_time` workflow runs; required for it and only for it.
5312
5384
  */
5313
- assigned_user_ids?: Array<string>;
5385
+ at_time?: {
5386
+ /**
5387
+ * Quarter hour it runs, `HH:MM`.
5388
+ */
5389
+ time: string;
5390
+ /**
5391
+ * IANA time zone of `time` and `weekdays`.
5392
+ */
5393
+ timezone: string;
5394
+ /**
5395
+ * Days it runs, 0 for Sunday to 6 for Saturday. Each at most once.
5396
+ */
5397
+ weekdays: Array<number>;
5398
+ };
5399
+ /**
5400
+ * Which conversations `at_time` and `conversation_assigned` reach; only for them.
5401
+ */
5402
+ conversation_filters?: {
5403
+ /**
5404
+ * Members the conversation is assigned to. Required for `at_time`; omitted on `conversation_assigned`, any member. See `GET /members`.
5405
+ */
5406
+ assigned_user_ids?: Array<string>;
5407
+ /**
5408
+ * Only open conversations.
5409
+ */
5410
+ only_open: boolean;
5411
+ };
5314
5412
  /**
5315
5413
  * When it runs; null runs at any hour.
5316
5414
  */
@@ -5330,7 +5428,7 @@ export type UpdateWorkflow = {
5330
5428
  */
5331
5429
  entry: string;
5332
5430
  /**
5333
- * One step. `close_conversation`, `end`, `answer_call`, `decline_call` and `turn_on_ai` finish the flow; every other step continues at its target.
5431
+ * One step. `close_conversation`, `end`, `answer_call`, `decline_call`, `turn_on_ai` and `turn_off_ai` finish the flow; every other step continues at its target.
5334
5432
  */
5335
5433
  steps: Array<{
5336
5434
  /**
@@ -5528,9 +5626,19 @@ export type UpdateWorkflow = {
5528
5626
  next: string | null;
5529
5627
  kind: 'turn_on_ai';
5530
5628
  /**
5531
- * The only step of an `assigned_to` workflow: this AI agent answers the chats it reaches while its hours hold. Nobody is reassigned.
5629
+ * Turns the AI on in the conversation with this AI agent; the conversation stays assigned to its member. If the contact wrote last, the agent answers at once. It turns off when a member writes in the conversation.
5532
5630
  */
5533
5631
  agent_id: string;
5632
+ } | {
5633
+ /**
5634
+ * Step ID: letters, digits, `_` or `-`, up to 64.
5635
+ */
5636
+ id: string;
5637
+ /**
5638
+ * Step to run next; null ends the flow.
5639
+ */
5640
+ next: string | null;
5641
+ kind: 'turn_off_ai';
5534
5642
  }>;
5535
5643
  };
5536
5644
  };
@@ -3318,9 +3318,9 @@ export type Workflow = {
3318
3318
  type: 'conversation' | 'scheduled';
3319
3319
  definition: {
3320
3320
  /**
3321
- * `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message that passes `sent_message_filters`, unless the contact replied first. `assigned_to` runs nothing: while a conversation of its channels is assigned to one of `assigned_user_ids` and its `condition` holds, the agent of its only `turn_on_ai` step answers it and no assignee moves; when the hours begin to hold it answers those already waiting for a reply. `call_received` decides who answers a WhatsApp call on its channels (WhatsApp numbers with AI calls on): its flow takes only `answer_call`, `decline_call` and a `branch` on `business_hours`, and the first active one that reaches a call step decides, over whoever holds the conversation.
3321
+ * `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message that passes `sent_message_filters`, unless the contact replied first. `at_time` runs once a day at `at_time.time`, on its weekdays, on each conversation of its channels assigned then to one of `conversation_filters.assigned_user_ids` (open ones only with `conversation_filters.only_open`); it has no `condition`. `conversation_assigned` runs when a conversation of its channels is assigned to a member (any member, or one of `conversation_filters.assigned_user_ids`) while its `condition` holds; the assignment an AI handoff makes does not run it. Both take only `turn_on_ai` and `turn_off_ai` steps, which only they take. `call_received` decides who answers a WhatsApp call on its channels (WhatsApp numbers with AI calls on): its flow takes only `answer_call`, `decline_call` and a `branch` on `business_hours`, and the first active one that reaches a call step decides, over whoever holds the conversation.
3322
3322
  */
3323
- trigger: 'assigned_to' | 'conversation_inactive' | 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'team_message_unanswered' | 'call_received';
3323
+ trigger: 'at_time' | 'conversation_assigned' | 'conversation_inactive' | 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'team_message_unanswered' | 'call_received';
3324
3324
  /**
3325
3325
  * Channels it listens to. See `GET /channels`.
3326
3326
  */
@@ -3360,9 +3360,35 @@ export type Workflow = {
3360
3360
  text_contains?: string;
3361
3361
  };
3362
3362
  /**
3363
- * Members whose conversations an `assigned_to` workflow reaches. See `GET /members`.
3363
+ * When an `at_time` workflow runs; required for it and only for it.
3364
3364
  */
3365
- assigned_user_ids?: Array<string>;
3365
+ at_time?: {
3366
+ /**
3367
+ * Quarter hour it runs, `HH:MM`.
3368
+ */
3369
+ time: string;
3370
+ /**
3371
+ * IANA time zone of `time` and `weekdays`.
3372
+ */
3373
+ timezone: string;
3374
+ /**
3375
+ * Days it runs, 0 for Sunday to 6 for Saturday. Each at most once.
3376
+ */
3377
+ weekdays: Array<number>;
3378
+ };
3379
+ /**
3380
+ * Which conversations `at_time` and `conversation_assigned` reach; only for them.
3381
+ */
3382
+ conversation_filters?: {
3383
+ /**
3384
+ * Members the conversation is assigned to. Required for `at_time`; omitted on `conversation_assigned`, any member. See `GET /members`.
3385
+ */
3386
+ assigned_user_ids?: Array<string>;
3387
+ /**
3388
+ * Only open conversations.
3389
+ */
3390
+ only_open: boolean;
3391
+ };
3366
3392
  /**
3367
3393
  * When it runs; null runs at any hour.
3368
3394
  */
@@ -3382,7 +3408,7 @@ export type Workflow = {
3382
3408
  */
3383
3409
  entry: string;
3384
3410
  /**
3385
- * One step. `close_conversation`, `end`, `answer_call`, `decline_call` and `turn_on_ai` finish the flow; every other step continues at its target.
3411
+ * One step. `close_conversation`, `end`, `answer_call`, `decline_call`, `turn_on_ai` and `turn_off_ai` finish the flow; every other step continues at its target.
3386
3412
  */
3387
3413
  steps: Array<{
3388
3414
  /**
@@ -3580,9 +3606,19 @@ export type Workflow = {
3580
3606
  next: string | null;
3581
3607
  kind: 'turn_on_ai';
3582
3608
  /**
3583
- * The only step of an `assigned_to` workflow: this AI agent answers the chats it reaches while its hours hold. Nobody is reassigned.
3609
+ * Turns the AI on in the conversation with this AI agent; the conversation stays assigned to its member. If the contact wrote last, the agent answers at once. It turns off when a member writes in the conversation.
3584
3610
  */
3585
3611
  agent_id: string;
3612
+ } | {
3613
+ /**
3614
+ * Step ID: letters, digits, `_` or `-`, up to 64.
3615
+ */
3616
+ id: string;
3617
+ /**
3618
+ * Step to run next; null ends the flow.
3619
+ */
3620
+ next: string | null;
3621
+ kind: 'turn_off_ai';
3586
3622
  }>;
3587
3623
  };
3588
3624
  } | {
@@ -4984,9 +5020,9 @@ export type CreateWorkflow = {
4984
5020
  */
4985
5021
  definition: {
4986
5022
  /**
4987
- * `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message that passes `sent_message_filters`, unless the contact replied first. `assigned_to` runs nothing: while a conversation of its channels is assigned to one of `assigned_user_ids` and its `condition` holds, the agent of its only `turn_on_ai` step answers it and no assignee moves; when the hours begin to hold it answers those already waiting for a reply. `call_received` decides who answers a WhatsApp call on its channels (WhatsApp numbers with AI calls on): its flow takes only `answer_call`, `decline_call` and a `branch` on `business_hours`, and the first active one that reaches a call step decides, over whoever holds the conversation.
5023
+ * `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message that passes `sent_message_filters`, unless the contact replied first. `at_time` runs once a day at `at_time.time`, on its weekdays, on each conversation of its channels assigned then to one of `conversation_filters.assigned_user_ids` (open ones only with `conversation_filters.only_open`); it has no `condition`. `conversation_assigned` runs when a conversation of its channels is assigned to a member (any member, or one of `conversation_filters.assigned_user_ids`) while its `condition` holds; the assignment an AI handoff makes does not run it. Both take only `turn_on_ai` and `turn_off_ai` steps, which only they take. `call_received` decides who answers a WhatsApp call on its channels (WhatsApp numbers with AI calls on): its flow takes only `answer_call`, `decline_call` and a `branch` on `business_hours`, and the first active one that reaches a call step decides, over whoever holds the conversation.
4988
5024
  */
4989
- trigger: 'assigned_to' | 'conversation_inactive' | 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'team_message_unanswered' | 'call_received';
5025
+ trigger: 'at_time' | 'conversation_assigned' | 'conversation_inactive' | 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'team_message_unanswered' | 'call_received';
4990
5026
  /**
4991
5027
  * Channels it listens to. See `GET /channels`.
4992
5028
  */
@@ -5026,9 +5062,35 @@ export type CreateWorkflow = {
5026
5062
  text_contains?: string;
5027
5063
  };
5028
5064
  /**
5029
- * Members whose conversations an `assigned_to` workflow reaches. See `GET /members`.
5065
+ * When an `at_time` workflow runs; required for it and only for it.
5030
5066
  */
5031
- assigned_user_ids?: Array<string>;
5067
+ at_time?: {
5068
+ /**
5069
+ * Quarter hour it runs, `HH:MM`.
5070
+ */
5071
+ time: string;
5072
+ /**
5073
+ * IANA time zone of `time` and `weekdays`.
5074
+ */
5075
+ timezone: string;
5076
+ /**
5077
+ * Days it runs, 0 for Sunday to 6 for Saturday. Each at most once.
5078
+ */
5079
+ weekdays: Array<number>;
5080
+ };
5081
+ /**
5082
+ * Which conversations `at_time` and `conversation_assigned` reach; only for them.
5083
+ */
5084
+ conversation_filters?: {
5085
+ /**
5086
+ * Members the conversation is assigned to. Required for `at_time`; omitted on `conversation_assigned`, any member. See `GET /members`.
5087
+ */
5088
+ assigned_user_ids?: Array<string>;
5089
+ /**
5090
+ * Only open conversations.
5091
+ */
5092
+ only_open: boolean;
5093
+ };
5032
5094
  /**
5033
5095
  * When it runs; null runs at any hour.
5034
5096
  */
@@ -5048,7 +5110,7 @@ export type CreateWorkflow = {
5048
5110
  */
5049
5111
  entry: string;
5050
5112
  /**
5051
- * One step. `close_conversation`, `end`, `answer_call`, `decline_call` and `turn_on_ai` finish the flow; every other step continues at its target.
5113
+ * One step. `close_conversation`, `end`, `answer_call`, `decline_call`, `turn_on_ai` and `turn_off_ai` finish the flow; every other step continues at its target.
5052
5114
  */
5053
5115
  steps: Array<{
5054
5116
  /**
@@ -5246,9 +5308,19 @@ export type CreateWorkflow = {
5246
5308
  next: string | null;
5247
5309
  kind: 'turn_on_ai';
5248
5310
  /**
5249
- * The only step of an `assigned_to` workflow: this AI agent answers the chats it reaches while its hours hold. Nobody is reassigned.
5311
+ * Turns the AI on in the conversation with this AI agent; the conversation stays assigned to its member. If the contact wrote last, the agent answers at once. It turns off when a member writes in the conversation.
5250
5312
  */
5251
5313
  agent_id: string;
5314
+ } | {
5315
+ /**
5316
+ * Step ID: letters, digits, `_` or `-`, up to 64.
5317
+ */
5318
+ id: string;
5319
+ /**
5320
+ * Step to run next; null ends the flow.
5321
+ */
5322
+ next: string | null;
5323
+ kind: 'turn_off_ai';
5252
5324
  }>;
5253
5325
  };
5254
5326
  };
@@ -5266,9 +5338,9 @@ export type UpdateWorkflow = {
5266
5338
  */
5267
5339
  definition?: {
5268
5340
  /**
5269
- * `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message that passes `sent_message_filters`, unless the contact replied first. `assigned_to` runs nothing: while a conversation of its channels is assigned to one of `assigned_user_ids` and its `condition` holds, the agent of its only `turn_on_ai` step answers it and no assignee moves; when the hours begin to hold it answers those already waiting for a reply. `call_received` decides who answers a WhatsApp call on its channels (WhatsApp numbers with AI calls on): its flow takes only `answer_call`, `decline_call` and a `branch` on `business_hours`, and the first active one that reaches a call step decides, over whoever holds the conversation.
5341
+ * `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message that passes `sent_message_filters`, unless the contact replied first. `at_time` runs once a day at `at_time.time`, on its weekdays, on each conversation of its channels assigned then to one of `conversation_filters.assigned_user_ids` (open ones only with `conversation_filters.only_open`); it has no `condition`. `conversation_assigned` runs when a conversation of its channels is assigned to a member (any member, or one of `conversation_filters.assigned_user_ids`) while its `condition` holds; the assignment an AI handoff makes does not run it. Both take only `turn_on_ai` and `turn_off_ai` steps, which only they take. `call_received` decides who answers a WhatsApp call on its channels (WhatsApp numbers with AI calls on): its flow takes only `answer_call`, `decline_call` and a `branch` on `business_hours`, and the first active one that reaches a call step decides, over whoever holds the conversation.
5270
5342
  */
5271
- trigger: 'assigned_to' | 'conversation_inactive' | 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'team_message_unanswered' | 'call_received';
5343
+ trigger: 'at_time' | 'conversation_assigned' | 'conversation_inactive' | 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'team_message_unanswered' | 'call_received';
5272
5344
  /**
5273
5345
  * Channels it listens to. See `GET /channels`.
5274
5346
  */
@@ -5308,9 +5380,35 @@ export type UpdateWorkflow = {
5308
5380
  text_contains?: string;
5309
5381
  };
5310
5382
  /**
5311
- * Members whose conversations an `assigned_to` workflow reaches. See `GET /members`.
5383
+ * When an `at_time` workflow runs; required for it and only for it.
5312
5384
  */
5313
- assigned_user_ids?: Array<string>;
5385
+ at_time?: {
5386
+ /**
5387
+ * Quarter hour it runs, `HH:MM`.
5388
+ */
5389
+ time: string;
5390
+ /**
5391
+ * IANA time zone of `time` and `weekdays`.
5392
+ */
5393
+ timezone: string;
5394
+ /**
5395
+ * Days it runs, 0 for Sunday to 6 for Saturday. Each at most once.
5396
+ */
5397
+ weekdays: Array<number>;
5398
+ };
5399
+ /**
5400
+ * Which conversations `at_time` and `conversation_assigned` reach; only for them.
5401
+ */
5402
+ conversation_filters?: {
5403
+ /**
5404
+ * Members the conversation is assigned to. Required for `at_time`; omitted on `conversation_assigned`, any member. See `GET /members`.
5405
+ */
5406
+ assigned_user_ids?: Array<string>;
5407
+ /**
5408
+ * Only open conversations.
5409
+ */
5410
+ only_open: boolean;
5411
+ };
5314
5412
  /**
5315
5413
  * When it runs; null runs at any hour.
5316
5414
  */
@@ -5330,7 +5428,7 @@ export type UpdateWorkflow = {
5330
5428
  */
5331
5429
  entry: string;
5332
5430
  /**
5333
- * One step. `close_conversation`, `end`, `answer_call`, `decline_call` and `turn_on_ai` finish the flow; every other step continues at its target.
5431
+ * One step. `close_conversation`, `end`, `answer_call`, `decline_call`, `turn_on_ai` and `turn_off_ai` finish the flow; every other step continues at its target.
5334
5432
  */
5335
5433
  steps: Array<{
5336
5434
  /**
@@ -5528,9 +5626,19 @@ export type UpdateWorkflow = {
5528
5626
  next: string | null;
5529
5627
  kind: 'turn_on_ai';
5530
5628
  /**
5531
- * The only step of an `assigned_to` workflow: this AI agent answers the chats it reaches while its hours hold. Nobody is reassigned.
5629
+ * Turns the AI on in the conversation with this AI agent; the conversation stays assigned to its member. If the contact wrote last, the agent answers at once. It turns off when a member writes in the conversation.
5532
5630
  */
5533
5631
  agent_id: string;
5632
+ } | {
5633
+ /**
5634
+ * Step ID: letters, digits, `_` or `-`, up to 64.
5635
+ */
5636
+ id: string;
5637
+ /**
5638
+ * Step to run next; null ends the flow.
5639
+ */
5640
+ next: string | null;
5641
+ kind: 'turn_off_ai';
5534
5642
  }>;
5535
5643
  };
5536
5644
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "getricky",
3
- "version": "0.1.40",
3
+ "version": "0.1.41",
4
4
  "description": "Official TypeScript SDK for the Ricky REST API",
5
5
  "keywords": [
6
6
  "api",