@interware/content-generator 0.4.4 → 0.5.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 (161) hide show
  1. package/README.md +21 -1
  2. package/dist/_chunks/{App-BQr5_g5u.mjs → App-DPVBu7QB.mjs} +37 -726
  3. package/dist/_chunks/{App-CfwvfmvL.js → App-DVTFrZvf.js} +31 -720
  4. package/dist/_chunks/ImageStudioTabs-B2UbKYq7.js +5299 -0
  5. package/dist/_chunks/ImageStudioTabs-mlNL6aQ2.mjs +5298 -0
  6. package/dist/_chunks/Settings-DziRY70a.js +155 -0
  7. package/dist/_chunks/Settings-RrBQdijj.mjs +155 -0
  8. package/dist/_chunks/StudioApp-AUyPNhh2.mjs +17 -0
  9. package/dist/_chunks/StudioApp-Cswkzh7F.js +17 -0
  10. package/dist/_chunks/{getTranslation-DNhP1INv.js → getTranslation-D88uLXGd.js} +1 -1
  11. package/dist/_chunks/{getTranslation-B9ND5RaH.mjs → getTranslation-DfxaP_TC.mjs} +1 -1
  12. package/dist/_chunks/{index-Dyq8dxMX.mjs → index-CqDdi211.mjs} +25 -7
  13. package/dist/_chunks/{index-DGPqyrzz.js → index-Ddp0Qvqo.js} +24 -6
  14. package/dist/admin/index.js +1 -1
  15. package/dist/admin/index.mjs +1 -1
  16. package/dist/admin/src/components/PluginIcon.d.ts +4 -2
  17. package/dist/admin/src/components/PluginProviders.d.ts +8 -0
  18. package/dist/admin/src/components/generate-video/Form.d.ts +1 -1
  19. package/dist/admin/src/components/settings/Form.d.ts +4 -5
  20. package/dist/admin/src/containers/settings/index.d.ts +7 -7
  21. package/dist/admin/src/features/background-removal/RemoveBackgroundButton.d.ts +7 -0
  22. package/dist/admin/src/features/background-removal/RemoveBackgroundDialog.d.ts +15 -0
  23. package/dist/admin/src/features/background-removal/colorKey.d.ts +29 -0
  24. package/dist/admin/src/features/background-removal/imageCanvas.d.ts +20 -0
  25. package/dist/admin/src/features/background-removal/mask.d.ts +10 -0
  26. package/dist/admin/src/features/background-removal/runtime.d.ts +31 -0
  27. package/dist/admin/src/features/generator/EditEmpty.d.ts +13 -0
  28. package/dist/admin/src/features/generator/GeneratorTab.d.ts +7 -0
  29. package/dist/admin/src/features/generator/GroundingSources.d.ts +9 -0
  30. package/dist/admin/src/features/generator/ModeSwitch.d.ts +6 -0
  31. package/dist/admin/src/features/generator/PromptComposer.d.ts +25 -0
  32. package/dist/admin/src/features/generator/ReferencePicker.d.ts +26 -0
  33. package/dist/admin/src/features/generator/VersionHistory.d.ts +13 -0
  34. package/dist/admin/src/features/generator/generatorApi.d.ts +71 -0
  35. package/dist/admin/src/features/generator/model.d.ts +60 -0
  36. package/dist/admin/src/features/generator/useGeneratorApi.d.ts +21 -0
  37. package/dist/admin/src/features/image-studio/ImageStudioTabs.d.ts +26 -0
  38. package/dist/admin/src/features/image-studio/SegmentedSwitch.d.ts +18 -0
  39. package/dist/admin/src/features/image-studio/checkerboard.d.ts +5 -0
  40. package/dist/admin/src/features/library/FileCard.d.ts +17 -0
  41. package/dist/admin/src/features/library/FolderTree.d.ts +14 -0
  42. package/dist/admin/src/features/library/LibraryDialogs.d.ts +46 -0
  43. package/dist/admin/src/features/library/LibraryImagePicker.d.ts +15 -0
  44. package/dist/admin/src/features/library/LibraryTab.d.ts +2 -0
  45. package/dist/admin/src/features/library/SaveToLibraryDialog.d.ts +15 -0
  46. package/dist/admin/src/features/library/model.d.ts +40 -0
  47. package/dist/admin/src/features/library/studioRoot.d.ts +11 -0
  48. package/dist/admin/src/features/library/uploadApi.d.ts +77 -0
  49. package/dist/admin/src/features/library/useLibraryApi.d.ts +34 -0
  50. package/dist/admin/src/features/templates/editor/ColorField.d.ts +11 -0
  51. package/dist/admin/src/features/templates/editor/Editor.d.ts +19 -0
  52. package/dist/admin/src/features/templates/editor/EditorBar.d.ts +9 -0
  53. package/dist/admin/src/features/templates/editor/EditorMenuBar.d.ts +58 -0
  54. package/dist/admin/src/features/templates/editor/EditorToolbar.d.ts +20 -0
  55. package/dist/admin/src/features/templates/editor/ElementPalette.d.ts +10 -0
  56. package/dist/admin/src/features/templates/editor/FloatingPanel.d.ts +17 -0
  57. package/dist/admin/src/features/templates/editor/FullscreenView.d.ts +11 -0
  58. package/dist/admin/src/features/templates/editor/IconPicker.d.ts +9 -0
  59. package/dist/admin/src/features/templates/editor/Inspector.d.ts +17 -0
  60. package/dist/admin/src/features/templates/editor/LayersPanel.d.ts +12 -0
  61. package/dist/admin/src/features/templates/editor/Precision.d.ts +23 -0
  62. package/dist/admin/src/features/templates/editor/RangeField.d.ts +12 -0
  63. package/dist/admin/src/features/templates/editor/SaveTemplateDialog.d.ts +14 -0
  64. package/dist/admin/src/features/templates/editor/Stage.d.ts +29 -0
  65. package/dist/admin/src/features/templates/editor/TemplateFolderSelect.d.ts +9 -0
  66. package/dist/admin/src/features/templates/editor/TemplatePicker.d.ts +23 -0
  67. package/dist/admin/src/features/templates/editor/TemplatesTab.d.ts +5 -0
  68. package/dist/admin/src/features/templates/editor/TypographyControls.d.ts +24 -0
  69. package/dist/admin/src/features/templates/editor/icons.d.ts +7 -0
  70. package/dist/admin/src/features/templates/editor/overlays.d.ts +20 -0
  71. package/dist/admin/src/features/templates/editor/useCanvasNav.d.ts +25 -0
  72. package/dist/admin/src/features/templates/editor/useFitScale.d.ts +3 -0
  73. package/dist/admin/src/features/templates/export/fontEmbed.d.ts +22 -0
  74. package/dist/admin/src/features/templates/export/imageSource.d.ts +21 -0
  75. package/dist/admin/src/features/templates/export/pdf.d.ts +6 -0
  76. package/dist/admin/src/features/templates/export/render.d.ts +22 -0
  77. package/dist/admin/src/features/templates/export/useEditorIO.d.ts +18 -0
  78. package/dist/admin/src/features/templates/fonts/catalog.d.ts +47 -0
  79. package/dist/admin/src/features/templates/fonts/customFonts.d.ts +19 -0
  80. package/dist/admin/src/features/templates/fonts/useCustomFonts.d.ts +9 -0
  81. package/dist/admin/src/features/templates/fonts/useFonts.d.ts +2 -0
  82. package/dist/admin/src/features/templates/model/drag.d.ts +10 -0
  83. package/dist/admin/src/features/templates/model/editorReducer.d.ts +58 -0
  84. package/dist/admin/src/features/templates/model/layers.d.ts +42 -0
  85. package/dist/admin/src/features/templates/model/palette.d.ts +38 -0
  86. package/dist/admin/src/features/templates/model/presets.d.ts +17 -0
  87. package/dist/admin/src/features/templates/model/shortcuts.d.ts +19 -0
  88. package/dist/admin/src/features/templates/model/snap.d.ts +24 -0
  89. package/dist/admin/src/features/templates/model/templates.d.ts +8 -0
  90. package/dist/admin/src/features/templates/model/types.d.ts +154 -0
  91. package/dist/admin/src/features/templates/model/viewport.d.ts +36 -0
  92. package/dist/admin/src/features/templates/render/IWLogo.d.ts +7 -0
  93. package/dist/admin/src/features/templates/render/LayerCanvas.d.ts +13 -0
  94. package/dist/admin/src/features/templates/render/fonts.d.ts +5 -0
  95. package/dist/admin/src/features/templates/render/icons.d.ts +10 -0
  96. package/dist/admin/src/features/templates/render/renderLayer.d.ts +9 -0
  97. package/dist/admin/src/features/templates/store/persist.d.ts +41 -0
  98. package/dist/admin/src/features/templates/store/templatesApi.d.ts +49 -0
  99. package/dist/admin/src/features/templates/store/useMyTemplates.d.ts +19 -0
  100. package/dist/admin/src/features/templates/store/useTemplateSaving.d.ts +14 -0
  101. package/dist/admin/src/features/templates/store/useTemplatesApi.d.ts +23 -0
  102. package/dist/admin/src/hooks/useAdminTheme.d.ts +8 -0
  103. package/dist/admin/src/hooks/useThemeColors.d.ts +9 -0
  104. package/dist/admin/src/lib/dataUrl.d.ts +6 -0
  105. package/dist/admin/src/lib/promptRules.d.ts +23 -0
  106. package/dist/admin/src/lib/use-cases/articles/index.d.ts +12 -1
  107. package/dist/admin/src/lib/use-cases/categories/index.d.ts +12 -1
  108. package/dist/admin/src/lib/use-cases/facebook/index.d.ts +1 -1
  109. package/dist/admin/src/lib/use-cases/generate-content/index.d.ts +2 -2
  110. package/dist/admin/src/lib/use-cases/images/index.d.ts +1 -4
  111. package/dist/admin/src/lib/use-cases/linkedin/index.d.ts +1 -1
  112. package/dist/admin/src/lib/use-cases/settings/index.d.ts +13 -2
  113. package/dist/admin/src/lib/use-cases/users/index.d.ts +12 -1
  114. package/dist/admin/src/pages/ImageStudio.d.ts +3 -0
  115. package/dist/admin/src/pages/StudioApp.d.ts +3 -0
  116. package/dist/admin/src/pluginId.d.ts +6 -0
  117. package/dist/admin/src/test-setup.d.ts +1 -0
  118. package/dist/admin/src/test-utils.d.ts +5 -0
  119. package/dist/server/index.js +2408 -1261
  120. package/dist/server/index.mjs +2415 -1267
  121. package/dist/server/src/bootstrap.d.ts +1 -1
  122. package/dist/server/src/content-types/index.d.ts +66 -1
  123. package/dist/server/src/content-types/template/index.d.ts +65 -0
  124. package/dist/server/src/content-types/template/schema.d.ts +69 -0
  125. package/dist/server/src/controllers/config.d.ts +2 -0
  126. package/dist/server/src/controllers/controller.d.ts +0 -5
  127. package/dist/server/src/controllers/image-studio.d.ts +23 -0
  128. package/dist/server/src/controllers/index.d.ts +128 -5
  129. package/dist/server/src/controllers/templates.d.ts +26 -0
  130. package/dist/server/src/image-studio/geminiConfig.d.ts +40 -0
  131. package/dist/server/src/image-studio/models.d.ts +38 -0
  132. package/dist/server/src/image-studio/prompt.d.ts +7 -0
  133. package/dist/server/src/image-studio/validate.d.ts +41 -0
  134. package/dist/server/src/index.d.ts +229 -75
  135. package/dist/server/src/routes/admin.d.ts +6 -2
  136. package/dist/server/src/routes/content-api.d.ts +4 -9
  137. package/dist/server/src/routes/index.d.ts +7 -11
  138. package/dist/server/src/routes/policies.d.ts +14 -0
  139. package/dist/server/src/services/image-studio.d.ts +62 -0
  140. package/dist/server/src/services/index.d.ts +27 -57
  141. package/dist/server/src/services/service.d.ts +0 -57
  142. package/dist/server/src/services/templates.d.ts +81 -0
  143. package/dist/server/src/templates/folders.d.ts +14 -0
  144. package/dist/server/src/templates/validate.d.ts +23 -0
  145. package/dist/server/src/utils/folders.d.ts +15 -0
  146. package/dist/server/src/utils/secrets.d.ts +9 -0
  147. package/package.json +22 -10
  148. package/static/background-worker.d.mts +15 -0
  149. package/static/background-worker.mjs +87 -0
  150. package/dist/_chunks/Settings-BrqTzJp-.js +0 -262
  151. package/dist/_chunks/Settings-CdZnYLLK.mjs +0 -244
  152. package/dist/admin/src/components/Navigation.d.ts +0 -2
  153. package/dist/admin/src/components/generate-image/Form.d.ts +0 -15
  154. package/dist/admin/src/components/generate-images/Image.d.ts +0 -5
  155. package/dist/admin/src/components/generate-images/Images.d.ts +0 -2
  156. package/dist/admin/src/components/generate-images/Modal.d.ts +0 -9
  157. package/dist/admin/src/containers/generate-image/index.d.ts +0 -2
  158. package/dist/admin/src/containers/generate-images/index.d.ts +0 -2
  159. package/dist/admin/src/hooks/generate-images/useImages.d.ts +0 -12
  160. package/dist/admin/src/pages/GenerateImage.d.ts +0 -2
  161. 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,17 +21,12 @@ 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;
