@asgardeo/javascript 0.2.10 → 0.2.12

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
@@ -2898,7 +2898,10 @@ var executeEmbeddedSignInFlowV2 = async ({
2898
2898
  );
2899
2899
  }
2900
2900
  let endpoint = url ?? `${baseUrl}/flow/execute`;
2901
- const requestPayload = typeof payload === "object" && payload !== null && "flowType" in payload ? { ...payload, verbose: true } : payload;
2901
+ const cleanPayload = typeof payload === "object" && payload !== null ? Object.fromEntries(Object.entries(payload).filter(([key]) => key !== "verbose")) : payload;
2902
+ const hasOnlyAppIdAndFlowType = typeof cleanPayload === "object" && cleanPayload !== null && "applicationId" in cleanPayload && "flowType" in cleanPayload && Object.keys(cleanPayload).length === 2;
2903
+ const hasOnlyFlowId = typeof cleanPayload === "object" && cleanPayload !== null && "flowId" in cleanPayload && Object.keys(cleanPayload).length === 1;
2904
+ const requestPayload = hasOnlyAppIdAndFlowType || hasOnlyFlowId ? { ...cleanPayload, verbose: true } : cleanPayload;
2902
2905
  const response = await fetch(endpoint, {
2903
2906
  ...requestConfig,
2904
2907
  method: requestConfig.method || "POST",
@@ -2995,7 +2998,10 @@ var executeEmbeddedSignUpFlowV2 = async ({
2995
2998
  );
2996
2999
  }
2997
3000
  let endpoint = url ?? `${baseUrl}/flow/execute`;
2998
- const requestPayload = typeof payload === "object" && payload !== null && "flowType" in payload ? { ...payload, verbose: true } : payload;
3001
+ const cleanPayload = typeof payload === "object" && payload !== null ? Object.fromEntries(Object.entries(payload).filter(([key]) => key !== "verbose")) : payload;
3002
+ const hasOnlyAppIdAndFlowType = typeof cleanPayload === "object" && cleanPayload !== null && "applicationId" in cleanPayload && "flowType" in cleanPayload && Object.keys(cleanPayload).length === 2;
3003
+ const hasOnlyFlowId = typeof cleanPayload === "object" && cleanPayload !== null && "flowId" in cleanPayload && Object.keys(cleanPayload).length === 1;
3004
+ const requestPayload = hasOnlyAppIdAndFlowType || hasOnlyFlowId ? { ...cleanPayload, verbose: true } : cleanPayload;
2999
3005
  const response = await fetch(endpoint, {
3000
3006
  ...requestConfig,
3001
3007
  method: requestConfig.method || "POST",