rapida-partner 1.19.1 → 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 (92) hide show
  1. package/README.md +73 -43
  2. package/index.ts +87 -13
  3. package/package.json +2 -2
  4. package/src/controllers/ts_project_to_json_project.ts +12 -11
  5. package/src/enums/form.enum.ts +3 -0
  6. package/src/examples/components/forms/actor.form.ts +57 -5
  7. package/src/examples/components/forms/character.form.ts +6 -1
  8. package/src/examples/components/forms/company.form.ts +9 -5
  9. package/src/examples/components/forms/movie.form.ts +21 -5
  10. package/src/examples/components/forms/movieEpisode.form.ts +10 -5
  11. package/src/examples/components/forms/movieGenre.form.ts +6 -1
  12. package/src/examples/components/forms/person.form.ts +9 -14
  13. package/src/examples/components/forms/project.form.ts +295 -0
  14. package/src/examples/components/forms/taskWithProject.form.ts +310 -0
  15. package/src/examples/components/lists/actor.list.ts +15 -9
  16. package/src/examples/components/lists/character.list.ts +13 -7
  17. package/src/examples/components/lists/movie.list.ts +104 -24
  18. package/src/examples/components/lists/movieEpisode.list.ts +17 -11
  19. package/src/examples/components/lists/movieGenre.list.ts +12 -6
  20. package/src/examples/components/lists/project.list.ts +78 -0
  21. package/src/examples/components/lists/taskWithProject.list.ts +202 -0
  22. package/src/examples/components/tables/character.table.ts +40 -0
  23. package/src/examples/modules/character.ts +1 -0
  24. package/src/examples/modules/project.ts +18 -0
  25. package/src/examples/projects/assets/images/favicon/android-chrome-192x192.png +0 -0
  26. package/src/examples/projects/assets/images/favicon/android-chrome-512x512.png +0 -0
  27. package/src/examples/projects/assets/images/favicon/apple-touch-icon.png +0 -0
  28. package/src/examples/projects/assets/images/favicon/favicon-16x16.png +0 -0
  29. package/src/examples/projects/assets/images/favicon/favicon-32x32.png +0 -0
  30. package/src/examples/projects/assets/images/favicon/favicon.ico +0 -0
  31. package/src/examples/projects/assets/images/logo.png +0 -0
  32. package/src/examples/projects/movieBackoffice.ts +62 -62
  33. package/src/interfaces/ai-agent.interface.ts +179 -0
  34. package/src/interfaces/condition.interface.ts +0 -1
  35. package/src/interfaces/data-chart.interface.ts +74 -56
  36. package/src/interfaces/data-table.interface.ts +43 -0
  37. package/src/interfaces/form-array.interface.ts +1 -0
  38. package/src/interfaces/form-autocomplete.interface.ts +1 -0
  39. package/src/interfaces/form-checkbox.interface.ts +27 -0
  40. package/src/interfaces/form-contract.interface.ts +12 -2
  41. package/src/interfaces/form-file.interface.ts +1 -1
  42. package/src/interfaces/form-input.interface.ts +18 -3
  43. package/src/interfaces/form-radio.interface.ts +27 -0
  44. package/src/interfaces/form-select.interface.ts +1 -1
  45. package/src/interfaces/form.interface.ts +13 -4
  46. package/src/interfaces/kanban.interface.ts +82 -0
  47. package/src/interfaces/list.interface.ts +15 -1
  48. package/src/interfaces/notification.interface.ts +27 -0
  49. package/src/interfaces/project-backend.interface.ts +61 -2
  50. package/src/interfaces/project-repositories.interface.ts +18 -0
  51. package/src/interfaces/project-style.interface.ts +15 -96
  52. package/src/interfaces/project.interface.ts +52 -5
  53. package/src/interfaces/record-reminder.interface.ts +14 -0
  54. package/src/interfaces/trusted-caller.interface.ts +21 -0
  55. package/src/schemas/ai-agent-config.ref.json +232 -0
  56. package/src/schemas/backend.ref.json +87 -1
  57. package/src/schemas/component-one-of.ref.json +4 -1
  58. package/src/schemas/data-chart.ref.json +3 -0
  59. package/src/schemas/data-table.ref.json +24 -0
  60. package/src/schemas/form-array.ref.json +3 -0
  61. package/src/schemas/form-autocomplete.ref.json +6 -0
  62. package/src/schemas/form-checkbox.ref.json +73 -0
  63. package/src/schemas/form-contract-request.ref.json +1 -0
  64. package/src/schemas/form-contract.ref.json +2 -1
  65. package/src/schemas/form-input.ref.json +8 -2
  66. package/src/schemas/form-one-of.ref.json +4 -2
  67. package/src/schemas/form-public-contract.ref.json +16 -5
  68. package/src/schemas/form-radio.ref.json +73 -0
  69. package/src/schemas/form-switch.ref.json +3 -12
  70. package/src/schemas/form.ref.json +14 -50
  71. package/src/schemas/frontend.ref.json +26 -1
  72. package/src/schemas/kanban.ref.json +259 -0
  73. package/src/schemas/list.ref.json +65 -313
  74. package/src/schemas/module.ref.json +3 -0
  75. package/src/schemas/notification-condition.ref.json +20 -0
  76. package/src/schemas/notification-recipients.ref.json +31 -0
  77. package/src/schemas/notification.ref.json +65 -0
  78. package/src/schemas/project-repositories.ref.json +19 -0
  79. package/src/schemas/project-style.ref.json +28 -12
  80. package/src/schemas/project.schema.json +115 -4
  81. package/src/schemas/record-reminder.ref.json +41 -0
  82. package/src/schemas/send-message.ref.json +33 -0
  83. package/src/schemas/trusted-caller.ref.json +28 -0
  84. package/src/schemas/types-datatype.ref.json +1 -0
  85. package/src/utils/json.ts +3 -11
  86. package/src/utils/path.ts +22 -27
  87. package/rapidaObject.json +0 -1
  88. package/src/constants/secrets/database.ts +0 -1
  89. package/src/constants/secrets/others.ts +0 -3
  90. package/src/constants/secrets/storage.ts +0 -1
  91. package/src/schemas/project-style-theme.ref.json +0 -98
  92. package/src/utils/env.ts +0 -9
