@iblai/web-utils 1.1.15 → 1.1.17

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
@@ -559,6 +559,13 @@ const MENTOR_AI_CONFIG = {
559
559
  description: "Allow users to access the mentors from the community.",
560
560
  type: "boolean",
561
561
  },
562
+ {
563
+ slug: "mentor_report_inappropriate_content",
564
+ label: "Report Inappropriate Content",
565
+ defaultValue: true,
566
+ description: "Allow users to report inappropriate content.",
567
+ type: "boolean",
568
+ },
562
569
  {
563
570
  slug: "help_center_url",
564
571
  label: "Help Center URL",
@@ -1278,6 +1285,10 @@ const useTenantMetadata = ({ org, spa, skip = false, }) => {
1278
1285
  var _a;
1279
1286
  return (_a = data === null || data === void 0 ? void 0 : data.metadata) === null || _a === void 0 ? void 0 : _a.support_email;
1280
1287
  };
1288
+ const isMentorInappropriateContentEnabled = () => {
1289
+ var _a;
1290
+ return ((_a = data === null || data === void 0 ? void 0 : data.metadata) === null || _a === void 0 ? void 0 : _a.mentor_report_inappropriate_content) !== false;
1291
+ };
1281
1292
  const getAllMetadatas = () => {
1282
1293
  const metadatas = loadMetadataConfig(spa);
1283
1294
  return metadatas.map((_metadata) => {
@@ -1298,6 +1309,7 @@ const useTenantMetadata = ({ org, spa, skip = false, }) => {
1298
1309
  isMentorAIEnabled,
1299
1310
  isSkillsLeaderBoardEnabled,
1300
1311
  getEmbeddedMentorToUse,
1312
+ isMentorInappropriateContentEnabled,
1301
1313
  metadataLoaded: !isLoading && (data === null || data === void 0 ? void 0 : data.metadata),
1302
1314
  getAllMetadatas,
1303
1315
  getSupportEmail,
@@ -1319,7 +1331,7 @@ const useSubscriptionHandlerV2 = (subscriptionFlow) => {
1319
1331
  const [getUserApps] = dataLayer.useLazyGetUserAppsQuery();
1320
1332
  const CREDIT_INTERVAL_CHECK_COUNTER = 60 * 60 * 1000; // 1 hour
1321
1333
  const { getSupportEmail } = useTenantMetadata({
1322
- org: subscriptionFlow.getCurrentTenantOrg(),
1334
+ org: subscriptionFlow.getCurrentTenantKey(),
1323
1335
  });
1324
1336
  /**
1325
1337
  * Checks if user is currently on the main tenant
@@ -3439,13 +3451,6 @@ function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, curr
3439
3451
  // user is not authenticated so we don't need to do anything that concerns an authenticated user
3440
3452
  return;
3441
3453
  }
3442
- // Logged-in user on a public route (e.g. shareable link) visiting another tenant
3443
- // — treat as visitor, skip tenant join/token/RBAC calls that will 403
3444
- if (userIsAccessingPublicRoute) {
3445
- saveVisitingTenant === null || saveVisitingTenant === void 0 ? void 0 : saveVisitingTenant(newCurrentTenant);
3446
- setIsLoading(false);
3447
- return;
3448
- }
3449
3454
  const { data: tenants } = await fetchUserTenants();
3450
3455
  const enhancedTenants = await enhanceTenants(tenants, data);
3451
3456
  saveUserTenants(enhancedTenants);
@@ -7088,7 +7093,6 @@ const useChat = ({ wsUrl, wsToken, flowConfig, sessionId, stopGenerationWsUrl, e
7088
7093
  MAX_INITIAL_WEBSOCKET_CONNECTION_ATTEMPTS;
7089
7094
  if (shouldShowError) {
7090
7095
  console.error("[ws-error] WebSocket connection error exceeded max attempts", {
7091
- error,
7092
7096
  wsUrl,
7093
7097
  tenant: flowConfig === null || flowConfig === void 0 ? void 0 : flowConfig.tenant,
7094
7098
  mentorId: flowConfig === null || flowConfig === void 0 ? void 0 : flowConfig.name,
@@ -7791,7 +7795,6 @@ const useChat = ({ wsUrl, wsToken, flowConfig, sessionId, stopGenerationWsUrl, e
7791
7795
  return;
7792
7796
  }
7793
7797
  console.error("[ws-error] WebSocket error on active connection", {
7794
- error,
7795
7798
  wsUrl,
7796
7799
  tenant: flowConfig === null || flowConfig === void 0 ? void 0 : flowConfig.tenant,
7797
7800
  mentorId: flowConfig === null || flowConfig === void 0 ? void 0 : flowConfig.name,
@@ -7806,7 +7809,7 @@ const useChat = ({ wsUrl, wsToken, flowConfig, sessionId, stopGenerationWsUrl, e
7806
7809
  onStreamingChange === null || onStreamingChange === void 0 ? void 0 : onStreamingChange(false);
7807
7810
  onStatusChange("error");
7808
7811
  });
7809
- socket.addEventListener("close", () => {
7812
+ socket.addEventListener("close", (event) => {
7810
7813
  isConnected.current = false;
7811
7814
  onStreamingChange === null || onStreamingChange === void 0 ? void 0 : onStreamingChange(false);
7812
7815
  // Don't retry or show error if we're offline in Tauri - this is expected
@@ -7820,7 +7823,11 @@ const useChat = ({ wsUrl, wsToken, flowConfig, sessionId, stopGenerationWsUrl, e
7820
7823
  // If this is an initial connection failure and we haven't exceeded max attempts
7821
7824
  if (isInitialConnection.current &&
7822
7825
  connectionAttempts.current < MAX_INITIAL_WEBSOCKET_CONNECTION_ATTEMPTS) {
7823
- console.log(`Initial connection closed, attempting retry ${connectionAttempts.current + 1}/${MAX_INITIAL_WEBSOCKET_CONNECTION_ATTEMPTS}`);
7826
+ console.log(`Initial connection closed, attempting retry ${connectionAttempts.current + 1}/${MAX_INITIAL_WEBSOCKET_CONNECTION_ATTEMPTS}`, {
7827
+ code: event === null || event === void 0 ? void 0 : event.code,
7828
+ reason: event === null || event === void 0 ? void 0 : event.reason,
7829
+ wasClean: event === null || event === void 0 ? void 0 : event.wasClean,
7830
+ });
7824
7831
  // Retry with exponential backoff
7825
7832
  const backoffDelay = Math.min(1000 * Math.pow(2, connectionAttempts.current), 5000);
7826
7833
  setTimeout(() => {
@@ -7836,6 +7843,9 @@ const useChat = ({ wsUrl, wsToken, flowConfig, sessionId, stopGenerationWsUrl, e
7836
7843
  connectionAttempts.current >=
7837
7844
  MAX_INITIAL_WEBSOCKET_CONNECTION_ATTEMPTS) {
7838
7845
  console.error("[ws-close] Failed to connect to the mentor after multiple attempts", {
7846
+ code: event === null || event === void 0 ? void 0 : event.code,
7847
+ reason: event === null || event === void 0 ? void 0 : event.reason,
7848
+ wasClean: event === null || event === void 0 ? void 0 : event.wasClean,
7839
7849
  wsUrl,
7840
7850
  tenant: flowConfig === null || flowConfig === void 0 ? void 0 : flowConfig.tenant,
7841
7851
  mentorId: flowConfig === null || flowConfig === void 0 ? void 0 : flowConfig.name,
@@ -13369,11 +13379,12 @@ Hook ${hookName} was either not provided or not a function.`);
13369
13379
  var createApi = /* @__PURE__ */ buildCreateApi(coreModule(), reactHooksModule());
13370
13380
 
13371
13381
  const STORAGE_KEYS = {
13372
- EDX_TOKEN_KEY: "edx_jwt_token",
13373
- DM_TOKEN_KEY: "dm_token",
13374
- AXD_TOKEN_KEY: "axd_token"};
13382
+ EDX_TOKEN_KEY: 'edx_jwt_token',
13383
+ DM_TOKEN_KEY: 'dm_token',
13384
+ AXD_TOKEN_KEY: 'axd_token'};
13375
13385
  var SERVICES;
13376
13386
  (function (SERVICES) {
13387
+ SERVICES["LEGACY_LMS"] = "LEGACY_LMS";
13377
13388
  SERVICES["LMS"] = "LMS";
13378
13389
  SERVICES["DM"] = "DM";
13379
13390
  SERVICES["AXD"] = "AXD";
@@ -13381,10 +13392,11 @@ var SERVICES;
13381
13392
 
13382
13393
  class Config {
13383
13394
  }
13384
- Config.lmsUrl = "https://learn.iblai.app";
13385
- Config.dmUrl = "https://base.manager.iblai.app";
13386
- Config.axdUrl = "https://base.manager.iblai.app";
13387
- Config.mentorIframeUrl = "https://mentor.iblai.tech";
13395
+ Config.legacyLmsUrl = 'https://learn.iblai.app';
13396
+ Config.lmsUrl = 'https://learn.iblai.app';
13397
+ Config.dmUrl = 'https://base.manager.iblai.app';
13398
+ Config.axdUrl = 'https://base.manager.iblai.app';
13399
+ Config.mentorIframeUrl = 'https://mentor.iblai.tech';
13388
13400
  Config.httpErrorHandlers = {};
13389
13401
 
13390
13402
  class IblDataLayer {
@@ -13445,6 +13457,8 @@ const iblFakeBaseQuery = retry(fakeBaseQueryWithLogging, {
13445
13457
  */
13446
13458
  const getServiceUrl = (service) => {
13447
13459
  switch (service) {
13460
+ case SERVICES.LEGACY_LMS:
13461
+ return Config.legacyLmsUrl;
13448
13462
  case SERVICES.LMS:
13449
13463
  return Config.lmsUrl;
13450
13464
  case SERVICES.DM:
@@ -13498,6 +13512,7 @@ const buildEndpointFromService = (service, serviceFn) => {
13498
13512
  try {
13499
13513
  iblaiApi.OpenAPI.BASE = getServiceUrl(service);
13500
13514
  iblaiApi.OpenAPI.HEADERS = await getHeaders(service);
13515
+ iblaiApi.OpenAPI.CREDENTIALS = service === SERVICES.LEGACY_LMS ? 'include' : 'omit';
13501
13516
  // API request initiated
13502
13517
  const data = await serviceFn(args);
13503
13518
  // API response received
@@ -13533,6 +13548,7 @@ const isErrorObject = (data) => {
13533
13548
  const baseQuery = (service, jsonContentType = true, contentType, skipAuth = false) => fetchBaseQuery({
13534
13549
  baseUrl: getServiceUrl(service),
13535
13550
  timeout: 30000, // 30 second timeout
13551
+ credentials: service === SERVICES.LEGACY_LMS ? 'include' : 'omit',
13536
13552
  prepareHeaders: async (headers) => {
13537
13553
  // Only add auth headers if skipAuth is false
13538
13554
  if (!skipAuth) {
@@ -13646,6 +13662,7 @@ const buildEndpointFromServiceLegacy = (service, serviceFn) => {
13646
13662
  try {
13647
13663
  iblaiApi.OpenAPI.BASE = getServiceUrl(service);
13648
13664
  iblaiApi.OpenAPI.HEADERS = await getHeaders(service);
13665
+ iblaiApi.OpenAPI.CREDENTIALS = service === SERVICES.LEGACY_LMS ? 'include' : 'omit';
13649
13666
  const data = await serviceFn(...args);
13650
13667
  return { data };
13651
13668
  }
@@ -14152,7 +14169,7 @@ const AUTH_ENDPOINTS = {
14152
14169
  path: () => '/api/ibl/manager/consolidated-token/proxy/',
14153
14170
  },
14154
14171
  REFRESH_JWT_TOKEN: {
14155
- service: SERVICES.LMS,
14172
+ service: SERVICES.LEGACY_LMS,
14156
14173
  path: () => '/ibl-auth/request-jwt/',
14157
14174
  },
14158
14175
  };
@@ -14186,14 +14203,12 @@ createApi({
14186
14203
  isJson: false,
14187
14204
  method: 'POST',
14188
14205
  body: formData,
14189
- credentials: 'include',
14190
14206
  }),
14191
14207
  }),
14192
14208
  refreshJwtToken: builder.query({
14193
14209
  query: () => ({
14194
14210
  url: AUTH_ENDPOINTS.REFRESH_JWT_TOKEN.path(),
14195
14211
  service: AUTH_ENDPOINTS.REFRESH_JWT_TOKEN.service,
14196
- credentials: 'include',
14197
14212
  }),
14198
14213
  }),
14199
14214
  }),
@@ -14227,10 +14242,10 @@ createApi({
14227
14242
  try {
14228
14243
  const authHeaders = await getHeaders(SERVICES.LMS);
14229
14244
  const response = await fetch(`${Config.lmsUrl}${TENANTS_ENDPOINTS.GET_USER_TENANTS.path()}`, {
14230
- credentials: 'include',
14231
14245
  headers: {
14232
14246
  ...authHeaders,
14233
14247
  },
14248
+ credentials: 'omit',
14234
14249
  });
14235
14250
  if (!response.ok) {
14236
14251
  return {
@@ -14316,6 +14331,7 @@ createApi({
14316
14331
  const response = await fetch(url, {
14317
14332
  method: 'GET',
14318
14333
  headers: iblaiApi.OpenAPI.HEADERS,
14334
+ credentials: 'omit',
14319
14335
  });
14320
14336
  if (!response.ok) {
14321
14337
  const error = new Error('Failed to fetch platform users');
@@ -14350,6 +14366,7 @@ createApi({
14350
14366
  const response = await fetch(url, {
14351
14367
  method: 'GET',
14352
14368
  headers: iblaiApi.OpenAPI.HEADERS,
14369
+ credentials: 'omit',
14353
14370
  });
14354
14371
  if (!response.ok) {
14355
14372
  const error = new Error('Failed to fetch team details');
@@ -14371,6 +14388,7 @@ createApi({
14371
14388
  'Content-Type': 'application/json',
14372
14389
  },
14373
14390
  body: JSON.stringify(args.requestBody),
14391
+ credentials: 'omit',
14374
14392
  });
14375
14393
  if (!response.ok) {
14376
14394
  const error = new Error('Failed to update platform user role with policies');
@@ -14596,6 +14614,7 @@ createApi({
14596
14614
  const response = await fetch(url, {
14597
14615
  method: 'GET',
14598
14616
  headers: iblaiApi.OpenAPI.HEADERS,
14617
+ credentials: 'omit',
14599
14618
  });
14600
14619
  if (!response.ok) {
14601
14620
  const error = new Error('Failed to fetch RBAC group details');
@@ -14632,6 +14651,7 @@ createApi({
14632
14651
  const response = await fetch(url, {
14633
14652
  method: 'GET',
14634
14653
  headers: iblaiApi.OpenAPI.HEADERS,
14654
+ credentials: 'omit',
14635
14655
  });
14636
14656
  if (!response.ok) {
14637
14657
  const error = new Error('Failed to fetch RBAC policy details');
@@ -14672,6 +14692,7 @@ createApi({
14672
14692
  const response = await fetch(url, {
14673
14693
  method: 'GET',
14674
14694
  headers: iblaiApi.OpenAPI.HEADERS,
14695
+ credentials: 'omit',
14675
14696
  });
14676
14697
  if (!response.ok) {
14677
14698
  const error = new Error('Failed to fetch RBAC role details');
@@ -14782,6 +14803,7 @@ createApi({
14782
14803
  const response = await fetch(url, {
14783
14804
  method: 'GET',
14784
14805
  headers: iblaiApi.OpenAPI.HEADERS,
14806
+ credentials: 'omit',
14785
14807
  });
14786
14808
  if (!response.ok) {
14787
14809
  const error = new Error('Failed to fetch credentials');
@@ -15757,6 +15779,7 @@ createApi({
15757
15779
  const response = await fetch(url, {
15758
15780
  method: 'GET',
15759
15781
  headers: iblaiApi.OpenAPI.HEADERS,
15782
+ credentials: 'omit',
15760
15783
  });
15761
15784
  if (!response.ok) {
15762
15785
  const error = new Error('Failed to fetch program invitations');
@@ -15857,6 +15880,7 @@ const performCareerRequest = async (path, options = {}) => {
15857
15880
  method: (_b = options.method) !== null && _b !== void 0 ? _b : 'GET',
15858
15881
  body: (_c = options.body) !== null && _c !== void 0 ? _c : null,
15859
15882
  headers,
15883
+ credentials: 'omit',
15860
15884
  });
15861
15885
  if (!response.ok) {
15862
15886
  const errorData = await parseResponse(response);
@@ -17429,6 +17453,182 @@ createApi({
17429
17453
  }),
17430
17454
  });
17431
17455
 
17456
+ const WORKFLOWS_REDUCER_PATH = 'workflowsApiSlice';
17457
+ const WORKFLOWS_ENDPOINTS = {
17458
+ LIST: {
17459
+ service: SERVICES.AXD,
17460
+ path: (org) => `/api/ai-mentor/orgs/${org}/workflows/`,
17461
+ },
17462
+ CREATE: {
17463
+ service: SERVICES.AXD,
17464
+ path: (org) => `/api/ai-mentor/orgs/${org}/workflows/`,
17465
+ },
17466
+ RETRIEVE: {
17467
+ service: SERVICES.AXD,
17468
+ path: (org, uniqueId) => `/api/ai-mentor/orgs/${org}/workflows/${uniqueId}/`,
17469
+ },
17470
+ UPDATE: {
17471
+ service: SERVICES.AXD,
17472
+ path: (org, uniqueId) => `/api/ai-mentor/orgs/${org}/workflows/${uniqueId}/`,
17473
+ },
17474
+ DELETE: {
17475
+ service: SERVICES.AXD,
17476
+ path: (org, uniqueId) => `/api/ai-mentor/orgs/${org}/workflows/${uniqueId}/`,
17477
+ },
17478
+ ACTIVATE: {
17479
+ service: SERVICES.AXD,
17480
+ path: (org, uniqueId) => `/api/ai-mentor/orgs/${org}/workflows/${uniqueId}/activate/`,
17481
+ },
17482
+ DEACTIVATE: {
17483
+ service: SERVICES.AXD,
17484
+ path: (org, uniqueId) => `/api/ai-mentor/orgs/${org}/workflows/${uniqueId}/deactivate/`,
17485
+ },
17486
+ PUBLISH: {
17487
+ service: SERVICES.AXD,
17488
+ path: (org, uniqueId) => `/api/ai-mentor/orgs/${org}/workflows/${uniqueId}/publish/`,
17489
+ },
17490
+ UNPUBLISH: {
17491
+ service: SERVICES.AXD,
17492
+ path: (org, uniqueId) => `/api/ai-mentor/orgs/${org}/workflows/${uniqueId}/unpublish/`,
17493
+ },
17494
+ VALIDATE: {
17495
+ service: SERVICES.AXD,
17496
+ path: (org, uniqueId) => `/api/ai-mentor/orgs/${org}/workflows/${uniqueId}/validate/`,
17497
+ },
17498
+ CHAT: {
17499
+ service: SERVICES.AXD,
17500
+ path: (org, uniqueId) => `/api/ai-mentor/orgs/${org}/workflows/${uniqueId}/chat/`,
17501
+ },
17502
+ NODE_TYPES: {
17503
+ service: SERVICES.AXD,
17504
+ path: (org) => `/api/ai-mentor/orgs/${org}/workflows/node-types/`,
17505
+ },
17506
+ };
17507
+ const WORKFLOWS_QUERY_KEYS = {
17508
+ LIST: () => ['WORKFLOWS'],
17509
+ DETAILS: () => ['WORKFLOW_DETAILS'],
17510
+ NODE_TYPES: () => ['WORKFLOW_NODE_TYPES'],
17511
+ };
17512
+
17513
+ createApi({
17514
+ reducerPath: WORKFLOWS_REDUCER_PATH,
17515
+ tagTypes: [
17516
+ ...WORKFLOWS_QUERY_KEYS.LIST(),
17517
+ ...WORKFLOWS_QUERY_KEYS.DETAILS(),
17518
+ ...WORKFLOWS_QUERY_KEYS.NODE_TYPES(),
17519
+ ],
17520
+ baseQuery: iblFetchBaseQuery,
17521
+ endpoints: (builder) => ({
17522
+ getWorkflows: builder.query({
17523
+ query: ({ org, params }) => ({
17524
+ url: WORKFLOWS_ENDPOINTS.LIST.path(org),
17525
+ params,
17526
+ service: WORKFLOWS_ENDPOINTS.LIST.service,
17527
+ }),
17528
+ providesTags: WORKFLOWS_QUERY_KEYS.LIST(),
17529
+ }),
17530
+ getWorkflow: builder.query({
17531
+ query: ({ org, uniqueId }) => ({
17532
+ url: WORKFLOWS_ENDPOINTS.RETRIEVE.path(org, uniqueId),
17533
+ service: WORKFLOWS_ENDPOINTS.RETRIEVE.service,
17534
+ }),
17535
+ providesTags: WORKFLOWS_QUERY_KEYS.DETAILS(),
17536
+ }),
17537
+ createWorkflow: builder.mutation({
17538
+ query: ({ org, data }) => ({
17539
+ url: WORKFLOWS_ENDPOINTS.CREATE.path(org),
17540
+ method: 'POST',
17541
+ body: data,
17542
+ service: WORKFLOWS_ENDPOINTS.CREATE.service,
17543
+ }),
17544
+ invalidatesTags: WORKFLOWS_QUERY_KEYS.LIST(),
17545
+ }),
17546
+ // Full update (PUT) - replaces entire workflow
17547
+ updateWorkflow: builder.mutation({
17548
+ query: ({ org, uniqueId, data }) => ({
17549
+ url: WORKFLOWS_ENDPOINTS.UPDATE.path(org, uniqueId),
17550
+ method: 'PUT',
17551
+ body: data,
17552
+ service: WORKFLOWS_ENDPOINTS.UPDATE.service,
17553
+ }),
17554
+ invalidatesTags: [...WORKFLOWS_QUERY_KEYS.LIST(), ...WORKFLOWS_QUERY_KEYS.DETAILS()],
17555
+ }),
17556
+ // Partial update (PATCH) - updates only provided fields
17557
+ patchWorkflow: builder.mutation({
17558
+ query: ({ org, uniqueId, data }) => ({
17559
+ url: WORKFLOWS_ENDPOINTS.UPDATE.path(org, uniqueId),
17560
+ method: 'PATCH',
17561
+ body: data,
17562
+ service: WORKFLOWS_ENDPOINTS.UPDATE.service,
17563
+ }),
17564
+ invalidatesTags: [...WORKFLOWS_QUERY_KEYS.LIST(), ...WORKFLOWS_QUERY_KEYS.DETAILS()],
17565
+ }),
17566
+ deleteWorkflow: builder.mutation({
17567
+ query: ({ org, uniqueId }) => ({
17568
+ url: WORKFLOWS_ENDPOINTS.DELETE.path(org, uniqueId),
17569
+ method: 'DELETE',
17570
+ service: WORKFLOWS_ENDPOINTS.DELETE.service,
17571
+ }),
17572
+ invalidatesTags: WORKFLOWS_QUERY_KEYS.LIST(),
17573
+ }),
17574
+ activateWorkflow: builder.mutation({
17575
+ query: ({ org, uniqueId }) => ({
17576
+ url: WORKFLOWS_ENDPOINTS.ACTIVATE.path(org, uniqueId),
17577
+ method: 'POST',
17578
+ service: WORKFLOWS_ENDPOINTS.ACTIVATE.service,
17579
+ }),
17580
+ invalidatesTags: [...WORKFLOWS_QUERY_KEYS.LIST(), ...WORKFLOWS_QUERY_KEYS.DETAILS()],
17581
+ }),
17582
+ deactivateWorkflow: builder.mutation({
17583
+ query: ({ org, uniqueId }) => ({
17584
+ url: WORKFLOWS_ENDPOINTS.DEACTIVATE.path(org, uniqueId),
17585
+ method: 'POST',
17586
+ service: WORKFLOWS_ENDPOINTS.DEACTIVATE.service,
17587
+ }),
17588
+ invalidatesTags: [...WORKFLOWS_QUERY_KEYS.LIST(), ...WORKFLOWS_QUERY_KEYS.DETAILS()],
17589
+ }),
17590
+ publishWorkflow: builder.mutation({
17591
+ query: ({ org, uniqueId, data }) => ({
17592
+ url: WORKFLOWS_ENDPOINTS.PUBLISH.path(org, uniqueId),
17593
+ method: 'POST',
17594
+ body: data,
17595
+ service: WORKFLOWS_ENDPOINTS.PUBLISH.service,
17596
+ }),
17597
+ invalidatesTags: [...WORKFLOWS_QUERY_KEYS.LIST(), ...WORKFLOWS_QUERY_KEYS.DETAILS()],
17598
+ }),
17599
+ unpublishWorkflow: builder.mutation({
17600
+ query: ({ org, uniqueId }) => ({
17601
+ url: WORKFLOWS_ENDPOINTS.UNPUBLISH.path(org, uniqueId),
17602
+ method: 'POST',
17603
+ service: WORKFLOWS_ENDPOINTS.UNPUBLISH.service,
17604
+ }),
17605
+ invalidatesTags: [...WORKFLOWS_QUERY_KEYS.LIST(), ...WORKFLOWS_QUERY_KEYS.DETAILS()],
17606
+ }),
17607
+ validateWorkflow: builder.mutation({
17608
+ query: ({ org, uniqueId }) => ({
17609
+ url: WORKFLOWS_ENDPOINTS.VALIDATE.path(org, uniqueId),
17610
+ method: 'POST',
17611
+ service: WORKFLOWS_ENDPOINTS.VALIDATE.service,
17612
+ }),
17613
+ }),
17614
+ chatWithWorkflow: builder.mutation({
17615
+ query: ({ org, uniqueId, message }) => ({
17616
+ url: WORKFLOWS_ENDPOINTS.CHAT.path(org, uniqueId),
17617
+ method: 'POST',
17618
+ body: { message },
17619
+ service: WORKFLOWS_ENDPOINTS.CHAT.service,
17620
+ }),
17621
+ }),
17622
+ getNodeTypes: builder.query({
17623
+ query: ({ org }) => ({
17624
+ url: WORKFLOWS_ENDPOINTS.NODE_TYPES.path(org),
17625
+ service: WORKFLOWS_ENDPOINTS.NODE_TYPES.service,
17626
+ }),
17627
+ providesTags: WORKFLOWS_QUERY_KEYS.NODE_TYPES(),
17628
+ }),
17629
+ }),
17630
+ });
17631
+
17432
17632
  function useMentorSettings({ mentorId, tenantKey, username, isPublicRoute, }) {
17433
17633
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
17434
17634
  const isLoggedIn = username !== ANONYMOUS_USERNAME;