@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
package/dist/dub-LDOFG3HC.js
DELETED
|
@@ -1,679 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createAuthedClient
|
|
3
|
-
} from "./chunk-XYBU3WZH.js";
|
|
4
|
-
import "./chunk-E6JCVKW6.js";
|
|
5
|
-
import {
|
|
6
|
-
asJsonObject,
|
|
7
|
-
compactDefined,
|
|
8
|
-
finiteNumber,
|
|
9
|
-
trimmedText
|
|
10
|
-
} from "./chunk-JXHMDBAY.js";
|
|
11
|
-
import {
|
|
12
|
-
createProviderPlugin,
|
|
13
|
-
upstreamError
|
|
14
|
-
} from "./chunk-ATK45BXV.js";
|
|
15
|
-
import "./chunk-U7B6DS2O.js";
|
|
16
|
-
import {
|
|
17
|
-
TBError,
|
|
18
|
-
external_exports
|
|
19
|
-
} from "./chunk-UZM2RXZH.js";
|
|
20
|
-
import "./chunk-U67V476Y.js";
|
|
21
|
-
|
|
22
|
-
// ../plugins/src/dub/api.ts
|
|
23
|
-
var SERVICE = "dub";
|
|
24
|
-
var API_BASE = "https://api.dub.co";
|
|
25
|
-
var LINKS_PATH = "/links";
|
|
26
|
-
var LINKS_INFO_PATH = "/links/info";
|
|
27
|
-
var LINKS_COUNT_PATH = "/links/count";
|
|
28
|
-
var TAGS_PATH = "/tags";
|
|
29
|
-
var FOLDERS_PATH = "/folders";
|
|
30
|
-
var ANALYTICS_PATH = "/analytics";
|
|
31
|
-
function nullableText(value) {
|
|
32
|
-
return value === null ? null : trimmedText(value);
|
|
33
|
-
}
|
|
34
|
-
function providerQuery(query) {
|
|
35
|
-
return Object.entries(query).filter(([, value]) => value !== void 0 && value !== null && value !== "").map(([key, value]) => [key, Array.isArray(value) ? value.map(String).join(",") : String(value)]);
|
|
36
|
-
}
|
|
37
|
-
function errorMessage(payload) {
|
|
38
|
-
if (typeof payload === "string") return payload;
|
|
39
|
-
const object = asJsonObject(payload);
|
|
40
|
-
if (object === void 0) return void 0;
|
|
41
|
-
return trimmedText(asJsonObject(object.error)?.message) ?? trimmedText(object.message) ?? trimmedText(object.error);
|
|
42
|
-
}
|
|
43
|
-
var http = createAuthedClient({
|
|
44
|
-
baseUrl: API_BASE,
|
|
45
|
-
service: SERVICE,
|
|
46
|
-
auth: { kind: "bearer" },
|
|
47
|
-
headers: { accept: "application/json" },
|
|
48
|
-
mapError: ({ data: payload, status, statusText }) => upstreamError(
|
|
49
|
-
status,
|
|
50
|
-
errorMessage(payload) ?? (statusText || `dub \u8FD4\u56DE HTTP ${status}`)
|
|
51
|
-
),
|
|
52
|
-
mapTransportError: ({ message }) => upstreamError(
|
|
53
|
-
502,
|
|
54
|
-
message === void 0 ? "dub \u8BF7\u6C42\u5931\u8D25" : `dub \u8BF7\u6C42\u5931\u8D25: ${message}`
|
|
55
|
-
)
|
|
56
|
-
});
|
|
57
|
-
async function request(ctx, path, input) {
|
|
58
|
-
const { bodyKind, data } = await http.request(ctx, {
|
|
59
|
-
path,
|
|
60
|
-
method: input.method,
|
|
61
|
-
query: providerQuery(input.query ?? {}),
|
|
62
|
-
...input.body === void 0 ? {} : { json: input.body },
|
|
63
|
-
invalidJson: "text"
|
|
64
|
-
});
|
|
65
|
-
return bodyKind === "empty" ? null : data;
|
|
66
|
-
}
|
|
67
|
-
function responseText(value, field) {
|
|
68
|
-
const text = trimmedText(value);
|
|
69
|
-
if (text === void 0) throw upstreamError(502, `dub \u54CD\u5E94\u7F3A\u5C11 ${field}`);
|
|
70
|
-
return text;
|
|
71
|
-
}
|
|
72
|
-
function responseRecord(value, field) {
|
|
73
|
-
const object = asJsonObject(value);
|
|
74
|
-
if (object === void 0) throw upstreamError(502, `dub \u8FD4\u56DE\u7684 ${field} \u4E0D\u662F\u5BF9\u8C61`);
|
|
75
|
-
return object;
|
|
76
|
-
}
|
|
77
|
-
function asArray(payload, field) {
|
|
78
|
-
if (!Array.isArray(payload)) throw upstreamError(502, `dub ${field} \u54CD\u5E94\u4E0D\u662F\u6570\u7EC4`);
|
|
79
|
-
return payload;
|
|
80
|
-
}
|
|
81
|
-
function normalizeLink(payload) {
|
|
82
|
-
const object = responseRecord(payload, "link");
|
|
83
|
-
return {
|
|
84
|
-
id: responseText(object.id, "link.id"),
|
|
85
|
-
domain: responseText(object.domain, "link.domain"),
|
|
86
|
-
key: responseText(object.key, "link.key"),
|
|
87
|
-
url: responseText(object.url, "link.url"),
|
|
88
|
-
shortLink: nullableText(object.shortLink),
|
|
89
|
-
qrCode: nullableText(object.qrCode),
|
|
90
|
-
title: nullableText(object.title),
|
|
91
|
-
archived: typeof object.archived === "boolean" ? object.archived : null,
|
|
92
|
-
clicks: finiteNumber(object.clicks) ?? null,
|
|
93
|
-
leads: finiteNumber(object.leads) ?? null,
|
|
94
|
-
sales: finiteNumber(object.sales) ?? null,
|
|
95
|
-
saleAmount: finiteNumber(object.saleAmount) ?? null,
|
|
96
|
-
createdAt: nullableText(object.createdAt),
|
|
97
|
-
updatedAt: nullableText(object.updatedAt),
|
|
98
|
-
raw: object
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
function normalizeTag(payload) {
|
|
102
|
-
const object = responseRecord(payload, "tag");
|
|
103
|
-
return {
|
|
104
|
-
id: responseText(object.id, "tag.id"),
|
|
105
|
-
name: responseText(object.name, "tag.name"),
|
|
106
|
-
color: nullableText(object.color),
|
|
107
|
-
raw: object
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
function normalizeFolder(payload) {
|
|
111
|
-
const object = responseRecord(payload, "folder");
|
|
112
|
-
return {
|
|
113
|
-
id: responseText(object.id, "folder.id"),
|
|
114
|
-
name: responseText(object.name, "folder.name"),
|
|
115
|
-
accessLevel: nullableText(object.accessLevel),
|
|
116
|
-
raw: object
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
function extractCount(payload) {
|
|
120
|
-
if (typeof payload === "number") return payload;
|
|
121
|
-
const object = asJsonObject(payload);
|
|
122
|
-
const count = finiteNumber(object?.count) ?? finiteNumber(object?.links);
|
|
123
|
-
if (count === void 0) throw upstreamError(502, "dub count \u54CD\u5E94\u91CC\u6CA1\u6709 count");
|
|
124
|
-
return count;
|
|
125
|
-
}
|
|
126
|
-
function assertNonEmptyPatch(patch, action) {
|
|
127
|
-
if (Object.keys(patch).length === 0) {
|
|
128
|
-
throw new TBError("invalid_argument", `${action} \u81F3\u5C11\u9700\u8981\u4E00\u4E2A\u5F85\u66F4\u65B0\u5B57\u6BB5`);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
function requirePathId(value, field) {
|
|
132
|
-
const text = trimmedText(value);
|
|
133
|
-
if (text === void 0) throw new TBError("invalid_argument", `${field} \u4E0D\u80FD\u4E3A\u7A7A`);
|
|
134
|
-
return encodeURIComponent(text);
|
|
135
|
-
}
|
|
136
|
-
async function deleteResource(ctx, path) {
|
|
137
|
-
const payload = await request(ctx, path, { method: "DELETE" });
|
|
138
|
-
return { deleted: true, raw: payload };
|
|
139
|
-
}
|
|
140
|
-
async function createLink(input, ctx) {
|
|
141
|
-
const payload = await request(ctx, LINKS_PATH, { method: "POST", body: compactDefined(input) });
|
|
142
|
-
return { link: normalizeLink(payload) };
|
|
143
|
-
}
|
|
144
|
-
async function listLinks(input, ctx) {
|
|
145
|
-
const payload = await request(ctx, LINKS_PATH, { method: "GET", query: compactDefined(input) });
|
|
146
|
-
return { links: asArray(payload, "links").map((item) => normalizeLink(item)) };
|
|
147
|
-
}
|
|
148
|
-
async function retrieveLink(input, ctx) {
|
|
149
|
-
const query = compactDefined({
|
|
150
|
-
linkId: trimmedText(input.linkId),
|
|
151
|
-
domain: trimmedText(input.domain),
|
|
152
|
-
key: trimmedText(input.key),
|
|
153
|
-
externalId: trimmedText(input.externalId)
|
|
154
|
-
});
|
|
155
|
-
if (Object.keys(query).length === 0) {
|
|
156
|
-
throw new TBError("invalid_argument", "retrieve_link \u9700\u8981 linkId\u3001externalId,\u6216 domain \u4E0E key \u6210\u5BF9");
|
|
157
|
-
}
|
|
158
|
-
if (query.linkId === void 0 && query.externalId === void 0 && !(query.domain !== void 0 && query.key !== void 0)) {
|
|
159
|
-
throw new TBError("invalid_argument", "retrieve_link \u7684 domain \u67E5\u6CD5\u9700\u8981\u540C\u65F6\u7ED9 domain \u548C key");
|
|
160
|
-
}
|
|
161
|
-
const payload = await request(ctx, LINKS_INFO_PATH, { method: "GET", query });
|
|
162
|
-
return { link: normalizeLink(payload) };
|
|
163
|
-
}
|
|
164
|
-
async function updateLink(input, ctx) {
|
|
165
|
-
const { linkId, ...body } = input;
|
|
166
|
-
const patch = compactDefined(body);
|
|
167
|
-
assertNonEmptyPatch(patch, "update_link");
|
|
168
|
-
const path = `${LINKS_PATH}/${requirePathId(linkId, "linkId")}`;
|
|
169
|
-
const payload = await request(ctx, path, { method: "PATCH", body: patch });
|
|
170
|
-
return { link: normalizeLink(payload) };
|
|
171
|
-
}
|
|
172
|
-
async function deleteLink(input, ctx) {
|
|
173
|
-
return deleteResource(ctx, `${LINKS_PATH}/${requirePathId(input.linkId, "linkId")}`);
|
|
174
|
-
}
|
|
175
|
-
async function countLinks(input, ctx) {
|
|
176
|
-
const payload = await request(ctx, LINKS_COUNT_PATH, { method: "GET", query: compactDefined(input) });
|
|
177
|
-
return { count: extractCount(payload), raw: payload };
|
|
178
|
-
}
|
|
179
|
-
async function listTags(input, ctx) {
|
|
180
|
-
const payload = await request(ctx, TAGS_PATH, { method: "GET", query: compactDefined(input) });
|
|
181
|
-
return { tags: asArray(payload, "tags").map((item) => normalizeTag(item)) };
|
|
182
|
-
}
|
|
183
|
-
async function createTag(input, ctx) {
|
|
184
|
-
const payload = await request(ctx, TAGS_PATH, { method: "POST", body: compactDefined(input) });
|
|
185
|
-
return { tag: normalizeTag(payload) };
|
|
186
|
-
}
|
|
187
|
-
async function updateTag(input, ctx) {
|
|
188
|
-
const { id, ...body } = input;
|
|
189
|
-
const patch = compactDefined(body);
|
|
190
|
-
assertNonEmptyPatch(patch, "update_tag");
|
|
191
|
-
const payload = await request(ctx, `${TAGS_PATH}/${requirePathId(id, "id")}`, {
|
|
192
|
-
method: "PATCH",
|
|
193
|
-
body: patch
|
|
194
|
-
});
|
|
195
|
-
return { tag: normalizeTag(payload) };
|
|
196
|
-
}
|
|
197
|
-
async function deleteTag(input, ctx) {
|
|
198
|
-
return deleteResource(ctx, `${TAGS_PATH}/${requirePathId(input.id, "id")}`);
|
|
199
|
-
}
|
|
200
|
-
async function listFolders(input, ctx) {
|
|
201
|
-
const payload = await request(ctx, FOLDERS_PATH, { method: "GET", query: compactDefined(input) });
|
|
202
|
-
return { folders: asArray(payload, "folders").map((item) => normalizeFolder(item)) };
|
|
203
|
-
}
|
|
204
|
-
async function createFolder(input, ctx) {
|
|
205
|
-
const payload = await request(ctx, FOLDERS_PATH, { method: "POST", body: compactDefined(input) });
|
|
206
|
-
return { folder: normalizeFolder(payload) };
|
|
207
|
-
}
|
|
208
|
-
async function updateFolder(input, ctx) {
|
|
209
|
-
const { id, ...body } = input;
|
|
210
|
-
const patch = compactDefined(body);
|
|
211
|
-
assertNonEmptyPatch(patch, "update_folder");
|
|
212
|
-
const payload = await request(ctx, `${FOLDERS_PATH}/${requirePathId(id, "id")}`, {
|
|
213
|
-
method: "PATCH",
|
|
214
|
-
body: patch
|
|
215
|
-
});
|
|
216
|
-
return { folder: normalizeFolder(payload) };
|
|
217
|
-
}
|
|
218
|
-
async function deleteFolder(input, ctx) {
|
|
219
|
-
return deleteResource(ctx, `${FOLDERS_PATH}/${requirePathId(input.id, "id")}`);
|
|
220
|
-
}
|
|
221
|
-
async function retrieveAnalytics(input, ctx) {
|
|
222
|
-
const payload = await request(ctx, ANALYTICS_PATH, { method: "GET", query: compactDefined(input) });
|
|
223
|
-
return { data: payload };
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
// ../plugins/src/dub/schema.ts
|
|
227
|
-
var createLinkInput = external_exports.strictObject({
|
|
228
|
-
url: external_exports.url().max(32e3).describe("The destination URL of the short link."),
|
|
229
|
-
domain: external_exports.string().max(190).describe("The short-link domain without protocol.").optional(),
|
|
230
|
-
key: external_exports.string().max(190).describe("The short-link slug.").optional(),
|
|
231
|
-
keyLength: external_exports.int().min(3).max(190).describe("The length of the generated short-link slug.").optional(),
|
|
232
|
-
externalId: external_exports.string().max(255).describe("The ID of the link in your database.").nullable().optional(),
|
|
233
|
-
tenantId: external_exports.string().max(255).describe("The tenant ID that created the link in your system.").nullable().optional(),
|
|
234
|
-
programId: external_exports.string().describe("The partner program ID associated with the link.").nullable().optional(),
|
|
235
|
-
partnerId: external_exports.string().describe("The partner ID associated with the link.").nullable().optional(),
|
|
236
|
-
prefix: external_exports.string().describe("The prefix used for randomly generated slugs.").optional(),
|
|
237
|
-
trackConversion: external_exports.boolean().describe("Whether Dub should track conversions for this link.").optional(),
|
|
238
|
-
archived: external_exports.boolean().describe("Whether the link should be archived.").optional(),
|
|
239
|
-
tagIds: external_exports.union([external_exports.string().describe("A Dub tag ID."), external_exports.array(external_exports.string().describe("A Dub identifier or name.")).min(1).describe("Dub tag IDs assigned to the link.")]).describe("The tag IDs assigned to the link.").optional(),
|
|
240
|
-
tagNames: external_exports.union([external_exports.string().describe("A Dub tag name."), external_exports.array(external_exports.string().describe("A Dub identifier or name.")).min(1).describe("Dub tag names assigned to the link.")]).describe("The tag names assigned to the link.").optional(),
|
|
241
|
-
folderId: external_exports.string().describe("The folder ID assigned to the link.").nullable().optional(),
|
|
242
|
-
comments: external_exports.string().describe("Comments for the link.").nullable().optional(),
|
|
243
|
-
expiresAt: external_exports.string().describe("The ISO-8601 timestamp when the link expires.").nullable().optional(),
|
|
244
|
-
expiredUrl: external_exports.url().max(32e3).describe("The URL used when the short link has expired.").nullable().optional(),
|
|
245
|
-
password: external_exports.string().describe("The password required to access the destination URL.").nullable().optional(),
|
|
246
|
-
proxy: external_exports.boolean().describe("Whether the link uses Dub custom link previews.").optional(),
|
|
247
|
-
title: external_exports.string().describe("The custom link preview title.").nullable().optional(),
|
|
248
|
-
description: external_exports.string().describe("The custom link preview description.").nullable().optional(),
|
|
249
|
-
image: external_exports.string().describe("The custom link preview image URL.").nullable().optional(),
|
|
250
|
-
video: external_exports.string().describe("The custom link preview video URL.").nullable().optional(),
|
|
251
|
-
rewrite: external_exports.boolean().describe("Whether the link uses link cloaking.").optional(),
|
|
252
|
-
ios: external_exports.url().max(32e3).describe("The iOS destination URL for device targeting.").nullable().optional(),
|
|
253
|
-
android: external_exports.url().max(32e3).describe("The Android destination URL for device targeting.").nullable().optional(),
|
|
254
|
-
geo: external_exports.record(external_exports.string(), external_exports.url().max(32e3).describe("The destination URL for this country.")).describe("Geo targeting destinations keyed by country code.").nullable().optional(),
|
|
255
|
-
doIndex: external_exports.boolean().describe("Whether search engines may index the short link.").optional(),
|
|
256
|
-
utm_source: external_exports.string().describe("The UTM source to apply to the destination URL.").nullable().optional(),
|
|
257
|
-
utm_medium: external_exports.string().describe("The UTM medium to apply to the destination URL.").nullable().optional(),
|
|
258
|
-
utm_campaign: external_exports.string().describe("The UTM campaign to apply to the destination URL.").nullable().optional(),
|
|
259
|
-
utm_term: external_exports.string().describe("The UTM term to apply to the destination URL.").nullable().optional(),
|
|
260
|
-
utm_content: external_exports.string().describe("The UTM content to apply to the destination URL.").nullable().optional(),
|
|
261
|
-
ref: external_exports.string().describe("The referral query parameter to apply to the destination URL.").nullable().optional(),
|
|
262
|
-
webhookIds: external_exports.array(external_exports.string().describe("A Dub webhook ID.")).describe("Webhook IDs to trigger when the link is clicked.").nullable().optional(),
|
|
263
|
-
testVariants: external_exports.array(external_exports.strictObject({
|
|
264
|
-
url: external_exports.url().describe("The variant destination URL.").optional(),
|
|
265
|
-
percentage: external_exports.int().min(10).max(90).describe("The traffic percentage for this variant.").optional()
|
|
266
|
-
}).describe("An A/B test URL variant.")).min(2).max(4).describe("A/B test URL variants for the short link.").nullable().optional(),
|
|
267
|
-
testStartedAt: external_exports.string().describe("The ISO-8601 timestamp when A/B testing started.").nullable().optional(),
|
|
268
|
-
testCompletedAt: external_exports.string().describe("The ISO-8601 timestamp when A/B testing completes.").nullable().optional()
|
|
269
|
-
}).describe("Input parameters for creating a Dub link.");
|
|
270
|
-
var createLinkOutput = external_exports.strictObject({
|
|
271
|
-
link: external_exports.strictObject({
|
|
272
|
-
id: external_exports.string().describe("The unique ID of the Dub link.").optional(),
|
|
273
|
-
domain: external_exports.string().describe("The domain of the short link.").optional(),
|
|
274
|
-
key: external_exports.string().describe("The short-link slug.").optional(),
|
|
275
|
-
url: external_exports.string().describe("The destination URL of the link.").optional(),
|
|
276
|
-
shortLink: external_exports.string().describe("The full short-link URL.").nullable().optional(),
|
|
277
|
-
qrCode: external_exports.string().describe("The QR code URL for the short link.").nullable().optional(),
|
|
278
|
-
title: external_exports.string().describe("The custom link preview title.").nullable().optional(),
|
|
279
|
-
archived: external_exports.boolean().describe("Whether the link is archived.").nullable().optional(),
|
|
280
|
-
clicks: external_exports.number().describe("The number of recorded clicks.").nullable().optional(),
|
|
281
|
-
leads: external_exports.number().describe("The number of generated leads.").nullable().optional(),
|
|
282
|
-
sales: external_exports.number().describe("The number of generated sales.").nullable().optional(),
|
|
283
|
-
saleAmount: external_exports.number().describe("The total sales amount in cents.").nullable().optional(),
|
|
284
|
-
createdAt: external_exports.string().describe("The timestamp when the link was created.").nullable().optional(),
|
|
285
|
-
updatedAt: external_exports.string().describe("The timestamp when the link was last updated.").nullable().optional(),
|
|
286
|
-
raw: external_exports.looseObject({}).describe("The raw Dub link payload.").optional()
|
|
287
|
-
}).describe("A normalized Dub link returned by the connector.").optional()
|
|
288
|
-
}).describe("A Dub link action result.");
|
|
289
|
-
var listLinksInput = external_exports.strictObject({
|
|
290
|
-
domain: external_exports.string().describe("Only return links for this domain.").optional(),
|
|
291
|
-
tagIds: external_exports.union([external_exports.string().describe("A Dub tag ID."), external_exports.array(external_exports.string().describe("A Dub identifier or name.")).min(1).describe("Dub tag IDs.")]).describe("Only return links with these tag IDs.").optional(),
|
|
292
|
-
tagNames: external_exports.union([external_exports.string().describe("A Dub tag name."), external_exports.array(external_exports.string().describe("A Dub identifier or name.")).min(1).describe("Dub tag names.")]).describe("Only return links with these tag names.").optional(),
|
|
293
|
-
folderId: external_exports.string().describe("Only return links in this folder.").optional(),
|
|
294
|
-
search: external_exports.string().describe("Search against link slugs and destination URLs.").optional(),
|
|
295
|
-
userId: external_exports.string().describe("Only return links created by this Dub user ID.").optional(),
|
|
296
|
-
tenantId: external_exports.string().describe("Only return links for this tenant ID.").optional(),
|
|
297
|
-
showArchived: external_exports.boolean().describe("Whether archived links should be included.").optional(),
|
|
298
|
-
sortBy: external_exports.enum(["createdAt", "clicks", "saleAmount", "lastClicked"]).describe("The field used to sort links.").optional(),
|
|
299
|
-
sortOrder: external_exports.enum(["asc", "desc"]).describe("The sort direction.").optional(),
|
|
300
|
-
endingBefore: external_exports.string().describe("Return links before this cursor.").optional(),
|
|
301
|
-
startingAfter: external_exports.string().describe("Return links after this cursor.").optional(),
|
|
302
|
-
pageSize: external_exports.int().max(100).gt(0).describe("The number of links to return.").optional()
|
|
303
|
-
}).describe("Filters and pagination options for listing Dub links.");
|
|
304
|
-
var listLinksOutput = external_exports.strictObject({
|
|
305
|
-
links: external_exports.array(external_exports.strictObject({
|
|
306
|
-
id: external_exports.string().describe("The unique ID of the Dub link.").optional(),
|
|
307
|
-
domain: external_exports.string().describe("The domain of the short link.").optional(),
|
|
308
|
-
key: external_exports.string().describe("The short-link slug.").optional(),
|
|
309
|
-
url: external_exports.string().describe("The destination URL of the link.").optional(),
|
|
310
|
-
shortLink: external_exports.string().describe("The full short-link URL.").nullable().optional(),
|
|
311
|
-
qrCode: external_exports.string().describe("The QR code URL for the short link.").nullable().optional(),
|
|
312
|
-
title: external_exports.string().describe("The custom link preview title.").nullable().optional(),
|
|
313
|
-
archived: external_exports.boolean().describe("Whether the link is archived.").nullable().optional(),
|
|
314
|
-
clicks: external_exports.number().describe("The number of recorded clicks.").nullable().optional(),
|
|
315
|
-
leads: external_exports.number().describe("The number of generated leads.").nullable().optional(),
|
|
316
|
-
sales: external_exports.number().describe("The number of generated sales.").nullable().optional(),
|
|
317
|
-
saleAmount: external_exports.number().describe("The total sales amount in cents.").nullable().optional(),
|
|
318
|
-
createdAt: external_exports.string().describe("The timestamp when the link was created.").nullable().optional(),
|
|
319
|
-
updatedAt: external_exports.string().describe("The timestamp when the link was last updated.").nullable().optional(),
|
|
320
|
-
raw: external_exports.looseObject({}).describe("The raw Dub link payload.").optional()
|
|
321
|
-
}).describe("A normalized Dub link returned by the connector.")).describe("Dub links returned by the API.").optional()
|
|
322
|
-
}).describe("A list of Dub links.");
|
|
323
|
-
var retrieveLinkInput = external_exports.strictObject({
|
|
324
|
-
linkId: external_exports.string().describe("The Dub link ID to retrieve.").optional(),
|
|
325
|
-
domain: external_exports.string().describe("The short-link domain used with key lookup.").optional(),
|
|
326
|
-
key: external_exports.string().describe("The short-link slug used with domain lookup.").optional(),
|
|
327
|
-
externalId: external_exports.string().describe("The external ID for the link. Prefix with ext_ when required by Dub.").optional()
|
|
328
|
-
}).describe("Identifiers for retrieving a Dub link.");
|
|
329
|
-
var retrieveLinkOutput = external_exports.strictObject({
|
|
330
|
-
link: external_exports.strictObject({
|
|
331
|
-
id: external_exports.string().describe("The unique ID of the Dub link.").optional(),
|
|
332
|
-
domain: external_exports.string().describe("The domain of the short link.").optional(),
|
|
333
|
-
key: external_exports.string().describe("The short-link slug.").optional(),
|
|
334
|
-
url: external_exports.string().describe("The destination URL of the link.").optional(),
|
|
335
|
-
shortLink: external_exports.string().describe("The full short-link URL.").nullable().optional(),
|
|
336
|
-
qrCode: external_exports.string().describe("The QR code URL for the short link.").nullable().optional(),
|
|
337
|
-
title: external_exports.string().describe("The custom link preview title.").nullable().optional(),
|
|
338
|
-
archived: external_exports.boolean().describe("Whether the link is archived.").nullable().optional(),
|
|
339
|
-
clicks: external_exports.number().describe("The number of recorded clicks.").nullable().optional(),
|
|
340
|
-
leads: external_exports.number().describe("The number of generated leads.").nullable().optional(),
|
|
341
|
-
sales: external_exports.number().describe("The number of generated sales.").nullable().optional(),
|
|
342
|
-
saleAmount: external_exports.number().describe("The total sales amount in cents.").nullable().optional(),
|
|
343
|
-
createdAt: external_exports.string().describe("The timestamp when the link was created.").nullable().optional(),
|
|
344
|
-
updatedAt: external_exports.string().describe("The timestamp when the link was last updated.").nullable().optional(),
|
|
345
|
-
raw: external_exports.looseObject({}).describe("The raw Dub link payload.").optional()
|
|
346
|
-
}).describe("A normalized Dub link returned by the connector.").optional()
|
|
347
|
-
}).describe("A Dub link action result.");
|
|
348
|
-
var updateLinkInput = external_exports.strictObject({
|
|
349
|
-
linkId: external_exports.string().min(1).describe("The Dub link ID to update."),
|
|
350
|
-
url: external_exports.url().max(32e3).describe("The destination URL of the short link.").optional(),
|
|
351
|
-
domain: external_exports.string().max(190).describe("The short-link domain without protocol.").optional(),
|
|
352
|
-
key: external_exports.string().max(190).describe("The short-link slug.").optional(),
|
|
353
|
-
keyLength: external_exports.int().min(3).max(190).describe("The length of the generated short-link slug.").optional(),
|
|
354
|
-
externalId: external_exports.string().max(255).describe("The ID of the link in your database.").nullable().optional(),
|
|
355
|
-
tenantId: external_exports.string().max(255).describe("The tenant ID that created the link in your system.").nullable().optional(),
|
|
356
|
-
programId: external_exports.string().describe("The partner program ID associated with the link.").nullable().optional(),
|
|
357
|
-
partnerId: external_exports.string().describe("The partner ID associated with the link.").nullable().optional(),
|
|
358
|
-
prefix: external_exports.string().describe("The prefix used for randomly generated slugs.").optional(),
|
|
359
|
-
trackConversion: external_exports.boolean().describe("Whether Dub should track conversions for this link.").optional(),
|
|
360
|
-
archived: external_exports.boolean().describe("Whether the link should be archived.").optional(),
|
|
361
|
-
tagIds: external_exports.union([external_exports.string().describe("A Dub tag ID."), external_exports.array(external_exports.string().describe("A Dub identifier or name.")).min(1).describe("Dub tag IDs assigned to the link.")]).describe("The tag IDs assigned to the link.").optional(),
|
|
362
|
-
tagNames: external_exports.union([external_exports.string().describe("A Dub tag name."), external_exports.array(external_exports.string().describe("A Dub identifier or name.")).min(1).describe("Dub tag names assigned to the link.")]).describe("The tag names assigned to the link.").optional(),
|
|
363
|
-
folderId: external_exports.string().describe("The folder ID assigned to the link.").nullable().optional(),
|
|
364
|
-
comments: external_exports.string().describe("Comments for the link.").nullable().optional(),
|
|
365
|
-
expiresAt: external_exports.string().describe("The ISO-8601 timestamp when the link expires.").nullable().optional(),
|
|
366
|
-
expiredUrl: external_exports.url().max(32e3).describe("The URL used when the short link has expired.").nullable().optional(),
|
|
367
|
-
password: external_exports.string().describe("The password required to access the destination URL.").nullable().optional(),
|
|
368
|
-
proxy: external_exports.boolean().describe("Whether the link uses Dub custom link previews.").optional(),
|
|
369
|
-
title: external_exports.string().describe("The custom link preview title.").nullable().optional(),
|
|
370
|
-
description: external_exports.string().describe("The custom link preview description.").nullable().optional(),
|
|
371
|
-
image: external_exports.string().describe("The custom link preview image URL.").nullable().optional(),
|
|
372
|
-
video: external_exports.string().describe("The custom link preview video URL.").nullable().optional(),
|
|
373
|
-
rewrite: external_exports.boolean().describe("Whether the link uses link cloaking.").optional(),
|
|
374
|
-
ios: external_exports.url().max(32e3).describe("The iOS destination URL for device targeting.").nullable().optional(),
|
|
375
|
-
android: external_exports.url().max(32e3).describe("The Android destination URL for device targeting.").nullable().optional(),
|
|
376
|
-
geo: external_exports.record(external_exports.string(), external_exports.url().max(32e3).describe("The destination URL for this country.")).describe("Geo targeting destinations keyed by country code.").nullable().optional(),
|
|
377
|
-
doIndex: external_exports.boolean().describe("Whether search engines may index the short link.").optional(),
|
|
378
|
-
utm_source: external_exports.string().describe("The UTM source to apply to the destination URL.").nullable().optional(),
|
|
379
|
-
utm_medium: external_exports.string().describe("The UTM medium to apply to the destination URL.").nullable().optional(),
|
|
380
|
-
utm_campaign: external_exports.string().describe("The UTM campaign to apply to the destination URL.").nullable().optional(),
|
|
381
|
-
utm_term: external_exports.string().describe("The UTM term to apply to the destination URL.").nullable().optional(),
|
|
382
|
-
utm_content: external_exports.string().describe("The UTM content to apply to the destination URL.").nullable().optional(),
|
|
383
|
-
ref: external_exports.string().describe("The referral query parameter to apply to the destination URL.").nullable().optional(),
|
|
384
|
-
webhookIds: external_exports.array(external_exports.string().describe("A Dub webhook ID.")).describe("Webhook IDs to trigger when the link is clicked.").nullable().optional(),
|
|
385
|
-
testVariants: external_exports.array(external_exports.strictObject({
|
|
386
|
-
url: external_exports.url().describe("The variant destination URL.").optional(),
|
|
387
|
-
percentage: external_exports.int().min(10).max(90).describe("The traffic percentage for this variant.").optional()
|
|
388
|
-
}).describe("An A/B test URL variant.")).min(2).max(4).describe("A/B test URL variants for the short link.").nullable().optional(),
|
|
389
|
-
testStartedAt: external_exports.string().describe("The ISO-8601 timestamp when A/B testing started.").nullable().optional(),
|
|
390
|
-
testCompletedAt: external_exports.string().describe("The ISO-8601 timestamp when A/B testing completes.").nullable().optional()
|
|
391
|
-
}).describe("Input parameters for updating a Dub link.");
|
|
392
|
-
var updateLinkOutput = external_exports.strictObject({
|
|
393
|
-
link: external_exports.strictObject({
|
|
394
|
-
id: external_exports.string().describe("The unique ID of the Dub link.").optional(),
|
|
395
|
-
domain: external_exports.string().describe("The domain of the short link.").optional(),
|
|
396
|
-
key: external_exports.string().describe("The short-link slug.").optional(),
|
|
397
|
-
url: external_exports.string().describe("The destination URL of the link.").optional(),
|
|
398
|
-
shortLink: external_exports.string().describe("The full short-link URL.").nullable().optional(),
|
|
399
|
-
qrCode: external_exports.string().describe("The QR code URL for the short link.").nullable().optional(),
|
|
400
|
-
title: external_exports.string().describe("The custom link preview title.").nullable().optional(),
|
|
401
|
-
archived: external_exports.boolean().describe("Whether the link is archived.").nullable().optional(),
|
|
402
|
-
clicks: external_exports.number().describe("The number of recorded clicks.").nullable().optional(),
|
|
403
|
-
leads: external_exports.number().describe("The number of generated leads.").nullable().optional(),
|
|
404
|
-
sales: external_exports.number().describe("The number of generated sales.").nullable().optional(),
|
|
405
|
-
saleAmount: external_exports.number().describe("The total sales amount in cents.").nullable().optional(),
|
|
406
|
-
createdAt: external_exports.string().describe("The timestamp when the link was created.").nullable().optional(),
|
|
407
|
-
updatedAt: external_exports.string().describe("The timestamp when the link was last updated.").nullable().optional(),
|
|
408
|
-
raw: external_exports.looseObject({}).describe("The raw Dub link payload.").optional()
|
|
409
|
-
}).describe("A normalized Dub link returned by the connector.").optional()
|
|
410
|
-
}).describe("A Dub link action result.");
|
|
411
|
-
var deleteLinkInput = external_exports.strictObject({
|
|
412
|
-
linkId: external_exports.string().min(1).describe("The Dub link ID to delete.").optional()
|
|
413
|
-
}).describe("Identifier for deleting a Dub link.");
|
|
414
|
-
var deleteLinkOutput = external_exports.strictObject({
|
|
415
|
-
deleted: external_exports.boolean().describe("Whether the connector completed the delete request.").optional(),
|
|
416
|
-
raw: external_exports.unknown().describe("The raw Dub deletion response, if any.").nullable().optional()
|
|
417
|
-
}).describe("A Dub link deletion acknowledgement.");
|
|
418
|
-
var countLinksInput = external_exports.strictObject({
|
|
419
|
-
domain: external_exports.string().describe("Only count links for this domain.").optional(),
|
|
420
|
-
tagIds: external_exports.union([external_exports.string().describe("A Dub tag ID."), external_exports.array(external_exports.string().describe("A Dub identifier or name.")).min(1).describe("Dub tag IDs.")]).describe("Only count links with these tag IDs.").optional(),
|
|
421
|
-
tagNames: external_exports.union([external_exports.string().describe("A Dub tag name."), external_exports.array(external_exports.string().describe("A Dub identifier or name.")).min(1).describe("Dub tag names.")]).describe("Only count links with these tag names.").optional(),
|
|
422
|
-
folderId: external_exports.string().describe("Only count links in this folder.").optional(),
|
|
423
|
-
search: external_exports.string().describe("Search against link slugs and destination URLs.").optional(),
|
|
424
|
-
userId: external_exports.string().describe("Only count links created by this Dub user ID.").optional(),
|
|
425
|
-
tenantId: external_exports.string().describe("Only count links for this tenant ID.").optional(),
|
|
426
|
-
showArchived: external_exports.boolean().describe("Whether archived links should be included.").optional()
|
|
427
|
-
}).describe("Filters for counting Dub links.");
|
|
428
|
-
var countLinksOutput = external_exports.strictObject({
|
|
429
|
-
count: external_exports.number().describe("The number of matching Dub links.").optional(),
|
|
430
|
-
raw: external_exports.unknown().describe("The raw Dub count response.").optional()
|
|
431
|
-
}).describe("The Dub links count result.");
|
|
432
|
-
var listTagsInput = external_exports.strictObject({
|
|
433
|
-
page: external_exports.int().gt(0).describe("The page number to retrieve.").optional(),
|
|
434
|
-
pageSize: external_exports.int().max(100).gt(0).describe("The number of tags to return.").optional()
|
|
435
|
-
}).describe("Pagination options for listing Dub tags.");
|
|
436
|
-
var listTagsOutput = external_exports.strictObject({
|
|
437
|
-
tags: external_exports.array(external_exports.strictObject({
|
|
438
|
-
id: external_exports.string().describe("The unique ID of the tag.").optional(),
|
|
439
|
-
name: external_exports.string().describe("The tag name.").optional(),
|
|
440
|
-
color: external_exports.string().describe("The tag color.").nullable().optional(),
|
|
441
|
-
raw: external_exports.looseObject({}).describe("The raw Dub tag payload.").optional()
|
|
442
|
-
}).describe("A normalized Dub tag.")).describe("Dub tags returned by the API.").optional()
|
|
443
|
-
}).describe("A list of Dub tags.");
|
|
444
|
-
var createTagInput = external_exports.strictObject({
|
|
445
|
-
name: external_exports.string().min(1).describe("The tag name."),
|
|
446
|
-
color: external_exports.enum(["red", "yellow", "green", "blue", "purple", "brown", "gray", "pink"]).describe("The Dub tag color.").optional()
|
|
447
|
-
}).describe("Input parameters for creating a Dub tag.");
|
|
448
|
-
var createTagOutput = external_exports.strictObject({
|
|
449
|
-
tag: external_exports.strictObject({
|
|
450
|
-
id: external_exports.string().describe("The unique ID of the tag.").optional(),
|
|
451
|
-
name: external_exports.string().describe("The tag name.").optional(),
|
|
452
|
-
color: external_exports.string().describe("The tag color.").nullable().optional(),
|
|
453
|
-
raw: external_exports.looseObject({}).describe("The raw Dub tag payload.").optional()
|
|
454
|
-
}).describe("A normalized Dub tag.").optional()
|
|
455
|
-
}).describe("A Dub tag action result.");
|
|
456
|
-
var updateTagInput = external_exports.strictObject({
|
|
457
|
-
id: external_exports.string().min(1).describe("The Dub tag ID to update."),
|
|
458
|
-
name: external_exports.string().min(1).describe("The updated tag name.").optional(),
|
|
459
|
-
color: external_exports.enum(["red", "yellow", "green", "blue", "purple", "brown", "gray", "pink"]).describe("The Dub tag color.").optional()
|
|
460
|
-
}).describe("Input parameters for updating a Dub tag.");
|
|
461
|
-
var updateTagOutput = external_exports.strictObject({
|
|
462
|
-
tag: external_exports.strictObject({
|
|
463
|
-
id: external_exports.string().describe("The unique ID of the tag.").optional(),
|
|
464
|
-
name: external_exports.string().describe("The tag name.").optional(),
|
|
465
|
-
color: external_exports.string().describe("The tag color.").nullable().optional(),
|
|
466
|
-
raw: external_exports.looseObject({}).describe("The raw Dub tag payload.").optional()
|
|
467
|
-
}).describe("A normalized Dub tag.").optional()
|
|
468
|
-
}).describe("A Dub tag action result.");
|
|
469
|
-
var deleteTagInput = external_exports.strictObject({
|
|
470
|
-
id: external_exports.string().min(1).describe("The Dub tag ID to delete.").optional()
|
|
471
|
-
}).describe("Identifier for deleting a Dub tag.");
|
|
472
|
-
var deleteTagOutput = external_exports.strictObject({
|
|
473
|
-
deleted: external_exports.boolean().describe("Whether the connector completed the delete request.").optional(),
|
|
474
|
-
raw: external_exports.unknown().describe("The raw Dub deletion response, if any.").nullable().optional()
|
|
475
|
-
}).describe("A Dub link deletion acknowledgement.");
|
|
476
|
-
var listFoldersInput = external_exports.strictObject({
|
|
477
|
-
page: external_exports.int().gt(0).describe("The page number to retrieve.").optional(),
|
|
478
|
-
pageSize: external_exports.int().max(100).gt(0).describe("The number of folders to return.").optional()
|
|
479
|
-
}).describe("Pagination options for listing Dub folders.");
|
|
480
|
-
var listFoldersOutput = external_exports.strictObject({
|
|
481
|
-
folders: external_exports.array(external_exports.strictObject({
|
|
482
|
-
id: external_exports.string().describe("The unique ID of the folder.").optional(),
|
|
483
|
-
name: external_exports.string().describe("The folder name.").optional(),
|
|
484
|
-
accessLevel: external_exports.string().describe("The folder access level returned by Dub.").nullable().optional(),
|
|
485
|
-
raw: external_exports.looseObject({}).describe("The raw Dub folder payload.").optional()
|
|
486
|
-
}).describe("A normalized Dub folder.")).describe("Dub folders returned by the API.").optional()
|
|
487
|
-
}).describe("A list of Dub folders.");
|
|
488
|
-
var createFolderInput = external_exports.strictObject({
|
|
489
|
-
name: external_exports.string().min(1).describe("The folder name.").optional()
|
|
490
|
-
}).describe("Input parameters for creating a Dub folder.");
|
|
491
|
-
var createFolderOutput = external_exports.strictObject({
|
|
492
|
-
folder: external_exports.strictObject({
|
|
493
|
-
id: external_exports.string().describe("The unique ID of the folder.").optional(),
|
|
494
|
-
name: external_exports.string().describe("The folder name.").optional(),
|
|
495
|
-
accessLevel: external_exports.string().describe("The folder access level returned by Dub.").nullable().optional(),
|
|
496
|
-
raw: external_exports.looseObject({}).describe("The raw Dub folder payload.").optional()
|
|
497
|
-
}).describe("A normalized Dub folder.").optional()
|
|
498
|
-
}).describe("A Dub folder action result.");
|
|
499
|
-
var updateFolderInput = external_exports.strictObject({
|
|
500
|
-
id: external_exports.string().min(1).describe("The Dub folder ID to update.").optional(),
|
|
501
|
-
name: external_exports.string().min(1).describe("The updated folder name.").optional()
|
|
502
|
-
}).describe("Input parameters for updating a Dub folder.");
|
|
503
|
-
var updateFolderOutput = external_exports.strictObject({
|
|
504
|
-
folder: external_exports.strictObject({
|
|
505
|
-
id: external_exports.string().describe("The unique ID of the folder.").optional(),
|
|
506
|
-
name: external_exports.string().describe("The folder name.").optional(),
|
|
507
|
-
accessLevel: external_exports.string().describe("The folder access level returned by Dub.").nullable().optional(),
|
|
508
|
-
raw: external_exports.looseObject({}).describe("The raw Dub folder payload.").optional()
|
|
509
|
-
}).describe("A normalized Dub folder.").optional()
|
|
510
|
-
}).describe("A Dub folder action result.");
|
|
511
|
-
var deleteFolderInput = external_exports.strictObject({
|
|
512
|
-
id: external_exports.string().min(1).describe("The Dub folder ID to delete.").optional()
|
|
513
|
-
}).describe("Identifier for deleting a Dub folder.");
|
|
514
|
-
var deleteFolderOutput = external_exports.strictObject({
|
|
515
|
-
deleted: external_exports.boolean().describe("Whether the connector completed the delete request.").optional(),
|
|
516
|
-
raw: external_exports.unknown().describe("The raw Dub deletion response, if any.").nullable().optional()
|
|
517
|
-
}).describe("A Dub link deletion acknowledgement.");
|
|
518
|
-
var retrieveAnalyticsInput = external_exports.strictObject({
|
|
519
|
-
event: external_exports.enum(["clicks", "leads", "sales", "composite"]).describe("The event metric to retrieve from Dub analytics.").optional(),
|
|
520
|
-
groupBy: external_exports.enum(["count", "timeseries", "continents", "regions", "countries", "cities", "devices", "browsers", "os", "trigger", "triggers", "referers", "referer_urls", "top_folders", "top_link_tags", "top_domains", "top_links", "top_urls", "top_base_urls", "top_partners", "top_groups", "top_partner_tags", "utm_sources", "utm_mediums", "utm_campaigns", "utm_terms", "utm_contents"]).describe("The dimension used to group Dub analytics.").optional(),
|
|
521
|
-
domain: external_exports.string().describe("The domain filter for analytics.").optional(),
|
|
522
|
-
key: external_exports.string().describe("The link slug used with a domain filter.").optional(),
|
|
523
|
-
linkId: external_exports.string().describe("The Dub link ID filter.").optional(),
|
|
524
|
-
externalId: external_exports.string().describe("The external link ID filter.").optional(),
|
|
525
|
-
tenantId: external_exports.string().describe("The tenant ID filter.").optional(),
|
|
526
|
-
tagId: external_exports.string().describe("The tag ID filter.").optional(),
|
|
527
|
-
folderId: external_exports.string().describe("The folder ID filter.").optional(),
|
|
528
|
-
partnerTagId: external_exports.string().describe("The partner tag ID filter.").optional(),
|
|
529
|
-
groupId: external_exports.string().describe("The partner group ID filter.").optional(),
|
|
530
|
-
partnerId: external_exports.string().describe("The partner ID filter.").optional(),
|
|
531
|
-
customerId: external_exports.string().describe("The customer ID filter.").optional(),
|
|
532
|
-
interval: external_exports.enum(["24h", "7d", "30d", "90d", "1y", "mtd", "qtd", "ytd", "all"]).describe("The analytics date range shortcut.").optional(),
|
|
533
|
-
start: external_exports.string().describe("The start timestamp for the analytics range.").optional(),
|
|
534
|
-
end: external_exports.string().describe("The end timestamp for the analytics range.").optional(),
|
|
535
|
-
timezone: external_exports.string().describe("The IANA time zone used to align timeseries buckets.").optional(),
|
|
536
|
-
country: external_exports.string().describe("The country filter using ISO 3166-1 alpha-2 codes.").optional(),
|
|
537
|
-
city: external_exports.string().describe("The city filter.").optional(),
|
|
538
|
-
region: external_exports.string().describe("The ISO 3166-2 region code filter.").optional(),
|
|
539
|
-
continent: external_exports.string().describe("The continent filter.").optional(),
|
|
540
|
-
device: external_exports.string().describe("The device filter.").optional(),
|
|
541
|
-
browser: external_exports.string().describe("The browser filter.").optional(),
|
|
542
|
-
os: external_exports.string().describe("The operating system filter.").optional(),
|
|
543
|
-
trigger: external_exports.string().describe("The trigger filter.").optional(),
|
|
544
|
-
referer: external_exports.string().describe("The referer hostname filter.").optional(),
|
|
545
|
-
refererUrl: external_exports.string().describe("The full referer URL filter.").optional(),
|
|
546
|
-
url: external_exports.string().describe("The destination URL filter.").optional(),
|
|
547
|
-
utm_source: external_exports.string().describe("The UTM source filter.").optional(),
|
|
548
|
-
utm_medium: external_exports.string().describe("The UTM medium filter.").optional(),
|
|
549
|
-
utm_campaign: external_exports.string().describe("The UTM campaign filter.").optional(),
|
|
550
|
-
utm_term: external_exports.string().describe("The UTM term filter.").optional(),
|
|
551
|
-
utm_content: external_exports.string().describe("The UTM content filter.").optional()
|
|
552
|
-
}).describe("Filters for retrieving Dub analytics.");
|
|
553
|
-
var retrieveAnalyticsOutput = external_exports.strictObject({
|
|
554
|
-
data: external_exports.unknown().describe("The analytics data returned by Dub.").optional()
|
|
555
|
-
}).describe("A Dub analytics result.");
|
|
556
|
-
var dubActions = {
|
|
557
|
-
create_link: {
|
|
558
|
-
description: "Create a short link in the authenticated Dub workspace.",
|
|
559
|
-
effect: "write",
|
|
560
|
-
inputSchema: createLinkInput,
|
|
561
|
-
outputSchema: external_exports.toJSONSchema(createLinkOutput, { io: "output", unrepresentable: "any" })
|
|
562
|
-
},
|
|
563
|
-
list_links: {
|
|
564
|
-
description: "List short links in the authenticated Dub workspace.",
|
|
565
|
-
effect: "read",
|
|
566
|
-
inputSchema: listLinksInput,
|
|
567
|
-
outputSchema: external_exports.toJSONSchema(listLinksOutput, { io: "output", unrepresentable: "any" })
|
|
568
|
-
},
|
|
569
|
-
retrieve_link: {
|
|
570
|
-
description: "Retrieve a Dub short link by ID or by supported lookup fields.",
|
|
571
|
-
effect: "read",
|
|
572
|
-
inputSchema: retrieveLinkInput,
|
|
573
|
-
outputSchema: external_exports.toJSONSchema(retrieveLinkOutput, { io: "output", unrepresentable: "any" })
|
|
574
|
-
},
|
|
575
|
-
update_link: {
|
|
576
|
-
description: "Update a short link in the authenticated Dub workspace.",
|
|
577
|
-
effect: "write",
|
|
578
|
-
inputSchema: updateLinkInput,
|
|
579
|
-
outputSchema: external_exports.toJSONSchema(updateLinkOutput, { io: "output", unrepresentable: "any" })
|
|
580
|
-
},
|
|
581
|
-
delete_link: {
|
|
582
|
-
description: "Delete a short link from the authenticated Dub workspace.",
|
|
583
|
-
effect: "destructive",
|
|
584
|
-
inputSchema: deleteLinkInput,
|
|
585
|
-
outputSchema: external_exports.toJSONSchema(deleteLinkOutput, { io: "output", unrepresentable: "any" })
|
|
586
|
-
},
|
|
587
|
-
count_links: {
|
|
588
|
-
description: "Retrieve the number of matching links in the authenticated Dub workspace.",
|
|
589
|
-
effect: "read",
|
|
590
|
-
inputSchema: countLinksInput,
|
|
591
|
-
outputSchema: external_exports.toJSONSchema(countLinksOutput, { io: "output", unrepresentable: "any" })
|
|
592
|
-
},
|
|
593
|
-
list_tags: {
|
|
594
|
-
description: "List tags in the authenticated Dub workspace.",
|
|
595
|
-
effect: "read",
|
|
596
|
-
inputSchema: listTagsInput,
|
|
597
|
-
outputSchema: external_exports.toJSONSchema(listTagsOutput, { io: "output", unrepresentable: "any" })
|
|
598
|
-
},
|
|
599
|
-
create_tag: {
|
|
600
|
-
description: "Create a tag in the authenticated Dub workspace.",
|
|
601
|
-
effect: "write",
|
|
602
|
-
inputSchema: createTagInput,
|
|
603
|
-
outputSchema: external_exports.toJSONSchema(createTagOutput, { io: "output", unrepresentable: "any" })
|
|
604
|
-
},
|
|
605
|
-
update_tag: {
|
|
606
|
-
description: "Update a tag in the authenticated Dub workspace.",
|
|
607
|
-
effect: "write",
|
|
608
|
-
inputSchema: updateTagInput,
|
|
609
|
-
outputSchema: external_exports.toJSONSchema(updateTagOutput, { io: "output", unrepresentable: "any" })
|
|
610
|
-
},
|
|
611
|
-
delete_tag: {
|
|
612
|
-
description: "Delete a tag from the authenticated Dub workspace.",
|
|
613
|
-
effect: "destructive",
|
|
614
|
-
inputSchema: deleteTagInput,
|
|
615
|
-
outputSchema: external_exports.toJSONSchema(deleteTagOutput, { io: "output", unrepresentable: "any" })
|
|
616
|
-
},
|
|
617
|
-
list_folders: {
|
|
618
|
-
description: "List folders in the authenticated Dub workspace.",
|
|
619
|
-
effect: "read",
|
|
620
|
-
inputSchema: listFoldersInput,
|
|
621
|
-
outputSchema: external_exports.toJSONSchema(listFoldersOutput, { io: "output", unrepresentable: "any" })
|
|
622
|
-
},
|
|
623
|
-
create_folder: {
|
|
624
|
-
description: "Create a folder in the authenticated Dub workspace.",
|
|
625
|
-
effect: "write",
|
|
626
|
-
inputSchema: createFolderInput,
|
|
627
|
-
outputSchema: external_exports.toJSONSchema(createFolderOutput, { io: "output", unrepresentable: "any" })
|
|
628
|
-
},
|
|
629
|
-
update_folder: {
|
|
630
|
-
description: "Update a folder in the authenticated Dub workspace.",
|
|
631
|
-
effect: "write",
|
|
632
|
-
inputSchema: updateFolderInput,
|
|
633
|
-
outputSchema: external_exports.toJSONSchema(updateFolderOutput, { io: "output", unrepresentable: "any" })
|
|
634
|
-
},
|
|
635
|
-
delete_folder: {
|
|
636
|
-
description: "Delete a folder from the authenticated Dub workspace.",
|
|
637
|
-
effect: "destructive",
|
|
638
|
-
inputSchema: deleteFolderInput,
|
|
639
|
-
outputSchema: external_exports.toJSONSchema(deleteFolderOutput, { io: "output", unrepresentable: "any" })
|
|
640
|
-
},
|
|
641
|
-
retrieve_analytics: {
|
|
642
|
-
description: "Retrieve analytics for a Dub link, domain, or workspace.",
|
|
643
|
-
effect: "read",
|
|
644
|
-
inputSchema: retrieveAnalyticsInput,
|
|
645
|
-
outputSchema: external_exports.toJSONSchema(retrieveAnalyticsOutput, { io: "output", unrepresentable: "any" })
|
|
646
|
-
}
|
|
647
|
-
};
|
|
648
|
-
|
|
649
|
-
// ../plugins/src/dub/index.ts
|
|
650
|
-
function createDubPlugin() {
|
|
651
|
-
return createProviderPlugin({
|
|
652
|
-
description: "Dub",
|
|
653
|
-
actions: dubActions,
|
|
654
|
-
// 上游 credentialValidators 也是打 /links/count 试凭证:只读、无必填入参,最便宜。
|
|
655
|
-
credentialProbe: "count_links",
|
|
656
|
-
handlers: {
|
|
657
|
-
create_link: createLink,
|
|
658
|
-
list_links: listLinks,
|
|
659
|
-
retrieve_link: retrieveLink,
|
|
660
|
-
update_link: updateLink,
|
|
661
|
-
delete_link: deleteLink,
|
|
662
|
-
count_links: countLinks,
|
|
663
|
-
list_tags: listTags,
|
|
664
|
-
create_tag: createTag,
|
|
665
|
-
update_tag: updateTag,
|
|
666
|
-
delete_tag: deleteTag,
|
|
667
|
-
list_folders: listFolders,
|
|
668
|
-
create_folder: createFolder,
|
|
669
|
-
update_folder: updateFolder,
|
|
670
|
-
delete_folder: deleteFolder,
|
|
671
|
-
retrieve_analytics: retrieveAnalytics
|
|
672
|
-
}
|
|
673
|
-
});
|
|
674
|
-
}
|
|
675
|
-
var dub_default = createDubPlugin();
|
|
676
|
-
export {
|
|
677
|
-
createDubPlugin,
|
|
678
|
-
dub_default as default
|
|
679
|
-
};
|