@appconda/nextjs 1.0.348 → 1.0.350
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.
- package/dist/modules/emploid/action.d.ts +26 -1
- package/dist/modules/emploid/action.js +351 -1
- package/dist/modules/emploid/schema.d.ts +110 -0
- package/dist/modules/emploid/schema.js +97 -1
- package/dist/modules/emploid/service.d.ts +27 -2
- package/dist/modules/emploid/service.js +76 -1
- package/dist/modules/emploid/types.d.ts +22 -0
- package/dist/modules/emploid/types.js +1 -1
- package/package.json +1 -1
- package/src/modules/emploid/action.ts +370 -1
- package/src/modules/emploid/schema.ts +122 -0
- package/src/modules/emploid/service.ts +107 -5
- package/src/modules/emploid/types.ts +26 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { AppcondaException } from '../../client';
|
|
5
5
|
import { getSDKForCurrentUser } from '../../getSDKForCurrentUser';
|
|
6
|
-
import { CreateAgentFlowSchema, CreateAssistantSchema, CreateCompetencySchema, CreateEmploidSchema, CreateExtensionSchema, CreateInputSchema, CreateJobDefinitionSchema, CreateOccupationSchema, CreateScopeSchema, CreateWorkerSchema, DeleteAssistantSchema, DeleteCompetencySchema, DeleteEmploidSchema, DeleteInputSchema, DeleteJobDefinitionSchema, DeleteOccupationSchema, DeleteScopeSchema, DeleteWorkerSchema, ListAgentFlowsSchema, ListAssistantsSchema, ListCompetenciesSchema, ListEmploidsPaginatedSchema, ListEmploidsSchema, ListExtensionsSchema, ListInputSchema, ListJobDefinitionSchema, ListOccupationsSchema, ListScopesSchema, ListWorkersSchema, UpdateAssistantSchema, UpdateCompetencySchema, UpdateEmploidSchema, UpdateInputSchema, UpdateJobDefinitionSchema, UpdateOccupationSchema, UpdateScopeSchema, UpdateWorkerSchema } from './schema';
|
|
6
|
+
import { CreateAgentFlowSchema, CreateAssistantSchema, CreateCompetencySchema, CreateEmploidSchema, CreateExtensionSchema, CreateInputSchema, CreateJobDefinitionSchema, CreateOccupationSchema, CreateScopeSchema, CreateStreamIdSchema, CreateTeamSchema, CreateWorkerSchema, DeleteAssistantSchema, DeleteChatByIdSchema, DeleteCompetencySchema, DeleteDocumentsByIdAfterTimestampSchema, DeleteEmploidSchema, DeleteInputSchema, DeleteJobDefinitionSchema, DeleteMessagesByChatIdAfterTimestampSchema, DeleteOccupationSchema, DeleteScopeSchema, DeleteTeamSchema, DeleteWorkerSchema, GetChatByIdSchema, GetChatsByUserIdSchema, GetDocumentByIdSchema, GetDocumentsByIdSchema, GetMessageByIdSchema, GetMessageCountByUserIdSchema, GetMessagesByChatIdSchema, GetStreamIdsByChatIdSchema, GetSuggestionsByDocumentIdSchema, GetVotesByChatIdSchema, ListAgentFlowsSchema, ListAssistantsSchema, ListCompetenciesSchema, ListEmploidsPaginatedSchema, ListEmploidsSchema, ListExtensionsSchema, ListInputSchema, ListJobDefinitionSchema, ListOccupationsSchema, ListScopesSchema, ListTeamsSchema, ListWorkersSchema, SaveChatSchema, SaveDocumentSchema, SaveMessagesSchema, SaveSuggestionsSchema, UpdateAssistantSchema, UpdateChatLastContextByIdSchema, UpdateChatVisiblityByIdSchema, UpdateCompetencySchema, UpdateEmploidSchema, UpdateInputSchema, UpdateJobDefinitionSchema, UpdateOccupationSchema, UpdateScopeSchema, UpdateTeamSchema, UpdateWorkerSchema, VoteMessageSchema } from './schema';
|
|
7
7
|
import { TEmploid } from './types';
|
|
8
8
|
|
|
9
9
|
export async function CreateEmploid(parsedInput: z.infer<typeof CreateEmploidSchema>): Promise<TEmploid> {
|
|
@@ -566,8 +566,377 @@ export const ListInputs = async (parsedInput: z.infer<typeof ListInputSchema>) =
|
|
|
566
566
|
}
|
|
567
567
|
};
|
|
568
568
|
|
|
569
|
+
export const CreateTeam = async (parsedInput: z.infer<typeof CreateTeamSchema>) => {
|
|
570
|
+
try {
|
|
571
|
+
const { emploid } = await getSDKForCurrentUser();
|
|
572
|
+
//@ts-ignore
|
|
573
|
+
const app = await emploid.CreateTeam(parsedInput);
|
|
574
|
+
return app;
|
|
575
|
+
} catch (error) {
|
|
576
|
+
if (error instanceof AppcondaException) {
|
|
577
|
+
throw new Error(error.message);
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
throw error;
|
|
581
|
+
}
|
|
582
|
+
};
|
|
583
|
+
|
|
584
|
+
export const UpdateTeam = async (parsedInput: z.infer<typeof UpdateTeamSchema>) => {
|
|
585
|
+
try {
|
|
586
|
+
const { emploid } = await getSDKForCurrentUser();
|
|
587
|
+
//@ts-ignore
|
|
588
|
+
const app = await emploid.UpdateTeam(parsedInput);
|
|
589
|
+
return app;
|
|
590
|
+
} catch (error) {
|
|
591
|
+
if (error instanceof AppcondaException) {
|
|
592
|
+
throw new Error(error.message);
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
throw error;
|
|
596
|
+
}
|
|
597
|
+
};
|
|
598
|
+
|
|
599
|
+
export const DeleteTeam = async (parsedInput: z.infer<typeof DeleteTeamSchema>) => {
|
|
600
|
+
try {
|
|
601
|
+
const { emploid } = await getSDKForCurrentUser();
|
|
602
|
+
//@ts-ignore
|
|
603
|
+
const app = await emploid.DeleteTeam(parsedInput);
|
|
604
|
+
return app;
|
|
605
|
+
} catch (error) {
|
|
606
|
+
if (error instanceof AppcondaException) {
|
|
607
|
+
throw new Error(error.message);
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
throw error;
|
|
611
|
+
}
|
|
612
|
+
};
|
|
613
|
+
|
|
614
|
+
export const ListTeams = async (parsedInput: z.infer<typeof ListTeamsSchema>) => {
|
|
615
|
+
try {
|
|
616
|
+
const { emploid } = await getSDKForCurrentUser();
|
|
617
|
+
//@ts-ignore
|
|
618
|
+
const app = await emploid.ListTeams(parsedInput);
|
|
619
|
+
return app;
|
|
620
|
+
} catch (error) {
|
|
621
|
+
if (error instanceof AppcondaException) {
|
|
622
|
+
throw new Error(error.message);
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
throw error;
|
|
626
|
+
}
|
|
627
|
+
};
|
|
628
|
+
|
|
629
|
+
export const SaveChat = async (parsedInput: z.infer<typeof SaveChatSchema>) => {
|
|
630
|
+
try {
|
|
631
|
+
const { emploid } = await getSDKForCurrentUser();
|
|
632
|
+
//@ts-ignore
|
|
633
|
+
const app = await emploid.SaveChat(parsedInput);
|
|
634
|
+
return app;
|
|
635
|
+
} catch (error) {
|
|
636
|
+
if (error instanceof AppcondaException) {
|
|
637
|
+
throw new Error(error.message);
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
throw error;
|
|
641
|
+
}
|
|
642
|
+
};
|
|
643
|
+
|
|
644
|
+
export const DeleteChatById = async (parsedInput: z.infer<typeof DeleteChatByIdSchema>) => {
|
|
645
|
+
try {
|
|
646
|
+
const { emploid } = await getSDKForCurrentUser();
|
|
647
|
+
//@ts-ignore
|
|
648
|
+
const app = await emploid.DeleteChatById(parsedInput);
|
|
649
|
+
return app;
|
|
650
|
+
} catch (error) {
|
|
651
|
+
if (error instanceof AppcondaException) {
|
|
652
|
+
throw new Error(error.message);
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
throw error;
|
|
656
|
+
}
|
|
657
|
+
};
|
|
658
|
+
|
|
659
|
+
export const GetChatById = async (parsedInput: z.infer<typeof GetChatByIdSchema>) => {
|
|
660
|
+
try {
|
|
661
|
+
const { emploid } = await getSDKForCurrentUser();
|
|
662
|
+
//@ts-ignore
|
|
663
|
+
const app = await emploid.GetChatById(parsedInput);
|
|
664
|
+
return app;
|
|
665
|
+
} catch (error) {
|
|
666
|
+
if (error instanceof AppcondaException) {
|
|
667
|
+
throw new Error(error.message);
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
throw error;
|
|
671
|
+
}
|
|
672
|
+
};
|
|
673
|
+
|
|
674
|
+
export const GetChatsByUserId = async (parsedInput: z.infer<typeof GetChatsByUserIdSchema>) => {
|
|
675
|
+
try {
|
|
676
|
+
const { emploid } = await getSDKForCurrentUser();
|
|
677
|
+
//@ts-ignore
|
|
678
|
+
const app = await emploid.GetChatsByUserId(parsedInput);
|
|
679
|
+
return app;
|
|
680
|
+
} catch (error) {
|
|
681
|
+
if (error instanceof AppcondaException) {
|
|
682
|
+
throw new Error(error.message);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
throw error;
|
|
686
|
+
}
|
|
687
|
+
};
|
|
688
|
+
|
|
689
|
+
export const SaveMessages = async (parsedInput: z.infer<typeof SaveMessagesSchema>) => {
|
|
690
|
+
try {
|
|
691
|
+
const { emploid } = await getSDKForCurrentUser();
|
|
692
|
+
//@ts-ignore
|
|
693
|
+
const app = await emploid.SaveMessages(parsedInput);
|
|
694
|
+
return app;
|
|
695
|
+
} catch (error) {
|
|
696
|
+
if (error instanceof AppcondaException) {
|
|
697
|
+
throw new Error(error.message);
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
throw error;
|
|
701
|
+
}
|
|
702
|
+
};
|
|
703
|
+
|
|
704
|
+
export const GetMessagesByChatId = async (parsedInput: z.infer<typeof GetMessagesByChatIdSchema>) => {
|
|
705
|
+
try {
|
|
706
|
+
const { emploid } = await getSDKForCurrentUser();
|
|
707
|
+
//@ts-ignore
|
|
708
|
+
const app = await emploid.GetMessagesByChatId(parsedInput);
|
|
709
|
+
return app;
|
|
710
|
+
} catch (error) {
|
|
711
|
+
if (error instanceof AppcondaException) {
|
|
712
|
+
throw new Error(error.message);
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
throw error;
|
|
716
|
+
}
|
|
717
|
+
};
|
|
718
|
+
|
|
719
|
+
export const GetMessageById = async (parsedInput: z.infer<typeof GetMessageByIdSchema>) => {
|
|
720
|
+
try {
|
|
721
|
+
const { emploid } = await getSDKForCurrentUser();
|
|
722
|
+
//@ts-ignore
|
|
723
|
+
const app = await emploid.GetMessageById(parsedInput);
|
|
724
|
+
return app;
|
|
725
|
+
} catch (error) {
|
|
726
|
+
if (error instanceof AppcondaException) {
|
|
727
|
+
throw new Error(error.message);
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
throw error;
|
|
731
|
+
}
|
|
732
|
+
};
|
|
733
|
+
|
|
734
|
+
export const VoteMessage = async (parsedInput: z.infer<typeof VoteMessageSchema>) => {
|
|
735
|
+
try {
|
|
736
|
+
const { emploid } = await getSDKForCurrentUser();
|
|
737
|
+
//@ts-ignore
|
|
738
|
+
const app = await emploid.VoteMessage(parsedInput);
|
|
739
|
+
return app;
|
|
740
|
+
} catch (error) {
|
|
741
|
+
if (error instanceof AppcondaException) {
|
|
742
|
+
throw new Error(error.message);
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
throw error;
|
|
746
|
+
}
|
|
747
|
+
};
|
|
748
|
+
|
|
749
|
+
export const GetVotesByChatId = async (parsedInput: z.infer<typeof GetVotesByChatIdSchema>) => {
|
|
750
|
+
try {
|
|
751
|
+
const { emploid } = await getSDKForCurrentUser();
|
|
752
|
+
//@ts-ignore
|
|
753
|
+
const app = await emploid.GetVotesByChatId(parsedInput);
|
|
754
|
+
return app;
|
|
755
|
+
} catch (error) {
|
|
756
|
+
if (error instanceof AppcondaException) {
|
|
757
|
+
throw new Error(error.message);
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
throw error;
|
|
761
|
+
}
|
|
762
|
+
};
|
|
763
|
+
|
|
764
|
+
export const DeleteDocumentsByIdAfterTimestamp = async (parsedInput: z.infer<typeof DeleteDocumentsByIdAfterTimestampSchema>) => {
|
|
765
|
+
try {
|
|
766
|
+
const { emploid } = await getSDKForCurrentUser();
|
|
767
|
+
//@ts-ignore
|
|
768
|
+
const app = await emploid.DeleteDocumentsByIdAfterTimestamp(parsedInput);
|
|
769
|
+
return app;
|
|
770
|
+
} catch (error) {
|
|
771
|
+
if (error instanceof AppcondaException) {
|
|
772
|
+
throw new Error(error.message);
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
throw error;
|
|
776
|
+
}
|
|
777
|
+
};
|
|
778
|
+
|
|
779
|
+
export const SaveSuggestions = async (parsedInput: z.infer<typeof SaveSuggestionsSchema>) => {
|
|
780
|
+
try {
|
|
781
|
+
const { emploid } = await getSDKForCurrentUser();
|
|
782
|
+
//@ts-ignore
|
|
783
|
+
const app = await emploid.SaveSuggestions(parsedInput);
|
|
784
|
+
return app;
|
|
785
|
+
} catch (error) {
|
|
786
|
+
if (error instanceof AppcondaException) {
|
|
787
|
+
throw new Error(error.message);
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
throw error;
|
|
791
|
+
}
|
|
792
|
+
};
|
|
793
|
+
|
|
794
|
+
export const GetSuggestionsByDocumentId = async (parsedInput: z.infer<typeof GetSuggestionsByDocumentIdSchema>) => {
|
|
795
|
+
try {
|
|
796
|
+
const { emploid } = await getSDKForCurrentUser();
|
|
797
|
+
//@ts-ignore
|
|
798
|
+
const app = await emploid.GetSuggestionsByDocumentId(parsedInput);
|
|
799
|
+
return app;
|
|
800
|
+
} catch (error) {
|
|
801
|
+
if (error instanceof AppcondaException) {
|
|
802
|
+
throw new Error(error.message);
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
throw error;
|
|
806
|
+
}
|
|
807
|
+
};
|
|
808
|
+
|
|
809
|
+
export const DeleteMessagesByChatIdAfterTimestamp = async (parsedInput: z.infer<typeof DeleteMessagesByChatIdAfterTimestampSchema>) => {
|
|
810
|
+
try {
|
|
811
|
+
const { emploid } = await getSDKForCurrentUser();
|
|
812
|
+
//@ts-ignore
|
|
813
|
+
const app = await emploid.DeleteMessagesByChatIdAfterTimestamp(parsedInput);
|
|
814
|
+
return app;
|
|
815
|
+
} catch (error) {
|
|
816
|
+
if (error instanceof AppcondaException) {
|
|
817
|
+
throw new Error(error.message);
|
|
818
|
+
}
|
|
569
819
|
|
|
820
|
+
throw error;
|
|
821
|
+
}
|
|
822
|
+
};
|
|
570
823
|
|
|
824
|
+
export const UpdateChatVisiblityById = async (parsedInput: z.infer<typeof UpdateChatVisiblityByIdSchema>) => {
|
|
825
|
+
try {
|
|
826
|
+
const { emploid } = await getSDKForCurrentUser();
|
|
827
|
+
//@ts-ignore
|
|
828
|
+
const app = await emploid.UpdateChatVisiblityById(parsedInput);
|
|
829
|
+
return app;
|
|
830
|
+
} catch (error) {
|
|
831
|
+
if (error instanceof AppcondaException) {
|
|
832
|
+
throw new Error(error.message);
|
|
833
|
+
}
|
|
571
834
|
|
|
835
|
+
throw error;
|
|
836
|
+
}
|
|
837
|
+
};
|
|
572
838
|
|
|
839
|
+
export const UpdateChatLastContextById = async (parsedInput: z.infer<typeof UpdateChatLastContextByIdSchema>) => {
|
|
840
|
+
try {
|
|
841
|
+
const { emploid } = await getSDKForCurrentUser();
|
|
842
|
+
//@ts-ignore
|
|
843
|
+
const app = await emploid.UpdateChatLastContextById(parsedInput);
|
|
844
|
+
return app;
|
|
845
|
+
} catch (error) {
|
|
846
|
+
if (error instanceof AppcondaException) {
|
|
847
|
+
throw new Error(error.message);
|
|
848
|
+
}
|
|
573
849
|
|
|
850
|
+
throw error;
|
|
851
|
+
}
|
|
852
|
+
};
|
|
853
|
+
|
|
854
|
+
export const GetMessageCountByUserId = async (parsedInput: z.infer<typeof GetMessageCountByUserIdSchema>) => {
|
|
855
|
+
try {
|
|
856
|
+
const { emploid } = await getSDKForCurrentUser();
|
|
857
|
+
//@ts-ignore
|
|
858
|
+
const app = await emploid.GetMessageCountByUserId(parsedInput);
|
|
859
|
+
return app;
|
|
860
|
+
} catch (error) {
|
|
861
|
+
if (error instanceof AppcondaException) {
|
|
862
|
+
throw new Error(error.message);
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
throw error;
|
|
866
|
+
}
|
|
867
|
+
};
|
|
868
|
+
|
|
869
|
+
export const CreateStreamId = async (parsedInput: z.infer<typeof CreateStreamIdSchema>) => {
|
|
870
|
+
try {
|
|
871
|
+
const { emploid } = await getSDKForCurrentUser();
|
|
872
|
+
//@ts-ignore
|
|
873
|
+
const app = await emploid.CreateStreamId(parsedInput);
|
|
874
|
+
return app;
|
|
875
|
+
} catch (error) {
|
|
876
|
+
if (error instanceof AppcondaException) {
|
|
877
|
+
throw new Error(error.message);
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
throw error;
|
|
881
|
+
}
|
|
882
|
+
};
|
|
883
|
+
|
|
884
|
+
export const GetStreamIdsByChatId = async (parsedInput: z.infer<typeof GetStreamIdsByChatIdSchema>) => {
|
|
885
|
+
try {
|
|
886
|
+
const { emploid } = await getSDKForCurrentUser();
|
|
887
|
+
//@ts-ignore
|
|
888
|
+
const app = await emploid.GetStreamIdsByChatId(parsedInput);
|
|
889
|
+
return app;
|
|
890
|
+
} catch (error) {
|
|
891
|
+
if (error instanceof AppcondaException) {
|
|
892
|
+
throw new Error(error.message);
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
throw error;
|
|
896
|
+
}
|
|
897
|
+
};
|
|
898
|
+
|
|
899
|
+
export const SaveDocument = async (parsedInput: z.infer<typeof SaveDocumentSchema>) => {
|
|
900
|
+
try {
|
|
901
|
+
const { emploid } = await getSDKForCurrentUser();
|
|
902
|
+
//@ts-ignore
|
|
903
|
+
const app = await emploid.SaveDocument(parsedInput);
|
|
904
|
+
return app;
|
|
905
|
+
} catch (error) {
|
|
906
|
+
if (error instanceof AppcondaException) {
|
|
907
|
+
throw new Error(error.message);
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
throw error;
|
|
911
|
+
}
|
|
912
|
+
};
|
|
913
|
+
|
|
914
|
+
export const GetDocumentById = async (parsedInput: z.infer<typeof GetDocumentByIdSchema>) => {
|
|
915
|
+
try {
|
|
916
|
+
const { emploid } = await getSDKForCurrentUser();
|
|
917
|
+
//@ts-ignore
|
|
918
|
+
const app = await emploid.GetDocumentById(parsedInput);
|
|
919
|
+
return app;
|
|
920
|
+
} catch (error) {
|
|
921
|
+
if (error instanceof AppcondaException) {
|
|
922
|
+
throw new Error(error.message);
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
throw error;
|
|
926
|
+
}
|
|
927
|
+
};
|
|
928
|
+
|
|
929
|
+
export const GetDocumentsById = async (parsedInput: z.infer<typeof GetDocumentsByIdSchema>) => {
|
|
930
|
+
try {
|
|
931
|
+
const { emploid } = await getSDKForCurrentUser();
|
|
932
|
+
//@ts-ignore
|
|
933
|
+
const app = await emploid.GetDocumentsById(parsedInput);
|
|
934
|
+
return app;
|
|
935
|
+
} catch (error) {
|
|
936
|
+
if (error instanceof AppcondaException) {
|
|
937
|
+
throw new Error(error.message);
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
throw error;
|
|
941
|
+
}
|
|
942
|
+
};
|
|
@@ -232,4 +232,126 @@ export const UpdateInputSchema = z.object({
|
|
|
232
232
|
|
|
233
233
|
export const DeleteInputSchema = z.object({
|
|
234
234
|
id: z.string(),
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
export const CreateTeamSchema = z.object({
|
|
238
|
+
tenantId: z.string(),
|
|
239
|
+
alias: z.string(),
|
|
240
|
+
name: z.string(),
|
|
241
|
+
description: z.string().optional(),
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
export const ListTeamsSchema = z.object({
|
|
245
|
+
tenantId: z.string()
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
export const UpdateTeamSchema = z.object({
|
|
249
|
+
teamId: z.string(),
|
|
250
|
+
alias: z.string().optional(),
|
|
251
|
+
name: z.string().optional(),
|
|
252
|
+
description: z.string().optional(),
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
export const DeleteTeamSchema = z.object({
|
|
256
|
+
teamId: z.string(),
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
export const SaveChatSchema = z.object({
|
|
260
|
+
id: z.string().optional(),
|
|
261
|
+
title: z.string(),
|
|
262
|
+
userId: z.string(),
|
|
263
|
+
visibility: z.enum(['private', 'public']),
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
export const DeleteChatByIdSchema = z.object({
|
|
267
|
+
id: z.string(),
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
export const GetChatByIdSchema = z.object({
|
|
271
|
+
id: z.string(),
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
export const GetChatsByUserIdSchema = z.object({
|
|
275
|
+
userId: z.string(),
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
export const SaveMessagesSchema = z.object({
|
|
279
|
+
messages: z.array(z.object())
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
export const GetMessagesByChatIdSchema = z.object({
|
|
284
|
+
chatId: z.string(),
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
export const GetMessageByIdSchema = z.object({
|
|
288
|
+
id: z.string(),
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
export const VoteMessageSchema = z.object({
|
|
292
|
+
chatId: z.string(),
|
|
293
|
+
messageId: z.string(),
|
|
294
|
+
type: z.enum(['up', 'down']),
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
export const GetVotesByChatIdSchema = z.object({
|
|
298
|
+
chatId: z.string(),
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
export const DeleteDocumentsByIdAfterTimestampSchema = z.object({
|
|
302
|
+
id: z.string(),
|
|
303
|
+
timestamp: z.date(),
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
export const SaveSuggestionsSchema = z.object({
|
|
307
|
+
suggestions: z.array(z.object({}))
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
export const GetSuggestionsByDocumentIdSchema = z.object({
|
|
311
|
+
id: z.string(),
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
export const DeleteMessagesByChatIdAfterTimestampSchema = z.object({
|
|
315
|
+
chatId: z.string(),
|
|
316
|
+
timestamp: z.date(),
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
export const UpdateChatVisiblityByIdSchema = z.object({
|
|
320
|
+
id: z.string(),
|
|
321
|
+
visibility: z.enum(['private', 'public']),
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
export const UpdateChatLastContextByIdSchema = z.object({
|
|
325
|
+
id: z.string(),
|
|
326
|
+
context: z.object({}),
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
export const GetMessageCountByUserIdSchema = z.object({
|
|
330
|
+
userId: z.string(),
|
|
331
|
+
differenceInHours: z.number(),
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
export const CreateStreamIdSchema = z.object({
|
|
335
|
+
treamId: z.string(),
|
|
336
|
+
chatId: z.string(),
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
export const GetStreamIdsByChatIdSchema = z.object({
|
|
340
|
+
chatId: z.string(),
|
|
341
|
+
});
|
|
342
|
+
|
|
343
|
+
export const SaveDocumentSchema = z.object({
|
|
344
|
+
id: z.string().optional(),
|
|
345
|
+
title: z.string(),
|
|
346
|
+
kind: z.enum(['text', 'code', 'image', 'sheet']),
|
|
347
|
+
content: z.string(),
|
|
348
|
+
userId: z.string(),
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
export const GetDocumentByIdSchema = z.object({
|
|
352
|
+
id: z.string(),
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
export const GetDocumentsByIdSchema = z.object({
|
|
356
|
+
id: z.string(),
|
|
235
357
|
});
|
|
@@ -3,8 +3,8 @@ import z from "zod";
|
|
|
3
3
|
import { ServiceClient } from "../../service-client";
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
import { CreateAgentFlowSchema, CreateAssistantSchema, CreateCompetencySchema, CreateEmploidSchema, CreateExtensionSchema, CreateInputSchema, CreateJobDefinitionSchema, CreateOccupationSchema, CreateScopeSchema, CreateWorkerSchema, DeleteAssistantSchema, DeleteCompetencySchema, DeleteEmploidSchema, DeleteInputSchema, DeleteJobDefinitionSchema, DeleteOccupationSchema, DeleteScopeSchema, DeleteWorkerSchema, ListAgentFlowsSchema, ListAssistantsSchema, ListCompetenciesSchema, ListEmploidsPaginatedSchema, ListEmploidsSchema, ListExtensionsSchema, ListInputSchema, ListJobDefinitionSchema, ListOccupationsSchema, ListScopesSchema, ListWorkersSchema, UpdateAssistantSchema, UpdateCompetencySchema, UpdateEmploidSchema, UpdateInputSchema, UpdateJobDefinitionSchema, UpdateOccupationSchema, UpdateScopeSchema, UpdateWorkerSchema } from "./schema";
|
|
7
|
-
import { TAgentFlow, TAssistant, TCompetency, TEmploid, TExtension, TInput, TJobDefinition, TOccupation, TPaginatedEmploidsResult, TScope, TWorker } from "./types";
|
|
6
|
+
import { CreateAgentFlowSchema, CreateAssistantSchema, CreateCompetencySchema, CreateEmploidSchema, CreateExtensionSchema, CreateInputSchema, CreateJobDefinitionSchema, CreateOccupationSchema, CreateScopeSchema, CreateStreamIdSchema, CreateTeamSchema, CreateWorkerSchema, DeleteAssistantSchema, DeleteChatByIdSchema, DeleteCompetencySchema, DeleteDocumentsByIdAfterTimestampSchema, DeleteEmploidSchema, DeleteInputSchema, DeleteJobDefinitionSchema, DeleteMessagesByChatIdAfterTimestampSchema, DeleteOccupationSchema, DeleteScopeSchema, DeleteTeamSchema, DeleteWorkerSchema, GetChatByIdSchema, GetChatsByUserIdSchema, GetDocumentByIdSchema, GetDocumentsByIdSchema, GetMessageByIdSchema, GetMessageCountByUserIdSchema, GetMessagesByChatIdSchema, GetStreamIdsByChatIdSchema, GetSuggestionsByDocumentIdSchema, GetVotesByChatIdSchema, ListAgentFlowsSchema, ListAssistantsSchema, ListCompetenciesSchema, ListEmploidsPaginatedSchema, ListEmploidsSchema, ListExtensionsSchema, ListInputSchema, ListJobDefinitionSchema, ListOccupationsSchema, ListScopesSchema, ListTeamsSchema, ListWorkersSchema, SaveChatSchema, SaveDocumentSchema, SaveMessagesSchema, SaveSuggestionsSchema, UpdateAssistantSchema, UpdateChatLastContextByIdSchema, UpdateChatVisiblityByIdSchema, UpdateCompetencySchema, UpdateEmploidSchema, UpdateInputSchema, UpdateJobDefinitionSchema, UpdateOccupationSchema, UpdateScopeSchema, UpdateTeamSchema, UpdateWorkerSchema, VoteMessageSchema } from "./schema";
|
|
7
|
+
import { TAgentFlow, TAssistant, TChat, TCompetency, TDocument, TEmploid, TExtension, TInput, TJobDefinition, TOccupation, TPaginatedEmploidsResult, TScope, TTeam, TWorker } from "./types";
|
|
8
8
|
|
|
9
9
|
export class EmploidService extends ServiceClient {
|
|
10
10
|
protected getServiceName(): string {
|
|
@@ -54,11 +54,11 @@ export class EmploidService extends ServiceClient {
|
|
|
54
54
|
public async UpdateOccupation(payload: z.infer<typeof UpdateOccupationSchema>): Promise<TOccupation> {
|
|
55
55
|
return await this.actionCall('occupation', 'UpdateOccupation', payload);
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
|
|
58
58
|
public async DeleteOccupation(payload: z.infer<typeof DeleteOccupationSchema>): Promise<TOccupation> {
|
|
59
59
|
return await this.actionCall('occupation', 'DeleteOccupation', payload);
|
|
60
60
|
}
|
|
61
|
-
|
|
61
|
+
|
|
62
62
|
public async ListOccupations(payload: z.infer<typeof ListOccupationsSchema>): Promise<TOccupation[]> {
|
|
63
63
|
return await this.actionCall('occupation', 'ListOccupations', payload);
|
|
64
64
|
}
|
|
@@ -106,7 +106,7 @@ export class EmploidService extends ServiceClient {
|
|
|
106
106
|
public async CreateExtension(payload: z.infer<typeof CreateExtensionSchema>): Promise<TExtension> {
|
|
107
107
|
return await this.actionCall('extension', 'CreateExtension', payload);
|
|
108
108
|
}
|
|
109
|
-
|
|
109
|
+
|
|
110
110
|
public async ListExtensions(payload: z.infer<typeof ListExtensionsSchema>): Promise<TExtension[]> {
|
|
111
111
|
return await this.actionCall('extension', 'ListExtensions', payload);
|
|
112
112
|
}
|
|
@@ -158,4 +158,106 @@ export class EmploidService extends ServiceClient {
|
|
|
158
158
|
public async ListInputs(payload: z.infer<typeof ListInputSchema>): Promise<TInput[]> {
|
|
159
159
|
return await this.actionCall('input-output', 'ListInputs', payload);
|
|
160
160
|
}
|
|
161
|
+
|
|
162
|
+
public async CreateTeam(payload: z.infer<typeof CreateTeamSchema>): Promise<TTeam> {
|
|
163
|
+
return await this.actionCall('team', 'CreateTeam', payload);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
public async ListTeams(payload: z.infer<typeof ListTeamsSchema>): Promise<TTeam[]> {
|
|
167
|
+
return await this.actionCall('team', 'ListTeams', payload);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
public async UpdateTeam(payload: z.infer<typeof UpdateTeamSchema>): Promise<TTeam> {
|
|
171
|
+
return await this.actionCall('team', 'UpdateTeam', payload);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
public async DeleteTeam(payload: z.infer<typeof DeleteTeamSchema>): Promise<TTeam> {
|
|
175
|
+
return await this.actionCall('team', 'DeleteTeam', payload);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
public async SaveChat(payload: z.infer<typeof SaveChatSchema>): Promise<TChat> {
|
|
179
|
+
return await this.actionCall('chat', 'SaveChat', payload);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
public async DeleteChatById(payload: z.infer<typeof DeleteChatByIdSchema>): Promise<TChat> {
|
|
183
|
+
return await this.actionCall('chat', 'DeleteChatById', payload);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
public async GetChatById(payload: z.infer<typeof GetChatByIdSchema>): Promise<TChat> {
|
|
187
|
+
return await this.actionCall('chat', 'GetChatById', payload);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
public async GetChatsByUserId(payload: z.infer<typeof GetChatsByUserIdSchema>): Promise<TChat[]> {
|
|
191
|
+
return await this.actionCall('chat', 'GetChatsByUserId', payload);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
public async SaveMessages(payload: z.infer<typeof SaveMessagesSchema>): Promise<void> {
|
|
195
|
+
return await this.actionCall('chat', 'SaveMessages', payload);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
public async GetMessagesByChatId(payload: z.infer<typeof GetMessagesByChatIdSchema>): Promise<TChat[]> {
|
|
200
|
+
return await this.actionCall('chat', 'GetMessagesByChatId', payload);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
public async GetMessageById(payload: z.infer<typeof GetMessageByIdSchema>): Promise<TChat[]> {
|
|
205
|
+
return await this.actionCall('chat', 'GetMessageById', payload);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
public async VoteMessage(payload: z.infer<typeof VoteMessageSchema>): Promise<TChat[]> {
|
|
209
|
+
return await this.actionCall('chat', 'VoteMessage', payload);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
public async GetVotesByChatId(payload: z.infer<typeof GetVotesByChatIdSchema>): Promise<TChat[]> {
|
|
213
|
+
return await this.actionCall('chat', 'GetVotesByChatId', payload);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
public async DeleteDocumentsByIdAfterTimestamp(payload: z.infer<typeof DeleteDocumentsByIdAfterTimestampSchema>): Promise<void> {
|
|
217
|
+
return await this.actionCall('chat', 'DeleteDocumentsByIdAfterTimestamp', payload);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
public async SaveSuggestions(payload: z.infer<typeof SaveSuggestionsSchema>): Promise<void> {
|
|
221
|
+
return await this.actionCall('chat', 'SaveSuggestions', payload);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
public async GetSuggestionsByDocumentId(payload: z.infer<typeof GetSuggestionsByDocumentIdSchema>): Promise<TChat[]> {
|
|
225
|
+
return await this.actionCall('chat', 'GetSuggestionsByDocumentId', payload);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
public async DeleteMessagesByChatIdAfterTimestamp(payload: z.infer<typeof DeleteMessagesByChatIdAfterTimestampSchema>): Promise<void> {
|
|
229
|
+
return await this.actionCall('chat', 'DeleteMessagesByChatIdAfterTimestamp', payload);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
public async UpdateChatVisiblityById(payload: z.infer<typeof UpdateChatVisiblityByIdSchema>): Promise<void> {
|
|
233
|
+
return await this.actionCall('chat', 'UpdateChatVisiblityById', payload);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
public async UpdateChatLastContextById(payload: z.infer<typeof UpdateChatLastContextByIdSchema>): Promise<void> {
|
|
237
|
+
return await this.actionCall('chat', 'UpdateChatLastContextById', payload);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
public async GetMessageCountByUserId(payload: z.infer<typeof GetMessageCountByUserIdSchema>): Promise<number> {
|
|
241
|
+
return await this.actionCall('chat', 'GetMessageCountByUserId', payload);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
public async CreateStreamId(payload: z.infer<typeof CreateStreamIdSchema>): Promise<number> {
|
|
245
|
+
return await this.actionCall('chat', 'CreateStreamId', payload);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
public async GetStreamIdsByChatId(payload: z.infer<typeof GetStreamIdsByChatIdSchema>): Promise<number[]> {
|
|
249
|
+
return await this.actionCall('chat', 'GetStreamIdsByChatId', payload);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
public async SaveDocument(payload: z.infer<typeof SaveDocumentSchema>): Promise<void> {
|
|
253
|
+
return await this.actionCall('chat', 'SaveDocument', payload);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
public async GetDocumentById(payload: z.infer<typeof GetDocumentByIdSchema>): Promise<TDocument> {
|
|
257
|
+
return await this.actionCall('chat', 'GetDocumentById', payload);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
public async GetDocumentsById(payload: z.infer<typeof GetDocumentsByIdSchema>): Promise<TDocument[]> {
|
|
261
|
+
return await this.actionCall('chat', 'GetDocumentsById', payload);
|
|
262
|
+
}
|
|
161
263
|
}
|
|
@@ -82,4 +82,30 @@ export type TInput = {
|
|
|
82
82
|
name: string;
|
|
83
83
|
description: string;
|
|
84
84
|
type: string;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export type TTeam = {
|
|
88
|
+
id: string;
|
|
89
|
+
alias: string;
|
|
90
|
+
name: string;
|
|
91
|
+
description: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export type TChat = {
|
|
95
|
+
id: string;
|
|
96
|
+
createdAt: string;
|
|
97
|
+
title: string;
|
|
98
|
+
userId: string;
|
|
99
|
+
visibility: string;
|
|
100
|
+
lastContext: any;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
export type TDocument = {
|
|
105
|
+
id: string;
|
|
106
|
+
createdAt: string;
|
|
107
|
+
title: string;
|
|
108
|
+
content?: string;
|
|
109
|
+
kind: string;
|
|
110
|
+
userId: string;
|
|
85
111
|
}
|