trade-safety 0.1.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.
Files changed (76) hide show
  1. package/README.md +59 -0
  2. package/dist/components/DetailedResult/CautionsSection.d.ts +7 -0
  3. package/dist/components/DetailedResult/CautionsSection.d.ts.map +1 -0
  4. package/dist/components/DetailedResult/CautionsSection.js +14 -0
  5. package/dist/components/DetailedResult/CautionsSection.js.map +1 -0
  6. package/dist/components/DetailedResult/CompanionCtaSection.d.ts +2 -0
  7. package/dist/components/DetailedResult/CompanionCtaSection.d.ts.map +1 -0
  8. package/dist/components/DetailedResult/CompanionCtaSection.js +12 -0
  9. package/dist/components/DetailedResult/CompanionCtaSection.js.map +1 -0
  10. package/dist/components/DetailedResult/ExpertAdviceSection.d.ts +6 -0
  11. package/dist/components/DetailedResult/ExpertAdviceSection.d.ts.map +1 -0
  12. package/dist/components/DetailedResult/ExpertAdviceSection.js +11 -0
  13. package/dist/components/DetailedResult/ExpertAdviceSection.js.map +1 -0
  14. package/dist/components/DetailedResult/PriceAnalysisSection.d.ts +7 -0
  15. package/dist/components/DetailedResult/PriceAnalysisSection.d.ts.map +1 -0
  16. package/dist/components/DetailedResult/PriceAnalysisSection.js +15 -0
  17. package/dist/components/DetailedResult/PriceAnalysisSection.js.map +1 -0
  18. package/dist/components/DetailedResult/RecommendationSection.d.ts +7 -0
  19. package/dist/components/DetailedResult/RecommendationSection.d.ts.map +1 -0
  20. package/dist/components/DetailedResult/RecommendationSection.js +10 -0
  21. package/dist/components/DetailedResult/RecommendationSection.js.map +1 -0
  22. package/dist/components/DetailedResult/RiskScoreHero.d.ts +6 -0
  23. package/dist/components/DetailedResult/RiskScoreHero.d.ts.map +1 -0
  24. package/dist/components/DetailedResult/RiskScoreHero.js +30 -0
  25. package/dist/components/DetailedResult/RiskScoreHero.js.map +1 -0
  26. package/dist/components/DetailedResult/RiskSignalsSection.d.ts +7 -0
  27. package/dist/components/DetailedResult/RiskSignalsSection.d.ts.map +1 -0
  28. package/dist/components/DetailedResult/RiskSignalsSection.js +14 -0
  29. package/dist/components/DetailedResult/RiskSignalsSection.js.map +1 -0
  30. package/dist/components/DetailedResult/SafeIndicatorsSection.d.ts +7 -0
  31. package/dist/components/DetailedResult/SafeIndicatorsSection.d.ts.map +1 -0
  32. package/dist/components/DetailedResult/SafeIndicatorsSection.js +14 -0
  33. package/dist/components/DetailedResult/SafeIndicatorsSection.js.map +1 -0
  34. package/dist/components/DetailedResult/SafetyChecklistSection.d.ts +6 -0
  35. package/dist/components/DetailedResult/SafetyChecklistSection.d.ts.map +1 -0
  36. package/dist/components/DetailedResult/SafetyChecklistSection.js +13 -0
  37. package/dist/components/DetailedResult/SafetyChecklistSection.js.map +1 -0
  38. package/dist/components/DetailedResult/TranslationSection.d.ts +7 -0
  39. package/dist/components/DetailedResult/TranslationSection.d.ts.map +1 -0
  40. package/dist/components/DetailedResult/TranslationSection.js +12 -0
  41. package/dist/components/DetailedResult/TranslationSection.js.map +1 -0
  42. package/dist/components/DetailedResult/index.d.ts +10 -0
  43. package/dist/components/DetailedResult/index.d.ts.map +1 -0
  44. package/dist/components/DetailedResult/index.js +33 -0
  45. package/dist/components/DetailedResult/index.js.map +1 -0
  46. package/dist/components/QuickResultTeaser.d.ts +8 -0
  47. package/dist/components/QuickResultTeaser.d.ts.map +1 -0
  48. package/dist/components/QuickResultTeaser.js +11 -0
  49. package/dist/components/QuickResultTeaser.js.map +1 -0
  50. package/dist/components/RiskSignalCard.d.ts +8 -0
  51. package/dist/components/RiskSignalCard.d.ts.map +1 -0
  52. package/dist/components/RiskSignalCard.js +26 -0
  53. package/dist/components/RiskSignalCard.js.map +1 -0
  54. package/dist/i18n/locales/en/translation.json +95 -0
  55. package/dist/i18n/locales/es/translation.json +95 -0
  56. package/dist/i18n/locales/id/translation.json +95 -0
  57. package/dist/i18n/locales/ja/translation.json +95 -0
  58. package/dist/i18n/locales/ko/translation.json +95 -0
  59. package/dist/i18n/locales/zh/translation.json +95 -0
  60. package/dist/index.d.ts +18 -0
  61. package/dist/index.d.ts.map +1 -0
  62. package/dist/index.js +21 -0
  63. package/dist/index.js.map +1 -0
  64. package/dist/repositories/TradeSafetyRepository.d.ts +570 -0
  65. package/dist/repositories/TradeSafetyRepository.d.ts.map +1 -0
  66. package/dist/repositories/TradeSafetyRepository.js +87 -0
  67. package/dist/repositories/TradeSafetyRepository.js.map +1 -0
  68. package/dist/repositories/index.d.ts +6 -0
  69. package/dist/repositories/index.d.ts.map +1 -0
  70. package/dist/repositories/index.js +6 -0
  71. package/dist/repositories/index.js.map +1 -0
  72. package/dist/types.d.ts +67 -0
  73. package/dist/types.d.ts.map +1 -0
  74. package/dist/types.js +10 -0
  75. package/dist/types.js.map +1 -0
  76. package/package.json +84 -0
