@marvalt/madapter 1.0.14
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/LICENSE +28 -0
- package/README.md +422 -0
- package/dist/client/mautic-client.d.ts +88 -0
- package/dist/client/mautic-client.d.ts.map +1 -0
- package/dist/data/mautic-data-store.d.ts +84 -0
- package/dist/data/mautic-data-store.d.ts.map +1 -0
- package/dist/generators/mautic-generator.d.ts +48 -0
- package/dist/generators/mautic-generator.d.ts.map +1 -0
- package/dist/index.cjs +3199 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +770 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +3141 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/react/components/MauticForm.d.ts +31 -0
- package/dist/react/components/MauticForm.d.ts.map +1 -0
- package/dist/react/components/MauticTracking.d.ts +42 -0
- package/dist/react/components/MauticTracking.d.ts.map +1 -0
- package/dist/react/hooks/useMautic.d.ts +98 -0
- package/dist/react/hooks/useMautic.d.ts.map +1 -0
- package/dist/react/providers/MauticProvider.d.ts +42 -0
- package/dist/react/providers/MauticProvider.d.ts.map +1 -0
- package/dist/service/mautic-service.d.ts +40 -0
- package/dist/service/mautic-service.d.ts.map +1 -0
- package/dist/setupTests.d.ts +18 -0
- package/dist/setupTests.d.ts.map +1 -0
- package/dist/types/config.d.ts +46 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/mautic.d.ts +108 -0
- package/dist/types/mautic.d.ts.map +1 -0
- package/dist/types/static-data.d.ts +59 -0
- package/dist/types/static-data.d.ts.map +1 -0
- package/dist/utils/config.d.ts +54 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/validation.d.ts +58 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/package.json +90 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license GPL-3.0-or-later
|
|
3
|
+
*
|
|
4
|
+
* This file is part of the MarVAlt Open SDK.
|
|
5
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
15
|
+
* See the GNU General Public License for more details.
|
|
16
|
+
*/
|
|
17
|
+
export type AuthMode = 'cloudflare_proxy' | 'direct';
|
|
18
|
+
export interface MauticConfig {
|
|
19
|
+
authMode: AuthMode;
|
|
20
|
+
apiUrl?: string;
|
|
21
|
+
cloudflareWorkerUrl?: string;
|
|
22
|
+
appId?: string;
|
|
23
|
+
workerSecret?: string;
|
|
24
|
+
timeout?: number;
|
|
25
|
+
retries?: number;
|
|
26
|
+
}
|
|
27
|
+
export interface MauticGeneratorConfig {
|
|
28
|
+
authMode: AuthMode;
|
|
29
|
+
apiUrl?: string;
|
|
30
|
+
cloudflareWorkerUrl?: string;
|
|
31
|
+
appId?: string;
|
|
32
|
+
workerSecret?: string;
|
|
33
|
+
outputPath: string;
|
|
34
|
+
formIds?: number[];
|
|
35
|
+
includeInactive?: boolean;
|
|
36
|
+
timeout?: number;
|
|
37
|
+
retries?: number;
|
|
38
|
+
}
|
|
39
|
+
export interface MauticTrackingConfig {
|
|
40
|
+
enabled?: boolean;
|
|
41
|
+
mauticUrl?: string;
|
|
42
|
+
proxyUrl?: string;
|
|
43
|
+
appId?: string;
|
|
44
|
+
workerSecret?: string;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,MAAM,QAAQ,GAAG,kBAAkB,GAAG,QAAQ,CAAC;AAErD,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license GPL-3.0-or-later
|
|
3
|
+
*
|
|
4
|
+
* This file is part of the MarVAlt Open SDK.
|
|
5
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
15
|
+
* See the GNU General Public License for more details.
|
|
16
|
+
*/
|
|
17
|
+
export interface MauticContact {
|
|
18
|
+
id?: number;
|
|
19
|
+
email: string;
|
|
20
|
+
firstname?: string;
|
|
21
|
+
lastname?: string;
|
|
22
|
+
company?: string;
|
|
23
|
+
phone?: string;
|
|
24
|
+
tags?: string[];
|
|
25
|
+
customFields?: {
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface MauticFormSubmission {
|
|
30
|
+
formId: number;
|
|
31
|
+
fields: {
|
|
32
|
+
[fieldName: string]: unknown;
|
|
33
|
+
};
|
|
34
|
+
contact?: MauticContact;
|
|
35
|
+
formName?: string;
|
|
36
|
+
returnUrl?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface MauticFormField {
|
|
39
|
+
id: number;
|
|
40
|
+
label: string;
|
|
41
|
+
alias: string;
|
|
42
|
+
type: string;
|
|
43
|
+
isRequired: boolean;
|
|
44
|
+
validationMessage?: string;
|
|
45
|
+
defaultValue?: string;
|
|
46
|
+
properties?: {
|
|
47
|
+
placeholder?: string;
|
|
48
|
+
cssClass?: string;
|
|
49
|
+
validation?: string[];
|
|
50
|
+
options?: string[];
|
|
51
|
+
helpText?: string;
|
|
52
|
+
size?: string;
|
|
53
|
+
[key: string]: unknown;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export interface MauticFormAction {
|
|
57
|
+
id: number;
|
|
58
|
+
name: string;
|
|
59
|
+
type: 'email' | 'notification' | 'tag' | 'segment';
|
|
60
|
+
properties: {
|
|
61
|
+
email?: string;
|
|
62
|
+
subject?: string;
|
|
63
|
+
message?: string;
|
|
64
|
+
tags?: string[];
|
|
65
|
+
segmentId?: number;
|
|
66
|
+
[key: string]: unknown;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export interface MauticForm {
|
|
70
|
+
id: number;
|
|
71
|
+
name: string;
|
|
72
|
+
alias?: string;
|
|
73
|
+
description?: string;
|
|
74
|
+
fields: MauticFormField[];
|
|
75
|
+
actions: MauticFormAction[];
|
|
76
|
+
cssClass?: string;
|
|
77
|
+
submitAction?: string;
|
|
78
|
+
postAction?: string;
|
|
79
|
+
postActionProperty?: string;
|
|
80
|
+
formType?: string;
|
|
81
|
+
isPublished?: boolean;
|
|
82
|
+
}
|
|
83
|
+
export interface MauticFormConfig {
|
|
84
|
+
id: number;
|
|
85
|
+
name: string;
|
|
86
|
+
description?: string;
|
|
87
|
+
fields: MauticFormField[];
|
|
88
|
+
actions: MauticFormAction[];
|
|
89
|
+
cssClass?: string;
|
|
90
|
+
submitAction?: string;
|
|
91
|
+
postAction?: string;
|
|
92
|
+
postActionProperty?: string;
|
|
93
|
+
formType?: string;
|
|
94
|
+
isPublished?: boolean;
|
|
95
|
+
}
|
|
96
|
+
export interface MauticEvent {
|
|
97
|
+
eventName: string;
|
|
98
|
+
eventData?: Record<string, any>;
|
|
99
|
+
email?: string;
|
|
100
|
+
contactId?: number;
|
|
101
|
+
}
|
|
102
|
+
export interface MauticApiResponse<T = any> {
|
|
103
|
+
success: boolean;
|
|
104
|
+
data?: T;
|
|
105
|
+
error?: string;
|
|
106
|
+
message?: string;
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=mautic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mautic.d.ts","sourceRoot":"","sources":["../../src/types/mautic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,WAAW,aAAa;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CA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EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC,GAAG,GAAG;IACxC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license GPL-3.0-or-later
|
|
3
|
+
*
|
|
4
|
+
* This file is part of the MarVAlt Open SDK.
|
|
5
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
15
|
+
* See the GNU General Public License for more details.
|
|
16
|
+
*/
|
|
17
|
+
import { MauticForm } from './mautic';
|
|
18
|
+
export interface MauticStaticData {
|
|
19
|
+
generated_at: string;
|
|
20
|
+
total_forms: number;
|
|
21
|
+
forms: MauticForm[];
|
|
22
|
+
}
|
|
23
|
+
export interface MauticFormData {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
isPublished: boolean;
|
|
28
|
+
postAction?: string;
|
|
29
|
+
postActionProperty?: string;
|
|
30
|
+
formType?: string;
|
|
31
|
+
fields: Array<{
|
|
32
|
+
id: number;
|
|
33
|
+
label: string;
|
|
34
|
+
alias: string;
|
|
35
|
+
type: string;
|
|
36
|
+
isRequired: boolean;
|
|
37
|
+
validationMessage?: string;
|
|
38
|
+
defaultValue?: string;
|
|
39
|
+
properties?: {
|
|
40
|
+
placeholder?: string;
|
|
41
|
+
cssClass?: string;
|
|
42
|
+
validation?: string[];
|
|
43
|
+
options?: string[];
|
|
44
|
+
helpText?: string;
|
|
45
|
+
size?: string;
|
|
46
|
+
[key: string]: unknown;
|
|
47
|
+
};
|
|
48
|
+
}>;
|
|
49
|
+
actions: Array<{
|
|
50
|
+
id: number;
|
|
51
|
+
name: string;
|
|
52
|
+
type: string;
|
|
53
|
+
properties: Record<string, unknown>;
|
|
54
|
+
}>;
|
|
55
|
+
cssClass?: string;
|
|
56
|
+
submitAction?: string;
|
|
57
|
+
[key: string]: unknown;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=static-data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static-data.d.ts","sourceRoot":"","sources":["../../src/types/static-data.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,KAAK,CAAC;QACZ,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,OAAO,CAAC;QACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,UAAU,CAAC,EAAE;YACX,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;YAClB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;YACtB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;YACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;YAClB,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;SACxB,CAAC;KACH,CAAC,CAAC;IACH,OAAO,EAAE,KAAK,CAAC;QACb,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACrC,CAAC,CAAC;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license GPL-3.0-or-later
|
|
3
|
+
*
|
|
4
|
+
* This file is part of the MarVAlt Open SDK.
|
|
5
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
15
|
+
* See the GNU General Public License for more details.
|
|
16
|
+
*/
|
|
17
|
+
import { MauticConfig, AuthMode } from '../types/config';
|
|
18
|
+
/**
|
|
19
|
+
* Create Mautic configuration from environment variables
|
|
20
|
+
*/
|
|
21
|
+
export declare const createMauticConfig: (overrides?: Partial<MauticConfig>) => MauticConfig;
|
|
22
|
+
/**
|
|
23
|
+
* Validate Mautic configuration
|
|
24
|
+
*/
|
|
25
|
+
export declare const validateMauticConfig: (config: MauticConfig) => {
|
|
26
|
+
isValid: boolean;
|
|
27
|
+
errors: string[];
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Get default Mautic configuration
|
|
31
|
+
*/
|
|
32
|
+
export declare const getDefaultMauticConfig: () => MauticConfig;
|
|
33
|
+
/**
|
|
34
|
+
* Merge Mautic configurations
|
|
35
|
+
*/
|
|
36
|
+
export declare const mergeMauticConfig: (base: MauticConfig, overrides: Partial<MauticConfig>) => MauticConfig;
|
|
37
|
+
/**
|
|
38
|
+
* Check if Mautic is enabled based on configuration
|
|
39
|
+
*/
|
|
40
|
+
export declare const isMauticEnabled: (config: MauticConfig) => boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Get Mautic configuration summary (for debugging)
|
|
43
|
+
*/
|
|
44
|
+
export declare const getMauticConfigSummary: (config: MauticConfig) => {
|
|
45
|
+
authMode: AuthMode;
|
|
46
|
+
hasApiUrl: boolean;
|
|
47
|
+
hasCloudflareWorkerUrl: boolean;
|
|
48
|
+
hasAppId: boolean;
|
|
49
|
+
hasWorkerSecret: boolean;
|
|
50
|
+
timeout: number | undefined;
|
|
51
|
+
retries: number | undefined;
|
|
52
|
+
isEnabled: boolean;
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,YAAW,OAAO,CAAC,YAAY,CAAM,KAAG,YAkD1E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,QAAQ,YAAY,KAAG;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAmC/F,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,QAAO,YAMzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,MAAM,YAAY,EAAE,WAAW,OAAO,CAAC,YAAY,CAAC,KAAG,YAKxF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,YAAY,KAAG,OAOtD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,GAAI,QAAQ,YAAY;;;;;;;;;CAW1D,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license GPL-3.0-or-later
|
|
3
|
+
*
|
|
4
|
+
* This file is part of the MarVAlt Open SDK.
|
|
5
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
15
|
+
* See the GNU General Public License for more details.
|
|
16
|
+
*/
|
|
17
|
+
import { MauticFormField } from '../types/mautic';
|
|
18
|
+
/**
|
|
19
|
+
* Validate email address
|
|
20
|
+
*/
|
|
21
|
+
export declare const isValidEmail: (email: string) => boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Validate phone number (basic validation)
|
|
24
|
+
*/
|
|
25
|
+
export declare const isValidPhone: (phone: string) => boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Validate URL
|
|
28
|
+
*/
|
|
29
|
+
export declare const isValidUrl: (url: string) => boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Validate required field
|
|
32
|
+
*/
|
|
33
|
+
export declare const isRequiredFieldValid: (value: any) => boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Validate field based on its type and configuration
|
|
36
|
+
*/
|
|
37
|
+
export declare const validateField: (field: MauticFormField, value: any) => string | null;
|
|
38
|
+
/**
|
|
39
|
+
* Validate custom validation rule
|
|
40
|
+
*/
|
|
41
|
+
export declare const validateCustomRule: (rule: string, value: any, field: MauticFormField) => string | null;
|
|
42
|
+
/**
|
|
43
|
+
* Validate form data against form fields
|
|
44
|
+
*/
|
|
45
|
+
export declare const validateFormData: (fields: MauticFormField[], formData: Record<string, any>) => Record<string, string>;
|
|
46
|
+
/**
|
|
47
|
+
* Check if form data is valid
|
|
48
|
+
*/
|
|
49
|
+
export declare const isFormDataValid: (fields: MauticFormField[], formData: Record<string, any>) => boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Sanitize form data
|
|
52
|
+
*/
|
|
53
|
+
export declare const sanitizeFormData: (formData: Record<string, any>) => Record<string, any>;
|
|
54
|
+
/**
|
|
55
|
+
* Format form data for submission
|
|
56
|
+
*/
|
|
57
|
+
export declare const formatFormDataForSubmission: (formData: Record<string, any>) => Record<string, any>;
|
|
58
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/utils/validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,OAG5C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,OAG5C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,KAAG,OAOxC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,OAAO,GAAG,KAAG,OAMjD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,eAAe,EAAE,OAAO,GAAG,KAAG,MAAM,GAAG,IA6D3E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,EAAE,OAAO,GAAG,EAAE,OAAO,eAAe,KAAG,MAAM,GAAG,IAqC9F,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,eAAe,EAAE,EAAE,UAAU,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAWhH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,eAAe,EAAE,EAAE,UAAU,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAG,OAG1F,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,UAAU,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAkBlF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B,GAAI,UAAU,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAU7F,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@marvalt/madapter",
|
|
3
|
+
"version": "1.0.14",
|
|
4
|
+
"description": "MarVAlt adapter for Mautic integration (React + static data generator)",
|
|
5
|
+
"main": "dist/index.cjs",
|
|
6
|
+
"module": "dist/index.esm.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"README.md",
|
|
12
|
+
"LICENSE"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "rollup -c",
|
|
16
|
+
"dev": "rollup -c -w",
|
|
17
|
+
"test": "jest",
|
|
18
|
+
"test:watch": "jest --watch",
|
|
19
|
+
"test:coverage": "jest --coverage",
|
|
20
|
+
"lint": "eslint src --ext .ts,.tsx",
|
|
21
|
+
"lint:fix": "eslint src --ext .ts,.tsx --fix",
|
|
22
|
+
"type-check": "tsc --noEmit",
|
|
23
|
+
"clean": "rimraf dist",
|
|
24
|
+
"prepublishOnly": "npm run clean && npm run build"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"mautic",
|
|
28
|
+
"marketing-automation",
|
|
29
|
+
"react",
|
|
30
|
+
"static-data",
|
|
31
|
+
"forms",
|
|
32
|
+
"tracking",
|
|
33
|
+
"marvalt"
|
|
34
|
+
],
|
|
35
|
+
"author": "Vibune Pty Ltd",
|
|
36
|
+
"license": "GPL-3.0-or-later",
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "https://github.com/MarVAlt/madapter.git"
|
|
40
|
+
},
|
|
41
|
+
"bugs": {
|
|
42
|
+
"url": "https://github.com/MarVAlt/madapter/issues"
|
|
43
|
+
},
|
|
44
|
+
"homepage": "https://github.com/MarVAlt/madapter#readme",
|
|
45
|
+
"exports": {
|
|
46
|
+
".": {
|
|
47
|
+
"import": "./dist/index.esm.js",
|
|
48
|
+
"require": "./dist/index.cjs"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"react": ">=16.8.0",
|
|
53
|
+
"react-dom": ">=16.8.0",
|
|
54
|
+
"@tanstack/react-query": ">=4.0.0"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
58
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
59
|
+
"@rollup/plugin-typescript": "^11.1.5",
|
|
60
|
+
"@testing-library/jest-dom": "^6.1.4",
|
|
61
|
+
"@testing-library/react": "^14.1.2",
|
|
62
|
+
"@types/jest": "^29.5.8",
|
|
63
|
+
"@types/node": "^20.9.0",
|
|
64
|
+
"@types/react": "^18.2.37",
|
|
65
|
+
"@types/react-dom": "^18.2.15",
|
|
66
|
+
"@typescript-eslint/eslint-plugin": "^6.10.0",
|
|
67
|
+
"@typescript-eslint/parser": "^6.10.0",
|
|
68
|
+
"eslint": "^8.53.0",
|
|
69
|
+
"eslint-plugin-react": "^7.33.2",
|
|
70
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
71
|
+
"jest": "^29.7.0",
|
|
72
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
73
|
+
"react": "^18.2.0",
|
|
74
|
+
"react-dom": "^18.2.0",
|
|
75
|
+
"rimraf": "^5.0.5",
|
|
76
|
+
"rollup": "^4.6.1",
|
|
77
|
+
"rollup-plugin-dts": "^6.1.0",
|
|
78
|
+
"ts-jest": "^29.1.1",
|
|
79
|
+
"tslib": "^2.8.1",
|
|
80
|
+
"typescript": "^5.2.2"
|
|
81
|
+
},
|
|
82
|
+
"engines": {
|
|
83
|
+
"node": ">=16.0.0",
|
|
84
|
+
"npm": ">=8.0.0"
|
|
85
|
+
},
|
|
86
|
+
"publishConfig": {
|
|
87
|
+
"registry": "https://registry.npmjs.org/",
|
|
88
|
+
"access": "public"
|
|
89
|
+
}
|
|
90
|
+
}
|