@veruna/api-contracts 1.0.47 → 1.0.49

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 (55) hide show
  1. package/build/controllers/index.d.ts +1 -0
  2. package/build/controllers/index.js +3 -1
  3. package/build/controllers/s2s.controllers.d.ts +5 -0
  4. package/build/controllers/s2s.controllers.js +8 -0
  5. package/build/rest-api.d.ts +3 -0
  6. package/build/rest-api.js +4 -0
  7. package/build/routes/index.d.ts +1 -0
  8. package/build/routes/index.js +3 -1
  9. package/build/routes/message.routes.d.ts +2 -0
  10. package/build/routes/message.routes.js +2 -0
  11. package/build/routes/s2s.routes.d.ts +7 -0
  12. package/build/routes/s2s.routes.js +10 -0
  13. package/build/v1/ai/ai.errors.d.ts +3 -1
  14. package/build/v1/ai/ai.errors.js +11 -0
  15. package/build/v1/chat/commands/create-reg-chat.command.d.ts +9 -0
  16. package/build/v1/chat/commands/create-unreg-chat.command.d.ts +9 -0
  17. package/build/v1/chat/commands/update-chat-title.command.d.ts +9 -0
  18. package/build/v1/chat/commands/update-chat.command.d.ts +9 -0
  19. package/build/v1/chat/queries/get-last-active-chat.query.d.ts +9 -0
  20. package/build/v1/chat/queries/get-reg-chat.query.d.ts +9 -0
  21. package/build/v1/chat/queries/get-unreg-chat.query.d.ts +9 -0
  22. package/build/v1/chat/schemas/chat-with-messages-response.schema.d.ts +9 -0
  23. package/build/v1/index.d.ts +1 -0
  24. package/build/v1/index.js +1 -0
  25. package/build/v1/message/commands/create-message.command.d.ts +18 -0
  26. package/build/v1/message/message.errors.d.ts +1 -0
  27. package/build/v1/message/message.errors.js +5 -0
  28. package/build/v1/message/schemas/delete-message.schema.d.ts +15 -0
  29. package/build/v1/message/schemas/delete-message.schema.js +22 -0
  30. package/build/v1/message/schemas/generation-step.schema.d.ts +23 -0
  31. package/build/v1/message/schemas/generation-step.schema.js +33 -0
  32. package/build/v1/message/schemas/index.d.ts +6 -1
  33. package/build/v1/message/schemas/index.js +10 -1
  34. package/build/v1/message/schemas/message-meta.schema.d.ts +10 -0
  35. package/build/v1/message/schemas/message-meta.schema.js +3 -0
  36. package/build/v1/message/schemas/message-response.schema.d.ts +9 -0
  37. package/build/v1/message/schemas/message-status.enum.d.ts +2 -1
  38. package/build/v1/message/schemas/message-status.enum.js +1 -0
  39. package/build/v1/message/schemas/stream-events.schema.d.ts +55 -0
  40. package/build/v1/message/schemas/stream-events.schema.js +35 -1
  41. package/build/v1/s2s/index.d.ts +5 -0
  42. package/build/v1/s2s/index.js +24 -0
  43. package/build/v1/s2s/queries/get-user-by-session.query.d.ts +15 -0
  44. package/build/v1/s2s/queries/get-user-by-session.query.js +14 -0
  45. package/build/v1/s2s/queries/index.d.ts +1 -0
  46. package/build/v1/s2s/queries/index.js +17 -0
  47. package/build/v1/s2s/s2s.errors.d.ts +8 -0
  48. package/build/v1/s2s/s2s.errors.js +28 -0
  49. package/build/v1/s2s/schemas/index.d.ts +2 -0
  50. package/build/v1/s2s/schemas/index.js +18 -0
  51. package/build/v1/s2s/schemas/s2s-user-response.schema.d.ts +9 -0
  52. package/build/v1/s2s/schemas/s2s-user-response.schema.js +12 -0
  53. package/build/v1/s2s/schemas/session-id-param.schema.d.ts +8 -0
  54. package/build/v1/s2s/schemas/session-id-param.schema.js +13 -0
  55. package/package.json +1 -1
@@ -16,3 +16,4 @@ export { VERIFICATION_CONTROLLER } from './verification.controllers';
16
16
  export { SITEMAP_CONTROLLER } from './sitemap.controllers';
17
17
  export { WALLET_CONTROLLER } from './wallet.controllers';
18
18
  export { PAGE_HINTS_ADMIN_CONTROLLER } from './page-hints.controllers';
19
+ export { S2S_CONTROLLER } from './s2s.controllers';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PAGE_HINTS_ADMIN_CONTROLLER = exports.WALLET_CONTROLLER = exports.SITEMAP_CONTROLLER = exports.VERIFICATION_CONTROLLER = exports.MESSAGE_REG_CONTROLLER = exports.MESSAGE_UNREG_CONTROLLER = exports.CHAT_HISTORY_CONTROLLER = exports.CHAT_REG_CONTROLLER = exports.CHAT_UNREG_CONTROLLER = exports.CHAT_PROJECT_CONTROLLER = exports.FILE_CONTROLLER = exports.AI_MODEL_UNREG_CONTROLLER = exports.AI_MODEL_PUBLIC_CONTROLLER = exports.AI_MODEL_ADMIN_CONTROLLER = exports.AI_PROVIDER_PUBLIC_CONTROLLER = exports.AI_PROVIDER_ADMIN_CONTROLLER = exports.SEO_PAGES_PUBLIC_CONTROLLER = exports.SEO_PAGES_ADMIN_CONTROLLER = exports.BLOG_PUBLIC_POSTS_CONTROLLER = exports.BLOG_PUBLIC_CATEGORIES_CONTROLLER = exports.BLOG_ADMIN_POSTS_CONTROLLER = exports.BLOG_ADMIN_CATEGORIES_CONTROLLER = exports.UNREG_USERS_CONTROLLER = exports.USERS_CONTROLLER = exports.AUTH_CONTROLLER = void 0;
3
+ exports.S2S_CONTROLLER = exports.PAGE_HINTS_ADMIN_CONTROLLER = exports.WALLET_CONTROLLER = exports.SITEMAP_CONTROLLER = exports.VERIFICATION_CONTROLLER = exports.MESSAGE_REG_CONTROLLER = exports.MESSAGE_UNREG_CONTROLLER = exports.CHAT_HISTORY_CONTROLLER = exports.CHAT_REG_CONTROLLER = exports.CHAT_UNREG_CONTROLLER = exports.CHAT_PROJECT_CONTROLLER = exports.FILE_CONTROLLER = exports.AI_MODEL_UNREG_CONTROLLER = exports.AI_MODEL_PUBLIC_CONTROLLER = exports.AI_MODEL_ADMIN_CONTROLLER = exports.AI_PROVIDER_PUBLIC_CONTROLLER = exports.AI_PROVIDER_ADMIN_CONTROLLER = exports.SEO_PAGES_PUBLIC_CONTROLLER = exports.SEO_PAGES_ADMIN_CONTROLLER = exports.BLOG_PUBLIC_POSTS_CONTROLLER = exports.BLOG_PUBLIC_CATEGORIES_CONTROLLER = exports.BLOG_ADMIN_POSTS_CONTROLLER = exports.BLOG_ADMIN_CATEGORIES_CONTROLLER = exports.UNREG_USERS_CONTROLLER = exports.USERS_CONTROLLER = exports.AUTH_CONTROLLER = void 0;
4
4
  /**
5
5
  * Centralized exports for all controllers
6
6
  */
