@layervai/qurl-mcp 0.4.0 → 0.5.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 +742 -46
- 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 +112 -23
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +173 -78
- 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 -25
- 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/secure-a-service.d.ts +16 -4
- package/dist/prompts/secure-a-service.d.ts.map +1 -1
- package/dist/prompts/secure-a-service.js +7 -15
- package/dist/prompts/secure-a-service.js.map +1 -1
- package/dist/server.d.ts +18 -6
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +41 -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 +13 -3
- package/dist/tools/_shared.d.ts.map +1 -1
- package/dist/tools/_shared.js +31 -7
- package/dist/tools/_shared.js.map +1 -1
- package/dist/tools/batch-create.d.ts +36 -343
- package/dist/tools/batch-create.d.ts.map +1 -1
- package/dist/tools/batch-create.js +7 -4
- package/dist/tools/batch-create.js.map +1 -1
- package/dist/tools/create-qurl.d.ts +79 -237
- package/dist/tools/create-qurl.d.ts.map +1 -1
- package/dist/tools/create-qurl.js +77 -47
- package/dist/tools/create-qurl.js.map +1 -1
- package/dist/tools/delete-qurl.d.ts +5 -22
- package/dist/tools/delete-qurl.d.ts.map +1 -1
- package/dist/tools/delete-qurl.js +19 -13
- package/dist/tools/delete-qurl.js.map +1 -1
- package/dist/tools/email-delivery.d.ts +37 -0
- package/dist/tools/email-delivery.d.ts.map +1 -0
- package/dist/tools/email-delivery.js +115 -0
- package/dist/tools/email-delivery.js.map +1 -0
- package/dist/tools/extend-qurl.d.ts +36 -189
- package/dist/tools/extend-qurl.d.ts.map +1 -1
- package/dist/tools/extend-qurl.js +3 -3
- package/dist/tools/extend-qurl.js.map +1 -1
- package/dist/tools/get-qurl.d.ts +36 -185
- package/dist/tools/get-qurl.d.ts.map +1 -1
- package/dist/tools/get-qurl.js +8 -5
- package/dist/tools/get-qurl.js.map +1 -1
- package/dist/tools/list-qurl-sessions.d.ts +45 -0
- package/dist/tools/list-qurl-sessions.d.ts.map +1 -0
- package/dist/tools/list-qurl-sessions.js +33 -0
- package/dist/tools/list-qurl-sessions.js.map +1 -0
- package/dist/tools/list-qurls.d.ts +38 -319
- package/dist/tools/list-qurls.d.ts.map +1 -1
- package/dist/tools/list-qurls.js +45 -20
- package/dist/tools/list-qurls.js.map +1 -1
- package/dist/tools/mint-link.d.ts +72 -303
- package/dist/tools/mint-link.d.ts.map +1 -1
- package/dist/tools/mint-link.js +35 -21
- package/dist/tools/mint-link.js.map +1 -1
- package/dist/tools/output-schemas.d.ts +326 -1112
- package/dist/tools/output-schemas.d.ts.map +1 -1
- package/dist/tools/output-schemas.js +141 -40
- package/dist/tools/output-schemas.js.map +1 -1
- package/dist/tools/resolve-qurl.d.ts +6 -37
- package/dist/tools/resolve-qurl.d.ts.map +1 -1
- package/dist/tools/resolve-qurl.js +5 -5
- package/dist/tools/resolve-qurl.js.map +1 -1
- package/dist/tools/revoke-qurl-token.d.ts +41 -0
- package/dist/tools/revoke-qurl-token.d.ts.map +1 -0
- package/dist/tools/revoke-qurl-token.js +40 -0
- package/dist/tools/revoke-qurl-token.js.map +1 -0
- package/dist/tools/terminate-qurl-sessions.d.ts +41 -0
- package/dist/tools/terminate-qurl-sessions.d.ts.map +1 -0
- package/dist/tools/terminate-qurl-sessions.js +68 -0
- package/dist/tools/terminate-qurl-sessions.js.map +1 -0
- package/dist/tools/update-qurl-token.d.ts +142 -0
- package/dist/tools/update-qurl-token.d.ts.map +1 -0
- package/dist/tools/update-qurl-token.js +75 -0
- package/dist/tools/update-qurl-token.js.map +1 -0
- package/dist/tools/update-qurl.d.ts +43 -264
- package/dist/tools/update-qurl.d.ts.map +1 -1
- package/dist/tools/update-qurl.js +57 -8
- package/dist/tools/update-qurl.js.map +1 -1
- package/dist/tools/upload-file-data-qurl.d.ts +182 -0
- package/dist/tools/upload-file-data-qurl.d.ts.map +1 -0
- package/dist/tools/upload-file-data-qurl.js +200 -0
- package/dist/tools/upload-file-data-qurl.js.map +1 -0
- package/dist/tools/upload-file-qurl.d.ts +162 -0
- package/dist/tools/upload-file-qurl.d.ts.map +1 -0
- package/dist/tools/upload-file-qurl.js +167 -0
- package/dist/tools/upload-file-qurl.js.map +1 -0
- package/dist/tools/upload-file-shared.d.ts +36 -0
- package/dist/tools/upload-file-shared.d.ts.map +1 -0
- package/dist/tools/upload-file-shared.js +347 -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 +29 -0
- package/dist/tools/upload-mint-options.js.map +1 -0
- package/dist/tools/upload-text-qurl.d.ts +144 -0
- package/dist/tools/upload-text-qurl.d.ts.map +1 -0
- package/dist/tools/upload-text-qurl.js +102 -0
- package/dist/tools/upload-text-qurl.js.map +1 -0
- package/package.json +27 -8
package/dist/client.js
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* qURL API client for the MCP server.
|
|
3
|
+
*
|
|
4
|
+
* The exported `QURLClient` is a thin adapter over the published
|
|
5
|
+
* `@layervai/qurl` SDK: the SDK owns all HTTP, retry, and error-parsing
|
|
6
|
+
* behavior, and this file translates between the SDK's surface and the local
|
|
7
|
+
* domain types/`IQURLClient` contract the tools, resources, and output schemas
|
|
8
|
+
* are written against (`{ data }` wrapping, the `qurls` field name, and the
|
|
9
|
+
* `QURLAPIError` error class).
|
|
3
10
|
*/
|
|
11
|
+
import { QURLClient as SDKQURLClient, QURLError } from "@layervai/qurl";
|
|
12
|
+
import { markRequestCredentialValidated } from "./auth/request-context.js";
|
|
4
13
|
// --- Error class ---
|
|
5
14
|
/**
|
|
6
15
|
* Error thrown by `QURLClient` for any API or pre-flight failure.
|
|
@@ -16,28 +25,86 @@ export class QURLAPIError extends Error {
|
|
|
16
25
|
type;
|
|
17
26
|
instance;
|
|
18
27
|
requestId;
|
|
19
|
-
|
|
28
|
+
tombstone;
|
|
29
|
+
constructor(statusCode, code, message, type, instance, requestId, tombstone) {
|
|
20
30
|
super(message);
|
|
21
31
|
this.statusCode = statusCode;
|
|
22
32
|
this.code = code;
|
|
23
33
|
this.type = type;
|
|
24
34
|
this.instance = instance;
|
|
25
35
|
this.requestId = requestId;
|
|
36
|
+
this.tombstone = tombstone;
|
|
26
37
|
this.name = "QURLAPIError";
|
|
27
38
|
}
|
|
28
39
|
}
|
|
29
40
|
/**
|
|
30
41
|
* Shared message for the missing-API-key condition. Emitted both at boot
|
|
31
|
-
* (stderr warning in `index.ts`) and on every API call
|
|
42
|
+
* (stderr warning in `index.ts`) and on every API call (the lazy `sdk` getter
|
|
43
|
+
* throws it when no key is configured).
|
|
32
44
|
* Keeping a single string means a user grepping logs/transcripts hits the
|
|
33
45
|
* same phrase from both sites, and the CI introspection probe has a stable
|
|
34
46
|
* substring to assert against.
|
|
35
47
|
*/
|
|
36
|
-
export const MISSING_API_KEY_MESSAGE = "QURL_API_KEY is not set. Set it in the MCP server environment and restart to make API calls.";
|
|
48
|
+
export const MISSING_API_KEY_MESSAGE = "QURL_API_KEY is not set. Set it in the MCP server environment or runtime config and restart to make API calls.";
|
|
49
|
+
// --- SDK adapter helpers ---
|
|
50
|
+
/**
|
|
51
|
+
* Translate an error thrown by the SDK into the `QURLAPIError` the MCP tools
|
|
52
|
+
* branch on. Two consumers depend on the exact fields: `delete-qurl` checks
|
|
53
|
+
* `statusCode === 404`, and `withMissingApiKeyHandler` checks
|
|
54
|
+
* `code === "missing_api_key"`. A `QURLAPIError` we raised ourselves (the
|
|
55
|
+
* missing-key pre-flight) passes through untouched; anything that isn't a
|
|
56
|
+
* `QURLError` is returned as-is.
|
|
57
|
+
*/
|
|
58
|
+
function translateError(err) {
|
|
59
|
+
if (err instanceof QURLAPIError)
|
|
60
|
+
return err;
|
|
61
|
+
if (err instanceof QURLError) {
|
|
62
|
+
return new QURLAPIError(err.status, err.code,
|
|
63
|
+
// `QURLError.detail` is non-optional and always populated (the SDK falls
|
|
64
|
+
// back to `title` when the API omits detail), so it carries the same
|
|
65
|
+
// human-readable text the old client's detail/title/message chain did.
|
|
66
|
+
err.detail, err.type, err.instance, err.requestId,
|
|
67
|
+
// 410 tombstone metadata: the SDK's QURLError does not currently surface
|
|
68
|
+
// it, so this is always undefined. Kept for forward-compat and because
|
|
69
|
+
// QURLAPIError carries the field; no MCP tool reads it today.
|
|
70
|
+
err.tombstone);
|
|
71
|
+
}
|
|
72
|
+
return err;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Map an SDK resource read (`QURL`/`Resource`) onto the MCP's `QURL` shape.
|
|
76
|
+
* The only structural difference is the field name for the nested tokens:
|
|
77
|
+
* the SDK exposes `access_tokens`, the MCP's output schemas validate `qurls`.
|
|
78
|
+
* When the SDK omits `access_tokens`, the key is dropped entirely rather than
|
|
79
|
+
* surfaced as `qurls: undefined`.
|
|
80
|
+
*/
|
|
81
|
+
function mapResource(raw) {
|
|
82
|
+
const { access_tokens, ...rest } = raw;
|
|
83
|
+
// Drop the key for both `undefined` and a defensive `null`.
|
|
84
|
+
const mapped = access_tokens === undefined || access_tokens === null
|
|
85
|
+
? rest
|
|
86
|
+
: { ...rest, qurls: access_tokens };
|
|
87
|
+
return mapped;
|
|
88
|
+
}
|
|
37
89
|
// --- Client implementation ---
|
|
90
|
+
/**
|
|
91
|
+
* Adapter implementing {@link IQURLClient} over the `@layervai/qurl` SDK.
|
|
92
|
+
*
|
|
93
|
+
* The SDK owns HTTP, retries, and error parsing. This class only translates
|
|
94
|
+
* shapes (re-wraps the SDK's unwrapped returns into `{ data }`, renames
|
|
95
|
+
* `access_tokens` → `qurls`, reshapes list/batch/session envelopes) and maps
|
|
96
|
+
* the SDK's `QURLError` subclasses onto `QURLAPIError`.
|
|
97
|
+
*/
|
|
38
98
|
export class QURLClient {
|
|
39
99
|
apiKey;
|
|
40
100
|
baseURL;
|
|
101
|
+
/**
|
|
102
|
+
* Constructed lazily on first API call. The SDK constructor throws on an
|
|
103
|
+
* empty key, but `index.ts` deliberately boots the server keyless so MCP
|
|
104
|
+
* introspection (tools/list, resources/list, prompts/list) works without a
|
|
105
|
+
* configured key — the missing-key error must defer to the first real call.
|
|
106
|
+
*/
|
|
107
|
+
_sdk;
|
|
41
108
|
constructor(config) {
|
|
42
109
|
// `?? ""` defends against JS callers that hand in `undefined` (the TS
|
|
43
110
|
// type forbids it, but `JSON.parse`'d configs and other dynamic call
|
|
@@ -45,112 +112,140 @@ export class QURLClient {
|
|
|
45
112
|
// stray `QURL_API_KEY=" "`) takes the typed `missing_api_key` path
|
|
46
113
|
// instead of being sent over the wire as a server-side 401.
|
|
47
114
|
this.apiKey = (config.apiKey ?? "").trim();
|
|
48
|
-
|
|
115
|
+
// `?? ""` mirrors the apiKey guard above: a JS caller passing `undefined`
|
|
116
|
+
// for baseURL (the TS type forbids it; index.ts always supplies a default)
|
|
117
|
+
// gets the default-empty path rather than a raw TypeError from `.replace`.
|
|
118
|
+
this.baseURL = (config.baseURL ?? "").replace(/\/$/, "");
|
|
49
119
|
}
|
|
50
120
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* `
|
|
54
|
-
*
|
|
55
|
-
* used by `batchCreate`, where the API returns a structured BatchCreateResponse
|
|
56
|
-
* on HTTP 400 (all items rejected) — throwing would drop the per-item errors.
|
|
121
|
+
* Lazily build the SDK client. Throws the typed `missing_api_key` error
|
|
122
|
+
* (status 0) when no key is configured, matching the pre-SDK behavior that
|
|
123
|
+
* `withMissingApiKeyHandler` and the CI introspection probe rely on. Note
|
|
124
|
+
* the SDK option is `baseUrl` (lowercase) vs. the MCP config's `baseURL`.
|
|
57
125
|
*/
|
|
58
|
-
|
|
126
|
+
get sdk() {
|
|
59
127
|
if (!this.apiKey) {
|
|
60
128
|
throw new QURLAPIError(0, "missing_api_key", MISSING_API_KEY_MESSAGE);
|
|
61
129
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
Authorization: `Bearer ${this.apiKey}`,
|
|
65
|
-
};
|
|
66
|
-
if (body !== undefined) {
|
|
67
|
-
headers["Content-Type"] = "application/json";
|
|
130
|
+
if (!this._sdk) {
|
|
131
|
+
this._sdk = new SDKQURLClient({ apiKey: this.apiKey, baseUrl: this.baseURL });
|
|
68
132
|
}
|
|
69
|
-
|
|
70
|
-
method,
|
|
71
|
-
headers,
|
|
72
|
-
body: body !== undefined ? JSON.stringify(body) : undefined,
|
|
73
|
-
});
|
|
74
|
-
const text = await response.text();
|
|
75
|
-
// Handle empty 2xx responses (e.g., 204 No Content from DELETE).
|
|
76
|
-
// Only deleteQURL hits this path — T is void there, so undefined is correct.
|
|
77
|
-
if (!text && response.ok) {
|
|
78
|
-
return undefined;
|
|
79
|
-
}
|
|
80
|
-
const json = this.parseJSON(text, response.status);
|
|
81
|
-
if (!response.ok && !passthroughStatuses.includes(response.status)) {
|
|
82
|
-
// Trust boundary: we cast the parsed error body to the RFC 7807 shape
|
|
83
|
-
// the API documents. The fallback chain below tolerates missing fields,
|
|
84
|
-
// so a malformed error response still degrades to `HTTP ${status}`.
|
|
85
|
-
const error = json.error;
|
|
86
|
-
const meta = json.meta;
|
|
87
|
-
throw new QURLAPIError(response.status, error?.code ?? "unknown", error?.detail ?? error?.title ?? error?.message ?? `HTTP ${response.status}`, error?.type, error?.instance, meta?.request_id);
|
|
88
|
-
}
|
|
89
|
-
return json;
|
|
133
|
+
return this._sdk;
|
|
90
134
|
}
|
|
91
|
-
|
|
135
|
+
/** Run an SDK call, translating its errors into `QURLAPIError`. */
|
|
136
|
+
async call(fn) {
|
|
92
137
|
try {
|
|
93
|
-
|
|
138
|
+
const result = await fn(this.sdk);
|
|
139
|
+
// Only a successful API response conclusively validates the request
|
|
140
|
+
// credential. Any error status may have originated from an intermediary
|
|
141
|
+
// before the qURL API authenticated the bearer token. This trust boundary
|
|
142
|
+
// assumes the operator-configured HTTPS endpoint and its intermediaries
|
|
143
|
+
// neither synthesize nor cache authenticated success responses.
|
|
144
|
+
markRequestCredentialValidated();
|
|
145
|
+
return result;
|
|
94
146
|
}
|
|
95
|
-
catch {
|
|
96
|
-
throw
|
|
147
|
+
catch (err) {
|
|
148
|
+
throw translateError(err);
|
|
97
149
|
}
|
|
98
150
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
151
|
+
// Casts at the SDK boundary are kept as tight as the compiler allows:
|
|
152
|
+
// inputs pass through unannotated where the MCP type is structurally
|
|
153
|
+
// assignable to the SDK type (a genuine drift then fails to compile), and
|
|
154
|
+
// outputs use a single `as` (not `as unknown as`) so a grossly incompatible
|
|
155
|
+
// SDK return is still rejected. `mapResource`'s `QURL`/`Resource` → MCP
|
|
156
|
+
// `QURL` conversion is the one place a double cast is genuinely required.
|
|
157
|
+
// The tools additionally validate every `structuredContent` against their
|
|
158
|
+
// zod `outputSchema`, so any residual response drift surfaces at runtime.
|
|
102
159
|
async createQURL(input) {
|
|
103
|
-
return this.
|
|
160
|
+
return this.call(async (sdk) => ({ data: (await sdk.create(input)) }));
|
|
104
161
|
}
|
|
105
162
|
async getQURL(id) {
|
|
106
|
-
return this.
|
|
163
|
+
return this.call(async (sdk) => ({ data: mapResource(await sdk.get(id)) }));
|
|
107
164
|
}
|
|
108
165
|
async listQURLs(input) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
params.set("created_before", input.created_before);
|
|
120
|
-
if (input?.expires_before)
|
|
121
|
-
params.set("expires_before", input.expires_before);
|
|
122
|
-
if (input?.expires_after)
|
|
123
|
-
params.set("expires_after", input.expires_after);
|
|
124
|
-
if (input?.sort)
|
|
125
|
-
params.set("sort", input.sort);
|
|
126
|
-
if (input?.q)
|
|
127
|
-
params.set("q", input.q);
|
|
128
|
-
const query = params.toString();
|
|
129
|
-
return this.request("GET", `/v1/qurls${query ? `?${query}` : ""}`);
|
|
166
|
+
return this.call(async (sdk) => {
|
|
167
|
+
const out = await sdk.list(input);
|
|
168
|
+
// The SDK's list envelope is `{ qurls, next_cursor, has_more }` and does
|
|
169
|
+
// not surface `meta.page_size` / `meta.request_id` (both optional in the
|
|
170
|
+
// output schema), so they are intentionally absent here.
|
|
171
|
+
return {
|
|
172
|
+
data: out.qurls.map(mapResource),
|
|
173
|
+
meta: { next_cursor: out.next_cursor, has_more: out.has_more },
|
|
174
|
+
};
|
|
175
|
+
});
|
|
130
176
|
}
|
|
131
177
|
async deleteQURL(id) {
|
|
132
|
-
|
|
178
|
+
// Preserve the legacy endpoint while bypassing its SDK prefix guard for modern IDs.
|
|
179
|
+
await this.call((sdk) => (id.startsWith("r_") ? sdk.delete(id) : sdk.deleteResource(id)));
|
|
133
180
|
}
|
|
134
181
|
async updateQURL(id, input) {
|
|
135
|
-
return this.
|
|
182
|
+
return this.call(async (sdk) => ({ data: mapResource(await sdk.update(id, input)) }));
|
|
183
|
+
}
|
|
184
|
+
async updateResource(id, input) {
|
|
185
|
+
return this.call(async (sdk) => ({ data: mapResource(await sdk.updateResource(id, input)) }));
|
|
136
186
|
}
|
|
137
187
|
async extendQURL(id, input) {
|
|
138
|
-
|
|
139
|
-
// so we delegate to updateQURL rather than duplicating the PATCH call.
|
|
140
|
-
return this.updateQURL(id, input);
|
|
188
|
+
return this.call(async (sdk) => ({ data: mapResource(await sdk.extend(id, input)) }));
|
|
141
189
|
}
|
|
142
190
|
async resolveQURL(input) {
|
|
143
|
-
return this.
|
|
191
|
+
return this.call(async (sdk) => ({ data: (await sdk.resolve(input)) }));
|
|
144
192
|
}
|
|
145
193
|
async getQuota() {
|
|
146
|
-
return this.
|
|
194
|
+
return this.call(async (sdk) => ({ data: (await sdk.getQuota()) }));
|
|
147
195
|
}
|
|
148
196
|
async mintLink(id, input) {
|
|
149
|
-
return this.
|
|
197
|
+
return this.call(async (sdk) => ({ data: (await sdk.mintLink(id, input)) }));
|
|
150
198
|
}
|
|
151
199
|
async batchCreate(input) {
|
|
152
|
-
|
|
153
|
-
|
|
200
|
+
return this.call(async (sdk) => {
|
|
201
|
+
// The SDK passes through HTTP 400 (all items failed) as a populated
|
|
202
|
+
// BatchCreateOutput rather than throwing, so the all-failed case still
|
|
203
|
+
// reaches here with `failed > 0` — matching the old passthrough behavior
|
|
204
|
+
// that batch-create.ts depends on. A populated response proves the API
|
|
205
|
+
// accepted the credential, so the shared call wrapper intentionally
|
|
206
|
+
// marks the request credential validated even for this HTTP 400 shape.
|
|
207
|
+
const out = await sdk.batchCreate(input);
|
|
208
|
+
return {
|
|
209
|
+
data: {
|
|
210
|
+
succeeded: out.succeeded,
|
|
211
|
+
failed: out.failed,
|
|
212
|
+
results: out.results,
|
|
213
|
+
},
|
|
214
|
+
meta: { request_id: out.request_id },
|
|
215
|
+
};
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
async revokeQurlToken(resourceId, qurlId) {
|
|
219
|
+
await this.call((sdk) => sdk.revokeResourceQurl(resourceId, qurlId));
|
|
220
|
+
}
|
|
221
|
+
async updateQurlToken(resourceId, qurlId, input) {
|
|
222
|
+
return this.call(async (sdk) => ({
|
|
223
|
+
// The SDK types this input as an extend_by-XOR-expires_at discriminated
|
|
224
|
+
// union; the MCP's UpdateQurlTokenInput allows both fields and enforces
|
|
225
|
+
// the XOR via a zod refinement in update-qurl-token.ts, so bridge here.
|
|
226
|
+
data: (await sdk.updateResourceQurl(resourceId, qurlId, input)),
|
|
227
|
+
}));
|
|
228
|
+
}
|
|
229
|
+
async listResourceSessions(resourceId) {
|
|
230
|
+
return this.call(async (sdk) => {
|
|
231
|
+
const out = await sdk.listResourceSessions(resourceId);
|
|
232
|
+
return {
|
|
233
|
+
data: out.sessions,
|
|
234
|
+
meta: { request_id: out.request_id },
|
|
235
|
+
};
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
async terminateResourceSession(resourceId, sessionId) {
|
|
239
|
+
await this.call((sdk) => sdk.terminateResourceSession(resourceId, sessionId));
|
|
240
|
+
}
|
|
241
|
+
async terminateAllResourceSessions(resourceId) {
|
|
242
|
+
return this.call(async (sdk) => {
|
|
243
|
+
const out = await sdk.terminateAllResourceSessions(resourceId);
|
|
244
|
+
return {
|
|
245
|
+
data: { terminated: out.terminated },
|
|
246
|
+
meta: { request_id: out.request_id },
|
|
247
|
+
};
|
|
248
|
+
});
|
|
154
249
|
}
|
|
155
250
|
}
|
|
156
251
|
//# sourceMappingURL=client.js.map
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,IAAI,aAAa,EAAE,SA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AAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
export interface SmtpConfig {
|
|
2
|
+
host: string;
|
|
3
|
+
port: number;
|
|
4
|
+
secure: boolean;
|
|
5
|
+
username: string;
|
|
6
|
+
password: string;
|
|
7
|
+
fromEmail: string;
|
|
8
|
+
fromName?: string;
|
|
9
|
+
allowedRecipients?: string[];
|
|
10
|
+
allowedRecipientDomains?: string[];
|
|
11
|
+
maxRecipientsPerMessage: number;
|
|
12
|
+
maxRecipientsPerHour: number;
|
|
13
|
+
}
|
|
14
|
+
export interface RuntimeConfig {
|
|
15
|
+
maxUploadFileDataBytes: number;
|
|
16
|
+
defaultQurlApiUrl: string;
|
|
17
|
+
defaultQurlConnectorUrl?: string;
|
|
18
|
+
qurlApiKey?: string;
|
|
19
|
+
smtp?: SmtpConfig;
|
|
20
|
+
publicVideo?: PublicVideoConfig;
|
|
21
|
+
}
|
|
22
|
+
export interface PublicVideoConfig {
|
|
23
|
+
title: string;
|
|
24
|
+
pagePath: string;
|
|
25
|
+
filePath: string;
|
|
26
|
+
}
|
|
27
|
+
export interface SmtpConfigInspection {
|
|
28
|
+
enabled: boolean;
|
|
29
|
+
missingFields: string[];
|
|
30
|
+
securityWarnings: string[];
|
|
31
|
+
host?: string;
|
|
32
|
+
port?: number;
|
|
33
|
+
secure?: boolean;
|
|
34
|
+
username?: string;
|
|
35
|
+
fromEmail?: string;
|
|
36
|
+
fromName?: string;
|
|
37
|
+
}
|
|
38
|
+
export type UncheckedConfigFileShape = Partial<{
|
|
39
|
+
port: number;
|
|
40
|
+
host: string;
|
|
41
|
+
baseUrl: string;
|
|
42
|
+
allowedHosts: string[];
|
|
43
|
+
trustProxyHops: number;
|
|
44
|
+
maxSessions: number;
|
|
45
|
+
maxSessionsPerCredential: number;
|
|
46
|
+
maxUnvalidatedSessions: number;
|
|
47
|
+
sessionIdleTtlMs: number;
|
|
48
|
+
sessionAbsoluteTtlMs: number;
|
|
49
|
+
unvalidatedSessionTtlMs: number;
|
|
50
|
+
mcpRateLimitPerMinute: number;
|
|
51
|
+
stateless: boolean;
|
|
52
|
+
serveLayerVLegalPages: boolean;
|
|
53
|
+
maxConcurrentRequests: number;
|
|
54
|
+
credentialRateLimitStore: "memory" | "dynamodb";
|
|
55
|
+
rateLimitDynamoDbTable: string;
|
|
56
|
+
metricsNamespace: string;
|
|
57
|
+
metricsService: string;
|
|
58
|
+
metricsEnvironment: string;
|
|
59
|
+
publicFileRateLimitPerMinute: number;
|
|
60
|
+
maxUploadFileDataBytes: string | number;
|
|
61
|
+
defaultQurlApiUrl: string;
|
|
62
|
+
defaultQurlConnectorUrl: string;
|
|
63
|
+
smtp: Partial<SmtpConfig>;
|
|
64
|
+
publicVideo: Partial<PublicVideoConfig>;
|
|
65
|
+
}>;
|
|
66
|
+
export declare const DEFAULT_QURL_API_URL = "https://api.layerv.ai";
|
|
67
|
+
export declare const DEFAULT_PUBLIC_VIDEO_TITLE = "Video Showcase";
|
|
68
|
+
export declare const DEFAULT_PUBLIC_VIDEO_PAGE_PATH = "/media/video";
|
|
69
|
+
export declare const MAX_PUBLIC_VIDEO_TITLE_CHARACTERS = 200;
|
|
70
|
+
export declare const DEFAULT_MAX_UPLOAD_FILE_DATA_BYTES: number;
|
|
71
|
+
export declare const MAX_UPLOAD_FILE_DATA_BYTES: number;
|
|
72
|
+
export declare const MAX_CONFIG_ALLOWLIST_ENTRIES = 1000;
|
|
73
|
+
export declare function parseConfigFile(configPath: string): UncheckedConfigFileShape;
|
|
74
|
+
export declare function parseSizeBytes(value: unknown, fallback: number, fieldName: string): number;
|
|
75
|
+
export declare function getDefaultConfigPath(): string;
|
|
76
|
+
export declare function trimString(value: unknown): string | undefined;
|
|
77
|
+
export declare function isLoopbackHostname(hostname: string): boolean;
|
|
78
|
+
export declare function normalizeServiceBaseUrl(value: string, fieldName: string, requireHttps: boolean): string;
|
|
79
|
+
export declare function normalizePublicPath(value: string | undefined, fallback: string, fieldName?: string): string;
|
|
80
|
+
export declare function normalizeAbsoluteFilePath(value: unknown, fieldName: string): string | undefined;
|
|
81
|
+
export declare function normalizePublicVideoTitle(value: string | undefined): string;
|
|
82
|
+
export declare function normalizePublicVideoConfig(rawConfig: Partial<PublicVideoConfig> | undefined): PublicVideoConfig | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* Load runtime configuration from file and environment variables.
|
|
85
|
+
* Results are cached per config path, environment fingerprint, and file
|
|
86
|
+
* metadata so edits are picked up without a process restart.
|
|
87
|
+
*
|
|
88
|
+
* @param configPath - Path to config file (defaults to getDefaultConfigPath())
|
|
89
|
+
* @returns Resolved runtime configuration
|
|
90
|
+
*/
|
|
91
|
+
export declare function loadRuntimeConfig(configPath?: string): RuntimeConfig;
|
|
92
|
+
/**
|
|
93
|
+
* Clear the runtime config cache. Useful for tests or for forcing a reload
|
|
94
|
+
* after an operator deliberately preserves a file's metadata while editing.
|
|
95
|
+
*/
|
|
96
|
+
export declare function clearRuntimeConfigCache(): void;
|
|
97
|
+
export declare function inspectSmtpConfig(configPath?: string): SmtpConfigInspection;
|
|
98
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAC;IACnC,uBAAuB,EAAE,MAAM,CAAC;IAChC,oBAAoB,EAAE,MAAM,CAAC;CAC9B;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