@marvalt/wadapter 1.1.12 → 2.0.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.
- package/README.md +67 -139
- package/dist/client/wordpress-client.d.ts.map +1 -1
- package/dist/generators/gravity-forms/gravity-forms-generator.d.ts +3 -3
- package/dist/generators/gravity-forms/gravity-forms-generator.d.ts.map +1 -1
- package/dist/generators/wordpress/wordpress-generator.d.ts.map +1 -1
- package/dist/gravity-forms/gravity-forms-client.d.ts.map +1 -1
- package/dist/index.d.ts +70 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +335 -32
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +346 -31
- package/dist/index.js.map +1 -1
- package/dist/static/gravity-forms-static.d.ts +28 -0
- package/dist/static/gravity-forms-static.d.ts.map +1 -0
- package/dist/static/wordpress-static.d.ts +33 -0
- package/dist/static/wordpress-static.d.ts.map +1 -0
- package/dist/types/gravity-forms.d.ts +1 -3
- package/dist/types/gravity-forms.d.ts.map +1 -1
- package/dist/types/wordpress.d.ts +3 -3
- package/dist/types/wordpress.d.ts.map +1 -1
- package/dist/utils/config.d.ts.map +1 -1
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -1,179 +1,107 @@
|
|
|
1
1
|
# marvalt-wadapter
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Static-first WordPress and Gravity Forms integration for React apps.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## What it provides
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- WordPress and Gravity Forms static-data generators (build-time)
|
|
8
|
+
- Static data loaders and selectors (runtime reads from JSON only)
|
|
9
|
+
- Gravity Forms submission client with two modes: `cloudflare_proxy` and `direct`
|
|
8
10
|
|
|
9
|
-
##
|
|
11
|
+
## Modes
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
- **React Hooks**: Custom hooks for WordPress data management
|
|
16
|
-
- **React Components**: Pre-built components for WordPress content display
|
|
13
|
+
- `cloudflare_proxy`:
|
|
14
|
+
- Frontend calls a Cloudflare Worker with `?endpoint=/wp-json/...`.
|
|
15
|
+
- Worker injects Cloudflare Access credentials from its environment and forwards requests.
|
|
16
|
+
- Gravity Forms submissions go to enhanced `gf-api/v1` endpoints via the worker.
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
- **Email Verification**: Handle email verification workflows
|
|
23
|
-
- **React Hooks**: Custom hooks for form handling and submission
|
|
24
|
-
- **React Components**: Pre-built form components with validation
|
|
18
|
+
- `direct`:
|
|
19
|
+
- Frontend calls your backend directly (not behind Zero Trust).
|
|
20
|
+
- WordPress uses `/wp-json/wp/v2/...`.
|
|
21
|
+
- Gravity Forms uses official REST API v2 for submissions.
|
|
25
22
|
|
|
26
|
-
|
|
27
|
-
- **WordPress Content**: Generate static data for posts, pages, media, etc.
|
|
28
|
-
- **Gravity Forms**: Generate form configurations, fields, notifications, confirmations
|
|
29
|
-
- **Form Protection**: Include Albert Bruckmann plugin behavior in static data
|
|
30
|
-
- **Validation**: Comprehensive data validation and error handling
|
|
31
|
-
|
|
32
|
-
## Installation
|
|
23
|
+
## Install
|
|
33
24
|
|
|
34
25
|
```bash
|
|
35
26
|
npm install @marvalt/wadapter
|
|
36
27
|
```
|
|
37
28
|
|
|
38
|
-
##
|
|
39
|
-
|
|
40
|
-
### WordPress Content
|
|
41
|
-
|
|
42
|
-
```typescript
|
|
43
|
-
import { useWordPress } from '@marvalt/wadapter';
|
|
44
|
-
|
|
45
|
-
function BlogPost({ postId }: { postId: number }) {
|
|
46
|
-
const { data: post, loading, error } = useWordPress('posts', postId);
|
|
47
|
-
|
|
48
|
-
if (loading) return <div>Loading...</div>;
|
|
49
|
-
if (error) return <div>Error: {error.message}</div>;
|
|
50
|
-
|
|
51
|
-
return (
|
|
52
|
-
<article>
|
|
53
|
-
<h1>{post.title.rendered}</h1>
|
|
54
|
-
<div dangerouslySetInnerHTML={{ __html: post.content.rendered }} />
|
|
55
|
-
</article>
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
### Gravity Forms
|
|
61
|
-
|
|
62
|
-
```typescript
|
|
63
|
-
import { useGravityForms } from '@marvalt/wadapter';
|
|
64
|
-
|
|
65
|
-
function ContactForm({ formId }: { formId: number }) {
|
|
66
|
-
const { submitForm, loading, result } = useGravityForms(formId);
|
|
67
|
-
|
|
68
|
-
const handleSubmit = async (formData: Record<string, any>) => {
|
|
69
|
-
await submitForm(formData);
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
return (
|
|
73
|
-
<form onSubmit={handleSubmit}>
|
|
74
|
-
{/* Form fields */}
|
|
75
|
-
<button type="submit" disabled={loading}>
|
|
76
|
-
{loading ? 'Submitting...' : 'Submit'}
|
|
77
|
-
</button>
|
|
78
|
-
{result && (
|
|
79
|
-
<div className={result.success ? 'success' : 'error'}>
|
|
80
|
-
{result.message}
|
|
81
|
-
</div>
|
|
82
|
-
)}
|
|
83
|
-
</form>
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
### Static Data Generation
|
|
89
|
-
|
|
90
|
-
```typescript
|
|
91
|
-
import { generateWordPressData, generateGravityFormsData } from '@marvalt/wadapter';
|
|
29
|
+
## Configure
|
|
92
30
|
|
|
93
|
-
|
|
94
|
-
await generateWordPressData({
|
|
95
|
-
apiUrl: 'https://your-wordpress-site.com',
|
|
96
|
-
endpoints: ['posts', 'pages', 'media'],
|
|
97
|
-
outputPath: './public/static-data.json'
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
// Generate Gravity Forms static data
|
|
101
|
-
await generateGravityFormsData({
|
|
102
|
-
apiUrl: 'https://your-wordpress-site.com',
|
|
103
|
-
outputPath: './public/gravity-forms.json'
|
|
104
|
-
});
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
## Configuration
|
|
108
|
-
|
|
109
|
-
### Environment Variables
|
|
31
|
+
Required environment variables:
|
|
110
32
|
|
|
111
33
|
```env
|
|
112
|
-
#
|
|
34
|
+
# Mode
|
|
35
|
+
VITE_AUTH_MODE=cloudflare_proxy|direct
|
|
36
|
+
|
|
37
|
+
# WordPress
|
|
113
38
|
VITE_WORDPRESS_API_URL=https://your-wordpress-site.com
|
|
114
|
-
|
|
115
|
-
|
|
39
|
+
VITE_CLOUDFLARE_WORKER_URL=https://your-worker.your-subdomain.workers.dev # when cloudflare_proxy
|
|
40
|
+
VITE_WP_API_USERNAME=your-username # when direct
|
|
41
|
+
VITE_WP_APP_PASSWORD=your-app-password # when direct
|
|
42
|
+
|
|
43
|
+
# Gravity Forms
|
|
44
|
+
VITE_GRAVITY_FORMS_API_URL=https://your-wordpress-site.com # base site URL
|
|
45
|
+
VITE_GRAVITY_FORMS_USERNAME=your-username # when direct
|
|
46
|
+
VITE_GRAVITY_FORMS_PASSWORD=your-app-password # when direct
|
|
47
|
+
|
|
48
|
+
# Optional worker headers (set at runtime by frontend; CF Access secrets live in the worker env)
|
|
49
|
+
VITE_APP_ID=your-app-id
|
|
50
|
+
VITE_WORKER_SECRET=your-shared-secret
|
|
51
|
+
```
|
|
116
52
|
|
|
117
|
-
|
|
118
|
-
VITE_GRAVITY_FORMS_API_URL=https://your-wordpress-site.com/wp-json/gf-api/v1
|
|
119
|
-
VITE_GRAVITY_FORMS_USERNAME=your-username
|
|
120
|
-
VITE_GRAVITY_FORMS_PASSWORD=your-app-password
|
|
53
|
+
## Build-time generation
|
|
121
54
|
|
|
122
|
-
|
|
123
|
-
VITE_FORM_PROTECTION_ENABLED=true
|
|
124
|
-
VITE_FORM_PROTECTION_SECRET=your-protection-secret
|
|
125
|
-
```
|
|
55
|
+
The generators fetch WordPress and Gravity Forms data and write static JSON:
|
|
126
56
|
|
|
127
|
-
|
|
57
|
+
- WordPress JSON: `public/wordpress-data.json`
|
|
58
|
+
- Gravity Forms JSON: `public/gravityForms.json`
|
|
128
59
|
|
|
129
|
-
|
|
60
|
+
You can wire them into npm scripts using your preferred runner. Example entry points are included in the docs.
|
|
130
61
|
|
|
131
|
-
|
|
132
|
-
- `useWordPressMedia(mediaId)` - Fetch WordPress media
|
|
133
|
-
- `useWordPressCategories()` - Fetch WordPress categories
|
|
134
|
-
- `useWordPressTags()` - Fetch WordPress tags
|
|
62
|
+
### Pages now include Gutenberg blocks
|
|
135
63
|
|
|
136
|
-
|
|
64
|
+
- Pages are fetched with `context=edit` so `content.raw` is available.
|
|
65
|
+
- We parse `content.raw` using `@wordpress/block-serialization-default-parser` and persist `pages[n].blocks`.
|
|
66
|
+
- Posts remain unchanged (HTML `content.rendered`).
|
|
137
67
|
|
|
138
|
-
|
|
139
|
-
- `useGravityFormsConfig(formId)` - Fetch form configuration
|
|
140
|
-
- `useGravityFormsFields(formId)` - Fetch form fields
|
|
68
|
+
Proxy mode note: the Cloudflare worker can inject Basic Auth for `context=edit` if `WP_BASIC_AUTH_USERNAME` and `WP_BASIC_AUTH_PASSWORD` are set.
|
|
141
69
|
|
|
142
|
-
|
|
70
|
+
## Runtime access (static-only)
|
|
143
71
|
|
|
144
|
-
-
|
|
145
|
-
- `
|
|
146
|
-
- `
|
|
72
|
+
- Loaders
|
|
73
|
+
- `loadWordPressData(path = '/wordpress-data.json')`
|
|
74
|
+
- `loadGravityFormsData(path = '/gravityForms.json')`
|
|
147
75
|
|
|
148
|
-
|
|
76
|
+
- Selectors
|
|
77
|
+
- WordPress: `getWordPressPosts`, `getWordPressPages`, `getWordPressMedia`, `getWordPressCategories`, `getWordPressTags`
|
|
78
|
+
- Gravity Forms: `getActiveForms`, `getPublishedForms`, `getFormById`
|
|
149
79
|
|
|
150
|
-
|
|
80
|
+
Note: These selectors read only from static JSON. They do not fetch live content at runtime.
|
|
151
81
|
|
|
152
|
-
|
|
153
|
-
- **Form Validation**: Enhanced form validation with protection rules
|
|
154
|
-
- **Spam Protection**: Built-in spam protection mechanisms
|
|
155
|
-
- **Rate Limiting**: Prevent form abuse with rate limiting
|
|
82
|
+
## Exports and types
|
|
156
83
|
|
|
157
|
-
|
|
84
|
+
- Generators
|
|
85
|
+
- `WordPressGenerator`, `generateWordPressData`
|
|
86
|
+
- `GravityFormsGenerator`, `generateGravityFormsData`
|
|
87
|
+
- Generator output type for GF: `GravityFormsStaticBundle`
|
|
158
88
|
|
|
159
|
-
|
|
89
|
+
- Static runtime selectors
|
|
90
|
+
- WordPress: `loadWordPressData`, `getWordPressPosts`, `getWordPressPages`, `getWordPressMedia`, `getWordPressCategories`, `getWordPressTags`
|
|
91
|
+
- Gravity Forms: `loadGravityFormsData`, `hasGravityFormsStatic`, `getActiveForms`, `getPublishedForms`, `getFormById`
|
|
160
92
|
|
|
161
|
-
|
|
162
|
-
Commercial orchestration, automation, and AI components are licensed separately via [marvalt.cloud](https://marvalt.cloud).
|
|
93
|
+
> Note: The generator bundle type was renamed to avoid conflicts with runtime static selectors.
|
|
163
94
|
|
|
95
|
+
## Form submissions
|
|
164
96
|
|
|
165
|
-
|
|
97
|
+
Use the package Gravity Forms client. It routes per mode:
|
|
166
98
|
|
|
167
|
-
|
|
99
|
+
- `cloudflare_proxy`: worker `?endpoint=/wp-json/gf-api/v1/...`
|
|
100
|
+
- `direct`: official Gravity Forms REST v2 endpoints
|
|
168
101
|
|
|
169
|
-
##
|
|
102
|
+
## License
|
|
170
103
|
|
|
171
|
-
|
|
172
|
-
- WordPress static data generation
|
|
173
|
-
- Gravity Forms integration
|
|
174
|
-
- Albert Bruckmann form protection integration
|
|
175
|
-
- React hooks and components
|
|
176
|
-
- Comprehensive TypeScript support
|
|
104
|
+
GPL-3.0-or-later.
|
|
177
105
|
|
|
178
106
|
|
|
179
107
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wordpress-client.d.ts","sourceRoot":"","sources":["../../src/client/wordpress-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;G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AAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAI5C,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAQ3E,kBAAkB,IAAI,OAAO,CAAC,GAAG,CAAC;IAIlC,UAAU,CAAC,MAAM,GAAE,oBAAyB,GAAG,OAAO,CAAC;QAC3D,KAAK,EAAE,aAAa,EAAE,CAAC;QACvB,KAAK,EAAE,aAAa,EAAE,CAAC;QACvB,KAAK,EAAE,cAAc,EAAE,CAAC;QACxB,UAAU,EAAE,iBAAiB,EAAE,CAAC;QAChC,IAAI,EAAE,YAAY,EAAE,CAAC;KACtB,CAAC;CAWH"}
|
|
@@ -20,7 +20,7 @@ export interface GravityFormsGeneratorConfig extends GravityFormsConfig {
|
|
|
20
20
|
formIds?: number[];
|
|
21
21
|
includeInactive?: boolean;
|
|
22
22
|
}
|
|
23
|
-
export interface
|
|
23
|
+
export interface GravityFormsStaticBundle {
|
|
24
24
|
generated_at: string;
|
|
25
25
|
total_forms: number;
|
|
26
26
|
forms: GravityForm[];
|
|
@@ -28,9 +28,9 @@ export interface GravityFormsStaticData {
|
|
|
28
28
|
export declare class GravityFormsGenerator {
|
|
29
29
|
private config;
|
|
30
30
|
constructor(config: GravityFormsGeneratorConfig);
|
|
31
|
-
generateStaticData(): Promise<
|
|
31
|
+
generateStaticData(): Promise<GravityFormsStaticBundle>;
|
|
32
32
|
private writeStaticData;
|
|
33
33
|
generateFormConfig(formId: number): Promise<GravityForm>;
|
|
34
34
|
}
|
|
35
|
-
export declare function generateGravityFormsData(config: GravityFormsGeneratorConfig): Promise<
|
|
35
|
+
export declare function generateGravityFormsData(config: GravityFormsGeneratorConfig): Promise<GravityFormsStaticBundle>;
|
|
36
36
|
//# sourceMappingURL=gravity-forms-generator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gravity-forms-generator.d.ts","sourceRoot":"","sources":["../../../src/generators/gravity-forms/gravity-forms-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAI5E,MAAM,WAAW,2BAA4B,SAAQ,kBAAkB;IACrE,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"gravity-forms-generator.d.ts","sourceRoot":"","sources":["../../../src/generators/gravity-forms/gravity-forms-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAI5E,MAAM,WAAW,2BAA4B,SAAQ,kBAAkB;IACrE,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,wBAAwB;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,WAAW,EAAE,CAAC;CACtB;AAED,qBAAa,qBAAqB;IAChC,OAAO,CAAC,MAAM,CAA8B;gBAEhC,MAAM,EAAE,2BAA2B;IAIzC,kBAAkB,IAAI,OAAO,CAAC,wBAAwB,CAAC;IAyE7D,OAAO,CAAC,eAAe;IAWjB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;CAI/D;AAGD,wBAAsB,wBAAwB,CAAC,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAGrH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wordpress-generator.d.ts","sourceRoot":"","sources":["../../../src/generators/wordpress/wordpress-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAmC,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"wordpress-generator.d.ts","sourceRoot":"","sources":["../../../src/generators/wordpress/wordpress-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAmC,MAAM,uBAAuB,CAAC;AAKvI,MAAM,WAAW,wBAAyB,SAAQ,eAAe;IAC/D,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE;QACN,WAAW,EAAE,MAAM,CAAC;QACpB,aAAa,EAAE,MAAM,CAAC;QACtB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE;YACzB,SAAS,EAAE,MAAM,CAAC;YAClB,gBAAgB,EAAE,OAAO,CAAC;YAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;YACjB,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;YACvB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;SACvB,CAAC,CAAC;KACJ,CAAC;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAA2B;gBAE7B,MAAM,EAAE,wBAAwB;IAItC,kBAAkB,IAAI,OAAO,CAAC,eAAe,CAAC;IA4DpD,OAAO,CAAC,eAAe;IAWjB,iBAAiB,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;IAK7C,iBAAiB,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;IAK7C,iBAAiB,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;CAIrD;AAGD,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,eAAe,CAAC,CAGtG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gravity-forms-client.d.ts","sourceRoot":"","sources":["../../src/gravity-forms/gravity-forms-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAE7H,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAAqB;gBAEvB,MAAM,EAAE,kBAAkB;YAIxB,WAAW;
|
|
1
|
+
{"version":3,"file":"gravity-forms-client.d.ts","sourceRoot":"","sources":["../../src/gravity-forms/gravity-forms-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAE7H,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAAqB;gBAEvB,MAAM,EAAE,kBAAkB;YAIxB,WAAW;IAiEzB,OAAO,CAAC,UAAU;IASZ,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAQzC,QAAQ,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAOlC,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAO/C,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,qBAAqB,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAUnG,SAAS,IAAI,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAA;KAAE,CAAC;CAM1F"}
|
package/dist/index.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ interface WordPressPost {
|
|
|
35
35
|
content: {
|
|
36
36
|
rendered: string;
|
|
37
37
|
protected: boolean;
|
|
38
|
+
raw?: string;
|
|
38
39
|
};
|
|
39
40
|
excerpt: {
|
|
40
41
|
rendered: string;
|
|
@@ -311,10 +312,8 @@ interface WordPressAuthor {
|
|
|
311
312
|
}
|
|
312
313
|
interface WordPressConfig {
|
|
313
314
|
apiUrl?: string;
|
|
314
|
-
authMode: 'direct' | 'cloudflare_proxy'
|
|
315
|
+
authMode: 'direct' | 'cloudflare_proxy';
|
|
315
316
|
cloudflareWorkerUrl?: string;
|
|
316
|
-
supabaseUrl?: string;
|
|
317
|
-
supabaseAnonKey?: string;
|
|
318
317
|
username?: string;
|
|
319
318
|
password?: string;
|
|
320
319
|
appId?: string;
|
|
@@ -348,6 +347,7 @@ interface WordPressQueryParams {
|
|
|
348
347
|
include?: number[];
|
|
349
348
|
offset?: number;
|
|
350
349
|
_embed?: boolean;
|
|
350
|
+
context?: 'view' | 'embed' | 'edit';
|
|
351
351
|
}
|
|
352
352
|
|
|
353
353
|
/**
|
|
@@ -558,10 +558,8 @@ interface GravityFormSubmissionResult {
|
|
|
558
558
|
}
|
|
559
559
|
interface GravityFormsConfig {
|
|
560
560
|
apiUrl?: string;
|
|
561
|
-
authMode: 'direct' | 'cloudflare_proxy'
|
|
561
|
+
authMode: 'direct' | 'cloudflare_proxy';
|
|
562
562
|
cloudflareWorkerUrl?: string;
|
|
563
|
-
supabaseUrl?: string;
|
|
564
|
-
supabaseAnonKey?: string;
|
|
565
563
|
username?: string;
|
|
566
564
|
password?: string;
|
|
567
565
|
appId?: string;
|
|
@@ -777,6 +775,67 @@ interface GravityFormsProviderProps {
|
|
|
777
775
|
declare const GravityFormsProvider: React.FC<GravityFormsProviderProps>;
|
|
778
776
|
declare function useGravityFormsContext(): GravityFormsContextType;
|
|
779
777
|
|
|
778
|
+
/**
|
|
779
|
+
* @license GPL-3.0-or-later
|
|
780
|
+
*
|
|
781
|
+
* This file is part of the MarVAlt Open SDK.
|
|
782
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
783
|
+
*
|
|
784
|
+
* This program is free software: you can redistribute it and/or modify
|
|
785
|
+
* it under the terms of the GNU General Public License as published by
|
|
786
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
787
|
+
* (at your option) any later version.
|
|
788
|
+
*
|
|
789
|
+
* This program is distributed in the hope that it will be useful,
|
|
790
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
791
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
792
|
+
* See the GNU General Public License for more details.
|
|
793
|
+
*/
|
|
794
|
+
|
|
795
|
+
interface WordPressStaticData {
|
|
796
|
+
generatedAt?: string;
|
|
797
|
+
posts: WordPressPost[];
|
|
798
|
+
pages: WordPressPage[];
|
|
799
|
+
media: WordPressMedia[];
|
|
800
|
+
categories: WordPressCategory[];
|
|
801
|
+
tags: WordPressTag[];
|
|
802
|
+
}
|
|
803
|
+
declare function loadWordPressData(path?: string): Promise<WordPressStaticData | null>;
|
|
804
|
+
declare function hasWordPressStatic(): boolean;
|
|
805
|
+
declare function getWordPressPosts(): WordPressPost[];
|
|
806
|
+
declare function getWordPressPages(): WordPressPage[];
|
|
807
|
+
declare function getWordPressMedia(): WordPressMedia[];
|
|
808
|
+
declare function getWordPressCategories(): WordPressCategory[];
|
|
809
|
+
declare function getWordPressTags(): WordPressTag[];
|
|
810
|
+
|
|
811
|
+
/**
|
|
812
|
+
* @license GPL-3.0-or-later
|
|
813
|
+
*
|
|
814
|
+
* This file is part of the MarVAlt Open SDK.
|
|
815
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
816
|
+
*
|
|
817
|
+
* This program is free software: you can redistribute it and/or modify
|
|
818
|
+
* it under the terms of the GNU General Public License as published by
|
|
819
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
820
|
+
* (at your option) any later version.
|
|
821
|
+
*
|
|
822
|
+
* This program is distributed in the hope that it will be useful,
|
|
823
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
824
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
825
|
+
* See the GNU General Public License for more details.
|
|
826
|
+
*/
|
|
827
|
+
|
|
828
|
+
interface GravityFormsStaticData {
|
|
829
|
+
generated_at?: string;
|
|
830
|
+
total_forms: number;
|
|
831
|
+
forms: GravityForm$1[];
|
|
832
|
+
}
|
|
833
|
+
declare function loadGravityFormsData(path?: string): Promise<GravityFormsStaticData | null>;
|
|
834
|
+
declare function hasGravityFormsStatic(): boolean;
|
|
835
|
+
declare function getActiveForms(): GravityForm$1[];
|
|
836
|
+
declare function getPublishedForms(): GravityForm$1[];
|
|
837
|
+
declare function getFormById(id: number | string): GravityForm$1 | undefined;
|
|
838
|
+
|
|
780
839
|
/**
|
|
781
840
|
* @license GPL-3.0-or-later
|
|
782
841
|
*
|
|
@@ -852,7 +911,7 @@ interface GravityFormsGeneratorConfig extends GravityFormsConfig {
|
|
|
852
911
|
formIds?: number[];
|
|
853
912
|
includeInactive?: boolean;
|
|
854
913
|
}
|
|
855
|
-
interface
|
|
914
|
+
interface GravityFormsStaticBundle {
|
|
856
915
|
generated_at: string;
|
|
857
916
|
total_forms: number;
|
|
858
917
|
forms: GravityForm$1[];
|
|
@@ -860,11 +919,11 @@ interface GravityFormsStaticData {
|
|
|
860
919
|
declare class GravityFormsGenerator {
|
|
861
920
|
private config;
|
|
862
921
|
constructor(config: GravityFormsGeneratorConfig);
|
|
863
|
-
generateStaticData(): Promise<
|
|
922
|
+
generateStaticData(): Promise<GravityFormsStaticBundle>;
|
|
864
923
|
private writeStaticData;
|
|
865
924
|
generateFormConfig(formId: number): Promise<GravityForm$1>;
|
|
866
925
|
}
|
|
867
|
-
declare function generateGravityFormsData(config: GravityFormsGeneratorConfig): Promise<
|
|
926
|
+
declare function generateGravityFormsData(config: GravityFormsGeneratorConfig): Promise<GravityFormsStaticBundle>;
|
|
868
927
|
|
|
869
928
|
/**
|
|
870
929
|
* @license GPL-3.0-or-later
|
|
@@ -1011,5 +1070,5 @@ declare function validateFormData(formData: Record<string, any>, rules: Record<s
|
|
|
1011
1070
|
errors: Record<string, string[]>;
|
|
1012
1071
|
};
|
|
1013
1072
|
|
|
1014
|
-
export { FormProtectionGenerator, GravityForm, GravityFormsClient, GravityFormsGenerator, GravityFormsProvider, WordPressClient, WordPressContent, WordPressGenerator, WordPressProvider, createFormProtectionConfig, createGravityFormsConfig, createWordPressConfig, generateFormProtectionData, generateGravityFormsData, generateWordPressData, sanitizeHtml, transformWordPressMedia, transformWordPressMediaItems, transformWordPressPage, transformWordPressPages, transformWordPressPost, transformWordPressPosts, useGravityForms, useGravityFormsConfig, useGravityFormsContext, useWordPress, useWordPressCategories, useWordPressContext, useWordPressMedia, useWordPressPage, useWordPressPages, useWordPressPost, useWordPressPosts, useWordPressTags, validateEmail, validateFormData, validateFormProtectionConfig, validateGravityFormsConfig, validateMaxLength, validateMinLength, validatePhoneNumber, validateRequired, validateUrl, validateWordPressConfig };
|
|
1015
|
-
export type { EmailVerificationData, FormProtectionConfig, FormProtectionGeneratorConfig, FormProtectionResult, FormProtectionStaticData, FormProtectionValidation, GravityFormConfirmation, GravityFormField, GravityFormNotification, GravityFormSubmission, GravityFormSubmissionResult, GravityFormsConfig, GravityFormsGeneratorConfig, GravityFormsStaticData, StaticDataStore, TransformedWordPressMedia, TransformedWordPressPage, TransformedWordPressPost, UseGravityFormsResult, UseWordPressResult, WordPressAuthor, WordPressCategory, WordPressConfig, WordPressGeneratorConfig, WordPressMedia, WordPressPage, WordPressPost, WordPressQueryParams, WordPressTag };
|
|
1073
|
+
export { FormProtectionGenerator, GravityForm, GravityFormsClient, GravityFormsGenerator, GravityFormsProvider, WordPressClient, WordPressContent, WordPressGenerator, WordPressProvider, createFormProtectionConfig, createGravityFormsConfig, createWordPressConfig, generateFormProtectionData, generateGravityFormsData, generateWordPressData, getActiveForms, getFormById, getPublishedForms, getWordPressCategories, getWordPressMedia, getWordPressPages, getWordPressPosts, getWordPressTags, hasGravityFormsStatic, hasWordPressStatic, loadGravityFormsData, loadWordPressData, sanitizeHtml, transformWordPressMedia, transformWordPressMediaItems, transformWordPressPage, transformWordPressPages, transformWordPressPost, transformWordPressPosts, useGravityForms, useGravityFormsConfig, useGravityFormsContext, useWordPress, useWordPressCategories, useWordPressContext, useWordPressMedia, useWordPressPage, useWordPressPages, useWordPressPost, useWordPressPosts, useWordPressTags, validateEmail, validateFormData, validateFormProtectionConfig, validateGravityFormsConfig, validateMaxLength, validateMinLength, validatePhoneNumber, validateRequired, validateUrl, validateWordPressConfig };
|
|
1074
|
+
export type { EmailVerificationData, FormProtectionConfig, FormProtectionGeneratorConfig, FormProtectionResult, FormProtectionStaticData, FormProtectionValidation, GravityFormConfirmation, GravityFormField, GravityFormNotification, GravityFormSubmission, GravityFormSubmissionResult, GravityFormsConfig, GravityFormsGeneratorConfig, GravityFormsStaticBundle, GravityFormsStaticData, StaticDataStore, TransformedWordPressMedia, TransformedWordPressPage, TransformedWordPressPost, UseGravityFormsResult, UseWordPressResult, WordPressAuthor, WordPressCategory, WordPressConfig, WordPressGeneratorConfig, WordPressMedia, WordPressPage, WordPressPost, WordPressQueryParams, WordPressStaticData, WordPressTag };
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,cAAc,2BAA2B,CAAC;AAC1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