@@ -44,3 +44,5 @@ var wallet_controllers_1 = require("./wallet.controllers");
44
44
  Object.defineProperty(exports, "WALLET_CONTROLLER", { enumerable: true, get: function () { return wallet_controllers_1.WALLET_CONTROLLER; } });
45
45
  var page_hints_controllers_1 = require("./page-hints.controllers");
46
46
  Object.defineProperty(exports, "PAGE_HINTS_ADMIN_CONTROLLER", { enumerable: true, get: function () { return page_hints_controllers_1.PAGE_HINTS_ADMIN_CONTROLLER; } });
47
+ var s2s_controllers_1 = require("./s2s.controllers");
48
+ Object.defineProperty(exports, "S2S_CONTROLLER", { enumerable: true, get: function () { return s2s_controllers_1.S2S_CONTROLLER; } });
@@ -0,0 +1,5 @@
1
+ /**
2
+ * S2S (Server-to-Server) Controller paths
3
+ * For NestJS @Controller decorator
4
+ */
5
+ export declare const S2S_CONTROLLER: "s2s";
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.S2S_CONTROLLER = void 0;
4
+ /**
5
+ * S2S (Server-to-Server) Controller paths
6
+ * For NestJS @Controller decorator
7
+ */
8
+ exports.S2S_CONTROLLER = 's2s';
@@ -168,4 +168,7 @@ export declare const REST_API: {
168
168
  readonly BALANCE: "/api/v1/wallet/balance";
169
169
  };
170
170
  };
171
+ readonly S2S: {
172
+ readonly GET_USER_BY_SESSION: (sessionId: string) => string;
173
+ };
171
174
  };
package/build/rest-api.js CHANGED
@@ -187,4 +187,8 @@ exports.REST_API = {
187
187
  BALANCE: `${exports.ROOT}/${controllers_1.WALLET_CONTROLLER}/${routes_1.WALLET_ROUTES.BALANCE}`,
188
188
  },
189
189
  },
190
+ // S2S (Server-to-Server) endpoints
191
+ S2S: {
192
+ GET_USER_BY_SESSION: (sessionId) => `${exports.ROOT}/${controllers_1.S2S_CONTROLLER}/${routes_1.S2S_ROUTES.GET_USER_BY_SESSION.replace(':sessionId', sessionId)}`,
193
+ },
190
194
  };
@@ -22,3 +22,4 @@ export { VERIFICATION_ROUTES } from './verification.routes';
22
22
  export { SITEMAP_ROUTES } from './sitemap.routes';
23
23
  export { WALLET_ROUTES } from './wallet.routes';
24
24
  export { PAGE_HINTS_ROUTES } from './page-hints.routes';
25
+ export { S2S_ROUTES } from './s2s.routes';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PAGE_HINTS_ROUTES = exports.WALLET_ROUTES = exports.SITEMAP_ROUTES = exports.VERIFICATION_ROUTES = exports.MESSAGE_REG_ROUTES = exports.MESSAGE_UNREG_ROUTES = exports.CHAT_HISTORY_ROUTES = exports.CHAT_REG_ROUTES = exports.CHAT_UNREG_ROUTES = exports.CHAT_PROJECT_ROUTES = exports.FILE_ROUTES = exports.AI_MODEL_UNREG_ROUTES = exports.AI_MODEL_PUBLIC_ROUTES = exports.AI_MODEL_ADMIN_ROUTES = exports.AI_PROVIDER_PUBLIC_ROUTES = exports.AI_PROVIDER_ADMIN_ROUTES = exports.SEO_PAGES_PUBLIC_ROUTES = exports.SEO_PAGES_ADMIN_ROUTES = exports.BLOG_PUBLIC_POSTS_ROUTES = exports.BLOG_PUBLIC_CATEGORIES_ROUTES = exports.BLOG_ADMIN_POSTS_ROUTES = exports.BLOG_ADMIN_CATEGORIES_ROUTES = exports.UNREG_USERS_ROUTES = exports.USERS_ROUTES = exports.AUTH_ROUTES = void 0;
3
+ exports.S2S_ROUTES = exports.PAGE_HINTS_ROUTES = exports.WALLET_ROUTES = exports.SITEMAP_ROUTES = exports.VERIFICATION_ROUTES = exports.MESSAGE_REG_ROUTES = exports.MESSAGE_UNREG_ROUTES = exports.CHAT_HISTORY_ROUTES = exports.CHAT_REG_ROUTES = exports.CHAT_UNREG_ROUTES = exports.CHAT_PROJECT_ROUTES = exports.FILE_ROUTES = exports.AI_MODEL_UNREG_ROUTES = exports.AI_MODEL_PUBLIC_ROUTES = exports.AI_MODEL_ADMIN_ROUTES = exports.AI_PROVIDER_PUBLIC_ROUTES = exports.AI_PROVIDER_ADMIN_ROUTES = exports.SEO_PAGES_PUBLIC_ROUTES = exports.SEO_PAGES_ADMIN_ROUTES = exports.BLOG_PUBLIC_POSTS_ROUTES = exports.BLOG_PUBLIC_CATEGORIES_ROUTES = exports.BLOG_ADMIN_POSTS_ROUTES = exports.BLOG_ADMIN_CATEGORIES_ROUTES = exports.UNREG_USERS_ROUTES = exports.USERS_ROUTES = exports.AUTH_ROUTES = void 0;
4
4
  /**
5
5
  * Centralized exports for all routes
6
6
  */
@@ -50,3 +50,5 @@ var wallet_routes_1 = require("./wallet.routes");
50
50
  Object.defineProperty(exports, "WALLET_ROUTES", { enumerable: true, get: function () { return wallet_routes_1.WALLET_ROUTES; } });
51
51
  var page_hints_routes_1 = require("./page-hints.routes");
52
52
  Object.defineProperty(exports, "PAGE_HINTS_ROUTES", { enumerable: true, get: function () { return page_hints_routes_1.PAGE_HINTS_ROUTES; } });
53
+ var s2s_routes_1 = require("./s2s.routes");
54
+ Object.defineProperty(exports, "S2S_ROUTES", { enumerable: true, get: function () { return s2s_routes_1.S2S_ROUTES; } });
@@ -1,8 +1,10 @@
1
1
  export declare const MESSAGE_UNREG_ROUTES: {
2
2
  readonly SEND: "";
3
3
  readonly RATE: ":messageId/rating";
4
+ readonly DELETE: ":messageId";
4
5
  };
5
6
  export declare const MESSAGE_REG_ROUTES: {
6
7
  readonly SEND: "";
7
8
  readonly RATE: ":messageId/rating";
9
+ readonly DELETE: ":messageId";
8
10
  };
@@ -4,8 +4,10 @@ exports.MESSAGE_REG_ROUTES = exports.MESSAGE_UNREG_ROUTES = void 0;
4
4
  exports.MESSAGE_UNREG_ROUTES = {
5
5
  SEND: '',
6
6
  RATE: ':messageId/rating',
7
+ DELETE: ':messageId',
7
8
  };
8
9
  exports.MESSAGE_REG_ROUTES = {
9
10
  SEND: '',
10
11
  RATE: ':messageId/rating',
12
+ DELETE: ':messageId',
11
13
  };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * S2S (Server-to-Server) Routes
