flowcore-fn 9.5.3 → 10.1.2

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.
@@ -3771,47 +3771,85 @@ function WorkFlowTransition() {
3771
3771
 
3772
3772
  // src/components/user-hierarchy-node-mapping/user_hierarachy_node_main.jsx
3773
3773
  import React27, { useState as useState19, useRef as useRef6, useEffect as useEffect15 } from "react";
3774
- import Swal9 from "sweetalert2";
3774
+ import Swal10 from "sweetalert2";
3775
3775
 
3776
3776
  // src/components/user-hierarchy-node-mapping/adduserhierarchynode.jsx
3777
3777
  import React22, { useEffect as useEffect12, useState as useState16 } from "react";
3778
+ import Swal9 from "sweetalert2";
3778
3779
  import { jsx as jsx22, jsxs as jsxs21 } from "react/jsx-runtime";
3779
3780
  function AddUserHierarchyNodeMappingModal({
3780
3781
  isOpen,
3781
3782
  onClose,
3782
3783
  onSave
3783
3784
  }) {
3784
- const [formData, setFormData] = useState16({ mappingId: "", externalUserId: "", hierarchyNodeId: "", roleCode: "", isPrimary: "", effectiveFrom: "", effectiveTo: "" });
3785
+ const [formData, setFormData] = useState16({ mappingId: "", externalUserId: "", workflowStepId: "", hierarchyNodeId: "", roleCode: "", isPrimary: "", effectiveFrom: "", effectiveTo: "" });
3785
3786
  const [isSubmitting, setIsSubmitting] = useState16(false);
3786
3787
  const [hierarchyNodes, setHierarchyNodes] = useState16([]);
3788
+ const [workflowSteps, setWorkflowSteps] = useState16([]);
3787
3789
  const [isLoadingHierarchyNodes, setIsLoadingHierarchyNodes] = useState16(false);
3790
+ const [isLoadingWorkflowSteps, setIsLoadingWorkflowSteps] = useState16(false);
3788
3791
  const [hierarchyNodesError, setHierarchyNodesError] = useState16("");
3792
+ const [workflowStepsError, setWorkflowStepsError] = useState16("");
3789
3793
  useEffect12(() => {
3790
3794
  if (!isOpen) return;
3791
- const loadHierarchyNodes = async () => {
3792
- var _a, _b, _c, _d, _e, _f, _g;
3795
+ const loadData = async () => {
3796
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
3797
+ const flowCore = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore;
3798
+ const hierarchyEndpoint = (_b = flowCore == null ? void 0 : flowCore.hierarchyNode) == null ? void 0 : _b.getList;
3799
+ const workflowStepEndpoint = ((_c = flowCore == null ? void 0 : flowCore.workflowStep) == null ? void 0 : _c.getList) || ((_d = flowCore == null ? void 0 : flowCore.WorkFlowStep) == null ? void 0 : _d.getList) || ((_e = flowCore == null ? void 0 : flowCore.workFlowStep) == null ? void 0 : _e.getList);
3793
3800
  setIsLoadingHierarchyNodes(true);
3801
+ setIsLoadingWorkflowSteps(true);
3794
3802
  setHierarchyNodesError("");
3803
+ setWorkflowStepsError("");
3795
3804
  try {
3796
- const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.hierarchyNode) == null ? void 0 : _c.getList;
3797
- if (!endpoint) throw new Error("Hierarchy node list endpoint is not configured.");
3798
- const result = await getApiService().get(endpoint);
3799
- const value = ((_d = result == null ? void 0 : result.data) == null ? void 0 : _d.data) || ((_e = result == null ? void 0 : result.data) == null ? void 0 : _e.result) || (result == null ? void 0 : result.data) || result;
3800
- setHierarchyNodes(Array.isArray(value) ? value : (value == null ? void 0 : value.items) || (value == null ? void 0 : value.records) || []);
3805
+ const [hierarchyResult, workflowStepResult] = await Promise.all([
3806
+ hierarchyEndpoint ? getApiService().get(hierarchyEndpoint) : Promise.resolve(null),
3807
+ workflowStepEndpoint ? getApiService().get(workflowStepEndpoint) : Promise.resolve(null)
3808
+ ]);
3809
+ const hierarchyValue = ((_f = hierarchyResult == null ? void 0 : hierarchyResult.data) == null ? void 0 : _f.data) || ((_g = hierarchyResult == null ? void 0 : hierarchyResult.data) == null ? void 0 : _g.result) || (hierarchyResult == null ? void 0 : hierarchyResult.data) || hierarchyResult;
3810
+ const workflowStepValue = ((_h = workflowStepResult == null ? void 0 : workflowStepResult.data) == null ? void 0 : _h.data) || ((_i = workflowStepResult == null ? void 0 : workflowStepResult.data) == null ? void 0 : _i.result) || (workflowStepResult == null ? void 0 : workflowStepResult.data) || workflowStepResult;
3811
+ setHierarchyNodes(Array.isArray(hierarchyValue) ? hierarchyValue : (hierarchyValue == null ? void 0 : hierarchyValue.items) || (hierarchyValue == null ? void 0 : hierarchyValue.records) || []);
3812
+ setWorkflowSteps(Array.isArray(workflowStepValue) ? workflowStepValue : (workflowStepValue == null ? void 0 : workflowStepValue.items) || (workflowStepValue == null ? void 0 : workflowStepValue.records) || []);
3801
3813
  } catch (error) {
3802
3814
  setHierarchyNodes([]);
3803
- setHierarchyNodesError(((_g = (_f = error == null ? void 0 : error.response) == null ? void 0 : _f.data) == null ? void 0 : _g.message) || (error == null ? void 0 : error.message) || "Unable to load hierarchy nodes.");
3815
+ setWorkflowSteps([]);
3816
+ setHierarchyNodesError(((_k = (_j = error == null ? void 0 : error.response) == null ? void 0 : _j.data) == null ? void 0 : _k.message) || (error == null ? void 0 : error.message) || "Unable to load hierarchy nodes.");
3817
+ setWorkflowStepsError(((_m = (_l = error == null ? void 0 : error.response) == null ? void 0 : _l.data) == null ? void 0 : _m.message) || (error == null ? void 0 : error.message) || "Unable to load workflow steps.");
3804
3818
  } finally {
3805
3819
  setIsLoadingHierarchyNodes(false);
3820
+ setIsLoadingWorkflowSteps(false);
3806
3821
  }
3807
3822
  };
3808
- loadHierarchyNodes();
3823
+ loadData();
3809
3824
  }, [isOpen]);
3825
+ const toApiDateTime = (value) => {
3826
+ if (!value) return null;
3827
+ if (typeof value === "string" && value.includes("T")) {
3828
+ const parsed = new Date(value);
3829
+ return Number.isNaN(parsed.getTime()) ? null : parsed.toISOString();
3830
+ }
3831
+ const [year, month, day] = value.split("-").map(Number);
3832
+ if (!year || !month || !day) return null;
3833
+ return new Date(Date.UTC(year, month - 1, day, 0, 0, 0, 0)).toISOString();
3834
+ };
3810
3835
  const handleChange = (event) => setFormData((previous) => __spreadProps(__spreadValues({}, previous), { [event.target.name]: event.target.value }));
3811
3836
  const handleSave = async () => {
3812
3837
  if (!onSave) return;
3838
+ if (!formData.workflowStepId) {
3839
+ await Swal9.fire("Required field", "Please select a workflow step.", "warning");
3840
+ return;
3841
+ }
3813
3842
  setIsSubmitting(true);
3814
- const success = await onSave({ externalUserId: Number(formData.externalUserId), hierarchyNodeId: Number(formData.hierarchyNodeId), roleCode: formData.roleCode, isPrimary: formData.isPrimary === "true", effectiveFrom: formData.effectiveFrom, effectiveTo: formData.effectiveTo || null, createdBy: "System" });
3843
+ const success = await onSave({
3844
+ externalUserId: Number(formData.externalUserId),
3845
+ workflowStepId: Number(formData.workflowStepId),
3846
+ hierarchyNodeId: Number(formData.hierarchyNodeId),
3847
+ roleCode: formData.roleCode,
3848
+ isPrimary: formData.isPrimary === "true",
3849
+ effectiveFrom: toApiDateTime(formData.effectiveFrom),
3850
+ effectiveTo: toApiDateTime(formData.effectiveTo),
3851
+ createdBy: "System"
3852
+ });
3815
3853
  setIsSubmitting(false);
3816
3854
  if (success) onClose();
3817
3855
  };
@@ -3853,6 +3891,25 @@ function AddUserHierarchyNodeMappingModal({
3853
3891
  /* @__PURE__ */ jsx22("p", { className: "fc:text-[10px] fc:text-slate-400 fc:mt-1", children: "Enter the consumer user ID" })
3854
3892
  ] })
3855
3893
  ] }),
