getricky 0.1.1 → 0.1.3

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.
@@ -3,6 +3,7 @@
3
3
  export const idempotentOperations = new Set([
4
4
  'PATCH /contacts/{contact_id}',
5
5
  'PATCH /conversations/{conversation_id}/assignment',
6
+ 'PATCH /workflows/{workflow_id}',
6
7
  'POST /contacts',
7
8
  'POST /contacts/{contact_id}/notes',
8
9
  'POST /conversations',
@@ -10,4 +11,5 @@ export const idempotentOperations = new Set([
10
11
  'POST /conversations/{conversation_id}/messages',
11
12
  'POST /conversations/{conversation_id}/reopen',
12
13
  'POST /tags',
14
+ 'POST /workflows',
13
15
  ]);
@@ -1,2 +1,2 @@
1
1
  export { type Options, RickyApi } from './sdk.gen.js';
2
- export type { AddContactNote, AddContactNoteData, AddContactNoteError, AddContactNoteErrors, AddContactNoteResponse, AddContactNoteResponses, AssignConversation, AssignConversationData, AssignConversationError, AssignConversationErrors, AssignConversationResponse, AssignConversationResponses, Channel, ClientOptions, CloseConversation, CloseConversationData, CloseConversationError, CloseConversationErrors, CloseConversationResponse, CloseConversationResponses, Contact, ContactField, ContactIdentity, Conversation, CreateContact, CreateContactData, CreateContactError, CreateContactErrors, CreateContactResponse, CreateContactResponses, CreatedWebhook, CreateTag, CreateTagData, CreateTagError, CreateTagErrors, CreateTagResponse, CreateTagResponses, CreateWebhook, CreateWebhookData, CreateWebhookError, CreateWebhookErrors, CreateWebhookResponse, CreateWebhookResponses, DisableWebhookData, DisableWebhookError, DisableWebhookErrors, DisableWebhookResponse, DisableWebhookResponses, Error, GetContactData, GetContactError, GetContactErrors, GetContactResponse, GetContactResponses, GetConversationData, GetConversationError, GetConversationErrors, GetConversationResponse, GetConversationResponses, GetMessageData, GetMessageError, GetMessageErrors, GetMessageResponse, GetMessageResponses, GetSendData, GetSendError, GetSendErrors, GetSendResponse, GetSendResponses, IdempotencyKey, ListChannelsData, ListChannelsError, ListChannelsErrors, ListChannelsResponse, ListChannelsResponses, ListContactFieldsData, ListContactFieldsError, ListContactFieldsErrors, ListContactFieldsResponse, ListContactFieldsResponses, ListContactsData, ListContactsError, ListContactsErrors, ListContactsResponse, ListContactsResponses, ListConversationsData, ListConversationsError, ListConversationsErrors, ListConversationsResponse, ListConversationsResponses, ListMembersData, ListMembersError, ListMembersErrors, ListMembersResponse, ListMembersResponses, ListMessagesData, ListMessagesError, ListMessagesErrors, ListMessagesResponse, ListMessagesResponses, ListTagsData, ListTagsError, ListTagsErrors, ListTagsResponse, ListTagsResponses, ListTemplatesData, ListTemplatesError, ListTemplatesErrors, ListTemplatesResponse, ListTemplatesResponses, ListWebhookDeliveriesData, ListWebhookDeliveriesError, ListWebhookDeliveriesErrors, ListWebhookDeliveriesResponse, ListWebhookDeliveriesResponses, ListWebhooksData, ListWebhooksError, ListWebhooksErrors, ListWebhooksResponse, ListWebhooksResponses, MediaMessage, Member, Message, ReopenConversationData, ReopenConversationError, ReopenConversationErrors, ReopenConversationResponse, ReopenConversationResponses, RetryWebhookDeliveryData, RetryWebhookDeliveryError, RetryWebhookDeliveryErrors, RetryWebhookDeliveryResponse, RetryWebhookDeliveryResponses, RotateWebhookSecret, RotateWebhookSecretData, RotateWebhookSecretError, RotateWebhookSecretErrors, RotateWebhookSecretResponse, RotateWebhookSecretResponses, Send, SendMessage, SendMessageData, SendMessageError, SendMessageErrors, SendMessageResponse, SendMessageResponses, StartConversation, StartConversationData, StartConversationError, StartConversationErrors, StartConversationResponse, StartConversationResponses, Tag, Template, TemplateMessage, TestWebhookData, TestWebhookError, TestWebhookErrors, TestWebhookResponse, TestWebhookResponses, UpdateContact, UpdateContactData, UpdateContactError, UpdateContactErrors, UpdateContactResponse, UpdateContactResponses, Webhook, WebhookContactCreatedWebhookPayload, WebhookContactCreatedWebhookRequest, WebhookContactUpdatedWebhookPayload, WebhookContactUpdatedWebhookRequest, WebhookConversationAssignmentChangedWebhookPayload, WebhookConversationAssignmentChangedWebhookRequest, WebhookConversationClosedWebhookPayload, WebhookConversationClosedWebhookRequest, WebhookConversationOpenedWebhookPayload, WebhookConversationOpenedWebhookRequest, WebhookDelivery, WebhookEvent, WebhookMessageDeliveredWebhookPayload, WebhookMessageDeliveredWebhookRequest, WebhookMessageFailedWebhookPayload, WebhookMessageFailedWebhookRequest, WebhookMessageReadWebhookPayload, WebhookMessageReadWebhookRequest, WebhookMessageReceivedWebhookPayload, WebhookMessageReceivedWebhookRequest, WebhookMessageSentWebhookPayload, WebhookMessageSentWebhookRequest, Webhooks, WebhookTestResult, WebhookWebhookTestWebhookPayload, WebhookWebhookTestWebhookRequest } from './types.gen.js';
2
+ export type { ActivateWorkflowData, ActivateWorkflowError, ActivateWorkflowErrors, ActivateWorkflowResponse, ActivateWorkflowResponses, AddContactNote, AddContactNoteData, AddContactNoteError, AddContactNoteErrors, AddContactNoteResponse, AddContactNoteResponses, AdsReport, AssignConversation, AssignConversationData, AssignConversationError, AssignConversationErrors, AssignConversationResponse, AssignConversationResponses, BroadcastsReport, Channel, ClientOptions, CloseConversation, CloseConversationData, CloseConversationError, CloseConversationErrors, CloseConversationResponse, CloseConversationResponses, Contact, ContactField, ContactIdentity, Conversation, ConversationsReport, CreateContact, CreateContactData, CreateContactError, CreateContactErrors, CreateContactResponse, CreateContactResponses, CreatedWebhook, CreateTag, CreateTagData, CreateTagError, CreateTagErrors, CreateTagResponse, CreateTagResponses, CreateWebhook, CreateWebhookData, CreateWebhookError, CreateWebhookErrors, CreateWebhookResponse, CreateWebhookResponses, CreateWorkflow, CreateWorkflowData, CreateWorkflowError, CreateWorkflowErrors, CreateWorkflowResponse, CreateWorkflowResponses, DashboardReport, DeleteWorkflowData, DeleteWorkflowError, DeleteWorkflowErrors, DeleteWorkflowResponse, DeleteWorkflowResponses, DisableWebhookData, DisableWebhookError, DisableWebhookErrors, DisableWebhookResponse, DisableWebhookResponses, Error, GetAdsReportData, GetAdsReportError, GetAdsReportErrors, GetAdsReportResponse, GetAdsReportResponses, GetBroadcastsReportData, GetBroadcastsReportError, GetBroadcastsReportErrors, GetBroadcastsReportResponse, GetBroadcastsReportResponses, GetContactData, GetContactError, GetContactErrors, GetContactResponse, GetContactResponses, GetConversationData, GetConversationError, GetConversationErrors, GetConversationResponse, GetConversationResponses, GetConversationsReportData, GetConversationsReportError, GetConversationsReportErrors, GetConversationsReportResponse, GetConversationsReportResponses, GetDashboardReportData, GetDashboardReportError, GetDashboardReportErrors, GetDashboardReportResponse, GetDashboardReportResponses, GetMessageData, GetMessageError, GetMessageErrors, GetMessageResponse, GetMessageResponses, GetMessagesReportData, GetMessagesReportError, GetMessagesReportErrors, GetMessagesReportResponse, GetMessagesReportResponses, GetResolutionsReportData, GetResolutionsReportError, GetResolutionsReportErrors, GetResolutionsReportResponse, GetResolutionsReportResponses, GetResponsesReportData, GetResponsesReportError, GetResponsesReportErrors, GetResponsesReportResponse, GetResponsesReportResponses, GetSendData, GetSendError, GetSendErrors, GetSendResponse, GetSendResponses, GetTeamReportData, GetTeamReportError, GetTeamReportErrors, GetTeamReportResponse, GetTeamReportResponses, GetWorkflowData, GetWorkflowError, GetWorkflowErrors, GetWorkflowResponse, GetWorkflowResponses, IdempotencyKey, ListChannelsData, ListChannelsError, ListChannelsErrors, ListChannelsResponse, ListChannelsResponses, ListContactFieldsData, ListContactFieldsError, ListContactFieldsErrors, ListContactFieldsResponse, ListContactFieldsResponses, ListContactsData, ListContactsError, ListContactsErrors, ListContactsResponse, ListContactsResponses, ListConversationsData, ListConversationsError, ListConversationsErrors, ListConversationsResponse, ListConversationsResponses, ListMembersData, ListMembersError, ListMembersErrors, ListMembersResponse, ListMembersResponses, ListMessagesData, ListMessagesError, ListMessagesErrors, ListMessagesResponse, ListMessagesResponses, ListTagsData, ListTagsError, ListTagsErrors, ListTagsResponse, ListTagsResponses, ListTemplatesData, ListTemplatesError, ListTemplatesErrors, ListTemplatesResponse, ListTemplatesResponses, ListWebhookDeliveriesData, ListWebhookDeliveriesError, ListWebhookDeliveriesErrors, ListWebhookDeliveriesResponse, ListWebhookDeliveriesResponses, ListWebhooksData, ListWebhooksError, ListWebhooksErrors, ListWebhooksResponse, ListWebhooksResponses, ListWorkflowExecutionsData, ListWorkflowExecutionsError, ListWorkflowExecutionsErrors, ListWorkflowExecutionsResponse, ListWorkflowExecutionsResponses, ListWorkflowsData, ListWorkflowsError, ListWorkflowsErrors, ListWorkflowsResponse, ListWorkflowsResponses, MediaMessage, Member, Message, MessagesReport, PauseWorkflowData, PauseWorkflowError, PauseWorkflowErrors, PauseWorkflowResponse, PauseWorkflowResponses, ReopenConversationData, ReopenConversationError, ReopenConversationErrors, ReopenConversationResponse, ReopenConversationResponses, ReportPeriod, ResolutionsReport, ResponsesReport, RetryWebhookDeliveryData, RetryWebhookDeliveryError, RetryWebhookDeliveryErrors, RetryWebhookDeliveryResponse, RetryWebhookDeliveryResponses, RotateWebhookSecret, RotateWebhookSecretData, RotateWebhookSecretError, RotateWebhookSecretErrors, RotateWebhookSecretResponse, RotateWebhookSecretResponses, Send, SendMessage, SendMessageData, SendMessageError, SendMessageErrors, SendMessageResponse, SendMessageResponses, StartConversation, StartConversationData, StartConversationError, StartConversationErrors, StartConversationResponse, StartConversationResponses, Tag, TeamReport, Template, TemplateMessage, TestWebhookData, TestWebhookError, TestWebhookErrors, TestWebhookResponse, TestWebhookResponses, UpdateContact, UpdateContactData, UpdateContactError, UpdateContactErrors, UpdateContactResponse, UpdateContactResponses, UpdateWorkflow, UpdateWorkflowData, UpdateWorkflowError, UpdateWorkflowErrors, UpdateWorkflowResponse, UpdateWorkflowResponses, Webhook, WebhookContactCreatedWebhookPayload, WebhookContactCreatedWebhookRequest, WebhookContactUpdatedWebhookPayload, WebhookContactUpdatedWebhookRequest, WebhookConversationAssignmentChangedWebhookPayload, WebhookConversationAssignmentChangedWebhookRequest, WebhookConversationClosedWebhookPayload, WebhookConversationClosedWebhookRequest, WebhookConversationOpenedWebhookPayload, WebhookConversationOpenedWebhookRequest, WebhookDelivery, WebhookEvent, WebhookMessageDeliveredWebhookPayload, WebhookMessageDeliveredWebhookRequest, WebhookMessageFailedWebhookPayload, WebhookMessageFailedWebhookRequest, WebhookMessageReadWebhookPayload, WebhookMessageReadWebhookRequest, WebhookMessageReceivedWebhookPayload, WebhookMessageReceivedWebhookRequest, WebhookMessageSentWebhookPayload, WebhookMessageSentWebhookRequest, Webhooks, WebhookTestResult, WebhookWebhookTestWebhookPayload, WebhookWebhookTestWebhookRequest, Workflow, WorkflowExecution } from './types.gen.js';
@@ -1,5 +1,5 @@
1
1
  import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client/index.js';
2
- import type { AddContactNoteData, AddContactNoteErrors, AddContactNoteResponses, AssignConversationData, AssignConversationErrors, AssignConversationResponses, CloseConversationData, CloseConversationErrors, CloseConversationResponses, CreateContactData, CreateContactErrors, CreateContactResponses, CreateTagData, CreateTagErrors, CreateTagResponses, CreateWebhookData, CreateWebhookErrors, CreateWebhookResponses, DisableWebhookData, DisableWebhookErrors, DisableWebhookResponses, GetContactData, GetContactErrors, GetContactResponses, GetConversationData, GetConversationErrors, GetConversationResponses, GetMessageData, GetMessageErrors, GetMessageResponses, GetSendData, GetSendErrors, GetSendResponses, ListChannelsData, ListChannelsErrors, ListChannelsResponses, ListContactFieldsData, ListContactFieldsErrors, ListContactFieldsResponses, ListContactsData, ListContactsErrors, ListContactsResponses, ListConversationsData, ListConversationsErrors, ListConversationsResponses, ListMembersData, ListMembersErrors, ListMembersResponses, ListMessagesData, ListMessagesErrors, ListMessagesResponses, ListTagsData, ListTagsErrors, ListTagsResponses, ListTemplatesData, ListTemplatesErrors, ListTemplatesResponses, ListWebhookDeliveriesData, ListWebhookDeliveriesErrors, ListWebhookDeliveriesResponses, ListWebhooksData, ListWebhooksErrors, ListWebhooksResponses, ReopenConversationData, ReopenConversationErrors, ReopenConversationResponses, RetryWebhookDeliveryData, RetryWebhookDeliveryErrors, RetryWebhookDeliveryResponses, RotateWebhookSecretData, RotateWebhookSecretErrors, RotateWebhookSecretResponses, SendMessageData, SendMessageErrors, SendMessageResponses, StartConversationData, StartConversationErrors, StartConversationResponses, TestWebhookData, TestWebhookErrors, TestWebhookResponses, UpdateContactData, UpdateContactErrors, UpdateContactResponses } from './types.gen.js';
2
+ import type { ActivateWorkflowData, ActivateWorkflowErrors, ActivateWorkflowResponses, AddContactNoteData, AddContactNoteErrors, AddContactNoteResponses, AssignConversationData, AssignConversationErrors, AssignConversationResponses, CloseConversationData, CloseConversationErrors, CloseConversationResponses, CreateContactData, CreateContactErrors, CreateContactResponses, CreateTagData, CreateTagErrors, CreateTagResponses, CreateWebhookData, CreateWebhookErrors, CreateWebhookResponses, CreateWorkflowData, CreateWorkflowErrors, CreateWorkflowResponses, DeleteWorkflowData, DeleteWorkflowErrors, DeleteWorkflowResponses, DisableWebhookData, DisableWebhookErrors, DisableWebhookResponses, GetAdsReportData, GetAdsReportErrors, GetAdsReportResponses, GetBroadcastsReportData, GetBroadcastsReportErrors, GetBroadcastsReportResponses, GetContactData, GetContactErrors, GetContactResponses, GetConversationData, GetConversationErrors, GetConversationResponses, GetConversationsReportData, GetConversationsReportErrors, GetConversationsReportResponses, GetDashboardReportData, GetDashboardReportErrors, GetDashboardReportResponses, GetMessageData, GetMessageErrors, GetMessageResponses, GetMessagesReportData, GetMessagesReportErrors, GetMessagesReportResponses, GetResolutionsReportData, GetResolutionsReportErrors, GetResolutionsReportResponses, GetResponsesReportData, GetResponsesReportErrors, GetResponsesReportResponses, GetSendData, GetSendErrors, GetSendResponses, GetTeamReportData, GetTeamReportErrors, GetTeamReportResponses, GetWorkflowData, GetWorkflowErrors, GetWorkflowResponses, ListChannelsData, ListChannelsErrors, ListChannelsResponses, ListContactFieldsData, ListContactFieldsErrors, ListContactFieldsResponses, ListContactsData, ListContactsErrors, ListContactsResponses, ListConversationsData, ListConversationsErrors, ListConversationsResponses, ListMembersData, ListMembersErrors, ListMembersResponses, ListMessagesData, ListMessagesErrors, ListMessagesResponses, ListTagsData, ListTagsErrors, ListTagsResponses, ListTemplatesData, ListTemplatesErrors, ListTemplatesResponses, ListWebhookDeliveriesData, ListWebhookDeliveriesErrors, ListWebhookDeliveriesResponses, ListWebhooksData, ListWebhooksErrors, ListWebhooksResponses, ListWorkflowExecutionsData, ListWorkflowExecutionsErrors, ListWorkflowExecutionsResponses, ListWorkflowsData, ListWorkflowsErrors, ListWorkflowsResponses, PauseWorkflowData, PauseWorkflowErrors, PauseWorkflowResponses, ReopenConversationData, ReopenConversationErrors, ReopenConversationResponses, RetryWebhookDeliveryData, RetryWebhookDeliveryErrors, RetryWebhookDeliveryResponses, RotateWebhookSecretData, RotateWebhookSecretErrors, RotateWebhookSecretResponses, SendMessageData, SendMessageErrors, SendMessageResponses, StartConversationData, StartConversationErrors, StartConversationResponses, TestWebhookData, TestWebhookErrors, TestWebhookResponses, UpdateContactData, UpdateContactErrors, UpdateContactResponses, UpdateWorkflowData, UpdateWorkflowErrors, UpdateWorkflowResponses } from './types.gen.js';
3
3
  export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
4
4
  /**
5
5
  * You can provide a client instance returned by `createClient()` instead of
@@ -255,5 +255,133 @@ export declare class RickyApi extends HeyApiClient {
255
255
  * Scope: `webhooks:manage`.
256
256
  */
257
257
  retryWebhookDelivery<ThrowOnError extends boolean = true>(options: Options<RetryWebhookDeliveryData, ThrowOnError>): RequestResult<RetryWebhookDeliveryResponses, RetryWebhookDeliveryErrors, ThrowOnError, 'data'>;
258
+ /**
259
+ * List workflows
260
+ *
261
+ * Every workflow of the organization with its definition, last changed first.
262
+ *
263
+ * Scope: `workflows:read`.
264
+ */
265
+ listWorkflows<ThrowOnError extends boolean = true>(options?: Options<ListWorkflowsData, ThrowOnError>): RequestResult<ListWorkflowsResponses, ListWorkflowsErrors, ThrowOnError, 'data'>;
266
+ /**
267
+ * Create a workflow
268
+ *
269
+ * Creates a conversation workflow as a `draft`; it runs nothing until you activate it. Ricky checks the flow with the rules of the workflow editor, and that its channels, members and agents belong to the organization.
270
+ *
271
+ * Scope: `workflows:write`.
272
+ */
273
+ createWorkflow<ThrowOnError extends boolean = true>(options: Options<CreateWorkflowData, ThrowOnError>): RequestResult<CreateWorkflowResponses, CreateWorkflowErrors, ThrowOnError, 'data'>;
274
+ /**
275
+ * Delete a workflow
276
+ *
277
+ * Deletes the workflow and answers it as it was. Sends already queued still go out. Deleting twice answers `404`.
278
+ *
279
+ * Scope: `workflows:write`.
280
+ */
281
+ deleteWorkflow<ThrowOnError extends boolean = true>(options: Options<DeleteWorkflowData, ThrowOnError>): RequestResult<DeleteWorkflowResponses, DeleteWorkflowErrors, ThrowOnError, 'data'>;
282
+ /**
283
+ * Get a workflow
284
+ *
285
+ * One workflow with its definition.
286
+ *
287
+ * Scope: `workflows:read`.
288
+ */
289
+ getWorkflow<ThrowOnError extends boolean = true>(options: Options<GetWorkflowData, ThrowOnError>): RequestResult<GetWorkflowResponses, GetWorkflowErrors, ThrowOnError, 'data'>;
290
+ /**
291
+ * Update a workflow
292
+ *
293
+ * Changes the name, replaces the definition, or both, and keeps the status. An active workflow must still be able to run the new definition. A scheduled workflow only accepts a new name.
294
+ *
295
+ * Scope: `workflows:write`.
296
+ */
297
+ updateWorkflow<ThrowOnError extends boolean = true>(options: Options<UpdateWorkflowData, ThrowOnError>): RequestResult<UpdateWorkflowResponses, UpdateWorkflowErrors, ThrowOnError, 'data'>;
298
+ /**
299
+ * Activate a workflow
300
+ *
301
+ * From now on it runs on new events, and its steps can message contacts, assign members or put an AI agent on conversations. Ricky checks again what it references; assigning an AI agent needs an active subscription. Activating an active workflow changes nothing. Send no body.
302
+ *
303
+ * Scope: `workflows:write`.
304
+ */
305
+ activateWorkflow<ThrowOnError extends boolean = true>(options: Options<ActivateWorkflowData, ThrowOnError>): RequestResult<ActivateWorkflowResponses, ActivateWorkflowErrors, ThrowOnError, 'data'>;
306
+ /**
307
+ * Pause a workflow
308
+ *
309
+ * It starts no new executions; sends already queued still go out. Pausing a paused workflow changes nothing. Send no body.
310
+ *
311
+ * Scope: `workflows:write`.
312
+ */
313
+ pauseWorkflow<ThrowOnError extends boolean = true>(options: Options<PauseWorkflowData, ThrowOnError>): RequestResult<PauseWorkflowResponses, PauseWorkflowErrors, ThrowOnError, 'data'>;
314
+ /**
315
+ * List executions
316
+ *
317
+ * Runs of the workflow with their status, attempts and errors, newest first.
318
+ *
319
+ * Scope: `workflows:read`.
320
+ */
321
+ listWorkflowExecutions<ThrowOnError extends boolean = true>(options: Options<ListWorkflowExecutionsData, ThrowOnError>): RequestResult<ListWorkflowExecutionsResponses, ListWorkflowExecutionsErrors, ThrowOnError, 'data'>;
322
+ /**
323
+ * Get the live dashboard
324
+ *
325
+ * Open conversations, who holds them and who is waiting for a reply, right now. "Today" is the America/Panama day.
326
+ *
327
+ * Scope: `reports:read`.
328
+ */
329
+ getDashboardReport<ThrowOnError extends boolean = true>(options?: Options<GetDashboardReportData, ThrowOnError>): RequestResult<GetDashboardReportResponses, GetDashboardReportErrors, ThrowOnError, 'data'>;
330
+ /**
331
+ * Get the conversations report
332
+ *
333
+ * Customers who wrote in the period, new or returning, per channel, day and hour. Days and hours are America/Panama time, like the Reports pages; each number is compared with the previous period of the same length.
334
+ *
335
+ * Scope: `reports:read`.
336
+ */
337
+ getConversationsReport<ThrowOnError extends boolean = true>(options?: Options<GetConversationsReportData, ThrowOnError>): RequestResult<GetConversationsReportResponses, GetConversationsReportErrors, ThrowOnError, 'data'>;
338
+ /**
339
+ * Get the messages report
340
+ *
341
+ * Messages received and sent in the period, and who sent them. Days and hours are America/Panama time, like the Reports pages; each number is compared with the previous period of the same length.
342
+ *
343
+ * Scope: `reports:read`.
344
+ */
345
+ getMessagesReport<ThrowOnError extends boolean = true>(options?: Options<GetMessagesReportData, ThrowOnError>): RequestResult<GetMessagesReportResponses, GetMessagesReportErrors, ThrowOnError, 'data'>;
346
+ /**
347
+ * Get the responses report
348
+ *
349
+ * How fast people and AI agents answered customers in the period, per channel and responder. Days and hours are America/Panama time, like the Reports pages; each number is compared with the previous period of the same length.
350
+ *
351
+ * Scope: `reports:read`.
352
+ */
353
+ getResponsesReport<ThrowOnError extends boolean = true>(options?: Options<GetResponsesReportData, ThrowOnError>): RequestResult<GetResponsesReportResponses, GetResponsesReportErrors, ThrowOnError, 'data'>;
354
+ /**
355
+ * Get the resolutions report
356
+ *
357
+ * Conversations closed in the period and how long they were open. Days and hours are America/Panama time, like the Reports pages; each number is compared with the previous period of the same length.
358
+ *
359
+ * Scope: `reports:read`.
360
+ */
361
+ getResolutionsReport<ThrowOnError extends boolean = true>(options?: Options<GetResolutionsReportData, ThrowOnError>): RequestResult<GetResolutionsReportResponses, GetResolutionsReportErrors, ThrowOnError, 'data'>;
362
+ /**
363
+ * Get the team report
364
+ *
365
+ * Assignments, messages, closes and medians per member and AI agent in the period. Days are America/Panama time, like the Reports pages.
366
+ *
367
+ * Scope: `reports:read`.
368
+ */
369
+ getTeamReport<ThrowOnError extends boolean = true>(options?: Options<GetTeamReportData, ThrowOnError>): RequestResult<GetTeamReportResponses, GetTeamReportErrors, ThrowOnError, 'data'>;
370
+ /**
371
+ * Get the broadcasts report
372
+ *
373
+ * WhatsApp broadcasts created in the period and their recipients' outcomes. Days and hours are America/Panama time, like the Reports pages; each number is compared with the previous period of the same length.
374
+ *
375
+ * Scope: `reports:read`.
376
+ */
377
+ getBroadcastsReport<ThrowOnError extends boolean = true>(options?: Options<GetBroadcastsReportData, ThrowOnError>): RequestResult<GetBroadcastsReportResponses, GetBroadcastsReportErrors, ThrowOnError, 'data'>;
378
+ /**
379
+ * Get the ads report
380
+ *
381
+ * Meta ad spend and the conversations each ad brought in the period. Days and hours are America/Panama time, like the Reports pages; each number is compared with the previous period of the same length.
382
+ *
383
+ * Scope: `reports:read`.
384
+ */
385
+ getAdsReport<ThrowOnError extends boolean = true>(options?: Options<GetAdsReportData, ThrowOnError>): RequestResult<GetAdsReportResponses, GetAdsReportErrors, ThrowOnError, 'data'>;
258
386
  }
259
387
  export {};
@@ -486,4 +486,252 @@ export class RickyApi extends HeyApiClient {
486
486
  ...options
487
487
  });