3
+ * For NestJS method decorators (@Get, @Post, etc.)
4
+ */
5
+ export declare const S2S_ROUTES: {
6
+ readonly GET_USER_BY_SESSION: "session/:sessionId/user";
7
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.S2S_ROUTES = void 0;
4
+ /**
5
+ * S2S (Server-to-Server) Routes
6
+ * For NestJS method decorators (@Get, @Post, etc.)
7
+ */
8
+ exports.S2S_ROUTES = {
9
+ GET_USER_BY_SESSION: 'session/:sessionId/user',
10
+ };
@@ -11,6 +11,8 @@ export declare enum AIErrorCode {
11
11
  COST_LIMIT_EXCEEDED = "COST_LIMIT_EXCEEDED",
12
12
  PROVIDER_ERROR = "PROVIDER_ERROR",
13
13
  PROVIDER_RATE_LIMIT = "PROVIDER_RATE_LIMIT",
14
- PROVIDER_TIMEOUT = "PROVIDER_TIMEOUT"
14
+ PROVIDER_TIMEOUT = "PROVIDER_TIMEOUT",
15
+ PROMPT_GENERATION_FAILED = "PROMPT_GENERATION_FAILED",
16
+ PROMPT_GENERATOR_MODEL_NOT_FOUND = "PROMPT_GENERATOR_MODEL_NOT_FOUND"
15
17
  }
16
18
  export declare const AI_ERRORS: Record<AIErrorCode, ErrorMetadata>;
@@ -19,6 +19,9 @@ var AIErrorCode;
19
19
  AIErrorCode["PROVIDER_ERROR"] = "PROVIDER_ERROR";
20
20
  AIErrorCode["PROVIDER_RATE_LIMIT"] = "PROVIDER_RATE_LIMIT";
21
21
  AIErrorCode["PROVIDER_TIMEOUT"] = "PROVIDER_TIMEOUT";
22
+ // Prompt Generation
23
+ AIErrorCode["PROMPT_GENERATION_FAILED"] = "PROMPT_GENERATION_FAILED";
24
+ AIErrorCode["PROMPT_GENERATOR_MODEL_NOT_FOUND"] = "PROMPT_GENERATOR_MODEL_NOT_FOUND";
22
25
  })(AIErrorCode || (exports.AIErrorCode = AIErrorCode = {}));
23
26
  exports.AI_ERRORS = {
24
27
  [AIErrorCode.GENERATION_FAILED]: {
@@ -69,4 +72,12 @@ exports.AI_ERRORS = {
69
72
  code: AIErrorCode.PROVIDER_TIMEOUT,
70
73
  statusCode: 504,
71
74
  },
75
+ [AIErrorCode.PROMPT_GENERATION_FAILED]: {
76
+ code: AIErrorCode.PROMPT_GENERATION_FAILED,
77
+ statusCode: 500,
78
+ },
79
+ [AIErrorCode.PROMPT_GENERATOR_MODEL_NOT_FOUND]: {
80
+ code: AIErrorCode.PROMPT_GENERATOR_MODEL_NOT_FOUND,
81
+ statusCode: 404,
82
+ },
72
83
  };
@@ -36,6 +36,15 @@ export declare namespace CreateRegChatCommand {
36
36
  summary: z.ZodOptional<z.ZodString>;
37
37
  }, z.core.$strip>>>;
38
38
  }, z.core.$strip>>;
39
+ steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
40
+ type: z.ZodEnum<typeof import("../..").GenerationStepType>;
41
+ content: z.ZodString;
42
+ modelId: z.ZodOptional<z.ZodString>;
43
+ modelTitle: z.ZodOptional<z.ZodString>;
44
+ includeInContext: z.ZodDefault<z.ZodBoolean>;
45
+ startedAt: z.ZodOptional<z.ZodString>;
46
+ completedAt: z.ZodOptional<z.ZodString>;
47
+ }, z.core.$strip>>>;
39
48
  }, z.core.$strip>>;
40
49
  createdAt: z.ZodString;
41
50
  updatedAt: z.ZodString;
@@ -34,6 +34,15 @@ export declare namespace CreateUnregChatCommand {
34
34
  summary: z.ZodOptional<z.ZodString>;
35
35
  }, z.core.$strip>>>;
36
36
  }, z.core.$strip>>;
37
+ steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
38
+ type: z.ZodEnum<typeof import("../..").GenerationStepType>;
39
+ content: z.ZodString;
40
+ modelId: z.ZodOptional<z.ZodString>;
41
+ modelTitle: z.ZodOptional<z.ZodString>;
42
+ includeInContext: z.ZodDefault<z.ZodBoolean>;
43
+ startedAt: z.ZodOptional<z.ZodString>;
44
+ completedAt: z.ZodOptional<z.ZodString>;
45
+ }, z.core.$strip>>>;
37
46
  }, z.core.$strip>>;
38
47
  createdAt: z.ZodString;
39
48
  updatedAt: z.ZodString;
@@ -36,6 +36,15 @@ export declare namespace UpdateChatTitleCommand {
36
36
  summary: z.ZodOptional<z.ZodString>;
37
37
  }, z.core.$strip>>>;
38
38
  }, z.core.$strip>>;
39
+ steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
40
+ type: z.ZodEnum<typeof import("../..").GenerationStepType>;
41
+ content: z.ZodString;
42
+ modelId: z.ZodOptional<z.ZodString>;
43
+ modelTitle: z.ZodOptional<z.ZodString>;
44
+ includeInContext: z.ZodDefault<z.ZodBoolean>;
45
+ startedAt: z.ZodOptional<z.ZodString>;
46
+ completedAt: z.ZodOptional<z.ZodString>;
47
+ }, z.core.$strip>>>;
39
48
  }, z.core.$strip>>;
40
49
  createdAt: z.ZodString;
41
50
  updatedAt: z.ZodString;
@@ -37,6 +37,15 @@ export declare namespace UpdateChatCommand {
37
37
  summary: z.ZodOptional<z.ZodString>;
38
38
  }, z.core.$strip>>>;
39
39
  }, z.core.$strip>>;
40
+ steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
41
+ type: z.ZodEnum<typeof import("../..").GenerationStepType>;
42
+ content: z.ZodString;
43
+ modelId: z.ZodOptional<z.ZodString>;
44
+ modelTitle: z.ZodOptional<z.ZodString>;
45
+ includeInContext: z.ZodDefault<z.ZodBoolean>;
46
+ startedAt: z.ZodOptional<z.ZodString>;
47
+ completedAt: z.ZodOptional<z.ZodString>;
48
+ }, z.core.$strip>>>;
40
49
  }, z.core.$strip>>;
41
50
  createdAt: z.ZodString;
42
51
  updatedAt: z.ZodString;
@@ -34,6 +34,15 @@ export declare namespace GetLastActiveChatQuery {
34
34
  summary: z.ZodOptional<z.ZodString>;
35
35
  }, z.core.$strip>>>;
36
36
  }, z.core.$strip>>;
37
+ steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
38
+ type: z.ZodEnum<typeof import("../..").GenerationStepType>;
39
+ content: z.ZodString;
40
+ modelId: z.ZodOptional<z.ZodString>;
41
+ modelTitle: z.ZodOptional<z.ZodString>;
42
+ includeInContext: z.ZodDefault<z.ZodBoolean>;
43
+ startedAt: z.ZodOptional<z.ZodString>;
44
+ completedAt: z.ZodOptional<z.ZodString>;
45
+ }, z.core.$strip>>>;
37
46
  }, z.core.$strip>>;
