strapi-plugin-hubspot 0.5.0 → 0.6.1

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 (51) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/README.md +110 -4
  3. package/dist/_chunks/Forms-B2y_0-x4.mjs +989 -0
  4. package/dist/_chunks/Forms-CaT0YEJo.js +1007 -0
  5. package/dist/_chunks/{HubspotObjectInput-DpXMFiPg.js → HubspotObjectInput-Crpcpa8T.js} +3 -3
  6. package/dist/_chunks/{HubspotObjectInput-D9r_sGFe.mjs → HubspotObjectInput-DdLAUh0N.mjs} +3 -3
  7. package/dist/_chunks/{HubspotPropertyInput-Dk0t0NVe.js → HubspotPropertyInput-SnJMFsII.js} +3 -3
  8. package/dist/_chunks/{HubspotPropertyInput-av9782v6.mjs → HubspotPropertyInput-k7wMSmeF.mjs} +3 -3
  9. package/dist/_chunks/Settings-BMOmj4NJ.mjs +321 -0
  10. package/dist/_chunks/Settings-BPAAD-QW.js +339 -0
  11. package/dist/_chunks/en-CJ9wYHgN.mjs +197 -0
  12. package/dist/_chunks/en-C_-N8cjv.js +197 -0
  13. package/dist/_chunks/fr-BHObPoUp.js +197 -0
  14. package/dist/_chunks/fr-DttDn-2Y.mjs +197 -0
  15. package/dist/_chunks/{index-B3c9qEYU.js → index-D_CPrIHe.js} +12 -4
  16. package/dist/_chunks/{index-C0XHwXog.mjs → index-foVSGFWb.mjs} +12 -4
  17. package/dist/_chunks/{objectLabels-DwOMxLfh.mjs → objectLabels-C9ocOgVY.mjs} +1 -1
  18. package/dist/_chunks/{objectLabels-DksWJnOK.js → objectLabels-VTt_-qTZ.js} +1 -1
  19. package/dist/_chunks/{useHubspotSchema-C3vn1DuR.js → useHubspotSchema-B8SctALV.js} +1 -1
  20. package/dist/_chunks/{useHubspotSchema-BGtg7Ffj.mjs → useHubspotSchema-Du3rLY_O.mjs} +1 -1
  21. package/dist/admin/index.js +2 -1
  22. package/dist/admin/index.mjs +2 -1
  23. package/dist/admin/src/builder/ConditionEditor.d.ts +17 -0
  24. package/dist/admin/src/builder/FieldPanel.d.ts +16 -0
  25. package/dist/admin/src/builder/types.d.ts +90 -0
  26. package/dist/admin/src/index.d.ts +1 -0
  27. package/dist/admin/src/pages/FormEditor.d.ts +9 -0
  28. package/dist/admin/src/pages/Forms.d.ts +4 -0
  29. package/dist/admin/src/pages/FormsList.d.ts +8 -0
  30. package/dist/server/index.js +880 -5
  31. package/dist/server/index.mjs +880 -5
  32. package/dist/server/src/__tests__/conditions.test.d.ts +1 -0
  33. package/dist/server/src/__tests__/forms.test.d.ts +1 -0
  34. package/dist/server/src/__tests__/formsSubmit.test.d.ts +1 -0
  35. package/dist/server/src/__tests__/importLegacy.test.d.ts +1 -0
  36. package/dist/server/src/conditions.d.ts +88 -0
  37. package/dist/server/src/content-types.d.ts +161 -9
  38. package/dist/server/src/forms.d.ts +81 -0
  39. package/dist/server/src/formsAdmin.d.ts +39 -0
  40. package/dist/server/src/importLegacy.d.ts +25 -0
  41. package/dist/server/src/index.d.ts +214 -16
  42. package/dist/shared/types.d.ts +103 -0
  43. package/dist/shared/types.js +2 -0
  44. package/dist/shared/types.mjs +2 -0
  45. package/package.json +24 -6
  46. package/dist/_chunks/Settings-CPxe6LdH.js +0 -1311
  47. package/dist/_chunks/Settings-DTzk6GWO.mjs +0 -1293
  48. package/dist/_chunks/en-BN5fD3ai.js +0 -83
  49. package/dist/_chunks/en-xeTTAUtX.mjs +0 -83
  50. package/dist/_chunks/fr-BKODkfPy.mjs +0 -83
  51. package/dist/_chunks/fr-D3-oO8Lt.js +0 -83
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Public types of strapi-plugin-hubspot, for host apps and frontends:
3
+ *
4
+ * import type { PublicForm, Condition } from "strapi-plugin-hubspot/types";
5
+ *
6
+ * They describe the payloads of the public content-api routes:
7
+ * GET /api/hubspot/forms/:slug → PublicForm
8
+ * POST /api/hubspot/forms/:slug/submit → SubmitResponse (SubmitRequest in)
9
+ */
10
+
11
+ export type Operator = "eq" | "neq" | "contains" | "empty" | "notEmpty" | "gt" | "lt";
12
+
13
+ export interface Rule {
14
+ /** Stable id (`fld_…`) of the field the rule reads — never its name. */
15
+ field: string;
16
+ operator: Operator;
17
+ value?: string;
18
+ }
19
+
20
+ export interface Condition {
21
+ logic: "and" | "or";
22
+ rules: Rule[];
23
+ }
24
+
25
+ export type FieldType =
26
+ | "text"
27
+ | "email"
28
+ | "tel"
29
+ | "number"
30
+ | "website"
31
+ | "textarea"
32
+ | "select"
33
+ | "checkbox"
34
+ | "radio";
35
+
36
+ export interface FieldOption {
37
+ value: string;
38
+ label?: string;
39
+ }
40
+
41
+ /** A field as the public endpoint serves it — the CRM mapping is stripped. */
42
+ export interface PublicFormField {
43
+ id: string;
44
+ name: string;
45
+ label: string;
46
+ type: FieldType;
47
+ placeholder?: string;
48
+ helpText?: string;
49
+ icon?: string;
50
+ class?: string;
51
+ width?: "full" | "half";
52
+ required?: boolean;
53
+ persist?: "session" | "days30";
54
+ options?: FieldOption[];
55
+ visibleIf?: Condition | null;
56
+ }
57
+
58
+ export interface PublicFormStep {
59
+ id: string;
60
+ title?: string;
61
+ description?: string;
62
+ class?: string;
63
+ visibleIf?: Condition | null;
64
+ fields: PublicFormField[];
65
+ }
66
+
67
+ /** GET /api/hubspot/forms/:slug */
68
+ export interface PublicForm {
69
+ slug: string;
70
+ title?: string | null;
71
+ subtitle?: string | null;
72
+ nextLabel?: string | null;
73
+ submitLabel?: string | null;
74
+ successMessage?: string | null;
75
+ locale?: string | null;
76
+ steps: PublicFormStep[];
77
+ }
78
+
79
+ /** POST /api/hubspot/forms/:slug/submit — request body. */
80
+ export interface SubmitRequest {
81
+ /** Answers keyed by field `name`. Values hidden by a condition are ignored. */
82
+ values: Record<string, string | number | boolean>;
83
+ meta?: {
84
+ pagePath?: string;
85
+ pageUrl?: string;
86
+ originPath?: string;
87
+ originLabel?: string;
88
+ source?: string;
89
+ };
90
+ }
91
+
92
+ /** POST /api/hubspot/forms/:slug/submit — 200 response. */
93
+ export interface SubmitResponse {
94
+ ok: true;
95
+ /** False when the CRM was unreachable — the submission is stored either way. */
96
+ hubspotSynced: boolean;
97
+ }
98
+
99
+ /** POST /api/hubspot/forms/:slug/submit — 422 response. */
100
+ export interface SubmitValidationError {
101
+ ok: false;
102
+ missingRequired: { id: string; name: string; label: string }[];
103
+ }
@@ -0,0 +1,2 @@
1
+ // types-only entry
2
+ module.exports = {};
@@ -0,0 +1,2 @@
1
+ // types-only entry
2
+ export default {};
package/package.json CHANGED
@@ -1,12 +1,16 @@
1
1
  {
2
2
  "name": "strapi-plugin-hubspot",
3
- "version": "0.5.0",
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.",
3
+ "version": "0.6.1",
4
+ "description": "The form builder for HubSpot in Strapi — multi-step forms with conditional fields mapped to real CRM properties, a public submit pipeline with retries, and save-time mapping validation.",
5
5
  "keywords": [
6
6
  "strapi",
7
7
  "plugin",
8
8
  "hubspot",
9
9
  "crm",
10
+ "form-builder",
11
+ "forms",
12
+ "conditional-fields",
13
+ "leads",
10
14
  "custom-field"
11
15
  ],
12
16
  "license": "MIT",
@@ -35,20 +39,30 @@
35
39
  "import": "./dist/server/index.mjs",
36
40
  "require": "./dist/server/index.js",
37
41
  "default": "./dist/server/index.js"
42
+ },
43
+ "./types": {
44
+ "types": "./dist/shared/types.d.ts",
45
+ "source": "./shared/types.ts",
46
+ "import": "./dist/shared/types.mjs",
47
+ "require": "./dist/shared/types.js",
48
+ "default": "./dist/shared/types.js"
38
49
  }
