@robinpath/cloudflare 0.1.0

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 ADDED
@@ -0,0 +1,123 @@
1
+ # @robinpath/cloudflare
2
+
3
+ > Cloudflare module for RobinPath.
4
+
5
+ ![Category](https://img.shields.io/badge/category-DevOps-blue) ![Functions](https://img.shields.io/badge/functions-29-green) ![Auth](https://img.shields.io/badge/auth-API%20Key-orange) ![License](https://img.shields.io/badge/license-MIT-brightgreen)
6
+
7
+ ## Why use this module?
8
+
9
+ The `cloudflare` module lets you:
10
+
11
+ - List Cloudflare zones
12
+ - Get details of a specific zone
13
+ - Create a new Cloudflare zone
14
+ - Delete a Cloudflare zone
15
+ - Purge cache for a zone (all or selective by URLs/tags/hosts/prefixes)
16
+
17
+ All functions are callable directly from RobinPath scripts with a simple, consistent API.
18
+
19
+ ## Installation
20
+
21
+ ```bash
22
+ npm install @robinpath/cloudflare
23
+ ```
24
+
25
+ ## Quick Start
26
+
27
+ **1. Set up credentials**
28
+
29
+ ```robinpath
30
+ cloudflare.setCredentials "user@example.com" "your-global-api-key"
31
+ ```
32
+
33
+ **2. List Cloudflare zones**
34
+
35
+ ```robinpath
36
+ cloudflare.listZones {"name": "example.com"}
37
+ ```
38
+
39
+ ## Available Functions
40
+
41
+ | Function | Description |
42
+ |----------|-------------|
43
+ | `cloudflare.setToken` | Set Cloudflare API token for authentication |
44
+ | `cloudflare.setCredentials` | Set Cloudflare global API key credentials |
45
+ | `cloudflare.listZones` | List Cloudflare zones |
46
+ | `cloudflare.getZone` | Get details of a specific zone |
47
+ | `cloudflare.createZone` | Create a new Cloudflare zone |
48
+ | `cloudflare.deleteZone` | Delete a Cloudflare zone |
49
+ | `cloudflare.purgeCache` | Purge cache for a zone (all or selective by URLs/tags/hosts/prefixes) |
50
+ | `cloudflare.listDnsRecords` | List DNS records for a zone |
51
+ | `cloudflare.getDnsRecord` | Get a specific DNS record |
52
+ | `cloudflare.createDnsRecord` | Create a DNS record in a zone |
53
+ | `cloudflare.updateDnsRecord` | Update an existing DNS record |
54
+ | `cloudflare.deleteDnsRecord` | Delete a DNS record from a zone |
55
+ | `cloudflare.listWorkers` | List Workers scripts for an account |
56
+ | `cloudflare.getWorkerScript` | Get the content of a Worker script |
57
+ | `cloudflare.deployWorker` | Deploy a Worker script |
58
+ | `cloudflare.deleteWorker` | Delete a Worker script |
59
+ | `cloudflare.listKvNamespaces` | List KV namespaces for an account |
60
+ | `cloudflare.createKvNamespace` | Create a KV namespace |
61
+ | `cloudflare.deleteKvNamespace` | Delete a KV namespace |
62
+ | `cloudflare.kvGet` | Read a value from KV storage |
63
+ | `cloudflare.kvPut` | Write a value to KV storage |
64
+ | `cloudflare.kvDelete` | Delete a key from KV storage |
65
+ | `cloudflare.kvListKeys` | List keys in a KV namespace |
66
+ | `cloudflare.listR2Buckets` | List R2 buckets for an account |
67
+ | `cloudflare.createR2Bucket` | Create an R2 bucket |
68
+ | `cloudflare.deleteR2Bucket` | Delete an R2 bucket |
69
+ | `cloudflare.listPages` | List Cloudflare Pages projects |
70
+ | `cloudflare.getPageProject` | Get details of a Cloudflare Pages project |
71
+ | `cloudflare.getZoneAnalytics` | Get analytics data for a zone |
72
+
73
+ ## Examples
74
+
75
+ ### List Cloudflare zones
76
+
77
+ ```robinpath
78
+ cloudflare.listZones {"name": "example.com"}
79
+ ```
80
+
81
+ ### Get details of a specific zone
82
+
83
+ ```robinpath
84
+ cloudflare.getZone "zone-id-here"
85
+ ```
86
+
87
+ ### Create a new Cloudflare zone
88
+
89
+ ```robinpath
90
+ cloudflare.createZone "example.com" {"accountId": "abc123"}
91
+ ```
92
+
93
+ ## Integration with RobinPath
94
+
95
+ ```typescript
96
+ import { RobinPath } from "@wiredwp/robinpath";
97
+ import Module from "@robinpath/cloudflare";
98
+
99
+ const rp = new RobinPath();
100
+ rp.registerModule(Module.name, Module.functions);
101
+ rp.registerModuleMeta(Module.name, Module.functionMetadata);
102
+
103
+ const result = await rp.executeScript(`
104
+ cloudflare.setCredentials "user@example.com" "your-global-api-key"
105
+ cloudflare.listZones {"name": "example.com"}
106
+ `);
107
+ ```
108
+
109
+ ## Full API Reference
110
+
111
+ See [MODULE.md](./MODULE.md) for complete documentation including all parameters, return types, error handling, and advanced examples.
112
+
113
+ ## Related Modules
114
+
115
+ - [`@robinpath/docker`](../docker) — Docker module for complementary functionality
116
+ - [`@robinpath/git`](../git) — Git module for complementary functionality
117
+ - [`@robinpath/github`](../github) — GitHub module for complementary functionality
118
+ - [`@robinpath/gitlab`](../gitlab) — GitLab module for complementary functionality
119
+ - [`@robinpath/vercel`](../vercel) — Vercel module for complementary functionality
120
+
121
+ ## License
122
+
123
+ MIT
@@ -0,0 +1,387 @@
1
+ import type { BuiltinHandler } from "@wiredwp/robinpath";
2
+ export declare const CloudflareFunctions: Record<string, BuiltinHandler>;
3
+ export declare const CloudflareFunctionMetadata: {
4
+ setToken: {
5
+ description: string;
6
+ parameters: {
7
+ name: string;
8
+ dataType: string;
9
+ description: string;
10
+ formInputType: string;
11
+ required: boolean;
12
+ }[];
13
+ returnType: string;
14
+ returnDescription: string;
15
+ example: string;
16
+ };
17
+ setCredentials: {
18
+ description: string;
19
+ parameters: {
20
+ name: string;
21
+ dataType: string;
22
+ description: string;
23
+ formInputType: string;
24
+ required: boolean;
25
+ }[];
26
+ returnType: string;
27
+ returnDescription: string;
28
+ example: string;
29
+ };
30
+ listZones: {
31
+ description: string;
32
+ parameters: {
33
+ name: string;
34
+ dataType: string;
35
+ description: string;
36
+ formInputType: string;
37
+ required: boolean;
38
+ }[];
39
+ returnType: string;
40
+ returnDescription: string;
41
+ example: string;
42
+ };
43
+ getZone: {
44
+ description: string;
45
+ parameters: {
46
+ name: string;
47
+ dataType: string;
48
+ description: string;
49
+ formInputType: string;
50
+ required: boolean;
51
+ }[];
52
+ returnType: string;
53
+ returnDescription: string;
54
+ example: string;
55
+ };
56
+ createZone: {
57
+ description: string;
58
+ parameters: {
59
+ name: string;
60
+ dataType: string;
61
+ description: string;
62
+ formInputType: string;
63
+ required: boolean;
64
+ }[];
65
+ returnType: string;
66
+ returnDescription: string;
67
+ example: string;
68
+ };
69
+ deleteZone: {
70
+ description: string;
71
+ parameters: {
72
+ name: string;
73
+ dataType: string;
74
+ description: string;
75
+ formInputType: string;
76
+ required: boolean;
77
+ }[];
78
+ returnType: string;
79
+ returnDescription: string;
80
+ example: string;
81
+ };
82
+ purgeCache: {
83
+ description: string;
84
+ parameters: {
85
+ name: string;
86
+ dataType: string;
87
+ description: string;
88
+ formInputType: string;
89
+ required: boolean;
90
+ }[];
91
+ returnType: string;
92
+ returnDescription: string;
93
+ example: string;
94
+ };
95
+ listDnsRecords: {
96
+ description: string;
97
+ parameters: {
98
+ name: string;
99
+ dataType: string;
100
+ description: string;
101
+ formInputType: string;
102
+ required: boolean;
103
+ }[];
104
+ returnType: string;
105
+ returnDescription: string;
106
+ example: string;
107
+ };
108
+ getDnsRecord: {
109
+ description: string;
110
+ parameters: {
111
+ name: string;
112
+ dataType: string;
113
+ description: string;
114
+ formInputType: string;
115
+ required: boolean;
116
+ }[];
117
+ returnType: string;
118
+ returnDescription: string;
119
+ example: string;
120
+ };
121
+ createDnsRecord: {
122
+ description: string;
123
+ parameters: {
124
+ name: string;
125
+ dataType: string;
126
+ description: string;
127
+ formInputType: string;
128
+ required: boolean;
129
+ }[];
130
+ returnType: string;
131
+ returnDescription: string;
132
+ example: string;
133
+ };
134
+ updateDnsRecord: {
135
+ description: string;
136
+ parameters: {
137
+ name: string;
138
+ dataType: string;
139
+ description: string;
140
+ formInputType: string;
141
+ required: boolean;
142
+ }[];
143
+ returnType: string;
144
+ returnDescription: string;
145
+ example: string;
146
+ };
147
+ deleteDnsRecord: {
148
+ description: string;
149
+ parameters: {
150
+ name: string;
151
+ dataType: string;
152
+ description: string;
153
+ formInputType: string;
154
+ required: boolean;
155
+ }[];
156
+ returnType: string;
157
+ returnDescription: string;
158
+ example: string;
159
+ };
160
+ listWorkers: {
161
+ description: string;
162
+ parameters: {
163
+ name: string;
164
+ dataType: string;
165
+ description: string;
166
+ formInputType: string;
167
+ required: boolean;
168
+ }[];
169
+ returnType: string;
170
+ returnDescription: string;
171
+ example: string;
172
+ };
173
+ getWorkerScript: {
174
+ description: string;
175
+ parameters: {
176
+ name: string;
177
+ dataType: string;
178
+ description: string;
179
+ formInputType: string;
180
+ required: boolean;
181
+ }[];
182
+ returnType: string;
183
+ returnDescription: string;
184
+ example: string;
185
+ };
186
+ deployWorker: {
187
+ description: string;
188
+ parameters: {
189
+ name: string;
190
+ dataType: string;
191
+ description: string;
192
+ formInputType: string;
193
+ required: boolean;
194
+ }[];
195
+ returnType: string;
196
+ returnDescription: string;
197
+ example: string;
198
+ };
199
+ deleteWorker: {
200
+ description: string;
201
+ parameters: {
202
+ name: string;
203
+ dataType: string;
204
+ description: string;
205
+ formInputType: string;
206
+ required: boolean;
207
+ }[];
208
+ returnType: string;
209
+ returnDescription: string;
210
+ example: string;
211
+ };
212
+ listKvNamespaces: {
213
+ description: string;
214
+ parameters: {
215
+ name: string;
216
+ dataType: string;
217
+ description: string;
218
+ formInputType: string;
219
+ required: boolean;
220
+ }[];
221
+ returnType: string;
222
+ returnDescription: string;
223
+ example: string;
224
+ };
225
+ createKvNamespace: {
226
+ description: string;
227
+ parameters: {
228
+ name: string;
229
+ dataType: string;
230
+ description: string;
231
+ formInputType: string;
232
+ required: boolean;
233
+ }[];
234
+ returnType: string;
235
+ returnDescription: string;
236
+ example: string;
237
+ };
238
+ deleteKvNamespace: {
239
+ description: string;
240
+ parameters: {
241
+ name: string;
242
+ dataType: string;
243
+ description: string;
244
+ formInputType: string;
245
+ required: boolean;
246
+ }[];
247
+ returnType: string;
248
+ returnDescription: string;
249
+ example: string;
250
+ };
251
+ kvGet: {
252
+ description: string;
253
+ parameters: {
254
+ name: string;
255
+ dataType: string;
256
+ description: string;
257
+ formInputType: string;
258
+ required: boolean;
259
+ }[];
260
+ returnType: string;
261
+ returnDescription: string;
262
+ example: string;
263
+ };
264
+ kvPut: {
265
+ description: string;
266
+ parameters: {
267
+ name: string;
268
+ dataType: string;
269
+ description: string;
270
+ formInputType: string;
271
+ required: boolean;
272
+ }[];
273
+ returnType: string;
274
+ returnDescription: string;
275
+ example: string;
276
+ };
277
+ kvDelete: {
278
+ description: string;
279
+ parameters: {
280
+ name: string;
281
+ dataType: string;
282
+ description: string;
283
+ formInputType: string;
284
+ required: boolean;
285
+ }[];
286
+ returnType: string;
287
+ returnDescription: string;
288
+ example: string;
289
+ };
290
+ kvListKeys: {
291
+ description: string;
292
+ parameters: {
293
+ name: string;
294
+ dataType: string;
295
+ description: string;
296
+ formInputType: string;
297
+ required: boolean;
298
+ }[];
299
+ returnType: string;
300
+ returnDescription: string;
301
+ example: string;
302
+ };
303
+ listR2Buckets: {
304
+ description: string;
305
+ parameters: {
306
+ name: string;
307
+ dataType: string;
308
+ description: string;
309
+ formInputType: string;
310
+ required: boolean;
311
+ }[];
312
+ returnType: string;
313
+ returnDescription: string;
314
+ example: string;
315
+ };
316
+ createR2Bucket: {
317
+ description: string;
318
+ parameters: {
319
+ name: string;
320
+ dataType: string;
321
+ description: string;
322
+ formInputType: string;
323
+ required: boolean;
324
+ }[];
325
+ returnType: string;
326
+ returnDescription: string;
327
+ example: string;
328
+ };
329
+ deleteR2Bucket: {
330
+ description: string;
331
+ parameters: {
332
+ name: string;
333
+ dataType: string;
334
+ description: string;
335
+ formInputType: string;
336
+ required: boolean;
337
+ }[];
338
+ returnType: string;
339
+ returnDescription: string;
340
+ example: string;
341
+ };
342
+ listPages: {
343
+ description: string;
344
+ parameters: {
345
+ name: string;
346
+ dataType: string;
347
+ description: string;
348
+ formInputType: string;
349
+ required: boolean;
350
+ }[];
351
+ returnType: string;
352
+ returnDescription: string;
353
+ example: string;
354
+ };
355
+ getPageProject: {
356
+ description: string;
357
+ parameters: {
358
+ name: string;
359
+ dataType: string;
360
+ description: string;
361
+ formInputType: string;
362
+ required: boolean;
363
+ }[];
364
+ returnType: string;
365
+ returnDescription: string;
366
+ example: string;
367
+ };
368
+ getZoneAnalytics: {
369
+ description: string;
370
+ parameters: {
371
+ name: string;
372
+ dataType: string;
373
+ description: string;
374
+ formInputType: string;
375
+ required: boolean;
376
+ }[];
377
+ returnType: string;
378
+ returnDescription: string;
379
+ example: string;
380
+ };
381
+ };
382
+ export declare const CloudflareModuleMetadata: {
383
+ description: string;
384
+ methods: string[];
385
+ category: string;
386
+ };
387
+ //# sourceMappingURL=cloudflare.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloudflare.d.ts","sourceRoot":"","sources":["../src/cloudflare.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAA2C,MAAM,oBAAoB,CAAC;AAsYlG,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CA8B9D,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2StC,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;CAIpC,CAAC"}