@hed-hog/core 0.0.364 → 0.0.366

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 (189) hide show
  1. package/dist/ai/ai.controller.d.ts +4 -4
  2. package/dist/ai/ai.module.d.ts.map +1 -1
  3. package/dist/ai/ai.module.js +2 -0
  4. package/dist/ai/ai.module.js.map +1 -1
  5. package/dist/ai/ai.service.d.ts +7 -5
  6. package/dist/ai/ai.service.d.ts.map +1 -1
  7. package/dist/ai/ai.service.js +63 -31
  8. package/dist/ai/ai.service.js.map +1 -1
  9. package/dist/ai-instruction/ai-execution.service.d.ts +45 -0
  10. package/dist/ai-instruction/ai-execution.service.d.ts.map +1 -0
  11. package/dist/ai-instruction/ai-execution.service.js +203 -0
  12. package/dist/ai-instruction/ai-execution.service.js.map +1 -0
  13. package/dist/ai-instruction/ai-instruction.controller.d.ts +25 -0
  14. package/dist/ai-instruction/ai-instruction.controller.d.ts.map +1 -0
  15. package/dist/ai-instruction/ai-instruction.controller.js +117 -0
  16. package/dist/ai-instruction/ai-instruction.controller.js.map +1 -0
  17. package/dist/ai-instruction/ai-instruction.module.d.ts +3 -0
  18. package/dist/ai-instruction/ai-instruction.module.d.ts.map +1 -0
  19. package/dist/ai-instruction/ai-instruction.module.js +27 -0
  20. package/dist/ai-instruction/ai-instruction.module.js.map +1 -0
  21. package/dist/ai-instruction/ai-instruction.service.d.ts +38 -0
  22. package/dist/ai-instruction/ai-instruction.service.d.ts.map +1 -0
  23. package/dist/ai-instruction/ai-instruction.service.js +289 -0
  24. package/dist/ai-instruction/ai-instruction.service.js.map +1 -0
  25. package/dist/ai-instruction/ai-prompt-builder.service.d.ts +53 -0
  26. package/dist/ai-instruction/ai-prompt-builder.service.d.ts.map +1 -0
  27. package/dist/ai-instruction/ai-prompt-builder.service.js +132 -0
  28. package/dist/ai-instruction/ai-prompt-builder.service.js.map +1 -0
  29. package/dist/ai-instruction/dto/create-ai-instruction.dto.d.ts +12 -0
  30. package/dist/ai-instruction/dto/create-ai-instruction.dto.d.ts.map +1 -0
  31. package/dist/ai-instruction/dto/create-ai-instruction.dto.js +57 -0
  32. package/dist/ai-instruction/dto/create-ai-instruction.dto.js.map +1 -0
  33. package/dist/ai-instruction/dto/update-ai-instruction.dto.d.ts +10 -0
  34. package/dist/ai-instruction/dto/update-ai-instruction.dto.d.ts.map +1 -0
  35. package/dist/ai-instruction/dto/update-ai-instruction.dto.js +56 -0
  36. package/dist/ai-instruction/dto/update-ai-instruction.dto.js.map +1 -0
  37. package/dist/ai-instruction/types/ai-instruction.types.d.ts +78 -0
  38. package/dist/ai-instruction/types/ai-instruction.types.d.ts.map +1 -0
  39. package/dist/ai-instruction/types/ai-instruction.types.js +3 -0
  40. package/dist/ai-instruction/types/ai-instruction.types.js.map +1 -0
  41. package/dist/auth/auth.controller.d.ts +13 -5
  42. package/dist/auth/auth.controller.d.ts.map +1 -1
  43. package/dist/auth/auth.controller.js +39 -20
  44. package/dist/auth/auth.controller.js.map +1 -1
  45. package/dist/auth/auth.service.d.ts +18 -7
  46. package/dist/auth/auth.service.d.ts.map +1 -1
  47. package/dist/auth/auth.service.js +20 -16
  48. package/dist/auth/auth.service.js.map +1 -1
  49. package/dist/core.module.d.ts.map +1 -1
  50. package/dist/core.module.js +3 -0
  51. package/dist/core.module.js.map +1 -1
  52. package/dist/file/file.service.d.ts +37 -0
  53. package/dist/file/file.service.d.ts.map +1 -1
  54. package/dist/file/file.service.js +94 -4
  55. package/dist/file/file.service.js.map +1 -1
  56. package/dist/file/provider/abstract.provider.d.ts +6 -2
  57. package/dist/file/provider/abstract.provider.d.ts.map +1 -1
  58. package/dist/file/provider/abstract.provider.js.map +1 -1
  59. package/dist/file/provider/azure.provider.d.ts +4 -1
  60. package/dist/file/provider/azure.provider.d.ts.map +1 -1
  61. package/dist/file/provider/azure.provider.js +7 -2
  62. package/dist/file/provider/azure.provider.js.map +1 -1
  63. package/dist/file/provider/gcs.provider.d.ts +4 -1
  64. package/dist/file/provider/gcs.provider.d.ts.map +1 -1
  65. package/dist/file/provider/gcs.provider.js +7 -2
  66. package/dist/file/provider/gcs.provider.js.map +1 -1
  67. package/dist/file/provider/local.provider.d.ts +2 -2
  68. package/dist/file/provider/local.provider.d.ts.map +1 -1
  69. package/dist/file/provider/local.provider.js +7 -2
  70. package/dist/file/provider/local.provider.js.map +1 -1
  71. package/dist/file/provider/s3.provider.d.ts +4 -1
  72. package/dist/file/provider/s3.provider.d.ts.map +1 -1
  73. package/dist/file/provider/s3.provider.js +9 -6
  74. package/dist/file/provider/s3.provider.js.map +1 -1
  75. package/dist/file/provider/spaces.provider.d.ts +4 -1
  76. package/dist/file/provider/spaces.provider.d.ts.map +1 -1
  77. package/dist/file/provider/spaces.provider.js +9 -5
  78. package/dist/file/provider/spaces.provider.js.map +1 -1
  79. package/dist/integration-profile/integration-profile.controller.d.ts +3 -3
  80. package/dist/integration-profile/integration-profile.service.d.ts +3 -3
  81. package/dist/integration-profile/integration-profile.service.d.ts.map +1 -1
  82. package/dist/integration-profile/integration-profile.service.js +1 -10
  83. package/dist/integration-profile/integration-profile.service.js.map +1 -1
  84. package/dist/mcp-chat/mcp-chat.controller.d.ts +2 -2
  85. package/dist/mcp-chat/mcp-chat.module.d.ts.map +1 -1
  86. package/dist/mcp-chat/mcp-chat.module.js +2 -0
  87. package/dist/mcp-chat/mcp-chat.module.js.map +1 -1
  88. package/dist/mcp-chat/mcp-chat.service.d.ts +8 -3
  89. package/dist/mcp-chat/mcp-chat.service.d.ts.map +1 -1
  90. package/dist/mcp-chat/mcp-chat.service.js +100 -20
  91. package/dist/mcp-chat/mcp-chat.service.js.map +1 -1
  92. package/dist/notification/notification.service.d.ts +1 -0
  93. package/dist/notification/notification.service.d.ts.map +1 -1
  94. package/dist/notification/notification.service.js +29 -1
  95. package/dist/notification/notification.service.js.map +1 -1
  96. package/dist/oauth/oauth.service.d.ts +1 -0
  97. package/dist/oauth/oauth.service.d.ts.map +1 -1
  98. package/dist/oauth/oauth.service.js +55 -1
  99. package/dist/oauth/oauth.service.js.map +1 -1
  100. package/dist/profile/events/profile-avatar-updated.event.d.ts +7 -0
  101. package/dist/profile/events/profile-avatar-updated.event.d.ts.map +1 -0
  102. package/dist/profile/events/profile-avatar-updated.event.js +12 -0
  103. package/dist/profile/events/profile-avatar-updated.event.js.map +1 -0
  104. package/dist/profile/events/profile-email-changed.event.d.ts +7 -0
  105. package/dist/profile/events/profile-email-changed.event.d.ts.map +1 -0
  106. package/dist/profile/events/profile-email-changed.event.js +12 -0
  107. package/dist/profile/events/profile-email-changed.event.js.map +1 -0
  108. package/dist/profile/events/profile-updated.event.d.ts +7 -0
  109. package/dist/profile/events/profile-updated.event.d.ts.map +1 -0
  110. package/dist/profile/events/profile-updated.event.js +12 -0
  111. package/dist/profile/events/profile-updated.event.js.map +1 -0
  112. package/dist/profile/profile.service.d.ts +3 -1
  113. package/dist/profile/profile.service.d.ts.map +1 -1
  114. package/dist/profile/profile.service.js +28 -17
  115. package/dist/profile/profile.service.js.map +1 -1
  116. package/dist/session/session.controller.d.ts +1 -0
  117. package/dist/session/session.controller.d.ts.map +1 -1
  118. package/dist/session/session.service.d.ts +9 -4
  119. package/dist/session/session.service.d.ts.map +1 -1
  120. package/dist/session/session.service.js +61 -51
  121. package/dist/session/session.service.js.map +1 -1
  122. package/dist/setting/setting.controller.d.ts +5 -5
  123. package/dist/setting/setting.service.d.ts +5 -5
  124. package/dist/setting/setting.service.d.ts.map +1 -1
  125. package/dist/setting/setting.service.js +2 -0
  126. package/dist/setting/setting.service.js.map +1 -1
  127. package/dist/task/task.service.d.ts +8 -11
  128. package/dist/task/task.service.d.ts.map +1 -1
  129. package/dist/task/task.service.js +10 -16
  130. package/dist/task/task.service.js.map +1 -1
  131. package/dist/user/user.controller.d.ts +1 -0
  132. package/dist/user/user.controller.d.ts.map +1 -1
  133. package/dist/user/user.service.d.ts +3 -0
  134. package/dist/user/user.service.d.ts.map +1 -1
  135. package/dist/webhook-integration/webhook-command.registry.d.ts +9 -2
  136. package/dist/webhook-integration/webhook-command.registry.d.ts.map +1 -1
  137. package/dist/webhook-integration/webhook-command.registry.js.map +1 -1
  138. package/dist/webhook-integration/webhook-integration.service.d.ts.map +1 -1
  139. package/dist/webhook-integration/webhook-integration.service.js +15 -7
  140. package/dist/webhook-integration/webhook-integration.service.js.map +1 -1
  141. package/hedhog/data/integration_provider.yaml +17 -0
  142. package/hedhog/data/integration_type.yaml +6 -0
  143. package/hedhog/data/route.yaml +86 -2
  144. package/hedhog/frontend/app/configurations/[slug]/components/setting-field.tsx.ejs +109 -0
  145. package/hedhog/frontend/app/configurations/layout.tsx.ejs +6 -6
  146. package/hedhog/frontend/app/integration/profiles/page.tsx.ejs +169 -14
  147. package/hedhog/frontend/messages/en.json +11 -2
  148. package/hedhog/frontend/messages/pt.json +11 -2
  149. package/hedhog/table/ai_execution.yaml +79 -0
  150. package/hedhog/table/ai_execution_step.yaml +65 -0
  151. package/hedhog/table/ai_instruction.yaml +43 -0
  152. package/hedhog/table/ai_instruction_version.yaml +30 -0
  153. package/hedhog/table/ai_model_pricing.yaml +35 -0
  154. package/hedhog/table/user_session.yaml +2 -0
  155. package/package.json +3 -2
  156. package/src/ai/ai.module.ts +2 -0
  157. package/src/ai/ai.service.ts +64 -31
  158. package/src/ai-instruction/ai-execution.service.ts +244 -0
  159. package/src/ai-instruction/ai-instruction.controller.ts +73 -0
  160. package/src/ai-instruction/ai-instruction.module.ts +14 -0
  161. package/src/ai-instruction/ai-instruction.service.ts +343 -0
  162. package/src/ai-instruction/ai-prompt-builder.service.ts +142 -0
  163. package/src/ai-instruction/dto/create-ai-instruction.dto.ts +36 -0
  164. package/src/ai-instruction/dto/update-ai-instruction.dto.ts +35 -0
  165. package/src/ai-instruction/types/ai-instruction.types.ts +90 -0
  166. package/src/auth/auth.controller.ts +23 -5
  167. package/src/auth/auth.service.ts +26 -15
  168. package/src/core.module.ts +3 -0
  169. package/src/file/file.service.ts +136 -4
  170. package/src/file/provider/abstract.provider.ts +4 -2
  171. package/src/file/provider/azure.provider.ts +6 -3
  172. package/src/file/provider/gcs.provider.ts +5 -3
  173. package/src/file/provider/local.provider.ts +7 -3
  174. package/src/file/provider/s3.provider.ts +8 -6
  175. package/src/file/provider/spaces.provider.ts +8 -7
  176. package/src/integration-profile/integration-profile.service.ts +1 -10
  177. package/src/mcp-chat/mcp-chat.module.ts +19 -17
  178. package/src/mcp-chat/mcp-chat.service.ts +95 -9
  179. package/src/notification/notification.service.ts +32 -1
  180. package/src/oauth/oauth.service.ts +74 -1
  181. package/src/profile/events/profile-avatar-updated.event.ts +8 -0
  182. package/src/profile/events/profile-email-changed.event.ts +8 -0
  183. package/src/profile/events/profile-updated.event.ts +8 -0
  184. package/src/profile/profile.service.ts +25 -16
  185. package/src/session/session.service.ts +70 -52
  186. package/src/setting/setting.service.ts +10 -8
  187. package/src/task/task.service.ts +10 -16
  188. package/src/webhook-integration/webhook-command.registry.ts +10 -2
  189. package/src/webhook-integration/webhook-integration.service.ts +33 -6
