strapi-plugin-hubspot 0.8.0 → 0.9.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 (36) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +28 -0
  3. package/dist/_chunks/{Forms-77Mornxt.mjs → Forms-BsKys-Hc.mjs} +295 -29
  4. package/dist/_chunks/{Forms-B8kkPY0c.js → Forms-JuzNfsbL.js} +292 -26
  5. package/dist/_chunks/{HubspotFormInput-BVknnlmR.mjs → HubspotFormInput-CIvHS5rp.mjs} +1 -1
  6. package/dist/_chunks/{HubspotFormInput-kx3LlQYF.js → HubspotFormInput-ph9pe6xY.js} +1 -1
  7. package/dist/_chunks/{HubspotObjectInput-B-Y1PZ6c.mjs → HubspotObjectInput-BX1qYD2c.mjs} +3 -3
  8. package/dist/_chunks/{HubspotObjectInput-BOO1PvOj.js → HubspotObjectInput-dAd-lMdD.js} +3 -3
  9. package/dist/_chunks/{HubspotPropertyInput-awfD1opH.js → HubspotPropertyInput-BM3ZaY8f.js} +3 -3
  10. package/dist/_chunks/{HubspotPropertyInput-Drxn_Ddt.mjs → HubspotPropertyInput-C2Z6472q.mjs} +3 -3
  11. package/dist/_chunks/{Settings-BT1NhvxO.js → Settings-Cdcjy9DA.js} +2 -2
  12. package/dist/_chunks/{Settings-DrujhMxS.mjs → Settings-DnwGetcc.mjs} +2 -2
  13. package/dist/_chunks/{en-BYKKi1LK.mjs → en-CcQWnXra.mjs} +41 -1
  14. package/dist/_chunks/{en-B8adhJhO.js → en-Cqfair98.js} +41 -1
  15. package/dist/_chunks/{fr-DzgArgi3.mjs → fr-CBRZ9q8U.mjs} +41 -1
  16. package/dist/_chunks/{fr-DnKtGXaB.js → fr-D117-3Ta.js} +41 -1
  17. package/dist/_chunks/{index-P7p8ASb6.js → index-BbRtXnAL.js} +6 -6
  18. package/dist/_chunks/{index-LrCSAHoH.mjs → index-LTaVoyWJ.mjs} +6 -6
  19. package/dist/_chunks/{objectLabels-yNrnTOBo.mjs → objectLabels-DE2xGq7f.mjs} +1 -1
  20. package/dist/_chunks/{objectLabels-Dn-zriuZ.js → objectLabels-DU0Cagt_.js} +1 -1
  21. package/dist/_chunks/{useHubspotSchema-DccG2KbZ.mjs → useHubspotSchema-BSKow0X3.mjs} +1 -1
  22. package/dist/_chunks/{useHubspotSchema-BottzdRR.js → useHubspotSchema-DzBMAxv7.js} +1 -1
  23. package/dist/admin/index.js +1 -1
  24. package/dist/admin/index.mjs +1 -1
  25. package/dist/admin/src/builder/types.d.ts +25 -0
  26. package/dist/admin/src/pages/Forms.d.ts +5 -1
  27. package/dist/admin/src/pages/Submissions.d.ts +8 -0
  28. package/dist/server/index.js +329 -13
  29. package/dist/server/index.mjs +329 -13
  30. package/dist/server/src/__tests__/importHubspot.test.d.ts +1 -0
  31. package/dist/server/src/__tests__/submissions.test.d.ts +1 -0
  32. package/dist/server/src/formsAdmin.d.ts +13 -0
  33. package/dist/server/src/importHubspot.d.ts +85 -0
  34. package/dist/server/src/index.d.ts +28 -1
  35. package/dist/server/src/submissions.d.ts +28 -0
  36. package/package.json +2 -2
