strapi-plugin-hubspot 0.14.0 → 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.
- package/CHANGELOG.md +8 -0
- package/README.md +16 -7
- package/dist/_chunks/{Forms-ws6d8rdC.mjs → Forms-B7eIm0Fi.mjs} +3 -3
- package/dist/_chunks/{Forms-Cch-7zei.js → Forms-ClyI4MJ1.js} +3 -3
- package/dist/_chunks/{HubspotFormInput-M2l_8w_e.js → HubspotFormInput-Do7F83V6.js} +1 -1
- package/dist/_chunks/{HubspotFormInput-18pWTITT.mjs → HubspotFormInput-cZAiaAaq.mjs} +1 -1
- package/dist/_chunks/{HubspotObjectInput-BDO99qXs.js → HubspotObjectInput-DWqk2C26.js} +3 -3
- package/dist/_chunks/{HubspotObjectInput-DshusXZP.mjs → HubspotObjectInput-ZZk_7hWq.mjs} +3 -3
- package/dist/_chunks/{HubspotPropertyInput-C-kHDgwx.mjs → HubspotPropertyInput-5bkDGmGo.mjs} +3 -3
- package/dist/_chunks/{HubspotPropertyInput-XGnH2tHn.js → HubspotPropertyInput-v9B3wb1a.js} +3 -3
- package/dist/_chunks/{Settings-Bm7WkzK1.mjs → Settings-QcFbm3s5.mjs} +132 -36
- package/dist/_chunks/{Settings-CRnsu6ob.js → Settings-X3EHnTaO.js} +131 -35
- package/dist/_chunks/{en-DKV-8FWP.mjs → en-DMJeF7EN.mjs} +15 -6
- package/dist/_chunks/{en-BXMU5CjT.js → en-ZHvaZLi7.js} +15 -6
- package/dist/_chunks/{fr-GB6T3ZyU.mjs → fr-CVAntLmc.mjs} +14 -5
- package/dist/_chunks/{fr-Dx4XmZ4X.js → fr-Ds_2EAzZ.js} +14 -5
- package/dist/_chunks/{index-CPVfElYB.mjs → index-BSJAhj8r.mjs} +6 -6
- package/dist/_chunks/{index-BlaG8oIq.js → index-BpcilDy1.js} +6 -6
- package/dist/_chunks/{objectLabels-CPc21Tdd.js → objectLabels-CYXXFpNB.js} +1 -1
- package/dist/_chunks/{objectLabels-6OUnIDB5.mjs → objectLabels-CrYRzsqe.mjs} +1 -1
- package/dist/_chunks/{useHubspotSchema-0MvCM1AC.js → useHubspotSchema-Ba6xZUCL.js} +1 -1
- package/dist/_chunks/{useHubspotSchema-qCUs2gIX.mjs → useHubspotSchema-CBF4GkmK.mjs} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/server/index.js +88 -11
- package/dist/server/index.mjs +88 -11
- package/dist/server/src/__tests__/settings.test.d.ts +1 -0
- package/dist/server/src/index.d.ts +5 -1
- package/dist/server/src/settings.d.ts +36 -5
- package/package.json +1 -1
|
@@ -5,9 +5,9 @@ const React = require("react");
|
|
|
5
5
|
const index = require("./index-DkTxsEqL.js");
|
|
6
6
|
const designSystem = require("@strapi/design-system");
|
|
7
7
|
const admin = require("@strapi/strapi/admin");
|
|
8
|
-
const index$1 = require("./index-
|
|
8
|
+
const index$1 = require("./index-BpcilDy1.js");
|
|
9
9
|
const reactRouterDom = require("react-router-dom");
|
|
10
|
-
const objectLabels = require("./objectLabels-
|
|
10
|
+
const objectLabels = require("./objectLabels-CYXXFpNB.js");
|
|
11
11
|
function _interopNamespace(e) {
|
|
12
12
|
if (e && e.__esModule) return e;
|
|
13
13
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
@@ -192,19 +192,31 @@ const FailuresSection = ({ configured }) => {
|
|
|
192
192
|
) : null
|
|
193
193
|
] });
|
|
194
194
|
};
|
|
195
|
+
const REGIONS = ["eu1", "na1"];
|
|
195
196
|
const HubspotSettings = () => {
|
|
196
197
|
const { formatMessage } = index.useIntl();
|
|
197
198
|
const { get, put, del } = admin.useFetchClient();
|
|
198
199
|
const [settings, setSettings] = React__namespace.useState(null);
|
|
199
200
|
const [apiKey, setApiKey] = React__namespace.useState("");
|
|
201
|
+
const [portalId, setPortalId] = React__namespace.useState("");
|
|
202
|
+
const [region, setRegion] = React__namespace.useState("eu1");
|
|
203
|
+
const [defaultFormId, setDefaultFormId] = React__namespace.useState("");
|
|
204
|
+
const [forms, setForms] = React__namespace.useState([]);
|
|
200
205
|
const [busy, setBusy] = React__namespace.useState(false);
|
|
201
206
|
const [feedback, setFeedback] = React__namespace.useState(
|
|
202
207
|
null
|
|
203
208
|
);
|
|
204
209
|
const t = (id, defaultMessage, values) => formatMessage({ id: index$1.getTranslation(id), defaultMessage }, values);
|
|
210
|
+
const apply = (data) => {
|
|
211
|
+
setSettings(data);
|
|
212
|
+
setPortalId(data.portalId ?? "");
|
|
213
|
+
setRegion(data.region || "eu1");
|
|
214
|
+
setDefaultFormId(data.defaultFormId ?? "");
|
|
215
|
+
setForms(Array.isArray(data.forms) ? data.forms : []);
|
|
216
|
+
};
|
|
205
217
|
const load = React__namespace.useCallback(async () => {
|
|
206
218
|
const { data } = await get(`/${index$1.PLUGIN_ID}/settings`);
|
|
207
|
-
|
|
219
|
+
apply(data);
|
|
208
220
|
}, [get]);
|
|
209
221
|
React__namespace.useEffect(() => {
|
|
210
222
|
load().catch(
|
|
@@ -215,12 +227,17 @@ const HubspotSettings = () => {
|
|
|
215
227
|
setBusy(true);
|
|
216
228
|
setFeedback(null);
|
|
217
229
|
try {
|
|
218
|
-
|
|
219
|
-
|
|
230
|
+
await put(`/${index$1.PLUGIN_ID}/settings`, {
|
|
231
|
+
...apiKey.trim() ? { apiKey: apiKey.trim() } : {},
|
|
232
|
+
portalId,
|
|
233
|
+
region,
|
|
234
|
+
defaultFormId
|
|
235
|
+
});
|
|
220
236
|
setApiKey("");
|
|
221
|
-
|
|
237
|
+
await load();
|
|
238
|
+
setFeedback({ tone: "success", text: t("settings.saved", "Settings saved.") });
|
|
222
239
|
} catch {
|
|
223
|
-
setFeedback({ tone: "danger", text: t("settings.save-error", "Could not save
|
|
240
|
+
setFeedback({ tone: "danger", text: t("settings.save-error", "Could not save settings.") });
|
|
224
241
|
} finally {
|
|
225
242
|
setBusy(false);
|
|
226
243
|
}
|
|
@@ -229,9 +246,9 @@ const HubspotSettings = () => {
|
|
|
229
246
|
setBusy(true);
|
|
230
247
|
setFeedback(null);
|
|
231
248
|
try {
|
|
232
|
-
|
|
233
|
-
setSettings(data);
|
|
249
|
+
await del(`/${index$1.PLUGIN_ID}/settings`);
|
|
234
250
|
setApiKey("");
|
|
251
|
+
await load();
|
|
235
252
|
setFeedback({ tone: "success", text: t("settings.removed", "Key removed.") });
|
|
236
253
|
} catch {
|
|
237
254
|
setFeedback({ tone: "danger", text: t("settings.remove-error", "Could not remove the key.") });
|
|
@@ -254,6 +271,7 @@ const HubspotSettings = () => {
|
|
|
254
271
|
})
|
|
255
272
|
} : { tone: "danger", text: t("settings.test-no-key", "No key configured.") }
|
|
256
273
|
);
|
|
274
|
+
if (data.configured) await load();
|
|
257
275
|
} catch {
|
|
258
276
|
setFeedback({
|
|
259
277
|
tone: "danger",
|
|
@@ -271,44 +289,122 @@ const HubspotSettings = () => {
|
|
|
271
289
|
config: t("settings.source.config", "config/plugins.ts"),
|
|
272
290
|
env: t("settings.source.env", "environment variable")
|
|
273
291
|
};
|
|
292
|
+
const sourceHint = (source) => source && source !== "settings" ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: t("settings.source", "source: {source}", { source: sourceLabel[source] }) }) : null;
|
|
293
|
+
const regionOptions = REGIONS.includes(region) ? [...REGIONS] : [region, ...REGIONS];
|
|
274
294
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 8, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: [
|
|
275
295
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "flex-start", gap: 2, children: [
|
|
276
296
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "alpha", children: "HubSpot" }),
|
|
277
297
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "epsilon", textColor: "neutral600", children: t(
|
|
278
298
|
"settings.subtitle",
|
|
279
|
-
"
|
|
299
|
+
"Private app token and the HubSpot account that receives form conversions. Switch test → production here — nothing is hardcoded."
|
|
280
300
|
) })
|
|
281
301
|
] }),
|
|
282
302
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "center", children: [
|
|
283
303
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { active: settings.configured, children: settings.configured ? t("settings.configured", "Configured {hint}", { hint: settings.hint }) : t("settings.not-configured", "Not configured") }),
|
|
284
304
|
settings.keySource ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: t("settings.source", "source: {source}", { source: sourceLabel[settings.keySource] }) }) : null
|
|
285
305
|
] }),
|
|
286
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { maxWidth: "32rem", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
306
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { maxWidth: "32rem", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 4, children: [
|
|
307
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
308
|
+
designSystem.Field.Root,
|
|
309
|
+
{
|
|
310
|
+
name: "apiKey",
|
|
311
|
+
hint: t(
|
|
312
|
+
"settings.key.hint",
|
|
313
|
+
"A key entered here overrides config/plugins.ts and HUBSPOT_API_KEY."
|
|
314
|
+
),
|
|
315
|
+
children: [
|
|
316
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: t("settings.key.label", "Private app token") }),
|
|
317
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
318
|
+
designSystem.Field.Input,
|
|
319
|
+
{
|
|
320
|
+
type: "password",
|
|
321
|
+
value: apiKey,
|
|
322
|
+
autoComplete: "off",
|
|
323
|
+
placeholder: settings.configured ? t("settings.key.placeholder.set", "•••••••• (leave empty to keep)") : t("settings.key.placeholder.empty", "pat-eu1-…"),
|
|
324
|
+
onChange: (e) => setApiKey(e.target.value)
|
|
325
|
+
}
|
|
326
|
+
),
|
|
327
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
|
|
328
|
+
]
|
|
329
|
+
}
|
|
330
|
+
),
|
|
331
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
332
|
+
designSystem.Field.Root,
|
|
333
|
+
{
|
|
334
|
+
name: "portalId",
|
|
335
|
+
hint: t(
|
|
336
|
+
"settings.portal.hint",
|
|
337
|
+
"HubSpot account id (Settings → Account → Account setup). Test portal today, production later."
|
|
338
|
+
),
|
|
339
|
+
children: [
|
|
340
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: t("settings.portal.label", "Portal ID") }),
|
|
341
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
342
|
+
designSystem.Field.Input,
|
|
343
|
+
{
|
|
344
|
+
type: "text",
|
|
345
|
+
value: portalId,
|
|
346
|
+
autoComplete: "off",
|
|
347
|
+
placeholder: "148991818",
|
|
348
|
+
onChange: (e) => setPortalId(e.target.value)
|
|
349
|
+
}
|
|
350
|
+
),
|
|
351
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {}),
|
|
352
|
+
sourceHint(settings.portalSource)
|
|
353
|
+
]
|
|
354
|
+
}
|
|
355
|
+
),
|
|
356
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { name: "region", children: [
|
|
357
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: t("settings.region.label", "Region") }),
|
|
358
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
359
|
+
designSystem.SingleSelect,
|
|
360
|
+
{
|
|
361
|
+
value: region,
|
|
362
|
+
onChange: (value) => setRegion(String(value)),
|
|
363
|
+
children: regionOptions.map((r) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: r, children: r === "eu1" ? t("settings.region.eu1", "Europe (eu1)") : r === "na1" ? t("settings.region.na1", "North America (na1)") : r }, r))
|
|
364
|
+
}
|
|
293
365
|
),
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
onChange: (e) => setApiKey(e.target.value)
|
|
304
|
-
}
|
|
366
|
+
sourceHint(settings.regionSource)
|
|
367
|
+
] }),
|
|
368
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
369
|
+
designSystem.Field.Root,
|
|
370
|
+
{
|
|
371
|
+
name: "defaultFormId",
|
|
372
|
+
hint: t(
|
|
373
|
+
"settings.form.hint",
|
|
374
|
+
"Marketing form that receives submissions when a builder form doesn't pick its own. Create the form in HubSpot, then pick it here."
|
|
305
375
|
),
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
376
|
+
children: [
|
|
377
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: t("settings.form.label", "Default marketing form") }),
|
|
378
|
+
forms.length ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
379
|
+
designSystem.SingleSelect,
|
|
380
|
+
{
|
|
381
|
+
value: defaultFormId,
|
|
382
|
+
placeholder: t("settings.form.placeholder", "Pick a form of the connected portal"),
|
|
383
|
+
onChange: (value) => setDefaultFormId(String(value)),
|
|
384
|
+
children: [
|
|
385
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "", children: t("settings.form.none", "None — CRM upsert only") }),
|
|
386
|
+
defaultFormId && !forms.some((f) => f.id === defaultFormId) && /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: defaultFormId, children: defaultFormId }),
|
|
387
|
+
forms.map((f) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: f.id, children: f.name }, f.id))
|
|
388
|
+
]
|
|
389
|
+
}
|
|
390
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
391
|
+
designSystem.Field.Input,
|
|
392
|
+
{
|
|
393
|
+
type: "text",
|
|
394
|
+
value: defaultFormId,
|
|
395
|
+
autoComplete: "off",
|
|
396
|
+
placeholder: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
|
|
397
|
+
onChange: (e) => setDefaultFormId(e.target.value.trim())
|
|
398
|
+
}
|
|
399
|
+
),
|
|
400
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {}),
|
|
401
|
+
sourceHint(settings.formSource)
|
|
402
|
+
]
|
|
403
|
+
}
|
|
404
|
+
)
|
|
405
|
+
] }) }),
|
|
310
406
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
311
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: save, loading: busy,
|
|
407
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: save, loading: busy, children: t("settings.save", "Save") }),
|
|
312
408
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "secondary", onClick: test, loading: busy, disabled: !settings.configured, children: t("settings.test", "Test connection") }),
|
|
313
409
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
314
410
|
designSystem.Button,
|
|
@@ -317,7 +413,7 @@ const HubspotSettings = () => {
|
|
|
317
413
|
onClick: remove,
|
|
318
414
|
loading: busy,
|
|
319
415
|
disabled: settings.keySource !== "settings",
|
|
320
|
-
children: t("settings.remove", "Remove")
|
|
416
|
+
children: t("settings.remove", "Remove key")
|
|
321
417
|
}
|
|
322
418
|
)
|
|
323
419
|
] }),
|
|
@@ -331,7 +427,7 @@ const HubspotSettings = () => {
|
|
|
331
427
|
) : null,
|
|
332
428
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingTop: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: t(
|
|
333
429
|
"settings.scopes",
|
|
334
|
-
"The token needs
|
|
430
|
+
"The token needs crm.schemas.contacts.read, crm.schemas.companies.read and forms (to list and submit marketing forms). The token is never returned to the browser."
|
|
335
431
|
) }) }),
|
|
336
432
|
/* @__PURE__ */ jsxRuntime.jsx(AuditSection, { configured: settings.configured }),
|
|
337
433
|
/* @__PURE__ */ jsxRuntime.jsx(FailuresSection, { configured: settings.configured })
|
|
@@ -28,7 +28,7 @@ const en = {
|
|
|
28
28
|
"picker.refresh": "Refresh the properties from HubSpot",
|
|
29
29
|
"picker.import": "Import the {count} options from HubSpot",
|
|
30
30
|
"picker.imported": "Options imported — save to keep them.",
|
|
31
|
-
"settings.subtitle": "
|
|
31
|
+
"settings.subtitle": "Private app token and the HubSpot account that receives form conversions. Switch test → production here — nothing is hardcoded.",
|
|
32
32
|
"settings.configured": "Configured {hint}",
|
|
33
33
|
"settings.not-configured": "Not configured",
|
|
34
34
|
"settings.source": "source: {source}",
|
|
@@ -36,22 +36,31 @@ const en = {
|
|
|
36
36
|
"settings.source.config": "config/plugins.ts",
|
|
37
37
|
"settings.source.env": "environment variable",
|
|
38
38
|
"settings.key.label": "Private app token",
|
|
39
|
-
"settings.key.hint": "A key entered here overrides
|
|
39
|
+
"settings.key.hint": "A key entered here overrides config/plugins.ts and HUBSPOT_API_KEY.",
|
|
40
40
|
"settings.key.placeholder.set": "•••••••• (leave empty to keep)",
|
|
41
41
|
"settings.key.placeholder.empty": "pat-eu1-…",
|
|
42
|
+
"settings.portal.label": "Portal ID",
|
|
43
|
+
"settings.portal.hint": "HubSpot account id (Settings → Account → Account setup). Test portal today, production later.",
|
|
44
|
+
"settings.region.label": "Region",
|
|
45
|
+
"settings.region.eu1": "Europe (eu1)",
|
|
46
|
+
"settings.region.na1": "North America (na1)",
|
|
47
|
+
"settings.form.label": "Default marketing form",
|
|
48
|
+
"settings.form.hint": "Marketing form that receives submissions when a builder form doesn't pick its own. Create the form in HubSpot, then pick it here.",
|
|
49
|
+
"settings.form.placeholder": "Pick a form of the connected portal",
|
|
50
|
+
"settings.form.none": "None — CRM upsert only",
|
|
42
51
|
"settings.save": "Save",
|
|
43
52
|
"settings.test": "Test connection",
|
|
44
|
-
"settings.remove": "Remove",
|
|
53
|
+
"settings.remove": "Remove key",
|
|
45
54
|
"settings.loading": "Loading…",
|
|
46
55
|
"settings.load-error": "Could not load settings.",
|
|
47
|
-
"settings.saved": "
|
|
48
|
-
"settings.save-error": "Could not save
|
|
56
|
+
"settings.saved": "Settings saved.",
|
|
57
|
+
"settings.save-error": "Could not save settings.",
|
|
49
58
|
"settings.removed": "Key removed.",
|
|
50
59
|
"settings.remove-error": "Could not remove the key.",
|
|
51
60
|
"settings.test-ok": "Connection established — {count} readable properties.",
|
|
52
61
|
"settings.test-no-key": "No key configured.",
|
|
53
62
|
"settings.test-error": "HubSpot unreachable — invalid or revoked key?",
|
|
54
|
-
"settings.scopes": "The token needs
|
|
63
|
+
"settings.scopes": "The token needs crm.schemas.contacts.read, crm.schemas.companies.read and forms (to list and submit marketing forms). The token is never returned to the browser.",
|
|
55
64
|
"audit.title": "Mapping audit",
|
|
56
65
|
"audit.subtitle": "Scans every entry of the validated content types and lists the mappings the portal would reject today — including properties deleted in HubSpot since they were saved.",
|
|
57
66
|
"audit.run": "Run the audit",
|
|
@@ -30,7 +30,7 @@ const en = {
|
|
|
30
30
|
"picker.refresh": "Refresh the properties from HubSpot",
|
|
31
31
|
"picker.import": "Import the {count} options from HubSpot",
|
|
32
32
|
"picker.imported": "Options imported — save to keep them.",
|
|
33
|
-
"settings.subtitle": "
|
|
33
|
+
"settings.subtitle": "Private app token and the HubSpot account that receives form conversions. Switch test → production here — nothing is hardcoded.",
|
|
34
34
|
"settings.configured": "Configured {hint}",
|
|
35
35
|
"settings.not-configured": "Not configured",
|
|
36
36
|
"settings.source": "source: {source}",
|
|
@@ -38,22 +38,31 @@ const en = {
|
|
|
38
38
|
"settings.source.config": "config/plugins.ts",
|
|
39
39
|
"settings.source.env": "environment variable",
|
|
40
40
|
"settings.key.label": "Private app token",
|
|
41
|
-
"settings.key.hint": "A key entered here overrides
|
|
41
|
+
"settings.key.hint": "A key entered here overrides config/plugins.ts and HUBSPOT_API_KEY.",
|
|
42
42
|
"settings.key.placeholder.set": "•••••••• (leave empty to keep)",
|
|
43
43
|
"settings.key.placeholder.empty": "pat-eu1-…",
|
|
44
|
+
"settings.portal.label": "Portal ID",
|
|
45
|
+
"settings.portal.hint": "HubSpot account id (Settings → Account → Account setup). Test portal today, production later.",
|
|
46
|
+
"settings.region.label": "Region",
|
|
47
|
+
"settings.region.eu1": "Europe (eu1)",
|
|
48
|
+
"settings.region.na1": "North America (na1)",
|
|
49
|
+
"settings.form.label": "Default marketing form",
|
|
50
|
+
"settings.form.hint": "Marketing form that receives submissions when a builder form doesn't pick its own. Create the form in HubSpot, then pick it here.",
|
|
51
|
+
"settings.form.placeholder": "Pick a form of the connected portal",
|
|
52
|
+
"settings.form.none": "None — CRM upsert only",
|
|
44
53
|
"settings.save": "Save",
|
|
45
54
|
"settings.test": "Test connection",
|
|
46
|
-
"settings.remove": "Remove",
|
|
55
|
+
"settings.remove": "Remove key",
|
|
47
56
|
"settings.loading": "Loading…",
|
|
48
57
|
"settings.load-error": "Could not load settings.",
|
|
49
|
-
"settings.saved": "
|
|
50
|
-
"settings.save-error": "Could not save
|
|
58
|
+
"settings.saved": "Settings saved.",
|
|
59
|
+
"settings.save-error": "Could not save settings.",
|
|
51
60
|
"settings.removed": "Key removed.",
|
|
52
61
|
"settings.remove-error": "Could not remove the key.",
|
|
53
62
|
"settings.test-ok": "Connection established — {count} readable properties.",
|
|
54
63
|
"settings.test-no-key": "No key configured.",
|
|
55
64
|
"settings.test-error": "HubSpot unreachable — invalid or revoked key?",
|
|
56
|
-
"settings.scopes": "The token needs
|
|
65
|
+
"settings.scopes": "The token needs crm.schemas.contacts.read, crm.schemas.companies.read and forms (to list and submit marketing forms). The token is never returned to the browser.",
|
|
57
66
|
"audit.title": "Mapping audit",
|
|
58
67
|
"audit.subtitle": "Scans every entry of the validated content types and lists the mappings the portal would reject today — including properties deleted in HubSpot since they were saved.",
|
|
59
68
|
"audit.run": "Run the audit",
|
|
@@ -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": "
|
|
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
|
|
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": "
|
|
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
|
|
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",
|
|
@@ -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": "
|
|
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
|
|
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": "
|
|
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
|
|
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",
|
|
@@ -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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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,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-
|
|
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-
|
|
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();
|
package/dist/admin/index.js
CHANGED
package/dist/admin/index.mjs
CHANGED