strapi-plugin-hubspot 0.4.1 → 0.4.2

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/README.md CHANGED
@@ -126,11 +126,13 @@ each `{ value?, label? }`) and they are checked too.
126
126
  Each problem is also carried as a structured code in the error's `details`, so a
127
127
  host app can localize the message instead of parsing the sentence.
128
128
 
129
- **`unknown` is the one code a legitimate workflow can produce** — a property
130
- staged in HubSpot but not created yet. Set `strict: false` on a validate target
131
- and those pass with a warning in the logs instead of blocking the save. The
132
- other three codes always block, whatever `strict` says: no workflow produces a
133
- wrong object, a trailing space, or a drifted option on purpose.
129
+ **`unknown` is the one code a legitimate workflow can produce** — a mapping
130
+ written before its property was deleted in HubSpot, or content created through
131
+ the API against a property staged but not created yet. Set `strict: false` on a
132
+ validate target and those pass with a warning in the logs instead of blocking
133
+ the save. The other three codes always block, whatever `strict` says: no
134
+ workflow produces a wrong object, a trailing space, or a drifted option on
135
+ purpose.
134
136
 
135
137
  ### An audit of existing content
136
138
 
@@ -300,7 +302,7 @@ This one never blocks work:
300
302
  |---|---|
301
303
  | No API key configured | The field falls back to a plain text input, with a note explaining why |
302
304
  | HubSpot unreachable | Saving proceeds; validation is skipped and a warning is logged |
303
- | Property staged in HubSpot but not created yet | The picker accepts a typed value (`creatable`); set `strict: false` on the validate target so the save passes too |
305
+ | Property staged in HubSpot but not created yet | Not offered — properties are managed in HubSpot, the picker never invents one. A value already stored (e.g. written via the API) passes the save if the target sets `strict: false` |
304
306
  | An object's scope is missing | That object is skipped; the others still work |
305
307
  | Portal id unreadable | Deep links are omitted; everything else is unaffected |
306
308
  | Plugin uninstalled | Values remain as strings — nothing to undo |
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
- const objectLabels = require("./objectLabels-CORLL0o7.js");
5
+ const objectLabels = require("./objectLabels-B76t8qqg.js");
6
6
  const designSystem = require("@strapi/design-system");
7
7
  const admin = require("@strapi/strapi/admin");
