basyx-typescript-sdk 2.3.0 → 2.3.1

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/bundle/index.mjs CHANGED
@@ -25972,6 +25972,13 @@ function isRequiredErrorLike(err) {
25972
25972
  return err instanceof RequiredError || err?.name === "RequiredError";
25973
25973
  }
25974
25974
  /**
25975
+ * Returns the current time as a UTC date-time string matching the timestamp
25976
+ * pattern of the AAS API Message schema.
25977
+ */
25978
+ function currentTimestamp() {
25979
+ return (/* @__PURE__ */ new Date()).toISOString();
25980
+ }
25981
+ /**
25975
25982
  * Processes errors from API calls and standardizes them to a Result object
25976
25983
  * with a consistent messages array following the API spec guidelines.
25977
25984
  *
@@ -25982,7 +25989,7 @@ async function handleApiError(err) {
25982
25989
  try {
25983
25990
  const errorAny = err;
25984
25991
  if (errorAny?.messages && Array.isArray(errorAny.messages)) return { messages: errorAny.messages };
25985
- const timestamp = ((/* @__PURE__ */ new Date()).getTime() / 1e3).toString();
25992
+ const timestamp = currentTimestamp();
25986
25993
  let message = {
25987
25994
  code: "500",
25988
25995
  messageType: "Exception",
@@ -26033,7 +26040,7 @@ async function handleApiError(err) {
26033
26040
  code: "500",
26034
26041
  messageType: "Exception",
26035
26042
  text: "An error occurred while processing another error",
26036
- timestamp: ((/* @__PURE__ */ new Date()).getTime() / 1e3).toString()
26043
+ timestamp: currentTimestamp()
26037
26044
  }] };
26038
26045
  }
26039
26046
  }