@tool-bridge/server 0.21.1 → 0.22.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/dist/admin.js +170 -0
- package/dist/airtable-ML2GIGCH.js +790 -0
- package/dist/{alt_text_generator_ai-W7O34SNG.js → alt_text_generator_ai-FGYQAF2A.js} +12 -11
- package/dist/{amap-VOX4T2AW.js → amap-G7V65NGK.js} +221 -220
- package/dist/anthropic-6ZK24TBB.js +203 -0
- package/dist/apify-VDGYHP6W.js +248 -0
- package/dist/brave_search-TAATLZOS.js +302 -0
- package/dist/chunk-2IAI3XQM.js +302 -0
- package/dist/chunk-7ISGFRC6.js +161 -0
- package/dist/{chunk-E6JCVKW6.js → chunk-BNMLA2RC.js} +3 -3
- package/dist/chunk-HA4BGL6C.js +8429 -0
- package/dist/{chunk-KMTT3I6D.js → chunk-RMAWSG7E.js} +19172 -25717
- package/dist/{chunk-XYBU3WZH.js → chunk-RTW5VRTK.js} +3 -3
- package/dist/chunk-U7PTOA3U.js +7320 -0
- package/dist/chunk-UY6ANCOY.js +378 -0
- package/dist/{chunk-ATK45BXV.js → chunk-X7ZUTKHR.js} +4 -2
- package/dist/circleci-BQ2UWXL2.js +389 -0
- package/dist/clerk-2JYWQNOI.js +1019 -0
- package/dist/cohere-6MI7AQM4.js +185 -0
- package/dist/{confluence-B3EWPZVE.js → confluence-6Y6GDETF.js} +105 -104
- package/dist/{convertapi-EUWSQYPF.js → convertapi-HBZCSWOX.js} +32 -31
- package/dist/{currencyapi-KVTIK3GL.js → currencyapi-337U5TGI.js} +71 -71
- package/dist/deepseek-OSPASO7O.js +210 -0
- package/dist/docker_hub-3ATQOY5L.js +933 -0
- package/dist/dropbox-LSA4GM2Y.js +1305 -0
- package/dist/dub-VZPJSPI6.js +680 -0
- package/dist/e2b-6SDYQZL2.js +278 -0
- package/dist/exa-B6EUYDVP.js +332 -0
- package/dist/{fal_ai-23E7JPNT.js → fal_ai-K4Q27IME.js} +81 -80
- package/dist/{feishu-7QRIDUV6.js → feishu-4TKXG4SU.js} +528 -572
- package/dist/{feishu_custom_bot-TJ4K7QNJ.js → feishu_custom_bot-7CTEAKRB.js} +57 -53
- package/dist/figma-OUKSZLD5.js +777 -0
- package/dist/firehydrant-7MOYL7QH.js +563 -0
- package/dist/{fixer-BWON27UO.js → fixer-H2BV2NO4.js} +34 -33
- package/dist/fly-PXKY6PNH.js +469 -0
- package/dist/{front-QCGXYEDJ.js → front-UZYIV5DW.js} +104 -104
- package/dist/geocodio-NSYO7TFP.js +213 -0
- package/dist/ghost-QBKKQQMF.js +338 -0
- package/dist/github-ENLSJ4CL.js +5421 -0
- package/dist/gmail-KQSDEB47.js +1887 -0
- package/dist/googlecalendar-5YCX4SZF.js +2524 -0
- package/dist/{googledocs-BUHL4J2H.js → googledocs-SSWIVFKA.js} +341 -340
- package/dist/{grafana-GLU2DWF2.js → grafana-TF2LXDQA.js} +221 -220
- package/dist/graphhopper-CURBVHYK.js +325 -0
- package/dist/index.d.ts +1132 -332
- package/dist/index.js +31 -14
- package/dist/{ip2proxy-EZ64Y4ZH.js → ip2proxy-YNVMTZEM.js} +28 -27
- package/dist/ipgeolocation_io-NAU7VJ4J.js +315 -0
- package/dist/ipqualityscore-OT63L4TI.js +279 -0
- package/dist/{jina_ai-EFBHTBXL.js → jina_ai-6WBMBGWM.js} +23 -23
- package/dist/{jira-HQSHAA5K.js → jira-DVDVTHNO.js} +118 -117
- package/dist/langsmith-IM5N4YAU.js +593 -0
- package/dist/lemlist-277SHUQF.js +289 -0
- package/dist/{linear-K7RYFYAD.js → linear-AEPH7B5V.js} +327 -326
- package/dist/logsnag-VEWRAGBG.js +150 -0
- package/dist/main.js +57 -280
- package/dist/{mattermost-S2BRCWLQ.js → mattermost-Q3A2BIZA.js} +59 -58
- package/dist/mem0-AXS7GZGI.js +544 -0
- package/dist/memos-7TXG4ZTU.js +744 -0
- package/dist/{metabase-MMSEPCOF.js → metabase-NSVACWQM.js} +90 -89
- package/dist/mistral_ai-YZ52RGD4.js +1196 -0
- package/dist/{mother_duck-H7PCQNZ2.js → mother_duck-XLLL6FVL.js} +94 -93
- package/dist/ngrok-4O4W3WZW.js +356 -0
- package/dist/{notes-PFMKRO33.js → notes-YTB3TJOO.js} +11 -9
- package/dist/notion-4W4O7J7V.js +940 -0
- package/dist/open_exchange_rates-23QJXVO5.js +215 -0
- package/dist/openai-ZS7GLSLH.js +800 -0
- package/dist/opengraph_io-PMVH7OYI.js +362 -0
- package/dist/openrouter-ONRGFNB6.js +441 -0
- package/dist/outline-UCUYZZ7J.js +599 -0
- package/dist/paddle-35HTKTUL.js +454 -0
- package/dist/perplexity-NVOBYN24.js +220 -0
- package/dist/pinecone-55CJY73C.js +571 -0
- package/dist/{pipedrive-Y2O7QGFF.js → pipedrive-WMCAKS72.js} +99 -98
- package/dist/polar-SM4ZM53B.js +395 -0
- package/dist/posthog-NWCXVXNJ.js +3464 -0
- package/dist/postmark-QJV5PHUQ.js +427 -0
- package/dist/{prerender-MENYM2TY.js → prerender-2W7UT4SC.js} +31 -30
- package/dist/{pubmed-GOXUVVH5.js → pubmed-VVV7XYLU.js} +239 -238
- package/dist/{railway-V2SID4WV.js → railway-KGI57S3O.js} +118 -117
- package/dist/readwise-AGHTQB42.js +470 -0
- package/dist/render-O4HBROCK.js +461 -0
- package/dist/{replicate-756MXPYX.js → replicate-KWBOMX7D.js} +81 -80
- package/dist/{resend-ZKH3BTBI.js → resend-DRH6Y6I4.js} +20 -16
- package/dist/rootly-XGCUDW6X.js +336 -0
- package/dist/{scrapfly-NSRHFDIQ.js → scrapfly-OIQ3OY6L.js} +62 -61
- package/dist/{scrapingbee-OQHLAVEY.js → scrapingbee-OCZO4FHX.js} +56 -56
- package/dist/{screenshot_fyi-DVWG3AXC.js → screenshot_fyi-CUNGFZOC.js} +16 -16
- package/dist/semantic_scholar-3UJRLKES.js +611 -0
- package/dist/{sentry-546MNDJG.js → sentry-5BWVZFJV.js} +208 -207
- package/dist/{shodan-C3OON3Z3.js → shodan-HI37CTEW.js} +62 -61
- package/dist/shopify-LJ2EV2HH.js +610 -0
- package/dist/stripe-3LHMV55K.js +585 -0
- package/dist/{supabase-U2SL4D63.js → supabase-H2KPX3Q2.js} +245 -244
- package/dist/tavily-FBEWGH3Z.js +326 -0
- package/dist/telegram-MYYO3JND.js +1767 -0
- package/dist/{telnyx-CXQ4EZUX.js → telnyx-H4ALEGAX.js} +57 -56
- package/dist/todoist-OBWICA5Q.js +664 -0
- package/dist/trello-GUFUJRWO.js +1080 -0
- package/dist/turso-NIAK4UMS.js +416 -0
- package/dist/{twilio-4PDBJKWX.js → twilio-K6SLK2CX.js} +70 -69
- package/dist/umami-42RS2EPS.js +389 -0
- package/dist/unsplash-V7TOTETT.js +351 -0
- package/dist/{upstash_redis-G4LQBYHA.js → upstash_redis-AWQMB6Y3.js} +51 -50
- package/dist/uptimerobot-AZC2DHOT.js +483 -0
- package/dist/v2ex-4TVRNMLS.js +667 -0
- package/dist/vercel-DPHTJ3XR.js +1076 -0
- package/dist/{wolfram_alpha_api-3G4PUJWB.js → wolfram_alpha_api-XAG7IXBW.js} +36 -35
- package/dist/wordpress-KMPKVGUX.js +812 -0
- package/dist/workos-PKB2YR7S.js +664 -0
- package/dist/zhihu-Y4H4XYPB.js +254 -0
- package/package.json +18 -9
- package/dist/airtable-LLZDFN7M.js +0 -789
- package/dist/anthropic-G23NN3X5.js +0 -202
- package/dist/apify-Y3SS734K.js +0 -247
- package/dist/brave_search-ZC7OAPSZ.js +0 -301
- package/dist/chunk-R6P4XAE5.js +0 -248
- package/dist/chunk-U7B6DS2O.js +0 -977
- package/dist/chunk-UZM2RXZH.js +0 -23436
- package/dist/circleci-3BAX5FCG.js +0 -388
- package/dist/clerk-6LEM6TNU.js +0 -1019
- package/dist/cloudflare_dns-KINYTJUD.js +0 -588
- package/dist/cohere-XCJ5AJ6B.js +0 -185
- package/dist/deepseek-PC5YGNC5.js +0 -209
- package/dist/docker_hub-C3MA5FU6.js +0 -932
- package/dist/dropbox-XBV7Z2IR.js +0 -1304
- package/dist/dub-LDOFG3HC.js +0 -679
- package/dist/e2b-JMCPSVBW.js +0 -277
- package/dist/exa-RAK7O7RD.js +0 -331
- package/dist/figma-E6IX5DTH.js +0 -773
- package/dist/firehydrant-ZBLPQREE.js +0 -562
- package/dist/fly-ZH3HFCZJ.js +0 -468
- package/dist/geocodio-YGNI7DA4.js +0 -212
- package/dist/ghost-EVSGKH2Q.js +0 -337
- package/dist/github-MA2BGRCJ.js +0 -5420
- package/dist/gmail-E5E6AADE.js +0 -1886
- package/dist/googlecalendar-BTLFPXTD.js +0 -2523
- package/dist/graphhopper-WSMB3TCD.js +0 -324
- package/dist/ipgeolocation_io-AA7HAS22.js +0 -315
- package/dist/ipqualityscore-BHJXVTJT.js +0 -277
- package/dist/langsmith-5W6SCT6F.js +0 -592
- package/dist/lemlist-HJWH6UMK.js +0 -288
- package/dist/logsnag-4KFOHL37.js +0 -150
- package/dist/mem0-CAW43CIC.js +0 -543
- package/dist/memos-TWEGPKFM.js +0 -740
- package/dist/mistral_ai-64BGZQHP.js +0 -1195
- package/dist/ngrok-GQCUGZKJ.js +0 -356
- package/dist/notion-DQWZWP4N.js +0 -936
- package/dist/open_exchange_rates-QMMD735E.js +0 -214
- package/dist/openai-W6PX32NZ.js +0 -799
- package/dist/opengraph_io-HNDBXYNW.js +0 -361
- package/dist/openrouter-JJYMEAUL.js +0 -437
- package/dist/outline-MCBNQZYY.js +0 -595
- package/dist/paddle-D2SKLUDN.js +0 -453
- package/dist/perplexity-XIFMKUAE.js +0 -219
- package/dist/pinecone-HUFTALV2.js +0 -570
- package/dist/polar-TYTOMOSR.js +0 -394
- package/dist/posthog-43JAR3VW.js +0 -3463
- package/dist/postmark-KL2QJYSG.js +0 -426
- package/dist/readwise-CI4GIMMJ.js +0 -469
- package/dist/render-SUBJ6YRZ.js +0 -460
- package/dist/rootly-CD2LJHPI.js +0 -336
- package/dist/semantic_scholar-T4A252KW.js +0 -610
- package/dist/shopify-Y2HN2MCQ.js +0 -609
- package/dist/stripe-VE3CD3AY.js +0 -584
- package/dist/tavily-KCZHK6HE.js +0 -326
- package/dist/telegram-3URFBCMY.js +0 -1766
- package/dist/todoist-HNPWNYTD.js +0 -663
- package/dist/trello-3W2MIXRP.js +0 -1079
- package/dist/turso-2EQF7C2Z.js +0 -415
- package/dist/umami-5REN7TGP.js +0 -388
- package/dist/unsplash-EIXL424F.js +0 -350
- package/dist/uptimerobot-KNJ3EYLY.js +0 -482
- package/dist/v2ex-RHJ234PZ.js +0 -666
- package/dist/vercel-AS6NCIC7.js +0 -1075
- package/dist/wordpress-KNDAAUV7.js +0 -811
- package/dist/workos-R6UITSJ7.js +0 -663
- package/dist/zhihu-AGK4HILK.js +0 -253
|
@@ -1,588 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createAuthedClient
|
|
3
|
-
} from "./chunk-XYBU3WZH.js";
|
|
4
|
-
import "./chunk-E6JCVKW6.js";
|
|
5
|
-
import {
|
|
6
|
-
asJsonObject,
|
|
7
|
-
booleanValue,
|
|
8
|
-
compactDefined,
|
|
9
|
-
integerValue,
|
|
10
|
-
trimmedText
|
|
11
|
-
} from "./chunk-JXHMDBAY.js";
|
|
12
|
-
import {
|
|
13
|
-
createProviderPlugin,
|
|
14
|
-
upstreamError
|
|
15
|
-
} from "./chunk-ATK45BXV.js";
|
|
16
|
-
import "./chunk-U7B6DS2O.js";
|
|
17
|
-
import {
|
|
18
|
-
TBError,
|
|
19
|
-
external_exports
|
|
20
|
-
} from "./chunk-UZM2RXZH.js";
|
|
21
|
-
import "./chunk-U67V476Y.js";
|
|
22
|
-
|
|
23
|
-
// ../plugins/src/cloudflare_dns/api.ts
|
|
24
|
-
var SERVICE = "cloudflare_dns";
|
|
25
|
-
var API_BASE = "https://api.cloudflare.com/client/v4";
|
|
26
|
-
var DEFAULT_ACCOUNTS_PAGE = 1;
|
|
27
|
-
var DEFAULT_ACCOUNTS_PER_PAGE = 50;
|
|
28
|
-
function rawText(value) {
|
|
29
|
-
return typeof value === "string" ? value : void 0;
|
|
30
|
-
}
|
|
31
|
-
function nullableText(value) {
|
|
32
|
-
return value === null ? null : trimmedText(value);
|
|
33
|
-
}
|
|
34
|
-
function textArray(value) {
|
|
35
|
-
if (!Array.isArray(value)) return void 0;
|
|
36
|
-
return value.filter((item) => typeof item === "string");
|
|
37
|
-
}
|
|
38
|
-
function requireRecord(value, label) {
|
|
39
|
-
const result = asJsonObject(value);
|
|
40
|
-
if (result === void 0) throw new TBError("unavailable", `${label}\u4E0D\u662F\u5BF9\u8C61`, { retryable: true });
|
|
41
|
-
return result;
|
|
42
|
-
}
|
|
43
|
-
function requireArray(value, label) {
|
|
44
|
-
if (!Array.isArray(value)) throw new TBError("unavailable", `${label}\u4E0D\u662F\u6570\u7EC4`, { retryable: true });
|
|
45
|
-
return value;
|
|
46
|
-
}
|
|
47
|
-
function requireText(source, field, label) {
|
|
48
|
-
const value = trimmedText(source[field]);
|
|
49
|
-
if (value === void 0) {
|
|
50
|
-
throw new TBError("unavailable", `${label}\u7F3A\u5C11 ${field}`, { retryable: true });
|
|
51
|
-
}
|
|
52
|
-
return value;
|
|
53
|
-
}
|
|
54
|
-
function errorMessage(envelope, status) {
|
|
55
|
-
for (const source of [envelope.errors, envelope.messages]) {
|
|
56
|
-
for (const entry of Array.isArray(source) ? source : []) {
|
|
57
|
-
const message = trimmedText(asJsonObject(entry)?.message);
|
|
58
|
-
if (message !== void 0) return message;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return `Cloudflare \u8FD4\u56DE HTTP ${status}`;
|
|
62
|
-
}
|
|
63
|
-
var http = createAuthedClient({
|
|
64
|
-
baseUrl: `${API_BASE}/`,
|
|
65
|
-
service: SERVICE,
|
|
66
|
-
auth: { kind: "bearer" },
|
|
67
|
-
headers: { accept: "application/json" },
|
|
68
|
-
mapError: ({ bodyKind, data, status }) => {
|
|
69
|
-
if (bodyKind === "json" && asJsonObject(data) === void 0) {
|
|
70
|
-
return new TBError("unavailable", "Cloudflare \u54CD\u5E94\u4E0D\u662F\u5BF9\u8C61", { retryable: true });
|
|
71
|
-
}
|
|
72
|
-
const envelope = bodyKind === "json" ? data : {};
|
|
73
|
-
return upstreamError(status, errorMessage(envelope, status));
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
async function request(ctx, input) {
|
|
77
|
-
const hasBody = input.body !== void 0;
|
|
78
|
-
const result = await http.request(ctx, {
|
|
79
|
-
path: input.path,
|
|
80
|
-
method: input.method ?? "GET",
|
|
81
|
-
// 上游 `queryParams`:undefined / null / 空串一律不发。
|
|
82
|
-
query: Object.entries(input.query ?? {}).filter(([, value]) => value !== void 0 && value !== ""),
|
|
83
|
-
...hasBody ? { json: input.body } : {},
|
|
84
|
-
invalidJsonMessage: "Cloudflare \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94"
|
|
85
|
-
});
|
|
86
|
-
const envelope = result.data === void 0 ? {} : requireRecord(result.data, "Cloudflare \u54CD\u5E94");
|
|
87
|
-
if (envelope.success === false) {
|
|
88
|
-
throw upstreamError(result.status, errorMessage(envelope, result.status));
|
|
89
|
-
}
|
|
90
|
-
return envelope;
|
|
91
|
-
}
|
|
92
|
-
function normalizeAccount(value) {
|
|
93
|
-
const account = requireRecord(value, "Cloudflare \u8D26\u6237");
|
|
94
|
-
return compactDefined({
|
|
95
|
-
id: requireText(account, "id", "Cloudflare \u8D26\u6237"),
|
|
96
|
-
name: trimmedText(account.name),
|
|
97
|
-
type: trimmedText(account.type)
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
function normalizeZoneAccount(value) {
|
|
101
|
-
const account = asJsonObject(value);
|
|
102
|
-
if (account === void 0) return void 0;
|
|
103
|
-
return compactDefined({
|
|
104
|
-
id: trimmedText(account.id),
|
|
105
|
-
name: trimmedText(account.name),
|
|
106
|
-
type: trimmedText(account.type)
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
function normalizeZone(value) {
|
|
110
|
-
const zone = requireRecord(value, "Cloudflare zone");
|
|
111
|
-
return compactDefined({
|
|
112
|
-
id: requireText(zone, "id", "Cloudflare zone"),
|
|
113
|
-
name: requireText(zone, "name", "Cloudflare zone"),
|
|
114
|
-
status: trimmedText(zone.status),
|
|
115
|
-
type: trimmedText(zone.type),
|
|
116
|
-
paused: booleanValue(zone.paused),
|
|
117
|
-
createdOn: trimmedText(zone.created_on),
|
|
118
|
-
modifiedOn: trimmedText(zone.modified_on),
|
|
119
|
-
nameServers: textArray(zone.name_servers),
|
|
120
|
-
originalNameServers: textArray(zone.original_name_servers),
|
|
121
|
-
account: normalizeZoneAccount(zone.account),
|
|
122
|
-
meta: asJsonObject(zone.meta)
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
function normalizeDnsRecord(value) {
|
|
126
|
-
const dns = requireRecord(value, "Cloudflare DNS \u8BB0\u5F55");
|
|
127
|
-
return compactDefined({
|
|
128
|
-
id: requireText(dns, "id", "Cloudflare DNS \u8BB0\u5F55"),
|
|
129
|
-
zoneId: trimmedText(dns.zone_id),
|
|
130
|
-
zoneName: trimmedText(dns.zone_name),
|
|
131
|
-
type: requireText(dns, "type", "Cloudflare DNS \u8BB0\u5F55"),
|
|
132
|
-
name: requireText(dns, "name", "Cloudflare DNS \u8BB0\u5F55"),
|
|
133
|
-
content: nullableText(dns.content),
|
|
134
|
-
ttl: integerValue(dns.ttl),
|
|
135
|
-
proxied: booleanValue(dns.proxied),
|
|
136
|
-
proxiable: booleanValue(dns.proxiable),
|
|
137
|
-
priority: integerValue(dns.priority),
|
|
138
|
-
comment: nullableText(dns.comment),
|
|
139
|
-
tags: textArray(dns.tags),
|
|
140
|
-
createdOn: trimmedText(dns.created_on),
|
|
141
|
-
modifiedOn: trimmedText(dns.modified_on),
|
|
142
|
-
commentModifiedOn: trimmedText(dns.comment_modified_on),
|
|
143
|
-
tagsModifiedOn: trimmedText(dns.tags_modified_on),
|
|
144
|
-
data: asJsonObject(dns.data),
|
|
145
|
-
meta: asJsonObject(dns.meta),
|
|
146
|
-
settings: asJsonObject(dns.settings)
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
function normalizeResultInfo(value) {
|
|
150
|
-
const info = asJsonObject(value);
|
|
151
|
-
if (info === void 0) return void 0;
|
|
152
|
-
return compactDefined({
|
|
153
|
-
page: integerValue(info.page),
|
|
154
|
-
perPage: integerValue(info.per_page),
|
|
155
|
-
count: integerValue(info.count),
|
|
156
|
-
totalCount: integerValue(info.total_count),
|
|
157
|
-
totalPages: integerValue(info.total_pages)
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
function mutationBody(input) {
|
|
161
|
-
return compactDefined({
|
|
162
|
-
type: trimmedText(input.type),
|
|
163
|
-
name: trimmedText(input.name),
|
|
164
|
-
// content / comment 原样发:清空一个字段靠的就是发空串,trim 掉就没法表达"清空"。
|
|
165
|
-
content: rawText(input.content),
|
|
166
|
-
data: asJsonObject(input.data),
|
|
167
|
-
ttl: integerValue(input.ttl),
|
|
168
|
-
proxied: booleanValue(input.proxied),
|
|
169
|
-
priority: integerValue(input.priority),
|
|
170
|
-
comment: rawText(input.comment),
|
|
171
|
-
tags: input.tags,
|
|
172
|
-
settings: asJsonObject(input.settings)
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
async function listAccounts(input, ctx) {
|
|
176
|
-
const envelope = await request(ctx, {
|
|
177
|
-
path: "/accounts",
|
|
178
|
-
// 这两个参数上游总是发(带缺省值),不是"没给就不发"。
|
|
179
|
-
query: {
|
|
180
|
-
page: input.page ?? DEFAULT_ACCOUNTS_PAGE,
|
|
181
|
-
per_page: input.perPage ?? DEFAULT_ACCOUNTS_PER_PAGE
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
return compactDefined({
|
|
185
|
-
accounts: requireArray(envelope.result, "Cloudflare \u8D26\u6237\u5217\u8868").map((item) => normalizeAccount(item)),
|
|
186
|
-
resultInfo: normalizeResultInfo(envelope.result_info)
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
async function listZones(input, ctx) {
|
|
190
|
-
const envelope = await request(ctx, {
|
|
191
|
-
path: "/zones",
|
|
192
|
-
query: {
|
|
193
|
-
"page": input.page,
|
|
194
|
-
"per_page": input.perPage,
|
|
195
|
-
"name": trimmedText(input.name),
|
|
196
|
-
"status": trimmedText(input.status),
|
|
197
|
-
// 上游的过滤键就叫 `account.id`,带点,不是笔误。
|
|
198
|
-
"account.id": trimmedText(input.accountId),
|
|
199
|
-
"match": input.match,
|
|
200
|
-
"order": trimmedText(input.order),
|
|
201
|
-
"direction": input.direction
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
return compactDefined({
|
|
205
|
-
zones: requireArray(envelope.result, "Cloudflare zone \u5217\u8868").map((item) => normalizeZone(item)),
|
|
206
|
-
resultInfo: normalizeResultInfo(envelope.result_info)
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
async function getZone(input, ctx) {
|
|
210
|
-
const envelope = await request(ctx, { path: `/zones/${encodeURIComponent(input.zoneId)}` });
|
|
211
|
-
return { zone: normalizeZone(envelope.result) };
|
|
212
|
-
}
|
|
213
|
-
async function listDnsRecords(input, ctx) {
|
|
214
|
-
const envelope = await request(ctx, {
|
|
215
|
-
path: `/zones/${encodeURIComponent(input.zoneId)}/dns_records`,
|
|
216
|
-
query: {
|
|
217
|
-
page: input.page,
|
|
218
|
-
per_page: input.perPage,
|
|
219
|
-
type: input.type,
|
|
220
|
-
name: trimmedText(input.name),
|
|
221
|
-
content: trimmedText(input.content),
|
|
222
|
-
proxied: input.proxied,
|
|
223
|
-
match: input.match,
|
|
224
|
-
order: trimmedText(input.order),
|
|
225
|
-
direction: input.direction
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
return compactDefined({
|
|
229
|
-
records: requireArray(envelope.result, "Cloudflare DNS \u8BB0\u5F55\u5217\u8868").map((item) => normalizeDnsRecord(item)),
|
|
230
|
-
resultInfo: normalizeResultInfo(envelope.result_info)
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
async function getDnsRecord(input, ctx) {
|
|
234
|
-
const envelope = await request(ctx, {
|
|
235
|
-
path: `/zones/${encodeURIComponent(input.zoneId)}/dns_records/${encodeURIComponent(input.dnsRecordId)}`
|
|
236
|
-
});
|
|
237
|
-
return { record: normalizeDnsRecord(envelope.result) };
|
|
238
|
-
}
|
|
239
|
-
async function createDnsRecord(input, ctx) {
|
|
240
|
-
const envelope = await request(ctx, {
|
|
241
|
-
method: "POST",
|
|
242
|
-
path: `/zones/${encodeURIComponent(input.zoneId)}/dns_records`,
|
|
243
|
-
body: mutationBody(input)
|
|
244
|
-
});
|
|
245
|
-
return { record: normalizeDnsRecord(envelope.result) };
|
|
246
|
-
}
|
|
247
|
-
async function updateDnsRecord(input, ctx) {
|
|
248
|
-
const envelope = await request(ctx, {
|
|
249
|
-
method: "PATCH",
|
|
250
|
-
path: `/zones/${encodeURIComponent(input.zoneId)}/dns_records/${encodeURIComponent(input.dnsRecordId)}`,
|
|
251
|
-
body: mutationBody(input)
|
|
252
|
-
});
|
|
253
|
-
return { record: normalizeDnsRecord(envelope.result) };
|
|
254
|
-
}
|
|
255
|
-
async function deleteDnsRecord(input, ctx) {
|
|
256
|
-
await request(ctx, {
|
|
257
|
-
method: "DELETE",
|
|
258
|
-
path: `/zones/${encodeURIComponent(input.zoneId)}/dns_records/${encodeURIComponent(input.dnsRecordId)}`
|
|
259
|
-
});
|
|
260
|
-
return { id: input.dnsRecordId, deleted: true };
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
// ../plugins/src/cloudflare_dns/schema.handwritten.ts
|
|
264
|
-
var dnsRecordType = external_exports.enum([
|
|
265
|
-
"A",
|
|
266
|
-
"AAAA",
|
|
267
|
-
"CAA",
|
|
268
|
-
"CERT",
|
|
269
|
-
"CNAME",
|
|
270
|
-
"DNSKEY",
|
|
271
|
-
"DS",
|
|
272
|
-
"HTTPS",
|
|
273
|
-
"LOC",
|
|
274
|
-
"MX",
|
|
275
|
-
"NAPTR",
|
|
276
|
-
"NS",
|
|
277
|
-
"OPENPGPKEY",
|
|
278
|
-
"PTR",
|
|
279
|
-
"SMIMEA",
|
|
280
|
-
"SRV",
|
|
281
|
-
"SSHFP",
|
|
282
|
-
"SVCB",
|
|
283
|
-
"TLSA",
|
|
284
|
-
"TXT",
|
|
285
|
-
"URI"
|
|
286
|
-
]).describe("The DNS record type.");
|
|
287
|
-
var mutationFields = {
|
|
288
|
-
type: dnsRecordType,
|
|
289
|
-
name: external_exports.string().min(1).describe("The DNS record name."),
|
|
290
|
-
content: external_exports.string().describe("The DNS record content."),
|
|
291
|
-
data: external_exports.looseObject({}).describe("A free-form object accepted by the Cloudflare API."),
|
|
292
|
-
ttl: external_exports.int().min(1).describe("The DNS TTL in seconds. Use 1 for automatic TTL."),
|
|
293
|
-
proxied: external_exports.boolean().describe("Whether Cloudflare proxying should be enabled."),
|
|
294
|
-
priority: external_exports.int().describe("The DNS record priority."),
|
|
295
|
-
comment: external_exports.string().describe("The DNS record comment."),
|
|
296
|
-
tags: external_exports.array(external_exports.string().min(1)).describe("The DNS record tags."),
|
|
297
|
-
settings: external_exports.looseObject({}).describe("A free-form object accepted by the Cloudflare API.")
|
|
298
|
-
};
|
|
299
|
-
var dnsRecord = external_exports.strictObject({
|
|
300
|
-
id: external_exports.string().describe("The DNS record ID."),
|
|
301
|
-
zoneId: external_exports.string().describe("The parent zone ID.").optional(),
|
|
302
|
-
zoneName: external_exports.string().describe("The parent zone name.").optional(),
|
|
303
|
-
type: external_exports.string().describe("The DNS record type."),
|
|
304
|
-
name: external_exports.string().describe("The record name."),
|
|
305
|
-
content: external_exports.string().describe("The record content.").nullable().optional(),
|
|
306
|
-
ttl: external_exports.int().describe("The DNS TTL in seconds.").optional(),
|
|
307
|
-
proxied: external_exports.boolean().describe("Whether Cloudflare proxying is enabled.").optional(),
|
|
308
|
-
proxiable: external_exports.boolean().describe("Whether the record can be proxied.").optional(),
|
|
309
|
-
priority: external_exports.int().describe("The record priority.").optional(),
|
|
310
|
-
comment: external_exports.string().describe("The record comment.").nullable().optional(),
|
|
311
|
-
tags: external_exports.array(external_exports.string().min(1)).describe("The record tags.").optional(),
|
|
312
|
-
createdOn: external_exports.string().describe("The record creation timestamp.").optional(),
|
|
313
|
-
modifiedOn: external_exports.string().describe("The last record update timestamp.").optional(),
|
|
314
|
-
commentModifiedOn: external_exports.string().describe("The comment update timestamp.").optional(),
|
|
315
|
-
tagsModifiedOn: external_exports.string().describe("The tag update timestamp.").optional(),
|
|
316
|
-
data: external_exports.looseObject({}).describe("A free-form object accepted by the Cloudflare API.").optional(),
|
|
317
|
-
meta: external_exports.looseObject({}).describe("A free-form object accepted by the Cloudflare API.").optional(),
|
|
318
|
-
settings: external_exports.looseObject({}).describe("A free-form object accepted by the Cloudflare API.").optional()
|
|
319
|
-
}).describe("A Cloudflare DNS record.");
|
|
320
|
-
var createDnsRecordInput = external_exports.strictObject({
|
|
321
|
-
zoneId: external_exports.string().min(1).describe("The Cloudflare zone ID."),
|
|
322
|
-
type: mutationFields.type,
|
|
323
|
-
name: mutationFields.name,
|
|
324
|
-
content: mutationFields.content.describe("The DNS record content, for simple record types such as A or CNAME. Provide at least one of content or data.").optional(),
|
|
325
|
-
data: mutationFields.data.describe("The structured record payload, for record types such as MX, SRV or CAA. Provide at least one of content or data.").optional(),
|
|
326
|
-
ttl: mutationFields.ttl.optional(),
|
|
327
|
-
proxied: mutationFields.proxied.optional(),
|
|
328
|
-
priority: mutationFields.priority.optional(),
|
|
329
|
-
comment: mutationFields.comment.optional(),
|
|
330
|
-
tags: mutationFields.tags.optional(),
|
|
331
|
-
settings: mutationFields.settings.optional()
|
|
332
|
-
}).refine(
|
|
333
|
-
(input) => input.content !== void 0 || input.data !== void 0,
|
|
334
|
-
{ message: "at least one of content or data is required", path: ["content"] }
|
|
335
|
-
).describe("The input payload for this action.");
|
|
336
|
-
var createDnsRecordOutput = external_exports.strictObject({
|
|
337
|
-
record: dnsRecord.optional()
|
|
338
|
-
}).describe("The output payload for this action.");
|
|
339
|
-
var UPDATABLE_FIELDS = Object.keys(mutationFields);
|
|
340
|
-
var updateDnsRecordInput = external_exports.strictObject({
|
|
341
|
-
zoneId: external_exports.string().min(1).describe("The Cloudflare zone ID."),
|
|
342
|
-
dnsRecordId: external_exports.string().min(1).describe("The Cloudflare DNS record ID."),
|
|
343
|
-
type: mutationFields.type.optional(),
|
|
344
|
-
name: mutationFields.name.optional(),
|
|
345
|
-
content: mutationFields.content.optional(),
|
|
346
|
-
data: mutationFields.data.optional(),
|
|
347
|
-
ttl: mutationFields.ttl.optional(),
|
|
348
|
-
proxied: mutationFields.proxied.optional(),
|
|
349
|
-
priority: mutationFields.priority.optional(),
|
|
350
|
-
comment: mutationFields.comment.optional(),
|
|
351
|
-
tags: mutationFields.tags.optional(),
|
|
352
|
-
settings: mutationFields.settings.optional()
|
|
353
|
-
}).refine(
|
|
354
|
-
(input) => UPDATABLE_FIELDS.some((field) => input[field] !== void 0),
|
|
355
|
-
{ message: "at least one DNS record field must be provided", path: ["content"] }
|
|
356
|
-
).describe("The input payload for this action. At least one record field must be provided.");
|
|
357
|
-
var updateDnsRecordOutput = external_exports.strictObject({
|
|
358
|
-
record: dnsRecord.optional()
|
|
359
|
-
}).describe("The output payload for this action.");
|
|
360
|
-
|
|
361
|
-
// ../plugins/src/cloudflare_dns/schema.ts
|
|
362
|
-
var listAccountsInput = external_exports.strictObject({
|
|
363
|
-
page: external_exports.int().min(1).describe("The result page number.").optional(),
|
|
364
|
-
perPage: external_exports.int().min(1).describe("The page size.").optional()
|
|
365
|
-
}).describe("The input payload for this action.");
|
|
366
|
-
var listAccountsOutput = external_exports.strictObject({
|
|
367
|
-
accounts: external_exports.array(external_exports.strictObject({
|
|
368
|
-
id: external_exports.string().describe("The Cloudflare account ID."),
|
|
369
|
-
name: external_exports.string().describe("The Cloudflare account name.").optional(),
|
|
370
|
-
type: external_exports.string().describe("The Cloudflare account type.").optional()
|
|
371
|
-
}).describe("The Cloudflare account summary.")).describe("The visible Cloudflare accounts."),
|
|
372
|
-
resultInfo: external_exports.strictObject({
|
|
373
|
-
page: external_exports.int().describe("The current page number.").optional(),
|
|
374
|
-
perPage: external_exports.int().describe("The page size.").optional(),
|
|
375
|
-
count: external_exports.int().describe("The number of items in the current page.").optional(),
|
|
376
|
-
totalCount: external_exports.int().describe("The total number of matching items.").optional(),
|
|
377
|
-
totalPages: external_exports.int().describe("The total number of pages.").optional()
|
|
378
|
-
}).describe("Cloudflare pagination metadata.").optional()
|
|
379
|
-
}).describe("The output payload for this action.");
|
|
380
|
-
var listZonesInput = external_exports.strictObject({
|
|
381
|
-
page: external_exports.int().min(1).describe("The result page number.").optional(),
|
|
382
|
-
perPage: external_exports.int().min(1).describe("The page size.").optional(),
|
|
383
|
-
name: external_exports.string().describe("Filter zones by exact zone name.").optional(),
|
|
384
|
-
status: external_exports.string().describe("Filter zones by zone status.").optional(),
|
|
385
|
-
accountId: external_exports.string().describe("Filter zones by Cloudflare account ID.").optional(),
|
|
386
|
-
match: external_exports.enum(["all", "any"]).describe("Whether all or any query filters must match.").optional(),
|
|
387
|
-
order: external_exports.string().describe("The field to order by.").optional(),
|
|
388
|
-
direction: external_exports.enum(["asc", "desc"]).describe("The sort direction.").optional()
|
|
389
|
-
}).describe("The input payload for this action.");
|
|
390
|
-
var listZonesOutput = external_exports.strictObject({
|
|
391
|
-
zones: external_exports.array(external_exports.strictObject({
|
|
392
|
-
id: external_exports.string().describe("The zone ID."),
|
|
393
|
-
name: external_exports.string().describe("The zone name."),
|
|
394
|
-
status: external_exports.string().describe("The zone status.").optional(),
|
|
395
|
-
type: external_exports.string().describe("The zone type.").optional(),
|
|
396
|
-
paused: external_exports.boolean().describe("Whether the zone is paused.").optional(),
|
|
397
|
-
createdOn: external_exports.string().describe("The zone creation timestamp.").optional(),
|
|
398
|
-
modifiedOn: external_exports.string().describe("The last zone update timestamp.").optional(),
|
|
399
|
-
nameServers: external_exports.array(external_exports.string().min(1)).describe("The assigned name servers.").optional(),
|
|
400
|
-
originalNameServers: external_exports.array(external_exports.string().min(1)).describe("The original name servers reported by Cloudflare.").optional(),
|
|
401
|
-
account: external_exports.strictObject({
|
|
402
|
-
id: external_exports.string().describe("The Cloudflare account ID.").optional(),
|
|
403
|
-
name: external_exports.string().describe("The Cloudflare account name.").optional(),
|
|
404
|
-
type: external_exports.string().describe("The Cloudflare account type.").optional()
|
|
405
|
-
}).describe("The Cloudflare account linked to a zone.").optional(),
|
|
406
|
-
meta: external_exports.looseObject({}).describe("A free-form object accepted by the Cloudflare API.").optional()
|
|
407
|
-
}).describe("A Cloudflare zone summary.")).describe("The list of matching zones."),
|
|
408
|
-
resultInfo: external_exports.strictObject({
|
|
409
|
-
page: external_exports.int().describe("The current page number.").optional(),
|
|
410
|
-
perPage: external_exports.int().describe("The page size.").optional(),
|
|
411
|
-
count: external_exports.int().describe("The number of items in the current page.").optional(),
|
|
412
|
-
totalCount: external_exports.int().describe("The total number of matching items.").optional(),
|
|
413
|
-
totalPages: external_exports.int().describe("The total number of pages.").optional()
|
|
414
|
-
}).describe("Cloudflare pagination metadata.").optional()
|
|
415
|
-
}).describe("The output payload for this action.");
|
|
416
|
-
var getZoneInput = external_exports.strictObject({
|
|
417
|
-
zoneId: external_exports.string().min(1).describe("The Cloudflare zone ID.")
|
|
418
|
-
}).describe("The input payload for this action.");
|
|
419
|
-
var getZoneOutput = external_exports.strictObject({
|
|
420
|
-
zone: external_exports.strictObject({
|
|
421
|
-
id: external_exports.string().describe("The zone ID."),
|
|
422
|
-
name: external_exports.string().describe("The zone name."),
|
|
423
|
-
status: external_exports.string().describe("The zone status.").optional(),
|
|
424
|
-
type: external_exports.string().describe("The zone type.").optional(),
|
|
425
|
-
paused: external_exports.boolean().describe("Whether the zone is paused.").optional(),
|
|
426
|
-
createdOn: external_exports.string().describe("The zone creation timestamp.").optional(),
|
|
427
|
-
modifiedOn: external_exports.string().describe("The last zone update timestamp.").optional(),
|
|
428
|
-
nameServers: external_exports.array(external_exports.string().min(1)).describe("The assigned name servers.").optional(),
|
|
429
|
-
originalNameServers: external_exports.array(external_exports.string().min(1)).describe("The original name servers reported by Cloudflare.").optional(),
|
|
430
|
-
account: external_exports.strictObject({
|
|
431
|
-
id: external_exports.string().describe("The Cloudflare account ID.").optional(),
|
|
432
|
-
name: external_exports.string().describe("The Cloudflare account name.").optional(),
|
|
433
|
-
type: external_exports.string().describe("The Cloudflare account type.").optional()
|
|
434
|
-
}).describe("The Cloudflare account linked to a zone.").optional(),
|
|
435
|
-
meta: external_exports.looseObject({}).describe("A free-form object accepted by the Cloudflare API.").optional()
|
|
436
|
-
}).describe("A Cloudflare zone summary.").optional()
|
|
437
|
-
}).describe("The output payload for this action.");
|
|
438
|
-
var listDnsRecordsInput = external_exports.strictObject({
|
|
439
|
-
zoneId: external_exports.string().min(1).describe("The Cloudflare zone ID."),
|
|
440
|
-
page: external_exports.int().min(1).describe("The result page number.").optional(),
|
|
441
|
-
perPage: external_exports.int().min(1).describe("The page size.").optional(),
|
|
442
|
-
type: external_exports.enum(["A", "AAAA", "CAA", "CERT", "CNAME", "DNSKEY", "DS", "HTTPS", "LOC", "MX", "NAPTR", "NS", "OPENPGPKEY", "PTR", "SMIMEA", "SRV", "SSHFP", "SVCB", "TLSA", "TXT", "URI"]).describe("The DNS record type.").optional(),
|
|
443
|
-
name: external_exports.string().describe("Filter by record name.").optional(),
|
|
444
|
-
content: external_exports.string().describe("Filter by record content.").optional(),
|
|
445
|
-
proxied: external_exports.boolean().describe("Filter by proxy status.").optional(),
|
|
446
|
-
match: external_exports.enum(["all", "any"]).describe("Whether all or any query filters must match.").optional(),
|
|
447
|
-
order: external_exports.string().describe("The field to order by.").optional(),
|
|
448
|
-
direction: external_exports.enum(["asc", "desc"]).describe("The sort direction.").optional()
|
|
449
|
-
}).describe("The input payload for this action.");
|
|
450
|
-
var listDnsRecordsOutput = external_exports.strictObject({
|
|
451
|
-
records: external_exports.array(external_exports.strictObject({
|
|
452
|
-
id: external_exports.string().describe("The DNS record ID."),
|
|
453
|
-
zoneId: external_exports.string().describe("The parent zone ID.").optional(),
|
|
454
|
-
zoneName: external_exports.string().describe("The parent zone name.").optional(),
|
|
455
|
-
type: external_exports.string().describe("The DNS record type."),
|
|
456
|
-
name: external_exports.string().describe("The record name."),
|
|
457
|
-
content: external_exports.string().describe("The record content.").nullable().optional(),
|
|
458
|
-
ttl: external_exports.int().describe("The DNS TTL in seconds.").optional(),
|
|
459
|
-
proxied: external_exports.boolean().describe("Whether Cloudflare proxying is enabled.").optional(),
|
|
460
|
-
proxiable: external_exports.boolean().describe("Whether the record can be proxied.").optional(),
|
|
461
|
-
priority: external_exports.int().describe("The record priority.").optional(),
|
|
462
|
-
comment: external_exports.string().describe("The record comment.").nullable().optional(),
|
|
463
|
-
tags: external_exports.array(external_exports.string().min(1)).describe("The record tags.").optional(),
|
|
464
|
-
createdOn: external_exports.string().describe("The record creation timestamp.").optional(),
|
|
465
|
-
modifiedOn: external_exports.string().describe("The last record update timestamp.").optional(),
|
|
466
|
-
commentModifiedOn: external_exports.string().describe("The comment update timestamp.").optional(),
|
|
467
|
-
tagsModifiedOn: external_exports.string().describe("The tag update timestamp.").optional(),
|
|
468
|
-
data: external_exports.looseObject({}).describe("A free-form object accepted by the Cloudflare API.").optional(),
|
|
469
|
-
meta: external_exports.looseObject({}).describe("A free-form object accepted by the Cloudflare API.").optional(),
|
|
470
|
-
settings: external_exports.looseObject({}).describe("A free-form object accepted by the Cloudflare API.").optional()
|
|
471
|
-
}).describe("A Cloudflare DNS record.")).describe("The list of DNS records."),
|
|
472
|
-
resultInfo: external_exports.strictObject({
|
|
473
|
-
page: external_exports.int().describe("The current page number.").optional(),
|
|
474
|
-
perPage: external_exports.int().describe("The page size.").optional(),
|
|
475
|
-
count: external_exports.int().describe("The number of items in the current page.").optional(),
|
|
476
|
-
totalCount: external_exports.int().describe("The total number of matching items.").optional(),
|
|
477
|
-
totalPages: external_exports.int().describe("The total number of pages.").optional()
|
|
478
|
-
}).describe("Cloudflare pagination metadata.").optional()
|
|
479
|
-
}).describe("The output payload for this action.");
|
|
480
|
-
var getDnsRecordInput = external_exports.strictObject({
|
|
481
|
-
zoneId: external_exports.string().min(1).describe("The Cloudflare zone ID."),
|
|
482
|
-
dnsRecordId: external_exports.string().min(1).describe("The Cloudflare DNS record ID.")
|
|
483
|
-
}).describe("The input payload for this action.");
|
|
484
|
-
var getDnsRecordOutput = external_exports.strictObject({
|
|
485
|
-
record: external_exports.strictObject({
|
|
486
|
-
id: external_exports.string().describe("The DNS record ID."),
|
|
487
|
-
zoneId: external_exports.string().describe("The parent zone ID.").optional(),
|
|
488
|
-
zoneName: external_exports.string().describe("The parent zone name.").optional(),
|
|
489
|
-
type: external_exports.string().describe("The DNS record type."),
|
|
490
|
-
name: external_exports.string().describe("The record name."),
|
|
491
|
-
content: external_exports.string().describe("The record content.").nullable().optional(),
|
|
492
|
-
ttl: external_exports.int().describe("The DNS TTL in seconds.").optional(),
|
|
493
|
-
proxied: external_exports.boolean().describe("Whether Cloudflare proxying is enabled.").optional(),
|
|
494
|
-
proxiable: external_exports.boolean().describe("Whether the record can be proxied.").optional(),
|
|
495
|
-
priority: external_exports.int().describe("The record priority.").optional(),
|
|
496
|
-
comment: external_exports.string().describe("The record comment.").nullable().optional(),
|
|
497
|
-
tags: external_exports.array(external_exports.string().min(1)).describe("The record tags.").optional(),
|
|
498
|
-
createdOn: external_exports.string().describe("The record creation timestamp.").optional(),
|
|
499
|
-
modifiedOn: external_exports.string().describe("The last record update timestamp.").optional(),
|
|
500
|
-
commentModifiedOn: external_exports.string().describe("The comment update timestamp.").optional(),
|
|
501
|
-
tagsModifiedOn: external_exports.string().describe("The tag update timestamp.").optional(),
|
|
502
|
-
data: external_exports.looseObject({}).describe("A free-form object accepted by the Cloudflare API.").optional(),
|
|
503
|
-
meta: external_exports.looseObject({}).describe("A free-form object accepted by the Cloudflare API.").optional(),
|
|
504
|
-
settings: external_exports.looseObject({}).describe("A free-form object accepted by the Cloudflare API.").optional()
|
|
505
|
-
}).describe("A Cloudflare DNS record.").optional()
|
|
506
|
-
}).describe("The output payload for this action.");
|
|
507
|
-
var deleteDnsRecordInput = external_exports.strictObject({
|
|
508
|
-
zoneId: external_exports.string().min(1).describe("The Cloudflare zone ID."),
|
|
509
|
-
dnsRecordId: external_exports.string().min(1).describe("The Cloudflare DNS record ID.")
|
|
510
|
-
}).describe("The input payload for this action.");
|
|
511
|
-
var deleteDnsRecordOutput = external_exports.strictObject({
|
|
512
|
-
id: external_exports.string().describe("The deleted DNS record ID.").optional(),
|
|
513
|
-
deleted: external_exports.boolean().describe("Whether the delete request succeeded.").optional()
|
|
514
|
-
}).describe("The output payload for this action.");
|
|
515
|
-
var cloudflareDnsActions = {
|
|
516
|
-
list_accounts: {
|
|
517
|
-
description: "List Cloudflare accounts visible to the current credential.",
|
|
518
|
-
effect: "read",
|
|
519
|
-
inputSchema: listAccountsInput,
|
|
520
|
-
outputSchema: external_exports.toJSONSchema(listAccountsOutput, { io: "output", unrepresentable: "any" })
|
|
521
|
-
},
|
|
522
|
-
list_zones: {
|
|
523
|
-
description: "List the Cloudflare zones visible to the current API token.",
|
|
524
|
-
effect: "read",
|
|
525
|
-
inputSchema: listZonesInput,
|
|
526
|
-
outputSchema: external_exports.toJSONSchema(listZonesOutput, { io: "output", unrepresentable: "any" })
|
|
527
|
-
},
|
|
528
|
-
get_zone: {
|
|
529
|
-
description: "Get one Cloudflare zone by zone ID.",
|
|
530
|
-
effect: "read",
|
|
531
|
-
inputSchema: getZoneInput,
|
|
532
|
-
outputSchema: external_exports.toJSONSchema(getZoneOutput, { io: "output", unrepresentable: "any" })
|
|
533
|
-
},
|
|
534
|
-
list_dns_records: {
|
|
535
|
-
description: "List DNS records inside one Cloudflare zone.",
|
|
536
|
-
effect: "read",
|
|
537
|
-
inputSchema: listDnsRecordsInput,
|
|
538
|
-
outputSchema: external_exports.toJSONSchema(listDnsRecordsOutput, { io: "output", unrepresentable: "any" })
|
|
539
|
-
},
|
|
540
|
-
get_dns_record: {
|
|
541
|
-
description: "Get one DNS record from a Cloudflare zone.",
|
|
542
|
-
effect: "read",
|
|
543
|
-
inputSchema: getDnsRecordInput,
|
|
544
|
-
outputSchema: external_exports.toJSONSchema(getDnsRecordOutput, { io: "output", unrepresentable: "any" })
|
|
545
|
-
},
|
|
546
|
-
create_dns_record: {
|
|
547
|
-
description: "Create a DNS record inside a Cloudflare zone.",
|
|
548
|
-
effect: "write",
|
|
549
|
-
inputSchema: createDnsRecordInput,
|
|
550
|
-
outputSchema: external_exports.toJSONSchema(createDnsRecordOutput, { io: "output", unrepresentable: "any" })
|
|
551
|
-
},
|
|
552
|
-
update_dns_record: {
|
|
553
|
-
description: "Patch one DNS record inside a Cloudflare zone.",
|
|
554
|
-
effect: "write",
|
|
555
|
-
inputSchema: updateDnsRecordInput,
|
|
556
|
-
outputSchema: external_exports.toJSONSchema(updateDnsRecordOutput, { io: "output", unrepresentable: "any" })
|
|
557
|
-
},
|
|
558
|
-
delete_dns_record: {
|
|
559
|
-
description: "Delete one DNS record from a Cloudflare zone.",
|
|
560
|
-
effect: "destructive",
|
|
561
|
-
inputSchema: deleteDnsRecordInput,
|
|
562
|
-
outputSchema: external_exports.toJSONSchema(deleteDnsRecordOutput, { io: "output", unrepresentable: "any" })
|
|
563
|
-
}
|
|
564
|
-
};
|
|
565
|
-
|
|
566
|
-
// ../plugins/src/cloudflare_dns/index.ts
|
|
567
|
-
function createCloudflareDnsPlugin() {
|
|
568
|
-
return createProviderPlugin({
|
|
569
|
-
description: "Cloudflare DNS",
|
|
570
|
-
actions: cloudflareDnsActions,
|
|
571
|
-
credentialProbe: "list_zones",
|
|
572
|
-
handlers: {
|
|
573
|
-
list_accounts: listAccounts,
|
|
574
|
-
list_zones: listZones,
|
|
575
|
-
get_zone: getZone,
|
|
576
|
-
list_dns_records: listDnsRecords,
|
|
577
|
-
get_dns_record: getDnsRecord,
|
|
578
|
-
create_dns_record: createDnsRecord,
|
|
579
|
-
update_dns_record: updateDnsRecord,
|
|
580
|
-
delete_dns_record: deleteDnsRecord
|
|
581
|
-
}
|
|
582
|
-
});
|
|
583
|
-
}
|
|
584
|
-
var cloudflare_dns_default = createCloudflareDnsPlugin();
|
|
585
|
-
export {
|
|
586
|
-
createCloudflareDnsPlugin,
|
|
587
|
-
cloudflare_dns_default as default
|
|
588
|
-
};
|