getricky 0.1.2 → 0.1.4

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.
@@ -614,4 +614,509 @@ export class RickyApi extends HeyApiClient {
614
614
  ...options
615
615
  });
616
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
+ }
737
+ /**
738
+ * List agents
739
+ *
740
+ * Active agents, newest first. Archived agents are not listed.
741
+ *
742
+ * Scope: `agents:read`.
743
+ */
744
+ listAgents(options) {
745
+ return (options?.client ?? this.client).get({
746
+ responseStyle: 'data',
747
+ security: [{ scheme: 'bearer', type: 'http' }],
748
+ url: '/agents',
749
+ ...options
750
+ });
751
+ }
752
+ /**
753
+ * Create an agent
754
+ *
755
+ * Creates an AI agent with its instructions, model, voice and capabilities. It answers no conversation until you assign it to one or make it a channel default in Ricky.
756
+ *
757
+ * Scope: `agents:write`.
758
+ */
759
+ createAgent(options) {
760
+ return (options.client ?? this.client).post({
761
+ responseStyle: 'data',
762
+ security: [{ scheme: 'bearer', type: 'http' }],
763
+ url: '/agents',
764
+ ...options,
765
+ headers: {
766
+ 'Content-Type': 'application/json',
767
+ ...options.headers
768
+ }
769
+ });
770
+ }
771
+ /**
772
+ * Archive an agent
773
+ *
774
+ * Archives the agent and answers it as it was, with `archived_at`. Its conversations stop being answered by it and workflows that assign it are paused. Archiving twice answers `404`.
775
+ *
776
+ * Scope: `agents:write`.
777
+ */
778
+ archiveAgent(options) {
779
+ return (options.client ?? this.client).delete({
780
+ responseStyle: 'data',
781
+ security: [{ scheme: 'bearer', type: 'http' }],
782
+ url: '/agents/{agent_id}',
783
+ ...options
784
+ });
785
+ }
786
+ /**
787
+ * Get an agent
788
+ *
789
+ * One active agent with its full settings.
790
+ *
791
+ * Scope: `agents:read`.
792
+ */
793
+ getAgent(options) {
794
+ return (options.client ?? this.client).get({
795
+ responseStyle: 'data',
796
+ security: [{ scheme: 'bearer', type: 'http' }],
797
+ url: '/agents/{agent_id}',
798
+ ...options
799
+ });
800
+ }
801
+ /**
802
+ * Update an agent
803
+ *
804
+ * Changes only the fields in the body. `capabilities` and `handoff_user_ids` replace their whole sets.
805
+ *
806
+ * Scope: `agents:write`.
807
+ */
808
+ updateAgent(options) {
809
+ return (options.client ?? this.client).patch({
810
+ responseStyle: 'data',
811
+ security: [{ scheme: 'bearer', type: 'http' }],
812
+ url: '/agents/{agent_id}',
813
+ ...options,
814
+ headers: {
815
+ 'Content-Type': 'application/json',
816
+ ...options.headers
817
+ }
818
+ });
819
+ }
820
+ /**
821
+ * Get agent options
822
+ *
823
+ * The models, voices and capabilities an agent can be configured with.
824
+ *
825
+ * Scope: `agents:read`.
826
+ */
827
+ getAgentOptions(options) {
828
+ return (options?.client ?? this.client).get({
829
+ responseStyle: 'data',
830
+ security: [{ scheme: 'bearer', type: 'http' }],
831
+ url: '/agent-options',
832
+ ...options
833
+ });
834
+ }
835
+ /**
836
+ * Set the AI agent of a conversation
837
+ *
838
+ * Makes an agent answer the conversation, or turns the AI off with `null`. Either way the conversation is no longer assigned to a member; the contact owner stays.
839
+ *
840
+ * Scope: `conversations:write`.
841
+ */
842
+ assignConversationAgent(options) {
843
+ return (options.client ?? this.client).patch({
844
+ responseStyle: 'data',
845
+ security: [{ scheme: 'bearer', type: 'http' }],
846
+ url: '/conversations/{conversation_id}/agent',
847
+ ...options,
848
+ headers: {
849
+ 'Content-Type': 'application/json',
850
+ ...options.headers
851
+ }
852
+ });
853
+ }
854
+ /**
855
+ * List locations
856
+ *
857
+ * Branches and places, newest first.
858
+ *
859
+ * Scope: `knowledge:read`.
860
+ */
861
+ listKnowledgeLocations(options) {
862
+ return (options?.client ?? this.client).get({
863
+ responseStyle: 'data',
864
+ security: [{ scheme: 'bearer', type: 'http' }],
865
+ url: '/knowledge/locations',
866
+ ...options
867
+ });
868
+ }
869
+ /**
870
+ * Create a location
871
+ *
872
+ * Adds a branch or place the agents can share.
873
+ *
874
+ * Scope: `knowledge:write`.
875
+ */
876
+ createKnowledgeLocation(options) {
877
+ return (options.client ?? this.client).post({
878
+ responseStyle: 'data',
879
+ security: [{ scheme: 'bearer', type: 'http' }],
880
+ url: '/knowledge/locations',
881
+ ...options,
882
+ headers: {
883
+ 'Content-Type': 'application/json',
884
+ ...options.headers
885
+ }
886
+ });
887
+ }
888
+ /**
889
+ * Delete a location
890
+ *
891
+ * Deletes it for good and answers it as it was.
892
+ *
893
+ * Scope: `knowledge:write`.
894
+ */
895
+ deleteKnowledgeLocation(options) {
896
+ return (options.client ?? this.client).delete({
897
+ responseStyle: 'data',
898
+ security: [{ scheme: 'bearer', type: 'http' }],
899
+ url: '/knowledge/locations/{location_id}',
900
+ ...options
901
+ });
902
+ }
903
+ /**
904
+ * Get a location
905
+ *
906
+ * One location.
907
+ *
908
+ * Scope: `knowledge:read`.
909
+ */
910
+ getKnowledgeLocation(options) {
911
+ return (options.client ?? this.client).get({
912
+ responseStyle: 'data',
913
+ security: [{ scheme: 'bearer', type: 'http' }],
914
+ url: '/knowledge/locations/{location_id}',
915
+ ...options
916
+ });
917
+ }
918
+ /**
919
+ * Update a location
920
+ *
921
+ * Changes only the fields in the body.
922
+ *
923
+ * Scope: `knowledge:write`.
924
+ */
925
+ updateKnowledgeLocation(options) {
926
+ return (options.client ?? this.client).patch({
927
+ responseStyle: 'data',
928
+ security: [{ scheme: 'bearer', type: 'http' }],
929
+ url: '/knowledge/locations/{location_id}',
930
+ ...options,
931
+ headers: {
932
+ 'Content-Type': 'application/json',
933
+ ...options.headers
934
+ }
935
+ });
936
+ }
937
+ /**
938
+ * List directory contacts
939
+ *
940
+ * Contact cards of the knowledge directory, by display name. These are not CRM contacts.
941
+ *
942
+ * Scope: `knowledge:read`.
943
+ */
944
+ listKnowledgeContacts(options) {
945
+ return (options?.client ?? this.client).get({
946
+ responseStyle: 'data',
947
+ security: [{ scheme: 'bearer', type: 'http' }],
948
+ url: '/knowledge/contacts',
949
+ ...options
950
+ });
951
+ }
952
+ /**
953
+ * Create a directory contact
954
+ *
955
+ * Adds a contact card the agents can send to customers.
956
+ *
957
+ * Scope: `knowledge:write`.
958
+ */
959
+ createKnowledgeContact(options) {
960
+ return (options.client ?? this.client).post({
961
+ responseStyle: 'data',
962
+ security: [{ scheme: 'bearer', type: 'http' }],
963
+ url: '/knowledge/contacts',
964
+ ...options,
965
+ headers: {
966
+ 'Content-Type': 'application/json',
967
+ ...options.headers
968
+ }
969
+ });
970
+ }
971
+ /**
972
+ * Delete a directory contact
973
+ *
974
+ * Deletes it for good and answers it as it was.
975
+ *
976
+ * Scope: `knowledge:write`.
977
+ */
978
+ deleteKnowledgeContact(options) {
979
+ return (options.client ?? this.client).delete({
980
+ responseStyle: 'data',
981
+ security: [{ scheme: 'bearer', type: 'http' }],
982
+ url: '/knowledge/contacts/{knowledge_contact_id}',
983
+ ...options
984
+ });
985
+ }
986
+ /**
987
+ * Get a directory contact
988
+ *
989
+ * One contact card.
990
+ *
991
+ * Scope: `knowledge:read`.
992
+ */
993
+ getKnowledgeContact(options) {
994
+ return (options.client ?? this.client).get({
995
+ responseStyle: 'data',
996
+ security: [{ scheme: 'bearer', type: 'http' }],
997
+ url: '/knowledge/contacts/{knowledge_contact_id}',
998
+ ...options
999
+ });
1000
+ }
1001
+ /**
1002
+ * Update a directory contact
1003
+ *
1004
+ * Changes only the fields in the body.
1005
+ *
1006
+ * Scope: `knowledge:write`.
1007
+ */
1008
+ updateKnowledgeContact(options) {
1009
+ return (options.client ?? this.client).patch({
1010
+ responseStyle: 'data',
1011
+ security: [{ scheme: 'bearer', type: 'http' }],
1012
+ url: '/knowledge/contacts/{knowledge_contact_id}',
1013
+ ...options,
1014
+ headers: {
1015
+ 'Content-Type': 'application/json',
1016
+ ...options.headers
1017
+ }
1018
+ });
1019
+ }
1020
+ /**
1021
+ * List files
1022
+ *
1023
+ * Documents and images the agents can consult or send, newest first.
1024
+ *
1025
+ * Scope: `knowledge:read`.
1026
+ */
1027
+ listKnowledgeFiles(options) {
1028
+ return (options?.client ?? this.client).get({
1029
+ responseStyle: 'data',
1030
+ security: [{ scheme: 'bearer', type: 'http' }],
1031
+ url: '/knowledge/files',
1032
+ ...options
1033
+ });
1034
+ }
1035
+ /**
1036
+ * Upload a file
1037
+ *
1038
+ * Begins an upload in three steps: this call answers the file, `uploading`, and an `upload_url`; `PUT` the bytes there; then call `POST /knowledge/files/{file_id}/complete`.
1039
+ *
1040
+ * Scope: `knowledge:write`.
1041
+ */
1042
+ createKnowledgeFile(options) {
1043
+ return (options.client ?? this.client).post({
1044
+ responseStyle: 'data',
1045
+ security: [{ scheme: 'bearer', type: 'http' }],
1046
+ url: '/knowledge/files',
1047
+ ...options,
1048
+ headers: {
1049
+ 'Content-Type': 'application/json',
1050
+ ...options.headers
1051
+ }
1052
+ });
1053
+ }
1054
+ /**
1055
+ * Complete an upload
1056
+ *
1057
+ * Checks the uploaded bytes against the declared type and size, reads the content for the agents and answers the file, `ready`. Reading a long PDF can take minutes. Completing a `ready` file changes nothing.
1058
+ *
1059
+ * Scope: `knowledge:write`.
1060
+ */
1061
+ completeKnowledgeFile(options) {
1062
+ return (options.client ?? this.client).post({
1063
+ responseStyle: 'data',
1064
+ security: [{ scheme: 'bearer', type: 'http' }],
1065
+ url: '/knowledge/files/{file_id}/complete',
1066
+ ...options,
1067
+ headers: {
1068
+ 'Content-Type': 'application/json',
1069
+ ...options.headers
1070
+ }
1071
+ });
1072
+ }
1073
+ /**
1074
+ * Delete a file
1075
+ *
1076
+ * Deletes it for good and answers it as it was. Copies already sent in conversations stay there.
1077
+ *
1078
+ * Scope: `knowledge:write`.
1079
+ */
1080
+ deleteKnowledgeFile(options) {
1081
+ return (options.client ?? this.client).delete({
1082
+ responseStyle: 'data',
1083
+ security: [{ scheme: 'bearer', type: 'http' }],
1084
+ url: '/knowledge/files/{file_id}',
1085
+ ...options
1086
+ });
1087
+ }
1088
+ /**
1089
+ * Get a file
1090
+ *
1091
+ * One file; a `ready` one carries a `download_url`.
1092
+ *
1093
+ * Scope: `knowledge:read`.
1094
+ */
1095
+ getKnowledgeFile(options) {
1096
+ return (options.client ?? this.client).get({
1097
+ responseStyle: 'data',
1098
+ security: [{ scheme: 'bearer', type: 'http' }],
1099
+ url: '/knowledge/files/{file_id}',
1100
+ ...options
1101
+ });
1102
+ }
1103
+ /**
1104
+ * Update a file
1105
+ *
1106
+ * Changes its title, description or what the agents may do with it. Only a `ready` file changes; otherwise `409 conflict`.
1107
+ *
1108
+ * Scope: `knowledge:write`.
1109
+ */
1110
+ updateKnowledgeFile(options) {
1111
+ return (options.client ?? this.client).patch({
1112
+ responseStyle: 'data',
1113
+ security: [{ scheme: 'bearer', type: 'http' }],
1114
+ url: '/knowledge/files/{file_id}',
1115
+ ...options,
1116
+ headers: {
1117
+ 'Content-Type': 'application/json',
1118
+ ...options.headers
1119
+ }
1120
+ });
1121
+ }
617
1122
  }