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