@@ -61,8 +61,19 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
61
61
  import { usePagination } from '@/hooks/use-pagination';
62
62
  import { formatDate } from '@/lib/format-date';
63
63
  import { useApp } from '@hed-hog/next-app-provider';
64
- import { Check, Copy, Eye, EyeOff, Pencil, PlugZap, Plus, Trash2, X } from 'lucide-react';
64
+ import {
65
+ Check,
66
+ Copy,
67
+ Eye,
68
+ EyeOff,
69
+ Pencil,
70
+ PlugZap,
71
+ Plus,
72
+ Trash2,
73
+ X,
74
+ } from 'lucide-react';
65
75
  import { useTranslations } from 'next-intl';
76
+ import { useSearchParams } from 'next/navigation';
66
77
  import { useEffect, useRef, useState } from 'react';
67
78
  import { toast } from 'sonner';
68
79
 
@@ -111,10 +122,14 @@ type ProfileForm = {
111
122
  type FieldDef = {
112
123
  key: string;
113
124
  labelKey: string;
114
- type: 'text' | 'password' | 'number' | 'boolean' | 'email' | 'url';
125
+ type: 'text' | 'password' | 'number' | 'boolean' | 'email' | 'url' | 'select';
115
126
  required: boolean;
116
127
  placeholder?: string;
117
128
  colSpan?: boolean;
129
+ options?: Array<{
130
+ value: string;
131
+ labelKey: string;
132
+ }>;
118
133
  };
119
134
 
120
135
  type ImportValidatedProfile = {
@@ -522,6 +537,66 @@ const PROVIDER_FIELDS: Record<string, FieldDef[]> = {
522
537
  required: true,
523
538
  },
524
539
  ],
540
+ stripe: [
541
+ {
542
+ key: 'publishable_key',
543
+ labelKey: 'fieldPublishableKey',
544
+ type: 'text',
545
+ required: false,
546
+ },
547
+ {
548
+ key: 'secret_key',
549
+ labelKey: 'fieldSecretKey',
550
+ type: 'password',
551
+ required: true,
552
+ },
553
+ {
554
+ key: 'webhook_secret',
555
+ labelKey: 'fieldWebhookSecret',
556
+ type: 'password',
557
+ required: false,
558
+ },
559
+ {
560
+ key: 'mode',
561
+ labelKey: 'fieldMode',
562
+ type: 'select',
563
+ required: false,
564
+ options: [
565
+ { value: 'sandbox', labelKey: 'fieldModeSandbox' },
566
+ { value: 'production', labelKey: 'fieldModeProduction' },
567
+ ],
568
+ },
569
+ ],
570
+ mercado_pago: [
571
+ {
572
+ key: 'public_key',
573
+ labelKey: 'fieldPublicKey',
574
+ type: 'text',
575
+ required: false,
576
+ },
577
+ {
578
+ key: 'access_token',
579
+ labelKey: 'fieldAccessToken',
580
+ type: 'password',
581
+ required: true,
582
+ },
583
+ {
584
+ key: 'webhook_secret',
585
+ labelKey: 'fieldWebhookSecret',
586
+ type: 'password',
587
+ required: false,
588
+ },
589
+ {
590
+ key: 'mode',
591
+ labelKey: 'fieldMode',
592
+ type: 'select',
593
+ required: false,
594
+ options: [
595
+ { value: 'sandbox', labelKey: 'fieldModeSandbox' },
596
+ { value: 'production', labelKey: 'fieldModeProduction' },
597
+ ],
598
+ },
599
+ ],
525
600
  };
