@iblai/data-layer 1.5.10 → 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.esm.js CHANGED
@@ -40553,6 +40553,130 @@ const skillsApiSlice = createApi({
40553
40553
  });
40554
40554
  const { useGetReportedSkillsQuery, useLazyGetReportedSkillsQuery, useGetSkillsPointsPercentileQuery, useLazyGetSkillsPointsPercentileQuery, useGetDesiredSkillsQuery, useLazyGetDesiredSkillsQuery, useGetUserEarnedSkillsQuery, useLazyGetUserEarnedSkillsQuery, } = skillsApiSlice;
40555
40555
 
40556
+ const CREDENTIALS_CUSTOM_REDUCER_PATH = 'credentialsCustomApiSlice';
40557
+ const CREDENTIALS_CUSTOM_ENDPOINTS = {
40558
+ DELETE_INTEGRATION_CREDENTIAL: {
40559
+ path: (org) => `/api/ai-account/orgs/${org}/integration-credential/`,
40560
+ service: SERVICES.DM,
40561
+ },
40562
+ DELETE_CREDENTIAL: {
40563
+ path: (org) => `/api/ai-account/orgs/${org}/credential/`,
40564
+ service: SERVICES.DM,
40565
+ },
40566
+ GET_INTEGRATION_CREDENTIALS_SCHEMA: {
40567
+ path: (org) => `/api/ai-account/orgs/${org}/integration-credential/schema/v2/`,
40568
+ service: SERVICES.DM,
40569
+ },
40570
+ GET_CREDENTIALS_SCHEMA: {
40571
+ path: (org) => `/api/ai-account/orgs/${org}/credential/schema/`,
40572
+ service: SERVICES.DM,
40573
+ },
40574
+ GET_MASKED_LLM_CREDENTIALS: {
40575
+ path: (org) => `/api/ai-account/orgs/${org}/masked-llm-credential/`,
40576
+ service: SERVICES.DM,
40577
+ },
40578
+ GET_MASKED_INTEGRATION_CREDENTIALS: {
40579
+ path: (org) => `/api/ai-account/orgs/${org}/masked-integration-credential/`,
40580
+ service: SERVICES.DM,
40581
+ },
40582
+ UPLOAD_CREDENTIAL_IMAGE: {
40583
+ path: (org, username) => `/api/credentials/orgs/${org}/users/${username}/images/`,
40584
+ service: SERVICES.DM,
40585
+ },
40586
+ GET_ISSUERS: {
40587
+ path: (org, username) => `/api/credentials/orgs/${org}/users/${username}/issuers/`,
40588
+ service: SERVICES.DM,
40589
+ },
40590
+ };
40591
+
40592
+ const credentialsCustomApiSlice = createApi({
40593
+ reducerPath: CREDENTIALS_CUSTOM_REDUCER_PATH,
40594
+ baseQuery: iblFetchBaseQuery,
40595
+ tagTypes: [
40596
+ 'IntegrationCredentialsSchema',
40597
+ 'CredentialsSchema',
40598
+ 'MaskedLLMCredentials',
40599
+ 'MaskedIntegrationCredentials',
40600
+ 'Issuers',
40601
+ ],
40602
+ endpoints: (builder) => ({
40603
+ deleteIntegrationCredential: builder.mutation({
40604
+ query: ({ org, platform_key, name }) => ({
40605
+ url: CREDENTIALS_CUSTOM_ENDPOINTS.DELETE_INTEGRATION_CREDENTIAL.path(org),
40606
+ service: CREDENTIALS_CUSTOM_ENDPOINTS.DELETE_INTEGRATION_CREDENTIAL.service,
40607
+ method: 'DELETE',
40608
+ body: JSON.stringify({
40609
+ platform: platform_key,
40610
+ name,
40611
+ }),
40612
+ }),
40613
+ invalidatesTags: ['MaskedIntegrationCredentials'],
40614
+ }),
40615
+ deleteCredential: builder.mutation({
40616
+ query: ({ org, name, platform_key, model_name }) => ({
40617
+ url: CREDENTIALS_CUSTOM_ENDPOINTS.DELETE_CREDENTIAL.path(org),
40618
+ service: CREDENTIALS_CUSTOM_ENDPOINTS.DELETE_CREDENTIAL.service,
40619
+ method: 'DELETE',
40620
+ body: JSON.stringify({ name, platform: platform_key, model_name }),
40621
+ }),
40622
+ invalidatesTags: ['MaskedLLMCredentials'],
40623
+ }),
40624
+ getIntegrationCredentialsSchema: builder.query({
40625
+ query: ({ org, name }) => ({
40626
+ url: CREDENTIALS_CUSTOM_ENDPOINTS.GET_INTEGRATION_CREDENTIALS_SCHEMA.path(org),
40627
+ service: CREDENTIALS_CUSTOM_ENDPOINTS.GET_INTEGRATION_CREDENTIALS_SCHEMA.service,
40628
+ method: 'GET',
40629
+ params: name ? { name } : undefined,
40630
+ }),
40631
+ providesTags: ['IntegrationCredentialsSchema'],
40632
+ }),
40633
+ getCredentialsSchema: builder.query({
40634
+ query: ({ org }) => ({
40635
+ url: CREDENTIALS_CUSTOM_ENDPOINTS.GET_CREDENTIALS_SCHEMA.path(org),
40636
+ service: CREDENTIALS_CUSTOM_ENDPOINTS.GET_CREDENTIALS_SCHEMA.service,
40637
+ method: 'GET',
40638
+ }),
40639
+ providesTags: ['CredentialsSchema'],
40640
+ }),
40641
+ getMaskedLLMCredentials: builder.query({
40642
+ query: ({ org }) => ({
40643
+ url: CREDENTIALS_CUSTOM_ENDPOINTS.GET_MASKED_LLM_CREDENTIALS.path(org),
40644
+ service: CREDENTIALS_CUSTOM_ENDPOINTS.GET_MASKED_LLM_CREDENTIALS.service,
40645
+ method: 'GET',
40646
+ }),
40647
+ providesTags: ['MaskedLLMCredentials'],
40648
+ }),
40649
+ getMaskedIntegrationCredentials: builder.query({
40650
+ query: ({ org }) => ({
40651
+ url: CREDENTIALS_CUSTOM_ENDPOINTS.GET_MASKED_INTEGRATION_CREDENTIALS.path(org),
40652
+ service: CREDENTIALS_CUSTOM_ENDPOINTS.GET_MASKED_INTEGRATION_CREDENTIALS.service,
40653
+ method: 'GET',
40654
+ }),
40655
+ providesTags: ['MaskedIntegrationCredentials'],
40656
+ }),
40657
+ getIssuers: builder.query({
40658
+ query: ({ org, username, q = '' }) => ({
40659
+ url: CREDENTIALS_CUSTOM_ENDPOINTS.GET_ISSUERS.path(org, username),
40660
+ service: CREDENTIALS_CUSTOM_ENDPOINTS.GET_ISSUERS.service,
40661
+ method: 'GET',
40662
+ params: { q, platform_key: org },
40663
+ }),
40664
+ providesTags: ['Issuers'],
40665
+ }),
40666
+ uploadCredentialImage: builder.mutation({
40667
+ query: ({ org, username, formData }) => ({
40668
+ url: CREDENTIALS_CUSTOM_ENDPOINTS.UPLOAD_CREDENTIAL_IMAGE.path(org, username),
40669
+ service: CREDENTIALS_CUSTOM_ENDPOINTS.UPLOAD_CREDENTIAL_IMAGE.service,
40670
+ method: 'POST',
40671
+ body: formData,
40672
+ isJson: false,
40673
+ }),
40674
+ invalidatesTags: ['Issuers'],
40675
+ }),
40676
+ }),
40677
+ });
40678
+ const { useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useLazyGetIntegrationCredentialsSchemaQuery, useGetCredentialsSchemaQuery, useLazyGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useGetMaskedIntegrationCredentialsQuery, useUploadCredentialImageMutation, useGetIssuersQuery, useLazyGetIssuersQuery, } = credentialsCustomApiSlice;
40679
+
40556
40680
  const credentialsApiSlice = createApi({
40557
40681
  reducerPath: 'credentialsApiSlice',
40558
40682
  baseQuery: iblFakeBaseQuery,
@@ -40661,6 +40785,15 @@ const credentialsApiSlice = createApi({
40661
40785
  }),
40662
40786
  createIntegrationCredential: builder.mutation({
40663
40787
  ...buildEndpointFromDmService(AiAccountService.aiAccountOrgsIntegrationCredentialCreate),
40788
+ async onQueryStarted(_args, { queryFulfilled, dispatch }) {
40789
+ try {
40790
+ await queryFulfilled;
40791
+ dispatch(credentialsCustomApiSlice.util.invalidateTags(['MaskedIntegrationCredentials']));
40792
+ }
40793
+ catch (_a) {
40794
+ // Swallow — invalidation should only happen on success.
40795
+ }
40796
+ },
40664
40797
  }),
40665
40798
  createLLMCredential: builder.mutation({
40666
40799
  ...buildEndpointFromDmService(AiAccountService.aiAccountOrgsCredentialCreate),
@@ -42480,114 +42613,6 @@ const tenantLogoApiSlice = createApi({
42480
42613
  });
42481
42614
  const { useUploadLightLogoMutation, useUploadDarkLogoMutation, } = tenantLogoApiSlice;
42482
42615
 
42483
- const CREDENTIALS_CUSTOM_REDUCER_PATH = 'credentialsCustomApiSlice';
42484
- const CREDENTIALS_CUSTOM_ENDPOINTS = {
42485
- DELETE_INTEGRATION_CREDENTIAL: {
42486
- path: (org) => `/api/ai-account/orgs/${org}/integration-credential/`,
42487
- service: SERVICES.DM,
42488
- },
42489
- DELETE_CREDENTIAL: {
42490
- path: (org) => `/api/ai-account/orgs/${org}/credential/`,
42491
- service: SERVICES.DM,
42492
- },
42493
- GET_INTEGRATION_CREDENTIALS_SCHEMA: {
42494
- path: (org) => `/api/ai-account/orgs/${org}/integration-credential/schema/`,
42495
- service: SERVICES.DM,
42496
- },
42497
- GET_CREDENTIALS_SCHEMA: {
42498
- path: (org) => `/api/ai-account/orgs/${org}/credential/schema/`,
42499
- service: SERVICES.DM,
42500
- },
42501
- GET_MASKED_LLM_CREDENTIALS: {
42502
- path: (org) => `/api/ai-account/orgs/${org}/masked-llm-credential/`,
42503
- service: SERVICES.DM,
42504
- },
42505
- GET_MASKED_INTEGRATION_CREDENTIALS: {
42506
- path: (org) => `/api/ai-account/orgs/${org}/masked-integration-credential/`,
42507
- service: SERVICES.DM,
42508
- },
42509
- UPLOAD_CREDENTIAL_IMAGE: {
42510
- path: (org, username) => `/api/credentials/orgs/${org}/users/${username}/images/`,
42511
- service: SERVICES.DM,
42512
- },
42513
- GET_ISSUERS: {
42514
- path: (org, username) => `/api/credentials/orgs/${org}/users/${username}/issuers/`,
42515
- service: SERVICES.DM,
42516
- },
42517
- };
42518
-
42519
- const credentialsCustomApiSlice = createApi({
42520
- reducerPath: CREDENTIALS_CUSTOM_REDUCER_PATH,
42521
- baseQuery: iblFetchBaseQuery,
42522
- endpoints: (builder) => ({
42523
- deleteIntegrationCredential: builder.mutation({
42524
- query: ({ org, platform_key, name }) => ({
42525
- url: CREDENTIALS_CUSTOM_ENDPOINTS.DELETE_INTEGRATION_CREDENTIAL.path(org),
42526
- service: CREDENTIALS_CUSTOM_ENDPOINTS.DELETE_INTEGRATION_CREDENTIAL.service,
42527
- method: 'DELETE',
42528
- body: JSON.stringify({
42529
- platform: platform_key,
42530
- name,
42531
- }),
42532
- }),
42533
- }),
42534
- deleteCredential: builder.mutation({
42535
- query: ({ org, name, platform_key, model_name }) => ({
42536
- url: CREDENTIALS_CUSTOM_ENDPOINTS.DELETE_CREDENTIAL.path(org),
42537
- service: CREDENTIALS_CUSTOM_ENDPOINTS.DELETE_CREDENTIAL.service,
42538
- method: 'DELETE',
42539
- body: JSON.stringify({ name, platform: platform_key, model_name }),
42540
- }),
42541
- }),
42542
- getIntegrationCredentialsSchema: builder.query({
42543
- query: ({ org }) => ({
42544
- url: CREDENTIALS_CUSTOM_ENDPOINTS.GET_INTEGRATION_CREDENTIALS_SCHEMA.path(org),
42545
- service: CREDENTIALS_CUSTOM_ENDPOINTS.GET_INTEGRATION_CREDENTIALS_SCHEMA.service,
42546
- method: 'GET',
42547
- }),
42548
- }),
42549
- getCredentialsSchema: builder.query({
42550
- query: ({ org }) => ({
42551
- url: CREDENTIALS_CUSTOM_ENDPOINTS.GET_CREDENTIALS_SCHEMA.path(org),
42552
- service: CREDENTIALS_CUSTOM_ENDPOINTS.GET_CREDENTIALS_SCHEMA.service,
42553
- method: 'GET',
42554
- }),
42555
- }),
42556
- getMaskedLLMCredentials: builder.query({
42557
- query: ({ org }) => ({
42558
- url: CREDENTIALS_CUSTOM_ENDPOINTS.GET_MASKED_LLM_CREDENTIALS.path(org),
42559
- service: CREDENTIALS_CUSTOM_ENDPOINTS.GET_MASKED_LLM_CREDENTIALS.service,
42560
- method: 'GET',
42561
- }),
42562
- }),
42563
- getMaskedIntegrationCredentials: builder.query({
42564
- query: ({ org }) => ({
42565
- url: CREDENTIALS_CUSTOM_ENDPOINTS.GET_MASKED_INTEGRATION_CREDENTIALS.path(org),
42566
- service: CREDENTIALS_CUSTOM_ENDPOINTS.GET_MASKED_INTEGRATION_CREDENTIALS.service,
42567
- method: 'GET',
42568
- }),
42569
- }),
42570
- getIssuers: builder.query({
42571
- query: ({ org, username, q = '' }) => ({
42572
- url: CREDENTIALS_CUSTOM_ENDPOINTS.GET_ISSUERS.path(org, username),
42573
- service: CREDENTIALS_CUSTOM_ENDPOINTS.GET_ISSUERS.service,
42574
- method: 'GET',
42575
- params: { q, platform_key: org },
42576
- }),
42577
- }),
42578
- uploadCredentialImage: builder.mutation({
42579
- query: ({ org, username, formData }) => ({
42580
- url: CREDENTIALS_CUSTOM_ENDPOINTS.UPLOAD_CREDENTIAL_IMAGE.path(org, username),
42581
- service: CREDENTIALS_CUSTOM_ENDPOINTS.UPLOAD_CREDENTIAL_IMAGE.service,
42582
- method: 'POST',
42583
- body: formData,
42584
- isJson: false,
42585
- }),
42586
- }),
42587
- }),
42588
- });
42589
- const { useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useLazyGetIntegrationCredentialsSchemaQuery, useGetCredentialsSchemaQuery, useLazyGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useGetMaskedIntegrationCredentialsQuery, useUploadCredentialImageMutation, useGetIssuersQuery, useLazyGetIssuersQuery, } = credentialsCustomApiSlice;
42590
-
42591
42616
  const notificationsApiSlice = createApi({
42592
42617
  reducerPath: 'notificationsApiSlice',
42593
42618
  baseQuery: iblFakeBaseQuery,
@@ -44343,13 +44368,47 @@ var recommendationPromptTypeEnum;
44343
44368
  recommendationPromptTypeEnum["catalog"] = "catalog";
44344
44369
  })(recommendationPromptTypeEnum || (recommendationPromptTypeEnum = {}));
44345
44370
 
44371
+ const encodePathSegment = (value) => encodeURIComponent(value);
44372
+ const periodicAgentsListPath = ({ org, userId }) => `/api/ai-mentor/orgs/${encodePathSegment(org)}/users/${encodePathSegment(userId)}/periodic-agents/`;
44373
+ const periodicAgentsListParams = ({ enabled, mentorId, ordering, page, pageSize, parentMentorId, parentSessionId, previousAgent, previousAgentStatus, search, status, title, username, startDate, endDate, }) => ({
44374
+ enabled,
44375
+ mentor_id: mentorId,
44376
+ ordering,
44377
+ page,
44378
+ page_size: pageSize,
44379
+ parent_mentor_id: parentMentorId,
44380
+ parent_session_id: parentSessionId,
44381
+ previous_agent: previousAgent,
44382
+ previous_agent_status: previousAgentStatus,
44383
+ search,
44384
+ status,
44385
+ title,
44386
+ username,
44387
+ start_date: startDate,
44388
+ end_date: endDate,
44389
+ });
44346
44390
  const periodicAgentsApiSlice = createApi({
44347
44391
  reducerPath: 'periodicAgentsApiSlice',
44348
44392
  baseQuery: iblFakeBaseQuery,
44349
44393
  tagTypes: ['periodicAgents', 'periodicAgent', 'periodicAgentLogs'],
44350
44394
  endpoints: (builder) => ({
44351
44395
  getPeriodicAgents: builder.query({
44352
- ...buildEndpointFromDmService(AiMentorService.aiMentorOrgsUsersPeriodicAgentsList),
44396
+ async queryFn(args, api, extraOptions) {
44397
+ try {
44398
+ const result = await iblFetchBaseQuery({
44399
+ url: periodicAgentsListPath(args),
44400
+ service: SERVICES.DM,
44401
+ params: periodicAgentsListParams(args),
44402
+ }, api, extraOptions);
44403
+ if ('error' in result) {
44404
+ return { error: result.error };
44405
+ }
44406
+ return { data: result.data };
44407
+ }
44408
+ catch (error) {
44409
+ return { error: error };
44410
+ }
44411
+ },
44353
44412
  providesTags: ['periodicAgents'],
44354
44413
  }),
44355
44414
  getPeriodicAgent: builder.query({