@@ -39,19 +34,139 @@ declare const _default: {
39
34
  get(ctx: any): Promise<void>;
40
35
  set(ctx: any): Promise<void>;
41
36
  };
37
+ 'image-studio': ({ strapi }: {
38
+ strapi: import("@strapi/types/dist/core").Strapi;
39
+ }) => {
40
+ models: (ctx: {
41
+ request: {
42
+ body?: Record<string, unknown>;
43
+ files?: Record<string, never>;
44
+ };
45
+ status: number;
46
+ body: unknown;
47
+ }) => Promise<void>;
48
+ generate: (ctx: {
49
+ request: {
50
+ body?: Record<string, unknown>;
51
+ files?: Record<string, never>;
52
+ };
53
+ status: number;
54
+ body: unknown;
55
+ }) => Promise<void>;
56
+ edit: (ctx: {
57
+ request: {
58
+ body?: Record<string, unknown>;
59
+ files?: Record<string, never>;
60
+ };
61
+ status: number;
62
+ body: unknown;
63
+ }) => Promise<void>;
64
+ expand: (ctx: {
65
+ request: {
66
+ body?: Record<string, unknown>;
67
+ files?: Record<string, never>;
68
+ };
69
+ status: number;
70
+ body: unknown;
71
+ }) => Promise<void>;
72
+ };
73
+ templates: ({ strapi }: {
74
+ strapi: import("@strapi/types/dist/core").Strapi;
75
+ }) => {
76
+ list: (ctx: {
77
+ request: {
78
+ body?: Record<string, unknown>;
79
+ };
80
+ params: Record<string, string>;
81
+ status: number;
82
+ body: unknown;
83
+ }) => Promise<void>;
84
+ create: (ctx: {
85
+ request: {
86
+ body?: Record<string, unknown>;
87
+ };
88
+ params: Record<string, string>;
89
+ status: number;
90
+ body: unknown;
91
+ }) => Promise<void>;
92
+ findOne: (ctx: {
93
+ request: {
94
+ body?: Record<string, unknown>;
95
+ };
96
+ params: Record<string, string>;
97
+ status: number;
98
+ body: unknown;
99
+ }) => Promise<void>;
100
+ update: (ctx: {
101
+ request: {
102
+ body?: Record<string, unknown>;
103
+ };
104
+ params: Record<string, string>;
105
+ status: number;
106
+ body: unknown;
107
+ }) => Promise<void>;
108
+ remove: (ctx: {
109
+ request: {
110
+ body?: Record<string, unknown>;
111
+ };
112
+ params: Record<string, string>;
113
+ status: number;
114
+ body: unknown;
115
+ }) => Promise<void>;
116
+ saveBase: (ctx: {
117
+ request: {
118
+ body?: Record<string, unknown>;
119
+ };
120
+ params: Record<string, string>;
121
+ status: number;
122
+ body: unknown;
123
+ }) => Promise<void>;
124
+ restoreBase: (ctx: {
125
+ request: {
126
+ body?: Record<string, unknown>;
127
+ };
128
+ params: Record<string, string>;
129
+ status: number;
130
+ body: unknown;
131
+ }) => Promise<void>;
132
+ folders: (ctx: {
133
+ request: {
134
+ body?: Record<string, unknown>;
135
+ };
136
+ params: Record<string, string>;
137
+ status: number;
138
+ body: unknown;
139
+ }) => Promise<void>;
140
+ createFolder: (ctx: {
141
+ request: {
142
+ body?: Record<string, unknown>;
143
+ };
144
+ params: Record<string, string>;
145
+ status: number;
146
+ body: unknown;
147
+ }) => Promise<void>;
148
+ renameFolder: (ctx: {
149
+ request: {
150
+ body?: Record<string, unknown>;
151
+ };
152
+ params: Record<string, string>;
153
+ status: number;
154
+ body: unknown;
155
+ }) => Promise<void>;
156
+ deleteFolder: (ctx: {
157
+ request: {
158
+ body?: Record<string, unknown>;
159
+ };
160
+ params: Record<string, string>;
161
+ status: number;
162
+ body: unknown;
163
+ }) => Promise<void>;
164
+ };
42
165
  };