3894
+ /* @__PURE__ */ jsxs21("div", { children: [
3895
+ /* @__PURE__ */ jsxs21("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
3896
+ "Workflow Step ",
3897
+ /* @__PURE__ */ jsx22("span", { className: "fc:text-red-500", children: "*" })
3898
+ ] }),
3899
+ /* @__PURE__ */ jsxs21("select", { name: "workflowStepId", value: formData.workflowStepId, onChange: handleChange, disabled: isLoadingWorkflowSteps, className: "fc:w-full fc:p-2.5 fc:border fc:border-slate-200 fc:rounded-xl fc:text-xs fc:bg-white fc:text-slate-700 disabled:fc:fc:bg-slate-100 disabled:fc:fc:cursor-not-allowed focus:fc:fc:outline-none focus:fc:fc:ring-2 focus:fc:fc:ring-indigo-500/10 focus:fc:fc:border-indigo-500", children: [
3900
+ /* @__PURE__ */ jsx22("option", { value: "", children: isLoadingWorkflowSteps ? "Loading workflow steps..." : "Select workflow step" }),
3901
+ workflowSteps.map((step) => {
3902
+ var _a, _b, _c, _d, _e, _f;
3903
+ const id = (_b = (_a = step.workflowStepId) != null ? _a : step.WorkflowStepId) != null ? _b : step.id;
3904
+ const name = (_f = (_e = (_d = (_c = step.stepName) != null ? _c : step.StepName) != null ? _d : step.name) != null ? _e : step.workflowStepName) != null ? _f : step.WorkflowStepName;
3905
+ return /* @__PURE__ */ jsxs21("option", { value: id, children: [
3906
+ id,
3907
+ name ? ` - ${name}` : ""
3908
+ ] }, id);
3909
+ })
3910
+ ] }),
3911
+ /* @__PURE__ */ jsx22("p", { className: `fc:text-[10px] fc:mt-1 ${workflowStepsError ? "fc:text-red-500" : "fc:text-slate-400"}`, children: workflowStepsError || "Select the workflow step for this mapping" })
3912
+ ] }),
3856
3913
  /* @__PURE__ */ jsxs21("div", { children: [
3857
3914
  /* @__PURE__ */ jsxs21("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
3858
3915
  "Hierarchy Node ID ",
@@ -3957,15 +4014,47 @@ function EditUserHierarchyNodeMappingModal({
3957
4014
  onSave
3958
4015
  }) {
3959
4016
  const [formData, setFormData] = useState17({
4017
+ workflowStepId: "",
3960
4018
  hierarchyNodeId: "",
3961
4019
  roleCode: "",
3962
4020
  isPrimary: "",
3963
4021
  effectiveFrom: "",
3964
4022
  effectiveTo: ""
3965
4023
  });
4024
+ const [workflowSteps, setWorkflowSteps] = useState17([]);
4025
+ const [isLoadingWorkflowSteps, setIsLoadingWorkflowSteps] = useState17(false);
4026
+ const [workflowStepsError, setWorkflowStepsError] = useState17("");
3966
4027
  useEffect13(() => {
4028
+ if (!isOpen) return;
4029
+ const loadWorkflowSteps = async () => {
4030
+ var _a, _b, _c, _d, _e, _f, _g, _h;
4031
+ const flowCore = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore;
4032
+ const workflowStepEndpoint = ((_b = flowCore == null ? void 0 : flowCore.workflowStep) == null ? void 0 : _b.getList) || ((_c = flowCore == null ? void 0 : flowCore.WorkFlowStep) == null ? void 0 : _c.getList) || ((_d = flowCore == null ? void 0 : flowCore.workFlowStep) == null ? void 0 : _d.getList);
4033
+ if (!workflowStepEndpoint) {
4034
+ setWorkflowSteps([]);
4035
+ setWorkflowStepsError("Workflow step list endpoint is not configured.");
4036
+ return;
4037
+ }
4038
+ setIsLoadingWorkflowSteps(true);
4039
+ setWorkflowStepsError("");
4040
+ try {
4041
+ const result = await getApiService().get(workflowStepEndpoint);
4042
+ const value = ((_e = result == null ? void 0 : result.data) == null ? void 0 : _e.data) || ((_f = result == null ? void 0 : result.data) == null ? void 0 : _f.result) || (result == null ? void 0 : result.data) || result;
4043
+ setWorkflowSteps(Array.isArray(value) ? value : (value == null ? void 0 : value.items) || (value == null ? void 0 : value.records) || []);
4044
+ } catch (error) {
4045
+ setWorkflowSteps([]);
4046
+ setWorkflowStepsError(((_h = (_g = error == null ? void 0 : error.response) == null ? void 0 : _g.data) == null ? void 0 : _h.message) || (error == null ? void 0 : error.message) || "Unable to load workflow steps.");
4047
+ } finally {
4048
+ setIsLoadingWorkflowSteps(false);
4049
+ }
4050
+ };
4051
+ loadWorkflowSteps();
4052
+ }, [isOpen]);
4053
+ useEffect13(() => {
4054
+ var _a, _b;
3967
4055
  if (selectedMapping) {
3968
4056
  setFormData({
4057
+ workflowStepId: (_b = (_a = selectedMapping.workflowStepId) != null ? _a : selectedMapping.WorkflowStepId) != null ? _b : "",
3969
4058
  hierarchyNodeId: selectedMapping.hierarchyNodeId || "",
3970
4059
  roleCode: selectedMapping.roleCode || "",
3971
4060
  isPrimary: selectedMapping.isPrimary === true || selectedMapping.isPrimary === 1 || selectedMapping.isPrimary === "1" || selectedMapping.isPrimary === "Yes" ? "true" : "false",
@@ -3981,18 +4070,33 @@ function EditUserHierarchyNodeMappingModal({
3981
4070
  [name]: value
3982
4071
  }));
3983
4072
  };
4073
+ const toApiDateTime = (value) => {
4074
+ if (!value) return null;
4075
+ if (typeof value === "string" && value.includes("T")) {
4076
+ const parsed = new Date(value);
4077
+ return Number.isNaN(parsed.getTime()) ? null : parsed.toISOString();
4078
+ }
4079
+ const [year, month, day] = value.split("-").map(Number);
4080
+ if (!year || !month || !day) return null;
4081
+ return new Date(Date.UTC(year, month - 1, day, 0, 0, 0, 0)).toISOString();
4082
+ };
3984
4083
  const handleSubmit = async (event) => {
3985
4084
  var _a, _b, _c;
3986
4085
  event.preventDefault();
4086
+ if (!formData.workflowStepId) {
4087
+ alert("Please select a workflow step.");
4088
+ return;
4089
+ }
3987
4090
  if (onSave) {
3988
4091
  const success = await onSave({
3989
4092
  mappingId: Number((_a = selectedMapping.mappingId) != null ? _a : selectedMapping.id),
3990
4093
  externalUserId: Number(selectedMapping.externalUserId),
4094
+ workflowStepId: Number(formData.workflowStepId),
3991
4095
  hierarchyNodeId: Number(formData.hierarchyNodeId),
3992
4096
  roleCode: formData.roleCode,
3993
4097
  isPrimary: formData.isPrimary === "true",
3994
- effectiveFrom: formData.effectiveFrom,
3995
- effectiveTo: formData.effectiveTo || null,
4098
+ effectiveFrom: toApiDateTime(formData.effectiveFrom),
4099
+ effectiveTo: toApiDateTime(formData.effectiveTo),
3996
4100
  isActive: (_c = (_b = selectedMapping.isActive) != null ? _b : selectedMapping.status) != null ? _c : true,
3997
4101
  updatedBy: selectedMapping.updatedBy || selectedMapping.createdBy || "System"
3998
4102
  });
@@ -4054,6 +4158,32 @@ function EditUserHierarchyNodeMappingModal({
4054
4158
  /* @__PURE__ */ jsx24("span", { children: "Edit Mapping" })
4055
4159
  ] }),
4056
4160
  /* @__PURE__ */ jsxs23("div", { className: "fc:grid fc:grid-cols-1 fc:gap-5 fc:md:grid-cols-2", children: [
4161
+ /* @__PURE__ */ jsxs23("div", { children: [
4162
+ /* @__PURE__ */ jsx24("label", { className: "mb-1.5 block text-xs font-bold text-slate-700", children: "Workflow Step" }),
4163
+ /* @__PURE__ */ jsxs23(
4164
+ "select",
4165
+ {
4166
+ name: "workflowStepId",
4167
+ value: formData.workflowStepId,
4168
+ onChange: handleChange,
4169
+ disabled: isLoadingWorkflowSteps,
4170
+ className: "fc:w-full fc:rounded-xl fc:border fc:border-slate-200 fc:bg-white fc:p-2.5 fc:text-xs fc:text-slate-700 fc:focus:border-indigo-500 fc:focus:outline-none fc:focus:ring-2 fc:focus:ring-indigo-500/10 disabled:fc:bg-slate-100 disabled:fc:cursor-not-allowed",
4171
+ children: [
4172
+ /* @__PURE__ */ jsx24("option", { value: "", children: isLoadingWorkflowSteps ? "Loading workflow steps..." : "Select workflow step" }),
4173
+ workflowSteps.map((step) => {
4174
+ var _a, _b, _c, _d, _e, _f;
4175
+ const id = (_b = (_a = step.workflowStepId) != null ? _a : step.WorkflowStepId) != null ? _b : step.id;
4176
+ const name = (_f = (_e = (_d = (_c = step.stepName) != null ? _c : step.StepName) != null ? _d : step.name) != null ? _e : step.workflowStepName) != null ? _f : step.WorkflowStepName;
4177
+ return /* @__PURE__ */ jsxs23("option", { value: id, children: [
4178
+ id,
4179
+ name ? ` - ${name}` : ""
4180
+ ] }, id);
4181
+ })
4182
+ ]
4183
+ }
4184
+ ),
4185
+ workflowStepsError ? /* @__PURE__ */ jsx24("p", { className: "fc:mt-1 fc:text-[10px] fc:text-red-500", children: workflowStepsError }) : null
4186
+ ] }),
4057
4187
  /* @__PURE__ */ jsxs23("div", { children: [
4058
4188
  /* @__PURE__ */ jsx24("label", { className: "mb-1.5 block text-xs font-bold text-slate-700", children: "Hierarchy Node ID" }),
4059
4189
  /* @__PURE__ */ jsx24(
@@ -4371,7 +4501,7 @@ function User_hierarchy_mapping_main() {
4371
4501
  const value = ((_d = result == null ? void 0 : result.data) == null ? void 0 : _d.data) || ((_e = result == null ? void 0 : result.data) == null ? void 0 : _e.result) || (result == null ? void 0 : result.data) || result;
4372
4502
  setApiData(Array.isArray(value) ? value : (value == null ? void 0 : value.items) || (value == null ? void 0 : value.records) || []);
4373
4503
  } catch (error) {
4374
- await Swal9.fire("Error", ((_g = (_f = error == null ? void 0 : error.response) == null ? void 0 : _f.data) == null ? void 0 : _g.message) || (error == null ? void 0 : error.message) || "Unable to load Workflow Step Hierarchy Mappings.", "error");
4504
+ await Swal10.fire("Error", ((_g = (_f = error == null ? void 0 : error.response) == null ? void 0 : _f.data) == null ? void 0 : _g.message) || (error == null ? void 0 : error.message) || "Unable to load Workflow Step Hierarchy Mappings.", "error");
4375
4505
  }
4376
4506
  })();
4377
4507
  }, [refreshkey]);
@@ -4394,11 +4524,11 @@ function User_hierarchy_mapping_main() {
4394
4524
  const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.WorkflowStepUserMapping) == null ? void 0 : _c[isEdit ? "update" : "create"];
4395
4525
  if (!endpoint) throw new Error(`Workflow Step Hierarchy Mapping ${isEdit ? "update" : "create"} endpoint is not configured.`);
4396
4526
  await getApiService()[isEdit ? "put" : "post"](endpoint, payload);
4397
- await Swal9.fire("Success", `Workflow Step Hierarchy Mapping ${isEdit ? "updated" : "created"} successfully.`, "success");
4527
+ await Swal10.fire("Success", `Workflow Step Hierarchy Mapping ${isEdit ? "updated" : "created"} successfully.`, "success");
4398
4528
  handleRefresh();
4399
4529
  return true;
4400
4530
  } catch (error) {
4401
- await Swal9.fire("Error", ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || `Unable to ${isEdit ? "update" : "create"} Workflow Step Hierarchy Mapping.`, "error");
4531
+ await Swal10.fire("Error", ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || `Unable to ${isEdit ? "update" : "create"} Workflow Step Hierarchy Mapping.`, "error");
4402
4532
  return false;
4403
4533
  }
4404
4534
  };
@@ -4440,7 +4570,7 @@ function User_hierarchy_mapping_main() {
4440
4570
 
4441
4571
  // src/components/user-hierarchy-node-mapping/Workflow_Step_Hierarchy_Mapping.jsx
4442
4572
  import React28, { useEffect as useEffect16, useMemo, useRef as useRef7, useState as useState20 } from "react";
4443
- import Swal10 from "sweetalert2";
4573
+ import Swal11 from "sweetalert2";
4444
4574
  import { jsx as jsx28, jsxs as jsxs27 } from "react/jsx-runtime";
4445
4575
  var emptyForm = { workflowStepId: "", hierarchyNodeId: "", isActive: "true" };
4446
4576
  var getRows = (result) => {
@@ -4512,7 +4642,7 @@ function Workflow_Step_Hierarchy_Mapping() {
4512
4642
  hierarchyNodeResult ? getRows(hierarchyNodeResult) : []
4513
4643
  );
4514
4644
  } catch (error) {
4515
- await Swal10.fire(
4645
+ await Swal11.fire(
4516
4646
  "Error",
4517
4647
  ((_f = (_e = error == null ? void 0 : error.response) == null ? void 0 : _e.data) == null ? void 0 : _f.message) || (error == null ? void 0 : error.message) || "Unable to load workflow step hierarchy mappings.",
4518
4648
  "error"
@@ -4543,7 +4673,7 @@ function Workflow_Step_Hierarchy_Mapping() {
4543
4673
  var _a, _b, _c, _d;
4544
4674
  event.preventDefault();
4545
4675
  if (!formData.workflowStepId || !formData.hierarchyNodeId)
4546
- return Swal10.fire(
4676
+ return Swal11.fire(
4547
4677
  "Required fields",
4548
4678
  "Please select a workflow step and hierarchy node.",
4549
4679
  "warning"
@@ -4564,7 +4694,7 @@ function Workflow_Step_Hierarchy_Mapping() {
4564
4694
  updatedBy: "System"
4565
4695
  } : { createdBy: "System" });
4566
4696
  await getApiService()[editingMapping ? "put" : "post"](endpoint, payload);
4567
- await Swal10.fire(
4697
+ await Swal11.fire(
4568
4698
  "Success",
4569
4699
  `Workflow step hierarchy mapping ${editingMapping ? "updated" : "created"} successfully.`,
4570
4700
  "success"
@@ -4572,7 +4702,7 @@ function Workflow_Step_Hierarchy_Mapping() {
4572
4702
  setIsModalOpen(false);
4573
4703
  setRefreshKey((previous) => previous + 1);
4574
4704
  } catch (error) {
4575
- await Swal10.fire(
4705
+ await Swal11.fire(
4576
4706
  "Error",
4577
4707
  ((_d = (_c = error == null ? void 0 : error.response) == null ? void 0 : _c.data) == null ? void 0 : _d.message) || (error == null ? void 0 : error.message) || "Unable to save workflow step hierarchy mapping.",
4578
4708
  "error"
@@ -4583,7 +4713,7 @@ function Workflow_Step_Hierarchy_Mapping() {
4583
4713
  };
4584
4714
  const handleDelete = async (mapping) => {
4585
4715
  var _a, _b, _c, _d, _e, _f;
4586
- const confirmation = await Swal10.fire({
4716
+ const confirmation = await Swal11.fire({
4587
4717
  title: "Delete mapping?",
4588
4718
  text: "This mapping will be marked inactive.",
4589
4719
  icon: "warning",
@@ -4609,14 +4739,14 @@ function Workflow_Step_Hierarchy_Mapping() {
4609
4739
  isActive: false,
4610
4740
  updatedBy: "System"
4611
4741
  });
4612
- await Swal10.fire(
4742
+ await Swal11.fire(
4613
4743
  "Deleted",
4614
4744
  "Workflow step hierarchy mapping has been deactivated.",
4615
4745
  "success"
4616
4746
  );
4617
4747
  setRefreshKey((previous) => previous + 1);
4618
4748
  } catch (error) {
4619
- await Swal10.fire(
4749
+ await Swal11.fire(
4620
4750
  "Error",
4621
4751
  ((_f = (_e = error == null ? void 0 : error.response) == null ? void 0 : _e.data) == null ? void 0 : _f.message) || (error == null ? void 0 : error.message) || "Unable to delete workflow step hierarchy mapping.",
4622
4752
  "error"
@@ -4919,7 +5049,7 @@ function Workflow_Step_Hierarchy_Mapping() {
4919
5049
 
4920
5050
  // src/components/document-configuration/DocumentConfigurationmain.jsx
4921
5051
  import React34, { useState as useState24, useRef as useRef8 } from "react";
4922
- import Swal12 from "sweetalert2";
5052
+ import Swal13 from "sweetalert2";
4923
5053
 
4924
5054
  // src/components/document-configuration/SearchBar.jsx
4925
5055
  import React29 from "react";
@@ -4940,7 +5070,7 @@ function SearchBar3({
4940
5070
 
4941
5071
  // src/components/document-configuration/DocumentConfigurationTable.jsx
4942
5072
  import React32, { useState as useState22, useEffect as useEffect18 } from "react";
4943
- import Swal11 from "sweetalert2";
5073
+ import Swal12 from "sweetalert2";
4944
5074
 
4945
5075
  // src/components/document-configuration/Edit.jsx
4946
5076
  import React30, { useState as useState21, useEffect as useEffect17 } from "react";
@@ -5438,7 +5568,7 @@ function DocumentConfigTable({
5438
5568
  setData(unwrapRows(result).map(toUiItem));
5439
5569
  } catch (error) {
5440
5570
  setData([]);
5441
- await Swal11.fire("Error", ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || "Unable to load document configurations.", "error");
5571
+ await Swal12.fire("Error", ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || "Unable to load document configurations.", "error");
5442
5572
  } finally {
5443
5573
  setIsLoading(false);
5444
5574
  }
@@ -5488,7 +5618,7 @@ function DocumentConfigTable({
5488
5618
  setSelectedItem(toUiItem(value != null ? value : item));
5489
5619
  setIsEditOpen(true);
5490
5620
  } catch (error) {
5491
- await Swal11.fire("Error", ((_j = (_i = error == null ? void 0 : error.response) == null ? void 0 : _i.data) == null ? void 0 : _j.message) || (error == null ? void 0 : error.message) || "Unable to load document configuration.", "error");
5621
+ await Swal12.fire("Error", ((_j = (_i = error == null ? void 0 : error.response) == null ? void 0 : _i.data) == null ? void 0 : _j.message) || (error == null ? void 0 : error.message) || "Unable to load document configuration.", "error");
5492
5622
  }
5493
5623
  };
5494
5624
  const handleDelete = (item) => {
@@ -5513,12 +5643,12 @@ function DocumentConfigTable({
5513
5643
  isActive: updatedData.status === "Active",
5514
5644
  updatedBy: "System"
5515
5645
  });
5516
- await Swal11.fire("Success", "Document configuration updated successfully.", "success");
5646
+ await Swal12.fire("Success", "Document configuration updated successfully.", "success");
5517
5647
  setIsEditOpen(false);
5518
5648
  await loadData();
5519
5649
  return true;
5520
5650
  } catch (error) {
5521
- await Swal11.fire("Error", ((_f = (_e = error == null ? void 0 : error.response) == null ? void 0 : _e.data) == null ? void 0 : _f.message) || (error == null ? void 0 : error.message) || "Unable to update document configuration.", "error");
5651
+ await Swal12.fire("Error", ((_f = (_e = error == null ? void 0 : error.response) == null ? void 0 : _e.data) == null ? void 0 : _f.message) || (error == null ? void 0 : error.message) || "Unable to update document configuration.", "error");
5522
5652
  return false;
5523
5653
  }
5524
5654
  };
@@ -5916,12 +6046,12 @@ function DocumentConfigurationmain() {
5916
6046
  const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.documentConfiguration) == null ? void 0 : _c.create;
5917
6047
  if (!endpoint) throw new Error("Document Configuration create endpoint is not configured.");
5918
6048
  await getApiService().post(endpoint, payload);
5919
- await Swal12.fire("Success", "Document configuration created successfully.", "success");
6049
+ await Swal13.fire("Success", "Document configuration created successfully.", "success");
5920
6050
  setModalOpen(false);
5921
6051
  handleRefresh();
5922
6052
  return true;
5923
6053
  } catch (error) {
5924
- await Swal12.fire("Error", ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || "Unable to create document configuration.", "error");
6054
+ await Swal13.fire("Error", ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || "Unable to create document configuration.", "error");
5925
6055
  return false;
5926
6056
  }
5927
6057
  };
@@ -6980,7 +7110,7 @@ function MovementHistorymain() {
6980
7110
 
6981
7111
  // src/components/task-permission/TaskPermissionMain.jsx
6982
7112
  import React47, { useState as useState34, useRef as useRef11 } from "react";
6983
- import Swal14 from "sweetalert2";
7113
+ import Swal15 from "sweetalert2";
6984
7114
 
6985
7115
  // src/components/task-permission/SearchBar.js
6986
7116
  import React43 from "react";
@@ -7249,7 +7379,7 @@ function Table({
7249
7379
 
7250
7380
  // src/components/task-permission/Popup.js
7251
7381
  import React45, { useState as useState32, useEffect as useEffect23 } from "react";
7252
- import Swal13 from "sweetalert2";
7382
+ import Swal14 from "sweetalert2";
7253
7383
  import { jsx as jsx45, jsxs as jsxs44 } from "react/jsx-runtime";
7254
7384
  function Popup({ isOpen, onClose, onSave }) {
7255
7385
  const [formData, setFormData] = useState32({
@@ -7319,7 +7449,7 @@ function Popup({ isOpen, onClose, onSave }) {
7319
7449
  await (onSave == null ? void 0 : onSave());
7320
7450
  } catch (error) {
7321
7451
  const msg = ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || "Unable to create task permission.";
7322
- await Swal13.fire("Error", msg, "error");
7452
+ await Swal14.fire("Error", msg, "error");
7323
7453
  } finally {
7324
7454
  setIsSubmitting(false);
7325
7455
  }
@@ -7718,13 +7848,13 @@ function TaskPermissionMain() {
7718
7848
  handleRefresh();
7719
7849
  return true;
7720
7850
  } catch (error) {
7721
- await Swal14.fire("Error", ((_g = (_f = error == null ? void 0 : error.response) == null ? void 0 : _f.data) == null ? void 0 : _g.message) || (error == null ? void 0 : error.message) || "Unable to update task permission.", "error");
7851
+ await Swal15.fire("Error", ((_g = (_f = error == null ? void 0 : error.response) == null ? void 0 : _f.data) == null ? void 0 : _g.message) || (error == null ? void 0 : error.message) || "Unable to update task permission.", "error");
7722
7852
  return false;
7723
7853
  }
7724
7854
  };
7725
7855
  const handleDeleteApi = async (item) => {
7726
7856
  var _a;
7727
- const confirm = await Swal14.fire({
7857
+ const confirm = await Swal15.fire({
7728
7858
  title: "Delete Task Permission?",
7729
7859
  text: `Permission #${(_a = item.taskPermissionId) != null ? _a : item.TaskPermissionId} will be marked as inactive.`,
7730
7860
  icon: "warning",
@@ -7734,7 +7864,7 @@ function TaskPermissionMain() {
7734
7864
  });
7735
7865
  if (!confirm.isConfirmed) return;
7736
7866
  const ok = await handleUpdateApi(__spreadProps(__spreadValues({}, item), { isActive: false }));
7737
- if (ok) await Swal14.fire("Deleted", "Task permission has been deactivated.", "success");
7867
+ if (ok) await Swal15.fire("Deleted", "Task permission has been deactivated.", "success");
7738
7868
  };
7739
7869
  return /* @__PURE__ */ jsxs46("div", { className: "fc:h-screen fc:overflow-hidden fc:bg-slate-50 fc:p-4 md:fc:fc:p-6", children: [
7740
7870
  /* @__PURE__ */ jsxs46("div", { className: "fc:w-full fc:space-y-5", children: [
@@ -7787,7 +7917,7 @@ function TaskPermissionMain() {
7787
7917
  isOpen: showModal,
7788
7918
  onClose: () => setShowModal(false),
7789
7919
  onSave: async () => {
7790
- await Swal14.fire("Success", "Task permission created successfully.", "success");
7920
+ await Swal15.fire("Success", "Task permission created successfully.", "success");
7791
7921
  handleRefresh();
7792
7922
  }
7793
7923
  }
@@ -7799,7 +7929,7 @@ function TaskPermissionMain() {
7799
7929
  onClose: () => setIsEditOpen(false),
7800
7930
  selectedData: selectedItem,
7801
7931
  onSave: async () => {
7802
- await Swal14.fire("Success", "Task permission updated successfully.", "success");
7932
+ await Swal15.fire("Success", "Task permission updated successfully.", "success");
7803
7933
  handleRefresh();
7804
7934
  },
7805
7935
  onUpdate: handleUpdateApi
@@ -10369,7 +10499,7 @@ function Comment_main() {
10369
10499
 
10370
10500
  // src/components/hierarchy-node/HierarchyNodeMain.jsx
10371
10501
  import React71, { useState as useState50, useRef as useRef16, useEffect as useEffect32 } from "react";
10372
- import Swal15 from "sweetalert2";
10502
+ import Swal16 from "sweetalert2";
10373
10503
 
10374
10504
  // src/components/hierarchy-node/SearchBar.jsx
10375
10505
  import React66 from "react";
@@ -10973,7 +11103,7 @@ function HierarchyNodeMain() {
10973
11103
  const value = ((_d = result == null ? void 0 : result.data) == null ? void 0 : _d.data) || ((_e = result == null ? void 0 : result.data) == null ? void 0 : _e.result) || (result == null ? void 0 : result.data) || result;
10974
11104
  setApiData(Array.isArray(value) ? value : (value == null ? void 0 : value.items) || (value == null ? void 0 : value.records) || []);
10975
11105
  } catch (error) {
10976
- await Swal15.fire("Error", ((_g = (_f = error == null ? void 0 : error.response) == null ? void 0 : _f.data) == null ? void 0 : _g.message) || (error == null ? void 0 : error.message) || "Unable to load hierarchy nodes.", "error");
11106
+ await Swal16.fire("Error", ((_g = (_f = error == null ? void 0 : error.response) == null ? void 0 : _f.data) == null ? void 0 : _g.message) || (error == null ? void 0 : error.message) || "Unable to load hierarchy nodes.", "error");
10977
11107
  }
10978
11108
  })();
10979
11109
  }, [refreshKey]);
@@ -10986,11 +11116,11 @@ function HierarchyNodeMain() {
10986
11116
  const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.hierarchyNode) == null ? void 0 : _c[isEdit ? "update" : "create"];
10987
11117
  if (!endpoint) throw new Error(`Hierarchy node ${isEdit ? "update" : "create"} endpoint is not configured.`);
10988
11118
  await getApiService()[isEdit ? "put" : "post"](endpoint, payload);
10989
- await Swal15.fire("Success", `Hierarchy node ${isEdit ? "updated" : "created"} successfully.`, "success");
11119
+ await Swal16.fire("Success", `Hierarchy node ${isEdit ? "updated" : "created"} successfully.`, "success");
10990
11120
  handleRefresh();
10991
11121
  return true;
10992
11122
  } catch (error) {
10993
- await Swal15.fire("Error", ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || `Unable to ${isEdit ? "update" : "create"} hierarchy node.`, "error");
11123
+ await Swal16.fire("Error", ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || `Unable to ${isEdit ? "update" : "create"} hierarchy node.`, "error");
10994
11124
  return false;
10995
11125
  }
10996
11126
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowcore-fn",
3
- "version": "9.5.3",
3
+ "version": "10.1.2",
4
4
  "main": "dist/pkg-index.js",
5
5
  "module": "dist/pkg-index.mjs",
6
6
  "files": [