strapi-plugin-hubspot 0.16.2 → 0.16.5
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 +26 -0
- package/README.md +8 -5
- package/dist/_chunks/{Forms-BOQWely0.mjs → Forms-DyV6KyiO.mjs} +20 -6
- package/dist/_chunks/{Forms-mMNP7hc9.js → Forms-uUN4XjhW.js} +20 -6
- package/dist/_chunks/{HubspotFormInput-DI35Aqiu.js → HubspotFormInput-BkWat_wu.js} +1 -1
- package/dist/_chunks/{HubspotFormInput-DCkoavrN.mjs → HubspotFormInput-DEXPX-6j.mjs} +1 -1
- package/dist/_chunks/{HubspotObjectInput-Cq1TuL_l.js → HubspotObjectInput-CFDYW-TM.js} +3 -3
- package/dist/_chunks/{HubspotObjectInput-BbnvhdbD.mjs → HubspotObjectInput-DL8fYK2x.mjs} +3 -3
- package/dist/_chunks/{HubspotPropertyInput-BLZzsW08.js → HubspotPropertyInput-CFMkbQeT.js} +3 -3
- package/dist/_chunks/{HubspotPropertyInput-BHfpBD36.mjs → HubspotPropertyInput-WU5FMJj3.mjs} +3 -3
- package/dist/_chunks/{Settings-BAsx0LGv.js → Settings-B_hhdpHa.js} +21 -3
- package/dist/_chunks/{Settings-DqRpHtnT.mjs → Settings-CiXEps_C.mjs} +21 -3
- package/dist/_chunks/{en-Djd3TID0.mjs → en-BIUBYzHv.mjs} +5 -1
- package/dist/_chunks/{en-sfzopB5K.js → en-CFhEtgZJ.js} +5 -1
- package/dist/_chunks/{fr-C7t1elmR.mjs → fr-CMYcnFH0.mjs} +5 -1
- package/dist/_chunks/{fr-sF5Josfh.js → fr-zdUuuV0M.js} +5 -1
- package/dist/_chunks/{index-CLAy5dVN.mjs → index-BeBn7bJa.mjs} +6 -6
- package/dist/_chunks/{index-R3ReZXF1.js → index-CG_WQzSa.js} +6 -6
- package/dist/_chunks/{objectLabels-CW2iBOkD.js → objectLabels-BGq-Ypgn.js} +1 -1
- package/dist/_chunks/{objectLabels--zOmqsfm.mjs → objectLabels-CS_0QCNz.mjs} +1 -1
- package/dist/_chunks/{useHubspotSchema-BRzzvs9t.js → useHubspotSchema-BZP2qkAu.js} +1 -1
- package/dist/_chunks/{useHubspotSchema-Bz2o1BU-.mjs → useHubspotSchema-CP7LRdzO.mjs} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/builder/types.d.ts +1 -1
- package/dist/server/index.js +108 -30
- package/dist/server/index.mjs +108 -30
- package/dist/server/src/forms.d.ts +3 -2
- package/dist/server/src/hsforms.d.ts +53 -7
- package/dist/server/src/importHubspot.d.ts +9 -0
- package/dist/server/src/index.d.ts +1 -0
- package/dist/server/src/settings.d.ts +6 -0
- package/package.json +1 -1
|
@@ -34,9 +34,54 @@ export declare function formFieldNames(raw: {
|
|
|
34
34
|
fieldGroups?: {
|
|
35
35
|
fields?: {
|
|
36
36
|
name?: string;
|
|
37
|
+
required?: boolean;
|
|
37
38
|
}[];
|
|
38
39
|
}[];
|
|
39
40
|
}): string[];
|
|
41
|
+
export declare function formRequiredNames(raw: {
|
|
42
|
+
fieldGroups?: {
|
|
43
|
+
fields?: {
|
|
44
|
+
name?: string;
|
|
45
|
+
required?: boolean;
|
|
46
|
+
}[];
|
|
47
|
+
}[];
|
|
48
|
+
}): string[];
|
|
49
|
+
export interface CommunicationConsent {
|
|
50
|
+
subscriptionTypeId: number;
|
|
51
|
+
text: string;
|
|
52
|
+
}
|
|
53
|
+
export interface FormShape {
|
|
54
|
+
names: Set<string>;
|
|
55
|
+
required: Set<string>;
|
|
56
|
+
hasLegalConsent: boolean;
|
|
57
|
+
captcha: boolean;
|
|
58
|
+
consentToProcessText?: string;
|
|
59
|
+
communications: CommunicationConsent[];
|
|
60
|
+
}
|
|
61
|
+
export declare function parseFormShape(raw: {
|
|
62
|
+
fieldGroups?: {
|
|
63
|
+
fields?: {
|
|
64
|
+
name?: string;
|
|
65
|
+
required?: boolean;
|
|
66
|
+
}[];
|
|
67
|
+
}[];
|
|
68
|
+
configuration?: {
|
|
69
|
+
captchaEnabled?: boolean;
|
|
70
|
+
};
|
|
71
|
+
legalConsentOptions?: {
|
|
72
|
+
type?: string;
|
|
73
|
+
consentToProcessText?: string;
|
|
74
|
+
communicationsCheckboxes?: {
|
|
75
|
+
label?: string;
|
|
76
|
+
text?: string;
|
|
77
|
+
subscriptionTypeId?: number | string;
|
|
78
|
+
communicationTypeId?: number | string;
|
|
79
|
+
}[];
|
|
80
|
+
} | null;
|
|
81
|
+
}): FormShape;
|
|
82
|
+
/** Email-only retry is only safe when HubSpot doesn't require other fields. */
|
|
83
|
+
export declare function canRetryEmailOnly(required: Iterable<string> | undefined): boolean;
|
|
84
|
+
export declare function buildLegalConsent(shape: Pick<FormShape, "hasLegalConsent" | "communications" | "consentToProcessText"> | null | undefined, given: boolean, fallbackText?: string): Record<string, unknown> | undefined;
|
|
40
85
|
export interface FormSubmitContext {
|
|
41
86
|
hutk?: string;
|
|
42
87
|
pageUri?: string;
|
|
@@ -51,24 +96,25 @@ export interface FormSubmitInput {
|
|
|
51
96
|
fields: {
|
|
52
97
|
name: string;
|
|
53
98
|
value: string;
|
|
99
|
+
objectTypeId?: string;
|
|
54
100
|
}[];
|
|
55
101
|
context?: FormSubmitContext;
|
|
56
102
|
consent?: {
|
|
57
103
|
given: boolean;
|
|
58
104
|
text?: string;
|
|
59
105
|
};
|
|
60
|
-
|
|
106
|
+
shape?: FormShape | null;
|
|
61
107
|
}
|
|
62
108
|
export declare function clearFormShapeCache(formGuid?: string): void;
|
|
63
|
-
export declare function loadFormShape(apiKey: string, formGuid: string): Promise<
|
|
64
|
-
names: Set<string>;
|
|
65
|
-
hasLegalConsent: boolean;
|
|
66
|
-
} | null>;
|
|
109
|
+
export declare function loadFormShape(apiKey: string, formGuid: string): Promise<FormShape | null>;
|
|
67
110
|
export declare function findContactIdByEmail(apiKey: string, email: string): Promise<string | undefined>;
|
|
68
111
|
/**
|
|
69
112
|
* Submit a marketing form. Extra fields HubSpot doesn't know on that form
|
|
70
|
-
* 400 the whole request, so callers should filter first
|
|
71
|
-
*
|
|
113
|
+
* 400 the whole request, so callers should filter first. A GDPR block on the
|
|
114
|
+
* HubSpot form needs the matching legalConsentOptions (including
|
|
115
|
+
* communications); stripping consent to "retry" would 400 forever. Email-only
|
|
116
|
+
* retry is only used when HubSpot doesn't require other fields. CAPTCHA
|
|
117
|
+
* cannot be solved server-side.
|
|
72
118
|
*/
|
|
73
119
|
export declare function submitMarketingForm(input: FormSubmitInput): Promise<{
|
|
74
120
|
ok: boolean;
|
|
@@ -73,9 +73,18 @@ export interface RawHubspotForm {
|
|
|
73
73
|
type?: string;
|
|
74
74
|
value?: string;
|
|
75
75
|
};
|
|
76
|
+
captchaEnabled?: boolean;
|
|
76
77
|
};
|
|
77
78
|
legalConsentOptions?: {
|
|
78
79
|
type?: string;
|
|
80
|
+
consentToProcessText?: string;
|
|
81
|
+
communicationsCheckboxes?: {
|
|
82
|
+
required?: boolean;
|
|
83
|
+
label?: string;
|
|
84
|
+
text?: string;
|
|
85
|
+
subscriptionTypeId?: number | string;
|
|
86
|
+
communicationTypeId?: number | string;
|
|
87
|
+
}[];
|
|
79
88
|
} | null;
|
|
80
89
|
}
|
|
81
90
|
export declare function convertHubspotForm(raw: RawHubspotForm): ConvertedHubspotForm;
|
|
@@ -24,6 +24,7 @@ export interface StoredSettings {
|
|
|
24
24
|
submissionMode?: SubmissionMode;
|
|
25
25
|
writeExtraProperties?: boolean;
|
|
26
26
|
syncFieldsOnPublish?: boolean;
|
|
27
|
+
timelineNote?: boolean;
|
|
27
28
|
}
|
|
28
29
|
export interface HubspotPolicy {
|
|
29
30
|
/** How submissions reach HubSpot. `auto` uses Forms API when a GUID is set. */
|
|
@@ -32,6 +33,8 @@ export interface HubspotPolicy {
|
|
|
32
33
|
writeExtraProperties: boolean;
|
|
33
34
|
/** On publish, PATCH missing mapped contact fields onto the HubSpot form. */
|
|
34
35
|
syncFieldsOnPublish: boolean;
|
|
36
|
+
/** Recap note on the contact (page URL, subject, answers) after a successful sync. */
|
|
37
|
+
timelineNote: boolean;
|
|
35
38
|
}
|
|
36
39
|
export interface PublicSettings {
|
|
37
40
|
configured: boolean;
|
|
@@ -48,6 +51,7 @@ export interface PublicSettings {
|
|
|
48
51
|
submissionMode: SubmissionMode;
|
|
49
52
|
writeExtraProperties: boolean;
|
|
50
53
|
syncFieldsOnPublish: boolean;
|
|
54
|
+
timelineNote: boolean;
|
|
51
55
|
}
|
|
52
56
|
export interface HubspotAccount {
|
|
53
57
|
portalId: string;
|
|
@@ -62,6 +66,7 @@ interface FormsCfg {
|
|
|
62
66
|
submissionMode?: unknown;
|
|
63
67
|
writeExtraProperties?: unknown;
|
|
64
68
|
syncFieldsOnPublish?: unknown;
|
|
69
|
+
timelineNote?: unknown;
|
|
65
70
|
}
|
|
66
71
|
export declare function policyFrom(stored: StoredSettings, forms: FormsCfg): HubspotPolicy;
|
|
67
72
|
export declare function resolvePolicy(strapi: Core.Strapi): Promise<HubspotPolicy>;
|
|
@@ -80,6 +85,7 @@ export interface SettingsPatch {
|
|
|
80
85
|
submissionMode?: unknown;
|
|
81
86
|
writeExtraProperties?: unknown;
|
|
82
87
|
syncFieldsOnPublish?: unknown;
|
|
88
|
+
timelineNote?: unknown;
|
|
83
89
|
}
|
|
84
90
|
/** Merge a PATCH-like body into the store without dropping the saved key. */
|
|
85
91
|
export declare function patchStoredSettings(strapi: Core.Strapi, body: SettingsPatch): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "strapi-plugin-hubspot",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.5",
|
|
4
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",
|