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,6 @@
1
+ /**
2
+ * Trade Safety Repositories
3
+ * Repository pattern for API data access
4
+ */
5
+ export { TradeSafetyRepository } from "./TradeSafetyRepository";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/repositories/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,67 @@
1
+ export type RiskSeverity = "high" | "medium" | "low";
2
+ export type RiskCategory = "payment" | "seller" | "platform" | "price" | "content";
3
+ /**
4
+ * Risk score thresholds for Trade Safety checks
5
+ * Used consistently across Public and Admin interfaces
6
+ */
7
+ export declare const RISK_SCORE_THRESHOLDS: {
8
+ readonly high: 70;
9
+ readonly medium: 40;
10
+ };
11
+ export interface TradeSafetyCheckRequest {
12
+ input_text: string;
13
+ }
14
+ export interface RiskSignal {
15
+ category: RiskCategory;
16
+ severity: RiskSeverity;
17
+ title: string;
18
+ description: string;
19
+ what_to_do: string;
20
+ }
21
+ export interface PriceAnalysis {
22
+ market_price_range?: string | null;
23
+ offered_price?: number | null;
24
+ currency?: string | null;
25
+ price_assessment: string;
26
+ warnings: string[];
27
+ }
28
+ export interface TradeSafetyAnalysis {
29
+ translation?: string | null;
30
+ nuance_explanation?: string | null;
31
+ risk_signals: RiskSignal[];
32
+ cautions: RiskSignal[];
33
+ safe_indicators: RiskSignal[];
34
+ price_analysis?: PriceAnalysis | null;
35
+ safety_checklist: string[];
36
+ risk_score: number;
37
+ recommendation: string;
38
+ emotional_support: string;
39
+ }
40
+ export interface QuickSummary {
41
+ risk_signals_count: number;
42
+ cautions_count: number;
43
+ safe_indicators_count: number;
44
+ }
45
+ export interface TradeSafetyCheckResponse {
46
+ id: string;
47
+ user_id?: string | null;
48
+ input_text: string;
49
+ llm_analysis: TradeSafetyAnalysis;
50
+ risk_score: number;
51
+ expert_advice?: string | null;
52
+ expert_reviewed: boolean;
53
+ expert_reviewed_at?: string | null;
54
+ expert_reviewed_by?: string | null;
55
+ created_at: string;
56
+ updated_at: string;
57
+ }
58
+ export interface QuickCheckResponse {
59
+ id: string;
60
+ quick_summary: QuickSummary;
61
+ signup_required: true;
62
+ }
63
+ export interface TradeSafetyEditFormData {
64
+ expert_advice?: string | null;
65
+ expert_reviewed: boolean;
66
+ }
67
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AACrD,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,QAAQ,GACR,UAAU,GACV,OAAO,GACP,SAAS,CAAC;AAEd;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;CAIxB,CAAC;AAEX,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,YAAY,CAAC;IACvB,QAAQ,EAAE,YAAY,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IAC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,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,YAAY,CAAC;IAC5B,eAAe,EAAE,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,uBAAuB;IACtC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,eAAe,EAAE,OAAO,CAAC;CAC1B"}
package/dist/types.js ADDED
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Risk score thresholds for Trade Safety checks
3
+ * Used consistently across Public and Admin interfaces
4
+ */
5
+ export var RISK_SCORE_THRESHOLDS = {
6
+ high: 70, // >= 70: High risk (red)
7
+ medium: 40, // >= 40: Medium risk (yellow)
8
+ // < 40: Low risk (green)
9
+ };
10
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,MAAM,CAAC,IAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,EAAE,EAAE,yBAAyB;IACnC,MAAM,EAAE,EAAE,EAAE,8BAA8B;IAC1C,yBAAyB;CACjB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,84 @@
1
+ {
2
+ "name": "trade-safety",
3
+ "version": "0.1.0",
4
+ "description": "React components for Trade Safety - K-pop merchandise trade safety analysis",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "scripts": {
11
+ "dev": "next dev",
12
+ "build": "next build",
13
+ "start": "next start",
14
+ "build:lib": "tsc --project tsconfig.lib.json",
15
+ "dev:lib": "tsc --project tsconfig.lib.json --watch",
16
+ "clean": "rm -rf dist .next",
17
+ "type-check": "tsc --noEmit",
18
+ "lint": "next lint",
19
+ "lint:fix": "eslint src --ext .ts,.tsx --fix",
20
+ "test": "jest",
21
+ "test:watch": "jest --watch",
22
+ "test:coverage": "jest --coverage",
23
+ "format": "prettier --write .",
24
+ "check-format": "prettier --check ."
25
+ },
26
+ "keywords": [
27
+ "kpop",
28
+ "merchandise",
29
+ "trade",
30
+ "safety",
31
+ "react",
32
+ "components"
33
+ ],
34
+ "author": "AIoIA, Inc.",
35
+ "license": "Apache-2.0",
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "https://github.com/algorima/trade-safety.git",
39
+ "directory": "frontend"
40
+ },
41
+ "peerDependencies": {
42
+ "@aioia/core": "^0.2.1",
43
+ "next": "^13.0.0 || ^14.0.0",
44
+ "react": "^18.0.0",
45
+ "react-dom": "^18.0.0"
46
+ },
47
+ "dependencies": {
48
+ "@heroicons/react": "^2",
49
+ "clsx": "^2.1.1",
50
+ "framer-motion": "^11.2.3",
51
+ "i18next": "^23.11.4",
52
+ "i18next-resources-to-backend": "^1.2.1",
53
+ "react-i18next": "^14.1.1",
54
+ "zod": "^3.23.8"
55
+ },
56
+ "devDependencies": {
57
+ "@sentry/nextjs": "^7.113.0",
58
+ "@storybook/react": "^8.0.9",
59
+ "@tailwindcss/typography": "^0.5.13",
60
+ "@testing-library/jest-dom": "^6.4.3",
61
+ "@testing-library/react": "^15.0.6",
62
+ "@types/jest": "^29.5.x",
63
+ "@types/node": "^20",
64
+ "@types/react": "^18",
65
+ "@types/react-dom": "^18",
66
+ "@typescript-eslint/eslint-plugin": "^6.21.0",
67
+ "@typescript-eslint/parser": "^6.21.0",
68
+ "autoprefixer": "^10",
69
+ "daisyui": "^4.10.5",
70
+ "eslint": "^8",
71
+ "eslint-config-next": "13.5.6",
72
+ "eslint-plugin-storybook": "^0.8.0",
73
+ "eslint-plugin-tailwindcss": "^3.18.0",
74
+ "jest": "^29.5.x",
75
+ "jest-environment-jsdom": "^29",
76
+ "postcss": "^8",
77
+ "prettier": "^3",
78
+ "prettier-plugin-tailwindcss": "^0.5.14",
79
+ "tailwindcss": "^3",
80
+ "semantic-release": "^24.0.0",
81
+ "ts-jest": "^29",
82
+ "typescript": "^5"
83
+ }
84
+ }