@layervai/qurl-mcp 0.4.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +798 -50
- package/assets/fonts/NotoSansSC-Regular.ttf +0 -0
- package/assets/fonts/OFL.txt +93 -0
- package/assets/fonts/README.md +18 -0
- package/dist/auth/request-context.d.ts +13 -0
- package/dist/auth/request-context.d.ts.map +1 -0
- package/dist/auth/request-context.js +21 -0
- package/dist/auth/request-context.js.map +1 -0
- package/dist/auth/static-bearer.d.ts +12 -0
- package/dist/auth/static-bearer.d.ts.map +1 -0
- package/dist/auth/static-bearer.js +47 -0
- package/dist/auth/static-bearer.js.map +1 -0
- package/dist/client.d.ts +66 -11
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +116 -7
- package/dist/client.js.map +1 -1
- package/dist/config.d.ts +98 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +543 -0
- package/dist/config.js.map +1 -0
- package/dist/credential-rate-limit-store.d.ts +38 -0
- package/dist/credential-rate-limit-store.d.ts.map +1 -0
- package/dist/credential-rate-limit-store.js +135 -0
- package/dist/credential-rate-limit-store.js.map +1 -0
- package/dist/email-addresses.d.ts +7 -0
- package/dist/email-addresses.d.ts.map +1 -0
- package/dist/email-addresses.js +36 -0
- package/dist/email-addresses.js.map +1 -0
- package/dist/email-types.d.ts +33 -0
- package/dist/email-types.d.ts.map +1 -0
- package/dist/email-types.js +28 -0
- package/dist/email-types.js.map +1 -0
- package/dist/emf-metrics.d.ts +25 -0
- package/dist/emf-metrics.d.ts.map +1 -0
- package/dist/emf-metrics.js +87 -0
- package/dist/emf-metrics.js.map +1 -0
- package/dist/http-config.d.ts +38 -0
- package/dist/http-config.d.ts.map +1 -0
- package/dist/http-config.js +243 -0
- package/dist/http-config.js.map +1 -0
- package/dist/http-routes.d.ts +5 -0
- package/dist/http-routes.d.ts.map +1 -0
- package/dist/http-routes.js +12 -0
- package/dist/http-routes.js.map +1 -0
- package/dist/http.d.ts +33 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +1116 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -26
- package/dist/index.js.map +1 -1
- package/dist/logging.d.ts +7 -0
- package/dist/logging.d.ts.map +1 -0
- package/dist/logging.js +110 -0
- package/dist/logging.js.map +1 -0
- package/dist/prompts/audit-links.js +1 -1
- package/dist/prompts/audit-links.js.map +1 -1
- package/dist/server.d.ts +14 -4
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +38 -8
- package/dist/server.js.map +1 -1
- package/dist/services/email.d.ts +17 -0
- package/dist/services/email.d.ts.map +1 -0
- package/dist/services/email.js +351 -0
- package/dist/services/email.js.map +1 -0
- package/dist/services/html.d.ts +5 -0
- package/dist/services/html.d.ts.map +1 -0
- package/dist/services/html.js +28 -0
- package/dist/services/html.js.map +1 -0
- package/dist/services/legal-pages.d.ts +12 -0
- package/dist/services/legal-pages.d.ts.map +1 -0
- package/dist/services/legal-pages.js +588 -0
- package/dist/services/legal-pages.js.map +1 -0
- package/dist/services/text-pdf.d.ts +16 -0
- package/dist/services/text-pdf.d.ts.map +1 -0
- package/dist/services/text-pdf.js +141 -0
- package/dist/services/text-pdf.js.map +1 -0
- package/dist/services/video-page.d.ts +4 -0
- package/dist/services/video-page.d.ts.map +1 -0
- package/dist/services/video-page.js +311 -0
- package/dist/services/video-page.js.map +1 -0
- package/dist/text.d.ts +4 -0
- package/dist/text.d.ts.map +1 -0
- package/dist/text.js +16 -0
- package/dist/text.js.map +1 -0
- package/dist/tools/_shared.d.ts +10 -1
- package/dist/tools/_shared.d.ts.map +1 -1
- package/dist/tools/_shared.js +25 -8
- package/dist/tools/_shared.js.map +1 -1
- package/dist/tools/batch-create.d.ts +12 -11
- package/dist/tools/batch-create.d.ts.map +1 -1
- package/dist/tools/batch-create.js +6 -4
- package/dist/tools/batch-create.js.map +1 -1
- package/dist/tools/consumer-access.d.ts +235 -0
- package/dist/tools/consumer-access.d.ts.map +1 -0
- package/dist/tools/consumer-access.js +231 -0
- package/dist/tools/consumer-access.js.map +1 -0
- package/dist/tools/create-qurl.d.ts +43 -4
- package/dist/tools/create-qurl.d.ts.map +1 -1
- package/dist/tools/create-qurl.js +69 -32
- package/dist/tools/create-qurl.js.map +1 -1
- package/dist/tools/delete-qurl.d.ts +3 -2
- package/dist/tools/delete-qurl.d.ts.map +1 -1
- package/dist/tools/delete-qurl.js +9 -13
- package/dist/tools/delete-qurl.js.map +1 -1
- package/dist/tools/duration.d.ts +13 -0
- package/dist/tools/duration.d.ts.map +1 -0
- package/dist/tools/duration.js +71 -0
- package/dist/tools/duration.js.map +1 -0
- package/dist/tools/email-delivery.d.ts +36 -0
- package/dist/tools/email-delivery.d.ts.map +1 -0
- package/dist/tools/email-delivery.js +114 -0
- package/dist/tools/email-delivery.js.map +1 -0
- package/dist/tools/extend-qurl.d.ts +20 -6
- package/dist/tools/extend-qurl.d.ts.map +1 -1
- package/dist/tools/extend-qurl.js +180 -19
- package/dist/tools/extend-qurl.js.map +1 -1
- package/dist/tools/get-qurl.d.ts +13 -5
- package/dist/tools/get-qurl.d.ts.map +1 -1
- package/dist/tools/get-qurl.js +5 -3
- package/dist/tools/get-qurl.js.map +1 -1
- package/dist/tools/list-qurl-sessions.d.ts +5 -4
- package/dist/tools/list-qurl-sessions.d.ts.map +1 -1
- package/dist/tools/list-qurl-sessions.js +2 -2
- package/dist/tools/list-qurl-sessions.js.map +1 -1
- package/dist/tools/list-qurls.d.ts +15 -7
- package/dist/tools/list-qurls.d.ts.map +1 -1
- package/dist/tools/list-qurls.js +9 -7
- package/dist/tools/list-qurls.js.map +1 -1
- package/dist/tools/mint-link.d.ts +39 -3
- package/dist/tools/mint-link.d.ts.map +1 -1
- package/dist/tools/mint-link.js +26 -14
- package/dist/tools/mint-link.js.map +1 -1
- package/dist/tools/output-schemas.d.ts +154 -45
- package/dist/tools/output-schemas.d.ts.map +1 -1
- package/dist/tools/output-schemas.js +106 -30
- package/dist/tools/output-schemas.js.map +1 -1
- package/dist/tools/resolve-qurl.d.ts +4 -3
- package/dist/tools/resolve-qurl.d.ts.map +1 -1
- package/dist/tools/resolve-qurl.js +3 -3
- package/dist/tools/resolve-qurl.js.map +1 -1
- package/dist/tools/revoke-qurl-token.d.ts +3 -2
- package/dist/tools/revoke-qurl-token.d.ts.map +1 -1
- package/dist/tools/revoke-qurl-token.js +2 -2
- package/dist/tools/revoke-qurl-token.js.map +1 -1
- package/dist/tools/share-by-crid.d.ts +50 -0
- package/dist/tools/share-by-crid.d.ts.map +1 -0
- package/dist/tools/share-by-crid.js +114 -0
- package/dist/tools/share-by-crid.js.map +1 -0
- package/dist/tools/terminate-qurl-sessions.d.ts +3 -2
- package/dist/tools/terminate-qurl-sessions.d.ts.map +1 -1
- package/dist/tools/terminate-qurl-sessions.js +7 -3
- package/dist/tools/terminate-qurl-sessions.js.map +1 -1
- package/dist/tools/update-qurl-token.d.ts +5 -4
- package/dist/tools/update-qurl-token.d.ts.map +1 -1
- package/dist/tools/update-qurl-token.js +8 -9
- package/dist/tools/update-qurl-token.js.map +1 -1
- package/dist/tools/update-qurl.d.ts +13 -5
- package/dist/tools/update-qurl.d.ts.map +1 -1
- package/dist/tools/update-qurl.js +10 -11
- package/dist/tools/update-qurl.js.map +1 -1
- package/dist/tools/upload-file-data-qurl.d.ts +138 -0
- package/dist/tools/upload-file-data-qurl.d.ts.map +1 -0
- package/dist/tools/upload-file-data-qurl.js +207 -0
- package/dist/tools/upload-file-data-qurl.js.map +1 -0
- package/dist/tools/upload-file-qurl.d.ts +134 -0
- package/dist/tools/upload-file-qurl.d.ts.map +1 -0
- package/dist/tools/upload-file-qurl.js +174 -0
- package/dist/tools/upload-file-qurl.js.map +1 -0
- package/dist/tools/upload-file-shared.d.ts +53 -0
- package/dist/tools/upload-file-shared.d.ts.map +1 -0
- package/dist/tools/upload-file-shared.js +617 -0
- package/dist/tools/upload-file-shared.js.map +1 -0
- package/dist/tools/upload-mint-options.d.ts +22 -0
- package/dist/tools/upload-mint-options.d.ts.map +1 -0
- package/dist/tools/upload-mint-options.js +47 -0
- package/dist/tools/upload-mint-options.js.map +1 -0
- package/dist/tools/upload-text-qurl.d.ts +112 -0
- package/dist/tools/upload-text-qurl.d.ts.map +1 -0
- package/dist/tools/upload-text-qurl.js +106 -0
- package/dist/tools/upload-text-qurl.js.map +1 -0
- package/package.json +26 -8
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import type { IQURLClient } from "../client.js";
|
|
3
|
+
import { type ToolRuntimeOptions } from "./_shared.js";
|
|
3
4
|
export declare const batchCreateSchema: z.ZodObject<{
|
|
4
5
|
items: z.ZodArray<z.ZodObject<{
|
|
5
6
|
type: z.ZodOptional<z.ZodString>;
|
|
6
7
|
target_url: z.ZodString;
|
|
8
|
+
custom_domain: z.ZodOptional<z.ZodString>;
|
|
7
9
|
label: z.ZodOptional<z.ZodString>;
|
|
8
|
-
expires_in: z.ZodOptional<z.ZodString>;
|
|
9
10
|
one_time_use: z.ZodOptional<z.ZodBoolean>;
|
|
10
11
|
max_sessions: z.ZodOptional<z.ZodNumber>;
|
|
11
12
|
session_duration: z.ZodOptional<z.ZodString>;
|
|
12
|
-
custom_domain: z.ZodOptional<z.ZodString>;
|
|
13
13
|
access_policy: z.ZodOptional<z.ZodObject<{
|
|
14
14
|
ip_allowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
15
15
|
ip_denylist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -23,9 +23,10 @@ export declare const batchCreateSchema: z.ZodObject<{
|
|
|
23
23
|
allow_categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
24
24
|
}, z.core.$strip>>;
|
|
25
25
|
}, z.core.$strip>>;
|
|
26
|
+
expires_in: z.ZodOptional<z.ZodString>;
|
|
26
27
|
}, z.core.$strip>>;
|
|
27
28
|
}, z.core.$strip>;
|
|
28
|
-
export declare function batchCreateTool(client: IQURLClient): {
|
|
29
|
+
export declare function batchCreateTool(client: IQURLClient, _runtime?: ToolRuntimeOptions): {
|
|
29
30
|
name: string;
|
|
30
31
|
title: string;
|
|
31
32
|
description: string;
|
|
@@ -33,12 +34,11 @@ export declare function batchCreateTool(client: IQURLClient): {
|
|
|
33
34
|
items: z.ZodArray<z.ZodObject<{
|
|
34
35
|
type: z.ZodOptional<z.ZodString>;
|
|
35
36
|
target_url: z.ZodString;
|
|
37
|
+
custom_domain: z.ZodOptional<z.ZodString>;
|
|
36
38
|
label: z.ZodOptional<z.ZodString>;
|
|
37
|
-
expires_in: z.ZodOptional<z.ZodString>;
|
|
38
39
|
one_time_use: z.ZodOptional<z.ZodBoolean>;
|
|
39
40
|
max_sessions: z.ZodOptional<z.ZodNumber>;
|
|
40
41
|
session_duration: z.ZodOptional<z.ZodString>;
|
|
41
|
-
custom_domain: z.ZodOptional<z.ZodString>;
|
|
42
42
|
access_policy: z.ZodOptional<z.ZodObject<{
|
|
43
43
|
ip_allowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
44
44
|
ip_denylist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -52,6 +52,7 @@ export declare function batchCreateTool(client: IQURLClient): {
|
|
|
52
52
|
allow_categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
53
53
|
}, z.core.$strip>>;
|
|
54
54
|
}, z.core.$strip>>;
|
|
55
|
+
expires_in: z.ZodOptional<z.ZodString>;
|
|
55
56
|
}, z.core.$strip>>;
|
|
56
57
|
}, z.core.$strip>;
|
|
57
58
|
outputSchema: z.ZodObject<{
|
|
@@ -65,16 +66,16 @@ export declare function batchCreateTool(client: IQURLClient): {
|
|
|
65
66
|
branded_domain: z.ZodOptional<z.ZodString>;
|
|
66
67
|
qurl_site: z.ZodString;
|
|
67
68
|
expires_at: z.ZodString;
|
|
68
|
-
}, z.core.$
|
|
69
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
69
70
|
index: z.ZodNumber;
|
|
70
71
|
success: z.ZodLiteral<false>;
|
|
71
72
|
error: z.ZodObject<{
|
|
72
73
|
code: z.ZodString;
|
|
73
74
|
message: z.ZodString;
|
|
74
|
-
}, z.core.$
|
|
75
|
-
}, z.core.$
|
|
75
|
+
}, z.core.$loose>;
|
|
76
|
+
}, z.core.$loose>], "success">>;
|
|
76
77
|
request_id: z.ZodOptional<z.ZodString>;
|
|
77
|
-
}, z.core.$
|
|
78
|
+
}, z.core.$loose>;
|
|
78
79
|
annotations: {
|
|
79
80
|
title: string;
|
|
80
81
|
readOnlyHint: boolean;
|
|
@@ -86,12 +87,11 @@ export declare function batchCreateTool(client: IQURLClient): {
|
|
|
86
87
|
items: {
|
|
87
88
|
target_url: string;
|
|
88
89
|
type?: string | undefined;
|
|
90
|
+
custom_domain?: string | undefined;
|
|
89
91
|
label?: string | undefined;
|
|
90
|
-
expires_in?: string | undefined;
|
|
91
92
|
one_time_use?: boolean | undefined;
|
|
92
93
|
max_sessions?: number | undefined;
|
|
93
94
|
session_duration?: string | undefined;
|
|
94
|
-
custom_domain?: string | undefined;
|
|
95
95
|
access_policy?: {
|
|
96
96
|
ip_allowlist?: string[] | undefined;
|
|
97
97
|
ip_denylist?: string[] | undefined;
|
|
@@ -105,6 +105,7 @@ export declare function batchCreateTool(client: IQURLClient): {
|
|
|
105
105
|
allow_categories?: string[] | undefined;
|
|
106
106
|
} | undefined;
|
|
107
107
|
} | undefined;
|
|
108
|
+
expires_in?: string | undefined;
|
|
108
109
|
}[];
|
|
109
110
|
}) => Promise<{
|
|
110
111
|
content: Array<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batch-create.d.ts","sourceRoot":"","sources":["../../src/tools/batch-create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAqB,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"batch-create.d.ts","sourceRoot":"","sources":["../../src/tools/batch-create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAqB,WAAW,EAAE,MAAM,cAAc,CAAC;AAEnE,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AAWtB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;iBAM5B,CAAC;AAEH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,WAAW,EACnB,QAAQ,GAAE,kBAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmEjD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { createQurlSchema } from "./create-qurl.js";
|
|
3
|
-
import { toStructuredContent, withMissingApiKeyHandler } from "./_shared.js";
|
|
3
|
+
import { toStructuredContent, withMissingApiKeyHandler, } from "./_shared.js";
|
|
4
4
|
import { batchCreateOutputSchema } from "./output-schemas.js";
|
|
5
5
|
function isBatchPayload(value) {
|
|
6
6
|
if (typeof value !== "object" || value === null)
|
|
@@ -10,16 +10,18 @@ function isBatchPayload(value) {
|
|
|
10
10
|
}
|
|
11
11
|
export const batchCreateSchema = z.object({
|
|
12
12
|
items: z
|
|
13
|
-
.array(createQurlSchema)
|
|
13
|
+
.array(createQurlSchema.omit({ email_delivery: true }))
|
|
14
14
|
.min(1)
|
|
15
15
|
.max(100)
|
|
16
16
|
.describe("Array of qURL creation requests (1-100 items)"),
|
|
17
17
|
});
|
|
18
|
-
export function batchCreateTool(client) {
|
|
18
|
+
export function batchCreateTool(client, _runtime = { mode: "stdio" }) {
|
|
19
19
|
return {
|
|
20
20
|
name: "batch_create_qurls",
|
|
21
21
|
title: "Batch Create qURLs",
|
|
22
22
|
description: "Create up to 100 qURLs in a single request. The single-call alternative to looping `create_qurl` — saves round trips and returns a single envelope of per-item results. " +
|
|
23
|
+
"Only use this when the user explicitly wants multiple qURLs in one request. Never use it for a single URL, a single file, a single image, or a single attachment. " +
|
|
24
|
+
"Do not use this tool for uploaded files, image attachments, PDFs, or base64 file content — use `upload_file_data_qurl` (HTTP mode) or `upload_file_qurl` (stdio mode) instead. " +
|
|
23
25
|
"**Not transactional:** items succeed or fail independently (see `succeeded`/`failed` counts and per-item `error`). " +
|
|
24
26
|
"Use this when you need to mint many qURLs at once (e.g. provisioning a vendor list, distributing per-customer share links). " +
|
|
25
27
|
"Use `create_qurl` for a single resource. " +
|
|
@@ -37,7 +39,7 @@ export function batchCreateTool(client) {
|
|
|
37
39
|
openWorldHint: true,
|
|
38
40
|
},
|
|
39
41
|
handler: withMissingApiKeyHandler(async (input) => {
|
|
40
|
-
const result = await client.batchCreate(input);
|
|
42
|
+
const result = await client.batchCreate(batchCreateSchema.parse(input));
|
|
41
43
|
// Defense-in-depth: batchCreate passes through HTTP 400, which is
|
|
42
44
|
// contracted to carry a BatchCreateResponse body with per-item errors.
|
|
43
45
|
// If the API ever returns 400 with a different shape (e.g., a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batch-create.js","sourceRoot":"","sources":["../../src/tools/batch-create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,
|
|
1
|
+
{"version":3,"file":"batch-create.js","sourceRoot":"","sources":["../../src/tools/batch-create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EACL,mBAAmB,EACnB,wBAAwB,GAEzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,uBAAuB,EAAE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MAAM,MAAM,CAAC,WAAW,CAAC,iBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;YACxE,kEAAkE;YAClE,uEAAuE;YACvE,8DAA8D;YAC9D,kEAAkE;YAClE,qEAAqE;YACrE,oEAAoE;YACpE,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;gBACjC,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAe;4BACrB,IAAI,EAAE,0CAA0C,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE;yBACvF;qBACF;oBACD,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;YACD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;YACzB,mEAAmE;YACnE,+DAA+D;YAC/D,8DAA8D;YAC9D,6DAA6D;YAC7D,iEAAiE;YACjE,yBAAyB;YACzB,MAAM,OAAO,GAAG;gBACd,GAAG,IAAI;gBACP,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;aACrF,CAAC;YACF,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;qBAC9B;iBACF;gBACD,iBAAiB,EAAE,mBAAmB,CAAC,OAAO,CAAC;gBAC/C,OAAO,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC;aACzB,CAAC;QACJ,CAAC,CAAC;KACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type IQURLClient } from "../client.js";
|
|
3
|
+
import { type ToolRuntimeOptions } from "./_shared.js";
|
|
4
|
+
export declare function publishCridTool(client: IQURLClient, _runtime?: ToolRuntimeOptions): {
|
|
5
|
+
name: string;
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
inputSchema: z.ZodObject<{
|
|
9
|
+
target_url: z.ZodString;
|
|
10
|
+
policy: z.ZodObject<{
|
|
11
|
+
mode: z.ZodEnum<{
|
|
12
|
+
keys: "keys";
|
|
13
|
+
invite_only: "invite_only";
|
|
14
|
+
email_capture: "email_capture";
|
|
15
|
+
review: "review";
|
|
16
|
+
contract: "contract";
|
|
17
|
+
}>;
|
|
18
|
+
version: z.ZodNumber;
|
|
19
|
+
contract_id: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, z.core.$strict>;
|
|
21
|
+
}, z.core.$strict>;
|
|
22
|
+
outputSchema: z.ZodObject<{
|
|
23
|
+
resource_id: z.ZodString;
|
|
24
|
+
crid: z.ZodString;
|
|
25
|
+
private: z.ZodLiteral<true>;
|
|
26
|
+
consumer_access: z.ZodObject<{
|
|
27
|
+
mode: z.ZodEnum<{
|
|
28
|
+
keys: "keys";
|
|
29
|
+
invite_only: "invite_only";
|
|
30
|
+
email_capture: "email_capture";
|
|
31
|
+
review: "review";
|
|
32
|
+
contract: "contract";
|
|
33
|
+
}>;
|
|
34
|
+
version: z.ZodNumber;
|
|
35
|
+
contract_id: z.ZodOptional<z.ZodString>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
annotations: {
|
|
39
|
+
title: string;
|
|
40
|
+
readOnlyHint: boolean;
|
|
41
|
+
destructiveHint: boolean;
|
|
42
|
+
idempotentHint: boolean;
|
|
43
|
+
openWorldHint: boolean;
|
|
44
|
+
};
|
|
45
|
+
handler: (input: {
|
|
46
|
+
target_url: string;
|
|
47
|
+
policy: {
|
|
48
|
+
mode: "keys" | "invite_only" | "email_capture" | "review" | "contract";
|
|
49
|
+
version: number;
|
|
50
|
+
contract_id?: string | undefined;
|
|
51
|
+
};
|
|
52
|
+
}) => Promise<{
|
|
53
|
+
content: Array<{
|
|
54
|
+
type: "text";
|
|
55
|
+
text: string;
|
|
56
|
+
}>;
|
|
57
|
+
structuredContent?: Record<string, unknown>;
|
|
58
|
+
isError?: boolean;
|
|
59
|
+
}>;
|
|
60
|
+
};
|
|
61
|
+
export declare function manageCridAccessTool(client: IQURLClient, _runtime?: ToolRuntimeOptions): {
|
|
62
|
+
name: string;
|
|
63
|
+
title: string;
|
|
64
|
+
description: string;
|
|
65
|
+
inputSchema: z.ZodObject<{
|
|
66
|
+
action: z.ZodEnum<{
|
|
67
|
+
configure: "configure";
|
|
68
|
+
invite: "invite";
|
|
69
|
+
list_invitations: "list_invitations";
|
|
70
|
+
resend: "resend";
|
|
71
|
+
revoke_invitation: "revoke_invitation";
|
|
72
|
+
list_grants: "list_grants";
|
|
73
|
+
approve: "approve";
|
|
74
|
+
deny: "deny";
|
|
75
|
+
revoke_grant: "revoke_grant";
|
|
76
|
+
}>;
|
|
77
|
+
resource_id: z.ZodString;
|
|
78
|
+
policy: z.ZodOptional<z.ZodObject<{
|
|
79
|
+
mode: z.ZodEnum<{
|
|
80
|
+
keys: "keys";
|
|
81
|
+
invite_only: "invite_only";
|
|
82
|
+
email_capture: "email_capture";
|
|
83
|
+
review: "review";
|
|
84
|
+
contract: "contract";
|
|
85
|
+
}>;
|
|
86
|
+
version: z.ZodNumber;
|
|
87
|
+
contract_id: z.ZodOptional<z.ZodString>;
|
|
88
|
+
}, z.core.$strict>>;
|
|
89
|
+
email: z.ZodOptional<z.ZodString>;
|
|
90
|
+
id: z.ZodOptional<z.ZodString>;
|
|
91
|
+
expected_version: z.ZodOptional<z.ZodNumber>;
|
|
92
|
+
approval: z.ZodOptional<z.ZodObject<{
|
|
93
|
+
expected_version: z.ZodNumber;
|
|
94
|
+
credential_kind: z.ZodOptional<z.ZodEnum<{
|
|
95
|
+
passkey: "passkey";
|
|
96
|
+
device: "device";
|
|
97
|
+
}>>;
|
|
98
|
+
credential_id: z.ZodOptional<z.ZodString>;
|
|
99
|
+
credential_public_key_b64: z.ZodOptional<z.ZodString>;
|
|
100
|
+
entitlement_id: z.ZodOptional<z.ZodString>;
|
|
101
|
+
expires_at: z.ZodOptional<z.ZodString>;
|
|
102
|
+
}, z.core.$strict>>;
|
|
103
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
104
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
105
|
+
}, z.core.$strict>;
|
|
106
|
+
outputSchema: z.ZodObject<{
|
|
107
|
+
action: z.ZodEnum<{
|
|
108
|
+
configure: "configure";
|
|
109
|
+
invite: "invite";
|
|
110
|
+
list_invitations: "list_invitations";
|
|
111
|
+
resend: "resend";
|
|
112
|
+
revoke_invitation: "revoke_invitation";
|
|
113
|
+
list_grants: "list_grants";
|
|
114
|
+
approve: "approve";
|
|
115
|
+
deny: "deny";
|
|
116
|
+
revoke_grant: "revoke_grant";
|
|
117
|
+
}>;
|
|
118
|
+
resource: z.ZodOptional<z.ZodObject<{
|
|
119
|
+
resource_id: z.ZodString;
|
|
120
|
+
crid: z.ZodString;
|
|
121
|
+
private: z.ZodLiteral<true>;
|
|
122
|
+
consumer_access: z.ZodObject<{
|
|
123
|
+
mode: z.ZodEnum<{
|
|
124
|
+
keys: "keys";
|
|
125
|
+
invite_only: "invite_only";
|
|
126
|
+
email_capture: "email_capture";
|
|
127
|
+
review: "review";
|
|
128
|
+
contract: "contract";
|
|
129
|
+
}>;
|
|
130
|
+
version: z.ZodNumber;
|
|
131
|
+
contract_id: z.ZodOptional<z.ZodString>;
|
|
132
|
+
}, z.core.$strip>;
|
|
133
|
+
}, z.core.$strip>>;
|
|
134
|
+
invitation: z.ZodOptional<z.ZodObject<{
|
|
135
|
+
id: z.ZodString;
|
|
136
|
+
email: z.ZodString;
|
|
137
|
+
status: z.ZodString;
|
|
138
|
+
delivery: z.ZodString;
|
|
139
|
+
version: z.ZodNumber;
|
|
140
|
+
expires_at: z.ZodString;
|
|
141
|
+
session_cleanup: z.ZodOptional<z.ZodEnum<{
|
|
142
|
+
pending: "pending";
|
|
143
|
+
complete: "complete";
|
|
144
|
+
}>>;
|
|
145
|
+
}, z.core.$strip>>;
|
|
146
|
+
grant: z.ZodOptional<z.ZodObject<{
|
|
147
|
+
id: z.ZodString;
|
|
148
|
+
status: z.ZodString;
|
|
149
|
+
version: z.ZodNumber;
|
|
150
|
+
credential_kind: z.ZodOptional<z.ZodEnum<{
|
|
151
|
+
passkey: "passkey";
|
|
152
|
+
device: "device";
|
|
153
|
+
}>>;
|
|
154
|
+
credential_id: z.ZodOptional<z.ZodString>;
|
|
155
|
+
credential_public_key_b64: z.ZodOptional<z.ZodString>;
|
|
156
|
+
email: z.ZodOptional<z.ZodString>;
|
|
157
|
+
email_verified_at: z.ZodOptional<z.ZodString>;
|
|
158
|
+
entitlement_id: z.ZodOptional<z.ZodString>;
|
|
159
|
+
expires_at: z.ZodOptional<z.ZodString>;
|
|
160
|
+
session_cleanup: z.ZodOptional<z.ZodEnum<{
|
|
161
|
+
pending: "pending";
|
|
162
|
+
complete: "complete";
|
|
163
|
+
}>>;
|
|
164
|
+
}, z.core.$strip>>;
|
|
165
|
+
invitations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
166
|
+
id: z.ZodString;
|
|
167
|
+
email: z.ZodString;
|
|
168
|
+
status: z.ZodString;
|
|
169
|
+
delivery: z.ZodString;
|
|
170
|
+
version: z.ZodNumber;
|
|
171
|
+
expires_at: z.ZodString;
|
|
172
|
+
session_cleanup: z.ZodOptional<z.ZodEnum<{
|
|
173
|
+
pending: "pending";
|
|
174
|
+
complete: "complete";
|
|
175
|
+
}>>;
|
|
176
|
+
}, z.core.$strip>>>;
|
|
177
|
+
grants: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
178
|
+
id: z.ZodString;
|
|
179
|
+
status: z.ZodString;
|
|
180
|
+
version: z.ZodNumber;
|
|
181
|
+
credential_kind: z.ZodOptional<z.ZodEnum<{
|
|
182
|
+
passkey: "passkey";
|
|
183
|
+
device: "device";
|
|
184
|
+
}>>;
|
|
185
|
+
credential_id: z.ZodOptional<z.ZodString>;
|
|
186
|
+
credential_public_key_b64: z.ZodOptional<z.ZodString>;
|
|
187
|
+
email: z.ZodOptional<z.ZodString>;
|
|
188
|
+
email_verified_at: z.ZodOptional<z.ZodString>;
|
|
189
|
+
entitlement_id: z.ZodOptional<z.ZodString>;
|
|
190
|
+
expires_at: z.ZodOptional<z.ZodString>;
|
|
191
|
+
session_cleanup: z.ZodOptional<z.ZodEnum<{
|
|
192
|
+
pending: "pending";
|
|
193
|
+
complete: "complete";
|
|
194
|
+
}>>;
|
|
195
|
+
}, z.core.$strip>>>;
|
|
196
|
+
next_cursor: z.ZodOptional<z.ZodString>;
|
|
197
|
+
}, z.core.$strict>;
|
|
198
|
+
annotations: {
|
|
199
|
+
title: string;
|
|
200
|
+
readOnlyHint: boolean;
|
|
201
|
+
destructiveHint: boolean;
|
|
202
|
+
idempotentHint: boolean;
|
|
203
|
+
openWorldHint: boolean;
|
|
204
|
+
};
|
|
205
|
+
handler: (input: {
|
|
206
|
+
action: "configure" | "invite" | "list_invitations" | "resend" | "revoke_invitation" | "list_grants" | "approve" | "deny" | "revoke_grant";
|
|
207
|
+
resource_id: string;
|
|
208
|
+
policy?: {
|
|
209
|
+
mode: "keys" | "invite_only" | "email_capture" | "review" | "contract";
|
|
210
|
+
version: number;
|
|
211
|
+
contract_id?: string | undefined;
|
|
212
|
+
} | undefined;
|
|
213
|
+
email?: string | undefined;
|
|
214
|
+
id?: string | undefined;
|
|
215
|
+
expected_version?: number | undefined;
|
|
216
|
+
approval?: {
|
|
217
|
+
expected_version: number;
|
|
218
|
+
credential_kind?: "passkey" | "device" | undefined;
|
|
219
|
+
credential_id?: string | undefined;
|
|
220
|
+
credential_public_key_b64?: string | undefined;
|
|
221
|
+
entitlement_id?: string | undefined;
|
|
222
|
+
expires_at?: string | undefined;
|
|
223
|
+
} | undefined;
|
|
224
|
+
cursor?: string | undefined;
|
|
225
|
+
limit?: number | undefined;
|
|
226
|
+
}) => Promise<{
|
|
227
|
+
content: Array<{
|
|
228
|
+
type: "text";
|
|
229
|
+
text: string;
|
|
230
|
+
}>;
|
|
231
|
+
structuredContent?: Record<string, unknown>;
|
|
232
|
+
isError?: boolean;
|
|
233
|
+
}>;
|
|
234
|
+
};
|
|
235
|
+
//# sourceMappingURL=consumer-access.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consumer-access.d.ts","sourceRoot":"","sources":["../../src/tools/consumer-access.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAKL,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AAyDtB,wBAAgB,eAAe,CAC7B,MAAM,EAAE,WAAW,EACnB,QAAQ,GAAE,kBAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BjD;AAkFD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,WAAW,EACnB,QAAQ,GAAE,kBAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyHjD"}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { QURLAPIError } from "../client.js";
|
|
3
|
+
import { resourceOnlyIdSchema, toStructuredContent, withMissingApiKeyHandler, zodErrorToToolResult, } from "./_shared.js";
|
|
4
|
+
const version = z.number().int().min(1).max(Number.MAX_SAFE_INTEGER);
|
|
5
|
+
const initialVersion = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
|
|
6
|
+
const policy = z
|
|
7
|
+
.object({
|
|
8
|
+
mode: z.enum(["keys", "invite_only", "email_capture", "review", "contract"]),
|
|
9
|
+
version,
|
|
10
|
+
contract_id: z.string().trim().min(1).max(128).optional(),
|
|
11
|
+
})
|
|
12
|
+
.strict();
|
|
13
|
+
const validPolicy = policy.refine((p) => (p.mode === "contract") === (p.contract_id !== undefined), "Only contract access requires a contract identifier");
|
|
14
|
+
const resource = z.object({
|
|
15
|
+
resource_id: z.string(),
|
|
16
|
+
crid: z.string(),
|
|
17
|
+
private: z.literal(true),
|
|
18
|
+
consumer_access: policy.strip(),
|
|
19
|
+
});
|
|
20
|
+
const invitation = z.object({
|
|
21
|
+
id: z.string(),
|
|
22
|
+
email: z.string(),
|
|
23
|
+
status: z.string().min(1).max(64),
|
|
24
|
+
delivery: z.string().min(1).max(64),
|
|
25
|
+
version,
|
|
26
|
+
expires_at: z.string(),
|
|
27
|
+
session_cleanup: z.enum(["pending", "complete"]).optional(),
|
|
28
|
+
});
|
|
29
|
+
const grant = z.object({
|
|
30
|
+
id: z.string(),
|
|
31
|
+
status: z.string().min(1).max(64),
|
|
32
|
+
version,
|
|
33
|
+
credential_kind: z.enum(["passkey", "device"]).optional(),
|
|
34
|
+
credential_id: z.string().optional(),
|
|
35
|
+
credential_public_key_b64: z.string().optional(),
|
|
36
|
+
email: z.string().optional(),
|
|
37
|
+
email_verified_at: z.string().optional(),
|
|
38
|
+
entitlement_id: z.string().optional(),
|
|
39
|
+
expires_at: z.string().optional(),
|
|
40
|
+
session_cleanup: z.enum(["pending", "complete"]).optional(),
|
|
41
|
+
});
|
|
42
|
+
const publishInput = z.object({ target_url: z.string().url(), policy: validPolicy }).strict();
|
|
43
|
+
function receipt(schema, value, resourceId) {
|
|
44
|
+
const parsed = schema.safeParse(value);
|
|
45
|
+
if (!parsed.success) {
|
|
46
|
+
throw new QURLAPIError(0, "access_receipt_unconfirmed", `The service returned an unrecognized access receipt. A write may have been applied; read resource ${resourceId} and list its access before retrying.`);
|
|
47
|
+
}
|
|
48
|
+
return parsed.data;
|
|
49
|
+
}
|
|
50
|
+
export function publishCridTool(client, _runtime = { mode: "stdio" }) {
|
|
51
|
+
return {
|
|
52
|
+
name: "publish_crid",
|
|
53
|
+
title: "Publish a private CRID",
|
|
54
|
+
description: "Publish a URL with private access. Choose keys for approved credentials, invite_only for publisher email invitations with no access requests, email_capture for verified email capture with consent, review for verified email requests, or contract for a publisher backend entitlement receipt. This tool does not verify payment. Use version 1 for creation. Repeating this call creates another resource; after an uncertain result use get_qurl or list_qurls before retrying. For local apps use the qURL CLI. Public sharing uses create_qurl.",
|
|
55
|
+
inputSchema: publishInput,
|
|
56
|
+
outputSchema: resource,
|
|
57
|
+
annotations: {
|
|
58
|
+
title: "Publish a private CRID",
|
|
59
|
+
readOnlyHint: false,
|
|
60
|
+
destructiveHint: false,
|
|
61
|
+
idempotentHint: false,
|
|
62
|
+
openWorldHint: true,
|
|
63
|
+
},
|
|
64
|
+
handler: withMissingApiKeyHandler(async (raw) => {
|
|
65
|
+
const parsed = publishInput.safeParse(raw);
|
|
66
|
+
if (!parsed.success)
|
|
67
|
+
return zodErrorToToolResult(parsed.error);
|
|
68
|
+
const handle = await client.protectUrl(parsed.data.target_url, {
|
|
69
|
+
consumerAccess: parsed.data.policy,
|
|
70
|
+
});
|
|
71
|
+
const data = receipt(resource, handle.details, handle.crid);
|
|
72
|
+
return {
|
|
73
|
+
content: [{ type: "text", text: JSON.stringify(data) }],
|
|
74
|
+
structuredContent: toStructuredContent(data),
|
|
75
|
+
};
|
|
76
|
+
}),
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
const approval = z
|
|
80
|
+
.object({
|
|
81
|
+
expected_version: initialVersion,
|
|
82
|
+
credential_kind: z.enum(["passkey", "device"]).optional(),
|
|
83
|
+
credential_id: z.string().min(1).max(1024).optional(),
|
|
84
|
+
credential_public_key_b64: z.string().min(1).max(1024).optional(),
|
|
85
|
+
entitlement_id: z.string().min(1).max(256).optional(),
|
|
86
|
+
expires_at: z.string().datetime({ offset: true }).optional(),
|
|
87
|
+
})
|
|
88
|
+
.strict();
|
|
89
|
+
const base = z
|
|
90
|
+
.object({
|
|
91
|
+
action: z.enum([
|
|
92
|
+
"configure",
|
|
93
|
+
"invite",
|
|
94
|
+
"list_invitations",
|
|
95
|
+
"resend",
|
|
96
|
+
"revoke_invitation",
|
|
97
|
+
"list_grants",
|
|
98
|
+
"approve",
|
|
99
|
+
"deny",
|
|
100
|
+
"revoke_grant",
|
|
101
|
+
]),
|
|
102
|
+
resource_id: resourceOnlyIdSchema("manage access"),
|
|
103
|
+
policy: validPolicy.optional(),
|
|
104
|
+
email: z.string().email().max(320).optional(),
|
|
105
|
+
id: z.string().min(1).max(64).optional(),
|
|
106
|
+
expected_version: initialVersion.optional(),
|
|
107
|
+
approval: approval.optional(),
|
|
108
|
+
cursor: z.string().max(4096).optional(),
|
|
109
|
+
limit: z.number().int().min(1).max(100).optional(),
|
|
110
|
+
})
|
|
111
|
+
.strict();
|
|
112
|
+
const identity = z.object({ resource_id: resourceOnlyIdSchema("manage access") });
|
|
113
|
+
const decision = { id: z.string().regex(/^[a-f0-9]{64}$/), expected_version: version };
|
|
114
|
+
const page = {
|
|
115
|
+
cursor: z.string().max(4096).optional(),
|
|
116
|
+
limit: z.number().int().min(1).max(100).optional(),
|
|
117
|
+
};
|
|
118
|
+
const actions = z
|
|
119
|
+
.discriminatedUnion("action", [
|
|
120
|
+
identity
|
|
121
|
+
.extend({
|
|
122
|
+
action: z.literal("configure"),
|
|
123
|
+
policy: validPolicy,
|
|
124
|
+
expected_version: initialVersion,
|
|
125
|
+
})
|
|
126
|
+
.strict(),
|
|
127
|
+
identity.extend({ action: z.literal("invite"), email: z.string().email().max(320) }).strict(),
|
|
128
|
+
identity.extend({ action: z.literal("list_invitations"), ...page }).strict(),
|
|
129
|
+
identity.extend({ action: z.literal("list_grants"), ...page }).strict(),
|
|
130
|
+
identity.extend({ action: z.literal("resend"), ...decision }).strict(),
|
|
131
|
+
identity.extend({ action: z.literal("revoke_invitation"), ...decision }).strict(),
|
|
132
|
+
identity
|
|
133
|
+
.extend({
|
|
134
|
+
action: z.literal("approve"),
|
|
135
|
+
id: z.union([decision.id, z.literal("new")]),
|
|
136
|
+
approval,
|
|
137
|
+
})
|
|
138
|
+
.strict(),
|
|
139
|
+
identity.extend({ action: z.literal("deny"), ...decision }).strict(),
|
|
140
|
+
identity.extend({ action: z.literal("revoke_grant"), ...decision }).strict(),
|
|
141
|
+
])
|
|
142
|
+
.refine((input) => input.action !== "approve" || input.id === "new" || input.approval.expected_version >= 1, "Approval of an existing grant requires expected_version of at least 1");
|
|
143
|
+
const output = z
|
|
144
|
+
.object({
|
|
145
|
+
action: base.shape.action,
|
|
146
|
+
resource: resource.optional(),
|
|
147
|
+
invitation: invitation.optional(),
|
|
148
|
+
grant: grant.optional(),
|
|
149
|
+
invitations: z.array(invitation).optional(),
|
|
150
|
+
grants: z.array(grant).optional(),
|
|
151
|
+
next_cursor: z.string().optional(),
|
|
152
|
+
})
|
|
153
|
+
.strict();
|
|
154
|
+
export function manageCridAccessTool(client, _runtime = { mode: "stdio" }) {
|
|
155
|
+
return {
|
|
156
|
+
name: "manage_crid_access",
|
|
157
|
+
title: "Manage private CRID access",
|
|
158
|
+
description: "Publisher access control. Configure the next policy version, send or resend an email invitation, list invitations or consumer grants, approve or deny a request, approve a credential with id new, or revoke access. Read the current version before a decision; configuring the first policy on an existing private resource uses expected_version 0. For approve, put expected_version inside approval; zero is allowed only for id new. After an uncertain invite result, list invitations before retrying. Invite-only access has no consumer requests. Contract approval requires a trusted publisher entitlement receipt and expiry, not an unverified payment claim. A removal is complete only when session_cleanup is complete; retry the same removal/version while pending. Email proves mailbox control, not legal identity. Only listed fields are returned; invitation secrets and bearer links are never returned.",
|
|
159
|
+
inputSchema: base,
|
|
160
|
+
outputSchema: output,
|
|
161
|
+
annotations: {
|
|
162
|
+
title: "Manage private CRID access",
|
|
163
|
+
readOnlyHint: false,
|
|
164
|
+
destructiveHint: true,
|
|
165
|
+
idempotentHint: false,
|
|
166
|
+
openWorldHint: true,
|
|
167
|
+
},
|
|
168
|
+
handler: withMissingApiKeyHandler(async (raw) => {
|
|
169
|
+
const parsed = actions.safeParse(raw);
|
|
170
|
+
if (!parsed.success)
|
|
171
|
+
return zodErrorToToolResult(parsed.error);
|
|
172
|
+
const input = parsed.data;
|
|
173
|
+
let result = { action: input.action };
|
|
174
|
+
switch (input.action) {
|
|
175
|
+
case "configure":
|
|
176
|
+
result.resource = receipt(resource, (await client.updateResource(input.resource_id, {
|
|
177
|
+
consumer_access: input.policy,
|
|
178
|
+
expected_consumer_access_version: input.expected_version,
|
|
179
|
+
})).data, input.resource_id);
|
|
180
|
+
if (result.resource.consumer_access.mode !== input.policy.mode ||
|
|
181
|
+
result.resource.consumer_access.version !== input.policy.version ||
|
|
182
|
+
result.resource.consumer_access.contract_id !== input.policy.contract_id) {
|
|
183
|
+
throw new QURLAPIError(0, "access_receipt_unconfirmed", "The service did not confirm the private access policy; the update may have been applied. Re-read the resource before retrying.");
|
|
184
|
+
}
|
|
185
|
+
break;
|
|
186
|
+
case "invite":
|
|
187
|
+
result.invitation = receipt(invitation, await client.inviteConsumer(input.resource_id, input.email), input.resource_id);
|
|
188
|
+
break;
|
|
189
|
+
case "resend":
|
|
190
|
+
result.invitation = receipt(invitation, await client.resendConsumerInvitation(input.resource_id, input.id, input.expected_version), input.resource_id);
|
|
191
|
+
break;
|
|
192
|
+
case "revoke_invitation":
|
|
193
|
+
result.invitation = receipt(invitation, await client.revokeConsumerInvitation(input.resource_id, input.id, input.expected_version), input.resource_id);
|
|
194
|
+
break;
|
|
195
|
+
case "approve":
|
|
196
|
+
result.grant = receipt(grant, await client.approveConsumerGrant(input.resource_id, input.id, input.approval), input.resource_id);
|
|
197
|
+
break;
|
|
198
|
+
case "deny":
|
|
199
|
+
result.grant = receipt(grant, await client.denyConsumerGrant(input.resource_id, input.id, input.expected_version), input.resource_id);
|
|
200
|
+
break;
|
|
201
|
+
case "revoke_grant":
|
|
202
|
+
result.grant = receipt(grant, await client.revokeConsumerGrant(input.resource_id, input.id, input.expected_version), input.resource_id);
|
|
203
|
+
break;
|
|
204
|
+
case "list_invitations": {
|
|
205
|
+
const reply = await client.listConsumerInvitations(input.resource_id, {
|
|
206
|
+
cursor: input.cursor,
|
|
207
|
+
limit: input.limit,
|
|
208
|
+
});
|
|
209
|
+
result.invitations = receipt(z.array(invitation), reply.invitations, input.resource_id);
|
|
210
|
+
result.next_cursor = reply.next_cursor ?? undefined;
|
|
211
|
+
break;
|
|
212
|
+
}
|
|
213
|
+
case "list_grants": {
|
|
214
|
+
const reply = await client.listConsumerGrants(input.resource_id, {
|
|
215
|
+
cursor: input.cursor,
|
|
216
|
+
limit: input.limit,
|
|
217
|
+
});
|
|
218
|
+
result.grants = receipt(z.array(grant), reply.grants, input.resource_id);
|
|
219
|
+
result.next_cursor = reply.next_cursor ?? undefined;
|
|
220
|
+
break;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
result = output.parse(result);
|
|
224
|
+
return {
|
|
225
|
+
content: [{ type: "text", text: JSON.stringify(result) }],
|
|
226
|
+
structuredContent: toStructuredContent(result),
|
|
227
|
+
};
|
|
228
|
+
}),
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
//# sourceMappingURL=consumer-access.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consumer-access.js","sourceRoot":"","sources":["../../src/tools/consumer-access.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAoB,MAAM,cAAc,CAAC;AAC9D,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,GAErB,MAAM,cAAc,CAAC;AAEtB,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,C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