488
488
  }
489
+ /**
490
+ * List workflows
491
+ *
492
+ * Every workflow of the organization with its definition, last changed first.
493
+ *
494
+ * Scope: `workflows:read`.
495
+ */
496
+ listWorkflows(options) {
497
+ return (options?.client ?? this.client).get({
498
+ responseStyle: 'data',
499
+ security: [{ scheme: 'bearer', type: 'http' }],
500
+ url: '/workflows',
501
+ ...options
502
+ });
503
+ }
504
+ /**
505
+ * Create a workflow
506
+ *
507
+ * Creates a conversation workflow as a `draft`; it runs nothing until you activate it. Ricky checks the flow with the rules of the workflow editor, and that its channels, members and agents belong to the organization.
508
+ *
509
+ * Scope: `workflows:write`.
510
+ */
511
+ createWorkflow(options) {
512
+ return (options.client ?? this.client).post({
513
+ responseStyle: 'data',
514
+ security: [{ scheme: 'bearer', type: 'http' }],
515
+ url: '/workflows',
516
+ ...options,
517
+ headers: {
518
+ 'Content-Type': 'application/json',
519
+ ...options.headers
520
+ }
521
+ });
522
+ }
523
+ /**
524
+ * Delete a workflow
525
+ *
526
+ * Deletes the workflow and answers it as it was. Sends already queued still go out. Deleting twice answers `404`.
527
+ *
528
+ * Scope: `workflows:write`.
529
+ */
530
+ deleteWorkflow(options) {
531
+ return (options.client ?? this.client).delete({
532
+ responseStyle: 'data',
533
+ security: [{ scheme: 'bearer', type: 'http' }],
534
+ url: '/workflows/{workflow_id}',
535
+ ...options
536
+ });
537
+ }
538
+ /**
539
+ * Get a workflow
540
+ *
541
+ * One workflow with its definition.
542
+ *
543
+ * Scope: `workflows:read`.
544
+ */
545
+ getWorkflow(options) {
546
+ return (options.client ?? this.client).get({
547
+ responseStyle: 'data',
548
+ security: [{ scheme: 'bearer', type: 'http' }],
549
+ url: '/workflows/{workflow_id}',
550
+ ...options
551
+ });
552
+ }
553
+ /**
554
+ * Update a workflow
555
+ *
556
+ * Changes the name, replaces the definition, or both, and keeps the status. An active workflow must still be able to run the new definition. A scheduled workflow only accepts a new name.
557
+ *
558
+ * Scope: `workflows:write`.
559
+ */
560
+ updateWorkflow(options) {
561
+ return (options.client ?? this.client).patch({
562
+ responseStyle: 'data',
563
+ security: [{ scheme: 'bearer', type: 'http' }],
564
+ url: '/workflows/{workflow_id}',
565
+ ...options,
566
+ headers: {
567
+ 'Content-Type': 'application/json',
568
+ ...options.headers
569
+ }
570
+ });
571
+ }
572
+ /**
573
+ * Activate a workflow
574
+ *
575
+ * From now on it runs on new events, and its steps can message contacts, assign members or put an AI agent on conversations. Ricky checks again what it references; assigning an AI agent needs an active subscription. Activating an active workflow changes nothing. Send no body.
576
+ *
577
+ * Scope: `workflows:write`.
578
+ */
579
+ activateWorkflow(options) {
580
+ return (options.client ?? this.client).post({
581
+ responseStyle: 'data',
582
+ security: [{ scheme: 'bearer', type: 'http' }],
583
+ url: '/workflows/{workflow_id}/activate',
584
+ ...options
585
+ });
586
+ }
587
+ /**
588
+ * Pause a workflow
589
+ *
590
+ * It starts no new executions; sends already queued still go out. Pausing a paused workflow changes nothing. Send no body.
591
+ *
592
+ * Scope: `workflows:write`.
593
+ */
594
+ pauseWorkflow(options) {
595
+ return (options.client ?? this.client).post({
596
+ responseStyle: 'data',
597
+ security: [{ scheme: 'bearer', type: 'http' }],
598
+ url: '/workflows/{workflow_id}/pause',
599
+ ...options
600
+ });
601
+ }
602
+ /**
603
+ * List executions
604
+ *
605
+ * Runs of the workflow with their status, attempts and errors, newest first.
606
+ *
607
+ * Scope: `workflows:read`.
608
+ */
609
+ listWorkflowExecutions(options) {
610
+ return (options.client ?? this.client).get({
611
+ responseStyle: 'data',
612
+ security: [{ scheme: 'bearer', type: 'http' }],
613
+ url: '/workflows/{workflow_id}/executions',
614
+ ...options
615
+ });
616
+ }
617
+ /**
618
+ * Get the live dashboard
619
+ *
620
+ * Open conversations, who holds them and who is waiting for a reply, right now. "Today" is the America/Panama day.
621
+ *
622
+ * Scope: `reports:read`.
623
+ */
624
+ getDashboardReport(options) {
625
+ return (options?.client ?? this.client).get({
626
+ responseStyle: 'data',
627
+ security: [{ scheme: 'bearer', type: 'http' }],
628
+ url: '/reports/dashboard',
629
+ ...options
630
+ });
631
+ }
632
+ /**
633
+ * Get the conversations report
634
+ *
635
+ * Customers who wrote in the period, new or returning, per channel, day and hour. Days and hours are America/Panama time, like the Reports pages; each number is compared with the previous period of the same length.
636
+ *
637
+ * Scope: `reports:read`.
638
+ */
639
+ getConversationsReport(options) {
640
+ return (options?.client ?? this.client).get({
641
+ responseStyle: 'data',
642
+ security: [{ scheme: 'bearer', type: 'http' }],
643
+ url: '/reports/conversations',
644
+ ...options
645
+ });
646
+ }
647
+ /**
648
+ * Get the messages report
649
+ *
650
+ * Messages received and sent in the period, and who sent them. Days and hours are America/Panama time, like the Reports pages; each number is compared with the previous period of the same length.
651
+ *
652
+ * Scope: `reports:read`.
653
+ */
654
+ getMessagesReport(options) {
655
+ return (options?.client ?? this.client).get({
656
+ responseStyle: 'data',
657
+ security: [{ scheme: 'bearer', type: 'http' }],
658
+ url: '/reports/messages',
659
+ ...options
660
+ });
661
+ }
662
+ /**
663
+ * Get the responses report
664
+ *
665
+ * How fast people and AI agents answered customers in the period, per channel and responder. Days and hours are America/Panama time, like the Reports pages; each number is compared with the previous period of the same length.
666
+ *
667
+ * Scope: `reports:read`.
668
+ */
669
+ getResponsesReport(options) {
670
+ return (options?.client ?? this.client).get({
671
+ responseStyle: 'data',
672
+ security: [{ scheme: 'bearer', type: 'http' }],
673
+ url: '/reports/responses',
674
+ ...options
675
+ });
676
+ }
677
+ /**
678
+ * Get the resolutions report
679
+ *
680
+ * Conversations closed in the period and how long they were open. Days and hours are America/Panama time, like the Reports pages; each number is compared with the previous period of the same length.
681
+ *
682
+ * Scope: `reports:read`.
683
+ */
684
+ getResolutionsReport(options) {
685
+ return (options?.client ?? this.client).get({
686
+ responseStyle: 'data',
687
+ security: [{ scheme: 'bearer', type: 'http' }],
688
+ url: '/reports/resolutions',
689
+ ...options
690
+ });
691
+ }
692
+ /**
693
+ * Get the team report
694
+ *
695
+ * Assignments, messages, closes and medians per member and AI agent in the period. Days are America/Panama time, like the Reports pages.
696
+ *
697
+ * Scope: `reports:read`.
698
+ */
699
+ getTeamReport(options) {
700
+ return (options?.client ?? this.client).get({
701
+ responseStyle: 'data',
702
+ security: [{ scheme: 'bearer', type: 'http' }],
703
+ url: '/reports/team',
704
+ ...options
705
+ });
706
+ }
707
+ /**
708
+ * Get the broadcasts report
709
+ *
710
+ * WhatsApp broadcasts created in the period and their recipients' outcomes. Days and hours are America/Panama time, like the Reports pages; each number is compared with the previous period of the same length.
711
+ *
712
+ * Scope: `reports:read`.
713
+ */
714
+ getBroadcastsReport(options) {
715
+ return (options?.client ?? this.client).get({
716
+ responseStyle: 'data',
717
+ security: [{ scheme: 'bearer', type: 'http' }],
718
+ url: '/reports/broadcasts',
719
+ ...options
720
+ });
721
+ }
722
+ /**
723
+ * Get the ads report
724
+ *
725
+ * Meta ad spend and the conversations each ad brought in the period. Days and hours are America/Panama time, like the Reports pages; each number is compared with the previous period of the same length.
726
+ *
727
+ * Scope: `reports:read`.
728
+ */
729
+ getAdsReport(options) {
730
+ return (options?.client ?? this.client).get({
731
+ responseStyle: 'data',
732
+ security: [{ scheme: 'bearer', type: 'http' }],
733
+ url: '/reports/ads',
734
+ ...options
735
+ });
736
+ }
489
737
  }