@@ -204,7 +204,47 @@ const fr = {
204
204
  "panel.persist": "Mémoire de la réponse",
205
205
  "panel.persist-session": "Cette visite seulement",
206
206
  "panel.persist-days30": "30 jours (champs non identifiants uniquement)",
207
- "panel.class": "Classes CSS"
207
+ "panel.class": "Classes CSS",
208
+ "forms.col-submissions": "Soumissions",
209
+ "forms.submissions": "Soumissions",
210
+ "forms.import-hubspot-title": "Importer depuis votre portail HubSpot",
211
+ "forms.import-hubspot-hint": "Traduit un formulaire construit dans HubSpot en brouillon ici, mapping CRM inclus. Ce que le builder ne sait pas exprimer est écarté et signalé. Ré-importer écrase le brouillon.",
212
+ "forms.import-hubspot-source": "Formulaire HubSpot à importer",
213
+ "forms.hubspot-list-error": "Impossible de lister les formulaires du portail — le jeton a besoin du scope de lecture `forms`.",
214
+ "forms.report-title": "Importé avec des manques",
215
+ "forms.report-dismiss": "Fermer",
216
+ "forms.report-open": "Ouvrir le formulaire",
217
+ "forms.skipped-field-type": "« {label} » écarté — type non supporté ({detail})",
218
+ "forms.skipped-hidden": "« {label} » écarté — les champs cachés ne sont pas encore supportés",
219
+ "forms.skipped-object": "« {label} » écarté — objet non mappé ({detail})",
220
+ "forms.skipped-duplicate": "« {label} » écarté — le nom « {detail} » est déjà utilisé",
221
+ "forms.skipped-condition": "Condition de « {label} » abandonnée — opérateur sans équivalent ({detail})",
222
+ "forms.skipped-rich-text": "Un bloc de contenu a été écarté — le builder n'a pas d'élément texte riche",
223
+ "forms.skipped-consent": "Le bloc de consentement RGPD a été écarté — recréez-le en champ si besoin",
224
+ "submissions.title": "Soumissions",
225
+ "submissions.subtitle": "Toutes les réponses reçues par les formulaires construits — conservées quoi qu'il arrive côté CRM.",
226
+ "submissions.back": "Retour aux formulaires",
227
+ "submissions.filter": "Filtrer par formulaire",
228
+ "submissions.all-forms": "Tous les formulaires",
229
+ "submissions.export": "Exporter en CSV",
230
+ "submissions.export-pick": "Choisissez un formulaire à exporter",
231
+ "submissions.export-error": "Impossible d'exporter les soumissions.",
232
+ "submissions.load-error": "Impossible de charger les soumissions.",
233
+ "submissions.loading": "Chargement…",
234
+ "submissions.empty": "Aucune soumission pour le moment.",
235
+ "submissions.empty-form": "Aucune soumission pour ce formulaire pour le moment.",
236
+ "submissions.col-date": "Date",
237
+ "submissions.col-form": "Formulaire",
238
+ "submissions.col-email": "Email",
239
+ "submissions.col-answers": "Réponses",
240
+ "submissions.col-crm": "CRM",
241
+ "submissions.synced": "Synchronisée",
242
+ "submissions.not-synced": "Non synchronisée",
243
+ "submissions.count": "{total, plural, one {# soumission} other {# soumissions}}",
244
+ "submissions.prev": "Précédent",
245
+ "submissions.next": "Suivant",
246
+ "submissions.page": "{page} / {pages}",
247
+ "submissions.meta-page": "Envoyée depuis"
208
248
  };
