@interware/content-generator 0.4.4 → 0.6.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 (166) hide show
  1. package/README.md +21 -1
  2. package/dist/_chunks/{App-CfwvfmvL.js → App-CJxSC8yt.js} +32 -720
  3. package/dist/_chunks/{App-BQr5_g5u.mjs → App-qbgUXlOZ.mjs} +38 -726
  4. package/dist/_chunks/ImageStudioTabs-BLAH3KYv.mjs +5270 -0
  5. package/dist/_chunks/ImageStudioTabs-DtusqpQO.js +5271 -0
  6. package/dist/_chunks/PluginProviders-D79TeGSE.js +34 -0
  7. package/dist/_chunks/PluginProviders-DWMpcAIh.mjs +35 -0
  8. package/dist/_chunks/Settings-BQXxV3LO.js +242 -0
  9. package/dist/_chunks/Settings-o2GngLaW.mjs +242 -0
  10. package/dist/_chunks/StudioApp-BaySMwrk.js +18 -0
  11. package/dist/_chunks/StudioApp-C_znlQRo.mjs +18 -0
  12. package/dist/_chunks/{getTranslation-B9ND5RaH.mjs → getTranslation-B6Bsu-uq.mjs} +1 -1
  13. package/dist/_chunks/{getTranslation-DNhP1INv.js → getTranslation-BRVMWSf8.js} +1 -1
  14. package/dist/_chunks/{index-DGPqyrzz.js → index-BKhe-Jyx.js} +24 -6
  15. package/dist/_chunks/{index-Dyq8dxMX.mjs → index-BKigRXm3.mjs} +25 -7
  16. package/dist/admin/index.js +1 -1
  17. package/dist/admin/index.mjs +1 -1
  18. package/dist/admin/src/components/PluginIcon.d.ts +4 -2
  19. package/dist/admin/src/components/PluginProviders.d.ts +12 -0
  20. package/dist/admin/src/components/generate-video/Form.d.ts +1 -1
  21. package/dist/admin/src/components/settings/Form.d.ts +4 -5
  22. package/dist/admin/src/components/settings/VertexSettings.d.ts +18 -0
  23. package/dist/admin/src/containers/settings/index.d.ts +7 -7
  24. package/dist/admin/src/features/background-removal/RemoveBackgroundButton.d.ts +7 -0
  25. package/dist/admin/src/features/background-removal/RemoveBackgroundDialog.d.ts +15 -0
  26. package/dist/admin/src/features/background-removal/colorKey.d.ts +29 -0
  27. package/dist/admin/src/features/background-removal/imageCanvas.d.ts +20 -0
  28. package/dist/admin/src/features/background-removal/mask.d.ts +10 -0
  29. package/dist/admin/src/features/background-removal/runtime.d.ts +31 -0
  30. package/dist/admin/src/features/generator/EditEmpty.d.ts +13 -0
  31. package/dist/admin/src/features/generator/GeneratorTab.d.ts +7 -0
  32. package/dist/admin/src/features/generator/GroundingSources.d.ts +9 -0
  33. package/dist/admin/src/features/generator/ModeSwitch.d.ts +6 -0
  34. package/dist/admin/src/features/generator/PromptComposer.d.ts +25 -0
  35. package/dist/admin/src/features/generator/ReferencePicker.d.ts +26 -0
  36. package/dist/admin/src/features/generator/VersionHistory.d.ts +13 -0
  37. package/dist/admin/src/features/generator/generatorApi.d.ts +71 -0
  38. package/dist/admin/src/features/generator/model.d.ts +60 -0
  39. package/dist/admin/src/features/generator/useGeneratorApi.d.ts +21 -0
  40. package/dist/admin/src/features/image-studio/ImageStudioTabs.d.ts +26 -0
  41. package/dist/admin/src/features/image-studio/SegmentedSwitch.d.ts +18 -0
  42. package/dist/admin/src/features/image-studio/checkerboard.d.ts +5 -0
  43. package/dist/admin/src/features/library/FileCard.d.ts +17 -0
  44. package/dist/admin/src/features/library/FolderTree.d.ts +14 -0
  45. package/dist/admin/src/features/library/LibraryDialogs.d.ts +46 -0
  46. package/dist/admin/src/features/library/LibraryImagePicker.d.ts +15 -0
  47. package/dist/admin/src/features/library/LibraryTab.d.ts +2 -0
  48. package/dist/admin/src/features/library/SaveToLibraryDialog.d.ts +15 -0
  49. package/dist/admin/src/features/library/model.d.ts +40 -0
  50. package/dist/admin/src/features/library/studioRoot.d.ts +11 -0
  51. package/dist/admin/src/features/library/uploadApi.d.ts +77 -0
  52. package/dist/admin/src/features/library/useLibraryApi.d.ts +34 -0
  53. package/dist/admin/src/features/templates/editor/ColorField.d.ts +11 -0
  54. package/dist/admin/src/features/templates/editor/Editor.d.ts +19 -0
  55. package/dist/admin/src/features/templates/editor/EditorBar.d.ts +9 -0
  56. package/dist/admin/src/features/templates/editor/EditorMenuBar.d.ts +58 -0
  57. package/dist/admin/src/features/templates/editor/EditorToolbar.d.ts +20 -0
  58. package/dist/admin/src/features/templates/editor/ElementPalette.d.ts +10 -0
  59. package/dist/admin/src/features/templates/editor/FloatingPanel.d.ts +17 -0
  60. package/dist/admin/src/features/templates/editor/FullscreenView.d.ts +11 -0
  61. package/dist/admin/src/features/templates/editor/IconPicker.d.ts +9 -0
  62. package/dist/admin/src/features/templates/editor/Inspector.d.ts +17 -0
  63. package/dist/admin/src/features/templates/editor/LayersPanel.d.ts +12 -0
  64. package/dist/admin/src/features/templates/editor/Precision.d.ts +23 -0
  65. package/dist/admin/src/features/templates/editor/RangeField.d.ts +12 -0
  66. package/dist/admin/src/features/templates/editor/SaveTemplateDialog.d.ts +14 -0
  67. package/dist/admin/src/features/templates/editor/Stage.d.ts +29 -0
  68. package/dist/admin/src/features/templates/editor/TemplateFolderSelect.d.ts +9 -0
  69. package/dist/admin/src/features/templates/editor/TemplatePicker.d.ts +23 -0
  70. package/dist/admin/src/features/templates/editor/TemplatesTab.d.ts +5 -0
  71. package/dist/admin/src/features/templates/editor/TypographyControls.d.ts +24 -0
  72. package/dist/admin/src/features/templates/editor/icons.d.ts +7 -0
  73. package/dist/admin/src/features/templates/editor/overlays.d.ts +20 -0
  74. package/dist/admin/src/features/templates/editor/useCanvasNav.d.ts +25 -0
  75. package/dist/admin/src/features/templates/editor/useFitScale.d.ts +3 -0
  76. package/dist/admin/src/features/templates/export/fontEmbed.d.ts +22 -0
  77. package/dist/admin/src/features/templates/export/imageSource.d.ts +21 -0
  78. package/dist/admin/src/features/templates/export/pdf.d.ts +6 -0
  79. package/dist/admin/src/features/templates/export/render.d.ts +22 -0
  80. package/dist/admin/src/features/templates/export/useEditorIO.d.ts +18 -0
  81. package/dist/admin/src/features/templates/fonts/catalog.d.ts +47 -0
  82. package/dist/admin/src/features/templates/fonts/customFonts.d.ts +19 -0
  83. package/dist/admin/src/features/templates/fonts/useCustomFonts.d.ts +9 -0
  84. package/dist/admin/src/features/templates/fonts/useFonts.d.ts +2 -0
  85. package/dist/admin/src/features/templates/model/drag.d.ts +10 -0
  86. package/dist/admin/src/features/templates/model/editorReducer.d.ts +58 -0
  87. package/dist/admin/src/features/templates/model/layers.d.ts +42 -0
  88. package/dist/admin/src/features/templates/model/palette.d.ts +38 -0
  89. package/dist/admin/src/features/templates/model/presets.d.ts +17 -0
  90. package/dist/admin/src/features/templates/model/shortcuts.d.ts +19 -0
  91. package/dist/admin/src/features/templates/model/snap.d.ts +24 -0
  92. package/dist/admin/src/features/templates/model/templates.d.ts +8 -0
  93. package/dist/admin/src/features/templates/model/types.d.ts +154 -0
  94. package/dist/admin/src/features/templates/model/viewport.d.ts +36 -0
  95. package/dist/admin/src/features/templates/render/IWLogo.d.ts +7 -0
  96. package/dist/admin/src/features/templates/render/LayerCanvas.d.ts +13 -0
  97. package/dist/admin/src/features/templates/render/fonts.d.ts +5 -0
  98. package/dist/admin/src/features/templates/render/icons.d.ts +10 -0
  99. package/dist/admin/src/features/templates/render/renderLayer.d.ts +9 -0
  100. package/dist/admin/src/features/templates/store/persist.d.ts +41 -0
  101. package/dist/admin/src/features/templates/store/templatesApi.d.ts +49 -0
  102. package/dist/admin/src/features/templates/store/useMyTemplates.d.ts +19 -0
  103. package/dist/admin/src/features/templates/store/useTemplateSaving.d.ts +14 -0
  104. package/dist/admin/src/features/templates/store/useTemplatesApi.d.ts +23 -0
  105. package/dist/admin/src/hooks/useAdminTheme.d.ts +8 -0
  106. package/dist/admin/src/hooks/useThemeColors.d.ts +9 -0
  107. package/dist/admin/src/lib/dataUrl.d.ts +6 -0
  108. package/dist/admin/src/lib/promptRules.d.ts +23 -0
  109. package/dist/admin/src/lib/use-cases/articles/index.d.ts +12 -1
  110. package/dist/admin/src/lib/use-cases/categories/index.d.ts +12 -1
  111. package/dist/admin/src/lib/use-cases/facebook/index.d.ts +1 -1
  112. package/dist/admin/src/lib/use-cases/generate-content/index.d.ts +2 -2
  113. package/dist/admin/src/lib/use-cases/images/index.d.ts +1 -4
  114. package/dist/admin/src/lib/use-cases/linkedin/index.d.ts +1 -1
  115. package/dist/admin/src/lib/use-cases/settings/index.d.ts +14 -2
  116. package/dist/admin/src/lib/use-cases/users/index.d.ts +12 -1
  117. package/dist/admin/src/pages/ImageStudio.d.ts +3 -0
  118. package/dist/admin/src/pages/StudioApp.d.ts +3 -0
  119. package/dist/admin/src/pluginId.d.ts +6 -0
  120. package/dist/admin/src/test-setup.d.ts +1 -0
  121. package/dist/admin/src/test-utils.d.ts +5 -0
  122. package/dist/server/index.js +2494 -1279
  123. package/dist/server/index.mjs +2501 -1285
  124. package/dist/server/src/bootstrap.d.ts +1 -1
  125. package/dist/server/src/content-types/index.d.ts +66 -1
  126. package/dist/server/src/content-types/template/index.d.ts +65 -0
  127. package/dist/server/src/content-types/template/schema.d.ts +69 -0
  128. package/dist/server/src/controllers/config.d.ts +10 -0
  129. package/dist/server/src/controllers/controller.d.ts +0 -5
  130. package/dist/server/src/controllers/image-studio.d.ts +23 -0
  131. package/dist/server/src/controllers/index.d.ts +129 -5
  132. package/dist/server/src/controllers/templates.d.ts +26 -0
  133. package/dist/server/src/image-studio/geminiConfig.d.ts +40 -0
  134. package/dist/server/src/image-studio/models.d.ts +39 -0
  135. package/dist/server/src/image-studio/prompt.d.ts +7 -0
  136. package/dist/server/src/image-studio/validate.d.ts +41 -0
  137. package/dist/server/src/index.d.ts +233 -75
  138. package/dist/server/src/routes/admin.d.ts +6 -2
  139. package/dist/server/src/routes/content-api.d.ts +4 -9
  140. package/dist/server/src/routes/index.d.ts +7 -11
  141. package/dist/server/src/routes/policies.d.ts +14 -0
  142. package/dist/server/src/services/image-studio.d.ts +66 -0
  143. package/dist/server/src/services/index.d.ts +30 -57
  144. package/dist/server/src/services/service.d.ts +10 -57
  145. package/dist/server/src/services/templates.d.ts +81 -0
  146. package/dist/server/src/templates/folders.d.ts +14 -0
  147. package/dist/server/src/templates/validate.d.ts +23 -0
  148. package/dist/server/src/utils/folders.d.ts +15 -0
  149. package/dist/server/src/utils/geminiClient.d.ts +24 -0
  150. package/dist/server/src/utils/secrets.d.ts +9 -0
  151. package/dist/server/src/utils/serviceAccount.d.ts +29 -0
  152. package/package.json +23 -10
  153. package/static/background-worker.d.mts +15 -0
  154. package/static/background-worker.mjs +87 -0
  155. package/dist/_chunks/Settings-BrqTzJp-.js +0 -262
  156. package/dist/_chunks/Settings-CdZnYLLK.mjs +0 -244
  157. package/dist/admin/src/components/Navigation.d.ts +0 -2
  158. package/dist/admin/src/components/generate-image/Form.d.ts +0 -15
  159. package/dist/admin/src/components/generate-images/Image.d.ts +0 -5
  160. package/dist/admin/src/components/generate-images/Images.d.ts +0 -2
  161. package/dist/admin/src/components/generate-images/Modal.d.ts +0 -9
  162. package/dist/admin/src/containers/generate-image/index.d.ts +0 -2
  163. package/dist/admin/src/containers/generate-images/index.d.ts +0 -2
  164. package/dist/admin/src/hooks/generate-images/useImages.d.ts +0 -12
  165. package/dist/admin/src/pages/GenerateImage.d.ts +0 -2
  166. package/dist/admin/src/pages/GenerateImages.d.ts +0 -2