38
47
  createdAt: z.ZodString;
39
48
  updatedAt: z.ZodString;
@@ -34,6 +34,15 @@ export declare namespace GetRegChatQuery {
34
34
  summary: z.ZodOptional<z.ZodString>;
35
35
  }, z.core.$strip>>>;
36
36
  }, z.core.$strip>>;
37
+ steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
38
+ type: z.ZodEnum<typeof import("../..").GenerationStepType>;
39
+ content: z.ZodString;
40
+ modelId: z.ZodOptional<z.ZodString>;
41
+ modelTitle: z.ZodOptional<z.ZodString>;
42
+ includeInContext: z.ZodDefault<z.ZodBoolean>;
43
+ startedAt: z.ZodOptional<z.ZodString>;
44
+ completedAt: z.ZodOptional<z.ZodString>;
45
+ }, z.core.$strip>>>;
37
46
  }, z.core.$strip>>;
38
47
  createdAt: z.ZodString;
39
48
  updatedAt: z.ZodString;
@@ -34,6 +34,15 @@ export declare namespace GetUnregChatQuery {
34
34
  summary: z.ZodOptional<z.ZodString>;
35
35
  }, z.core.$strip>>>;
36
36
  }, z.core.$strip>>;
37
+ steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
38
+ type: z.ZodEnum<typeof import("../..").GenerationStepType>;
39
+ content: z.ZodString;
40
+ modelId: z.ZodOptional<z.ZodString>;
41
+ modelTitle: z.ZodOptional<z.ZodString>;
42
+ includeInContext: z.ZodDefault<z.ZodBoolean>;
43
+ startedAt: z.ZodOptional<z.ZodString>;
44
+ completedAt: z.ZodOptional<z.ZodString>;
45
+ }, z.core.$strip>>>;
37
46
  }, z.core.$strip>>;
38
47
  createdAt: z.ZodString;
39
48
  updatedAt: z.ZodString;
@@ -28,6 +28,15 @@ export declare const ChatWithMessagesResponseSchema: z.ZodObject<{
28
28
  summary: z.ZodOptional<z.ZodString>;
29
29
  }, z.core.$strip>>>;
30
30
  }, z.core.$strip>>;
31
+ steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
32
+ type: z.ZodEnum<typeof import("../..").GenerationStepType>;
33
+ content: z.ZodString;
34
+ modelId: z.ZodOptional<z.ZodString>;
35
+ modelTitle: z.ZodOptional<z.ZodString>;
36
+ includeInContext: z.ZodDefault<z.ZodBoolean>;
37
+ startedAt: z.ZodOptional<z.ZodString>;
38
+ completedAt: z.ZodOptional<z.ZodString>;
39
+ }, z.core.$strip>>>;
31
40
  }, z.core.$strip>>;
32
41
  createdAt: z.ZodString;
33
42
  updatedAt: z.ZodString;
@@ -18,3 +18,4 @@ export * from './email-validation';
18
18
  export * from './registration-antifraud';
19
19
  export * from './page-hints';
20
20
  export * from './s3';
21
+ export * from './s2s';
package/build/v1/index.js CHANGED
@@ -34,3 +34,4 @@ __exportStar(require("./email-validation"), exports);
34
34
  __exportStar(require("./registration-antifraud"), exports);
35
35
  __exportStar(require("./page-hints"), exports);
36
36
  __exportStar(require("./s3"), exports);
