@interware/content-generator 0.1.4 → 0.2.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 (30) hide show
  1. package/dist/_chunks/{App-KtJGFVFQ.mjs → App-Cbkccs2K.mjs} +552 -55
  2. package/dist/_chunks/{App-Bt1yydY9.js → App-DCuBRwX8.js} +545 -48
  3. package/dist/_chunks/{Settings-CFag78zw.mjs → Settings-B60QGKK4.mjs} +48 -4
  4. package/dist/_chunks/{Settings-BbIpY74m.js → Settings-DuGbtyWC.js} +48 -4
  5. package/dist/_chunks/{getTranslation-BcuPOeW7.mjs → getTranslation-B97xbmEl.mjs} +1 -1
  6. package/dist/_chunks/{getTranslation-DA3AxQPb.js → getTranslation-CacX7ZX5.js} +1 -1
  7. package/dist/_chunks/{index-B6aEv34B.mjs → index-B2RuvYul.mjs} +2 -2
  8. package/dist/_chunks/{index-JZA3FSFH.js → index-BVGbP3E-.js} +2 -2
  9. package/dist/admin/index.js +1 -1
  10. package/dist/admin/index.mjs +1 -1
  11. package/dist/admin/src/components/Navigation.d.ts +2 -0
  12. package/dist/admin/src/components/generate-content/Form.d.ts +1 -1
  13. package/dist/admin/src/components/generate-images/Image.d.ts +5 -0
  14. package/dist/admin/src/components/generate-images/Images.d.ts +2 -0
  15. package/dist/admin/src/components/generate-images/Modal.d.ts +9 -0
  16. package/dist/admin/src/components/home/table.d.ts +2 -1
  17. package/dist/admin/src/containers/generate-images/index.d.ts +2 -0
  18. package/dist/admin/src/containers/settings/index.d.ts +2 -0
  19. package/dist/admin/src/hooks/generate-images/useImages.d.ts +11 -0
  20. package/dist/admin/src/lib/use-cases/facebook/index.d.ts +5 -0
  21. package/dist/admin/src/lib/use-cases/images/index.d.ts +6 -0
  22. package/dist/admin/src/pages/GenerateImages.d.ts +2 -0
  23. package/dist/server/index.js +309 -147
  24. package/dist/server/index.mjs +309 -127
  25. package/dist/server/src/controllers/controller.d.ts +2 -0
  26. package/dist/server/src/controllers/index.d.ts +2 -0
  27. package/dist/server/src/index.d.ts +56 -1
  28. package/dist/server/src/services/index.d.ts +54 -1
  29. package/dist/server/src/services/service.d.ts +54 -1
  30. package/package.json +1 -2
@@ -5,8 +5,8 @@ import { useCallback, useState, useEffect } from "react";
5
5
  import { Box, Grid, Field, Flex, Button, DesignSystemProvider, Typography } from "@strapi/design-system";
6
6
  import { Formik } from "formik";
7
7
  import * as Yup from "yup";