526
601
 
527
602
  // ─── Helpers ─────────────────────────────────────────────────────────────────
@@ -801,10 +876,12 @@ function TypeTab({
801
876
  export default function IntegrationProfilesPage() {
802
877
  const t = useTranslations('core.IntegrationProfilePage');
803
878
  const { request, currentLocaleCode, getSettingValue } = useApp();
879
+ const searchParams = useSearchParams();
880
+ const requestedType = searchParams.get('type')?.trim().toLowerCase() ?? '';
804
881
 
805
882
  const [types, setTypes] = useState<IntegrationType[]>([]);
806
883
  const [providers, setProviders] = useState<IntegrationProvider[]>([]);
807
- const [activeTab, setActiveTab] = useState<string>('');
884
+ const [activeTab, setActiveTab] = useState<string>(requestedType);
808
885
  const [refreshKey, setRefreshKey] = useState(0);
809
886
 
810
887
  const [isSheetOpen, setIsSheetOpen] = useState(false);
@@ -877,7 +954,27 @@ export default function IntegrationProfilesPage() {
877
954
  .then(({ data }) => {
878
955
  const list = Array.isArray(data) ? data : ((data as any).data ?? []);
879
956
  setTypes(list);
880
- if (list.length > 0 && !activeTab) setActiveTab(list[0].slug);
957
+ if (list.length === 0) return;
958
+
959
+ const hasRequestedType = requestedType
960
+ ? list.some((type: IntegrationType) => type.slug === requestedType)
961
+ : false;
962
+
963
+ if (hasRequestedType) {
964
+ setActiveTab(requestedType);
965
+ return;
966
+ }
967
+
968
+ setActiveTab((currentTab) => {
969
+ if (
970
+ currentTab &&
971
+ list.some((type: IntegrationType) => type.slug === currentTab)
972
+ ) {
973
+ return currentTab;
974
+ }
975
+
976
+ return list[0].slug;
977
+ });
881
978
  })
882
979
  .catch(() => toast.error(t('loadError')));
883
980
 
@@ -890,7 +987,13 @@ export default function IntegrationProfilesPage() {
890
987
  setProviders(list);
891
988
  })
892
989
  .catch(() => {});
893
- }, []);
990
+ }, [request, requestedType, t]);
991
+
992
+ useEffect(() => {
993
+ if (!requestedType) return;
994
+ if (!types.some((type) => type.slug === requestedType)) return;
995
+ setActiveTab(requestedType);
996
+ }, [requestedType, types]);
894
997
 
