@iblai/data-layer 1.5.11 → 1.6.0

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
@@ -40555,6 +40555,130 @@ const skillsApiSlice = react.createApi({
40555
40555
  });
40556
40556
  const { useGetReportedSkillsQuery, useLazyGetReportedSkillsQuery, useGetSkillsPointsPercentileQuery, useLazyGetSkillsPointsPercentileQuery, useGetDesiredSkillsQuery, useLazyGetDesiredSkillsQuery, useGetUserEarnedSkillsQuery, useLazyGetUserEarnedSkillsQuery, } = skillsApiSlice;
40557
40557
 
40558
+ const CREDENTIALS_CUSTOM_REDUCER_PATH = 'credentialsCustomApiSlice';
40559
+ const CREDENTIALS_CUSTOM_ENDPOINTS = {
40560
+ DELETE_INTEGRATION_CREDENTIAL: {
40561
+ path: (org) => `/api/ai-account/orgs/${org}/integration-credential/`,
40562
+ service: exports.SERVICES.DM,
40563
+ },
40564
+ DELETE_CREDENTIAL: {
40565
+ path: (org) => `/api/ai-account/orgs/${org}/credential/`,
40566
+ service: exports.SERVICES.DM,
40567
+ },
40568
+ GET_INTEGRATION_CREDENTIALS_SCHEMA: {
40569
+ path: (org) => `/api/ai-account/orgs/${org}/integration-credential/schema/v2/`,
40570
+ service: exports.SERVICES.DM,
40571
+ },
40572
+ GET_CREDENTIALS_SCHEMA: {
40573
+ path: (org) => `/api/ai-account/orgs/${org}/credential/schema/`,
40574
+ service: exports.SERVICES.DM,
40575
+ },
40576
+ GET_MASKED_LLM_CREDENTIALS: {
40577
+ path: (org) => `/api/ai-account/orgs/${org}/masked-llm-credential/`,
40578
+ service: exports.SERVICES.DM,
40579
+ },
40580
+ GET_MASKED_INTEGRATION_CREDENTIALS: {
40581
+ path: (org) => `/api/ai-account/orgs/${org}/masked-integration-credential/`,
40582
+ service: exports.SERVICES.DM,
40583
+ },
40584
+ UPLOAD_CREDENTIAL_IMAGE: {
40585
+ path: (org, username) => `/api/credentials/orgs/${org}/users/${username}/images/`,
40586
+ service: exports.SERVICES.DM,
40587
+ },
40588
+ GET_ISSUERS: {
40589
+ path: (org, username) => `/api/credentials/orgs/${org}/users/${username}/issuers/`,
40590
+ service: exports.SERVICES.DM,
40591
+ },
40592
+ };
40593
+
40594
+ const credentialsCustomApiSlice = react.createApi({
40595
+ reducerPath: CREDENTIALS_CUSTOM_REDUCER_PATH,
40596
+ baseQuery: iblFetchBaseQuery,
40597
+ tagTypes: [
40598
+ 'IntegrationCredentialsSchema',
40599
+ 'CredentialsSchema',
40600
+ 'MaskedLLMCredentials',
40601
+ 'MaskedIntegrationCredentials',
40602
+ 'Issuers',
40603
+ ],
40604
+ endpoints: (builder) => ({
40605
+ deleteIntegrationCredential: builder.mutation({
40606
+ query: ({ org, platform_key, name }) => ({
40607
+ url: CREDENTIALS_CUSTOM_ENDPOINTS.DELETE_INTEGRATION_CREDENTIAL.path(org),
40608
+ service: CREDENTIALS_CUSTOM_ENDPOINTS.DELETE_INTEGRATION_CREDENTIAL.service,
40609
+ method: 'DELETE',
40610
+ body: JSON.stringify({
40611
+ platform: platform_key,
40612
+ name,
40613
+ }),
40614
+ }),
40615
+ invalidatesTags: ['MaskedIntegrationCredentials'],
40616
+ }),
40617
+ deleteCredential: builder.mutation({
40618
+ query: ({ org, name, platform_key, model_name }) => ({
40619
+ url: CREDENTIALS_CUSTOM_ENDPOINTS.DELETE_CREDENTIAL.path(org),
40620
+ service: CREDENTIALS_CUSTOM_ENDPOINTS.DELETE_CREDENTIAL.service,
40621
+ method: 'DELETE',
40622
+ body: JSON.stringify({ name, platform: platform_key, model_name }),
40623
+ }),
40624
+ invalidatesTags: ['MaskedLLMCredentials'],
40625
+ }),
40626
+ getIntegrationCredentialsSchema: builder.query({
40627
+ query: ({ org, name }) => ({
40628
+ url: CREDENTIALS_CUSTOM_ENDPOINTS.GET_INTEGRATION_CREDENTIALS_SCHEMA.path(org),
40629
+ service: CREDENTIALS_CUSTOM_ENDPOINTS.GET_INTEGRATION_CREDENTIALS_SCHEMA.service,
40630
+ method: 'GET',
40631
+ params: name ? { name } : undefined,
40632
+ }),
40633
+ providesTags: ['IntegrationCredentialsSchema'],
40634
+ }),
40635
+ getCredentialsSchema: builder.query({
40636
+ query: ({ org }) => ({
40637
+ url: CREDENTIALS_CUSTOM_ENDPOINTS.GET_CREDENTIALS_SCHEMA.path(org),
40638
+ service: CREDENTIALS_CUSTOM_ENDPOINTS.GET_CREDENTIALS_SCHEMA.service,
40639
+ method: 'GET',
40640
+ }),
40641
+ providesTags: ['CredentialsSchema'],
40642
+ }),
40643
+ getMaskedLLMCredentials: builder.query({
40644
+ query: ({ org }) => ({
40645
+ url: CREDENTIALS_CUSTOM_ENDPOINTS.GET_MASKED_LLM_CREDENTIALS.path(org),
40646
+ service: CREDENTIALS_CUSTOM_ENDPOINTS.GET_MASKED_LLM_CREDENTIALS.service,
40647
+ method: 'GET',
40648
+ }),
40649
+ providesTags: ['MaskedLLMCredentials'],
40650
+ }),
40651
+ getMaskedIntegrationCredentials: builder.query({
40652
+ query: ({ org }) => ({
40653
+ url: CREDENTIALS_CUSTOM_ENDPOINTS.GET_MASKED_INTEGRATION_CREDENTIALS.path(org),
40654
+ service: CREDENTIALS_CUSTOM_ENDPOINTS.GET_MASKED_INTEGRATION_CREDENTIALS.service,
40655
+ method: 'GET',
40656
+ }),
40657
+ providesTags: ['MaskedIntegrationCredentials'],
40658
+ }),
40659
+ getIssuers: builder.query({
40660
+ query: ({ org, username, q = '' }) => ({
40661
+ url: CREDENTIALS_CUSTOM_ENDPOINTS.GET_ISSUERS.path(org, username),
40662
+ service: CREDENTIALS_CUSTOM_ENDPOINTS.GET_ISSUERS.service,
40663
+ method: 'GET',
40664
+ params: { q, platform_key: org },
40665
+ }),
40666
+ providesTags: ['Issuers'],
40667
+ }),
40668
+ uploadCredentialImage: builder.mutation({
40669
+ query: ({ org, username, formData }) => ({
40670
+ url: CREDENTIALS_CUSTOM_ENDPOINTS.UPLOAD_CREDENTIAL_IMAGE.path(org, username),
40671
+ service: CREDENTIALS_CUSTOM_ENDPOINTS.UPLOAD_CREDENTIAL_IMAGE.service,
40672
+ method: 'POST',
40673
+ body: formData,
40674
+ isJson: false,
40675
+ }),
40676
+ invalidatesTags: ['Issuers'],
40677
+ }),
40678
+ }),
40679
+ });
40680
+ const { useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useLazyGetIntegrationCredentialsSchemaQuery, useGetCredentialsSchemaQuery, useLazyGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useGetMaskedIntegrationCredentialsQuery, useUploadCredentialImageMutation, useGetIssuersQuery, useLazyGetIssuersQuery, } = credentialsCustomApiSlice;
40681
+
40558
40682
  const credentialsApiSlice = react.createApi({
40559
40683
  reducerPath: 'credentialsApiSlice',
40560
40684
  baseQuery: iblFakeBaseQuery,
@@ -40663,6 +40787,15 @@ const credentialsApiSlice = react.createApi({
40663
40787
  }),
40664
40788
  createIntegrationCredential: builder.mutation({
40665
40789
  ...buildEndpointFromDmService(AiAccountService.aiAccountOrgsIntegrationCredentialCreate),
40790
+ async onQueryStarted(_args, { queryFulfilled, dispatch }) {
40791
+ try {
40792
+ await queryFulfilled;
40793
+ dispatch(credentialsCustomApiSlice.util.invalidateTags(['MaskedIntegrationCredentials']));
40794
+ }
40795
+ catch (_a) {
40796
+ // Swallow — invalidation should only happen on success.
40797
+ }
40798
+ },
40666
40799
  }),
40667
40800
  createLLMCredential: builder.mutation({
40668
40801
  ...buildEndpointFromDmService(AiAccountService.aiAccountOrgsCredentialCreate),
@@ -42482,114 +42615,6 @@ const tenantLogoApiSlice = react.createApi({
42482
42615
  });
42483
42616
  const { useUploadLightLogoMutation, useUploadDarkLogoMutation, } = tenantLogoApiSlice;
42484
42617
 
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
42618
  const notificationsApiSlice = react.createApi({
42594
42619
  reducerPath: 'notificationsApiSlice',
42595
42620
  baseQuery: iblFakeBaseQuery,