@iblai/data-layer 1.5.11 → 1.6.1

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/index.js CHANGED
@@ -39498,6 +39498,39 @@ const chatApiSlice = react.createApi({
39498
39498
  });
39499
39499
  const { useLazyGetPinnedMessagesQuery, useUnPinMessageMutation, useDeleteMessageMutation, useGetPinnedMessagesQuery, useAddPinnedMessageMutation, useGetVectorDocumentsQuery, useLazyGetVectorDocumentsQuery, useGetRecentMessageQuery, useLazyGetRecentMessageQuery, useUpdateMessageFeedbackMutation, useAudioToTextMutation, } = chatApiSlice;
39500
39500
 
39501
+ const CHAT_CUSTOM_REDUCER_PATH = 'chatCustomApiSlice';
39502
+ const CHAT_CUSTOM_ENDPOINTS = {
39503
+ GET_CHAT_MESSAGE_TTS: {
39504
+ path: (org, user_id, chat_message_id) => `/api/ai-mentor/orgs/${org}/users/${user_id}/chat-messages/${chat_message_id}/tts`,
39505
+ service: exports.SERVICES.DM,
39506
+ },
39507
+ };
39508
+
39509
+ const chatCustomApiSlice = react.createApi({
39510
+ reducerPath: CHAT_CUSTOM_REDUCER_PATH,
39511
+ baseQuery: iblFetchBaseQuery,
39512
+ endpoints: (builder) => ({
39513
+ getChatMessageTts: builder.query({
39514
+ query: ({ org, user_id, chat_message_id }) => ({
39515
+ url: CHAT_CUSTOM_ENDPOINTS.GET_CHAT_MESSAGE_TTS.path(org, user_id, chat_message_id),
39516
+ service: CHAT_CUSTOM_ENDPOINTS.GET_CHAT_MESSAGE_TTS.service,
39517
+ method: 'GET',
39518
+ responseHandler: async (response) => {
39519
+ const blob = await response.blob();
39520
+ return await new Promise((resolve, reject) => {
39521
+ const reader = new FileReader();
39522
+ reader.onloadend = () => resolve(reader.result);
39523
+ reader.onerror = () => reject(reader.error);
39524
+ reader.readAsDataURL(blob);
39525
+ });
39526
+ },
39527
+ cache: 'no-cache',
39528
+ }),
39529
+ }),
39530
+ }),
39531
+ });
39532
+ const { useGetChatMessageTtsQuery, useLazyGetChatMessageTtsQuery } = chatCustomApiSlice;
39533
+
39501
39534
  const chatFilesApiSlice = react.createApi({
39502
39535
  reducerPath: 'chatFilesApiSlice',
39503
39536
  baseQuery: iblFetchBaseQuery,
@@ -40555,6 +40588,130 @@ const skillsApiSlice = react.createApi({
40555
40588
  });
40556
40589
  const { useGetReportedSkillsQuery, useLazyGetReportedSkillsQuery, useGetSkillsPointsPercentileQuery, useLazyGetSkillsPointsPercentileQuery, useGetDesiredSkillsQuery, useLazyGetDesiredSkillsQuery, useGetUserEarnedSkillsQuery, useLazyGetUserEarnedSkillsQuery, } = skillsApiSlice;
40557
40590
 
40591
+ const CREDENTIALS_CUSTOM_REDUCER_PATH = 'credentialsCustomApiSlice';
40592
+ const CREDENTIALS_CUSTOM_ENDPOINTS = {
40593
+ DELETE_INTEGRATION_CREDENTIAL: {
40594
+ path: (org) => `/api/ai-account/orgs/${org}/integration-credential/`,
40595
+ service: exports.SERVICES.DM,
40596
+ },
40597
+ DELETE_CREDENTIAL: {
40598
+ path: (org) => `/api/ai-account/orgs/${org}/credential/`,
40599
+ service: exports.SERVICES.DM,
40600
+ },
40601
+ GET_INTEGRATION_CREDENTIALS_SCHEMA: {
40602
+ path: (org) => `/api/ai-account/orgs/${org}/integration-credential/schema/v2/`,
40603
+ service: exports.SERVICES.DM,
40604
+ },
40605
+ GET_CREDENTIALS_SCHEMA: {
40606
+ path: (org) => `/api/ai-account/orgs/${org}/credential/schema/`,
40607
+ service: exports.SERVICES.DM,
40608
+ },
40609
+ GET_MASKED_LLM_CREDENTIALS: {
40610
+ path: (org) => `/api/ai-account/orgs/${org}/masked-llm-credential/`,
40611
+ service: exports.SERVICES.DM,
40612
+ },
40613
+ GET_MASKED_INTEGRATION_CREDENTIALS: {
40614
+ path: (org) => `/api/ai-account/orgs/${org}/masked-integration-credential/`,
40615
+ service: exports.SERVICES.DM,
40616
+ },
40617
+ UPLOAD_CREDENTIAL_IMAGE: {
40618
+ path: (org, username) => `/api/credentials/orgs/${org}/users/${username}/images/`,
40619
+ service: exports.SERVICES.DM,
40620
+ },
40621
+ GET_ISSUERS: {
40622
+ path: (org, username) => `/api/credentials/orgs/${org}/users/${username}/issuers/`,
40623
+ service: exports.SERVICES.DM,
40624
+ },
40625
+ };
40626
+
40627
+ const credentialsCustomApiSlice = react.createApi({
40628
+ reducerPath: CREDENTIALS_CUSTOM_REDUCER_PATH,
40629
+ baseQuery: iblFetchBaseQuery,
40630
+ tagTypes: [
40631
+ 'IntegrationCredentialsSchema',
40632
+ 'CredentialsSchema',
40633
+ 'MaskedLLMCredentials',
40634
+ 'MaskedIntegrationCredentials',
40635
+ 'Issuers',
40636
+ ],
40637
+ endpoints: (builder) => ({
40638
+ deleteIntegrationCredential: builder.mutation({
40639
+ query: ({ org, platform_key, name }) => ({
40640
+ url: CREDENTIALS_CUSTOM_ENDPOINTS.DELETE_INTEGRATION_CREDENTIAL.path(org),
40641
+ service: CREDENTIALS_CUSTOM_ENDPOINTS.DELETE_INTEGRATION_CREDENTIAL.service,
40642
+ method: 'DELETE',
40643
+ body: JSON.stringify({
40644
+ platform: platform_key,
40645
+ name,
40646
+ }),
40647
+ }),
40648
+ invalidatesTags: ['MaskedIntegrationCredentials'],
40649
+ }),
40650
+ deleteCredential: builder.mutation({
40651
+ query: ({ org, name, platform_key, model_name }) => ({
40652
+ url: CREDENTIALS_CUSTOM_ENDPOINTS.DELETE_CREDENTIAL.path(org),
40653
+ service: CREDENTIALS_CUSTOM_ENDPOINTS.DELETE_CREDENTIAL.service,
40654
+ method: 'DELETE',
40655
+ body: JSON.stringify({ name, platform: platform_key, model_name }),
40656
+ }),
40657
+ invalidatesTags: ['MaskedLLMCredentials'],
40658
+ }),
40659
+ getIntegrationCredentialsSchema: builder.query({
40660
+ query: ({ org, name }) => ({
40661
+ url: CREDENTIALS_CUSTOM_ENDPOINTS.GET_INTEGRATION_CREDENTIALS_SCHEMA.path(org),
40662
+ service: CREDENTIALS_CUSTOM_ENDPOINTS.GET_INTEGRATION_CREDENTIALS_SCHEMA.service,
40663
+ method: 'GET',
40664
+ params: name ? { name } : undefined,
40665
+ }),
40666
+ providesTags: ['IntegrationCredentialsSchema'],
40667
+ }),
40668
+ getCredentialsSchema: builder.query({
40669
+ query: ({ org }) => ({
40670
+ url: CREDENTIALS_CUSTOM_ENDPOINTS.GET_CREDENTIALS_SCHEMA.path(org),
40671
+ service: CREDENTIALS_CUSTOM_ENDPOINTS.GET_CREDENTIALS_SCHEMA.service,
40672
+ method: 'GET',
40673
+ }),
40674
+ providesTags: ['CredentialsSchema'],
40675
+ }),
40676
+ getMaskedLLMCredentials: builder.query({
40677
+ query: ({ org }) => ({
40678
+ url: CREDENTIALS_CUSTOM_ENDPOINTS.GET_MASKED_LLM_CREDENTIALS.path(org),
40679
+ service: CREDENTIALS_CUSTOM_ENDPOINTS.GET_MASKED_LLM_CREDENTIALS.service,
40680
+ method: 'GET',
40681
+ }),
40682
+ providesTags: ['MaskedLLMCredentials'],
40683
+ }),
40684
+ getMaskedIntegrationCredentials: builder.query({
40685
+ query: ({ org }) => ({
40686
+ url: CREDENTIALS_CUSTOM_ENDPOINTS.GET_MASKED_INTEGRATION_CREDENTIALS.path(org),
40687
+ service: CREDENTIALS_CUSTOM_ENDPOINTS.GET_MASKED_INTEGRATION_CREDENTIALS.service,
40688
+ method: 'GET',
40689
+ }),
40690
+ providesTags: ['MaskedIntegrationCredentials'],
40691
+ }),
40692
+ getIssuers: builder.query({
40693
+ query: ({ org, username, q = '' }) => ({
40694
+ url: CREDENTIALS_CUSTOM_ENDPOINTS.GET_ISSUERS.path(org, username),
40695
+ service: CREDENTIALS_CUSTOM_ENDPOINTS.GET_ISSUERS.service,
40696
+ method: 'GET',
40697
+ params: { q, platform_key: org },
40698
+ }),
40699
+ providesTags: ['Issuers'],
40700
+ }),
40701
+ uploadCredentialImage: builder.mutation({
40702
+ query: ({ org, username, formData }) => ({
40703
+ url: CREDENTIALS_CUSTOM_ENDPOINTS.UPLOAD_CREDENTIAL_IMAGE.path(org, username),
40704
+ service: CREDENTIALS_CUSTOM_ENDPOINTS.UPLOAD_CREDENTIAL_IMAGE.service,
40705
+ method: 'POST',
40706
+ body: formData,
40707
+ isJson: false,
40708
+ }),
40709
+ invalidatesTags: ['Issuers'],
40710
+ }),
40711
+ }),
40712
+ });
40713
+ const { useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useLazyGetIntegrationCredentialsSchemaQuery, useGetCredentialsSchemaQuery, useLazyGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useGetMaskedIntegrationCredentialsQuery, useUploadCredentialImageMutation, useGetIssuersQuery, useLazyGetIssuersQuery, } = credentialsCustomApiSlice;
40714
+
40558
40715
  const credentialsApiSlice = react.createApi({
40559
40716
  reducerPath: 'credentialsApiSlice',
40560
40717
  baseQuery: iblFakeBaseQuery,
@@ -40663,6 +40820,15 @@ const credentialsApiSlice = react.createApi({
40663
40820
  }),
40664
40821
  createIntegrationCredential: builder.mutation({
40665
40822
  ...buildEndpointFromDmService(AiAccountService.aiAccountOrgsIntegrationCredentialCreate),
40823
+ async onQueryStarted(_args, { queryFulfilled, dispatch }) {
40824
+ try {
40825
+ await queryFulfilled;
40826
+ dispatch(credentialsCustomApiSlice.util.invalidateTags(['MaskedIntegrationCredentials']));
40827
+ }
40828
+ catch (_a) {
40829
+ // Swallow — invalidation should only happen on success.
40830
+ }
40831
+ },
40666
40832
  }),
40667
40833
  createLLMCredential: builder.mutation({
40668
40834
  ...buildEndpointFromDmService(AiAccountService.aiAccountOrgsCredentialCreate),
@@ -42482,114 +42648,6 @@ const tenantLogoApiSlice = react.createApi({
42482
42648
  });
42483
42649
  const { useUploadLightLogoMutation, useUploadDarkLogoMutation, } = tenantLogoApiSlice;
42484
42650
 
42485
- const CREDENTIALS_CUSTOM_REDUCER_PATH = 'credentialsCustomApiSlice';
42486
- const CREDENTIALS_CUSTOM_ENDPOINTS = {
42487
- DELETE_INTEGRATION_CREDENTIAL: {
42488
- path: (org) => `/api/ai-account/orgs/${org}/integration-credential/`,
42489
- service: exports.SERVICES.DM,
42490
- },
42491
- DELETE_CREDENTIAL: {
42492
- path: (org) => `/api/ai-account/orgs/${org}/credential/`,
42493
- service: exports.SERVICES.DM,
42494
- },
42495
- GET_INTEGRATION_CREDENTIALS_SCHEMA: {
42496
- path: (org) => `/api/ai-account/orgs/${org}/integration-credential/schema/`,
42497
- service: exports.SERVICES.DM,
42498
- },
42499
- GET_CREDENTIALS_SCHEMA: {
42500
- path: (org) => `/api/ai-account/orgs/${org}/credential/schema/`,
42501
- service: exports.SERVICES.DM,
42502
- },
42503
- GET_MASKED_LLM_CREDENTIALS: {
42504
- path: (org) => `/api/ai-account/orgs/${org}/masked-llm-credential/`,
42505
- service: exports.SERVICES.DM,
42506
- },
42507
- GET_MASKED_INTEGRATION_CREDENTIALS: {
42508
- path: (org) => `/api/ai-account/orgs/${org}/masked-integration-credential/`,
42509
- service: exports.SERVICES.DM,
42510
- },
42511
- UPLOAD_CREDENTIAL_IMAGE: {
42512
- path: (org, username) => `/api/credentials/orgs/${org}/users/${username}/images/`,
42513
- service: exports.SERVICES.DM,
42514
- },
42515
- GET_ISSUERS: {
42516
- path: (org, username) => `/api/credentials/orgs/${org}/users/${username}/issuers/`,
42517
- service: exports.SERVICES.DM,
42518
- },
42519
- };
42520
-
42521
- const credentialsCustomApiSlice = react.createApi({
42522
- reducerPath: CREDENTIALS_CUSTOM_REDUCER_PATH,
42523
- baseQuery: iblFetchBaseQuery,
42524
- endpoints: (builder) => ({
42525
- deleteIntegrationCredential: builder.mutation({
42526
- query: ({ org, platform_key, name }) => ({
42527
- url: CREDENTIALS_CUSTOM_ENDPOINTS.DELETE_INTEGRATION_CREDENTIAL.path(org),
42528
- service: CREDENTIALS_CUSTOM_ENDPOINTS.DELETE_INTEGRATION_CREDENTIAL.service,
42529
- method: 'DELETE',
42530
- body: JSON.stringify({
42531
- platform: platform_key,
42532
- name,
42533
- }),
42534
- }),
42535
- }),
42536
- deleteCredential: builder.mutation({
42537
- query: ({ org, name, platform_key, model_name }) => ({
42538
- url: CREDENTIALS_CUSTOM_ENDPOINTS.DELETE_CREDENTIAL.path(org),
42539
- service: CREDENTIALS_CUSTOM_ENDPOINTS.DELETE_CREDENTIAL.service,
42540
- method: 'DELETE',
42541
- body: JSON.stringify({ name, platform: platform_key, model_name }),
42542
- }),
42543
- }),
42544
- getIntegrationCredentialsSchema: builder.query({
42545
- query: ({ org }) => ({
42546
- url: CREDENTIALS_CUSTOM_ENDPOINTS.GET_INTEGRATION_CREDENTIALS_SCHEMA.path(org),
42547
- service: CREDENTIALS_CUSTOM_ENDPOINTS.GET_INTEGRATION_CREDENTIALS_SCHEMA.service,
42548
- method: 'GET',
42549
- }),
42550
- }),
42551
- getCredentialsSchema: builder.query({
42552
- query: ({ org }) => ({
42553
- url: CREDENTIALS_CUSTOM_ENDPOINTS.GET_CREDENTIALS_SCHEMA.path(org),
42554
- service: CREDENTIALS_CUSTOM_ENDPOINTS.GET_CREDENTIALS_SCHEMA.service,
42555
- method: 'GET',
42556
- }),
42557
- }),
42558
- getMaskedLLMCredentials: builder.query({
42559
- query: ({ org }) => ({
42560
- url: CREDENTIALS_CUSTOM_ENDPOINTS.GET_MASKED_LLM_CREDENTIALS.path(org),
42561
- service: CREDENTIALS_CUSTOM_ENDPOINTS.GET_MASKED_LLM_CREDENTIALS.service,
42562
- method: 'GET',
42563
- }),
42564
- }),
42565
- getMaskedIntegrationCredentials: builder.query({
42566
- query: ({ org }) => ({
42567
- url: CREDENTIALS_CUSTOM_ENDPOINTS.GET_MASKED_INTEGRATION_CREDENTIALS.path(org),
42568
- service: CREDENTIALS_CUSTOM_ENDPOINTS.GET_MASKED_INTEGRATION_CREDENTIALS.service,
42569
- method: 'GET',
42570
- }),
42571
- }),
42572
- getIssuers: builder.query({
42573
- query: ({ org, username, q = '' }) => ({
42574
- url: CREDENTIALS_CUSTOM_ENDPOINTS.GET_ISSUERS.path(org, username),
42575
- service: CREDENTIALS_CUSTOM_ENDPOINTS.GET_ISSUERS.service,
42576
- method: 'GET',
42577
- params: { q, platform_key: org },
42578
- }),
42579
- }),
42580
- uploadCredentialImage: builder.mutation({
42581
- query: ({ org, username, formData }) => ({
42582
- url: CREDENTIALS_CUSTOM_ENDPOINTS.UPLOAD_CREDENTIAL_IMAGE.path(org, username),
42583
- service: CREDENTIALS_CUSTOM_ENDPOINTS.UPLOAD_CREDENTIAL_IMAGE.service,
42584
- method: 'POST',
42585
- body: formData,
42586
- isJson: false,
42587
- }),
42588
- }),
42589
- }),
42590
- });
42591
- const { useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useLazyGetIntegrationCredentialsSchemaQuery, useGetCredentialsSchemaQuery, useLazyGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useGetMaskedIntegrationCredentialsQuery, useUploadCredentialImageMutation, useGetIssuersQuery, useLazyGetIssuersQuery, } = credentialsCustomApiSlice;
42592
-
42593
42651
  const notificationsApiSlice = react.createApi({
42594
42652
  reducerPath: 'notificationsApiSlice',
42595
42653
  baseQuery: iblFakeBaseQuery,
@@ -45067,6 +45125,7 @@ const mentorReducer = {
45067
45125
  [userApiSlice.reducerPath]: userApiSlice.reducer,
45068
45126
  [platformApiSlice.reducerPath]: platformApiSlice.reducer,
45069
45127
  [chatApiSlice.reducerPath]: chatApiSlice.reducer,
45128
+ [chatCustomApiSlice.reducerPath]: chatCustomApiSlice.reducer,
45070
45129
  [chatFilesApiSlice.reducerPath]: chatFilesApiSlice.reducer,
45071
45130
  [apiKeysApiSlice.reducerPath]: apiKeysApiSlice.reducer,
45072
45131
  [llmsApiSlice.reducerPath]: llmsApiSlice.reducer,
@@ -45129,6 +45188,7 @@ const mentorMiddleware = [
45129
45188
  credentialsApiSlice.middleware,
45130
45189
  userInvitationsApiSlice.middleware,
45131
45190
  chatApiSlice.middleware,
45191
+ chatCustomApiSlice.middleware,
45132
45192
  chatFilesApiSlice.middleware,
45133
45193
  appApiSlice.middleware,
45134
45194
  billingApiSlice.middleware,
@@ -45340,6 +45400,7 @@ exports.billingCustomSlice = billingCustomSlice;
45340
45400
  exports.careerApiSlice = careerApiSlice;
45341
45401
  exports.catalogApiSlice = catalogApiSlice;
45342
45402
  exports.chatApiSlice = chatApiSlice;
45403
+ exports.chatCustomApiSlice = chatCustomApiSlice;
45343
45404
  exports.chatFilesApiSlice = chatFilesApiSlice;
45344
45405
  exports.chatHistoryApiSlice = chatHistoryApiSlice;
45345
45406
  exports.clawApiSlice = clawApiSlice;
@@ -45547,6 +45608,7 @@ exports.useGetCatalogSearchQuery = useGetCatalogSearchQuery;
45547
45608
  exports.useGetChatHistoryExportStatusQuery = useGetChatHistoryExportStatusQuery;
45548
45609
  exports.useGetChatHistoryFilterQuery = useGetChatHistoryFilterQuery;
45549
45610
  exports.useGetChatHistoryQuery = useGetChatHistoryQuery;
45611
+ exports.useGetChatMessageTtsQuery = useGetChatMessageTtsQuery;
45550
45612
  exports.useGetChatMessagesForSessionQuery = useGetChatMessagesForSessionQuery;
45551
45613
  exports.useGetClawInstanceQuery = useGetClawInstanceQuery;
45552
45614
  exports.useGetClawInstancesQuery = useGetClawInstancesQuery;
@@ -45751,6 +45813,7 @@ exports.useLazyGetCatalogSearchQuery = useLazyGetCatalogSearchQuery;
45751
45813
  exports.useLazyGetChatHistoryExportStatusQuery = useLazyGetChatHistoryExportStatusQuery;
45752
45814
  exports.useLazyGetChatHistoryFilterQuery = useLazyGetChatHistoryFilterQuery;
45753
45815
  exports.useLazyGetChatHistoryQuery = useLazyGetChatHistoryQuery;
45816
+ exports.useLazyGetChatMessageTtsQuery = useLazyGetChatMessageTtsQuery;
45754
45817
  exports.useLazyGetChatMessagesForSessionQuery = useLazyGetChatMessagesForSessionQuery;
45755
45818
  exports.useLazyGetClawInstanceQuery = useLazyGetClawInstanceQuery;
45756
45819
  exports.useLazyGetClawInstancesQuery = useLazyGetClawInstancesQuery;