37
+ __exportStar(require("./s2s"), exports);
@@ -71,6 +71,24 @@ export declare namespace CreateMessageCommand {
71
71
  imageBase64: z.ZodString;
72
72
  imageMimeType: z.ZodString;
73
73
  imageIndex: z.ZodNumber;
74
+ }, z.core.$strip>, z.ZodObject<{
75
+ id: z.ZodNumber;
76
+ chatId: z.ZodString;
77
+ messageId: z.ZodString;
78
+ type: z.ZodLiteral<import("../schemas").StreamEventType.PROMPT_GENERATION>;
79
+ promptChunk: z.ZodString;
80
+ }, z.core.$strip>, z.ZodObject<{
81
+ id: z.ZodNumber;
82
+ chatId: z.ZodString;
83
+ messageId: z.ZodString;
84
+ type: z.ZodLiteral<import("../schemas").StreamEventType.STEP_DONE>;
85
+ stepType: z.ZodEnum<typeof import("../schemas").GenerationStepType>;
86
+ fullContent: z.ZodOptional<z.ZodString>;
87
+ }, z.core.$strip>, z.ZodObject<{
88
+ id: z.ZodNumber;
89
+ chatId: z.ZodString;
90
+ messageId: z.ZodString;
91
+ type: z.ZodLiteral<import("../schemas").StreamEventType.IMAGE_GENERATION_START>;
74
92
  }, z.core.$strip>, z.ZodObject<{
75
93
  id: z.ZodNumber;
76
94
  chatId: z.ZodString;
@@ -1,6 +1,7 @@
1
1
  import { ErrorMetadata } from '../../shared';
2
2
  export declare enum MessageErrorCode {
3
3
  MESSAGE_NOT_FOUND = "MESSAGE_NOT_FOUND",
4
+ MESSAGE_ALREADY_DELETED = "MESSAGE_ALREADY_DELETED",
4
5
  CHAT_NOT_FOUND = "CHAT_NOT_FOUND",
5
6
  CHAT_NOT_OWNED = "CHAT_NOT_OWNED",
6
7
  CHAT_DELETED = "CHAT_DELETED",
@@ -4,6 +4,7 @@ exports.MESSAGE_ERRORS = exports.MessageErrorCode = void 0;
4
4
  var MessageErrorCode;
5
5
  (function (MessageErrorCode) {
6
6
  MessageErrorCode["MESSAGE_NOT_FOUND"] = "MESSAGE_NOT_FOUND";
7
+ MessageErrorCode["MESSAGE_ALREADY_DELETED"] = "MESSAGE_ALREADY_DELETED";
7
8
  MessageErrorCode["CHAT_NOT_FOUND"] = "CHAT_NOT_FOUND";
8
9
  MessageErrorCode["CHAT_NOT_OWNED"] = "CHAT_NOT_OWNED";
9
10
  MessageErrorCode["CHAT_DELETED"] = "CHAT_DELETED";
@@ -21,6 +22,10 @@ exports.MESSAGE_ERRORS = {
21
22
  code: MessageErrorCode.MESSAGE_NOT_FOUND,
22
23
  statusCode: 404,
23
24
  },
25
+ [MessageErrorCode.MESSAGE_ALREADY_DELETED]: {
26
+ code: MessageErrorCode.MESSAGE_ALREADY_DELETED,
27
+ statusCode: 410,
28
+ },
24
29
  [MessageErrorCode.CHAT_NOT_FOUND]: {
25
30
  code: MessageErrorCode.CHAT_NOT_FOUND,
26
31
  statusCode: 404,
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Delete Message Params Schema
4
+ * Error messages: DeleteMessageParams.{field}.{rule}
5
+ */
6
+ export declare const DeleteMessageParamsSchema: z.ZodObject<{
7
+ pageId: z.ZodString;
8
+ chatId: z.ZodString;
9
+ messageId: z.ZodString;
10
+ }, z.core.$strip>;
11
+ export declare const DeleteMessageResponseSchema: z.ZodObject<{
12
+ uuid: z.ZodString;
13
+ }, z.core.$strip>;
14
+ export type DeleteMessageParamsDto = z.infer<typeof DeleteMessageParamsSchema>;
15
+ export type DeleteMessageResponseDto = z.infer<typeof DeleteMessageResponseSchema>;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleteMessageResponseSchema = exports.DeleteMessageParamsSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * Delete Message Params Schema
7
+ * Error messages: DeleteMessageParams.{field}.{rule}
8
+ */
9
+ exports.DeleteMessageParamsSchema = zod_1.z.object({
10
+ pageId: zod_1.z
11
+ .string({ error: 'DeleteMessageParams.pageId.required' })
12
+ .uuid({ message: 'DeleteMessageParams.pageId.invalid' }),
13
+ chatId: zod_1.z
14
+ .string({ error: 'DeleteMessageParams.chatId.required' })
15
+ .uuid({ message: 'DeleteMessageParams.chatId.invalid' }),
16
+ messageId: zod_1.z
17
+ .string({ error: 'DeleteMessageParams.messageId.required' })
18
+ .uuid({ message: 'DeleteMessageParams.messageId.invalid' }),
19
+ });
20
+ exports.DeleteMessageResponseSchema = zod_1.z.object({
21
+ uuid: zod_1.z.string().uuid(),
22
+ });
@@ -0,0 +1,23 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Generation step types for multi-stage generation
4
+ */
5
+ export declare enum GenerationStepType {
6
+ /** Prompt generation step (AI generates image prompt) */
7
+ PROMPT_GENERATION = "prompt_generation",
8
+ /** Image generation step */
9
+ IMAGE_GENERATION = "image_generation"
10
+ }
11
+ /**
12
+ * Single generation step in multi-stage process
13
+ */
14
+ export declare const GenerationStepSchema: z.ZodObject<{
15
+ type: z.ZodEnum<typeof GenerationStepType>;
16
+ content: z.ZodString;
17
+ modelId: z.ZodOptional<z.ZodString>;
18
+ modelTitle: z.ZodOptional<z.ZodString>;
19
+ includeInContext: z.ZodDefault<z.ZodBoolean>;
20
+ startedAt: z.ZodOptional<z.ZodString>;
21
+ completedAt: z.ZodOptional<z.ZodString>;
22
+ }, z.core.$strip>;
23
+ export type GenerationStep = z.infer<typeof GenerationStepSchema>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GenerationStepSchema = exports.GenerationStepType = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * Generation step types for multi-stage generation
7
+ */
8
+ var GenerationStepType;
9
+ (function (GenerationStepType) {
10
+ /** Prompt generation step (AI generates image prompt) */
11
+ GenerationStepType["PROMPT_GENERATION"] = "prompt_generation";
12
+ /** Image generation step */
13
+ GenerationStepType["IMAGE_GENERATION"] = "image_generation";
14
+ })(GenerationStepType || (exports.GenerationStepType = GenerationStepType = {}));
15
+ /**
16
+ * Single generation step in multi-stage process
17
+ */
18
+ exports.GenerationStepSchema = zod_1.z.object({
19
+ /** Step type identifier */
20
+ type: zod_1.z.nativeEnum(GenerationStepType),
21
+ /** Step content (e.g., generated prompt text) */
22
+ content: zod_1.z.string(),
23
+ /** Model UUID used for this step */
24
+ modelId: zod_1.z.string().uuid().optional(),
25
+ /** Model display name for UI */
26
+ modelTitle: zod_1.z.string().optional(),
27
+ /** Whether to include this step in context for future generations */
28
+ includeInContext: zod_1.z.boolean().default(false),
29
+ /** Timestamp when step started */
30
+ startedAt: zod_1.z.string().optional(),
31
+ /** Timestamp when step completed */
32
+ completedAt: zod_1.z.string().optional(),
33
+ });
@@ -4,9 +4,14 @@ export { UserRating } from './user-rating.enum';
4
4
  export { CreateMessageRequestSchema } from './create-message-request.schema';
5
5
  export { CreateMessageResponseSchema } from './create-message-response.schema';
6
6
  export { MessageResponseSchema } from './message-response.schema';
7
- export { StreamEventType, StreamEventSchema, StreamChunkEventSchema, StreamReasoningEventSchema, StreamImageEventSchema, StreamDoneEventSchema, StreamErrorEventSchema, } from './stream-events.schema';
7
+ export { StreamEventType, StreamEventSchema, StreamChunkEventSchema, StreamReasoningEventSchema, StreamImageEventSchema, StreamPromptGenerationEventSchema, StreamStepDoneEventSchema, StreamImageGenerationStartEventSchema, StreamDoneEventSchema, StreamErrorEventSchema, } from './stream-events.schema';
8
8
  export { AttachmentType, AttachmentSchema, AttachmentsSchema } from './message-attachment.schema';
9
9
  export type { Attachment, Attachments } from './message-attachment.schema';
10
10
  export { MessageMetaSchema, ReasoningMetaSchema, ReasoningDetailSchema, } from './message-meta.schema';
11
+ export type { MessageMetaData } from './message-meta.schema';
12
+ export { GenerationStepSchema, GenerationStepType } from './generation-step.schema';
13
+ export type { GenerationStep } from './generation-step.schema';
11
14
  export { RateMessageRequestSchema, RateMessageResponseSchema, RateMessageParamsSchema, } from './rate-message.schema';
12
15
  export type { RateMessageRequestDto, RateMessageResponseDto, RateMessageParamsDto, } from './rate-message.schema';
16
+ export { DeleteMessageParamsSchema, DeleteMessageResponseSchema } from './delete-message.schema';
17
+ export type { DeleteMessageParamsDto, DeleteMessageResponseDto } from './delete-message.schema';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RateMessageParamsSchema = exports.RateMessageResponseSchema = exports.RateMessageRequestSchema = exports.ReasoningDetailSchema = exports.ReasoningMetaSchema = exports.MessageMetaSchema = exports.AttachmentsSchema = exports.AttachmentSchema = exports.AttachmentType = exports.StreamErrorEventSchema = exports.StreamDoneEventSchema = exports.StreamImageEventSchema = exports.StreamReasoningEventSchema = exports.StreamChunkEventSchema = exports.StreamEventSchema = exports.StreamEventType = exports.MessageResponseSchema = exports.CreateMessageResponseSchema = exports.CreateMessageRequestSchema = exports.UserRating = exports.MessageStatus = exports.MessageRole = void 0;
3
+ exports.DeleteMessageResponseSchema = exports.DeleteMessageParamsSchema = exports.RateMessageParamsSchema = exports.RateMessageResponseSchema = exports.RateMessageRequestSchema = exports.GenerationStepType = exports.GenerationStepSchema = exports.ReasoningDetailSchema = exports.ReasoningMetaSchema = exports.MessageMetaSchema = exports.AttachmentsSchema = exports.AttachmentSchema = exports.AttachmentType = exports.StreamErrorEventSchema = exports.StreamDoneEventSchema = exports.StreamImageGenerationStartEventSchema = exports.StreamStepDoneEventSchema = exports.StreamPromptGenerationEventSchema = exports.StreamImageEventSchema = exports.StreamReasoningEventSchema = exports.StreamChunkEventSchema = exports.StreamEventSchema = exports.StreamEventType = exports.MessageResponseSchema = exports.CreateMessageResponseSchema = exports.CreateMessageRequestSchema = exports.UserRating = exports.MessageStatus = exports.MessageRole = void 0;
4
4
  var message_role_enum_1 = require("./message-role.enum");
5
5
  Object.defineProperty(exports, "MessageRole", { enumerable: true, get: function () { return message_role_enum_1.MessageRole; } });
6
6
  var message_status_enum_1 = require("./message-status.enum");
@@ -19,6 +19,9 @@ Object.defineProperty(exports, "StreamEventSchema", { enumerable: true, get: fun
19
19
  Object.defineProperty(exports, "StreamChunkEventSchema", { enumerable: true, get: function () { return stream_events_schema_1.StreamChunkEventSchema; } });
20
20
  Object.defineProperty(exports, "StreamReasoningEventSchema", { enumerable: true, get: function () { return stream_events_schema_1.StreamReasoningEventSchema; } });
21
21
  Object.defineProperty(exports, "StreamImageEventSchema", { enumerable: true, get: function () { return stream_events_schema_1.StreamImageEventSchema; } });
22
+ Object.defineProperty(exports, "StreamPromptGenerationEventSchema", { enumerable: true, get: function () { return stream_events_schema_1.StreamPromptGenerationEventSchema; } });
23
+ Object.defineProperty(exports, "StreamStepDoneEventSchema", { enumerable: true, get: function () { return stream_events_schema_1.StreamStepDoneEventSchema; } });
24
+ Object.defineProperty(exports, "StreamImageGenerationStartEventSchema", { enumerable: true, get: function () { return stream_events_schema_1.StreamImageGenerationStartEventSchema; } });
22
25
  Object.defineProperty(exports, "StreamDoneEventSchema", { enumerable: true, get: function () { return stream_events_schema_1.StreamDoneEventSchema; } });
23
26
  Object.defineProperty(exports, "StreamErrorEventSchema", { enumerable: true, get: function () { return stream_events_schema_1.StreamErrorEventSchema; } });
24
27
  var message_attachment_schema_1 = require("./message-attachment.schema");
@@ -29,7 +32,13 @@ var message_meta_schema_1 = require("./message-meta.schema");
29
32
  Object.defineProperty(exports, "MessageMetaSchema", { enumerable: true, get: function () { return message_meta_schema_1.MessageMetaSchema; } });
30
33
  Object.defineProperty(exports, "ReasoningMetaSchema", { enumerable: true, get: function () { return message_meta_schema_1.ReasoningMetaSchema; } });
31
34
  Object.defineProperty(exports, "ReasoningDetailSchema", { enumerable: true, get: function () { return message_meta_schema_1.ReasoningDetailSchema; } });
35
+ var generation_step_schema_1 = require("./generation-step.schema");
36
+ Object.defineProperty(exports, "GenerationStepSchema", { enumerable: true, get: function () { return generation_step_schema_1.GenerationStepSchema; } });
37
+ Object.defineProperty(exports, "GenerationStepType", { enumerable: true, get: function () { return generation_step_schema_1.GenerationStepType; } });
32
38
  var rate_message_schema_1 = require("./rate-message.schema");
33
39
  Object.defineProperty(exports, "RateMessageRequestSchema", { enumerable: true, get: function () { return rate_message_schema_1.RateMessageRequestSchema; } });
34
40
  Object.defineProperty(exports, "RateMessageResponseSchema", { enumerable: true, get: function () { return rate_message_schema_1.RateMessageResponseSchema; } });
35
41
  Object.defineProperty(exports, "RateMessageParamsSchema", { enumerable: true, get: function () { return rate_message_schema_1.RateMessageParamsSchema; } });
42
+ var delete_message_schema_1 = require("./delete-message.schema");
43
+ Object.defineProperty(exports, "DeleteMessageParamsSchema", { enumerable: true, get: function () { return delete_message_schema_1.DeleteMessageParamsSchema; } });
44
+ Object.defineProperty(exports, "DeleteMessageResponseSchema", { enumerable: true, get: function () { return delete_message_schema_1.DeleteMessageResponseSchema; } });
@@ -43,4 +43,14 @@ export declare const MessageMetaSchema: z.ZodObject<{
43
43
  summary: z.ZodOptional<z.ZodString>;
44
44
  }, z.core.$strip>>>;
45
45
  }, z.core.$strip>>;
46
+ steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
47
+ type: z.ZodEnum<typeof import("./generation-step.schema").GenerationStepType>;
48
+ content: z.ZodString;
49
+ modelId: z.ZodOptional<z.ZodString>;
50
+ modelTitle: z.ZodOptional<z.ZodString>;
51
+ includeInContext: z.ZodDefault<z.ZodBoolean>;
52
+ startedAt: z.ZodOptional<z.ZodString>;
53
+ completedAt: z.ZodOptional<z.ZodString>;
54
+ }, z.core.$strip>>>;
46
55
  }, z.core.$strip>;
56
+ export type MessageMetaData = z.infer<typeof MessageMetaSchema>;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MessageMetaSchema = exports.ReasoningMetaSchema = exports.ReasoningDetailSchema = void 0;
4
4
  const zod_1 = require("zod");
5
+ const generation_step_schema_1 = require("./generation-step.schema");
5
6
  /**
6
7
  * Reasoning detail from AI model (e.g., Claude extended thinking)
7
8
  * Supports both plain text and encrypted reasoning formats
@@ -32,4 +33,6 @@ exports.ReasoningMetaSchema = zod_1.z.object({
32
33
  exports.MessageMetaSchema = zod_1.z.object({
33
34
  /** AI model reasoning/thinking (for models that support extended thinking) */
34
35
  reasoning: exports.ReasoningMetaSchema.optional(),
36
+ /** Generation steps for multi-stage processes (e.g., prompt → image) */
37
+ steps: zod_1.z.array(generation_step_schema_1.GenerationStepSchema).optional(),
35
38
  });
@@ -22,6 +22,15 @@ export declare const MessageResponseSchema: z.ZodObject<{
22
22
  summary: z.ZodOptional<z.ZodString>;
23
23
  }, z.core.$strip>>>;
24
24
  }, z.core.$strip>>;
25
+ steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
26
+ type: z.ZodEnum<typeof import("./generation-step.schema").GenerationStepType>;
27
+ content: z.ZodString;
28
+ modelId: z.ZodOptional<z.ZodString>;
29
+ modelTitle: z.ZodOptional<z.ZodString>;
30
+ includeInContext: z.ZodDefault<z.ZodBoolean>;
31
+ startedAt: z.ZodOptional<z.ZodString>;
32
+ completedAt: z.ZodOptional<z.ZodString>;
33
+ }, z.core.$strip>>>;
25
34
  }, z.core.$strip>>;
