trade-safety 1.7.0 → 1.9.0

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.mjs CHANGED
@@ -1,27 +1,27 @@
1
- import { jsxs as s, jsx as a } from "react/jsx-runtime";
1
+ import { jsxs as i, jsx as a } from "react/jsx-runtime";
2
2
  import { useTranslation as u } from "react-i18next";
3
3
  import "i18next";
4
4
  import "i18next-resources-to-backend";
5
- import { TRADE_SAFETY_NS as f } from "./locale.mjs";
6
- import { tradeSafetyTranslations as ge } from "./locale.mjs";
5
+ import { TRADE_SAFETY_NS as h } from "./locale.mjs";
6
+ import { tradeSafetyTranslations as we } from "./locale.mjs";
7
7
  import * as o from "react";
8
8
  import m from "react";
9
9
  import { BaseCrudRepository as R } from "@aioia/core";
10
- import { z as l } from "zod";
10
+ import { z as s } from "zod";
11
11
  function _(e) {
12
12
  var t, r, n = "";
13
13
  if (typeof e == "string" || typeof e == "number") n += e;
14
14
  else if (typeof e == "object") if (Array.isArray(e)) {
15
- var i = e.length;
16
- for (t = 0; t < i; t++) e[t] && (r = _(e[t])) && (n && (n += " "), n += r);
15
+ var l = e.length;
16
+ for (t = 0; t < l; t++) e[t] && (r = _(e[t])) && (n && (n += " "), n += r);
17
17
  } else for (r in e) e[r] && (n && (n += " "), n += r);
18
18
  return n;
19
19
  }
20
20
  function S() {
21
- for (var e, t, r = 0, n = "", i = arguments.length; r < i; r++) (e = arguments[r]) && (t = _(e)) && (n && (n += " "), n += t);
21
+ for (var e, t, r = 0, n = "", l = arguments.length; r < l; r++) (e = arguments[r]) && (t = _(e)) && (n && (n += " "), n += t);
22
22
  return n;
23
23
  }