895
998
  const handleCreate = () => {
896
999
  const activeType = types.find((ty) => ty.slug === activeTab);
@@ -912,10 +1015,8 @@ export default function IntegrationProfilesPage() {
912
1015
  method: 'GET',
913
1016
  });
914
1017
  const loadedConfig =
915
- (data.config as Record<
916
- string,
917
- string | boolean | number | string[]
918
- >) ?? {};
1018
+ (data.config as Record<string, string | boolean | number | string[]>) ??
1019
+ {};
919
1020
  const providerSlug =
920
1021
  providers.find((p) => p.id === data.provider_id)?.slug ?? '';
921
1022
  if (
@@ -1144,8 +1245,11 @@ export default function IntegrationProfilesPage() {
1144
1245
  };
1145
1246
 
1146
1247
  const handleProviderChange = (provider_id: string) => {
1147
- const provider = formTypeProviders.find((p) => String(p.id) === provider_id);
1148
- const initialConfig: Record<string, string | boolean | number | string[]> = {};
1248
+ const provider = formTypeProviders.find(
1249
+ (p) => String(p.id) === provider_id
1250
+ );
1251
+ const initialConfig: Record<string, string | boolean | number | string[]> =
1252
+ {};
1149
1253
  if (provider?.slug?.endsWith('-oauth')) {
1150
1254
  const pName = provider.slug.replace(/-oauth$/, '');
1151
1255
  initialConfig.callback_urls = appUrl
@@ -1160,14 +1264,20 @@ export default function IntegrationProfilesPage() {
1160
1264
  setVisibleFields({});
1161
1265
  };
1162
1266
 
1163
- const updateConfig = (key: string, value: string | boolean | number | string[]) => {
1267
+ const updateConfig = (
1268
+ key: string,
1269
+ value: string | boolean | number | string[]
1270
+ ) => {
1164
1271
  setFormData((p) => ({ ...p, config: { ...p.config, [key]: value } }));
1165
1272
  };
1166
1273
 
1167
1274
  const updateCallbackUrl = (index: number, value: string) => {
1168
1275
  const urls = [...callbackUrls];
1169
1276
  urls[index] = value;
1170
- setFormData((p) => ({ ...p, config: { ...p.config, callback_urls: urls } }));
1277
+ setFormData((p) => ({
1278
+ ...p,
1279
+ config: { ...p.config, callback_urls: urls },
1280
+ }));
1171
1281
  };
1172
1282
 
1173
1283
  const addCallbackUrl = () => {
@@ -1633,6 +1743,49 @@ export default function IntegrationProfilesPage() {
1633
1743
  );
1634
1744
  }
1635
1745
 
1746
+ if (field.type === 'select') {
1747
+ return (
1748
+ <div
1749
+ key={field.key}
1750
+ className={
1751
+ field.colSpan
1752
+ ? 'col-span-full space-y-2'
1753
+ : 'space-y-2'
1754
+ }
1755
+ >
1756
+ <Label htmlFor={`ip-cfg-${field.key}`}>
1757
+ {t(field.labelKey as any)}
1758
+ {field.required && (
1759
+ <span className="text-destructive"> *</span>
1760
+ )}
1761
+ </Label>
1762
+ <Select
1763
+ value={String(formData.config[field.key] ?? '')}
1764
+ onValueChange={(value) =>
1765
+ updateConfig(field.key, value)
1766
+ }
1767
+ >
1768
+ <SelectTrigger
1769
+ id={`ip-cfg-${field.key}`}
1770
+ className="w-full"
1771
+ >
1772
+ <SelectValue placeholder={field.placeholder} />
1773
+ </SelectTrigger>
1774
+ <SelectContent>
1775
+ {field.options?.map((option) => (
1776
+ <SelectItem
1777
+ key={option.value}
1778
+ value={option.value}
1779
+ >
1780
+ {t(option.labelKey as any)}
1781
+ </SelectItem>
1782
+ ))}
1783
+ </SelectContent>
1784
+ </Select>
1785
+ </div>
1786
+ );
1787
+ }
1788
+
1636
1789
  const isPassword = field.type === 'password';
1637
1790
  const isVisible = visibleFields[field.key] ?? false;
1638
1791
 
@@ -1739,7 +1892,9 @@ export default function IntegrationProfilesPage() {
1739
1892
  <div key={index} className="flex gap-2">
1740
1893
  <Input
1741
1894
  value={url}
1742
- onChange={(e) => updateCallbackUrl(index, e.target.value)}
1895
+ onChange={(e) =>
1896
+ updateCallbackUrl(index, e.target.value)
1897
+ }
1743
1898
  placeholder={t('callbackUrlPlaceholder')}
1744
1899
  className="font-mono text-sm"
1745
1900
  />
@@ -1241,6 +1241,8 @@
1241
1241
  "aiProfileEmptyState": "No AI profiles found.",
1242
1242
  "selectOAuthProfile": "Select an OAuth profile",
1243
1243
  "oauthProfileEmptyState": "No OAuth profiles found.",
1244
+ "selectPaymentProfile": "Select a payment profile",
1245
+ "paymentProfileEmptyState": "No payment profiles found.",
1244
1246
  "mailProfile": {
1245
1247
  "nameLabel": "Name *",
1246
1248
  "namePlaceholder": "My Mail Profile",
@@ -2239,7 +2241,7 @@
2239
2241
  "breadcrumbHome": "Home",
2240
2242
  "breadcrumbTitle": "Integration Profiles",
2241
2243
  "title": "Integration Profiles",
2242
- "description": "Manage credentials and connection settings for email, messaging, storage, AI, and OAuth providers.",
2244
+ "description": "Manage credentials and connection settings for email, messaging, storage, AI, OAuth, and payment providers.",
2243
2245
  "searchPlaceholder": "Search profiles by name or slug...",
2244
2246
  "selectProfile": "Select profile",
2245
2247
  "selectAllVisible": "Select all visible profiles",
@@ -2346,6 +2348,13 @@
2346
2348
  "fieldOrganization": "Organization ID",
2347
2349
  "fieldRedirectUri": "Redirect URI",
2348
2350
  "fieldTenantId": "Tenant ID",
2351
+ "fieldPublishableKey": "Publishable Key",
2352
+ "fieldSecretKey": "Secret Key",
2353
+ "fieldWebhookSecret": "Webhook Secret",
2354
+ "fieldPublicKey": "Public Key",
2355
+ "fieldMode": "Mode",
2356
+ "fieldModeSandbox": "Sandbox",
2357
+ "fieldModeProduction": "Production",
2349
2358
  "callbackUrlsSectionTitle": "Callback URLs",
2350
2359
  "callbackUrlsDescription": "Register these URLs in your OAuth application settings.",
2351
2360
  "addCallbackUrl": "Add URL",
@@ -2354,4 +2363,4 @@
2354
2363
  "showPassword": "Show value",
2355
2364
  "hidePassword": "Hide value"
2356
2365
  }
2357
- }
2366
+ }
@@ -1244,6 +1244,8 @@
1244
1244
  "aiProfileEmptyState": "Nenhum perfil de IA encontrado.",
1245
1245
  "selectOAuthProfile": "Selecione um perfil OAuth",
1246
1246
  "oauthProfileEmptyState": "Nenhum perfil OAuth encontrado.",
1247
+ "selectPaymentProfile": "Selecione um perfil de pagamento",
1248
+ "paymentProfileEmptyState": "Nenhum perfil de pagamento encontrado.",
1247
1249
  "mailProfile": {
1248
1250
  "nameLabel": "Nome *",
1249
1251
  "namePlaceholder": "Meu Perfil de Email",
@@ -2294,7 +2296,7 @@
2294
2296
  "breadcrumbHome": "Início",
2295
2297
  "breadcrumbTitle": "Perfis de Integração",
2296
2298
  "title": "Perfis de Integração",
2297
- "description": "Gerencie credenciais para provedores de e-mail, mensagens, armazenamento, IA e OAuth.",
2299
+ "description": "Gerencie credenciais para provedores de e-mail, mensagens, armazenamento, IA, OAuth e pagamentos.",
2298
2300
  "searchPlaceholder": "Buscar perfis por nome ou slug...",
2299
2301
  "selectProfile": "Selecionar perfil",
2300
2302
  "selectAllVisible": "Selecionar todos os perfis visíveis",
@@ -2401,6 +2403,13 @@
2401
2403
  "fieldOrganization": "ID da Organização",
2402
2404
  "fieldRedirectUri": "URI de Redirecionamento",
2403
2405
  "fieldTenantId": "Tenant ID",
2406
+ "fieldPublishableKey": "Chave Publicável",
2407
+ "fieldSecretKey": "Chave Secreta",
2408
+ "fieldWebhookSecret": "Segredo do Webhook",
2409
+ "fieldPublicKey": "Chave Pública",
2410
+ "fieldMode": "Modo",
2411
+ "fieldModeSandbox": "Sandbox",
2412
+ "fieldModeProduction": "Produção",
2404
2413
  "callbackUrlsSectionTitle": "URLs de Callback",
2405
2414
  "callbackUrlsDescription": "Registre estas URLs nas configurações do seu aplicativo OAuth.",
2406
2415
  "addCallbackUrl": "Adicionar URL",
@@ -2409,4 +2418,4 @@
2409
2418
  "showPassword": "Mostrar valor",
2410
2419
  "hidePassword": "Ocultar valor"
2411
2420
  }
2412
- }
2421
+ }
@@ -0,0 +1,79 @@
1
+ columns:
2
+ - type: pk
3
+ - name: user_id
4
+ type: fk
5
+ isNullable: true
6
+ references:
7
+ table: user
8
+ column: id
9
+ onDelete: SET NULL
10
+ - name: conversation_id
11
+ type: fk
12
+ isNullable: true
13
+ references:
14
+ table: mcp_conversation
15
+ column: id
16
+ onDelete: SET NULL
17
+ - name: agent_id
18
+ type: fk
19
+ isNullable: true
20
+ references:
21
+ table: ai_agent
22
+ column: id
23
+ onDelete: SET NULL
24
+ - name: trigger
25
+ type: enum
26
+ enum:
27
+ - manual
28
+ - webhook
29
+ - schedule
30
+ - tool
31
+ - api
32
+ default: manual
33
+ - name: status
34
+ type: enum
35
+ enum:
36
+ - running
37
+ - completed
38
+ - failed
39
+ - cancelled
40
+ default: running
41
+ - name: context_slug
42
+ isNullable: true
43
+ - name: tokens_input
44
+ type: int
45
+ default: 0
46
+ - name: tokens_output
47
+ type: int
48
+ default: 0
49
+ - name: tokens_total
50
+ type: int
51
+ default: 0
52
+ - name: cost_usd
53
+ type: decimal
54
+ precision: 10
55
+ scale: 6
56
+ default: 0
57
+ - name: started_at
58
+ type: datetime
59
+ - name: finished_at
60
+ type: datetime
61
+ isNullable: true
62
+ - name: error
63
+ type: text
64
+ isNullable: true
65
+ - type: created_at
66
+ - type: updated_at
67
+ indices:
68
+ - columns:
69
+ - user_id
70
+ - columns:
71
+ - conversation_id
72
+ - columns:
73
+ - agent_id
74
+ - columns:
75
+ - status
76
+ - columns:
77
+ - context_slug
78
+ - columns:
79
+ - started_at
@@ -0,0 +1,65 @@
1
+ columns:
2
+ - type: pk
3
+ - name: execution_id
4
+ type: fk
5
+ references:
6
+ table: ai_execution
7
+ column: id
8
+ onDelete: CASCADE
9
+ - name: step_order
10
+ type: int
11
+ default: 0
12
+ - name: type
13
+ type: enum
14
+ enum:
15
+ - prompt
16
+ - tool_call
17
+ - tool_result
18
+ - output
19
+ - error
20
+ default: prompt
21
+ - name: provider
22
+ isNullable: true
23
+ length: 50
24
+ - name: model
25
+ isNullable: true
26
+ length: 100
27
+ - name: tool_name
28
+ isNullable: true
29
+ - name: tokens_input
30
+ type: int
31
+ default: 0
32
+ - name: tokens_output
33
+ type: int
34
+ default: 0
35
+ - name: cost_usd
36
+ type: decimal
37
+ precision: 10
38
+ scale: 6
39
+ default: 0
40
+ - name: duration_ms
41
+ type: int
42
+ default: 0
43
+ - name: input_summary
44
+ type: text
45
+ isNullable: true
46
+ - name: output_summary
47
+ type: text
48
+ isNullable: true
49
+ - name: success
50
+ type: boolean
51
+ default: true
52
+ - name: error
53
+ type: text
54
+ isNullable: true
55
+ - type: created_at
56
+ indices:
57
+ - columns:
58
+ - execution_id
59
+ - step_order
60
+ - columns:
61
+ - execution_id
62
+ - columns:
63
+ - type
64
+ - columns:
65
+ - tool_name
@@ -0,0 +1,43 @@
1
+ columns:
2
+ - type: pk
3
+ - type: slug
4
+ - name: layer
5
+ type: enum
6
+ enum:
7
+ - system
8
+ - product
9
+ - module
10
+ - agent
11
+ - tool
12
+ - output
13
+ default: system
14
+ - name: name
15
+ length: 200
16
+ - name: content
17
+ type: text
18
+ - name: variables_schema
19
+ type: json
20
+ isNullable: true
21
+ - name: locale
22
+ length: 10
23
+ default: "'en'"
24
+ - name: module_slug
25
+ isNullable: true
26
+ - name: is_active
27
+ type: boolean
28
+ default: true
29
+ - name: version
30
+ type: int
31
+ default: 1
32
+ - type: created_at
33
+ - type: updated_at
34
+ indices:
35
+ - columns:
36
+ - slug
37
+ isUnique: true
38
+ - columns:
39
+ - layer
40
+ - columns:
41
+ - module_slug
42
+ - columns:
43
+ - is_active
@@ -0,0 +1,30 @@
1
+ columns:
2
+ - type: pk
3
+ - name: instruction_id
4
+ type: fk
5
+ references:
6
+ table: ai_instruction
7
+ column: id
8
+ onDelete: CASCADE
9
+ - name: version
10
+ type: int
11
+ - name: content
12
+ type: text
13
+ - name: change_note
14
+ isNullable: true
15
+ length: 500
16
+ - name: created_by_id
17
+ type: fk
18
+ isNullable: true
19
+ references:
20
+ table: user
21
+ column: id
22
+ onDelete: SET NULL
23
+ - type: created_at
24
+ indices:
25
+ - columns:
26
+ - instruction_id
27
+ - version
28
+ isUnique: true
29
+ - columns:
30
+ - instruction_id
@@ -0,0 +1,35 @@
1
+ columns:
2
+ - type: pk
3
+ - name: provider
4
+ length: 50
5
+ - name: model
6
+ length: 100
7
+ - name: price_input_per_million
8
+ type: decimal
9
+ precision: 10
10
+ scale: 4
11
+ - name: price_output_per_million
12
+ type: decimal
13
+ precision: 10
14
+ scale: 4
15
+ - name: price_cached_input_per_million
16
+ type: decimal
17
+ precision: 10
18
+ scale: 4
19
+ isNullable: true
20
+ - name: is_active
21
+ type: boolean
22
+ default: true
23
+ - name: valid_from
24
+ type: datetime
25
+ - type: created_at
26
+ indices:
27
+ - columns:
28
+ - provider
29
+ - model
30
+ - valid_from
31
+ isUnique: true
32
+ - columns:
33
+ - provider
34
+ - columns:
35
+ - is_active
@@ -7,6 +7,8 @@ columns:
7
7
  column: id
8
8
  onDelete: CASCADE
9
9
  - name: hash
10
+ - name: browser_id
11
+ isNullable: true
10
12
  - name: ip_address
11
13
  - name: user_agent
12
14
  - name: revoked_at
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hed-hog/core",
3
- "version": "0.0.364",
3
+ "version": "0.0.366",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "dependencies": {
@@ -15,6 +15,7 @@
15
15
  "@nestjs/common": "*",
16
16
  "@nestjs/config": "^4.0.2",
17
17
  "@nestjs/core": "^11",
18
+ "@nestjs/event-emitter": "*",
18
19
  "@nestjs/jwt": "^11",
19
20
  "@nestjs/mapped-types": "*",
20
21
  "@nestjs/schedule": "^6.0.1",
@@ -37,10 +38,10 @@
37
38
  "speakeasy": "^2.0.0",
38
39
  "ua-parser-js": "^2.0.10",
39
40
  "uuid": "^11.1.0",
41
+ "@hed-hog/api-pagination": "0.0.7",
40
42
  "@hed-hog/api": "0.0.8",
41
43
  "@hed-hog/api-locale": "0.0.14",
42
44
  "@hed-hog/api-mail": "0.0.9",
43
- "@hed-hog/api-pagination": "0.0.7",
44
45
  "@hed-hog/api-prisma": "0.0.6",
45
46
  "@hed-hog/api-types": "0.0.1"
46
47
  },
@@ -1,5 +1,6 @@
1
1
  import { PrismaModule } from '@hed-hog/api-prisma';
2
2
  import { Module, forwardRef } from '@nestjs/common';
3
+ import { AiInstructionModule } from '../ai-instruction/ai-instruction.module';
3
4
  import { FileModule } from '../file/file.module';
4
5
  import { SettingModule } from '../setting/setting.module';
5
6
  import { AiController } from './ai.controller';
@@ -10,6 +11,7 @@ import { AiService } from './ai.service';
10
11
  forwardRef(() => PrismaModule),
11
12
  forwardRef(() => SettingModule),
12
13
  forwardRef(() => FileModule),
14
+ forwardRef(() => AiInstructionModule),
13
15
  ],
14
16
  controllers: [AiController],
15
17
  providers: [AiService],