209
249
  export {
210
250
  fr as default
@@ -206,6 +206,46 @@ const fr = {
206
206
  "panel.persist": "Mémoire de la réponse",
207
207
  "panel.persist-session": "Cette visite seulement",
208
208
  "panel.persist-days30": "30 jours (champs non identifiants uniquement)",
209
- "panel.class": "Classes CSS"
209
+ "panel.class": "Classes CSS",
210
+ "forms.col-submissions": "Soumissions",
211
+ "forms.submissions": "Soumissions",
212
+ "forms.import-hubspot-title": "Importer depuis votre portail HubSpot",
213
+ "forms.import-hubspot-hint": "Traduit un formulaire construit dans HubSpot en brouillon ici, mapping CRM inclus. Ce que le builder ne sait pas exprimer est écarté et signalé. Ré-importer écrase le brouillon.",
214
+ "forms.import-hubspot-source": "Formulaire HubSpot à importer",
215
+ "forms.hubspot-list-error": "Impossible de lister les formulaires du portail — le jeton a besoin du scope de lecture `forms`.",
216
+ "forms.report-title": "Importé avec des manques",
217
+ "forms.report-dismiss": "Fermer",
218
+ "forms.report-open": "Ouvrir le formulaire",
219
+ "forms.skipped-field-type": "« {label} » écarté — type non supporté ({detail})",
220
+ "forms.skipped-hidden": "« {label} » écarté — les champs cachés ne sont pas encore supportés",
221
+ "forms.skipped-object": "« {label} » écarté — objet non mappé ({detail})",
222
+ "forms.skipped-duplicate": "« {label} » écarté — le nom « {detail} » est déjà utilisé",
223
+ "forms.skipped-condition": "Condition de « {label} » abandonnée — opérateur sans équivalent ({detail})",
224
+ "forms.skipped-rich-text": "Un bloc de contenu a été écarté — le builder n'a pas d'élément texte riche",
225
+ "forms.skipped-consent": "Le bloc de consentement RGPD a été écarté — recréez-le en champ si besoin",
226
+ "submissions.title": "Soumissions",
227
+ "submissions.subtitle": "Toutes les réponses reçues par les formulaires construits — conservées quoi qu'il arrive côté CRM.",
228
+ "submissions.back": "Retour aux formulaires",
229
+ "submissions.filter": "Filtrer par formulaire",
230
+ "submissions.all-forms": "Tous les formulaires",
231
+ "submissions.export": "Exporter en CSV",
232
+ "submissions.export-pick": "Choisissez un formulaire à exporter",
233
+ "submissions.export-error": "Impossible d'exporter les soumissions.",
234
+ "submissions.load-error": "Impossible de charger les soumissions.",
235
+ "submissions.loading": "Chargement…",
236
+ "submissions.empty": "Aucune soumission pour le moment.",
237
+ "submissions.empty-form": "Aucune soumission pour ce formulaire pour le moment.",
238
+ "submissions.col-date": "Date",
239
+ "submissions.col-form": "Formulaire",
240
+ "submissions.col-email": "Email",
241
+ "submissions.col-answers": "Réponses",
242
+ "submissions.col-crm": "CRM",
243
+ "submissions.synced": "Synchronisée",
244
+ "submissions.not-synced": "Non synchronisée",
245
+ "submissions.count": "{total, plural, one {# soumission} other {# soumissions}}",
246
+ "submissions.prev": "Précédent",
247
+ "submissions.next": "Suivant",
248
+ "submissions.page": "{page} / {pages}",
249
+ "submissions.meta-page": "Envoyée depuis"
210
250
  };
211
251
  exports.default = fr;
@@ -26,7 +26,7 @@ const index = {
26
26
  icon: icons.PaperPlane,
27
27
  intlLabel: { id: `${PLUGIN_ID}.menu.label`, defaultMessage: "HubSpot Forms" },
28
28
  permissions: [{ action: `plugin::${PLUGIN_ID}.forms`, subject: null }],
29
- Component: async () => (await Promise.resolve().then(() => require("./Forms-B8kkPY0c.js"))).default
29
+ Component: async () => (await Promise.resolve().then(() => require("./Forms-JuzNfsbL.js"))).default
30
30
  });
31
31
  app.customFields.register({
32
32
  name: "property",
@@ -41,7 +41,7 @@ const index = {
41
41
  defaultMessage: "Picked from the portal's real properties"
42
42
  },
43
43
  components: {
44
- Input: async () => Promise.resolve().then(() => require("./HubspotPropertyInput-awfD1opH.js"))
44
+ Input: async () => Promise.resolve().then(() => require("./HubspotPropertyInput-BM3ZaY8f.js"))
45
45
  },
46
46
  // Exposed in the Content-Type Builder. Without this, `objectField` could
47
47
  // only be set by hand-editing schema.json — which is not how anyone
@@ -104,7 +104,7 @@ const index = {
104
104
  defaultMessage: "Picked from the portal's configured objects"
105
105
  },
106
106
  components: {
107
- Input: async () => Promise.resolve().then(() => require("./HubspotObjectInput-BOO1PvOj.js"))
107
+ Input: async () => Promise.resolve().then(() => require("./HubspotObjectInput-dAd-lMdD.js"))
108
108
  }
109
109
  });