@@ -0,0 +1,40 @@
1
+ import type { IDataTable } from "../../../interfaces/data-table.interface";
2
+
3
+ export const characterTable: IDataTable = {
4
+ title: "Lista de personagens",
5
+ componentType: "dataTable",
6
+ id: "characterTable",
7
+ dataSource: {
8
+ endpoint: "/characters",
9
+ paramType: "query",
10
+ hasAuthentication: true,
11
+ },
12
+ columns: [
13
+ { type: "title", label: "Nome", property: "characterName" },
14
+ { type: "description", label: "Descrição", property: "characterDescription", isHtml: true },
15
+ ],
16
+ actions: [
17
+ {
18
+ label: "Editar",
19
+ icon: "pencil",
20
+ action: {
21
+ type: "link",
22
+ link: {
23
+ route: "/character-form",
24
+ paramProperty: "_id",
25
+ },
26
+ },
27
+ },
28
+ {
29
+ label: "Excluir",
30
+ icon: "delete",
31
+ action: {
32
+ type: "request",
33
+ link: {
34
+ route: "/character-list",
35
+ paramProperty: "_id",
36
+ },
37
+ },
38
+ },
39
+ ],
40
+ };
@@ -1,6 +1,7 @@
1
1
  import type { IModule } from "../../interfaces/project.interface";
2
2
  import { characterForm } from "../components/forms/character.form";
3
3
  import { characterList } from "../components/lists/character.list";
4
+ import { characterTable } from "../components/tables/character.table";
4
5
 