39
50
  },
40
51
  "files": [
41
- "dist"
52
+ "dist",
53
+ "CHANGELOG.md"
42
54
  ],
43
55
  "scripts": {
44
- "build": "strapi-plugin build",
56
+ "build": "strapi-plugin build && node scripts/build-types.mjs && node scripts/check-externals.mjs",
45
57
  "watch": "strapi-plugin watch",
46
58
  "verify": "strapi-plugin verify",
47
59
  "test": "vitest run",
48
60
  "test:watch": "vitest",
49
- "prepublishOnly": "npm run build"
61
+ "prepublishOnly": "npm run build",
62
+ "lint": "eslint admin/src server/src"
50
63
  },
51
64
  "devDependencies": {
65
+ "@eslint/js": "^10.0.1",
52
66
  "@strapi/design-system": "^2.0.0-rc.29",
53
67
  "@strapi/icons": "^2.0.0-rc.29",
54
68
  "@strapi/sdk-plugin": "^5.3.2",
@@ -57,11 +71,14 @@
57
71
  "@strapi/utils": "^5.0.0",
58
72
  "@types/react": "^18.3.3",
59
73
  "@types/react-dom": "^18.3.0",
74
+ "eslint": "^10.9.1",
75
+ "eslint-plugin-react-hooks": "^7.1.1",
60
76
  "react": "^18.3.1",
61
77
  "react-dom": "^18.3.1",
62
78
  "react-router-dom": "^6.26.0",
63
79
  "styled-components": "^6.1.11",
64
80
  "typescript": "^5.5.4",
81
+ "typescript-eslint": "^8.68.0",
65
82
  "vitest": "^3.2.4"
66
83
  },
67
84
  "peerDependencies": {
@@ -71,6 +88,7 @@
71
88
  "@strapi/utils": "^5.0.0",
72
89
  "react": "^17.0.0 || ^18.0.0",
73
90
  "react-dom": "^17.0.0 || ^18.0.0",
91
+ "react-router-dom": "^6.0.0",
74
92
  "styled-components": "^6.0.0"
75
93
  },
76
94
  "strapi": {
@@ -82,4 +100,4 @@
82
100
  "engines": {
83
101
  "node": ">=18.0.0"
84
102
  }
85
- }
103
+ }