strapi-plugin-hubspot 0.13.1 → 0.15.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 +33 -0
  2. package/README.md +58 -32
  3. package/dist/_chunks/{Forms-CHB-sKem.mjs → Forms-B7eIm0Fi.mjs} +38 -3
  4. package/dist/_chunks/{Forms-lrzuWzoB.js → Forms-ClyI4MJ1.js} +38 -3
  5. package/dist/_chunks/{HubspotFormInput-Bb6it0nP.js → HubspotFormInput-Do7F83V6.js} +1 -1
  6. package/dist/_chunks/{HubspotFormInput-YI09keTC.mjs → HubspotFormInput-cZAiaAaq.mjs} +1 -1
  7. package/dist/_chunks/{HubspotObjectInput-D3A6xzb3.js → HubspotObjectInput-DWqk2C26.js} +3 -3
  8. package/dist/_chunks/{HubspotObjectInput-CzLKT9oj.mjs → HubspotObjectInput-ZZk_7hWq.mjs} +3 -3
  9. package/dist/_chunks/{HubspotPropertyInput-DicskLcN.mjs → HubspotPropertyInput-5bkDGmGo.mjs} +3 -3
  10. package/dist/_chunks/{HubspotPropertyInput-Dss3eUlL.js → HubspotPropertyInput-v9B3wb1a.js} +3 -3
  11. package/dist/_chunks/{Settings-4CbX3SPK.mjs → Settings-QcFbm3s5.mjs} +132 -36
  12. package/dist/_chunks/{Settings-Ch8tPZAV.js → Settings-X3EHnTaO.js} +131 -35
  13. package/dist/_chunks/{en-D8DJiSxd.mjs → en-DMJeF7EN.mjs} +19 -6
  14. package/dist/_chunks/{en-PYFibnDc.js → en-ZHvaZLi7.js} +19 -6
  15. package/dist/_chunks/{fr-BMjixfXn.mjs → fr-CVAntLmc.mjs} +18 -5
  16. package/dist/_chunks/{fr-yHk4sSEl.js → fr-Ds_2EAzZ.js} +18 -5
  17. package/dist/_chunks/{index-BE2ribUL.mjs → index-BSJAhj8r.mjs} +6 -6
  18. package/dist/_chunks/{index-BAvedd2m.js → index-BpcilDy1.js} +6 -6
  19. package/dist/_chunks/{objectLabels-CycoU0zY.js → objectLabels-CYXXFpNB.js} +1 -1
  20. package/dist/_chunks/{objectLabels-DGJxYjKz.mjs → objectLabels-CrYRzsqe.mjs} +1 -1
  21. package/dist/_chunks/{useHubspotSchema-DRfaI6mF.js → useHubspotSchema-Ba6xZUCL.js} +1 -1
  22. package/dist/_chunks/{useHubspotSchema-e31UsYb2.mjs → useHubspotSchema-CBF4GkmK.mjs} +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 +2 -0
  26. package/dist/server/index.js +502 -197
  27. package/dist/server/index.mjs +502 -197
  28. package/dist/server/src/__tests__/hsforms.test.d.ts +1 -0
  29. package/dist/server/src/__tests__/settings.test.d.ts +1 -0
  30. package/dist/server/src/content-types.d.ts +8 -0
  31. package/dist/server/src/forms.d.ts +10 -6
  32. package/dist/server/src/hsforms.d.ts +75 -0
  33. package/dist/server/src/importHubspot.d.ts +1 -0
  34. package/dist/server/src/index.d.ts +17 -2
  35. package/dist/server/src/settings.d.ts +36 -5
  36. package/package.json +1 -1