8
- import { P as PLUGIN_ID } from "./index-B6aEv34B.mjs";
9
- import { g as getTranslation } from "./getTranslation-BcuPOeW7.mjs";
8
+ import { P as PLUGIN_ID } from "./index-B2RuvYul.mjs";
9
+ import { g as getTranslation } from "./getTranslation-B97xbmEl.mjs";
10
10
  const useSettings = () => {
11
11
  const { get, post } = useFetchClient();
12
12
  const getSettings = useCallback(
@@ -29,7 +29,9 @@ const useSettings = () => {
29
29
  const schema = Yup.object({
30
30
  googleGenAI: Yup.string().required("Este campo es requerido"),
31
31
  linkedInAccessToken: Yup.string().required("Este campo es requerido"),
32
- linkedInOrganizationId: Yup.string().required("Este campo es requerido")
32
+ linkedInOrganizationId: Yup.string().required("Este campo es requerido"),
33
+ facebookClientToken: Yup.string().required("Este campo es requerido"),
34
+ facebookPageId: Yup.string().required("Este campo es requerido")
33
35
  });
34
36
  const Form = ({ settings, handleSubmit }) => {
35
37
  return /* @__PURE__ */ jsx(Box, { padding: 6, margin: 6, background: "neutral0", width: "100%", children: /* @__PURE__ */ jsx(
@@ -110,6 +112,46 @@ const Form = ({ settings, handleSubmit }) => {
110
112
  ]
111
113
  }
112
114
  ) }),
115
+ /* @__PURE__ */ jsx(Grid.Item, { children: /* @__PURE__ */ jsxs(
116
+ Field.Root,
117
+ {
118
+ id: "facebookClientToken",
119
+ required: true,
120
+ width: "100%",
121
+ children: [
122
+ /* @__PURE__ */ jsx(Field.Label, { children: "FACEBOOK CLIENT TOKEN" }),
123
+ /* @__PURE__ */ jsx(
124
+ Field.Input,
125
+ {
126
+ name: "facebookClientToken",
127
+ value: values.facebookClientToken,
128
+ type: "password",
129
+ onChange: handleChange
130
+ }
131
+ )
132
+ ]
133
+ }
134
+ ) }),
135
+ /* @__PURE__ */ jsx(Grid.Item, { children: /* @__PURE__ */ jsxs(
136
+ Field.Root,
137
+ {
138
+ id: "facebookPageId",
139
+ required: true,
140
+ width: "100%",
141
+ children: [
142
+ /* @__PURE__ */ jsx(Field.Label, { children: "FACEBOOK PAGE ID" }),
143
+ /* @__PURE__ */ jsx(
144
+ Field.Input,
145
+ {
146
+ name: "facebookPageId",
147
+ value: values.facebookPageId,
148
+ type: "password",
149
+ onChange: handleChange
150
+ }
151
+ )
152
+ ]
153
+ }
154
+ ) }),
113
155
  /* @__PURE__ */ jsx(Grid.Item, { children: /* @__PURE__ */ jsx(Flex, { justifyContent: "end", alignItems: "end", width: "100%", children: /* @__PURE__ */ jsx(
114
156
  Button,
115
157
  {
@@ -126,7 +168,9 @@ const Form = ({ settings, handleSubmit }) => {
126
168
  const initialValues = {
127
169
  googleGenAI: "",
128
170
  linkedInAccessToken: "",
129
- linkedInOrganizationId: ""
171
+ linkedInOrganizationId: "",
172
+ facebookClientToken: "",
173
+ facebookPageId: ""
130
174
  };
131
175
  const SettingsContainer = () => {
132
176
  const [settings, setSettingsConfig] = useState(initialValues);
@@ -7,8 +7,8 @@ const react = require("react");
7
7
  const designSystem = require("@strapi/design-system");
8
8
  const formik = require("formik");
9
9
  const Yup = require("yup");
10
- const index = require("./index-JZA3FSFH.js");
11
- const getTranslation = require("./getTranslation-DA3AxQPb.js");
10
+ const index = require("./index-BVGbP3E-.js");
11
+ const getTranslation = require("./getTranslation-CacX7ZX5.js");
12
12
  function _interopNamespace(e) {
13
13
  if (e && e.__esModule) return e;
14
14
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -49,7 +49,9 @@ const useSettings = () => {
49
49
  const schema = Yup__namespace.object({
50
50
  googleGenAI: Yup__namespace.string().required("Este campo es requerido"),
51
51
  linkedInAccessToken: Yup__namespace.string().required("Este campo es requerido"),
52
- linkedInOrganizationId: Yup__namespace.string().required("Este campo es requerido")
52
+ linkedInOrganizationId: Yup__namespace.string().required("Este campo es requerido"),
53
+ facebookClientToken: Yup__namespace.string().required("Este campo es requerido"),
54
+ facebookPageId: Yup__namespace.string().required("Este campo es requerido")
53
55
  });
54
56
  const Form = ({ settings, handleSubmit }) => {
55
57
  return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 6, margin: 6, background: "neutral0", width: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -130,6 +132,46 @@ const Form = ({ settings, handleSubmit }) => {
130
132
  ]
131
133
  }
132
134
  ) }),
135
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { children: /* @__PURE__ */ jsxRuntime.jsxs(
136
+ designSystem.Field.Root,
137
+ {
138
+ id: "facebookClientToken",
139
+ required: true,
140
+ width: "100%",
141
+ children: [
142
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: "FACEBOOK CLIENT TOKEN" }),
143
+ /* @__PURE__ */ jsxRuntime.jsx(
144
+ designSystem.Field.Input,
145
+ {
146
+ name: "facebookClientToken",
147
+ value: values.facebookClientToken,
148
+ type: "password",
149
+ onChange: handleChange
150
+ }
151
+ )
152
+ ]
153
+ }
154
+ ) }),
155
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { children: /* @__PURE__ */ jsxRuntime.jsxs(
156
+ designSystem.Field.Root,
157
+ {
158
+ id: "facebookPageId",
159
+ required: true,
160
+ width: "100%",
161
+ children: [
162
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: "FACEBOOK PAGE ID" }),
163
+ /* @__PURE__ */ jsxRuntime.jsx(
164
+ designSystem.Field.Input,
165
+ {
166
+ name: "facebookPageId",
167
+ value: values.facebookPageId,
168
+ type: "password",
169
+ onChange: handleChange
170
+ }
171
+ )
172
+ ]
173
+ }
174
+ ) }),
133
175
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "end", alignItems: "end", width: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(
134
176
  designSystem.Button,
135
177
  {
@@ -146,7 +188,9 @@ const Form = ({ settings, handleSubmit }) => {
146
188
  const initialValues = {
147
189
  googleGenAI: "",
148
190
  linkedInAccessToken: "",
149
- linkedInOrganizationId: ""
191
+ linkedInOrganizationId: "",
192
+ facebookClientToken: "",
193
+ facebookPageId: ""
150
194
  };
151
195
  const SettingsContainer = () => {
152
196
  const [settings, setSettingsConfig] = react.useState(initialValues);
@@ -1,4 +1,4 @@
1
- import { P as PLUGIN_ID } from "./index-B6aEv34B.mjs";
1
+ import { P as PLUGIN_ID } from "./index-B2RuvYul.mjs";
2
2
  const getTranslation = (id) => `${PLUGIN_ID}.${id}`;
3
3
  export {
4
4
  getTranslation as g
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
- const index = require("./index-JZA3FSFH.js");
2
+ const index = require("./index-BVGbP3E-.js");
3
3
  const getTranslation = (id) => `${index.PLUGIN_ID}.${id}`;
4
4
  exports.getTranslation = getTranslation;
@@ -76,7 +76,7 @@ const index = {
76
76
  defaultMessage: PLUGIN_ID
77
77
  },
78
78
  Component: async () => {
79
- const { App } = await import("./App-KtJGFVFQ.mjs");
79
+ const { App } = await import("./App-Cbkccs2K.mjs");
80
80
  return App;
81
81
  },
82
82
  permissions: [
@@ -97,7 +97,7 @@ const index = {
97
97
  defaultMessage: PLUGIN_ID
98
98
  },
99
99
  Component: async () => {
100
- const component = await import("./Settings-CFag78zw.mjs");
100
+ const component = await import("./Settings-B60QGKK4.mjs");
101
101
  return component.default;
102
102
  },
103
103
  to: `plugins/${PLUGIN_ID}/settings`,
@@ -77,7 +77,7 @@ const index = {
77
77
  defaultMessage: PLUGIN_ID
78
78
  },
79
79
  Component: async () => {
80
- const { App } = await Promise.resolve().then(() => require("./App-Bt1yydY9.js"));
80
+ const { App } = await Promise.resolve().then(() => require("./App-DCuBRwX8.js"));
81
81
  return App;
82
82
  },
83
83
  permissions: [
@@ -98,7 +98,7 @@ const index = {
98
98
  defaultMessage: PLUGIN_ID
99
99
  },
100
100
  Component: async () => {
101
- const component = await Promise.resolve().then(() => require("./Settings-BbIpY74m.js"));
101
+ const component = await Promise.resolve().then(() => require("./Settings-DuGbtyWC.js"));
102
102
  return component.default;
103
103
  },
104
104
  to: `plugins/${PLUGIN_ID}/settings`,
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
- const index = require("../_chunks/index-JZA3FSFH.js");
2
+ const index = require("../_chunks/index-BVGbP3E-.js");
3
3
  module.exports = index.index;
@@ -1,4 +1,4 @@
1
- import { i } from "../_chunks/index-B6aEv34B.mjs";
1
+ import { i } from "../_chunks/index-B2RuvYul.mjs";
2
2
  export {
3
3
  i as default
4
4
  };
@@ -0,0 +1,2 @@
1
+ declare const Navigation: () => import("react/jsx-runtime").JSX.Element | null;
2
+ export { Navigation };
@@ -4,7 +4,7 @@ export interface FormValues {
4
4
  titulo: string;
5
5
  autor: string;
6
6
  categoria: string;
7
- keywords: string;
7
+ temperatura?: string;
8
8
  instrucciones: string;
9
9
  }
10
10
  declare const Form: ({ onSubmit, categorias, users }: {
@@ -0,0 +1,5 @@
1
+ import type { Data } from '@strapi/strapi';
2
+ declare const Image: ({ image }: {
3
+ image: Data.ContentType<"plugin::upload.file">;
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ export { Image };
@@ -0,0 +1,2 @@
1
+ declare const Images: () => import("react/jsx-runtime").JSX.Element;
2
+ export { Images };
@@ -0,0 +1,9 @@
1
+ import type { Dispatch, SetStateAction } from "react";
2
+ import type { Data } from "@strapi/strapi";
3
+ declare const ModalImagesSizes: ({ open, setOpen, image, handleDownload }: {
4
+ open: boolean;
5
+ setOpen: Dispatch<SetStateAction<boolean>>;
6
+ image: Data.ContentType<"plugin::upload.file">;
7
+ handleDownload: (selectedKeys: Set<string>) => Promise<void>;
8
+ }) => import("react/jsx-runtime").JSX.Element | null;
9
+ export { ModalImagesSizes };
@@ -5,8 +5,9 @@ interface PublishingTableProps {
5
5
  posts: Article[];
6
6
  loadingImage: boolean;
7
7
  loadingPublishLinkedIn: boolean;
8
+ loadingPublishingToFacebook: boolean;
8
9
  currentPost: MutableRefObject<string>;
9
10
  onClickAction: (postId: string, modalId: string) => void;
10
11
  }
11
- export declare const PublishingTable: import("react").MemoExoticComponent<({ posts, currentPost, loadingImage, loadingPublishLinkedIn, onClickAction, }: PublishingTableProps) => import("react/jsx-runtime").JSX.Element>;
12
+ export declare const PublishingTable: import("react").MemoExoticComponent<({ posts, currentPost, loadingImage, loadingPublishLinkedIn, loadingPublishingToFacebook, onClickAction, }: PublishingTableProps) => import("react/jsx-runtime").JSX.Element>;
12
13
  export {};
@@ -0,0 +1,2 @@
1
+ declare const GenerateImagesContainer: () => import("react/jsx-runtime").JSX.Element;
2
+ export { GenerateImagesContainer };
@@ -2,6 +2,8 @@ export type FormValues = {
2
2
  googleGenAI: string;
3
3
  linkedInAccessToken: string;
4
4
  linkedInOrganizationId: string;
5
+ facebookClientToken: string;
6
+ facebookPageId: string;
5
7
  };
6
8
  declare const SettingsContainer: () => import("react/jsx-runtime").JSX.Element;
7
9
  export { SettingsContainer };
@@ -0,0 +1,11 @@
1
+ import { ReactNode } from 'react';
2
+ import type { Data } from '@strapi/strapi';
3
+ interface ImagesContextType {
4
+ images: Data.ContentType<"plugin::upload.file">[];
5
+ onClickAction: (image: Data.ContentType<"plugin::upload.file">, action: "delete" | "download") => void;
6
+ }
7
+ export declare const ImagesProvider: ({ children }: {
8
+ children: ReactNode;
9
+ }) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const useImages: () => ImagesContextType;
11
+ export {};
@@ -0,0 +1,5 @@
1
+ import { FetchOptions } from '@strapi/strapi/admin';
2
+ declare const usePublishFacebook: () => {
3
+ publishToFacebook: (data: any, config?: FetchOptions) => Promise<import("@strapi/strapi/admin").FetchResponse<(<TData = any, TSend = any>(url: string, data?: TSend | undefined, config?: FetchOptions | undefined) => Promise<import("@strapi/strapi/admin").FetchResponse<TData>>)>>;
4
+ };
5
+ export { usePublishFacebook };
@@ -0,0 +1,6 @@
1
+ import { FetchOptions } from '@strapi/strapi/admin';
2
+ declare const useImages: () => {
3
+ getImages: () => Promise<import("@strapi/strapi/admin").FetchResponse<(<TData = any>(url: string, config?: FetchOptions | undefined) => Promise<import("@strapi/strapi/admin").FetchResponse<TData>>)>>;
4
+ deleteImage: (config: FetchOptions) => Promise<import("@strapi/strapi/admin").FetchResponse<(<TData_1 = any>(url: string, config?: FetchOptions | undefined) => Promise<import("@strapi/strapi/admin").FetchResponse<TData_1>>)>>;
5
+ };
6
+ export { useImages };
@@ -0,0 +1,2 @@
1
+ declare const GenerateImages: () => import("react/jsx-runtime").JSX.Element;
2
+ export { GenerateImages };