43
166
  routes: {
44
167
  'content-api': {
45
168
  type: string;
46
- routes: {
47
- method: string;
48
- path: string;
49
- handler: string;
50
- config: {
51
- policies: any[];
52
- auth: boolean;
53
- };
54
- }[];
169
+ routes: any[];
55
170
  };
56
171
  admin: {
57
172
  type: string;
@@ -60,8 +175,12 @@ declare const _default: {
60
175
  path: string;
61
176
  handler: string;
62
177
  config: {
63
- policies: any[];
64
- auth: boolean;
178
+ policies: (string | {
179
+ name: string;
180
+ config: {
181
+ actions: string[];
182
+ };
183
+ })[];
65
184
  };
66
185
  }[];
67
186
  };
@@ -122,55 +241,6 @@ declare const _default: {
122
241
  sfid?: string;
123
242
  username?: string;
124
243
  }[]>;
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
244
  downloadFile(ctx: any): Promise<void>;
175
245
  _uploadGeneratedFile(file: string | Buffer, filename: string, mimeType: string, folderName?: string): Promise<any>;
176
246
  generateArticle(ctx: any): Promise<{
@@ -193,14 +263,6 @@ declare const _default: {
193
263
  message: string;
194
264
  image: any;
195
265
  }>;
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
266
  _callVeoVideoGeneration(promptText: string, aspectRatio: string, durationSeconds: number, sceneRefs: {
205
267
  buffer: Buffer;
206
268
  mimeType: string;
@@ -218,8 +280,100 @@ declare const _default: {
218
280
  facebookResponse: any;
219
281
  }>;
220
282
  };
283
+ 'image-studio': ({ strapi }: {
284
+ strapi: import("@strapi/types/dist/core").Strapi;
285
+ }) => {
286
+ models(): Promise<{
287
+ models: import("./image-studio/models").ImageModelInfo[];
288
+ verified: boolean;
289
+ }>;
290
+ generateForArticle(prompt: string, aspectRatio: string, imageSize: string): Promise<string>;
291
+ generate(input: import("./image-studio/validate").GenerateInput): Promise<import("./services/image-studio").GeneratedImage>;
292
+ edit(input: import("./image-studio/validate").EditInput): Promise<import("./services/image-studio").GeneratedImage>;
293
+ expand(prompt: string): Promise<string>;
294
+ };
295
+ templates: ({ strapi }: {
296
+ strapi: import("@strapi/types/dist/core").Strapi;
297
+ }) => {
298
+ list(): Promise<import("./services/templates").StoredTemplate[]>;
299
+ findOne(documentId: string): Promise<import("./services/templates").StoredTemplate>;
300
+ create(input: unknown): Promise<import("./services/templates").StoredTemplate>;
301
+ update(documentId: string, patch: unknown): Promise<import("./services/templates").StoredTemplate>;
302
+ remove(documentId: string): Promise<void>;
303
+ saveBase(baseId: unknown, input: unknown): Promise<import("./services/templates").StoredTemplate>;
304
+ restoreBase(baseId: unknown): Promise<void>;
305
+ folders: () => Promise<string[]>;
306
+ createFolder(path: unknown): Promise<string[]>;
307
+ renameFolder(from: unknown, to: unknown): Promise<string[]>;
308
+ deleteFolder(path: unknown): Promise<string[]>;
309
+ };
310
+ };
311
+ contentTypes: {
312
+ template: {
313
+ schema: {
314
+ kind: string;
315
+ collectionName: string;
316
+ info: {
317
+ singularName: string;
318
+ pluralName: string;
319
+ displayName: string;
320
+ description: string;
321
+ };
322
+ options: {
323
+ draftAndPublish: boolean;
324
+ };
325
+ pluginOptions: {
326
+ 'content-manager': {
327
+ visible: boolean;
328
+ };
329
+ 'content-type-builder': {
330
+ visible: boolean;
331
+ };
332
+ };
333
+ attributes: {
334
+ name: {
335
+ type: string;
336
+ required: boolean;
337
+ maxLength: number;
338
+ };
339
+ folder: {
340
+ type: string;
341
+ default: string;
342
+ };
343
+ width: {
344
+ type: string;
345
+ required: boolean;
346
+ };
347
+ height: {
348
+ type: string;
349
+ required: boolean;
350
+ };
351
+ background: {
352
+ type: string;
353
+ default: string;
354
+ };
355
+ safeMargin: {
356
+ type: string;
357
+ default: number;
358
+ };
359
+ gridUnit: {
360
+ type: string;
361
+ default: number;
362
+ };
363
+ layers: {
364
+ type: string;
365
+ required: boolean;
366
+ };
367
+ baseId: {
368
+ type: string;
369
+ };
370
+ replacesBase: {
371
+ type: string;
372
+ };
373
+ };
374
+ };
375
+ };
221
376
  };
222
- contentTypes: {};
223
377
  policies: {};
224
378
  middlewares: {};
225
379
  };
@@ -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,62 @@
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
+ /**
27
+ * Generador del Estudio de imágenes (diseño S4.2). Recibe el cliente de Gemini por inyección para
28
+ * probarse sin red; la llave nunca sale del servidor. `backend` indica con qué se creó el cliente:
29
+ * hoy llave de API (Gemini API); al migrar a Vertex AI se crea con `vertexai: true` y se pasa
30
+ * `'vertex'` (S4.14).
31
+ */
32
+ export declare const createImageStudio: (getModels: () => Promise<ModelsApi>, read?: ReadFile, backend?: Backend) => {
33
+ models(): Promise<{
34
+ models: import("../image-studio/models").ImageModelInfo[];
35
+ verified: boolean;
36
+ }>;
37
+ /**
38
+ * Imagen para un artículo (S4.12): antes usaba Imagen 4, que Google apagó. Usa el primer modelo
39
+ * disponible del catálogo y ajusta proporción y tamaño a lo que admite. Devuelve base64.
40
+ */
41
+ generateForArticle(prompt: string, aspectRatio: string, imageSize: string): Promise<string>;
42
+ generate(input: GenerateInput): Promise<GeneratedImage>;
43
+ edit(input: EditInput): Promise<GeneratedImage>;
44
+ expand(prompt: string): Promise<string>;
45
+ };
46
+ declare const _default: ({ strapi }: {
47
+ strapi: Core.Strapi;
48
+ }) => {
49
+ models(): Promise<{
50
+ models: import("../image-studio/models").ImageModelInfo[];
51
+ verified: boolean;
52
+ }>;
53
+ /**
54
+ * Imagen para un artículo (S4.12): antes usaba Imagen 4, que Google apagó. Usa el primer modelo
55
+ * disponible del catálogo y ajusta proporción y tamaño a lo que admite. Devuelve base64.
56
+ */
57
+ generateForArticle(prompt: string, aspectRatio: string, imageSize: string): Promise<string>;
58
+ generate(input: GenerateInput): Promise<GeneratedImage>;
59
+ edit(input: EditInput): Promise<GeneratedImage>;
60
+ expand(prompt: string): Promise<string>;
61
+ };
62
+ export default _default;
@@ -56,55 +56,6 @@ declare const _default: {
56
56
  sfid?: string;
57
57
  username?: string;
58
58
  }[]>;
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
59
  downloadFile(ctx: any): Promise<void>;
109
60
  _uploadGeneratedFile(file: string | Buffer, filename: string, mimeType: string, folderName?: string): Promise<any>;
110
61
  generateArticle(ctx: any): Promise<{
@@ -127,14 +78,6 @@ declare const _default: {
127
78
  message: string;
128
79
  image: any;
129
80
  }>;
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
81
  _callVeoVideoGeneration(promptText: string, aspectRatio: string, durationSeconds: number, sceneRefs: {
139
82
  buffer: Buffer;
140
83
  mimeType: string;
@@ -152,5 +95,32 @@ declare const _default: {
152
95
  facebookResponse: any;
153
96
  }>;
154
97
  };
98
+ 'image-studio': ({ strapi }: {
99
+ strapi: import("@strapi/types/dist/core").Strapi;
100
+ }) => {
101
+ models(): Promise<{
102
+ models: import("../image-studio/models").ImageModelInfo[];
103
+ verified: boolean;
104
+ }>;
105
+ generateForArticle(prompt: string, aspectRatio: string, imageSize: string): Promise<string>;
106
+ generate(input: import("../image-studio/validate").GenerateInput): Promise<import("./image-studio").GeneratedImage>;
107
+ edit(input: import("../image-studio/validate").EditInput): Promise<import("./image-studio").GeneratedImage>;
108
+ expand(prompt: string): Promise<string>;
109
+ };
110
+ templates: ({ strapi }: {
111
+ strapi: import("@strapi/types/dist/core").Strapi;
112
+ }) => {
113
+ list(): Promise<import("./templates").StoredTemplate[]>;
114
+ findOne(documentId: string): Promise<import("./templates").StoredTemplate>;
115
+ create(input: unknown): Promise<import("./templates").StoredTemplate>;
116
+ update(documentId: string, patch: unknown): Promise<import("./templates").StoredTemplate>;
117
+ remove(documentId: string): Promise<void>;
118
+ saveBase(baseId: unknown, input: unknown): Promise<import("./templates").StoredTemplate>;
119
+ restoreBase(baseId: unknown): Promise<void>;
120
+ folders: () => Promise<string[]>;
121
+ createFolder(path: unknown): Promise<string[]>;
122
+ renameFolder(from: unknown, to: unknown): Promise<string[]>;
123
+ deleteFolder(path: unknown): Promise<string[]>;
124
+ };
155
125
  };
156
126
  export default _default;
@@ -57,55 +57,6 @@ declare const service: ({ strapi }: {
57
57
  sfid?: string;
58
58
  username?: string;
59
59
  }[]>;
60
- getImagenes(): Promise<{
61
- id: import("@strapi/types/dist/data").ID;
62
- documentId: string;
63
- locale?: string;
64
- createdAt?: import("@strapi/types/dist/schema/attribute").DateTimeValue;
65
- publishedAt?: import("@strapi/types/dist/schema/attribute").DateTimeValue;
66
- updatedAt?: import("@strapi/types/dist/schema/attribute").DateTimeValue;
67
- provider?: string;
68
- alternativeText?: string;
69
- caption?: string;
70
- ext?: string;
71
- folderPath?: string;
72
- formats?: import("@strapi/types/dist/utils").JSONValue;
73
- hash?: string;
74
- height?: number;
75
- mime?: string;
76
- name?: string;
77
- previewUrl?: string;
78
- provider_metadata?: import("@strapi/types/dist/utils").JSONValue;
79
- size?: number;
80
- url?: string;
81
- width?: number;
82
- }[]>;
83
- eliminarImagen(sanitizedQueryParams: any): Promise<{
84
- documentId: string;
85
- entries: {
86
- id: import("@strapi/types/dist/data").ID;
87
- documentId: string;
88
- locale?: string;
89
- createdAt?: import("@strapi/types/dist/schema/attribute").DateTimeValue;
90
- publishedAt?: import("@strapi/types/dist/schema/attribute").DateTimeValue;
91
- updatedAt?: import("@strapi/types/dist/schema/attribute").DateTimeValue;
92
- provider?: string;
93
- alternativeText?: string;
94
- caption?: string;
95
- ext?: string;
96
- folderPath?: string;
97
- formats?: import("@strapi/types/dist/utils").JSONValue;
98
- hash?: string;
99
- height?: number;
100
- mime?: string;
101
- name?: string;
102
- previewUrl?: string;
103
- provider_metadata?: import("@strapi/types/dist/utils").JSONValue;
104
- size?: number;
105
- url?: string;
106
- width?: number;
107
- }[];
108
- }>;
109
60
  downloadFile(ctx: any): Promise<void>;
110
61
  _uploadGeneratedFile(file: Buffer | string, filename: string, mimeType: string, folderName?: string): Promise<any>;
111
62
  generateArticle(ctx: any): Promise<{
@@ -128,14 +79,6 @@ declare const service: ({ strapi }: {
128
79
  message: string;
129
80
  image: any;
130
81
  }>;
131
- _callGeminiImageGeneration(promptText: string, aspectRatio: string, imageSizeLabel: string, referenceImages: {
132
- buffer: Buffer;
133
- mimeType: string;
134
- }[]): Promise<string>;
135
- generateImage(ctx: any): Promise<{
136
- message: string;
137
- file: any;
138
- }>;
139
82
  _callVeoVideoGeneration(promptText: string, aspectRatio: string, durationSeconds: number, sceneRefs: {
140
83
  buffer: Buffer;
141
84
  mimeType: string;