@@ -28,7 +28,7 @@ const fr = {
28
28
  "picker.refresh": "Rafraîchir les propriétés depuis HubSpot",
29
29
  "picker.import": "Importer les {count} options depuis HubSpot",
30
30
  "picker.imported": "Options importées — enregistrez pour les conserver.",
31
- "settings.subtitle": "Le jeton d'application privée utilisé pour lire les propriétés du portail et valider les mappings de formulaires.",
31
+ "settings.subtitle": "Jeton d'application privée et compte HubSpot qui reçoit les conversions. Passez du test à la prod ici — rien n'est figé dans le code.",
32
32
  "settings.configured": "Configurée {hint}",
33
33
  "settings.not-configured": "Non configurée",
34
34
  "settings.source": "source : {source}",
@@ -36,22 +36,31 @@ const fr = {
36
36
  "settings.source.config": "config/plugins.ts",
37
37
  "settings.source.env": "variable d'environnement",
38
38
  "settings.key.label": "Jeton d'application privée",
39
- "settings.key.hint": "Saisir une clé ici remplace celles venant de config/plugins.ts et de HUBSPOT_API_KEY.",
39
+ "settings.key.hint": "Saisir une clé ici remplace config/plugins.ts et HUBSPOT_API_KEY.",
40
40
  "settings.key.placeholder.set": "•••••••• (laisser vide pour conserver)",
41
41
  "settings.key.placeholder.empty": "pat-eu1-…",
42
+ "settings.portal.label": "ID de portail",
43
+ "settings.portal.hint": "Identifiant du compte HubSpot (Paramètres → Compte). Portail de test aujourd'hui, production plus tard.",
44
+ "settings.region.label": "Région",
45
+ "settings.region.eu1": "Europe (eu1)",
46
+ "settings.region.na1": "Amérique du Nord (na1)",
47
+ "settings.form.label": "Formulaire marketing par défaut",
48
+ "settings.form.hint": "Formulaire qui reçoit les envois quand un formulaire du builder n'en choisit pas un. Créez-le dans HubSpot, puis sélectionnez-le ici.",
49
+ "settings.form.placeholder": "Choisir un formulaire du portail connecté",
50
+ "settings.form.none": "Aucun — upsert CRM uniquement",
42
51
  "settings.save": "Enregistrer",
43
52
  "settings.test": "Tester la connexion",
44
- "settings.remove": "Supprimer",
53
+ "settings.remove": "Supprimer la clé",
45
54
  "settings.loading": "Chargement…",
46
55
  "settings.load-error": "Réglages illisibles.",
47
- "settings.saved": "Clé enregistrée.",
56
+ "settings.saved": "Réglages enregistrés.",
48
57
  "settings.save-error": "Enregistrement impossible.",
49
58
  "settings.removed": "Clé supprimée.",
50
59
  "settings.remove-error": "Suppression impossible.",
51
60
  "settings.test-ok": "Connexion établie — {count} propriétés lisibles.",
52
61
  "settings.test-no-key": "Aucune clé configurée.",
53
62
  "settings.test-error": "HubSpot injoignable — clé invalide ou révoquée ?",
54
- "settings.scopes": "Le jeton a besoin des portées crm.schemas.contacts.read et crm.schemas.companies.read pour lister les propriétés. Il n'est jamais renvoyé au navigateur : seuls son existence, sa provenance et ses quatre derniers caractères le sont.",
63
+ "settings.scopes": "Le jeton a besoin de crm.schemas.contacts.read, crm.schemas.companies.read et forms (lister et soumettre les formulaires marketing). Il n'est jamais renvoyé au navigateur.",
55
64
  "audit.title": "Audit des mappings",
56
65
  "audit.subtitle": "Parcourt toutes les entrées des content-types validés et liste les mappings que le portail refuserait aujourd'hui — y compris les propriétés supprimées dans HubSpot depuis leur enregistrement.",
57
66
  "audit.run": "Lancer l'audit",
@@ -139,6 +148,10 @@ const fr = {
139
148
  "editor.form-next": "Libellé Suivant",
140
149
  "editor.form-submit": "Libellé Envoyer",
141
150
  "editor.form-success": "Message de succès",
151
+ "editor.hubspot-form": "Formulaire marketing HubSpot",
152
+ "editor.hubspot-form-placeholder": "Choisir un formulaire du portail connecté",
153
+ "editor.hubspot-form-none": "Aucun — upsert CRM uniquement",
154
+ "editor.hubspot-form-hint": "Les envois passent par l’API Forms de HubSpot pour compter comme des conversions. Changez de portail (test → prod) et sélectionnez le formulaire correspondant — rien n’est figé dans le code.",
142
155
  "editor.form-hint": "Sélectionnez une étape ou un champ pour l'éditer. Le endpoint public sert ce formulaire sur /api/hubspot/forms/{slug}.",
143
156
  "panel.label": "Libellé",
144
157
  "panel.name": "Clé du payload",
@@ -30,7 +30,7 @@ const fr = {
30
30
  "picker.refresh": "Rafraîchir les propriétés depuis HubSpot",
31
31
  "picker.import": "Importer les {count} options depuis HubSpot",
32
32
  "picker.imported": "Options importées — enregistrez pour les conserver.",
33
- "settings.subtitle": "Le jeton d'application privée utilisé pour lire les propriétés du portail et valider les mappings de formulaires.",
33
+ "settings.subtitle": "Jeton d'application privée et compte HubSpot qui reçoit les conversions. Passez du test à la prod ici — rien n'est figé dans le code.",
34
34
  "settings.configured": "Configurée {hint}",
35
35
  "settings.not-configured": "Non configurée",
36
36
  "settings.source": "source : {source}",
@@ -38,22 +38,31 @@ const fr = {
38
38
  "settings.source.config": "config/plugins.ts",
39
39
  "settings.source.env": "variable d'environnement",
40
40
  "settings.key.label": "Jeton d'application privée",
41
- "settings.key.hint": "Saisir une clé ici remplace celles venant de config/plugins.ts et de HUBSPOT_API_KEY.",
41
+ "settings.key.hint": "Saisir une clé ici remplace config/plugins.ts et HUBSPOT_API_KEY.",
42
42
  "settings.key.placeholder.set": "•••••••• (laisser vide pour conserver)",
43
43
  "settings.key.placeholder.empty": "pat-eu1-…",
44
+ "settings.portal.label": "ID de portail",
45
+ "settings.portal.hint": "Identifiant du compte HubSpot (Paramètres → Compte). Portail de test aujourd'hui, production plus tard.",
46
+ "settings.region.label": "Région",
47
+ "settings.region.eu1": "Europe (eu1)",
48
+ "settings.region.na1": "Amérique du Nord (na1)",
49
+ "settings.form.label": "Formulaire marketing par défaut",
50
+ "settings.form.hint": "Formulaire qui reçoit les envois quand un formulaire du builder n'en choisit pas un. Créez-le dans HubSpot, puis sélectionnez-le ici.",
51
+ "settings.form.placeholder": "Choisir un formulaire du portail connecté",
52
+ "settings.form.none": "Aucun — upsert CRM uniquement",
44
53
  "settings.save": "Enregistrer",
45
54
  "settings.test": "Tester la connexion",
46
- "settings.remove": "Supprimer",
55
+ "settings.remove": "Supprimer la clé",
47
56
  "settings.loading": "Chargement…",
48
57
  "settings.load-error": "Réglages illisibles.",
49
- "settings.saved": "Clé enregistrée.",
58
+ "settings.saved": "Réglages enregistrés.",
50
59
  "settings.save-error": "Enregistrement impossible.",
51
60
  "settings.removed": "Clé supprimée.",
52
61
  "settings.remove-error": "Suppression impossible.",
53
62
  "settings.test-ok": "Connexion établie — {count} propriétés lisibles.",
54
63
  "settings.test-no-key": "Aucune clé configurée.",
55
64
  "settings.test-error": "HubSpot injoignable — clé invalide ou révoquée ?",
56
- "settings.scopes": "Le jeton a besoin des portées crm.schemas.contacts.read et crm.schemas.companies.read pour lister les propriétés. Il n'est jamais renvoyé au navigateur : seuls son existence, sa provenance et ses quatre derniers caractères le sont.",
65
+ "settings.scopes": "Le jeton a besoin de crm.schemas.contacts.read, crm.schemas.companies.read et forms (lister et soumettre les formulaires marketing). Il n'est jamais renvoyé au navigateur.",
57
66
  "audit.title": "Audit des mappings",
58
67
  "audit.subtitle": "Parcourt toutes les entrées des content-types validés et liste les mappings que le portail refuserait aujourd'hui — y compris les propriétés supprimées dans HubSpot depuis leur enregistrement.",
59
68
  "audit.run": "Lancer l'audit",
@@ -141,6 +150,10 @@ const fr = {
141
150
  "editor.form-next": "Libellé Suivant",
142
151
  "editor.form-submit": "Libellé Envoyer",
143
152
  "editor.form-success": "Message de succès",
153
+ "editor.hubspot-form": "Formulaire marketing HubSpot",
154
+ "editor.hubspot-form-placeholder": "Choisir un formulaire du portail connecté",
155
+ "editor.hubspot-form-none": "Aucun — upsert CRM uniquement",
156
+ "editor.hubspot-form-hint": "Les envois passent par l’API Forms de HubSpot pour compter comme des conversions. Changez de portail (test → prod) et sélectionnez le formulaire correspondant — rien n’est figé dans le code.",
144
157
  "editor.form-hint": "Sélectionnez une étape ou un champ pour l'éditer. Le endpoint public sert ce formulaire sur /api/hubspot/forms/{slug}.",
145
158
  "panel.label": "Libellé",
146
159
  "panel.name": "Clé du payload",
@@ -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-CHB-sKem.mjs")).default
28
+ Component: async () => (await import("./Forms-B7eIm0Fi.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-DicskLcN.mjs")
43
+ Input: async () => import("./HubspotPropertyInput-5bkDGmGo.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-CzLKT9oj.mjs")
106
+ Input: async () => import("./HubspotObjectInput-ZZk_7hWq.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-YI09keTC.mjs")
122
+ Input: async () => import("./HubspotFormInput-cZAiaAaq.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-4CbX3SPK.mjs")).default
138
+ Component: async () => (await import("./Settings-QcFbm3s5.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-D8DJiSxd.mjs"), "./translations/fr.json": () => import("./fr-BMjixfXn.mjs") }), `./translations/${locale}.json`, 3);
148
+ const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => import("./en-DMJeF7EN.mjs"), "./translations/fr.json": () => import("./fr-CVAntLmc.mjs") }), `./translations/${locale}.json`, 3);
149
149
  return { data: prefixPluginTranslations(data), locale };
150
150
  } catch {
151
151
  return { data: {}, locale };
@@ -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-lrzuWzoB.js"))).default
29
+ Component: async () => (await Promise.resolve().then(() => require("./Forms-ClyI4MJ1.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-Dss3eUlL.js"))
44
+ Input: async () => Promise.resolve().then(() => require("./HubspotPropertyInput-v9B3wb1a.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-D3A6xzb3.js"))
107
+ Input: async () => Promise.resolve().then(() => require("./HubspotObjectInput-DWqk2C26.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-Bb6it0nP.js"))
123
+ Input: async () => Promise.resolve().then(() => require("./HubspotFormInput-Do7F83V6.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-Ch8tPZAV.js"))).default
139
+ Component: async () => (await Promise.resolve().then(() => require("./Settings-X3EHnTaO.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-PYFibnDc.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-yHk4sSEl.js")) }), `./translations/${locale}.json`, 3);
149
+ const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => Promise.resolve().then(() => require("./en-ZHvaZLi7.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-Ds_2EAzZ.js")) }), `./translations/${locale}.json`, 3);
150
150
  return { data: prefixPluginTranslations(data), locale };