110
110
  app.customFields.register({
@@ -120,7 +120,7 @@ const index = {
120
120
  defaultMessage: "A form built in the HubSpot form builder, stored by slug"
121
121
  },
122
122
  components: {
123
- Input: async () => Promise.resolve().then(() => require("./HubspotFormInput-kx3LlQYF.js"))
123
+ Input: async () => Promise.resolve().then(() => require("./HubspotFormInput-ph9pe6xY.js"))
124
124
  }
125
125
  });
126
126
  app.createSettingSection(
@@ -136,7 +136,7 @@ const index = {
136
136
  // Mirrors the RBAC action registered server-side: a role without it
137
137
  // doesn't see the link at all — the routes refuse it anyway.
138
138
  permissions: [{ action: `plugin::${PLUGIN_ID}.settings`, subject: null }],
139
- Component: async () => (await Promise.resolve().then(() => require("./Settings-BT1NhvxO.js"))).default
139
+ Component: async () => (await Promise.resolve().then(() => require("./Settings-Cdcjy9DA.js"))).default
140
140
  }
141
141
  ]
142
142
  );
@@ -146,7 +146,7 @@ const index = {
146
146
  return Promise.all(
147
147
  locales.map(async (locale) => {
148
148
  try {
149
- const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => Promise.resolve().then(() => require("./en-B8adhJhO.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-DnKtGXaB.js")) }), `./translations/${locale}.json`, 3);
149
+ const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => Promise.resolve().then(() => require("./en-Cqfair98.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-D117-3Ta.js")) }), `./translations/${locale}.json`, 3);
150
150
  return { data: prefixPluginTranslations(data), locale };
151
151
  } catch {
152
152
  return { data: {}, locale };
@@ -25,7 +25,7 @@ const index = {
25
25
  icon: PaperPlane,
26
26
  intlLabel: { id: `${PLUGIN_ID}.menu.label`, defaultMessage: "HubSpot Forms" },
27
27
  permissions: [{ action: `plugin::${PLUGIN_ID}.forms`, subject: null }],
28
- Component: async () => (await import("./Forms-77Mornxt.mjs")).default
28
+ Component: async () => (await import("./Forms-BsKys-Hc.mjs")).default
29
29
  });
30
30
  app.customFields.register({
31
31
  name: "property",
@@ -40,7 +40,7 @@ const index = {
40
40
  defaultMessage: "Picked from the portal's real properties"
41
41
  },
42
42
  components: {
43
- Input: async () => import("./HubspotPropertyInput-Drxn_Ddt.mjs")
43
+ Input: async () => import("./HubspotPropertyInput-C2Z6472q.mjs")
44
44
  },
45
45
  // Exposed in the Content-Type Builder. Without this, `objectField` could
46
46
  // only be set by hand-editing schema.json — which is not how anyone
@@ -103,7 +103,7 @@ const index = {
103
103
  defaultMessage: "Picked from the portal's configured objects"
104
104
  },
105
105
  components: {
106
- Input: async () => import("./HubspotObjectInput-B-Y1PZ6c.mjs")
106
+ Input: async () => import("./HubspotObjectInput-BX1qYD2c.mjs")
107
107
  }
108
108
  });
109
109
  app.customFields.register({
@@ -119,7 +119,7 @@ const index = {
119
119
  defaultMessage: "A form built in the HubSpot form builder, stored by slug"
120
120
  },
121
121
  components: {
122
- Input: async () => import("./HubspotFormInput-BVknnlmR.mjs")
122
+ Input: async () => import("./HubspotFormInput-CIvHS5rp.mjs")
123
123
  }
124
124
  });
125
125
  app.createSettingSection(
@@ -135,7 +135,7 @@ const index = {
135
135
  // Mirrors the RBAC action registered server-side: a role without it
136
136
  // doesn't see the link at all — the routes refuse it anyway.
137
137
  permissions: [{ action: `plugin::${PLUGIN_ID}.settings`, subject: null }],
138
- Component: async () => (await import("./Settings-DrujhMxS.mjs")).default
138
+ Component: async () => (await import("./Settings-DnwGetcc.mjs")).default
139
139
  }
140
140
  ]
141
141
  );