5
6
  export const characterModule: IModule = {
6
7
  id: "characterModule",
@@ -0,0 +1,18 @@
1
+ import type { IModule } from "../../interfaces/project.interface";
2
+ import { projectForm } from "../components/forms/project.form";
3
+ import { taskWithProjectForm } from "../components/forms/taskWithProject.form";
4
+ import { projectList } from "../components/lists/project.list";
5
+ import { taskWithProjectList } from "../components/lists/taskWithProject.list";
6
+
7
+ export const projectModule: IModule = {
8
+ id: "projectModule",
9
+ title: "Projeto",
10
+ icon: "chart-gantt",
11
+ components: [
12
+ projectForm,
13
+ projectList,
14
+
15
+ taskWithProjectForm,
16
+ taskWithProjectList,
17
+ ],
18
+ };
@@ -1,10 +1,18 @@
1
- import { DATABASE_PASSWORD } from "../../constants/secrets/database";
2
- import { DISCORD_WEBHOOK_URL, JWT_SECRET, SMTP_PASSWORD } from "../../constants/secrets/others";
1
+ import { DEEPSEEK_API_KEY } from "../../constants/secrets/ai";
2
+ import { DATABASE_PASSWORD, MONGODB_ACCOUNT_PRIVATE_KEY, MONGODB_ACCOUNT_PUBLIC_KEY, MONGODB_GROUP_ID, MONGODB_ORGANIZATION_ID, MONGODB_PROCESS_ID } from "../../constants/secrets/database";
3
+ import {
4
+ DISCORD_WEBHOOK_URL,
5
+ JWT_SECRET,
6
+ SMTP_PASSWORD,
7
+ } from "../../constants/secrets/others";
3
8
  import { STORAGE_PRIVATE_KEY } from "../../constants/secrets/storage";
9
+ import { WHATSAPP_BUSINESS_ACCOUNT_ID, WHATSAPP_PHONE_NUMBER_ID, WHATSAPP_TOKEN, WHATSAPP_VERIFY_TOKEN } from "../../constants/secrets/whatsapp";
4
10
  import type { IProject } from "../../interfaces/project.interface";
5
11
  import { movieGenreChart } from "../components/charts/movieGenre.chart";
6
12
  import { companyForm } from "../components/forms/company.form";
7
13
  import { personForm } from "../components/forms/person.form";
14
+ import { projectForm } from "../components/forms/project.form";
15
+ import { taskWithProjectForm } from "../components/forms/taskWithProject.form";
8
16
  import { actorModule } from "../modules/actor";
9
17
  import { characterModule } from "../modules/character";
10
18
  import { movieModule } from "../modules/movie";
@@ -17,33 +25,51 @@ export const movieBackoffice: IProject = {
17
25
  flows: {
18
26
  authentication: true,
19
27
  permission: true,
20
- invitation: true,
21
28
  registration: true,
22
29
  profiles: {
23
30
  personProfile: personForm,
24
31
  companyProfile: companyForm,
25
- }
32
+ },
26
33
  },
27
34
  businessPlan: {
28
35
  businessValue: "Gerenciar e otimizar as operações do Movie.",
29
- targetMarket: "Empresas que utilizam o Movie para gerenciar sugestões e feedbacks.",
36
+ targetMarket:
37
+ "Empresas que utilizam o Movie para gerenciar sugestões e feedbacks.",
30
38
  benchmarkings: "Análise de sistemas de gerenciamento de feedbacks.",
31
39
  legalIssues: "Conformidade com leis de proteção de dados.",
32
40
  ethicalIssues: "Garantir a privacidade dos usuários.",
33
41
  afterSales: "Suporte contínuo e atualizações regulares.",
34
42
  monetization: "Assinaturas mensais para acesso ao sistema.",
35
43
  },
36
- frontend: {
44
+ deepseekIntegration: [{
45
+ apiKey: DEEPSEEK_API_KEY,
46
+ service: "cost"
47
+ }],
48
+ mongodbIntegration: [{
49
+ accountPublicKey: MONGODB_ACCOUNT_PUBLIC_KEY,
50
+ accountPrivateKey: MONGODB_ACCOUNT_PRIVATE_KEY,
51
+ organizationId: MONGODB_ORGANIZATION_ID,
52
+ groupId: MONGODB_GROUP_ID,
53
+ processId: MONGODB_PROCESS_ID,
54
+ service: "cost",
55
+ }],
56
+ frontend: [{
57
+ environment: "dev",
58
+ baseUrl: "http://localhost:4200",
59
+ apiBaseUrl: "http://localhost:3000",
60
+ isActiveEnvironment: true,
37
61
  framework: "angular",
38
62
  uiKit: "flowbite",
39
- },
40
- backend: {
63
+ }],
64
+ backend: [{
65
+ environment: "dev",
66
+ baseUrl: "http://localhost:3000",
67
+ isActiveEnvironment: true,
41
68
  framework: "nest",
42
69
  jwtSecret: JWT_SECRET,
43
70
  database: {
44
71
  provider: "mongodb",
45
- connectionString:
46
- `mongodb+srv://kunlatek:${DATABASE_PASSWORD}@cluster0.b0pfr.mongodb.net/movie-v1`,
72
+ connectionString: `mongodb+srv://kunlatek:${DATABASE_PASSWORD}@cluster0.b0pfr.mongodb.net/movie-v1`,
47
73
  credentials: {
48
74
  databaseName: "movie-v1",
49
75
  username: "kunlatek",
@@ -62,6 +88,12 @@ export const movieBackoffice: IProject = {
62
88
  publicBucketName: "rapida-public-files",
63
89
  privateBucketName: "rapida-private-files",
64
90
  },
91
+ whatsapp: {
92
+ whatsappToken: WHATSAPP_TOKEN,
93
+ whatsappPhoneNumberId: WHATSAPP_PHONE_NUMBER_ID,
94
+ whatsappVerifyToken: WHATSAPP_VERIFY_TOKEN,
95
+ whatsappBusinessAccountId: WHATSAPP_BUSINESS_ACCOUNT_ID,
96
+ },
65
97
  logging: {
66
98
  discordWebhookUrl: DISCORD_WEBHOOK_URL,
67
99
  },
@@ -70,60 +102,28 @@ export const movieBackoffice: IProject = {
70
102
  smtpPass: SMTP_PASSWORD,
71
103
  smtpFrom: "noreply@kunlatek.com",
72
104
  },
73
- baseUrl: "http://localhost:5173",
74
- },
75
- e2e: {
76
- framework: "playwright",
77
- moduleId: movieModule.id,
78
- },
79
- modules: [
80
- movieModule,
81
- actorModule,
82
- characterModule,
83
- ],
105
+ }],
106
+ // e2e: {
107
+ // framework: "playwright",
108
+ // moduleId: movieModule.id,
109
+ // },
110
+ modules: [movieModule, actorModule, characterModule],
84
111
  styles: [
85
112
  {
86
113
  themeName: "light",
87
- main: {
88
- headerHeight: "60px",
89
- typography: {
90
- fontFamily: "Arial, sans-serif",
91
- fontSize: "16px",
92
- },
93
- colors: {
94
- primary: "#4F46E5",
95
- primaryContrast: "#FFFFFF",
96
- secondary: "#6B7280",
97
- secondaryContrast: "#FFFFFF",
98
- background: "#FFFFFF",
99
- error: "#DC2626",
100
- success: "#16A34A",
101
- warning: "#D97706",
102
- },
103
- shadows: {
104
- boxShadow: "0 1px 3px rgba(0, 0, 0, 0.1)",
105
- },
106
- borders: {
107
- radius: "4px",
108
- },
109
- components: {
110
- input: {
111
- text: "#111827",
112
- background: "#F9FAFB",
113
- border: "#D1D5DB",
114
- borderRadius: "4px",
115
- focusBorder: "#4F46E5",
116
- placeholder: "#9CA3AF",
117
- width: "248px",
118
- }
119
- },
120
- spacing: "8px",
121
- maxWidth: "1200px",
122
- footerHeight: "60px",
123
- }
124
- }
114
+ colors: {
115
+ primary: "#4F46E5",
116
+ primaryContrast: "#FFFFFF",
117
+ secondary: "#6B7280",
118
+ secondaryContrast: "#FFFFFF",
119
+ background: "#FFFFFF",
120
+ error: "#DC2626",
121
+ success: "#16A34A",
122
+ },
123
+ borders: {
124
+ borderRadius: "4px",
125
+ },
126
+ },
125
127
  ],
126
- dashboard: [
127
- movieGenreChart,
128
- ]
128
+ dashboard: [movieGenreChart],
129
129
  };
@@ -0,0 +1,179 @@
1
+ export type TAgentSchemaType =
2
+ | "string"
3
+ | "number"
4
+ | "integer"
5
+ | "boolean"
6
+ | "array"
7
+ | "object";
8
+
9
+ export interface IAiAgentConfig {
10
+ agentIdentity: {
11
+ name: string;
12
+
13
+ // LITERAL markdown content of the system prompt — NOT a file path.
14
+ // Example: "## Identidade\n\nVocê é a ...". When non-empty it is
15
+ // written verbatim to prompts/system.template.md. When empty (""), the
16
+ // code generator emits a default prompt scaffold including a tools
17
+ // table built from the fixed tools and the exposedContracts.
18
+ systemPromptTemplate: string;
19
+
20
+ // Relative path (inside the generated agent) where the knowledge
21
+ // base markdown file is written and read from (e.g.
22
+ // "data/knowledge.md").
23
+ knowledgeBaseFile: string;
24
+
25
+ // Optional brand/company name used by the default prompt scaffold.
26
+ // Falls back to the project title when omitted.
27
+ companyName?: string;
28
+
29
+ // Optional mission statement used by the default prompt scaffold.
30
+ mission?: string;
31
+
32
+ // Optional initial content for the knowledge base file. When
33
+ // omitted, a fill-in skeleton is generated.
34
+ knowledgeBaseContent?: string;
35
+ };
36
+
37
+ infrastructure: {
38
+ // "instagram" is a stub today: the generated webhook accepts the
39
+ // request but does not process incoming messages yet. Prefer
40
+ // "whatsapp"/"telegram" until it is implemented.
41
+ messengers: ("whatsapp" | "instagram" | "telegram")[];
42
+ aiProvider: "deepseek" | "gemini" | "openai";
43
+ model: string;
44
+ };
45
+
46
+ businessContext: {
47
+ targetBackendProjectId: string;
48
+
49
+ // Optional path to an ALREADY COMPILED rapidaObject.json of the target
50
+ // backend project (NOT the .ts source — the loader parses it as JSON),
51
+ // resolved relative to the directory of this agent's own
52
+ // rapidaObject.json. When provided, the code generator loads this file
53
+ // and resolves contract bindings against it in addition to the current
54
+ // project. When omitted, contracts are resolved only from the current
55
+ // project's modules — the simplest and only end-to-end tested setup
56
+ // today is embedding the same modules directly in this project (see
57
+ // katia.ts), rather than pointing at an external compiled file.
58
+ targetBackendDefinitionFile?: string;
59
+
60
+ // exposedContracts only covers *additional* domain actions. The agent
61
+ // always ships fixed tools (identity + appointment/agenda + knowledge
62
+ // base) that hit hardcoded endpoints (/people, /appointments,
63
+ // /availability-schedules) regardless of what is declared here — do not
64
+ // redeclare a binding with the same toolName as a fixed tool
65
+ // (cadastrar_usuario, atualizar_status_usuario, atualizar_telefone_usuario,
66
+ // atualizar_email_usuario, atualizar_genero_usuario, checar_disponibilidade,
67
+ // criar_evento, meus_agendamentos, cancelar_agendamento,
68
+ // consultar_base_conhecimento). Also note: for "update"/"getById"/
69
+ // "softDelete"/"hardDelete" actions the generator already injects a
70
+ // generic required "id" tool parameter — do not add your own id/_id
71
+ // entry to formFields, it will create a duplicate, unused parameter.
72
+ //
73
+ // The target backend also needs a dedicated user account for the bot to
74
+ // authenticate against (see botCredentials below) — this is separate from
75
+ // flows.invitation.mainUserEmail and must be provisioned manually on the
76
+ // target backend.
77
+ exposedContracts: IAgentContractBinding[];
78
+
79
+ // Credentials of the dedicated bot user on the target backend (written to
80
+ // BOT_API_EMAIL/BOT_API_PASSWORD in the generated agent .env). The account
81
+ // itself still has to be provisioned on the target backend. Import the
82
+ // values from constants/secrets — never write them literally in a project.
83
+ botCredentials?: {
84
+ email: string;
85
+ password: string;
86
+ };
87
+ };
88
+
89
+ // Optional human handoff: when present with at least one contact, the
90
+ // code generator adds a fixed tool ("escalar_para_humano") that sends a
91
+ // WhatsApp text message (summary generated by the LLM itself + the name/
92
+ // contact of who it was talking to, taken from the current session —
93
+ // never asked as a tool argument, to avoid the LLM guessing/inventing a
94
+ // phone number) to one of the configured contacts' whatsappPhoneNumber.
95
+ // The agent keeps responding the original user normally after the
96
+ // handoff — this is a parallel notification to a human, not a channel
97
+ // switch/handover of the conversation itself.
98
+ humanHandoff?: {
99
+ contacts: IHumanHandoffContact[];
100
+ };
101
+
102
+ // Optional limits for incoming audio messages (transcribed through the
103
+ // project's openaiIntegration with service "transcription").
104
+ audio?: {
105
+ // Longer audios are rejected before download/transcription.
106
+ // Defaults to 300.
107
+ maxDurationSeconds?: number;
108
+ // Minimum interval between two audios from the same user.
109
+ // Defaults to 10.
110
+ rateLimitIntervalSeconds?: number;
111
+ };
112
+
113
+ // Optional background jobs configuration. Values become the generated
114
+ // defaults of the agent's job services and can still be overridden at
115
+ // runtime through each service's updateConfig method.
116
+ jobs?: {
117
+ reminder?: {
118
+ // Defaults to true. The reminder job is only generated when the
119
+ // whatsapp messenger is active.
120
+ enabled?: boolean;
121
+ // Cron expression. Defaults to "*/2 * * * *".
122
+ cronInterval?: string;
123
+ // How many minutes ahead of the appointment the reminder fires.
124
+ // Defaults to 1440 (24 hours).
125
+ minutesAhead?: number;
126
+ // IANA timezone for the cron scheduler.
127
+ // Defaults to "America/Sao_Paulo".
128
+ timezone?: string;
129
+ };
130
+ };
131
+ }
132
+
133
+ export interface IAgentContractBinding {
134
+ contractId: string;
135
+
136
+ toolName: string;
137
+
138
+ action: "create" | "get" | "getById" | "update" | "softDelete" | "hardDelete";
139
+
140
+ intentMapping: {
141
+ formFields: {
142
+ fieldId: string;
143
+
144
+ naturalLanguagePrompt: string;
145
+
146
+ validationHint?: string;
147
+
148
+ // Optional explicit JSON-Schema type for the generated tool
149
+ // parameter. When provided it takes precedence over the code
150
+ // generator's defensive EDataType-to-schema mapping, making the
151
+ // tool parameter typing independent from the enum values.
152
+ schemaType?: TAgentSchemaType;
153
+ }[];
154
+
155
+ triggerKeywords: string[];
156
+ };
157
+
158
+ responseTemplate?: {
159
+ successMessage: string;
160
+ errorMessage: string;
161
+ };
162
+ }
163
+
164
+ export interface IHumanHandoffContact {
165
+ // Human-readable identifier the LLM uses to pick this contact
166
+ // (e.g. "Júlia"). Must be unique within humanHandoff.contacts.
167
+ name: string;
168
+
169
+ // Free text describing when/why this contact should receive the
170
+ // handoff (e.g. "fecha reservas quando o hóspede confirma uma data
171
+ // disponível"). The LLM matches the escalation reason against this
172
+ // text to pick the right contact — same spirit as triggerKeywords
173
+ // above, not a fixed enum of categories.
174
+ useCase: string;
175
+
176
+ // E.164 phone number (e.g. "+558296539080") that receives the
177
+ // WhatsApp text message on handoff.
178
+ whatsappPhoneNumber: string;
179
+ }
@@ -7,7 +7,6 @@ type ConditionType = "property" | "enum" | "form" | "code" | "array" | "button";
7
7
  interface IConditionBody {
8
8
  elements?: IConditionElement[];
9
9
  code?: IConditionCode;
10
- businessRules?: IBusinessRule[];
11
10
  conditionResponse?: "show" | "hide" | "enable" | "disable" | "fillFields";
12
11
  fillFields?:Array<{ fieldKey: string; value: any }>;
13
12
  buttonId?: string;
@@ -1,16 +1,7 @@
1
1
  import type { IApiRequest } from "./form-input.interface";
2
2
  import type { IBusinessRule } from "./project.interface";
3
3
 
4
- export interface IDataChart {
5
- componentType: "dataChart";
6
- id: string;
7
- title: string;
8
- userStory?: string;
9
- icon?: string;
10
- guards?: "isAuthenticated" | "isAuthorized";
11
- businessRules?: IBusinessRule[];
12
- dataSource: IApiRequest;
13
- chartType:
4
+ export type IChartType =
14
5
  | "line"
15
6
  | "bar"
16
7
  | "pie"
@@ -20,59 +11,81 @@ export interface IDataChart {
20
11
  | "bubble"
21
12
  | "area"
22
13
  | "polarArea";
23
- dimensions: {
14
+
15
+ export type IChartAggregator = "sum" | "avg" | "min" | "max" | "count";
16
+
17
+ export type IChartLegendPosition = "top" | "bottom" | "left" | "right";
18
+
19
+ export interface IChartLabelFormatter {
20
+ code?: string;
21
+ pattern?: string;
22
+ flags?: string;
23
+ replacement?: string;
24
+ }
25
+
26
+ export interface IChartAxisOptions {
27
+ title?: {
28
+ display?: boolean;
29
+ text?: string;
30
+ };
31
+ grid?: {
32
+ display?: boolean;
33
+ };
34
+ beginAtZero?: boolean;
35
+ stacked?: boolean;
36
+ min?: number;
37
+ max?: number;
38
+ }
39
+
40
+ export interface IChartOptions {
41
+ responsive?: boolean;
42
+ maintainAspectRatio?: boolean;
43
+ indexAxis?: "x" | "y";
44
+ cutout?: string | number;
45
+ animation?: boolean;
46
+ plugins?: {
47
+ title?: {
48
+ display?: boolean;
49
+ text?: string;
50
+ };
51
+ legend?: {
52
+ display?: boolean;
53
+ position?: IChartLegendPosition;
54
+ };
55
+ tooltip?: {
56
+ enabled?: boolean;
57
+ };
58
+ };
59
+ scales?: {
60
+ x?: IChartAxisOptions;
61
+ y?: IChartAxisOptions;
62
+ };
63
+ }
64
+
65
+ export interface IDataChart {
66
+ componentType: "dataChart";
67
+ id: string;
68
+ title: string;
69
+ userStory?: string;
70
+ icon?: string;
71
+ guards?: "isAuthenticated" | "isAuthorized";
72
+ businessRules?: IBusinessRule[];
73
+ dataSource: IApiRequest;
74
+ chartType: IChartType;
75
+ limit?: number;
76
+ dimensions?: {
24
77
  width?: string;
25
78
  height?: string;
26
79
  aspectRatio?: number;
27
80
  };
28
81
  data: {
29
- labels: { // normally refers to description of "x" in cartesian plan charts or area of non-cartesian plan charts
82
+ labels: {
30
83
  property: string;
31
- formatter?: {
32
- code?: string;
33
- regex?: RegExp;
34
- }
84
+ formatter?: IChartLabelFormatter;
35
85
  };
36
86
  datasets: IChartDataset[];
37
87
  };
38
- options?: {
39
- responsive?: boolean;
40
- maintainAspectRatio?: boolean;
41
- plugins?: {
42
- title?: {
43
- display?: boolean;
44
- text?: string;
45
- };
46
- legend?: {
47
- display?: boolean;
48
- position?: "top" | "bottom" | "left" | "right";
49
- };
50
- tooltip?: {
51
- enabled?: boolean;
52
- };
53
- };
54
- scales?: {
55
- x?: {
56
- title?: {
57
- display?: boolean;
58
- text?: string;
59
- };
60
- grid?: {
61
- display?: boolean;
62
- };
63
- };
64
- y?: {
65
- title?: {
66
- display?: boolean;
67
- text?: string;
68
- };
69
- grid?: {
70
- display?: boolean;
71
- };
72
- beginAtZero?: boolean;
73
- };
74
- };
75
- };
88
+ options?: IChartOptions;
76
89
  }
77
90
 
78
91
  export interface IChartDataset {
@@ -82,6 +95,11 @@ export interface IChartDataset {
82
95
  borderColor?: string | string[];
83
96
  borderWidth?: number;
84
97
  fill?: boolean;
85
- tension?: number; // curved lines
86
- aggregator?: "sum" | "avg" | "min" | "max" | "count";
98
+ tension?: number;
99
+ aggregator?: IChartAggregator;
100
+ stack?: string;
101
+ yAxisID?: string;
102
+ pointRadius?: number;
103
+ hidden?: boolean;
104
+ hoverOffset?: number;
87
105
  }
@@ -1,3 +1,4 @@
1
+ import type { EDataType } from "../enums/form.enum";
1
2
  import type { IApiRequest } from "./form-input.interface";
2
3
  import type { IBusinessRule } from "./project.interface";
3
4
 
@@ -24,17 +25,59 @@ export interface IDataTable {
24
25
  export interface IDataTableColumn {
25
26
  property: string;
26
27
  label: string;
28
+
29
+ /**
30
+ * Display type aligned with list component styles.
31
+ * When provided, it overrides renderAs behavior.
32
+ */
33
+ type?:
34
+ | "title"
35
+ | "subtitle"
36
+ | "description"
37
+ | "video"
38
+ | "image"
39
+ | "images"
40
+ | "icon"
41
+ | "badge";
42
+
43
+ /**
44
+ * Mark column content as HTML to be rendered directly.
45
+ */
46
+ isHtml?: boolean;
47
+
48
+ /**
49
+ * Treat the value as a timestamp for automatic formatting.
50
+ */
51
+ isTimestamp?: boolean;
52
+
53
+ /**
54
+ * Optional call-to-action configuration for the column content.
55
+ * When present, the cell becomes clickable using the defined link.
56
+ */
57
+ callToAction?: {
58
+ link: string;
59
+ usePropertyAsQuery?: boolean;
60
+ };
61
+
62
+ /**
63
+ * Data type of the property, useful for automatic formatting or validation.
64
+ */
65
+ dataType?: EDataType;
66
+
27
67
  sortable?: boolean;
28
68
  filterable?: boolean;
29
69
  hidden?: boolean;
30
70
  width?: string;
31
71
  align?: "left" | "center" | "right";
72
+
32
73
  formatter?: {
33
74
  type: "date" | "currency" | "number" | "boolean" | "custom";
34
75
  format?: string;
35
76
  customFunction?: string;
36
77
  };
78
+
37
79
  renderAs?: "text" | "link" | "badge" | "image" | "icon";
80
+
38
81
  linkConfig?: {
39
82
  route: string;
40
83
  paramProperty?: string;
@@ -7,6 +7,7 @@ export interface IFormArray {
7
7
  name: string;
8
8
  label: string;
9
9
  elements: IFormElement[];
10
+ tooltip?: string;
10
11
  conditions?: IFormCondition;
11
12
  todo?: string;
12
13
  businessRules?: IBusinessRule[];
@@ -40,6 +40,7 @@ export interface IOptionsApi {
40
40
  isNotKunlatekResponse?: boolean;
41
41
  rawQuery?: string;
42
42
  conditions?: IFormCondition;
43
+ isExternal?: boolean;
43
44
  }
44
45
 
45
46
  export interface IApiResponseField {