151
151
  } catch {
152
152
  return { data: {}, locale };
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const index = require("./index-BAvedd2m.js");
2
+ const index = require("./index-BpcilDy1.js");
3
3
  const STANDARD = /* @__PURE__ */ new Set([
4
4
  "contact",
5
5
  "company",
@@ -1,4 +1,4 @@
1
- import { g as getTranslation } from "./index-BE2ribUL.mjs";
1
+ import { g as getTranslation } from "./index-BSJAhj8r.mjs";
2
2
  const STANDARD = /* @__PURE__ */ new Set([
3
3
  "contact",
4
4
  "company",
@@ -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-BAvedd2m.js");
4
+ const index = require("./index-BpcilDy1.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,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-BE2ribUL.mjs";
3
+ import { P as PLUGIN_ID } from "./index-BSJAhj8r.mjs";
4
4
  let cached = null;
5
5
  let inFlight = null;
6
6
  const listeners = /* @__PURE__ */ new Set();
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
- const index = require("../_chunks/index-BAvedd2m.js");
2
+ const index = require("../_chunks/index-BpcilDy1.js");
3
3
  require("@strapi/icons");
4
4
  module.exports = index.index;
@@ -1,4 +1,4 @@
1
- import { i } from "../_chunks/index-BE2ribUL.mjs";
1
+ import { i } from "../_chunks/index-BSJAhj8r.mjs";
2
2
  import "@strapi/icons";
3
3
  export {
4
4
  i as default
@@ -68,6 +68,8 @@ export interface FormEntryDto {
68
68
  submitLabel?: string | null;
69
69
  successMessage?: string | null;
70
70
  class?: string | null;
71
+ /** Marketing form GUID in the connected HubSpot portal. */
72
+ hubspotFormId?: string | null;
71
73
  locale?: string | null;
72
74
  updatedAt?: string;
73
75
  definition: FormDefinition;