8
- const index = require("./index-CDpmcrIu.js");
8
+ const index = require("./index-BUlB1rK9.js");
9
9
  function _interopNamespace(e) {
10
10
  if (e && e.__esModule) return e;
11
11
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -1,9 +1,9 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
- import { u as useIntl, o as objectLabel } from "./objectLabels-DKr0yCaU.mjs";
3
+ import { u as useIntl, o as objectLabel } from "./objectLabels-dM4o67Fz.mjs";
4
4
  import { Field, Flex, Loader, SingleSelect, SingleSelectOption } from "@strapi/design-system";
5
5
  import { useFetchClient } from "@strapi/strapi/admin";
6
- import { P as PLUGIN_ID, g as getTranslation } from "./index-ymm9UsG8.mjs";
6
+ import { P as PLUGIN_ID, g as getTranslation } from "./index-CKoBcX1T.mjs";
7
7
  const HubspotObjectInput = React.forwardRef(
8
8
  ({ name, value, onChange, disabled, error, required, label, hint, labelAction }, ref) => {
9
9
  const intl = useIntl();
@@ -1,9 +1,9 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
- import { u as useIntl, o as objectLabel } from "./objectLabels-DKr0yCaU.mjs";
3
+ import { u as useIntl, o as objectLabel } from "./objectLabels-dM4o67Fz.mjs";
4
4
  import { Field, Flex, Loader, Combobox, ComboboxOption, Button, Typography, Link } from "@strapi/design-system";
5
5
  import { useFetchClient, useField } from "@strapi/strapi/admin";
6
- import { P as PLUGIN_ID, g as getTranslation } from "./index-ymm9UsG8.mjs";
6
+ import { P as PLUGIN_ID, g as getTranslation } from "./index-CKoBcX1T.mjs";
7
7
  const oneLine = {
8
8
  display: "block",
9
9
  whiteSpace: "nowrap",
@@ -129,8 +129,11 @@ const HubspotPropertyInput = React.forwardRef(
129
129
  id: getTranslation("picker.placeholder"),
130
130
  defaultMessage: "Search a property…"
131
131
  }),
132
- creatable: true,
133
- onCreateOption: emit,
132
+ autocomplete: { type: "list", filter: "contains" },
133
+ noOptionsMessage: () => formatMessage({
134
+ id: getTranslation("picker.no-results"),
135
+ defaultMessage: "No matching property — properties are managed in HubSpot."
136
+ }),
134
137
  children: options.map((o) => /* @__PURE__ */ jsx(ComboboxOption, { value: o.value, textValue: o.label, children: /* @__PURE__ */ jsx("span", { title: o.label, style: oneLine, children: o.label }) }, o.value))
135
138
  }
136
139
  ) : /* @__PURE__ */ jsx(
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
- const objectLabels = require("./objectLabels-CORLL0o7.js");
5
+ const objectLabels = require("./objectLabels-B76t8qqg.js");
6
6
  const designSystem = require("@strapi/design-system");
7
7
  const admin = require("@strapi/strapi/admin");
8
- const index = require("./index-CDpmcrIu.js");
8
+ const index = require("./index-BUlB1rK9.js");
9
9
  function _interopNamespace(e) {
10
10
  if (e && e.__esModule) return e;
11
11
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -149,8 +149,11 @@ const HubspotPropertyInput = React__namespace.forwardRef(
149
149
  id: index.getTranslation("picker.placeholder"),
150
150
  defaultMessage: "Search a property…"
151
151
  }),
152
- creatable: true,
153
- onCreateOption: emit,
152
+ autocomplete: { type: "list", filter: "contains" },
153
+ noOptionsMessage: () => formatMessage({
154
+ id: index.getTranslation("picker.no-results"),
155
+ defaultMessage: "No matching property — properties are managed in HubSpot."
156
+ }),
154
157
  children: options.map((o) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: o.value, textValue: o.label, children: /* @__PURE__ */ jsxRuntime.jsx("span", { title: o.label, style: oneLine, children: o.label }) }, o.value))
155
158
  }