26
35
  createdAt: z.ZodString;
27
36
  updatedAt: z.ZodString;
@@ -2,5 +2,6 @@ export declare enum MessageStatus {
2
2
  NEW = "new",
3
3
  GENERATING = "generating",
4
4
  GENERATED = "generated",
5
- ERROR = "error"
5
+ ERROR = "error",
6
+ DELETED = "deleted"
6
7
  }
@@ -7,4 +7,5 @@ var MessageStatus;
7
7
  MessageStatus["GENERATING"] = "generating";
8
8
  MessageStatus["GENERATED"] = "generated";
9
9
  MessageStatus["ERROR"] = "error";
10
+ MessageStatus["DELETED"] = "deleted";
10
11
  })(MessageStatus || (exports.MessageStatus = MessageStatus = {}));
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { GenerationStepType } from './generation-step.schema';
2
3
  /**
3
4
  * Stream Event Types for message streaming (NDJSON format)
4
5
  */
@@ -9,6 +10,12 @@ export declare enum StreamEventType {
9
10
  REASONING = "reasoning",
10
11
  /** Image generated by AI */
11
12
  IMAGE = "image",
13
+ /** Prompt generation chunk - AI generating image prompt */
14
+ PROMPT_GENERATION = "prompt_generation",
15
+ /** Generation step completed (NOT the whole stream) */
16
+ STEP_DONE = "step_done",
17
+ /** Image generation started */
18
+ IMAGE_GENERATION_START = "image_generation_start",
12
19
  /** Stream completed successfully */
13
20
  DONE = "done",
14
21
  /** Error occurred during streaming */
@@ -77,6 +84,36 @@ export declare const StreamImageEventSchema: z.ZodObject<{
77
84
  imageMimeType: z.ZodString;
78
85
  imageIndex: z.ZodNumber;
79
86
  }, z.core.$strip>;
87
+ /**
88
+ * Prompt generation chunk event - AI generating image prompt
89
+ */
90
+ export declare const StreamPromptGenerationEventSchema: z.ZodObject<{
91
+ id: z.ZodNumber;
92
+ chatId: z.ZodString;
93
+ messageId: z.ZodString;
94
+ type: z.ZodLiteral<StreamEventType.PROMPT_GENERATION>;
95
+ promptChunk: z.ZodString;
96
+ }, z.core.$strip>;
97
+ /**
98
+ * Step done event - a generation step completed (NOT the whole stream)
99
+ */
100
+ export declare const StreamStepDoneEventSchema: z.ZodObject<{
101
+ id: z.ZodNumber;
102
+ chatId: z.ZodString;
103
+ messageId: z.ZodString;
104
+ type: z.ZodLiteral<StreamEventType.STEP_DONE>;
105
+ stepType: z.ZodEnum<typeof GenerationStepType>;
106
+ fullContent: z.ZodOptional<z.ZodString>;
107
+ }, z.core.$strip>;
108
+ /**
109
+ * Image generation start event - signals start of image generation
110
+ */
111
+ export declare const StreamImageGenerationStartEventSchema: z.ZodObject<{
112
+ id: z.ZodNumber;
113
+ chatId: z.ZodString;
114
+ messageId: z.ZodString;
115
+ type: z.ZodLiteral<StreamEventType.IMAGE_GENERATION_START>;
116
+ }, z.core.$strip>;
80
117
  /**
81
118
  * Discriminated union of all stream events
82
119
  * Use `type` field to narrow the type
@@ -112,6 +149,24 @@ export declare const StreamEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
112
149
  imageBase64: z.ZodString;
113
150
  imageMimeType: z.ZodString;
114
151
  imageIndex: z.ZodNumber;
152
+ }, z.core.$strip>, z.ZodObject<{
153
+ id: z.ZodNumber;
154
+ chatId: z.ZodString;
155
+ messageId: z.ZodString;
156
+ type: z.ZodLiteral<StreamEventType.PROMPT_GENERATION>;
157
+ promptChunk: z.ZodString;
158
+ }, z.core.$strip>, z.ZodObject<{
159
+ id: z.ZodNumber;
160
+ chatId: z.ZodString;
161
+ messageId: z.ZodString;
162
+ type: z.ZodLiteral<StreamEventType.STEP_DONE>;
163
+ stepType: z.ZodEnum<typeof GenerationStepType>;
164
+ fullContent: z.ZodOptional<z.ZodString>;
165
+ }, z.core.$strip>, z.ZodObject<{
166
+ id: z.ZodNumber;
167
+ chatId: z.ZodString;
168
+ messageId: z.ZodString;
169
+ type: z.ZodLiteral<StreamEventType.IMAGE_GENERATION_START>;
115
170
  }, z.core.$strip>, z.ZodObject<{
116
171
  id: z.ZodNumber;
117
172
  chatId: z.ZodString;
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StreamEventSchema = exports.StreamImageEventSchema = exports.StreamErrorEventSchema = exports.StreamDoneEventSchema = exports.StreamReasoningEventSchema = exports.StreamChunkEventSchema = exports.StreamEventType = void 0;
3
+ exports.StreamEventSchema = exports.StreamImageGenerationStartEventSchema = exports.StreamStepDoneEventSchema = exports.StreamPromptGenerationEventSchema = exports.StreamImageEventSchema = exports.StreamErrorEventSchema = exports.StreamDoneEventSchema = exports.StreamReasoningEventSchema = exports.StreamChunkEventSchema = exports.StreamEventType = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const message_meta_schema_1 = require("./message-meta.schema");
6
+ const generation_step_schema_1 = require("./generation-step.schema");
6
7
  /**
7
8
  * Stream Event Types for message streaming (NDJSON format)
8
9
  */
@@ -14,6 +15,12 @@ var StreamEventType;
14
15
  StreamEventType["REASONING"] = "reasoning";
15
16
  /** Image generated by AI */
16
17
  StreamEventType["IMAGE"] = "image";
18
+ /** Prompt generation chunk - AI generating image prompt */
19
+ StreamEventType["PROMPT_GENERATION"] = "prompt_generation";
20
+ /** Generation step completed (NOT the whole stream) */
21
+ StreamEventType["STEP_DONE"] = "step_done";
22
+ /** Image generation started */
23
+ StreamEventType["IMAGE_GENERATION_START"] = "image_generation_start";
17
24
  /** Stream completed successfully */
18
25
  StreamEventType["DONE"] = "done";
19
26
  /** Error occurred during streaming */
@@ -83,6 +90,30 @@ exports.StreamImageEventSchema = BaseStreamEventSchema.extend({
83
90
  /** Image index (for multiple images in one message) */
84
91
  imageIndex: zod_1.z.number().int().nonnegative(),
85
92
  });
93
+ /**
94
+ * Prompt generation chunk event - AI generating image prompt
95
+ */
96
+ exports.StreamPromptGenerationEventSchema = BaseStreamEventSchema.extend({
97
+ type: zod_1.z.literal(StreamEventType.PROMPT_GENERATION),
98
+ /** Partial prompt text being generated */
99
+ promptChunk: zod_1.z.string(),
100
+ });
101
+ /**
102
+ * Step done event - a generation step completed (NOT the whole stream)
103
+ */
104
+ exports.StreamStepDoneEventSchema = BaseStreamEventSchema.extend({
105
+ type: zod_1.z.literal(StreamEventType.STEP_DONE),
106
+ /** Which step type completed */
107
+ stepType: zod_1.z.nativeEnum(generation_step_schema_1.GenerationStepType),
108
+ /** Full content of the completed step (in Russian for prompt_generation) */
109
+ fullContent: zod_1.z.string().optional(),
110
+ });
111
+ /**
112
+ * Image generation start event - signals start of image generation
113
+ */
114
+ exports.StreamImageGenerationStartEventSchema = BaseStreamEventSchema.extend({
115
+ type: zod_1.z.literal(StreamEventType.IMAGE_GENERATION_START),
116
+ });
86
117
  // ============================================================================
87
118
  // Union Schema
88
119
  // ============================================================================
@@ -94,6 +125,9 @@ exports.StreamEventSchema = zod_1.z.discriminatedUnion('type', [
94
125
  exports.StreamChunkEventSchema,
95
126
  exports.StreamReasoningEventSchema,
96
127
  exports.StreamImageEventSchema,
128
+ exports.StreamPromptGenerationEventSchema,
129
+ exports.StreamStepDoneEventSchema,
130
+ exports.StreamImageGenerationStartEventSchema,
97
131
  exports.StreamDoneEventSchema,
98
132
  exports.StreamErrorEventSchema,
99
133
  ]);
@@ -0,0 +1,5 @@
1
+ export * from './s2s.errors';
2
+ export * from './schemas';
3
+ export * from './queries';
4
+ export { S2S_CONTROLLER } from '../../controllers';
5
+ export { S2S_ROUTES } from '../../routes';
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.S2S_ROUTES = exports.S2S_CONTROLLER = void 0;
18
+ __exportStar(require("./s2s.errors"), exports);
19
+ __exportStar(require("./schemas"), exports);
20
+ __exportStar(require("./queries"), exports);
21
+ var controllers_1 = require("../../controllers");
22
+ Object.defineProperty(exports, "S2S_CONTROLLER", { enumerable: true, get: function () { return controllers_1.S2S_CONTROLLER; } });
23
+ var routes_1 = require("../../routes");
24
+ Object.defineProperty(exports, "S2S_ROUTES", { enumerable: true, get: function () { return routes_1.S2S_ROUTES; } });
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ import { HttpMethod } from '../../../shared/http-method';
3
+ export declare namespace S2SGetUserBySessionQuery {
4
+ const Params: z.ZodObject<{
5
+ sessionId: z.ZodString;
6
+ }, z.core.$strip>;
7
+ const Response: z.ZodObject<{
8
+ uuid: z.ZodString;
9
+ role: z.ZodString;
10
+ }, z.core.$strip>;
11
+ const URL: (sessionId: string) => string;
12
+ const METHOD = HttpMethod.GET;
13
+ type ParamsType = z.infer<typeof Params>;
14
+ type ResponseType = z.infer<typeof Response>;
15
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.S2SGetUserBySessionQuery = void 0;
4
+ const s2s_user_response_schema_1 = require("../schemas/s2s-user-response.schema");
5
+ const session_id_param_schema_1 = require("../schemas/session-id-param.schema");
6
+ const rest_api_1 = require("../../../rest-api");
7
+ const http_method_1 = require("../../../shared/http-method");
8
+ var S2SGetUserBySessionQuery;
9
+ (function (S2SGetUserBySessionQuery) {
10
+ S2SGetUserBySessionQuery.Params = session_id_param_schema_1.SessionIdParamSchema;
11
+ S2SGetUserBySessionQuery.Response = s2s_user_response_schema_1.S2SUserResponseSchema;
12
+ S2SGetUserBySessionQuery.URL = rest_api_1.REST_API.S2S.GET_USER_BY_SESSION;
13
+ S2SGetUserBySessionQuery.METHOD = http_method_1.HttpMethod.GET;
14
+ })(S2SGetUserBySessionQuery || (exports.S2SGetUserBySessionQuery = S2SGetUserBySessionQuery = {}));
@@ -0,0 +1 @@
1
+ export * from './get-user-by-session.query';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./get-user-by-session.query"), exports);
@@ -0,0 +1,8 @@
1
+ import { ErrorMetadata } from '../../shared';
2
+ export declare enum S2SErrorCode {
3
+ INVALID_API_KEY = "S2S_INVALID_API_KEY",
4
+ SESSION_NOT_FOUND = "S2S_SESSION_NOT_FOUND",
5
+ SESSION_INACTIVE = "S2S_SESSION_INACTIVE",
6
+ USER_NOT_FOUND = "S2S_USER_NOT_FOUND"
7
+ }
8
+ export declare const S2S_ERRORS: Record<S2SErrorCode, ErrorMetadata>;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.S2S_ERRORS = exports.S2SErrorCode = void 0;
4
+ var S2SErrorCode;
5
+ (function (S2SErrorCode) {
6
+ S2SErrorCode["INVALID_API_KEY"] = "S2S_INVALID_API_KEY";
7
+ S2SErrorCode["SESSION_NOT_FOUND"] = "S2S_SESSION_NOT_FOUND";
8
+ S2SErrorCode["SESSION_INACTIVE"] = "S2S_SESSION_INACTIVE";
9
+ S2SErrorCode["USER_NOT_FOUND"] = "S2S_USER_NOT_FOUND";
10
+ })(S2SErrorCode || (exports.S2SErrorCode = S2SErrorCode = {}));
11
+ exports.S2S_ERRORS = {
12
+ [S2SErrorCode.INVALID_API_KEY]: {
13
+ code: S2SErrorCode.INVALID_API_KEY,
14
+ statusCode: 401,
15
+ },
16
+ [S2SErrorCode.SESSION_NOT_FOUND]: {
17
+ code: S2SErrorCode.SESSION_NOT_FOUND,
18
+ statusCode: 404,
19
+ },
20
+ [S2SErrorCode.SESSION_INACTIVE]: {
21
+ code: S2SErrorCode.SESSION_INACTIVE,
22
+ statusCode: 404,
23
+ },
24
+ [S2SErrorCode.USER_NOT_FOUND]: {
25
+ code: S2SErrorCode.USER_NOT_FOUND,
26
+ statusCode: 404,
27
+ },
28
+ };
@@ -0,0 +1,2 @@
1
+ export * from './s2s-user-response.schema';
2
+ export * from './session-id-param.schema';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./s2s-user-response.schema"), exports);
18
+ __exportStar(require("./session-id-param.schema"), exports);
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * S2S User Response Schema
4
+ * Minimal user data for service-to-service communication
5
+ */
6
+ export declare const S2SUserResponseSchema: z.ZodObject<{
7
+ uuid: z.ZodString;
8
+ role: z.ZodString;
9
+ }, z.core.$strip>;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.S2SUserResponseSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * S2S User Response Schema
7
+ * Minimal user data for service-to-service communication
8
+ */
9
+ exports.S2SUserResponseSchema = zod_1.z.object({
10
+ uuid: zod_1.z.string(),
11
+ role: zod_1.z.string(),
12
+ });
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Session ID Param Schema for S2S endpoints
4
+ * Error messages: SessionIdParam.{field}.{rule}
5
+ */
6
+ export declare const SessionIdParamSchema: z.ZodObject<{
7
+ sessionId: z.ZodString;
8
+ }, z.core.$strip>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SessionIdParamSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * Session ID Param Schema for S2S endpoints
7
+ * Error messages: SessionIdParam.{field}.{rule}
8
+ */
9
+ exports.SessionIdParamSchema = zod_1.z.object({
10
+ sessionId: zod_1.z
11
+ .string({ error: 'SessionIdParam.sessionId.required' })
12
+ .uuid({ message: 'SessionIdParam.sessionId.invalid' }),
13
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veruna/api-contracts",
3
- "version": "1.0.47",
3
+ "version": "1.0.49",
4
4
  "description": "API contracts for Veruna project - Zod schemas, types, and paths",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",