@@ -0,0 +1,570 @@
1
+ import { BaseCrudRepository } from "@aioia/core";
2
+ import { z } from "zod";
3
+ declare const tradeSafetyCheckResponseSchema: z.ZodObject<{
4
+ id: z.ZodString;
5
+ user_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6
+ input_text: z.ZodString;
7
+ llm_analysis: z.ZodObject<{
8
+ translation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
9
+ nuance_explanation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
10
+ risk_signals: z.ZodArray<z.ZodObject<{
11
+ category: z.ZodEnum<["payment", "seller", "platform", "price", "content"]>;
12
+ severity: z.ZodEnum<["high", "medium", "low"]>;
13
+ title: z.ZodString;
14
+ description: z.ZodString;
15
+ what_to_do: z.ZodString;
16
+ }, "strip", z.ZodTypeAny, {
17
+ title: string;
18
+ category: "payment" | "seller" | "platform" | "price" | "content";
19
+ severity: "high" | "medium" | "low";
20
+ description: string;
21
+ what_to_do: string;
22
+ }, {
23
+ title: string;
24
+ category: "payment" | "seller" | "platform" | "price" | "content";
25
+ severity: "high" | "medium" | "low";
26
+ description: string;
27
+ what_to_do: string;
28
+ }>, "many">;
29
+ cautions: z.ZodArray<z.ZodObject<{
30
+ category: z.ZodEnum<["payment", "seller", "platform", "price", "content"]>;
31
+ severity: z.ZodEnum<["high", "medium", "low"]>;
32
+ title: z.ZodString;
33
+ description: z.ZodString;
34
+ what_to_do: z.ZodString;
35
+ }, "strip", z.ZodTypeAny, {
36
+ title: string;
37
+ category: "payment" | "seller" | "platform" | "price" | "content";
38
+ severity: "high" | "medium" | "low";
39
+ description: string;
40
+ what_to_do: string;
41
+ }, {
42
+ title: string;
43
+ category: "payment" | "seller" | "platform" | "price" | "content";
44
+ severity: "high" | "medium" | "low";
45
+ description: string;
46
+ what_to_do: string;
47
+ }>, "many">;
48
+ safe_indicators: z.ZodArray<z.ZodObject<{
49
+ category: z.ZodEnum<["payment", "seller", "platform", "price", "content"]>;
50
+ severity: z.ZodEnum<["high", "medium", "low"]>;
51
+ title: z.ZodString;
52
+ description: z.ZodString;
53
+ what_to_do: z.ZodString;
54
+ }, "strip", z.ZodTypeAny, {
55
+ title: string;
56
+ category: "payment" | "seller" | "platform" | "price" | "content";
57
+ severity: "high" | "medium" | "low";
58
+ description: string;
59
+ what_to_do: string;
60
+ }, {
61
+ title: string;
62
+ category: "payment" | "seller" | "platform" | "price" | "content";
63
+ severity: "high" | "medium" | "low";
64
+ description: string;
65
+ what_to_do: string;
66
+ }>, "many">;
67
+ price_analysis: z.ZodOptional<z.ZodNullable<z.ZodObject<{
68
+ market_price_range: z.ZodOptional<z.ZodNullable<z.ZodString>>;
69
+ offered_price: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
70
+ currency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
71
+ price_assessment: z.ZodString;
72
+ warnings: z.ZodArray<z.ZodString, "many">;
73
+ }, "strip", z.ZodTypeAny, {
74
+ price_assessment: string;
75
+ warnings: string[];
76
+ market_price_range?: string | null | undefined;
77
+ currency?: string | null | undefined;
78
+ offered_price?: number | null | undefined;
79
+ }, {
80
+ price_assessment: string;
81
+ warnings: string[];
82
+ market_price_range?: string | null | undefined;
83
+ currency?: string | null | undefined;
84
+ offered_price?: number | null | undefined;
85
+ }>>>;
86
+ safety_checklist: z.ZodArray<z.ZodString, "many">;
87
+ risk_score: z.ZodNumber;
88
+ recommendation: z.ZodString;
89
+ emotional_support: z.ZodString;
90
+ }, "strip", z.ZodTypeAny, {
91
+ cautions: {
92
+ title: string;
93
+ category: "payment" | "seller" | "platform" | "price" | "content";
94
+ severity: "high" | "medium" | "low";
95
+ description: string;
96
+ what_to_do: string;
97
+ }[];
98
+ recommendation: string;
99
+ risk_signals: {
100
+ title: string;
101
+ category: "payment" | "seller" | "platform" | "price" | "content";
102
+ severity: "high" | "medium" | "low";
103
+ description: string;
104
+ what_to_do: string;
105
+ }[];
106
+ safe_indicators: {
107
+ title: string;
108
+ category: "payment" | "seller" | "platform" | "price" | "content";
109
+ severity: "high" | "medium" | "low";
110
+ description: string;
111
+ what_to_do: string;
112
+ }[];
113
+ safety_checklist: string[];
114
+ risk_score: number;
115
+ emotional_support: string;
116
+ translation?: string | null | undefined;
117
+ nuance_explanation?: string | null | undefined;
118
+ price_analysis?: {
119
+ price_assessment: string;
120
+ warnings: string[];
121
+ market_price_range?: string | null | undefined;
122
+ currency?: string | null | undefined;
123
+ offered_price?: number | null | undefined;
124
+ } | null | undefined;
125
+ }, {
126
+ cautions: {
127
+ title: string;
128
+ category: "payment" | "seller" | "platform" | "price" | "content";
129
+ severity: "high" | "medium" | "low";
130
+ description: string;
131
+ what_to_do: string;
132
+ }[];
133
+ recommendation: string;
134
+ risk_signals: {
135
+ title: string;
136
+ category: "payment" | "seller" | "platform" | "price" | "content";
137
+ severity: "high" | "medium" | "low";
138
+ description: string;
139
+ what_to_do: string;
140
+ }[];
141
+ safe_indicators: {
142
+ title: string;
143
+ category: "payment" | "seller" | "platform" | "price" | "content";
144
+ severity: "high" | "medium" | "low";
145
+ description: string;
146
+ what_to_do: string;
147
+ }[];
148
+ safety_checklist: string[];
149
+ risk_score: number;
150
+ emotional_support: string;
151
+ translation?: string | null | undefined;
152
+ nuance_explanation?: string | null | undefined;
153
+ price_analysis?: {
154
+ price_assessment: string;
155
+ warnings: string[];
156
+ market_price_range?: string | null | undefined;
157
+ currency?: string | null | undefined;
158
+ offered_price?: number | null | undefined;
159
+ } | null | undefined;
160
+ }>;
161
+ risk_score: z.ZodNumber;
162
+ expert_advice: z.ZodOptional<z.ZodNullable<z.ZodString>>;
163
+ expert_reviewed: z.ZodBoolean;
164
+ expert_reviewed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
165
+ expert_reviewed_by: z.ZodOptional<z.ZodNullable<z.ZodString>>;
166
+ created_at: z.ZodString;
167
+ updated_at: z.ZodString;
168
+ }, "strip", z.ZodTypeAny, {
169
+ id: string;
170
+ risk_score: number;
171
+ input_text: string;
172
+ llm_analysis: {
173
+ cautions: {
174
+ title: string;
175
+ category: "payment" | "seller" | "platform" | "price" | "content";
176
+ severity: "high" | "medium" | "low";
177
+ description: string;
178
+ what_to_do: string;
179
+ }[];
180
+ recommendation: string;
181
+ risk_signals: {
182
+ title: string;
183
+ category: "payment" | "seller" | "platform" | "price" | "content";
184
+ severity: "high" | "medium" | "low";
185
+ description: string;
186
+ what_to_do: string;
187
+ }[];
188
+ safe_indicators: {
189
+ title: string;
190
+ category: "payment" | "seller" | "platform" | "price" | "content";
191
+ severity: "high" | "medium" | "low";
192
+ description: string;
193
+ what_to_do: string;
194
+ }[];
195
+ safety_checklist: string[];
196
+ risk_score: number;
197
+ emotional_support: string;
198
+ translation?: string | null | undefined;
199
+ nuance_explanation?: string | null | undefined;
200
+ price_analysis?: {
201
+ price_assessment: string;
202
+ warnings: string[];
203
+ market_price_range?: string | null | undefined;
204
+ currency?: string | null | undefined;
205
+ offered_price?: number | null | undefined;
206
+ } | null | undefined;
207
+ };
208
+ expert_reviewed: boolean;
209
+ created_at: string;
210
+ updated_at: string;
211
+ user_id?: string | null | undefined;
212
+ expert_advice?: string | null | undefined;
213
+ expert_reviewed_at?: string | null | undefined;
214
+ expert_reviewed_by?: string | null | undefined;
215
+ }, {
216
+ id: string;
217
+ risk_score: number;
218
+ input_text: string;
219
+ llm_analysis: {
220
+ cautions: {
221
+ title: string;
222
+ category: "payment" | "seller" | "platform" | "price" | "content";
223
+ severity: "high" | "medium" | "low";
224
+ description: string;
225
+ what_to_do: string;
226
+ }[];
227
+ recommendation: string;
228
+ risk_signals: {
229
+ title: string;
230
+ category: "payment" | "seller" | "platform" | "price" | "content";
231
+ severity: "high" | "medium" | "low";
232
+ description: string;
233
+ what_to_do: string;
234
+ }[];
235
+ safe_indicators: {
236
+ title: string;
237
+ category: "payment" | "seller" | "platform" | "price" | "content";
238
+ severity: "high" | "medium" | "low";
239
+ description: string;
240
+ what_to_do: string;
241
+ }[];
242
+ safety_checklist: string[];
243
+ risk_score: number;
244
+ emotional_support: string;
245
+ translation?: string | null | undefined;
246
+ nuance_explanation?: string | null | undefined;
247
+ price_analysis?: {
248
+ price_assessment: string;
249
+ warnings: string[];
250
+ market_price_range?: string | null | undefined;
251
+ currency?: string | null | undefined;
252
+ offered_price?: number | null | undefined;
253
+ } | null | undefined;
254
+ };
255
+ expert_reviewed: boolean;
256
+ created_at: string;
257
+ updated_at: string;
258
+ user_id?: string | null | undefined;
259
+ expert_advice?: string | null | undefined;
260
+ expert_reviewed_at?: string | null | undefined;
261
+ expert_reviewed_by?: string | null | undefined;
262
+ }>;
263
+ export type TradeSafetyCheckFullResponse = z.infer<typeof tradeSafetyCheckResponseSchema>;
264
+ export interface QuickCheckRepositoryResponse {
265
+ id: string;
266
+ quick_summary: {
267
+ risk_signals_count: number;
268
+ cautions_count: number;
269
+ safe_indicators_count: number;
270
+ };
271
+ signup_required: true;
272
+ }
273
+ export type TradeSafetyCheckRepositoryResponse = TradeSafetyCheckFullResponse | QuickCheckRepositoryResponse;
274
+ export declare class TradeSafetyRepository extends BaseCrudRepository<TradeSafetyCheckRepositoryResponse> {
275
+ readonly resource = "trade-safety";
276
+ protected getDataSchema(): z.ZodUnion<[z.ZodObject<{
277
+ id: z.ZodString;
278
+ user_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
279
+ input_text: z.ZodString;
280
+ llm_analysis: z.ZodObject<{
281
+ translation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
282
+ nuance_explanation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
283
+ risk_signals: z.ZodArray<z.ZodObject<{
284
+ category: z.ZodEnum<["payment", "seller", "platform", "price", "content"]>;
285
+ severity: z.ZodEnum<["high", "medium", "low"]>;
286
+ title: z.ZodString;
287
+ description: z.ZodString;
288
+ what_to_do: z.ZodString;
289
+ }, "strip", z.ZodTypeAny, {
290
+ title: string;
291
+ category: "payment" | "seller" | "platform" | "price" | "content";
292
+ severity: "high" | "medium" | "low";
293
+ description: string;
294
+ what_to_do: string;
295
+ }, {
296
+ title: string;
297
+ category: "payment" | "seller" | "platform" | "price" | "content";
298
+ severity: "high" | "medium" | "low";
299
+ description: string;
300
+ what_to_do: string;
301
+ }>, "many">;
302
+ cautions: z.ZodArray<z.ZodObject<{
303
+ category: z.ZodEnum<["payment", "seller", "platform", "price", "content"]>;
304
+ severity: z.ZodEnum<["high", "medium", "low"]>;
305
+ title: z.ZodString;
306
+ description: z.ZodString;
307
+ what_to_do: z.ZodString;
308
+ }, "strip", z.ZodTypeAny, {
309
+ title: string;
310
+ category: "payment" | "seller" | "platform" | "price" | "content";
311
+ severity: "high" | "medium" | "low";
312
+ description: string;
313
+ what_to_do: string;
314
+ }, {
315
+ title: string;
316
+ category: "payment" | "seller" | "platform" | "price" | "content";
317
+ severity: "high" | "medium" | "low";
318
+ description: string;
319
+ what_to_do: string;
320
+ }>, "many">;
321
+ safe_indicators: z.ZodArray<z.ZodObject<{
322
+ category: z.ZodEnum<["payment", "seller", "platform", "price", "content"]>;
323
+ severity: z.ZodEnum<["high", "medium", "low"]>;
324
+ title: z.ZodString;
325
+ description: z.ZodString;
326
+ what_to_do: z.ZodString;
327
+ }, "strip", z.ZodTypeAny, {
328
+ title: string;
329
+ category: "payment" | "seller" | "platform" | "price" | "content";
330
+ severity: "high" | "medium" | "low";
331
+ description: string;
332
+ what_to_do: string;
333
+ }, {
334
+ title: string;
335
+ category: "payment" | "seller" | "platform" | "price" | "content";
336
+ severity: "high" | "medium" | "low";
337
+ description: string;
338
+ what_to_do: string;
339
+ }>, "many">;
340
+ price_analysis: z.ZodOptional<z.ZodNullable<z.ZodObject<{
341
+ market_price_range: z.ZodOptional<z.ZodNullable<z.ZodString>>;
342
+ offered_price: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
343
+ currency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
344
+ price_assessment: z.ZodString;
345
+ warnings: z.ZodArray<z.ZodString, "many">;
346
+ }, "strip", z.ZodTypeAny, {
347
+ price_assessment: string;
348
+ warnings: string[];
349
+ market_price_range?: string | null | undefined;
350
+ currency?: string | null | undefined;
351
+ offered_price?: number | null | undefined;
352
+ }, {
353
+ price_assessment: string;
354
+ warnings: string[];
355
+ market_price_range?: string | null | undefined;
356
+ currency?: string | null | undefined;
357
+ offered_price?: number | null | undefined;
358
+ }>>>;
359
+ safety_checklist: z.ZodArray<z.ZodString, "many">;
360
+ risk_score: z.ZodNumber;
361
+ recommendation: z.ZodString;
362
+ emotional_support: z.ZodString;
363
+ }, "strip", z.ZodTypeAny, {
364
+ cautions: {
365
+ title: string;
366
+ category: "payment" | "seller" | "platform" | "price" | "content";
367
+ severity: "high" | "medium" | "low";
368
+ description: string;
369
+ what_to_do: string;
370
+ }[];
371
+ recommendation: string;
372
+ risk_signals: {
373
+ title: string;
374
+ category: "payment" | "seller" | "platform" | "price" | "content";
375
+ severity: "high" | "medium" | "low";
376
+ description: string;
377
+ what_to_do: string;
378
+ }[];
379
+ safe_indicators: {
380
+ title: string;
381
+ category: "payment" | "seller" | "platform" | "price" | "content";
382
+ severity: "high" | "medium" | "low";
383
+ description: string;
384
+ what_to_do: string;
385
+ }[];
386
+ safety_checklist: string[];
387
+ risk_score: number;
388
+ emotional_support: string;
389
+ translation?: string | null | undefined;
390
+ nuance_explanation?: string | null | undefined;
391
+ price_analysis?: {
392
+ price_assessment: string;
393
+ warnings: string[];
394
+ market_price_range?: string | null | undefined;
395
+ currency?: string | null | undefined;
396
+ offered_price?: number | null | undefined;
397
+ } | null | undefined;
398
+ }, {
399
+ cautions: {
400
+ title: string;
401
+ category: "payment" | "seller" | "platform" | "price" | "content";
402
+ severity: "high" | "medium" | "low";
403
+ description: string;
404
+ what_to_do: string;
405
+ }[];
406
+ recommendation: string;
407
+ risk_signals: {
408
+ title: string;
409
+ category: "payment" | "seller" | "platform" | "price" | "content";
410
+ severity: "high" | "medium" | "low";
411
+ description: string;
412
+ what_to_do: string;
413
+ }[];
414
+ safe_indicators: {
415
+ title: string;
416
+ category: "payment" | "seller" | "platform" | "price" | "content";
417
+ severity: "high" | "medium" | "low";
418
+ description: string;
419
+ what_to_do: string;
420
+ }[];
421
+ safety_checklist: string[];
422
+ risk_score: number;
423
+ emotional_support: string;
424
+ translation?: string | null | undefined;
425
+ nuance_explanation?: string | null | undefined;
426
+ price_analysis?: {
427
+ price_assessment: string;
428
+ warnings: string[];
429
+ market_price_range?: string | null | undefined;
430
+ currency?: string | null | undefined;
431
+ offered_price?: number | null | undefined;
432
+ } | null | undefined;
433
+ }>;
434
+ risk_score: z.ZodNumber;
435
+ expert_advice: z.ZodOptional<z.ZodNullable<z.ZodString>>;
436
+ expert_reviewed: z.ZodBoolean;
437
+ expert_reviewed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
438
+ expert_reviewed_by: z.ZodOptional<z.ZodNullable<z.ZodString>>;
439
+ created_at: z.ZodString;
440
+ updated_at: z.ZodString;
441
+ }, "strip", z.ZodTypeAny, {
442
+ id: string;
443
+ risk_score: number;
444
+ input_text: string;
445
+ llm_analysis: {
446
+ cautions: {
447
+ title: string;
448
+ category: "payment" | "seller" | "platform" | "price" | "content";
449
+ severity: "high" | "medium" | "low";
450
+ description: string;
451
+ what_to_do: string;
452
+ }[];
453
+ recommendation: string;
454
+ risk_signals: {
455
+ title: string;
456
+ category: "payment" | "seller" | "platform" | "price" | "content";
457
+ severity: "high" | "medium" | "low";
458
+ description: string;
459
+ what_to_do: string;
460
+ }[];
461
+ safe_indicators: {
462
+ title: string;
463
+ category: "payment" | "seller" | "platform" | "price" | "content";
464
+ severity: "high" | "medium" | "low";
465
+ description: string;
466
+ what_to_do: string;
467
+ }[];
468
+ safety_checklist: string[];
469
+ risk_score: number;
470
+ emotional_support: string;
471
+ translation?: string | null | undefined;
472
+ nuance_explanation?: string | null | undefined;
473
+ price_analysis?: {
474
+ price_assessment: string;
475
+ warnings: string[];
476
+ market_price_range?: string | null | undefined;
477
+ currency?: string | null | undefined;
478
+ offered_price?: number | null | undefined;
479
+ } | null | undefined;
480
+ };
481
+ expert_reviewed: boolean;
482
+ created_at: string;
483
+ updated_at: string;
484
+ user_id?: string | null | undefined;
485
+ expert_advice?: string | null | undefined;
486
+ expert_reviewed_at?: string | null | undefined;
487
+ expert_reviewed_by?: string | null | undefined;
488
+ }, {
489
+ id: string;
490
+ risk_score: number;
491
+ input_text: string;
492
+ llm_analysis: {
493
+ cautions: {
494
+ title: string;
495
+ category: "payment" | "seller" | "platform" | "price" | "content";
496
+ severity: "high" | "medium" | "low";
497
+ description: string;
498
+ what_to_do: string;
499
+ }[];
500
+ recommendation: string;
501
+ risk_signals: {
502
+ title: string;
503
+ category: "payment" | "seller" | "platform" | "price" | "content";
504
+ severity: "high" | "medium" | "low";
505
+ description: string;
506
+ what_to_do: string;
507
+ }[];
508
+ safe_indicators: {
509
+ title: string;
510
+ category: "payment" | "seller" | "platform" | "price" | "content";
511
+ severity: "high" | "medium" | "low";
512
+ description: string;
513
+ what_to_do: string;
514
+ }[];
515
+ safety_checklist: string[];
516
+ risk_score: number;
517
+ emotional_support: string;
518
+ translation?: string | null | undefined;
519
+ nuance_explanation?: string | null | undefined;
520
+ price_analysis?: {
521
+ price_assessment: string;
522
+ warnings: string[];
523
+ market_price_range?: string | null | undefined;
524
+ currency?: string | null | undefined;
525
+ offered_price?: number | null | undefined;
526
+ } | null | undefined;
527
+ };
528
+ expert_reviewed: boolean;
529
+ created_at: string;
530
+ updated_at: string;
531
+ user_id?: string | null | undefined;
532
+ expert_advice?: string | null | undefined;
533
+ expert_reviewed_at?: string | null | undefined;
534
+ expert_reviewed_by?: string | null | undefined;
535
+ }>, z.ZodObject<{
536
+ id: z.ZodString;
537
+ quick_summary: z.ZodObject<{
538
+ risk_signals_count: z.ZodNumber;
539
+ cautions_count: z.ZodNumber;
540
+ safe_indicators_count: z.ZodNumber;
541
+ }, "strip", z.ZodTypeAny, {
542
+ risk_signals_count: number;
543
+ cautions_count: number;
544
+ safe_indicators_count: number;
545
+ }, {
546
+ risk_signals_count: number;
547
+ cautions_count: number;
548
+ safe_indicators_count: number;
549
+ }>;
550
+ signup_required: z.ZodLiteral<true>;
551
+ }, "strip", z.ZodTypeAny, {
552
+ id: string;
553
+ quick_summary: {
554
+ risk_signals_count: number;
555
+ cautions_count: number;
556
+ safe_indicators_count: number;
557
+ };
558
+ signup_required: true;
559
+ }, {
560
+ id: string;
561
+ quick_summary: {
562
+ risk_signals_count: number;
563
+ cautions_count: number;
564
+ safe_indicators_count: number;
565
+ };
566
+ signup_required: true;
567
+ }>]>;
568
+ }
569
+ export {};
570
+ //# sourceMappingURL=TradeSafetyRepository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TradeSafetyRepository.d.ts","sourceRoot":"","sources":["../../src/repositories/TradeSafetyRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwCxB,QAAA,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYlC,CAAC;AAGH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,8BAA8B,CACtC,CAAC;AAGF,MAAM,WAAW,4BAA4B;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE;QACb,kBAAkB,EAAE,MAAM,CAAC;QAC3B,cAAc,EAAE,MAAM,CAAC;QACvB,qBAAqB,EAAE,MAAM,CAAC;KAC/B,CAAC;IACF,eAAe,EAAE,IAAI,CAAC;CACvB;AAGD,MAAM,MAAM,kCAAkC,GAC1C,4BAA4B,GAC5B,4BAA4B,CAAC;AAYjC,qBAAa,qBAAsB,SAAQ,kBAAkB,CAAC,kCAAkC,CAAC;IAC/F,QAAQ,CAAC,QAAQ,kBAAkB;IAEnC,SAAS,CAAC,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGxB"}
@@ -0,0 +1,87 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ import { BaseCrudRepository } from "@aioia/core";
17
+ import { z } from "zod";
18
+ // Zod schema for nested objects
19
+ var riskSignalSchema = z.object({
20
+ category: z.enum(["payment", "seller", "platform", "price", "content"]),
21
+ severity: z.enum(["high", "medium", "low"]),
22
+ title: z.string(),
23
+ description: z.string(),
24
+ what_to_do: z.string(),
25
+ });
26
+ var priceAnalysisSchema = z
27
+ .object({
28
+ market_price_range: z.string().nullish(),
29
+ offered_price: z.number().nullish(),
30
+ currency: z.string().nullish(),
31
+ price_assessment: z.string(),
32
+ warnings: z.array(z.string()),
33
+ })
34
+ .nullish();
35
+ var tradeSafetyAnalysisSchema = z.object({
36
+ translation: z.string().nullish(),
37
+ nuance_explanation: z.string().nullish(),
38
+ risk_signals: z.array(riskSignalSchema),
39
+ cautions: z.array(riskSignalSchema),
40
+ safe_indicators: z.array(riskSignalSchema),
41
+ price_analysis: priceAnalysisSchema,
42
+ safety_checklist: z.array(z.string()),
43
+ risk_score: z.number(),
44
+ recommendation: z.string(),
45
+ emotional_support: z.string(),
46
+ });
47
+ var quickSummarySchema = z.object({
48
+ risk_signals_count: z.number(),
49
+ cautions_count: z.number(),
50
+ safe_indicators_count: z.number(),
51
+ });
52
+ var tradeSafetyCheckResponseSchema = z.object({
53
+ id: z.string(),
54
+ user_id: z.string().nullish(),
55
+ input_text: z.string(),
56
+ llm_analysis: tradeSafetyAnalysisSchema,
57
+ risk_score: z.number(),
58
+ expert_advice: z.string().nullish(),
59
+ expert_reviewed: z.boolean(),
60
+ expert_reviewed_at: z.string().nullish(),
61
+ expert_reviewed_by: z.string().nullish(),
62
+ created_at: z.string(),
63
+ updated_at: z.string(),
64
+ });
65
+ // Union schema for repository responses
66
+ var tradeSafetyCheckRepositoryResponseSchema = z.union([
67
+ tradeSafetyCheckResponseSchema,
68
+ z.object({
69
+ id: z.string(),
70
+ quick_summary: quickSummarySchema,
71
+ signup_required: z.literal(true),
72
+ }),
73
+ ]);
74
+ var TradeSafetyRepository = /** @class */ (function (_super) {
75
+ __extends(TradeSafetyRepository, _super);
76
+ function TradeSafetyRepository() {
77
+ var _this = _super !== null && _super.apply(this, arguments) || this;
78
+ _this.resource = "trade-safety";
79
+ return _this;
80
+ }
81
+ TradeSafetyRepository.prototype.getDataSchema = function () {
82
+ return tradeSafetyCheckRepositoryResponseSchema;
83
+ };
84
+ return TradeSafetyRepository;
85
+ }(BaseCrudRepository));
86
+ export { TradeSafetyRepository };
87
+ //# sourceMappingURL=TradeSafetyRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TradeSafetyRepository.js","sourceRoot":"","sources":["../../src/repositories/TradeSafetyRepository.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Trade Safety Repositories
3
+ * Repository pattern for API data access
4
+ */
5
+ export { TradeSafetyRepository } from "./TradeSafetyRepository";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/repositories/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}