arky-sdk 0.9.18 → 0.9.19

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/admin.d.cts CHANGED
@@ -1,3 +1,3 @@
1
- export { a3 as AdminSession, a0 as ApiConfig, A as AuthStateListener, a6 as CreateAdminConfig, a7 as createAdmin } from './admin-CBgRGUCX.cjs';
1
+ export { a3 as AdminSession, a0 as ApiConfig, A as AuthStateListener, a6 as CreateAdminConfig, a7 as createAdmin } from './admin-CgER0AZn.cjs';
2
2
  export { am as AuthStorage, al as HttpClientConfig } from './api-CuqZQQGv.cjs';
3
3
  import './inventory-DrVRUkE2.cjs';
package/dist/admin.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { a3 as AdminSession, a0 as ApiConfig, A as AuthStateListener, a6 as CreateAdminConfig, a7 as createAdmin } from './admin-yoFJKZB8.js';
1
+ export { a3 as AdminSession, a0 as ApiConfig, A as AuthStateListener, a6 as CreateAdminConfig, a7 as createAdmin } from './admin-CqasPNLl.js';
2
2
  export { am as AuthStorage, al as HttpClientConfig } from './api-CuqZQQGv.js';
3
3
  import './inventory-DNX8Vg-N.js';
package/dist/admin.js CHANGED
@@ -1,18 +1,3 @@
1
- // src/utils/errors.ts
2
- var convertServerErrorToRequestError = (serverError, renameRules) => {
3
- const validationErrors = serverError?.validationErrors ?? [];
4
- return {
5
- ...serverError,
6
- validationErrors: validationErrors.map((validationError) => {
7
- const field = validationError.field;
8
- return {
9
- field,
10
- error: validationError.error || "GENERAL.VALIDATION_ERROR"
11
- };
12
- })
13
- };
14
- };
15
-
16
1
  // src/utils/queryParams.ts
17
2
  function buildQueryString(params) {
18
3
  const queryParts = Object.entries(params).flatMap(
@@ -56,6 +41,12 @@ function toServerError(value, statusCode) {
56
41
  validationErrors
57
42
  };
58
43
  }
44
+ function normalizeValidationErrors(validationErrors) {
45
+ return validationErrors.map((validationError) => ({
46
+ field: validationError.field,
47
+ error: validationError.error || "GENERAL.VALIDATION_ERROR"
48
+ }));
49
+ }
59
50
  function createHttpClient(cfg) {
60
51
  const { authStorage } = cfg;
61
52
  let refreshPromise = null;
@@ -186,11 +177,10 @@ function createHttpClient(cfg) {
186
177
  }
187
178
  if (!res.ok) {
188
179
  const serverErr = toServerError(data, res.status);
189
- const reqErr = convertServerErrorToRequestError(serverErr);
190
180
  const requestId = res.headers.get("x-request-id") || res.headers.get("request-id");
191
181
  const err = requestError("ApiError", serverErr.message, {
192
182
  statusCode: serverErr.statusCode,
193
- validationErrors: reqErr.validationErrors,
183
+ validationErrors: normalizeValidationErrors(serverErr.validationErrors),
194
184
  method,
195
185
  url: fullUrl,
196
186
  requestId: requestId || void 0
@@ -2975,11 +2965,8 @@ function getBlockLabel(block) {
2975
2965
  function formatBlockValue(block) {
2976
2966
  if (block?.value === null || block?.value === void 0) return "";
2977
2967
  if (block.type === "boolean") return block.value ? "Yes" : "No";
2978
- if (block.type === "number") {
2979
- const properties = isRecord2(block.properties) ? block.properties : {};
2980
- if (properties.variant === "DATE" || properties.variant === "DATE_TIME") {
2981
- return new Date(Number(block.value)).toLocaleDateString();
2982
- }
2968
+ if (block.type === "date") {
2969
+ return new Date(Number(block.value) * 1e3).toLocaleDateString();
2983
2970
  }
2984
2971
  if (block.type === "media" && isRecord2(block.value)) {
2985
2972
  const label = block.value.name ?? block.value.title ?? block.value.id;