156
159
  ) : /* @__PURE__ */ jsxRuntime.jsx(
@@ -1,9 +1,9 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
- import { u as useIntl, o as objectLabel } from "./objectLabels-DKr0yCaU.mjs";
3
+ import { u as useIntl, o as objectLabel } from "./objectLabels-dM4o67Fz.mjs";
4
4
  import { Flex, Divider, Typography, Button, Box, Link as Link$1, Badge, Loader, Field } from "@strapi/design-system";
5
5
  import { useFetchClient } from "@strapi/strapi/admin";
6
- import { g as getTranslation, P as PLUGIN_ID } from "./index-ymm9UsG8.mjs";
6
+ import { g as getTranslation, P as PLUGIN_ID } from "./index-CKoBcX1T.mjs";
7
7
  import "react-dom";
8
8
  /**
9
9
  * @remix-run/router v1.23.3
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
- const objectLabels = require("./objectLabels-CORLL0o7.js");
5
+ const objectLabels = require("./objectLabels-B76t8qqg.js");
6
6
  const designSystem = require("@strapi/design-system");
7
7
  const admin = require("@strapi/strapi/admin");
8
- const index = require("./index-CDpmcrIu.js");
8
+ const index = require("./index-BUlB1rK9.js");
9
9
  require("react-dom");
10
10
  function _interopNamespace(e) {
11
11
  if (e && e.__esModule) return e;
@@ -24,6 +24,7 @@ const en = {
24
24
  "picker.belongs-to": "{property} — belongs to {object}",
25
25
  "picker.unknown": "{property} — unknown to the portal",
26
26
  "picker.view": "View in HubSpot",
27
+ "picker.no-results": "No matching property — properties are managed in HubSpot.",
27
28
  "picker.import": "Import the {count} options from HubSpot",
28
29
  "picker.imported": "Options imported — save to keep them.",
29
30
  "settings.subtitle": "The private app token used to read the portal's properties and validate form mappings.",
@@ -26,6 +26,7 @@ const en = {
26
26
  "picker.belongs-to": "{property} — belongs to {object}",
27
27
  "picker.unknown": "{property} — unknown to the portal",
28
28
  "picker.view": "View in HubSpot",
29
+ "picker.no-results": "No matching property — properties are managed in HubSpot.",
29
30
  "picker.import": "Import the {count} options from HubSpot",
30
31
  "picker.imported": "Options imported — save to keep them.",
31
32
  "settings.subtitle": "The private app token used to read the portal's properties and validate form mappings.",
@@ -26,6 +26,7 @@ const fr = {
26
26
  "picker.belongs-to": "{property} — appartient à {object}",
27
27
  "picker.unknown": "{property} — inconnue du portail",
28
28
  "picker.view": "Voir dans HubSpot",
29
+ "picker.no-results": "Aucune propriété correspondante — les propriétés se gèrent dans HubSpot.",
29
30
  "picker.import": "Importer les {count} options depuis HubSpot",
30
31
  "picker.imported": "Options importées — enregistrez pour les conserver.",
31
32
  "settings.subtitle": "Le jeton d'application privée utilisé pour lire les propriétés du portail et valider les mappings de formulaires.",
@@ -24,6 +24,7 @@ const fr = {
24
24
  "picker.belongs-to": "{property} — appartient à {object}",
25
25
  "picker.unknown": "{property} — inconnue du portail",
26
26
  "picker.view": "Voir dans HubSpot",
27
+ "picker.no-results": "Aucune propriété correspondante — les propriétés se gèrent dans HubSpot.",
27
28
  "picker.import": "Importer les {count} options depuis HubSpot",
28
29
  "picker.imported": "Options importées — enregistrez pour les conserver.",
29
30
  "settings.subtitle": "Le jeton d'application privée utilisé pour lire les propriétés du portail et valider les mappings de formulaires.",
@@ -33,7 +33,7 @@ const index = {
33
33
  defaultMessage: "Picked from the portal's real properties"
34
34
  },
35
35
  components: {
36
- Input: async () => Promise.resolve().then(() => require("./HubspotPropertyInput-YKXA_-Sk.js"))
36
+ Input: async () => Promise.resolve().then(() => require("./HubspotPropertyInput-DIPDPRXJ.js"))
37
37
  },
38
38
  // Exposed in the Content-Type Builder. Without this, `objectField` could
39
39
  // only be set by hand-editing schema.json — which is not how anyone
@@ -96,7 +96,7 @@ const index = {
96
96
  defaultMessage: "Picked from the portal's configured objects"
97
97
  },
98
98
  components: {
99
- Input: async () => Promise.resolve().then(() => require("./HubspotObjectInput-Dqgz6Epv.js"))
99
+ Input: async () => Promise.resolve().then(() => require("./HubspotObjectInput-Br2jTFkG.js"))
100
100
  }
101
101
  });
102
102
  app.createSettingSection(
@@ -112,7 +112,7 @@ const index = {
112
112
  // Mirrors the RBAC action registered server-side: a role without it
113
113
  // doesn't see the link at all — the routes refuse it anyway.
114
114
  permissions: [{ action: `plugin::${PLUGIN_ID}.settings`, subject: null }],
115
- Component: async () => (await Promise.resolve().then(() => require("./Settings-D34hp54b.js"))).default
115
+ Component: async () => (await Promise.resolve().then(() => require("./Settings-CvbKVl-t.js"))).default
116
116
  }
117
117
  ]
118
118
  );
@@ -122,7 +122,7 @@ const index = {
122
122
  return Promise.all(
123
123
  locales.map(async (locale) => {
124
124
  try {
125
- const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => Promise.resolve().then(() => require("./en-CnQbjHs-.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-Bv8zsNX5.js")) }), `./translations/${locale}.json`, 3);
125
+ const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => Promise.resolve().then(() => require("./en-PBG7-vMR.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-DL4wdV8I.js")) }), `./translations/${locale}.json`, 3);
126
126
  return { data: prefixPluginTranslations(data), locale };
127
127
  } catch {
128
128
  return { data: {}, locale };
@@ -32,7 +32,7 @@ const index = {
32
32
  defaultMessage: "Picked from the portal's real properties"
33
33
  },
34
34
  components: {
35
- Input: async () => import("./HubspotPropertyInput-BUbQk1CX.mjs")
35
+ Input: async () => import("./HubspotPropertyInput-CK6Yj9rC.mjs")
36
36
  },
37
37
  // Exposed in the Content-Type Builder. Without this, `objectField` could
38
38
  // only be set by hand-editing schema.json — which is not how anyone
@@ -95,7 +95,7 @@ const index = {
95
95
  defaultMessage: "Picked from the portal's configured objects"
96
96
  },
97
97
  components: {
98
- Input: async () => import("./HubspotObjectInput-DiYaEyE7.mjs")
98
+ Input: async () => import("./HubspotObjectInput-DutelVp6.mjs")
99
99
  }
100
100
  });
101
101
  app.createSettingSection(
@@ -111,7 +111,7 @@ const index = {
111
111
  // Mirrors the RBAC action registered server-side: a role without it
112
112
  // doesn't see the link at all — the routes refuse it anyway.
113
113
  permissions: [{ action: `plugin::${PLUGIN_ID}.settings`, subject: null }],
114
- Component: async () => (await import("./Settings-B_lg_AaC.mjs")).default
114
+ Component: async () => (await import("./Settings-CQsB0B2T.mjs")).default
115
115
  }
116
116
  ]
117
117
  );
@@ -121,7 +121,7 @@ const index = {
121
121
  return Promise.all(
122
122
  locales.map(async (locale) => {
123
123
  try {
124
- const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => import("./en-DHQZuRsj.mjs"), "./translations/fr.json": () => import("./fr-Dxgil7RP.mjs") }), `./translations/${locale}.json`, 3);
124
+ const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => import("./en-D4ueeUcJ.mjs"), "./translations/fr.json": () => import("./fr-DYnxVmIO.mjs") }), `./translations/${locale}.json`, 3);
125
125
  return { data: prefixPluginTranslations(data), locale };
126
126
  } catch {
127
127
  return { data: {}, locale };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const React = require("react");
3
- const index = require("./index-CDpmcrIu.js");
3
+ const index = require("./index-BUlB1rK9.js");
4
4
  function _interopNamespace(e) {
5
5
  if (e && e.__esModule) return e;
6
6
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { g as getTranslation } from "./index-ymm9UsG8.mjs";
2
+ import { g as getTranslation } from "./index-CKoBcX1T.mjs";
3
3
  var __assign = function() {
4
4
  __assign = Object.assign || function __assign2(t) {
5
5
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
- const index = require("../_chunks/index-CDpmcrIu.js");
2
+ const index = require("../_chunks/index-BUlB1rK9.js");
3
3
  module.exports = index.index;
@@ -1,4 +1,4 @@
1
- import { i } from "../_chunks/index-ymm9UsG8.mjs";
1
+ import { i } from "../_chunks/index-CKoBcX1T.mjs";
2
2
  export {
3
3
  i as default
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strapi-plugin-hubspot",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "HubSpot integration for Strapi — pick CRM properties from a searchable list filtered by object, and catch bad mappings before they reach the API.",
5
5
  "keywords": [
6
6
  "strapi",