24
- const C = {
24
+ const P = {
25
25
  default: "border-base-300",
26
26
  error: "border-error bg-error/10",
27
27
  warning: "border-warning bg-warning/10",
@@ -34,33 +34,33 @@ function p({
34
34
  variant: r = "default",
35
35
  children: n
36
36
  }) {
37
- return n ? /* @__PURE__ */ s("div", { className: S("rounded-lg border p-6", C[r]), children: [
38
- e && /* @__PURE__ */ s("h2", { className: "mb-2 flex items-center gap-2 font-bold", children: [
37
+ return n ? /* @__PURE__ */ i("div", { className: S("rounded-lg border p-6", P[r]), children: [
38
+ e && /* @__PURE__ */ i("h2", { className: "mb-2 flex items-center gap-2 font-bold", children: [
39
39
  e,
40
40
  t
41
41
  ] }),
42
42
  n
43
43
  ] }) : null;
44
44
  }
45
- function k({ summary: e }) {
46
- const { t } = u(f);
45
+ function C({ summary: e }) {
46
+ const { t } = u(h);
47
47
  return /* @__PURE__ */ a(p, { title: t("result.aiSummary"), children: /* @__PURE__ */ a("p", { className: "rounded-lg bg-base-200 p-6 text-sm leading-relaxed text-base-content", children: e }) });
48
48
  }
49
- function P({ data: e }) {
50
- const { t, i18n: r } = u(f);
51
- return e ? /* @__PURE__ */ s(p, { title: t("result.priceAnalysis"), children: [
52
- e.market_price_range && /* @__PURE__ */ s("div", { className: "mb-2", children: [
49
+ function k({ data: e }) {
50
+ const { t, i18n: r } = u(h);
51
+ return e ? /* @__PURE__ */ i(p, { title: t("result.priceAnalysis"), children: [
52
+ e.market_price_range && /* @__PURE__ */ i("div", { className: "mb-2", children: [
53
53
  /* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: t("result.marketPrice") }),
54
54
  /* @__PURE__ */ a("p", { className: "text-xs", children: e.market_price_range })
55
55
  ] }),
56
- e.offered_price && /* @__PURE__ */ s("div", { className: "mb-2", children: [
56
+ e.offered_price && /* @__PURE__ */ i("div", { className: "mb-2", children: [
57
57
  /* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: t("result.offeredPrice") }),
58
58
  /* @__PURE__ */ a("p", { className: "text-xs", children: new Intl.NumberFormat(r.language, {
59
59
  style: "currency",
60
60
  currency: e.currency || "USD"
61
61
  }).format(e.offered_price) })
62
62
  ] }),
63
- e.price_assessment && /* @__PURE__ */ s("div", { children: [
63
+ e.price_assessment && /* @__PURE__ */ i("div", { children: [
64
64
  /* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: t("result.priceAssessment") }),
65
65
  /* @__PURE__ */ a("p", { className: "text-xs", children: e.price_assessment })
66
66
  ] })
@@ -69,10 +69,10 @@ function P({ data: e }) {
69
69
  function z({
70
70
  recommendation: e
71
71
  }) {
72
- const { t } = u(f);
72
+ const { t } = u(h);
73
73
  return e ? /* @__PURE__ */ a(p, { title: t("result.recommendation"), children: /* @__PURE__ */ a("p", { className: "text-xs", children: e }) }) : null;
74
74
  }
75
- function A({
75
+ function T({
76
76
  title: e,
77
77
  titleId: t,
78
78
  ...r
@@ -93,7 +93,7 @@ function A({
93
93
  clipRule: "evenodd"
94
94
  }));
95
95
  }
96
- const T = /* @__PURE__ */ o.forwardRef(A);
96
+ const A = /* @__PURE__ */ o.forwardRef(T);
97
97
  function D({
98
98
  title: e,
99
99
  titleId: t,
@@ -161,14 +161,14 @@ function B({
161
161
  }
162
162
  const H = /* @__PURE__ */ o.forwardRef(B);
163
163
  function I({ items: e }) {
164
- const { t } = u(f);
165
- return e.length === 0 ? null : /* @__PURE__ */ s("div", { className: "mb-4", children: [
166
- /* @__PURE__ */ s("h2", { className: "flex items-center gap-1 py-4 font-bold", children: [
164
+ const { t } = u(h);
165
+ return e.length === 0 ? null : /* @__PURE__ */ i("div", { className: "mb-4", children: [
166
+ /* @__PURE__ */ i("h2", { className: "flex items-center gap-1 py-4 font-bold", children: [
167
167
  t("result.safetyChecklist"),
168
168
  " ",
169
- /* @__PURE__ */ a(T, { className: "size-6" })
169
+ /* @__PURE__ */ a(A, { className: "size-6" })
170
170
  ] }),
171
- /* @__PURE__ */ a(p, { variant: "info", children: e.map((r, n) => /* @__PURE__ */ s("label", { className: "label w-fit cursor-pointer gap-2", children: [
171
+ /* @__PURE__ */ a(p, { variant: "info", children: e.map((r, n) => /* @__PURE__ */ i("label", { className: "label w-fit cursor-pointer gap-2", children: [
172
172
  /* @__PURE__ */ a(
173
173
  "input",
174
174
  {
@@ -184,7 +184,7 @@ const L = {
184
184
  error: F,
185
185
  warning: M,
186
186
  success: H
187
- }, W = {
187
+ }, $ = {
188
188
  error: "result.riskSignals",
189
189
  warning: "result.cautions",
190
190
  success: "result.safeIndicators"
@@ -193,55 +193,55 @@ function v({
193
193
  signals: e,
194
194
  variant: t = "error"
195
195
  }) {
196
- const { t: r } = u(f);
196
+ const { t: r } = u(h);
197
197
  if (e.length === 0) return null;
198
198
  const n = L[t];
199
- return /* @__PURE__ */ s("div", { className: "mb-4", children: [
200
- /* @__PURE__ */ s("h2", { className: "flex items-center gap-1 py-4 font-bold", children: [
201
- r(W[t]),
199
+ return /* @__PURE__ */ i("div", { className: "mb-4", children: [
200
+ /* @__PURE__ */ i("h2", { className: "flex items-center gap-1 py-4 font-bold", children: [
201
+ r($[t]),
202
202
  " ",
203
203
  /* @__PURE__ */ a(n, { className: "size-6" })
204
204
  ] }),
205
- /* @__PURE__ */ a("div", { className: "space-y-3", children: e.map((i, c) => /* @__PURE__ */ a(p, { variant: t, children: /* @__PURE__ */ s("div", { className: "space-y-2", children: [
206
- /* @__PURE__ */ s("div", { children: [
207
- /* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: i.title }),
208
- /* @__PURE__ */ a("p", { className: "text-xs", children: i.description })
205
+ /* @__PURE__ */ a("div", { className: "space-y-3", children: e.map((l, c) => /* @__PURE__ */ a(p, { variant: t, children: /* @__PURE__ */ i("div", { className: "space-y-2", children: [
206
+ /* @__PURE__ */ i("div", { children: [
207
+ /* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: l.title }),
208
+ /* @__PURE__ */ a("p", { className: "text-xs", children: l.description })
209
209
  ] }),
210
- /* @__PURE__ */ s("div", { children: [
210
+ /* @__PURE__ */ i("div", { children: [
211
211
  /* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: r("result.whatToDo") }),
212
- /* @__PURE__ */ a("p", { className: "text-xs", children: i.what_to_do })
212
+ /* @__PURE__ */ a("p", { className: "text-xs", children: l.what_to_do })
213
213
  ] })
214
214
  ] }) }, c)) })
215
215
  ] });
216
216
  }
217
- function $({
217
+ function W({
218
218
  translation: e,
219
219
  nuance: t
220
220
  }) {
221
- const { t: r } = u(f);
222
- return /* @__PURE__ */ s(p, { title: r("result.translation"), children: [
223
- e && /* @__PURE__ */ s("div", { className: "mb-2", children: [
221
+ const { t: r } = u(h);
222
+ return /* @__PURE__ */ i(p, { title: r("result.translation"), children: [
223
+ e && /* @__PURE__ */ i("div", { className: "mb-2", children: [
224
224
  /* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: r("result.translationTitle") }),
225
225
  /* @__PURE__ */ a("p", { className: "text-xs", children: e })
226
226
  ] }),
227
- t && /* @__PURE__ */ s("div", { children: [
227
+ t && /* @__PURE__ */ i("div", { children: [
228
228
  /* @__PURE__ */ a("h3", { className: "text-sm font-bold", children: r("result.nuanceTitle") }),
229
229
  /* @__PURE__ */ a("p", { className: "text-xs", children: t })
230
230
  ] })
231
231
  ] });
232
232
  }
233
- function me({ analysis: e }) {
234
- return /* @__PURE__ */ s("div", { children: [
235
- e.ai_summary && /* @__PURE__ */ a(k, { summary: e.ai_summary }),
236
- /* @__PURE__ */ s("div", { className: "my-4 flex flex-col gap-4", children: [
233
+ function fe({ analysis: e }) {
234
+ return /* @__PURE__ */ i("div", { children: [
235
+ e.ai_summary && /* @__PURE__ */ a(C, { summary: e.ai_summary }),
236
+ /* @__PURE__ */ i("div", { className: "my-4 flex flex-col gap-4", children: [
237
237
  (e.translation || e.nuance_explanation) && /* @__PURE__ */ a(
238
- $,
238
+ W,
239
239
  {
240
240
  translation: e.translation,
241
241
  nuance: e.nuance_explanation
242
242
  }
243
243
  ),
244
- e.price_analysis && /* @__PURE__ */ a(P, { data: e.price_analysis }),
244
+ e.price_analysis && /* @__PURE__ */ a(k, { data: e.price_analysis }),
245
245
  e.recommendation && /* @__PURE__ */ a(z, { recommendation: e.recommendation })
246
246
  ] }),
247
247
  e.risk_signals.length > 0 && /* @__PURE__ */ a(v, { signals: e.risk_signals, variant: "error" }),
@@ -257,17 +257,17 @@ var O = {
257
257
  style: void 0,
258
258
  attr: void 0
259
259
  }, y = m.createContext && /* @__PURE__ */ m.createContext(O), K = ["attr", "size", "title"];
260
- function V(e, t) {
260
+ function U(e, t) {
261
261
  if (e == null) return {};
262
- var r = X(e, t), n, i;
262
+ var r = V(e, t), n, l;
263
263
  if (Object.getOwnPropertySymbols) {
264
264
  var c = Object.getOwnPropertySymbols(e);
265
- for (i = 0; i < c.length; i++)
266
- n = c[i], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n]);
265
+ for (l = 0; l < c.length; l++)
266
+ n = c[l], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n]);
267
267
  }
268
268
  return r;
269
269
  }
270
- function X(e, t) {
270
+ function V(e, t) {
271
271
  if (e == null) return {};
272
272
  var r = {};
273
273
  for (var n in e)
@@ -291,8 +291,8 @@ function N(e, t) {
291
291
  var r = Object.keys(e);
292
292
  if (Object.getOwnPropertySymbols) {
293
293
  var n = Object.getOwnPropertySymbols(e);
294
- t && (n = n.filter(function(i) {
295
- return Object.getOwnPropertyDescriptor(e, i).enumerable;
294
+ t && (n = n.filter(function(l) {
295
+ return Object.getOwnPropertyDescriptor(e, l).enumerable;
296
296
  })), r.push.apply(r, n);
297
297
  }
298
298
  return r;
@@ -301,21 +301,21 @@ function x(e) {
301
301
  for (var t = 1; t < arguments.length; t++) {
302
302
  var r = arguments[t] != null ? arguments[t] : {};
303
303
  t % 2 ? N(Object(r), !0).forEach(function(n) {
304
- Y(e, n, r[n]);
304
+ X(e, n, r[n]);
305
305
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : N(Object(r)).forEach(function(n) {
306
306
  Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
307
307
  });
308
308
  }
309
309
  return e;
310
310
  }
311
- function Y(e, t, r) {
312
- return t = G(t), t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
311
+ function X(e, t, r) {
312
+ return t = Y(t), t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
313
313
  }
314
- function G(e) {
315
- var t = U(e, "string");
314
+ function Y(e) {
315
+ var t = q(e, "string");
316
316
  return typeof t == "symbol" ? t : t + "";
317
317
  }
318
- function U(e, t) {
318
+ function q(e, t) {
319
319
  if (typeof e != "object" || !e) return e;
320
320
  var r = e[Symbol.toPrimitive];
321
321
  if (r !== void 0) {
@@ -331,17 +331,17 @@ function j(e) {
331
331
  }, t.attr), j(t.child)));
332
332
  }
333
333
  function E(e) {
334
- return (t) => /* @__PURE__ */ m.createElement(q, g({
334
+ return (t) => /* @__PURE__ */ m.createElement(G, g({
335
335
  attr: x({}, e.attr)
336
336
  }, t), j(e.child));
337
337
  }
338
- function q(e) {
338
+ function G(e) {
339
339
  var t = (r) => {
340
340
  var {
341
341
  attr: n,
342
- size: i,
342
+ size: l,
343
343
  title: c
344
- } = e, b = V(e, K), h = i || r.size || "1em", d;
344
+ } = e, b = U(e, K), f = l || r.size || "1em", d;
345
345
  return r.className && (d = r.className), e.className && (d = (d ? d + " " : "") + e.className), /* @__PURE__ */ m.createElement("svg", g({
346
346
  stroke: "currentColor",
347
347
  fill: "currentColor",
@@ -351,8 +351,8 @@ function q(e) {
351
351
  style: x(x({
352
352
  color: e.color || r.color
353
353
  }, r.style), e.style),
354
- height: h,
355
- width: h,
354
+ height: f,
355
+ width: f,
356
356
  xmlns: "http://www.w3.org/2000/svg"
357
357
  }), c && /* @__PURE__ */ m.createElement("title", null, c), e.children);
358
358
  };
@@ -364,19 +364,19 @@ function J(e) {
364
364
  function Q(e) {
365
365
  return E({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z" }, child: [] }] })(e);
366
366
  }
367
- function ue({
367
+ function pe({
368
368
  value: e,
369
369
  onChange: t,
370
370
  onSubmit: r,
371
371
  isLoading: n,
372
- error: i
372
+ error: l
373
373
  }) {
374
- const { t: c } = u(f), b = n ? /* @__PURE__ */ a("span", { className: "loading loading-spinner loading-sm" }) : c("hero.checkSafety"), h = n || !e.trim();
375
- return /* @__PURE__ */ a("div", { className: "flex w-full flex-col items-center justify-center", children: /* @__PURE__ */ s("div", { className: "w-full lg:max-w-[720px]", children: [
374
+ const { t: c } = u(h), b = n ? /* @__PURE__ */ a("span", { className: "loading loading-spinner loading-sm" }) : c("hero.checkSafety"), f = n || !e.trim();
375
+ return /* @__PURE__ */ a("div", { className: "flex w-full flex-col items-center justify-center", children: /* @__PURE__ */ i("div", { className: "w-full lg:max-w-[720px]", children: [
376
376
  /* @__PURE__ */ a("h1", { className: "mb-2 text-left text-3xl font-bold text-base-content sm:mb-8 sm:text-center sm:text-4xl md:mb-8", children: c("hero.title") }),
377
377
  /* @__PURE__ */ a("p", { className: "mb-4 text-left text-sm text-base-content/70 sm:mb-8 sm:text-center sm:text-base md:mb-16", children: c("hero.subtitle") }),
378
- /* @__PURE__ */ s("div", { className: S("mb-4", !i && "sm:mb-8 md:mb-12"), children: [
379
- /* @__PURE__ */ s("div", { className: "relative hidden lg:block", children: [
378
+ /* @__PURE__ */ i("div", { className: S("mb-4", !l && "sm:mb-8 md:mb-12"), children: [
379
+ /* @__PURE__ */ i("div", { className: "relative hidden lg:block", children: [
380
380
  /* @__PURE__ */ a(
381
381
  "input",
382
382
  {
@@ -388,7 +388,7 @@ function ue({
388
388
  onChange: (d) => t(d.target.value),
389
389
  disabled: n,
390
390
  onKeyDown: (d) => {
391
- d.key === "Enter" && !h && r();
391
+ d.key === "Enter" && !f && r();
392
392
  }
393
393
  }
394
394
  ),
@@ -397,18 +397,18 @@ function ue({
397
397
  {
398
398
  className: "btn btn-neutral absolute right-2 top-1/2 h-[56px] min-h-0 -translate-y-1/2 !animate-none px-6 font-bold text-neutral-content",
399
399
  onClick: r,
400
- disabled: h,
400
+ disabled: f,
401
401
  children: b
402
402
  }
403
403
  )
404
404
  ] }),
405
- /* @__PURE__ */ a("div", { className: "block lg:hidden", children: /* @__PURE__ */ s("div", { className: "relative h-[400px] w-full overflow-hidden rounded-xl border border-base-300 bg-base-100", children: [
405
+ /* @__PURE__ */ a("div", { className: "block lg:hidden", children: /* @__PURE__ */ i("div", { className: "relative h-[400px] w-full overflow-hidden rounded-xl border border-base-300 bg-base-100", children: [
406
406
  !e && /* @__PURE__ */ a(
407
407
  "div",
408
408
  {
409
409
  className: "pointer-events-none absolute inset-0 overflow-hidden p-5 pb-24 text-base text-base-300",
410
410
  "aria-hidden": "true",
411
- children: /* @__PURE__ */ s("div", { className: "whitespace-pre-line leading-relaxed", children: [
411
+ children: /* @__PURE__ */ i("div", { className: "whitespace-pre-line leading-relaxed", children: [
412
412
  /* @__PURE__ */ a("p", { className: "mb-4 text-base-300", children: c("hero.placeholder") }),
413
413
  c("hero.placeholderExample")
414
414
  ] })
@@ -430,15 +430,15 @@ function ue({
430
430
  {
431
431
  className: "btn btn-neutral h-16 w-full text-base font-medium text-neutral-content",
432
432
  onClick: r,
433
- disabled: h,
433
+ disabled: f,
434
434
  children: b
435
435
  }
436
436
  ) })
437
437
  ] }) })
438
438
  ] }),
439
- i && /* @__PURE__ */ a("div", { className: "alert alert-error mb-6 flex items-center gap-2 text-sm", children: /* @__PURE__ */ a("span", { children: i }) }),
439
+ l && /* @__PURE__ */ a("div", { className: "alert alert-error mb-6 flex items-center gap-2 text-sm", children: /* @__PURE__ */ a("span", { children: l }) }),
440
440
  /* @__PURE__ */ a("p", { className: "mb-4 text-left text-xs text-base-content/60 sm:mb-8 sm:text-center md:mb-12", children: c("hero.disclaimer") }),
441
- /* @__PURE__ */ s("div", { className: "flex items-center justify-start gap-6 sm:justify-center", children: [
441
+ /* @__PURE__ */ i("div", { className: "flex items-center justify-start gap-6 sm:justify-center", children: [
442
442
  /* @__PURE__ */ a(
443
443
  "a",
444
444
  {
@@ -462,61 +462,83 @@ function ue({
462
462
  ] })
463
463
  ] }) });
464
464
  }
465
- const w = l.object({
466
- category: l.enum(["payment", "seller", "platform", "price", "content"]),
467
- severity: l.enum(["high", "medium", "low"]),
468
- title: l.string(),
469
- description: l.string(),
470
- what_to_do: l.string()
471
- }), ee = l.object({
472
- market_price_range: l.string().nullish(),
473
- offered_price: l.number().nullish(),
474
- currency: l.string().nullish(),
475
- price_assessment: l.string(),
476
- warnings: l.array(l.string())
477
- }), te = l.object({
478
- ai_summary: l.string(),
479
- translation: l.string().nullish(),
480
- nuance_explanation: l.string().nullish(),
481
- risk_signals: l.array(w),
482
- cautions: l.array(w),
483
- safe_indicators: l.array(w),
465
+ const w = s.object({
466
+ category: s.enum(["payment", "seller", "platform", "price", "content"]),
467
+ severity: s.enum(["high", "medium", "low"]),
468
+ title: s.string(),
469
+ description: s.string(),
470
+ what_to_do: s.string()
471
+ }), ee = s.object({
472
+ market_price_range: s.string().nullish(),
473
+ offered_price: s.number().nullish(),
474
+ currency: s.string().nullish(),
475
+ price_assessment: s.string(),
476
+ warnings: s.array(s.string())
477
+ }), te = s.object({
478
+ ai_summary: s.string(),
479
+ translation: s.string().nullish(),
480
+ nuance_explanation: s.string().nullish(),
481
+ risk_signals: s.array(w),
482
+ cautions: s.array(w),
483
+ safe_indicators: s.array(w),
484
484
  price_analysis: ee,
485
- safety_checklist: l.array(l.string()),
486
- safe_score: l.number(),
487
- recommendation: l.string(),
488
- emotional_support: l.string()
489
- }), re = l.object({
490
- id: l.string(),
491
- user_id: l.string().nullish(),
492
- input_text: l.string(),
485
+ safety_checklist: s.array(s.string()),
486
+ safe_score: s.number(),
487
+ recommendation: s.string(),
488
+ emotional_support: s.string()
489
+ }), re = s.object({
490
+ id: s.string(),
491
+ user_id: s.string().nullish(),
492
+ input_text: s.string(),
493
493
  llm_analysis: te,
494
- safe_score: l.number(),
495
- expert_advice: l.string().nullish(),
496
- expert_reviewed: l.boolean(),
497
- expert_reviewed_at: l.string().nullish(),
498
- expert_reviewed_by: l.string().nullish(),
499
- created_at: l.string(),
500
- updated_at: l.string()
494
+ safe_score: s.number(),
495
+ expert_advice: s.string().nullish(),
496
+ expert_reviewed: s.boolean(),
497
+ expert_reviewed_at: s.string().nullish(),
498
+ expert_reviewed_by: s.string().nullish(),
499
+ created_at: s.string(),
500
+ updated_at: s.string()
501
+ }), ne = s.enum(["twitter"]), ae = s.object({
502
+ platform: ne,
503
+ author: s.string(),
504
+ created_at: s.string().nullish(),
505
+ text: s.string(),
506
+ text_preview: s.string(),
507
+ images: s.array(s.string())
508
+ }), se = s.object({
509
+ data: ae
501
510
  });
502
- class fe extends R {
511
+ class be extends R {
503
512
  constructor() {
504
513
  super(...arguments), this.resource = "trade-safety";
505
514
  }
506
515
  getDataSchema() {
507
516
  return re;
508
517
  }
518
+ /**
519
+ * Fetch post preview metadata from a social media URL
520
+ * POST /trade-safety/preview
521
+ */
522
+ async fetchPreview(t, r) {
523
+ const n = `${this.apiService.buildUrl(this.resource)}/preview`, l = await this.apiService.request(n, {
524
+ ...r,
525
+ method: "POST",
526
+ headers: { "Content-Type": "application/json" },
527
+ body: JSON.stringify({ url: t })
528
+ });
529
+ return this.validateResponse(l, se).data;
530
+ }
509
531
  }
510
- const he = {
532
+ const ge = {
511
533
  safe: 70,
512
534
  caution: 40
513
535
  };
514
536
  export {
515
- me as DetailedResult,
516
- ue as HomeHeroSection,
517
- he as SAFETY_SCORE_THRESHOLDS,
518
- f as TRADE_SAFETY_NS,
519
- fe as TradeSafetyRepository,
520
- ge as tradeSafetyTranslations
537
+ fe as DetailedResult,
538
+ pe as HomeHeroSection,
539
+ ge as SAFETY_SCORE_THRESHOLDS,
540
+ h as TRADE_SAFETY_NS,
541
+ be as TradeSafetyRepository,
542
+ we as tradeSafetyTranslations
521
543
  };
522
544
  //# sourceMappingURL=index.mjs.map