@@ -6,7 +6,7 @@ declare const _default: {
6
6
  }) => void;
7
7
  bootstrap: ({ strapi }: {
8
8
  strapi: import("@strapi/types/dist/core").Strapi;
9
- }) => void;
9
+ }) => Promise<void>;
10
10
  destroy: ({ strapi }: {
11
11
  strapi: import("@strapi/types/dist/core").Strapi;
12
12
  }) => void;
@@ -21,37 +21,153 @@ declare const _default: {
21
21
  getArticles(ctx: any): Promise<unknown>;
22
22
  getCategories(ctx: any): Promise<unknown>;
23
23
  getUsers(ctx: any): Promise<unknown>;
24
- getImages(ctx: any): Promise<unknown>;
25
- deleteImage(ctx: any): Promise<unknown>;
26
24
  generateArticle(ctx: any): Promise<void>;
27
25
  generateImageForArticle(ctx: any): Promise<void>;
28
- generateImage(ctx: any): Promise<void>;
29
26
  downloadFile(ctx: any): Promise<void>;
30
27
  generateVideo(ctx: any): Promise<void>;
31
28
  publishToLinkedIn(ctx: any): Promise<void>;
32
29
  publishToFacebook(ctx: any): Promise<void>;
33
- get(ctx: any): Promise<void>;
34
- set(ctx: any): Promise<void>;
35
30
  };