@@ -145,7 +145,7 @@ const index = {
145
145
  return Promise.all(
146
146
  locales.map(async (locale) => {
147
147
  try {
148
- const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => import("./en-BYKKi1LK.mjs"), "./translations/fr.json": () => import("./fr-DzgArgi3.mjs") }), `./translations/${locale}.json`, 3);
148
+ const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => import("./en-CcQWnXra.mjs"), "./translations/fr.json": () => import("./fr-CBRZ9q8U.mjs") }), `./translations/${locale}.json`, 3);
149
149
  return { data: prefixPluginTranslations(data), locale };
150
150
  } catch {
151
151
  return { data: {}, locale };
@@ -1,4 +1,4 @@
1
- import { g as getTranslation } from "./index-LrCSAHoH.mjs";
1
+ import { g as getTranslation } from "./index-LTaVoyWJ.mjs";
2
2
  const STANDARD = /* @__PURE__ */ new Set([
3
3
  "contact",
4
4
  "company",
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const index = require("./index-P7p8ASb6.js");
2
+ const index = require("./index-BbRtXnAL.js");
3
3
  const STANDARD = /* @__PURE__ */ new Set([
4
4
  "contact",
5
5
  "company",
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { useFetchClient } from "@strapi/strapi/admin";
3
- import { P as PLUGIN_ID } from "./index-LrCSAHoH.mjs";
3
+ import { P as PLUGIN_ID } from "./index-LTaVoyWJ.mjs";
4
4
  let cached = null;
5
5
  let inFlight = null;
6
6
  const listeners = /* @__PURE__ */ new Set();
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const React = require("react");
3
3
  const admin = require("@strapi/strapi/admin");
4
- const index = require("./index-P7p8ASb6.js");
4
+ const index = require("./index-BbRtXnAL.js");
5
5
  function _interopNamespace(e) {
6
6
  if (e && e.__esModule) return e;
7
7
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
- const index = require("../_chunks/index-P7p8ASb6.js");
2
+ const index = require("../_chunks/index-BbRtXnAL.js");
3
3
  require("@strapi/icons");
4
4
  module.exports = index.index;
@@ -1,4 +1,4 @@
1
- import { i } from "../_chunks/index-LrCSAHoH.mjs";
1
+ import { i } from "../_chunks/index-LTaVoyWJ.mjs";
2
2
  import "@strapi/icons";
3
3
  export {
4
4
  i as default
@@ -68,6 +68,31 @@ export interface FormListRow {
68
68
  published: boolean;
69
69
  steps: number;
70
70
  fields: number;
71
+ submissions: number;
72
+ }
73
+ /** One form of the connected portal, offered for import. */
74
+ export interface HubspotSource {
75
+ id: string;
76
+ name: string;
77
+ updatedAt?: string;
78
+ }
79
+ /** What a HubSpot import couldn't carry over (mirrors server SkippedItem). */
80
+ export interface SkippedItem {
81
+ code: "field-type" | "hidden-field" | "object" | "duplicate" | "condition" | "rich-text" | "legal-consent";
82
+ label?: string;
83
+ detail?: string;
84
+ }
85
+ /** One stored submission, as the admin list serves it. */
86
+ export interface SubmissionRowDto {
87
+ documentId: string;
88
+ form: string;
89
+ formTitle?: string | null;
90
+ email?: string | null;
91
+ values: Record<string, string | number | boolean>;
92
+ meta?: Record<string, string> | null;
93
+ locale?: string | null;
94
+ hubspotSynced?: boolean;
95
+ createdAt?: string;
71
96
  }
72
97
  export interface DefinitionError {
73
98
  code: "duplicate-name" | "missing-name" | "unknown-field" | "forward-reference" | "missing-value";
@@ -1,4 +1,8 @@
1
1
  /// <reference types="react" />
2
- /** The Forms menu entry: the list at the root, the builder at /:documentId. */
2
+ /**
3
+ * The Forms menu entry: the list at the root, the submissions browser at
4
+ * /submissions (static, so it wins over the param route), the builder at
5
+ * /:documentId.
6
+ */
3
7
  declare const Forms: () => import("react").JSX.Element;
4
8
  export default Forms;
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ /**
3
+ * The submissions browser: every stored answer, filterable by form, with a
4
+ * per-form CSV export. Reading happens here; deleting stays in the Content
5
+ * Manager, where the type is visible on purpose.
6
+ */
7
+ declare const Submissions: () => React.JSX.Element;
8
+ export default Submissions;