@vezlo/assistant-server 1.4.0 → 2.0.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 (107) hide show
  1. package/README.md +56 -4
  2. package/database-schema.sql +193 -33
  3. package/dist/knexfile.d.ts.map +1 -1
  4. package/dist/knexfile.js +17 -8
  5. package/dist/knexfile.js.map +1 -1
  6. package/dist/src/config/database.d.ts.map +1 -1
  7. package/dist/src/config/database.js +9 -1
  8. package/dist/src/config/database.js.map +1 -1
  9. package/dist/src/config/knex.d.ts.map +1 -1
  10. package/dist/src/config/knex.js +22 -2
  11. package/dist/src/config/knex.js.map +1 -1
  12. package/dist/src/config/swagger.d.ts.map +1 -1
  13. package/dist/src/config/swagger.js +18 -71
  14. package/dist/src/config/swagger.js.map +1 -1
  15. package/dist/src/controllers/ApiKeyController.d.ts +17 -0
  16. package/dist/src/controllers/ApiKeyController.d.ts.map +1 -0
  17. package/dist/src/controllers/ApiKeyController.js +84 -0
  18. package/dist/src/controllers/ApiKeyController.js.map +1 -0
  19. package/dist/src/controllers/AuthController.d.ts +14 -0
  20. package/dist/src/controllers/AuthController.d.ts.map +1 -0
  21. package/dist/src/controllers/AuthController.js +212 -0
  22. package/dist/src/controllers/AuthController.js.map +1 -0
  23. package/dist/src/controllers/ChatController.d.ts +8 -5
  24. package/dist/src/controllers/ChatController.d.ts.map +1 -1
  25. package/dist/src/controllers/ChatController.js +139 -31
  26. package/dist/src/controllers/ChatController.js.map +1 -1
  27. package/dist/src/controllers/KnowledgeController.d.ts +5 -4
  28. package/dist/src/controllers/KnowledgeController.d.ts.map +1 -1
  29. package/dist/src/controllers/KnowledgeController.js +54 -16
  30. package/dist/src/controllers/KnowledgeController.js.map +1 -1
  31. package/dist/src/middleware/auth.d.ts +51 -0
  32. package/dist/src/middleware/auth.d.ts.map +1 -0
  33. package/dist/src/middleware/auth.js +232 -0
  34. package/dist/src/middleware/auth.js.map +1 -0
  35. package/dist/src/middleware/errorHandler.d.ts.map +1 -1
  36. package/dist/src/middleware/errorHandler.js +13 -19
  37. package/dist/src/middleware/errorHandler.js.map +1 -1
  38. package/dist/src/migrations/001_initial_schema.d.ts.map +1 -1
  39. package/dist/src/migrations/001_initial_schema.js +39 -64
  40. package/dist/src/migrations/001_initial_schema.js.map +1 -1
  41. package/dist/src/migrations/002_multitenancy_schema.d.ts +4 -0
  42. package/dist/src/migrations/002_multitenancy_schema.d.ts.map +1 -0
  43. package/dist/src/migrations/002_multitenancy_schema.js +119 -0
  44. package/dist/src/migrations/002_multitenancy_schema.js.map +1 -0
  45. package/dist/src/schemas/AuthSchemas.d.ts +89 -0
  46. package/dist/src/schemas/AuthSchemas.d.ts.map +1 -0
  47. package/dist/src/schemas/AuthSchemas.js +63 -0
  48. package/dist/src/schemas/AuthSchemas.js.map +1 -0
  49. package/dist/src/schemas/CommonSchemas.d.ts +62 -0
  50. package/dist/src/schemas/CommonSchemas.d.ts.map +1 -0
  51. package/dist/src/schemas/CommonSchemas.js +65 -0
  52. package/dist/src/schemas/CommonSchemas.js.map +1 -0
  53. package/dist/src/schemas/ConversationSchemas.d.ts +64 -27
  54. package/dist/src/schemas/ConversationSchemas.d.ts.map +1 -1
  55. package/dist/src/schemas/ConversationSchemas.js +28 -9
  56. package/dist/src/schemas/ConversationSchemas.js.map +1 -1
  57. package/dist/src/schemas/FeedbackSchemas.d.ts +43 -5
  58. package/dist/src/schemas/FeedbackSchemas.d.ts.map +1 -1
  59. package/dist/src/schemas/FeedbackSchemas.js +20 -2
  60. package/dist/src/schemas/FeedbackSchemas.js.map +1 -1
  61. package/dist/src/schemas/KnowledgeSchemas.d.ts +114 -35
  62. package/dist/src/schemas/KnowledgeSchemas.d.ts.map +1 -1
  63. package/dist/src/schemas/KnowledgeSchemas.js +58 -16
  64. package/dist/src/schemas/KnowledgeSchemas.js.map +1 -1
  65. package/dist/src/schemas/MessageSchemas.d.ts +57 -8
  66. package/dist/src/schemas/MessageSchemas.d.ts.map +1 -1
  67. package/dist/src/schemas/MessageSchemas.js +22 -3
  68. package/dist/src/schemas/MessageSchemas.js.map +1 -1
  69. package/dist/src/schemas/index.d.ts +410 -68
  70. package/dist/src/schemas/index.d.ts.map +1 -1
  71. package/dist/src/schemas/index.js +8 -2
  72. package/dist/src/schemas/index.js.map +1 -1
  73. package/dist/src/server.js +1047 -613
  74. package/dist/src/server.js.map +1 -1
  75. package/dist/src/services/AIService.d.ts +1 -1
  76. package/dist/src/services/AIService.d.ts.map +1 -1
  77. package/dist/src/services/AIService.js +6 -2
  78. package/dist/src/services/AIService.js.map +1 -1
  79. package/dist/src/services/ApiKeyService.d.ts +38 -0
  80. package/dist/src/services/ApiKeyService.d.ts.map +1 -0
  81. package/dist/src/services/ApiKeyService.js +123 -0
  82. package/dist/src/services/ApiKeyService.js.map +1 -0
  83. package/dist/src/services/KnowledgeBaseService.d.ts +2 -2
  84. package/dist/src/services/KnowledgeBaseService.d.ts.map +1 -1
  85. package/dist/src/services/KnowledgeBaseService.js +9 -2
  86. package/dist/src/services/KnowledgeBaseService.js.map +1 -1
  87. package/dist/src/services/MigrationService.d.ts +1 -1
  88. package/dist/src/services/MigrationService.d.ts.map +1 -1
  89. package/dist/src/services/MigrationService.js +4 -8
  90. package/dist/src/services/MigrationService.js.map +1 -1
  91. package/dist/src/services/SetupService.d.ts +102 -0
  92. package/dist/src/services/SetupService.d.ts.map +1 -0
  93. package/dist/src/services/SetupService.js +343 -0
  94. package/dist/src/services/SetupService.js.map +1 -0
  95. package/dist/src/storage/ConversationRepository.d.ts.map +1 -1
  96. package/dist/src/storage/ConversationRepository.js +42 -8
  97. package/dist/src/storage/ConversationRepository.js.map +1 -1
  98. package/dist/src/storage/MessageRepository.d.ts.map +1 -1
  99. package/dist/src/storage/MessageRepository.js +23 -27
  100. package/dist/src/storage/MessageRepository.js.map +1 -1
  101. package/env.example +5 -0
  102. package/knexfile.ts +17 -8
  103. package/package.json +10 -2
  104. package/scripts/generate-key.js +124 -0
  105. package/scripts/seed-default.js +72 -0
  106. package/scripts/setup.js +148 -13
  107. package/scripts/validate-db.js +22 -6
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.up = up;
4
+ exports.down = down;
5
+ async function up(knex) {
6
+ // ============================================================================
7
+ // COMPANIES TABLE
8
+ // ============================================================================
9
+ await knex.schema.createTable('vezlo_companies', (table) => {
10
+ table.bigIncrements('id').primary();
11
+ table.uuid('uuid').defaultTo(knex.raw('gen_random_uuid()')).unique().notNullable();
12
+ table.text('name').notNullable();
13
+ table.text('domain').unique();
14
+ table.timestamps(true, true); // created_at, updated_at with timezone
15
+ });
16
+ // ============================================================================
17
+ // USERS TABLE
18
+ // ============================================================================
19
+ await knex.schema.createTable('vezlo_users', (table) => {
20
+ table.bigIncrements('id').primary();
21
+ table.uuid('uuid').defaultTo(knex.raw('gen_random_uuid()')).unique().notNullable();
22
+ table.text('email').unique().notNullable();
23
+ table.text('name').notNullable();
24
+ table.text('password_hash').notNullable();
25
+ table.text('user_type').defaultTo('internal').comment('internal, external, admin');
26
+ table.timestamp('token_updated_at', { useTz: true }).defaultTo(knex.fn.now());
27
+ table.timestamps(true, true); // created_at, updated_at with timezone
28
+ });
29
+ // ============================================================================
30
+ // USER COMPANY PROFILES TABLE
31
+ // ============================================================================
32
+ await knex.schema.createTable('vezlo_user_company_profiles', (table) => {
33
+ table.bigIncrements('id').primary();
34
+ table.uuid('uuid').defaultTo(knex.raw('gen_random_uuid()')).unique().notNullable();
35
+ table.bigInteger('user_id').notNullable().references('id').inTable('vezlo_users').onDelete('CASCADE');
36
+ table.bigInteger('company_id').notNullable().references('id').inTable('vezlo_companies').onDelete('CASCADE');
37
+ table.text('role').defaultTo('user').comment('admin, user, viewer');
38
+ table.text('status').defaultTo('active').comment('active, inactive');
39
+ table.timestamps(true, true); // created_at, updated_at with timezone
40
+ table.unique(['user_id', 'company_id']);
41
+ });
42
+ // ============================================================================
43
+ // API KEYS TABLE
44
+ // ============================================================================
45
+ await knex.schema.createTable('vezlo_api_keys', (table) => {
46
+ table.bigIncrements('id').primary();
47
+ table.uuid('uuid').defaultTo(knex.raw('gen_random_uuid()')).unique().notNullable();
48
+ table.bigInteger('company_id').notNullable().references('id').inTable('vezlo_companies').onDelete('CASCADE');
49
+ table.text('name').notNullable();
50
+ table.text('key_hash').notNullable();
51
+ table.timestamp('expires_at', { useTz: true });
52
+ table.timestamps(true, true); // created_at, updated_at with timezone
53
+ });
54
+ // ============================================================================
55
+ // UPDATE EXISTING TABLES WITH FOREIGN KEYS
56
+ // ============================================================================
57
+ // Update conversations table
58
+ await knex.schema.alterTable('vezlo_conversations', (table) => {
59
+ // company_id already exists from Migration 001, just add foreign key constraint
60
+ table.foreign('company_id').references('id').inTable('vezlo_companies').onDelete('CASCADE');
61
+ });
62
+ // Update knowledge_items table
63
+ await knex.schema.alterTable('vezlo_knowledge_items', (table) => {
64
+ // company_id already exists from Migration 001, just add foreign key constraint
65
+ table.foreign('company_id').references('id').inTable('vezlo_companies').onDelete('CASCADE');
66
+ });
67
+ // Update message_feedback table
68
+ await knex.schema.alterTable('vezlo_message_feedback', (table) => {
69
+ // user_id already exists from Migration 001, just add foreign key constraint
70
+ table.foreign('user_id').references('id').inTable('vezlo_users').onDelete('CASCADE');
71
+ table.bigInteger('company_id').references('id').inTable('vezlo_companies').onDelete('CASCADE');
72
+ });
73
+ // ============================================================================
74
+ // INDEXES FOR PERFORMANCE
75
+ // ============================================================================
76
+ // Company indexes
77
+ await knex.schema.raw('CREATE INDEX IF NOT EXISTS idx_vezlo_companies_uuid ON vezlo_companies(uuid)');
78
+ await knex.schema.raw('CREATE INDEX IF NOT EXISTS idx_vezlo_companies_domain ON vezlo_companies(domain)');
79
+ // User indexes
80
+ await knex.schema.raw('CREATE INDEX IF NOT EXISTS idx_vezlo_users_uuid ON vezlo_users(uuid)');
81
+ await knex.schema.raw('CREATE INDEX IF NOT EXISTS idx_vezlo_users_email ON vezlo_users(email)');
82
+ await knex.schema.raw('CREATE INDEX IF NOT EXISTS idx_vezlo_users_user_type ON vezlo_users(user_type)');
83
+ await knex.schema.raw('CREATE INDEX IF NOT EXISTS idx_vezlo_users_token_updated_at ON vezlo_users(token_updated_at)');
84
+ // User-Company Profile indexes
85
+ await knex.schema.raw('CREATE INDEX IF NOT EXISTS idx_vezlo_user_company_profiles_user_id ON vezlo_user_company_profiles(user_id)');
86
+ await knex.schema.raw('CREATE INDEX IF NOT EXISTS idx_vezlo_user_company_profiles_company_id ON vezlo_user_company_profiles(company_id)');
87
+ await knex.schema.raw('CREATE INDEX IF NOT EXISTS idx_vezlo_user_company_profiles_uuid ON vezlo_user_company_profiles(uuid)');
88
+ await knex.schema.raw('CREATE INDEX IF NOT EXISTS idx_vezlo_user_company_profiles_role ON vezlo_user_company_profiles(role)');
89
+ await knex.schema.raw('CREATE INDEX IF NOT EXISTS idx_vezlo_user_company_profiles_status ON vezlo_user_company_profiles(status)');
90
+ // API Key indexes
91
+ await knex.schema.raw('CREATE INDEX IF NOT EXISTS idx_vezlo_api_keys_uuid ON vezlo_api_keys(uuid)');
92
+ await knex.schema.raw('CREATE INDEX IF NOT EXISTS idx_vezlo_api_keys_company_id ON vezlo_api_keys(company_id)');
93
+ await knex.schema.raw('CREATE INDEX IF NOT EXISTS idx_vezlo_api_keys_key_hash ON vezlo_api_keys(key_hash)');
94
+ await knex.schema.raw('CREATE INDEX IF NOT EXISTS idx_vezlo_api_keys_expires_at ON vezlo_api_keys(expires_at)');
95
+ // Updated foreign key indexes
96
+ await knex.schema.raw('CREATE INDEX IF NOT EXISTS idx_vezlo_conversations_company_id ON vezlo_conversations(company_id)');
97
+ await knex.schema.raw('CREATE INDEX IF NOT EXISTS idx_vezlo_knowledge_company_id ON vezlo_knowledge_items(company_id)');
98
+ await knex.schema.raw('CREATE INDEX IF NOT EXISTS idx_vezlo_feedback_user_id ON vezlo_message_feedback(user_id)');
99
+ await knex.schema.raw('CREATE INDEX IF NOT EXISTS idx_vezlo_feedback_company_id ON vezlo_message_feedback(company_id)');
100
+ }
101
+ async function down(knex) {
102
+ // Drop foreign key constraints first
103
+ await knex.schema.alterTable('vezlo_conversations', (table) => {
104
+ table.dropForeign('company_id');
105
+ });
106
+ await knex.schema.alterTable('vezlo_knowledge_items', (table) => {
107
+ table.dropForeign('company_id');
108
+ });
109
+ await knex.schema.alterTable('vezlo_message_feedback', (table) => {
110
+ table.dropForeign('user_id');
111
+ table.dropColumn('company_id');
112
+ });
113
+ // Drop tables in reverse order due to foreign key constraints
114
+ await knex.schema.dropTableIfExists('vezlo_api_keys');
115
+ await knex.schema.dropTableIfExists('vezlo_user_company_profiles');
116
+ await knex.schema.dropTableIfExists('vezlo_users');
117
+ await knex.schema.dropTableIfExists('vezlo_companies');
118
+ }
119
+ //# sourceMappingURL=002_multitenancy_schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"002_multitenancy_schema.js","sourceRoot":"","sources":["../../../src/migrations/002_multitenancy_schema.ts"],"names":[],"mappings":";;AAEA,gBA4GC;AAED,oBAoBC;AAlIM,KAAK,UAAU,EAAE,CAAC,IAAU;IACjC,+EAA+E;IAC/E,kBAAkB;IAClB,+EAA+E;IAC/E,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,iBAAiB,EAAE,CAAC,KAAK,EAAE,EAAE;QACzD,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;QACpC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC;QACnF,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;QACjC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC;QAC9B,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,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CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;AACzD,CAAC"}
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Authentication API Schemas
3
+ * All request/response schemas for authentication-related endpoints
4
+ */
5
+ export declare const AuthSchemas: {
6
+ LoginRequest: {
7
+ type: string;
8
+ required: string[];
9
+ properties: {
10
+ email: {
11
+ type: string;
12
+ format: string;
13
+ description: string;
14
+ };
15
+ password: {
16
+ type: string;
17
+ description: string;
18
+ };
19
+ };
20
+ };
21
+ LogoutRequest: {
22
+ type: string;
23
+ properties: {};
24
+ };
25
+ LoginResponse: {
26
+ type: string;
27
+ properties: {
28
+ access_token: {
29
+ type: string;
30
+ description: string;
31
+ };
32
+ };
33
+ };
34
+ LogoutResponse: {
35
+ type: string;
36
+ properties: {
37
+ success: {
38
+ type: string;
39
+ };
40
+ message: {
41
+ type: string;
42
+ };
43
+ };
44
+ };
45
+ MeResponse: {
46
+ type: string;
47
+ properties: {
48
+ user: {
49
+ type: string;
50
+ properties: {
51
+ uuid: {
52
+ type: string;
53
+ description: string;
54
+ };
55
+ email: {
56
+ type: string;
57
+ description: string;
58
+ };
59
+ name: {
60
+ type: string;
61
+ description: string;
62
+ };
63
+ };
64
+ };
65
+ profile: {
66
+ type: string;
67
+ properties: {
68
+ uuid: {
69
+ type: string;
70
+ description: string;
71
+ };
72
+ company_uuid: {
73
+ type: string;
74
+ description: string;
75
+ };
76
+ company_name: {
77
+ type: string;
78
+ description: string;
79
+ };
80
+ role: {
81
+ type: string;
82
+ description: string;
83
+ };
84
+ };
85
+ };
86
+ };
87
+ };
88
+ };
89
+ //# sourceMappingURL=AuthSchemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthSchemas.d.ts","sourceRoot":"","sources":["../../../src/schemas/AuthSchemas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DvB,CAAC"}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ /**
3
+ * Authentication API Schemas
4
+ * All request/response schemas for authentication-related endpoints
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.AuthSchemas = void 0;
8
+ exports.AuthSchemas = {
9
+ // ============================================================================
10
+ // AUTHENTICATION REQUEST SCHEMAS
11
+ // ============================================================================
12
+ LoginRequest: {
13
+ type: 'object',
14
+ required: ['email', 'password'],
15
+ properties: {
16
+ email: { type: 'string', format: 'email', description: 'User email address' },
17
+ password: { type: 'string', description: 'User password' }
18
+ }
19
+ },
20
+ LogoutRequest: {
21
+ type: 'object',
22
+ properties: {}
23
+ },
24
+ // ============================================================================
25
+ // AUTHENTICATION RESPONSE SCHEMAS
26
+ // ============================================================================
27
+ LoginResponse: {
28
+ type: 'object',
29
+ properties: {
30
+ access_token: { type: 'string', description: 'JWT access token' }
31
+ }
32
+ },
33
+ LogoutResponse: {
34
+ type: 'object',
35
+ properties: {
36
+ success: { type: 'boolean' },
37
+ message: { type: 'string' }
38
+ }
39
+ },
40
+ MeResponse: {
41
+ type: 'object',
42
+ properties: {
43
+ user: {
44
+ type: 'object',
45
+ properties: {
46
+ uuid: { type: 'string', description: 'User UUID' },
47
+ email: { type: 'string', description: 'User email' },
48
+ name: { type: 'string', description: 'User name' }
49
+ }
50
+ },
51
+ profile: {
52
+ type: 'object',
53
+ properties: {
54
+ uuid: { type: 'string', description: 'Profile UUID' },
55
+ company_uuid: { type: 'string', description: 'Company UUID' },
56
+ company_name: { type: 'string', description: 'Company name' },
57
+ role: { type: 'string', description: 'User role in company' }
58
+ }
59
+ }
60
+ }
61
+ }
62
+ };
63
+ //# sourceMappingURL=AuthSchemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthSchemas.js","sourceRoot":"","sources":["../../../src/schemas/AuthSchemas.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAE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EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE;oBACrD,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE;oBAC7D,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE;oBAC7D,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,sBAAsB,EAAE;iBAC9D;aACF;SACF;KACF;CACF,CAAC"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Common API Schemas
3
+ * Shared schemas for common responses across all endpoints
4
+ */
5
+ export declare const CommonSchemas: {
6
+ HealthCheck: {
7
+ type: string;
8
+ properties: {
9
+ server: {
10
+ type: string;
11
+ description: string;
12
+ example: string;
13
+ };
14
+ timestamp: {
15
+ type: string;
16
+ format: string;
17
+ description: string;
18
+ example: string;
19
+ };
20
+ database: {
21
+ type: string;
22
+ description: string;
23
+ example: string;
24
+ };
25
+ };
26
+ required: string[];
27
+ };
28
+ Error: {
29
+ type: string;
30
+ properties: {
31
+ error: {
32
+ type: string;
33
+ description: string;
34
+ example: string;
35
+ };
36
+ };
37
+ required: string[];
38
+ };
39
+ Success: {
40
+ type: string;
41
+ properties: {
42
+ success: {
43
+ type: string;
44
+ description: string;
45
+ example: boolean;
46
+ };
47
+ message: {
48
+ type: string;
49
+ description: string;
50
+ example: string;
51
+ };
52
+ timestamp: {
53
+ type: string;
54
+ format: string;
55
+ description: string;
56
+ example: string;
57
+ };
58
+ };
59
+ required: string[];
60
+ };
61
+ };
62
+ //# sourceMappingURL=CommonSchemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommonSchemas.d.ts","sourceRoot":"","sources":["../../../src/schemas/CommonSchemas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DzB,CAAC"}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ /**
3
+ * Common API Schemas
4
+ * Shared schemas for common responses across all endpoints
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.CommonSchemas = void 0;
8
+ exports.CommonSchemas = {
9
+ HealthCheck: {
10
+ type: 'object',
11
+ properties: {
12
+ server: {
13
+ type: 'string',
14
+ description: 'Server health status',
15
+ example: 'healthy'
16
+ },
17
+ timestamp: {
18
+ type: 'string',
19
+ format: 'date-time',
20
+ description: 'Current server timestamp',
21
+ example: '2025-10-27T06:52:40.215Z'
22
+ },
23
+ database: {
24
+ type: 'string',
25
+ description: 'Database connection status',
26
+ example: 'connected'
27
+ }
28
+ },
29
+ required: ['server', 'timestamp', 'database']
30
+ },
31
+ Error: {
32
+ type: 'object',
33
+ properties: {
34
+ error: {
35
+ type: 'string',
36
+ description: 'Error message',
37
+ example: 'No token provided'
38
+ }
39
+ },
40
+ required: ['error']
41
+ },
42
+ Success: {
43
+ type: 'object',
44
+ properties: {
45
+ success: {
46
+ type: 'boolean',
47
+ description: 'Indicates if the request was successful',
48
+ example: true
49
+ },
50
+ message: {
51
+ type: 'string',
52
+ description: 'Success message',
53
+ example: 'Operation completed successfully'
54
+ },
55
+ timestamp: {
56
+ type: 'string',
57
+ format: 'date-time',
58
+ description: 'Success timestamp',
59
+ example: '2025-10-27T06:52:40.215Z'
60
+ }
61
+ },
62
+ required: ['success']
63
+ }
64
+ };
65
+ //# sourceMappingURL=CommonSchemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommonSchemas.js","sourceRoot":"","sources":["../../../src/schemas/CommonSchemas.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEU,QAAA,aAAa,GAAG;IAC3B,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,sBAAsB;gBACnC,OAAO,EAAE,SAAS;aACnB;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,WAAW;gBACnB,WAAW,EAAE,0BAA0B;gBACvC,OAAO,EAAE,0BAA0B;aACpC;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,4BAA4B;gBACzC,OAAO,EAAE,WAAW;aACrB;SACF;QACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,UAAU,CAAC;KAC9C;IAED,KAAK,EAAE;QACL,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,eAAe;gBAC5B,OAAO,EAAE,mBAAmB;aAC7B;SACF;QACD,QAAQ,EAAE,CAAC,OAAO,CAAC;KACpB;IAED,OAAO,EAAE;QACP,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,yCAAyC;gBACtD,OAAO,EAAE,IAAI;aACd;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,iBAAiB;gBAC9B,OAAO,EAAE,kCAAkC;aAC5C;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,WAAW;gBACnB,WAAW,EAAE,mBAAmB;gBAChC,OAAO,EAAE,0BAA0B;aACpC;SACF;QACD,QAAQ,EAAE,CAAC,SAAS,CAAC;KACtB;CACF,CAAC"}
@@ -5,23 +5,12 @@
5
5
  export declare const ConversationSchemas: {
6
6
  CreateConversationRequest: {
7
7
  type: string;
8
- required: string[];
9
8
  properties: {
10
9
  title: {
11
10
  type: string;
12
11
  description: string;
13
12
  default: string;
14
13
  };
15
- user_uuid: {
16
- type: string;
17
- description: string;
18
- default: number;
19
- };
20
- company_uuid: {
21
- type: string;
22
- description: string;
23
- default: number;
24
- };
25
14
  };
26
15
  };
27
16
  UpdateConversationRequest: {
@@ -44,14 +33,6 @@ export declare const ConversationSchemas: {
44
33
  type: string;
45
34
  description: string;
46
35
  };
47
- user_uuid: {
48
- type: string;
49
- description: string;
50
- };
51
- company_uuid: {
52
- type: string;
53
- description: string;
54
- };
55
36
  message_count: {
56
37
  type: string;
57
38
  description: string;
@@ -60,10 +41,6 @@ export declare const ConversationSchemas: {
60
41
  type: string;
61
42
  format: string;
62
43
  };
63
- updated_at: {
64
- type: string;
65
- format: string;
66
- };
67
44
  };
68
45
  };
69
46
  ConversationWithMessages: {
@@ -93,10 +70,6 @@ export declare const ConversationSchemas: {
93
70
  type: string;
94
71
  format: string;
95
72
  };
96
- updated_at: {
97
- type: string;
98
- format: string;
99
- };
100
73
  messages: {
101
74
  type: string;
102
75
  items: {
@@ -128,5 +101,69 @@ export declare const ConversationSchemas: {
128
101
  };
129
102
  };
130
103
  };
104
+ CreateConversationResponse: {
105
+ type: string;
106
+ properties: {
107
+ uuid: {
108
+ type: string;
109
+ description: string;
110
+ };
111
+ title: {
112
+ type: string;
113
+ description: string;
114
+ };
115
+ user_uuid: {
116
+ type: string;
117
+ description: string;
118
+ };
119
+ company_uuid: {
120
+ type: string;
121
+ description: string;
122
+ };
123
+ message_count: {
124
+ type: string;
125
+ description: string;
126
+ };
127
+ created_at: {
128
+ type: string;
129
+ format: string;
130
+ };
131
+ };
132
+ };
133
+ GetConversationResponse: {
134
+ type: string;
135
+ properties: {
136
+ uuid: {
137
+ type: string;
138
+ description: string;
139
+ };
140
+ title: {
141
+ type: string;
142
+ description: string;
143
+ };
144
+ user_uuid: {
145
+ type: string;
146
+ description: string;
147
+ };
148
+ company_uuid: {
149
+ type: string;
150
+ description: string;
151
+ };
152
+ message_count: {
153
+ type: string;
154
+ description: string;
155
+ };
156
+ created_at: {
157
+ type: string;
158
+ format: string;
159
+ };
160
+ messages: {
161
+ type: string;
162
+ items: {
163
+ $ref: string;
164
+ };
165
+ };
166
+ };
167
+ };
131
168
  };
132
169
  //# sourceMappingURL=ConversationSchemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConversationSchemas.d.ts","sourceRoot":"","sources":["../../../src/schemas/ConversationSchemas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkE/B,CAAC"}
1
+ {"version":3,"file":"ConversationSchemas.d.ts","sourceRoot":"","sources":["../../../src/schemas/ConversationSchemas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuF/B,CAAC"}
@@ -11,11 +11,8 @@ exports.ConversationSchemas = {
11
11
  // ============================================================================
12
12
  CreateConversationRequest: {
13
13
  type: 'object',
14
- required: ['user_uuid'],
15
14
  properties: {
16
- title: { type: 'string', description: 'Conversation title', default: 'New Conversation' },
17
- user_uuid: { type: 'integer', description: 'User UUID who creates the conversation', default: 12345 },
18
- company_uuid: { type: 'integer', description: 'Optional company UUID', default: 67890 }
15
+ title: { type: 'string', description: 'Conversation title', default: 'New Conversation' }
19
16
  }
20
17
  },
21
18
  UpdateConversationRequest: {
@@ -32,11 +29,8 @@ exports.ConversationSchemas = {
32
29
  properties: {
33
30
  uuid: { type: 'string', description: 'Conversation UUID' },
34
31
  title: { type: 'string', description: 'Conversation title' },
35
- user_uuid: { type: 'string', description: 'User UUID' },
36
- company_uuid: { type: 'string', description: 'Company UUID' },
37
32
  message_count: { type: 'integer', description: 'Number of messages' },
38
- created_at: { type: 'string', format: 'date-time' },
39
- updated_at: { type: 'string', format: 'date-time' }
33
+ created_at: { type: 'string', format: 'date-time' }
40
34
  }
41
35
  },
42
36
  ConversationWithMessages: {
@@ -48,7 +42,6 @@ exports.ConversationSchemas = {
48
42
  company_uuid: { type: 'string', description: 'Company UUID' },
49
43
  message_count: { type: 'integer', description: 'Number of messages' },
50
44
  created_at: { type: 'string', format: 'date-time' },
51
- updated_at: { type: 'string', format: 'date-time' },
52
45
  messages: {
53
46
  type: 'array',
54
47
  items: { $ref: '#/components/schemas/MessageResponse' }
@@ -66,6 +59,32 @@ exports.ConversationSchemas = {
66
59
  limit: { type: 'integer', description: 'Conversations per page' },
67
60
  offset: { type: 'integer', description: 'Conversations skipped' }
68
61
  }
62
+ },
63
+ CreateConversationResponse: {
64
+ type: 'object',
65
+ properties: {
66
+ uuid: { type: 'string', description: 'Conversation UUID' },
67
+ title: { type: 'string', description: 'Conversation title' },
68
+ user_uuid: { type: 'string', description: 'User UUID' },
69
+ company_uuid: { type: 'string', description: 'Company UUID' },
70
+ message_count: { type: 'integer', description: 'Number of messages' },
71
+ created_at: { type: 'string', format: 'date-time' }
72
+ }
73
+ },
74
+ GetConversationResponse: {
75
+ type: 'object',
76
+ properties: {
77
+ uuid: { type: 'string', description: 'Conversation UUID' },
78
+ title: { type: 'string', description: 'Conversation title' },
79
+ user_uuid: { type: 'string', description: 'User UUID' },
80
+ company_uuid: { type: 'string', description: 'Company UUID' },
81
+ message_count: { type: 'integer', description: 'Number of messages' },
82
+ created_at: { type: 'string', format: 'date-time' },
83
+ messages: {
84
+ type: 'array',
85
+ items: { $ref: '#/components/schemas/MessageResponse' }
86
+ }
87
+ }
69
88
  }
70
89
  };
71
90
  //# sourceMappingURL=ConversationSchemas.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConversationSchemas.js","sourceRoot":"","sources":["../../../src/schemas/ConversationSchemas.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEU,QAAA,mBAAmB,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