36
31
  config: ({ strapi }: {
37
32
  strapi: import("@strapi/types/dist/core").Strapi;
38
33
  }) => {
39
34
  get(ctx: any): Promise<void>;
40
35
  set(ctx: any): Promise<void>;
36
+ removeVertex(ctx: any): Promise<void>;
37
+ };
38
+ 'image-studio': ({ strapi }: {
39
+ strapi: import("@strapi/types/dist/core").Strapi;
40
+ }) => {
41
+ models: (ctx: {
42
+ request: {
43
+ body?: Record<string, unknown>;
44
+ files?: Record<string, never>;
45
+ };
46
+ status: number;
47
+ body: unknown;
48
+ }) => Promise<void>;
49
+ generate: (ctx: {
50
+ request: {
51
+ body?: Record<string, unknown>;
52
+ files?: Record<string, never>;
53
+ };
54
+ status: number;
55
+ body: unknown;
56
+ }) => Promise<void>;
57
+ edit: (ctx: {
58
+ request: {
59
+ body?: Record<string, unknown>;
60
+ files?: Record<string, never>;
61
+ };
62
+ status: number;
63
+ body: unknown;
64
+ }) => Promise<void>;
65
+ expand: (ctx: {
66
+ request: {
67
+ body?: Record<string, unknown>;
68
+ files?: Record<string, never>;
69
+ };
70
+ status: number;
71
+ body: unknown;
72
+ }) => Promise<void>;
73
+ };
74
+ templates: ({ strapi }: {
75
+ strapi: import("@strapi/types/dist/core").Strapi;
76
+ }) => {
77
+ list: (ctx: {
78
+ request: {
79
+ body?: Record<string, unknown>;
80
+ };
81
+ params: Record<string, string>;
82
+ status: number;
83
+ body: unknown;
84
+ }) => Promise<void>;
85
+ create: (ctx: {
86
+ request: {
87
+ body?: Record<string, unknown>;
88
+ };
89
+ params: Record<string, string>;
90
+ status: number;
91
+ body: unknown;
92
+ }) => Promise<void>;
93
+ findOne: (ctx: {
94
+ request: {
95
+ body?: Record<string, unknown>;
96
+ };
97
+ params: Record<string, string>;
98
+ status: number;
99
+ body: unknown;
100
+ }) => Promise<void>;
101
+ update: (ctx: {
102
+ request: {
103
+ body?: Record<string, unknown>;
104
+ };
105
+ params: Record<string, string>;
106
+ status: number;
107
+ body: unknown;
108
+ }) => Promise<void>;
109
+ remove: (ctx: {
110
+ request: {
111
+ body?: Record<string, unknown>;
112
+ };
113
+ params: Record<string, string>;
114
+ status: number;
115
+ body: unknown;
116
+ }) => Promise<void>;
117
+ saveBase: (ctx: {
118
+ request: {
119
+ body?: Record<string, unknown>;
120
+ };
121
+ params: Record<string, string>;
122
+ status: number;
123
+ body: unknown;
124
+ }) => Promise<void>;
125
+ restoreBase: (ctx: {
126
+ request: {
127
+ body?: Record<string, unknown>;
128
+ };
129
+ params: Record<string, string>;
130
+ status: number;
131
+ body: unknown;
132
+ }) => Promise<void>;
133
+ folders: (ctx: {
134
+ request: {
135
+ body?: Record<string, unknown>;
136
+ };
137
+ params: Record<string, string>;
138
+ status: number;
139
+ body: unknown;
140
+ }) => Promise<void>;
141
+ createFolder: (ctx: {
142
+ request: {
143
+ body?: Record<string, unknown>;
144
+ };
145
+ params: Record<string, string>;
146
+ status: number;
147
+ body: unknown;
148
+ }) => Promise<void>;
149
+ renameFolder: (ctx: {
150
+ request: {
151
+ body?: Record<string, unknown>;
152
+ };
153
+ params: Record<string, string>;
154
+ status: number;
155
+ body: unknown;
156
+ }) => Promise<void>;
157
+ deleteFolder: (ctx: {
158
+ request: {
159
+ body?: Record<string, unknown>;
160
+ };
161
+ params: Record<string, string>;
162
+ status: number;
163
+ body: unknown;
164
+ }) => Promise<void>;
41
165
  };
