nworks-plus 1.4.0 → 1.4.3
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 +190 -190
- package/README.ja.md +393 -393
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +4 -4
- package/dist/mcp.js.map +1 -1
- package/package.json +59 -58
package/dist/mcp.js
CHANGED
|
@@ -291,7 +291,7 @@ async function request(opts, _retryCount = 0) {
|
|
|
291
291
|
}
|
|
292
292
|
|
|
293
293
|
// src/utils/sanitize.ts
|
|
294
|
-
import {
|
|
294
|
+
import { posix, resolve, sep } from "path";
|
|
295
295
|
import { randomBytes } from "crypto";
|
|
296
296
|
function sanitizePathSegment(value) {
|
|
297
297
|
if (!value || typeof value !== "string") {
|
|
@@ -307,7 +307,7 @@ function sanitizeFileName(name) {
|
|
|
307
307
|
if (!name || typeof name !== "string") {
|
|
308
308
|
throw new Error("File name must be a non-empty string");
|
|
309
309
|
}
|
|
310
|
-
const base = basename(name);
|
|
310
|
+
const base = posix.basename(name);
|
|
311
311
|
return base.replace(/[\r\n"\\]/g, "_");
|
|
312
312
|
}
|
|
313
313
|
function validateLocalPath(filePath, allowedBase) {
|
|
@@ -838,7 +838,7 @@ async function deleteEvent(eventId, userId = "me", sendNotification = false, pro
|
|
|
838
838
|
|
|
839
839
|
// src/api/drive.ts
|
|
840
840
|
import { readFile as readFile3, stat as stat2 } from "fs/promises";
|
|
841
|
-
import { basename
|
|
841
|
+
import { basename } from "path";
|
|
842
842
|
var BASE_URL3 = "https://www.worksapis.com/v1.0";
|
|
843
843
|
var MAX_UPLOAD_SIZE = 100 * 1024 * 1024;
|
|
844
844
|
var ALLOWED_HOSTS = [
|
|
@@ -882,7 +882,7 @@ async function listFiles(userId = "me", folderId, count = 20, cursor, profile =
|
|
|
882
882
|
return { files: data.files ?? [], responseMetaData: data.responseMetaData };
|
|
883
883
|
}
|
|
884
884
|
async function uploadFile(localPath, userId = "me", folderId, overwrite = false, profile = "default") {
|
|
885
|
-
const fileName =
|
|
885
|
+
const fileName = basename(localPath);
|
|
886
886
|
const safeName = sanitizeFileName(fileName);
|
|
887
887
|
const fileStat = await stat2(localPath);
|
|
888
888
|
const fileSize = fileStat.size;
|