@layervai/qurl-mcp 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +98 -0
- package/dist/client.d.ts +278 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +156 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +34 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/audit-links.d.ts +7 -0
- package/dist/prompts/audit-links.d.ts.map +1 -0
- package/dist/prompts/audit-links.js +31 -0
- package/dist/prompts/audit-links.js.map +1 -0
- package/dist/prompts/rotate-access.d.ts +18 -0
- package/dist/prompts/rotate-access.d.ts.map +1 -0
- package/dist/prompts/rotate-access.js +41 -0
- package/dist/prompts/rotate-access.js.map +1 -0
- package/dist/prompts/secure-a-service.d.ts +38 -0
- package/dist/prompts/secure-a-service.d.ts.map +1 -0
- package/dist/prompts/secure-a-service.js +141 -0
- package/dist/prompts/secure-a-service.js.map +1 -0
- package/dist/resources/_shared.d.ts +31 -0
- package/dist/resources/_shared.d.ts.map +1 -0
- package/dist/resources/_shared.js +42 -0
- package/dist/resources/_shared.js.map +1 -0
- package/dist/resources/links.d.ts +15 -0
- package/dist/resources/links.d.ts.map +1 -0
- package/dist/resources/links.js +22 -0
- package/dist/resources/links.js.map +1 -0
- package/dist/resources/usage.d.ts +15 -0
- package/dist/resources/usage.d.ts.map +1 -0
- package/dist/resources/usage.js +18 -0
- package/dist/resources/usage.js.map +1 -0
- package/dist/server.d.ts +37 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +58 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/_shared.d.ts +78 -0
- package/dist/tools/_shared.d.ts.map +1 -0
- package/dist/tools/_shared.js +80 -0
- package/dist/tools/_shared.js.map +1 -0
- package/dist/tools/batch-create.d.ts +426 -0
- package/dist/tools/batch-create.d.ts.map +1 -0
- package/dist/tools/batch-create.js +81 -0
- package/dist/tools/batch-create.js.map +1 -0
- package/dist/tools/create-qurl.d.ts +316 -0
- package/dist/tools/create-qurl.d.ts.map +1 -0
- package/dist/tools/create-qurl.js +106 -0
- package/dist/tools/create-qurl.js.map +1 -0
- package/dist/tools/delete-qurl.d.ts +55 -0
- package/dist/tools/delete-qurl.d.ts.map +1 -0
- package/dist/tools/delete-qurl.js +76 -0
- package/dist/tools/delete-qurl.js.map +1 -0
- package/dist/tools/extend-qurl.d.ts +238 -0
- package/dist/tools/extend-qurl.d.ts.map +1 -0
- package/dist/tools/extend-qurl.js +45 -0
- package/dist/tools/extend-qurl.js.map +1 -0
- package/dist/tools/get-qurl.d.ts +231 -0
- package/dist/tools/get-qurl.d.ts.map +1 -0
- package/dist/tools/get-qurl.js +39 -0
- package/dist/tools/get-qurl.js.map +1 -0
- package/dist/tools/list-qurls.d.ts +395 -0
- package/dist/tools/list-qurls.d.ts.map +1 -0
- package/dist/tools/list-qurls.js +72 -0
- package/dist/tools/list-qurls.js.map +1 -0
- package/dist/tools/mint-link.d.ts +384 -0
- package/dist/tools/mint-link.d.ts.map +1 -0
- package/dist/tools/mint-link.js +75 -0
- package/dist/tools/mint-link.js.map +1 -0
- package/dist/tools/output-schemas.d.ts +1261 -0
- package/dist/tools/output-schemas.d.ts.map +1 -0
- package/dist/tools/output-schemas.js +173 -0
- package/dist/tools/output-schemas.js.map +1 -0
- package/dist/tools/resolve-qurl.d.ts +72 -0
- package/dist/tools/resolve-qurl.d.ts.map +1 -0
- package/dist/tools/resolve-qurl.js +42 -0
- package/dist/tools/resolve-qurl.js.map +1 -0
- package/dist/tools/update-qurl.d.ts +330 -0
- package/dist/tools/update-qurl.d.ts.map +1 -0
- package/dist/tools/update-qurl.js +96 -0
- package/dist/tools/update-qurl.js.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { IQURLClient } from "../client.js";
|
|
3
|
+
export declare const extendQurlSchema: z.ZodObject<{
|
|
4
|
+
resource_id: z.ZodString;
|
|
5
|
+
extend_by: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
resource_id: string;
|
|
8
|
+
extend_by: string;
|
|
9
|
+
}, {
|
|
10
|
+
resource_id: string;
|
|
11
|
+
extend_by: string;
|
|
12
|
+
}>;
|
|
13
|
+
export declare function extendQurlTool(client: IQURLClient): {
|
|
14
|
+
name: string;
|
|
15
|
+
title: string;
|
|
16
|
+
description: string;
|
|
17
|
+
inputSchema: z.ZodObject<{
|
|
18
|
+
resource_id: z.ZodString;
|
|
19
|
+
extend_by: z.ZodString;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
resource_id: string;
|
|
22
|
+
extend_by: string;
|
|
23
|
+
}, {
|
|
24
|
+
resource_id: string;
|
|
25
|
+
extend_by: string;
|
|
26
|
+
}>;
|
|
27
|
+
outputSchema: z.ZodObject<{
|
|
28
|
+
resource_id: z.ZodString;
|
|
29
|
+
qurl_site: z.ZodOptional<z.ZodString>;
|
|
30
|
+
target_url: z.ZodString;
|
|
31
|
+
description: z.ZodOptional<z.ZodString>;
|
|
32
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
33
|
+
expires_at: z.ZodString;
|
|
34
|
+
created_at: z.ZodString;
|
|
35
|
+
status: z.ZodEnum<["active", "revoked"]>;
|
|
36
|
+
custom_domain: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
37
|
+
preserve_host: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
+
qurl_count: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
qurls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
40
|
+
qurl_id: z.ZodString;
|
|
41
|
+
label: z.ZodOptional<z.ZodString>;
|
|
42
|
+
status: z.ZodEnum<["active", "consumed", "expired", "revoked"]>;
|
|
43
|
+
one_time_use: z.ZodBoolean;
|
|
44
|
+
max_sessions: z.ZodNumber;
|
|
45
|
+
session_duration: z.ZodNumber;
|
|
46
|
+
use_count: z.ZodNumber;
|
|
47
|
+
qurl_site: z.ZodOptional<z.ZodString>;
|
|
48
|
+
access_policy: z.ZodOptional<z.ZodObject<{
|
|
49
|
+
ip_allowlist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
50
|
+
ip_denylist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
51
|
+
geo_allowlist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
52
|
+
geo_denylist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
53
|
+
user_agent_allow_regex: z.ZodOptional<z.ZodString>;
|
|
54
|
+
user_agent_deny_regex: z.ZodOptional<z.ZodString>;
|
|
55
|
+
ai_agent_policy: z.ZodOptional<z.ZodObject<{
|
|
56
|
+
block_all: z.ZodOptional<z.ZodBoolean>;
|
|
57
|
+
deny_categories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
58
|
+
allow_categories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
59
|
+
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
block_all?: boolean | undefined;
|
|
61
|
+
deny_categories?: string[] | undefined;
|
|
62
|
+
allow_categories?: string[] | undefined;
|
|
63
|
+
}, {
|
|
64
|
+
block_all?: boolean | undefined;
|
|
65
|
+
deny_categories?: string[] | undefined;
|
|
66
|
+
allow_categories?: string[] | undefined;
|
|
67
|
+
}>>;
|
|
68
|
+
}, "strip", z.ZodTypeAny, {
|
|
69
|
+
ip_allowlist?: string[] | undefined;
|
|
70
|
+
ip_denylist?: string[] | undefined;
|
|
71
|
+
geo_allowlist?: string[] | undefined;
|
|
72
|
+
geo_denylist?: string[] | undefined;
|
|
73
|
+
user_agent_allow_regex?: string | undefined;
|
|
74
|
+
user_agent_deny_regex?: string | undefined;
|
|
75
|
+
ai_agent_policy?: {
|
|
76
|
+
block_all?: boolean | undefined;
|
|
77
|
+
deny_categories?: string[] | undefined;
|
|
78
|
+
allow_categories?: string[] | undefined;
|
|
79
|
+
} | undefined;
|
|
80
|
+
}, {
|
|
81
|
+
ip_allowlist?: string[] | undefined;
|
|
82
|
+
ip_denylist?: string[] | undefined;
|
|
83
|
+
geo_allowlist?: string[] | undefined;
|
|
84
|
+
geo_denylist?: string[] | undefined;
|
|
85
|
+
user_agent_allow_regex?: string | undefined;
|
|
86
|
+
user_agent_deny_regex?: string | undefined;
|
|
87
|
+
ai_agent_policy?: {
|
|
88
|
+
block_all?: boolean | undefined;
|
|
89
|
+
deny_categories?: string[] | undefined;
|
|
90
|
+
allow_categories?: string[] | undefined;
|
|
91
|
+
} | undefined;
|
|
92
|
+
}>>;
|
|
93
|
+
created_at: z.ZodString;
|
|
94
|
+
expires_at: z.ZodString;
|
|
95
|
+
}, "strip", z.ZodTypeAny, {
|
|
96
|
+
status: "active" | "consumed" | "expired" | "revoked";
|
|
97
|
+
qurl_id: string;
|
|
98
|
+
one_time_use: boolean;
|
|
99
|
+
max_sessions: number;
|
|
100
|
+
session_duration: number;
|
|
101
|
+
use_count: number;
|
|
102
|
+
created_at: string;
|
|
103
|
+
expires_at: string;
|
|
104
|
+
label?: string | undefined;
|
|
105
|
+
qurl_site?: string | undefined;
|
|
106
|
+
access_policy?: {
|
|
107
|
+
ip_allowlist?: string[] | undefined;
|
|
108
|
+
ip_denylist?: string[] | undefined;
|
|
109
|
+
geo_allowlist?: string[] | undefined;
|
|
110
|
+
geo_denylist?: string[] | undefined;
|
|
111
|
+
user_agent_allow_regex?: string | undefined;
|
|
112
|
+
user_agent_deny_regex?: string | undefined;
|
|
113
|
+
ai_agent_policy?: {
|
|
114
|
+
block_all?: boolean | undefined;
|
|
115
|
+
deny_categories?: string[] | undefined;
|
|
116
|
+
allow_categories?: string[] | undefined;
|
|
117
|
+
} | undefined;
|
|
118
|
+
} | undefined;
|
|
119
|
+
}, {
|
|
120
|
+
status: "active" | "consumed" | "expired" | "revoked";
|
|
121
|
+
qurl_id: string;
|
|
122
|
+
one_time_use: boolean;
|
|
123
|
+
max_sessions: number;
|
|
124
|
+
session_duration: number;
|
|
125
|
+
use_count: number;
|
|
126
|
+
created_at: string;
|
|
127
|
+
expires_at: string;
|
|
128
|
+
label?: string | undefined;
|
|
129
|
+
qurl_site?: string | undefined;
|
|
130
|
+
access_policy?: {
|
|
131
|
+
ip_allowlist?: string[] | undefined;
|
|
132
|
+
ip_denylist?: string[] | undefined;
|
|
133
|
+
geo_allowlist?: string[] | undefined;
|
|
134
|
+
geo_denylist?: string[] | undefined;
|
|
135
|
+
user_agent_allow_regex?: string | undefined;
|
|
136
|
+
user_agent_deny_regex?: string | undefined;
|
|
137
|
+
ai_agent_policy?: {
|
|
138
|
+
block_all?: boolean | undefined;
|
|
139
|
+
deny_categories?: string[] | undefined;
|
|
140
|
+
allow_categories?: string[] | undefined;
|
|
141
|
+
} | undefined;
|
|
142
|
+
} | undefined;
|
|
143
|
+
}>, "many">>;
|
|
144
|
+
}, "strip", z.ZodTypeAny, {
|
|
145
|
+
status: "active" | "revoked";
|
|
146
|
+
created_at: string;
|
|
147
|
+
expires_at: string;
|
|
148
|
+
resource_id: string;
|
|
149
|
+
target_url: string;
|
|
150
|
+
qurl_site?: string | undefined;
|
|
151
|
+
description?: string | undefined;
|
|
152
|
+
tags?: string[] | undefined;
|
|
153
|
+
custom_domain?: string | null | undefined;
|
|
154
|
+
preserve_host?: boolean | undefined;
|
|
155
|
+
qurl_count?: number | undefined;
|
|
156
|
+
qurls?: {
|
|
157
|
+
status: "active" | "consumed" | "expired" | "revoked";
|
|
158
|
+
qurl_id: string;
|
|
159
|
+
one_time_use: boolean;
|
|
160
|
+
max_sessions: number;
|
|
161
|
+
session_duration: number;
|
|
162
|
+
use_count: number;
|
|
163
|
+
created_at: string;
|
|
164
|
+
expires_at: string;
|
|
165
|
+
label?: string | undefined;
|
|
166
|
+
qurl_site?: string | undefined;
|
|
167
|
+
access_policy?: {
|
|
168
|
+
ip_allowlist?: string[] | undefined;
|
|
169
|
+
ip_denylist?: string[] | undefined;
|
|
170
|
+
geo_allowlist?: string[] | undefined;
|
|
171
|
+
geo_denylist?: string[] | undefined;
|
|
172
|
+
user_agent_allow_regex?: string | undefined;
|
|
173
|
+
user_agent_deny_regex?: string | undefined;
|
|
174
|
+
ai_agent_policy?: {
|
|
175
|
+
block_all?: boolean | undefined;
|
|
176
|
+
deny_categories?: string[] | undefined;
|
|
177
|
+
allow_categories?: string[] | undefined;
|
|
178
|
+
} | undefined;
|
|
179
|
+
} | undefined;
|
|
180
|
+
}[] | undefined;
|
|
181
|
+
}, {
|
|
182
|
+
status: "active" | "revoked";
|
|
183
|
+
created_at: string;
|
|
184
|
+
expires_at: string;
|
|
185
|
+
resource_id: string;
|
|
186
|
+
target_url: string;
|
|
187
|
+
qurl_site?: string | undefined;
|
|
188
|
+
description?: string | undefined;
|
|
189
|
+
tags?: string[] | undefined;
|
|
190
|
+
custom_domain?: string | null | undefined;
|
|
191
|
+
preserve_host?: boolean | undefined;
|
|
192
|
+
qurl_count?: number | undefined;
|
|
193
|
+
qurls?: {
|
|
194
|
+
status: "active" | "consumed" | "expired" | "revoked";
|
|
195
|
+
qurl_id: string;
|
|
196
|
+
one_time_use: boolean;
|
|
197
|
+
max_sessions: number;
|
|
198
|
+
session_duration: number;
|
|
199
|
+
use_count: number;
|
|
200
|
+
created_at: string;
|
|
201
|
+
expires_at: string;
|
|
202
|
+
label?: string | undefined;
|
|
203
|
+
qurl_site?: string | undefined;
|
|
204
|
+
access_policy?: {
|
|
205
|
+
ip_allowlist?: string[] | undefined;
|
|
206
|
+
ip_denylist?: string[] | undefined;
|
|
207
|
+
geo_allowlist?: string[] | undefined;
|
|
208
|
+
geo_denylist?: string[] | undefined;
|
|
209
|
+
user_agent_allow_regex?: string | undefined;
|
|
210
|
+
user_agent_deny_regex?: string | undefined;
|
|
211
|
+
ai_agent_policy?: {
|
|
212
|
+
block_all?: boolean | undefined;
|
|
213
|
+
deny_categories?: string[] | undefined;
|
|
214
|
+
allow_categories?: string[] | undefined;
|
|
215
|
+
} | undefined;
|
|
216
|
+
} | undefined;
|
|
217
|
+
}[] | undefined;
|
|
218
|
+
}>;
|
|
219
|
+
annotations: {
|
|
220
|
+
title: string;
|
|
221
|
+
readOnlyHint: boolean;
|
|
222
|
+
destructiveHint: boolean;
|
|
223
|
+
idempotentHint: boolean;
|
|
224
|
+
openWorldHint: boolean;
|
|
225
|
+
};
|
|
226
|
+
handler: (input: {
|
|
227
|
+
resource_id: string;
|
|
228
|
+
extend_by: string;
|
|
229
|
+
}) => Promise<{
|
|
230
|
+
content: Array<{
|
|
231
|
+
type: "text";
|
|
232
|
+
text: string;
|
|
233
|
+
}>;
|
|
234
|
+
structuredContent?: Record<string, unknown>;
|
|
235
|
+
isError?: boolean;
|
|
236
|
+
}>;
|
|
237
|
+
};
|
|
238
|
+
//# sourceMappingURL=extend-qurl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extend-qurl.d.ts","sourceRoot":"","sources":["../../src/tools/extend-qurl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAIhD,eAAO,MAAM,gBAAgB;;;;;;;;;EAG3B,CAAC;AAEH,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqCjD"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { resourceIdSchema, toStructuredContent, withMissingApiKeyHandler } from "./_shared.js";
|
|
3
|
+
import { extendQurlOutputSchema } from "./output-schemas.js";
|
|
4
|
+
export const extendQurlSchema = z.object({
|
|
5
|
+
resource_id: resourceIdSchema("extend"),
|
|
6
|
+
extend_by: z.string().min(1).describe('Duration to extend by (e.g., "24h", "7d")'),
|
|
7
|
+
});
|
|
8
|
+
export function extendQurlTool(client) {
|
|
9
|
+
return {
|
|
10
|
+
name: "extend_qurl",
|
|
11
|
+
title: "Extend qURL Expiration",
|
|
12
|
+
description: "Push out the expiration of an active qURL by a relative duration. " +
|
|
13
|
+
"Convenience wrapper for the most common update — equivalent to `update_qurl({ resource_id, extend_by })`. " +
|
|
14
|
+
"Use this when the only change you need is more time on the clock. " +
|
|
15
|
+
"Use `update_qurl` instead when you also need to change tags, description, or set an absolute `expires_at`. " +
|
|
16
|
+
"Use `delete_qurl` when you want to cut off access entirely. " +
|
|
17
|
+
"Accepts both `r_` and `q_` IDs (q_ is auto-resolved to its parent resource). " +
|
|
18
|
+
"**Not idempotent:** calling twice with the same `extend_by` extends the expiration twice. If you need an absolute target, use `update_qurl` with `expires_at` so retries on transient errors don't double-push. " +
|
|
19
|
+
"Returns the updated resource with the new `expires_at` (same shape as `get_qurl`).",
|
|
20
|
+
inputSchema: extendQurlSchema,
|
|
21
|
+
outputSchema: extendQurlOutputSchema,
|
|
22
|
+
annotations: {
|
|
23
|
+
title: "Extend qURL Expiration",
|
|
24
|
+
readOnlyHint: false,
|
|
25
|
+
destructiveHint: false,
|
|
26
|
+
idempotentHint: false,
|
|
27
|
+
openWorldHint: true,
|
|
28
|
+
},
|
|
29
|
+
handler: withMissingApiKeyHandler(async (input) => {
|
|
30
|
+
const result = await client.extendQURL(input.resource_id, {
|
|
31
|
+
extend_by: input.extend_by,
|
|
32
|
+
});
|
|
33
|
+
return {
|
|
34
|
+
content: [
|
|
35
|
+
{
|
|
36
|
+
type: "text",
|
|
37
|
+
text: JSON.stringify(result.data),
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
structuredContent: toStructuredContent(result.data),
|
|
41
|
+
};
|
|
42
|
+
}),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=extend-qurl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extend-qurl.js","sourceRoot":"","sources":["../../src/tools/extend-qurl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAC/F,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,WAAW,EAAE,gBAAgB,CAAC,QAAQ,CAAC;IACvC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,2CAA2C,CAAC;CACnF,CAAC,CAAC;AAEH,MAAM,UAAU,cAAc,CAAC,MAAmB;IAChD,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EACT,oEAAoE;YACpE,4GAA4G;YAC5G,oEAAoE;YACpE,6GAA6G;YAC7G,8DAA8D;YAC9D,+EAA+E;YAC/E,kNAAkN;YAClN,oFAAoF;QACtF,WAAW,EAAE,gBAAgB;QAC7B,YAAY,EAAE,sBAAsB;QACpC,WAAW,EAAE;YACX,KAAK,EAAE,wBAAwB;YAC/B,YAAY,EAAE,KAAK;YACnB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,KAAK;YACrB,aAAa,EAAE,IAAI;SACpB;QACD,OAAO,EAAE,wBAAwB,CAAC,KAAK,EAAE,KAAuC,EAAE,EAAE;YAClF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,WAAW,EAAE;gBACxD,SAAS,EAAE,KAAK,CAAC,SAAS;aAC3B,CAAC,CAAC;YACH,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC;qBAClC;iBACF;gBACD,iBAAiB,EAAE,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC;aACpD,CAAC;QACJ,CAAC,CAAC;KACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { IQURLClient } from "../client.js";
|
|
3
|
+
export declare const getQurlSchema: z.ZodObject<{
|
|
4
|
+
resource_id: z.ZodString;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
resource_id: string;
|
|
7
|
+
}, {
|
|
8
|
+
resource_id: string;
|
|
9
|
+
}>;
|
|
10
|
+
export declare function getQurlTool(client: IQURLClient): {
|
|
11
|
+
name: string;
|
|
12
|
+
title: string;
|
|
13
|
+
description: string;
|
|
14
|
+
inputSchema: z.ZodObject<{
|
|
15
|
+
resource_id: z.ZodString;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
resource_id: string;
|
|
18
|
+
}, {
|
|
19
|
+
resource_id: string;
|
|
20
|
+
}>;
|
|
21
|
+
outputSchema: z.ZodObject<{
|
|
22
|
+
resource_id: z.ZodString;
|
|
23
|
+
qurl_site: z.ZodOptional<z.ZodString>;
|
|
24
|
+
target_url: z.ZodString;
|
|
25
|
+
description: z.ZodOptional<z.ZodString>;
|
|
26
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
27
|
+
expires_at: z.ZodString;
|
|
28
|
+
created_at: z.ZodString;
|
|
29
|
+
status: z.ZodEnum<["active", "revoked"]>;
|
|
30
|
+
custom_domain: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
31
|
+
preserve_host: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
qurl_count: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
qurls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
34
|
+
qurl_id: z.ZodString;
|
|
35
|
+
label: z.ZodOptional<z.ZodString>;
|
|
36
|
+
status: z.ZodEnum<["active", "consumed", "expired", "revoked"]>;
|
|
37
|
+
one_time_use: z.ZodBoolean;
|
|
38
|
+
max_sessions: z.ZodNumber;
|
|
39
|
+
session_duration: z.ZodNumber;
|
|
40
|
+
use_count: z.ZodNumber;
|
|
41
|
+
qurl_site: z.ZodOptional<z.ZodString>;
|
|
42
|
+
access_policy: z.ZodOptional<z.ZodObject<{
|
|
43
|
+
ip_allowlist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
44
|
+
ip_denylist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
45
|
+
geo_allowlist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
46
|
+
geo_denylist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
47
|
+
user_agent_allow_regex: z.ZodOptional<z.ZodString>;
|
|
48
|
+
user_agent_deny_regex: z.ZodOptional<z.ZodString>;
|
|
49
|
+
ai_agent_policy: z.ZodOptional<z.ZodObject<{
|
|
50
|
+
block_all: z.ZodOptional<z.ZodBoolean>;
|
|
51
|
+
deny_categories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
52
|
+
allow_categories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
53
|
+
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
block_all?: boolean | undefined;
|
|
55
|
+
deny_categories?: string[] | undefined;
|
|
56
|
+
allow_categories?: string[] | undefined;
|
|
57
|
+
}, {
|
|
58
|
+
block_all?: boolean | undefined;
|
|
59
|
+
deny_categories?: string[] | undefined;
|
|
60
|
+
allow_categories?: string[] | undefined;
|
|
61
|
+
}>>;
|
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
|
63
|
+
ip_allowlist?: string[] | undefined;
|
|
64
|
+
ip_denylist?: string[] | undefined;
|
|
65
|
+
geo_allowlist?: string[] | undefined;
|
|
66
|
+
geo_denylist?: string[] | undefined;
|
|
67
|
+
user_agent_allow_regex?: string | undefined;
|
|
68
|
+
user_agent_deny_regex?: string | undefined;
|
|
69
|
+
ai_agent_policy?: {
|
|
70
|
+
block_all?: boolean | undefined;
|
|
71
|
+
deny_categories?: string[] | undefined;
|
|
72
|
+
allow_categories?: string[] | undefined;
|
|
73
|
+
} | undefined;
|
|
74
|
+
}, {
|
|
75
|
+
ip_allowlist?: string[] | undefined;
|
|
76
|
+
ip_denylist?: string[] | undefined;
|
|
77
|
+
geo_allowlist?: string[] | undefined;
|
|
78
|
+
geo_denylist?: string[] | undefined;
|
|
79
|
+
user_agent_allow_regex?: string | undefined;
|
|
80
|
+
user_agent_deny_regex?: string | undefined;
|
|
81
|
+
ai_agent_policy?: {
|
|
82
|
+
block_all?: boolean | undefined;
|
|
83
|
+
deny_categories?: string[] | undefined;
|
|
84
|
+
allow_categories?: string[] | undefined;
|
|
85
|
+
} | undefined;
|
|
86
|
+
}>>;
|
|
87
|
+
created_at: z.ZodString;
|
|
88
|
+
expires_at: z.ZodString;
|
|
89
|
+
}, "strip", z.ZodTypeAny, {
|
|
90
|
+
status: "active" | "consumed" | "expired" | "revoked";
|
|
91
|
+
qurl_id: string;
|
|
92
|
+
one_time_use: boolean;
|
|
93
|
+
max_sessions: number;
|
|
94
|
+
session_duration: number;
|
|
95
|
+
use_count: number;
|
|
96
|
+
created_at: string;
|
|
97
|
+
expires_at: string;
|
|
98
|
+
label?: string | undefined;
|
|
99
|
+
qurl_site?: string | undefined;
|
|
100
|
+
access_policy?: {
|
|
101
|
+
ip_allowlist?: string[] | undefined;
|
|
102
|
+
ip_denylist?: string[] | undefined;
|
|
103
|
+
geo_allowlist?: string[] | undefined;
|
|
104
|
+
geo_denylist?: string[] | undefined;
|
|
105
|
+
user_agent_allow_regex?: string | undefined;
|
|
106
|
+
user_agent_deny_regex?: string | undefined;
|
|
107
|
+
ai_agent_policy?: {
|
|
108
|
+
block_all?: boolean | undefined;
|
|
109
|
+
deny_categories?: string[] | undefined;
|
|
110
|
+
allow_categories?: string[] | undefined;
|
|
111
|
+
} | undefined;
|
|
112
|
+
} | undefined;
|
|
113
|
+
}, {
|
|
114
|
+
status: "active" | "consumed" | "expired" | "revoked";
|
|
115
|
+
qurl_id: string;
|
|
116
|
+
one_time_use: boolean;
|
|
117
|
+
max_sessions: number;
|
|
118
|
+
session_duration: number;
|
|
119
|
+
use_count: number;
|
|
120
|
+
created_at: string;
|
|
121
|
+
expires_at: string;
|
|
122
|
+
label?: string | undefined;
|
|
123
|
+
qurl_site?: string | undefined;
|
|
124
|
+
access_policy?: {
|
|
125
|
+
ip_allowlist?: string[] | undefined;
|
|
126
|
+
ip_denylist?: string[] | undefined;
|
|
127
|
+
geo_allowlist?: string[] | undefined;
|
|
128
|
+
geo_denylist?: string[] | undefined;
|
|
129
|
+
user_agent_allow_regex?: string | undefined;
|
|
130
|
+
user_agent_deny_regex?: string | undefined;
|
|
131
|
+
ai_agent_policy?: {
|
|
132
|
+
block_all?: boolean | undefined;
|
|
133
|
+
deny_categories?: string[] | undefined;
|
|
134
|
+
allow_categories?: string[] | undefined;
|
|
135
|
+
} | undefined;
|
|
136
|
+
} | undefined;
|
|
137
|
+
}>, "many">>;
|
|
138
|
+
}, "strip", z.ZodTypeAny, {
|
|
139
|
+
status: "active" | "revoked";
|
|
140
|
+
created_at: string;
|
|
141
|
+
expires_at: string;
|
|
142
|
+
resource_id: string;
|
|
143
|
+
target_url: string;
|
|
144
|
+
qurl_site?: string | undefined;
|
|
145
|
+
description?: string | undefined;
|
|
146
|
+
tags?: string[] | undefined;
|
|
147
|
+
custom_domain?: string | null | undefined;
|
|
148
|
+
preserve_host?: boolean | undefined;
|
|
149
|
+
qurl_count?: number | undefined;
|
|
150
|
+
qurls?: {
|
|
151
|
+
status: "active" | "consumed" | "expired" | "revoked";
|
|
152
|
+
qurl_id: string;
|
|
153
|
+
one_time_use: boolean;
|
|
154
|
+
max_sessions: number;
|
|
155
|
+
session_duration: number;
|
|
156
|
+
use_count: number;
|
|
157
|
+
created_at: string;
|
|
158
|
+
expires_at: string;
|
|
159
|
+
label?: string | undefined;
|
|
160
|
+
qurl_site?: string | undefined;
|
|
161
|
+
access_policy?: {
|
|
162
|
+
ip_allowlist?: string[] | undefined;
|
|
163
|
+
ip_denylist?: string[] | undefined;
|
|
164
|
+
geo_allowlist?: string[] | undefined;
|
|
165
|
+
geo_denylist?: string[] | undefined;
|
|
166
|
+
user_agent_allow_regex?: string | undefined;
|
|
167
|
+
user_agent_deny_regex?: string | undefined;
|
|
168
|
+
ai_agent_policy?: {
|
|
169
|
+
block_all?: boolean | undefined;
|
|
170
|
+
deny_categories?: string[] | undefined;
|
|
171
|
+
allow_categories?: string[] | undefined;
|
|
172
|
+
} | undefined;
|
|
173
|
+
} | undefined;
|
|
174
|
+
}[] | undefined;
|
|
175
|
+
}, {
|
|
176
|
+
status: "active" | "revoked";
|
|
177
|
+
created_at: string;
|
|
178
|
+
expires_at: string;
|
|
179
|
+
resource_id: string;
|
|
180
|
+
target_url: string;
|
|
181
|
+
qurl_site?: string | undefined;
|
|
182
|
+
description?: string | undefined;
|
|
183
|
+
tags?: string[] | undefined;
|
|
184
|
+
custom_domain?: string | null | undefined;
|
|
185
|
+
preserve_host?: boolean | undefined;
|
|
186
|
+
qurl_count?: number | undefined;
|
|
187
|
+
qurls?: {
|
|
188
|
+
status: "active" | "consumed" | "expired" | "revoked";
|
|
189
|
+
qurl_id: string;
|
|
190
|
+
one_time_use: boolean;
|
|
191
|
+
max_sessions: number;
|
|
192
|
+
session_duration: number;
|
|
193
|
+
use_count: number;
|
|
194
|
+
created_at: string;
|
|
195
|
+
expires_at: string;
|
|
196
|
+
label?: string | undefined;
|
|
197
|
+
qurl_site?: string | undefined;
|
|
198
|
+
access_policy?: {
|
|
199
|
+
ip_allowlist?: string[] | undefined;
|
|
200
|
+
ip_denylist?: string[] | undefined;
|
|
201
|
+
geo_allowlist?: string[] | undefined;
|
|
202
|
+
geo_denylist?: string[] | undefined;
|
|
203
|
+
user_agent_allow_regex?: string | undefined;
|
|
204
|
+
user_agent_deny_regex?: string | undefined;
|
|
205
|
+
ai_agent_policy?: {
|
|
206
|
+
block_all?: boolean | undefined;
|
|
207
|
+
deny_categories?: string[] | undefined;
|
|
208
|
+
allow_categories?: string[] | undefined;
|
|
209
|
+
} | undefined;
|
|
210
|
+
} | undefined;
|
|
211
|
+
}[] | undefined;
|
|
212
|
+
}>;
|
|
213
|
+
annotations: {
|
|
214
|
+
title: string;
|
|
215
|
+
readOnlyHint: boolean;
|
|
216
|
+
destructiveHint: boolean;
|
|
217
|
+
idempotentHint: boolean;
|
|
218
|
+
openWorldHint: boolean;
|
|
219
|
+
};
|
|
220
|
+
handler: (input: {
|
|
221
|
+
resource_id: string;
|
|
222
|
+
}) => Promise<{
|
|
223
|
+
content: Array<{
|
|
224
|
+
type: "text";
|
|
225
|
+
text: string;
|
|
226
|
+
}>;
|
|
227
|
+
structuredContent?: Record<string, unknown>;
|
|
228
|
+
isError?: boolean;
|
|
229
|
+
}>;
|
|
230
|
+
};
|
|
231
|
+
//# sourceMappingURL=get-qurl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-qurl.d.ts","sourceRoot":"","sources":["../../src/tools/get-qurl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAIhD,eAAO,MAAM,aAAa;;;;;;EAExB,CAAC;AAEH,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgC9C"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { resourceIdSchema, toStructuredContent, withMissingApiKeyHandler } from "./_shared.js";
|
|
3
|
+
import { getQurlOutputSchema } from "./output-schemas.js";
|
|
4
|
+
export const getQurlSchema = z.object({
|
|
5
|
+
resource_id: resourceIdSchema("fetch"),
|
|
6
|
+
});
|
|
7
|
+
export function getQurlTool(client) {
|
|
8
|
+
return {
|
|
9
|
+
name: "get_qurl",
|
|
10
|
+
title: "Get qURL",
|
|
11
|
+
description: "Fetch a single qURL resource by ID and return its current state plus all access tokens. " +
|
|
12
|
+
"Use this when you have a specific resource ID (r_ prefix) or qURL display ID (q_ prefix) — q_ IDs are auto-resolved to their parent resource. " +
|
|
13
|
+
"Use `list_qurls` instead when you need to discover qURLs by status, date range, or search query. " +
|
|
14
|
+
"Use `resolve_qurl` instead when you have an end-user access token (at_ prefix) and need to redeem it for the underlying URL. " +
|
|
15
|
+
"Returns the resource shape with embedded `qurls[]` (per-token state); the one-shot `qurl_link` from creation is never returned here.",
|
|
16
|
+
inputSchema: getQurlSchema,
|
|
17
|
+
outputSchema: getQurlOutputSchema,
|
|
18
|
+
annotations: {
|
|
19
|
+
title: "Get qURL",
|
|
20
|
+
readOnlyHint: true,
|
|
21
|
+
destructiveHint: false,
|
|
22
|
+
idempotentHint: true,
|
|
23
|
+
openWorldHint: true,
|
|
24
|
+
},
|
|
25
|
+
handler: withMissingApiKeyHandler(async (input) => {
|
|
26
|
+
const result = await client.getQURL(input.resource_id);
|
|
27
|
+
return {
|
|
28
|
+
content: [
|
|
29
|
+
{
|
|
30
|
+
type: "text",
|
|
31
|
+
text: JSON.stringify(result.data),
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
structuredContent: toStructuredContent(result.data),
|
|
35
|
+
};
|
|
36
|
+
}),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=get-qurl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-qurl.js","sourceRoot":"","sources":["../../src/tools/get-qurl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAC/F,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,WAAW,EAAE,gBAAgB,CAAC,OAAO,CAAC;CACvC,CAAC,CAAC;AAEH,MAAM,UAAU,WAAW,CAAC,MAAmB;IAC7C,OAAO;QACL,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,UAAU;QACjB,WAAW,EACT,0FAA0F;YAC1F,gJAAgJ;YAChJ,mGAAmG;YACnG,+HAA+H;YAC/H,sIAAsI;QACxI,WAAW,EAAE,aAAa;QAC1B,YAAY,EAAE,mBAAmB;QACjC,WAAW,EAAE;YACX,KAAK,EAAE,UAAU;YACjB,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,IAAI;YACpB,aAAa,EAAE,IAAI;SACpB;QACD,OAAO,EAAE,wBAAwB,CAAC,KAAK,EAAE,KAAoC,EAAE,EAAE;YAC/E,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YACvD,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC;qBAClC;iBACF;gBACD,iBAAiB,EAAE,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC;aACpD,CAAC;QACJ,CAAC,CAAC;KACH,CAAC;AACJ,CAAC"}
|