42
166
  };
43
167
  routes: {
44
168
  'content-api': {
45
169
  type: string;
46
- routes: {
47
- method: string;
48
- path: string;
49
- handler: string;
50
- config: {
51
- policies: any[];
52
- auth: boolean;
53
- };
54
- }[];
170
+ routes: any[];
55
171
  };
56
172
  admin: {
57
173
  type: string;
@@ -60,8 +176,12 @@ declare const _default: {
60
176
  path: string;
61
177
  handler: string;
62
178
  config: {
63
- policies: any[];
64
- auth: boolean;
179
+ policies: (string | {
180
+ name: string;
181
+ config: {
182
+ actions: string[];
183
+ };
184
+ })[];
65
185
  };
66
186
  }[];
67
187
  };
@@ -70,6 +190,9 @@ declare const _default: {
70
190
  service: ({ strapi }: {
71
191
  strapi: import("@strapi/types/dist/core").Strapi;
72
192
  }) => {
193
+ geminiClient({ allowVertex }?: {
194
+ allowVertex?: boolean;
195
+ }): Promise<import("./utils/geminiClient").GeminiClient>;
73
196
  geminiConfig(): Promise<import("@google/genai").GoogleGenAI>;
74
197
  getArticulos(sanitizedQueryParams: any): Promise<{
75
198
  id: import("@strapi/types/dist/data").ID;
@@ -122,55 +245,6 @@ declare const _default: {
122
245
  sfid?: string;
123
246
  username?: string;
124
247
  }[]>;
125
- getImagenes(): Promise<{
126
- id: import("@strapi/types/dist/data").ID;
127
- documentId: string;
128
- locale?: string;
129
- createdAt?: import("@strapi/types/dist/schema/attribute").DateTimeValue;
130
- publishedAt?: import("@strapi/types/dist/schema/attribute").DateTimeValue;
131
- updatedAt?: import("@strapi/types/dist/schema/attribute").DateTimeValue;
132
- provider?: string;
133
- alternativeText?: string;
134
- caption?: string;
135
- ext?: string;
136
- folderPath?: string;
137
- formats?: import("@strapi/types/dist/utils").JSONValue;
138
- hash?: string;
139
- height?: number;
140
- mime?: string;
141
- name?: string;
142
- previewUrl?: string;
143
- provider_metadata?: import("@strapi/types/dist/utils").JSONValue;
144
- size?: number;
145
- url?: string;
146
- width?: number;
147
- }[]>;
148
- eliminarImagen(sanitizedQueryParams: any): Promise<{
149
- documentId: string;
150
- entries: {
151
- id: import("@strapi/types/dist/data").ID;
152
- documentId: string;
153
- locale?: string;
154
- createdAt?: import("@strapi/types/dist/schema/attribute").DateTimeValue;
155
- publishedAt?: import("@strapi/types/dist/schema/attribute").DateTimeValue;
156
- updatedAt?: import("@strapi/types/dist/schema/attribute").DateTimeValue;
157
- provider?: string;
158
- alternativeText?: string;
159
- caption?: string;
160
- ext?: string;
161
- folderPath?: string;
162
- formats?: import("@strapi/types/dist/utils").JSONValue;
163
- hash?: string;
164
- height?: number;
165
- mime?: string;
166
- name?: string;
167
- previewUrl?: string;
168
- provider_metadata?: import("@strapi/types/dist/utils").JSONValue;
169
- size?: number;
170
- url?: string;
171
- width?: number;
172
- }[];
173
- }>;
174
248
  downloadFile(ctx: any): Promise<void>;
175
249
  _uploadGeneratedFile(file: string | Buffer, filename: string, mimeType: string, folderName?: string): Promise<any>;
176
250
  generateArticle(ctx: any): Promise<{
@@ -193,14 +267,6 @@ declare const _default: {
193
267
  message: string;
194
268
  image: any;
195
269
  }>;
196
- _callGeminiImageGeneration(promptText: string, aspectRatio: string, imageSizeLabel: string, referenceImages: {
197
- buffer: Buffer;
198
- mimeType: string;
199
- }[]): Promise<string>;
200
- generateImage(ctx: any): Promise<{
201
- message: string;
202
- file: any;
203
- }>;
204
270
  _callVeoVideoGeneration(promptText: string, aspectRatio: string, durationSeconds: number, sceneRefs: {
205
271
  buffer: Buffer;
206
272
  mimeType: string;
@@ -218,8 +284,100 @@ declare const _default: {
218
284
  facebookResponse: any;
219
285
  }>;
220
286
  };
287
+ 'image-studio': ({ strapi }: {
288
+ strapi: import("@strapi/types/dist/core").Strapi;
289
+ }) => {
290
+ models(): Promise<{
291
+ models: import("./image-studio/models").ImageModelInfo[];
292
+ verified: boolean;
293
+ }>;
294
+ generateForArticle(prompt: string, aspectRatio: string, imageSize: string): Promise<string>;
295
+ generate(input: import("./image-studio/validate").GenerateInput): Promise<import("./services/image-studio").GeneratedImage>;
296
+ edit(input: import("./image-studio/validate").EditInput): Promise<import("./services/image-studio").GeneratedImage>;
297
+ expand(prompt: string): Promise<string>;
298
+ };
299
+ templates: ({ strapi }: {
300
+ strapi: import("@strapi/types/dist/core").Strapi;
301
+ }) => {
302
+ list(): Promise<import("./services/templates").StoredTemplate[]>;
303
+ findOne(documentId: string): Promise<import("./services/templates").StoredTemplate>;
304
+ create(input: unknown): Promise<import("./services/templates").StoredTemplate>;
305
+ update(documentId: string, patch: unknown): Promise<import("./services/templates").StoredTemplate>;
306
+ remove(documentId: string): Promise<void>;
307
+ saveBase(baseId: unknown, input: unknown): Promise<import("./services/templates").StoredTemplate>;
308
+ restoreBase(baseId: unknown): Promise<void>;
309
+ folders: () => Promise<string[]>;
310
+ createFolder(path: unknown): Promise<string[]>;
311
+ renameFolder(from: unknown, to: unknown): Promise<string[]>;
312
+ deleteFolder(path: unknown): Promise<string[]>;
313
+ };
314
+ };
315
+ contentTypes: {
316
+ template: {
317
+ schema: {
318
+ kind: string;
319
+ collectionName: string;
320
+ info: {
321
+ singularName: string;
322
+ pluralName: string;
323
+ displayName: string;
324
+ description: string;
325
+ };
326
+ options: {
327
+ draftAndPublish: boolean;
328
+ };
329
+ pluginOptions: {
330
+ 'content-manager': {
331
+ visible: boolean;
332
+ };
333
+ 'content-type-builder': {
334
+ visible: boolean;
335
+ };
336
+ };
337
+ attributes: {
338
+ name: {
339
+ type: string;
340
+ required: boolean;
341
+ maxLength: number;
342
+ };
343
+ folder: {
344
+ type: string;
345
+ default: string;
346
+ };
347
+ width: {
348
+ type: string;
349
+ required: boolean;
350
+ };
351
+ height: {
352
+ type: string;
353
+ required: boolean;
354
+ };
355
+ background: {
356
+ type: string;
357
+ default: string;
358
+ };
359
+ safeMargin: {
360
+ type: string;
361
+ default: number;
362
+ };
363
+ gridUnit: {
364
+ type: string;
365
+ default: number;
366
+ };
367
+ layers: {
368
+ type: string;
369
+ required: boolean;
370
+ };
371
+ baseId: {
372
+ type: string;
373
+ };
374
+ replacesBase: {
375
+ type: string;
376
+ };
377
+ };
378
+ };
379
+ };
221
380
  };
222
- contentTypes: {};
223
381
  policies: {};
224
382
  middlewares: {};
225
383
  };
@@ -3,8 +3,12 @@ declare const _default: {
3
3
  path: string;
4
4
  handler: string;
5
5
  config: {
6
- policies: any[];
7
- auth: boolean;
6
+ policies: (string | {
7
+ name: string;
8
+ config: {
9
+ actions: string[];
10
+ };
11
+ })[];
8
12
  };
9
13
  }[];
10
14
  export default _default;
@@ -1,10 +1,5 @@
1
- declare const _default: {
2
- method: string;
3
- path: string;
4
- handler: string;
5
- config: {
6
- policies: any[];
7
- auth: boolean;
8
- };
9
- }[];
1
+ /**
2
+ * El plugin no expone rutas públicas. `/config` vive en las rutas del panel (ADR-001).
3
+ */
4
+ declare const _default: any[];
10
5
  export default _default;
@@ -1,15 +1,7 @@
1
1
  declare const _default: {
2
2
  'content-api': {
3
3
  type: string;
4
- routes: {
5
- method: string;
6
- path: string;
7
- handler: string;
8
- config: {
9
- policies: any[];
10
- auth: boolean;
11
- };
12
- }[];
4
+ routes: any[];
13
5
  };
14
6
  admin: {
15
7
  type: string;
@@ -18,8 +10,12 @@ declare const _default: {
18
10
  path: string;
19
11
  handler: string;
20
12
  config: {
21
- policies: any[];
22
- auth: boolean;
13
+ policies: (string | {
14
+ name: string;
15
+ config: {
16
+ actions: string[];
17
+ };
18
+ })[];
23
19
  };
24
20
  }[];
25
21
  };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Acción RBAC que registra `bootstrap.ts`. Toda ruta del plugin la exige (ADR-001).
3
+ */
4
+ export declare const ACCESS_ACTION = "plugin::strapi-content-generator-gemini.access";
5
+ /**
6
+ * Mismo par de políticas que usa el plugin upload de Strapi en sus rutas de administración:
7
+ * sesión de administrador válida y permiso explícito sobre el plugin.
8
+ */
9
+ export declare const ADMIN_ACCESS_POLICIES: (string | {
10
+ name: string;
11
+ config: {
12
+ actions: string[];
13
+ };
14
+ })[];
@@ -0,0 +1,66 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import type { Core } from '@strapi/strapi';
4
+ import type { GoogleGenAI } from '@google/genai';
5
+ import type { Backend } from '../image-studio/geminiConfig';
6
+ import type { EditInput, GenerateInput } from '../image-studio/validate';
7
+ /** El modelo no devolvió imagen (bloqueo de seguridad u otra causa): el controlador responde 422. */
8
+ export declare class BlockedError extends Error {
9
+ }
10
+ type ModelsApi = Pick<GoogleGenAI['models'], 'generateContent' | 'list'>;
11
+ type ReadFile = (path: string) => Promise<Buffer>;
12
+ export interface GeneratedImage {
13
+ image: string;
14
+ mimeType: string;
15
+ model: string;
16
+ /** Con búsqueda de Google: la sugerencia que Google pide mostrar y las fuentes (S4.14, D6). */
17
+ grounding?: {
18
+ suggestions?: string;
19
+ queries: string[];
20
+ sources: {
21
+ title: string;
22
+ uri: string;
23
+ }[];
24
+ };
25
+ }
26
+ /** Cliente del Estudio: los modelos y el backend con que se creó (Gemini API o Vertex AI, S5.1). */
27
+ export interface StudioClient {
28
+ models: ModelsApi;
29
+ backend: Backend;
30
+ }
31
+ /**
32
+ * Generador del Estudio de imágenes (diseño S4.2). Recibe el cliente por inyección para probarse sin red;
33
+ * las credenciales nunca salen del servidor. El cliente se pide en cada operación: si un admin configura o
34
+ * quita la cuenta de servicio en Ajustes, la siguiente petición ya usa el otro backend (S5.1).
35
+ */
36
+ export declare const createImageStudio: (getClient: () => Promise<StudioClient>, read?: ReadFile) => {
37
+ models(): Promise<{
38
+ models: import("../image-studio/models").ImageModelInfo[];
39
+ verified: boolean;
40
+ }>;
41
+ /**
42
+ * Imagen para un artículo (S4.12): antes usaba Imagen 4, que Google apagó. Usa el primer modelo
43
+ * disponible del catálogo y ajusta proporción y tamaño a lo que admite. Devuelve base64.
44
+ */
45
+ generateForArticle(prompt: string, aspectRatio: string, imageSize: string): Promise<string>;
46
+ generate(input: GenerateInput): Promise<GeneratedImage>;
47
+ edit(input: EditInput): Promise<GeneratedImage>;
48
+ expand(prompt: string): Promise<string>;
49
+ };
50
+ declare const _default: ({ strapi }: {
51
+ strapi: Core.Strapi;
52
+ }) => {
53
+ models(): Promise<{
54
+ models: import("../image-studio/models").ImageModelInfo[];
55
+ verified: boolean;
56
+ }>;
57
+ /**
58
+ * Imagen para un artículo (S4.12): antes usaba Imagen 4, que Google apagó. Usa el primer modelo
59
+ * disponible del catálogo y ajusta proporción y tamaño a lo que admite. Devuelve base64.
60
+ */
61
+ generateForArticle(prompt: string, aspectRatio: string, imageSize: string): Promise<string>;
62
+ generate(input: GenerateInput): Promise<GeneratedImage>;
63
+ edit(input: EditInput): Promise<GeneratedImage>;
64
+ expand(prompt: string): Promise<string>;
65
+ };
66
+ export default _default;
@@ -4,6 +4,9 @@ declare const _default: {
4
4
  service: ({ strapi }: {
5
5
  strapi: import("@strapi/types/dist/core").Strapi;
6
6
  }) => {
7
+ geminiClient({ allowVertex }?: {
8
+ allowVertex?: boolean;
9
+ }): Promise<import("../utils/geminiClient").GeminiClient>;
7
10
  geminiConfig(): Promise<import("@google/genai").GoogleGenAI>;
8
11
  getArticulos(sanitizedQueryParams: any): Promise<{
9
12
  id: import("@strapi/types/dist/data").ID;
@@ -56,55 +59,6 @@ declare const _default: {
56
59
  sfid?: string;
57
60
  username?: string;
58
61
  }[]>;
59
- getImagenes(): Promise<{
60
- id: import("@strapi/types/dist/data").ID;
61
- documentId: string;
62
- locale?: string;
63
- createdAt?: import("@strapi/types/dist/schema/attribute").DateTimeValue;
64
- publishedAt?: import("@strapi/types/dist/schema/attribute").DateTimeValue;
65
- updatedAt?: import("@strapi/types/dist/schema/attribute").DateTimeValue;
66
- provider?: string;
67
- alternativeText?: string;
68
- caption?: string;
69
- ext?: string;
70
- folderPath?: string;
71
- formats?: import("@strapi/types/dist/utils").JSONValue;
72
- hash?: string;
73
- height?: number;
74
- mime?: string;
75
- name?: string;
76
- previewUrl?: string;
77
- provider_metadata?: import("@strapi/types/dist/utils").JSONValue;
78
- size?: number;
79
- url?: string;
80
- width?: number;
81
- }[]>;
82
- eliminarImagen(sanitizedQueryParams: any): Promise<{
83
- documentId: string;
84
- entries: {
85
- id: import("@strapi/types/dist/data").ID;
86
- documentId: string;
87
- locale?: string;
88
- createdAt?: import("@strapi/types/dist/schema/attribute").DateTimeValue;
89
- publishedAt?: import("@strapi/types/dist/schema/attribute").DateTimeValue;
90
- updatedAt?: import("@strapi/types/dist/schema/attribute").DateTimeValue;
91
- provider?: string;
92
- alternativeText?: string;
93
- caption?: string;
94
- ext?: string;
95
- folderPath?: string;
96
- formats?: import("@strapi/types/dist/utils").JSONValue;
97
- hash?: string;
98
- height?: number;
99
- mime?: string;
100
- name?: string;
101
- previewUrl?: string;
102
- provider_metadata?: import("@strapi/types/dist/utils").JSONValue;
103
- size?: number;
104
- url?: string;
105
- width?: number;
106
- }[];
107
- }>;
108
62
  downloadFile(ctx: any): Promise<void>;
109
63
  _uploadGeneratedFile(file: string | Buffer, filename: string, mimeType: string, folderName?: string): Promise<any>;
110
64
  generateArticle(ctx: any): Promise<{
@@ -127,14 +81,6 @@ declare const _default: {
127
81
  message: string;
128
82
  image: any;
129
83
  }>;
130
- _callGeminiImageGeneration(promptText: string, aspectRatio: string, imageSizeLabel: string, referenceImages: {
131
- buffer: Buffer;
132
- mimeType: string;
133
- }[]): Promise<string>;
134
- generateImage(ctx: any): Promise<{
135
- message: string;
136
- file: any;
137
- }>;
138
84
  _callVeoVideoGeneration(promptText: string, aspectRatio: string, durationSeconds: number, sceneRefs: {
139
85
  buffer: Buffer;
140
86
  mimeType: string;
@@ -152,5 +98,32 @@ declare const _default: {
152
98
  facebookResponse: any;
153
99
  }>;
154
100
  };
101
+ 'image-studio': ({ strapi }: {
102
+ strapi: import("@strapi/types/dist/core").Strapi;
103
+ }) => {
104
+ models(): Promise<{
105
+ models: import("../image-studio/models").ImageModelInfo[];
106
+ verified: boolean;
107
+ }>;
108
+ generateForArticle(prompt: string, aspectRatio: string, imageSize: string): Promise<string>;
109
+ generate(input: import("../image-studio/validate").GenerateInput): Promise<import("./image-studio").GeneratedImage>;
110
+ edit(input: import("../image-studio/validate").EditInput): Promise<import("./image-studio").GeneratedImage>;
111
+ expand(prompt: string): Promise<string>;
112
+ };
113
+ templates: ({ strapi }: {
114
+ strapi: import("@strapi/types/dist/core").Strapi;
115
+ }) => {
116
+ list(): Promise<import("./templates").StoredTemplate[]>;
117
+ findOne(documentId: string): Promise<import("./templates").StoredTemplate>;
118
+ create(input: unknown): Promise<import("./templates").StoredTemplate>;
119
+ update(documentId: string, patch: unknown): Promise<import("./templates").StoredTemplate>;
120
+ remove(documentId: string): Promise<void>;
121
+ saveBase(baseId: unknown, input: unknown): Promise<import("./templates").StoredTemplate>;
122
+ restoreBase(baseId: unknown): Promise<void>;
123
+ folders: () => Promise<string[]>;
124
+ createFolder(path: unknown): Promise<string[]>;
125
+ renameFolder(from: unknown, to: unknown): Promise<string[]>;
126
+ deleteFolder(path: unknown): Promise<string[]>;
127
+ };
155
128
  };
156
129
  export default _default;