microsoft-graph 2.11.3 → 2.13.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/biome.jsonc +1 -1
- package/dist/cjs/errors/TimeoutError.d.ts +4 -0
- package/dist/cjs/errors/TimeoutError.d.ts.map +1 -0
- package/dist/cjs/errors/TimeoutError.js +9 -0
- package/dist/cjs/graphApi.js +7 -8
- package/dist/cjs/operations/driveItem/initiateCopyDriveItem.d.ts +3 -2
- package/dist/cjs/operations/driveItem/initiateCopyDriveItem.d.ts.map +1 -1
- package/dist/cjs/operations/driveItem/initiateCopyDriveItem.js +2 -2
- package/dist/cjs/operations/driveItem/moveDriveItem.d.ts +14 -0
- package/dist/cjs/operations/driveItem/moveDriveItem.d.ts.map +1 -0
- package/dist/cjs/operations/driveItem/moveDriveItem.js +33 -0
- package/dist/cjs/services/driveItem.d.ts +9 -0
- package/dist/cjs/services/driveItem.d.ts.map +1 -1
- package/dist/cjs/services/driveItem.js +18 -0
- package/dist/cjs/tasks/copyDriveItem.d.ts +14 -0
- package/dist/cjs/tasks/copyDriveItem.d.ts.map +1 -0
- package/dist/cjs/tasks/copyDriveItem.js +39 -0
- package/dist/esm/errors/TimeoutError.d.ts +4 -0
- package/dist/esm/errors/TimeoutError.d.ts.map +1 -0
- package/dist/esm/errors/TimeoutError.js +6 -0
- package/dist/esm/graphApi.js +7 -8
- package/dist/esm/operations/driveItem/initiateCopyDriveItem.d.ts +3 -2
- package/dist/esm/operations/driveItem/initiateCopyDriveItem.d.ts.map +1 -1
- package/dist/esm/operations/driveItem/initiateCopyDriveItem.js +2 -2
- package/dist/esm/operations/driveItem/moveDriveItem.d.ts +14 -0
- package/dist/esm/operations/driveItem/moveDriveItem.d.ts.map +1 -0
- package/dist/esm/operations/driveItem/moveDriveItem.js +30 -0
- package/dist/esm/services/driveItem.d.ts +9 -0
- package/dist/esm/services/driveItem.d.ts.map +1 -1
- package/dist/esm/services/driveItem.js +17 -0
- package/dist/esm/tasks/copyDriveItem.d.ts +14 -0
- package/dist/esm/tasks/copyDriveItem.d.ts.map +1 -0
- package/dist/esm/tasks/copyDriveItem.js +33 -0
- package/package.json +898 -143
- package/update-exports.ts +82 -93
- package/vitest.config.ts +17 -17
package/update-exports.ts
CHANGED
|
@@ -1,101 +1,90 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { basename, extname, join } from "node:path";
|
|
3
|
+
|
|
4
|
+
const esmFolderPath = join(process.cwd(), "dist", "esm");
|
|
5
|
+
const cjsFolderPath = join(process.cwd(), "dist", "cjs");
|
|
6
|
+
|
|
7
|
+
const cjsPackageFilePath = join(cjsFolderPath, "package.json");
|
|
8
|
+
const esmPackageFilePath = join(esmFolderPath, "package.json");
|
|
9
|
+
|
|
10
|
+
const rootPackageFilePath = join(process.cwd(), "package.json");
|
|
11
|
+
|
|
12
|
+
patchRoot();
|
|
13
|
+
// biome-ignore lint/suspicious/noConsoleLog: Appropriate in this context
|
|
14
|
+
console.log("✅ package.json exports updated with");
|
|
15
|
+
|
|
16
|
+
createCjsPackageJson();
|
|
17
|
+
createEsmPackageJson();
|
|
18
|
+
// biome-ignore lint/suspicious/noConsoleLog: Appropriate in this context
|
|
19
|
+
console.log("✅ Generated package.json files in dist folders");
|
|
20
|
+
|
|
21
|
+
function patchRoot() {
|
|
22
|
+
const exportsMap = {
|
|
23
|
+
".": {
|
|
24
|
+
import: "./dist/esm/index.js",
|
|
25
|
+
require: "./dist/cjs/index.js",
|
|
26
|
+
types: "./dist/esm/index.d.ts",
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
exportsWalk(esmFolderPath, exportsMap); // Use esmDir to determine what gets exported
|
|
31
|
+
|
|
32
|
+
const cjsEntries = Object.keys(exportsMap).filter((key) => key !== ".");
|
|
33
|
+
for (const entry of cjsEntries) {
|
|
34
|
+
const cjsOnlyPath = exportsMap[entry].require.replace("./dist/cjs/", "./dist/cjs/");
|
|
35
|
+
exportsMap[cjsOnlyPath] = {
|
|
36
|
+
require: exportsMap[entry].require,
|
|
37
|
+
import: exportsMap[entry].import,
|
|
38
|
+
types: exportsMap[entry].types,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const pkg = JSON.parse(readFileSync(rootPackageFilePath, "utf-8"));
|
|
43
|
+
pkg.exports = exportsMap;
|
|
44
|
+
writeFileSync(rootPackageFilePath, JSON.stringify(pkg, null, 2));
|
|
19
45
|
}
|
|
20
46
|
|
|
21
|
-
function
|
|
22
|
-
|
|
47
|
+
function createCjsPackageJson() {
|
|
48
|
+
const body = {
|
|
49
|
+
type: "commonjs",
|
|
50
|
+
};
|
|
51
|
+
writeFileSync(cjsPackageFilePath, JSON.stringify(body, null, 2));
|
|
23
52
|
}
|
|
24
53
|
|
|
25
|
-
function
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const stats = fs.statSync(fullPath);
|
|
31
|
-
const relPath = path.join(currentRelPath, entry);
|
|
32
|
-
|
|
33
|
-
if (stats.isDirectory()) {
|
|
34
|
-
if (!isTestDir(relPath)) {
|
|
35
|
-
walk(fullPath, relPath);
|
|
36
|
-
}
|
|
37
|
-
} else if (
|
|
38
|
-
entry.endsWith('.js') &&
|
|
39
|
-
entry !== 'index.js' &&
|
|
40
|
-
!isTestFile(entry) &&
|
|
41
|
-
!isTestDir(relPath)
|
|
42
|
-
) {
|
|
43
|
-
// Create a clean path without 'dist/esm' or 'dist/cjs'
|
|
44
|
-
const cleanRelPath = relPath.replace(/\\/g, '/');
|
|
45
|
-
const moduleBasePath = cleanRelPath.replace(/\.js$/, '');
|
|
46
|
-
|
|
47
|
-
// Create a clean export path for the module (without dist)
|
|
48
|
-
const exportPath = `./${moduleBasePath}`;
|
|
49
|
-
|
|
50
|
-
exportsMap[exportPath] = {
|
|
51
|
-
import: `./dist/esm/${cleanRelPath}`,
|
|
52
|
-
require: `./dist/cjs/${cleanRelPath}`,
|
|
53
|
-
types: `./dist/esm/${cleanRelPath.replace(/\.js$/, '.d.ts')}`
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
}
|
|
54
|
+
function createEsmPackageJson() {
|
|
55
|
+
const body = {
|
|
56
|
+
type: "module",
|
|
57
|
+
};
|
|
58
|
+
writeFileSync(esmPackageFilePath, JSON.stringify(body, null, 2));
|
|
57
59
|
}
|
|
58
60
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
61
|
+
function exportsWalk(dir: string, exportsMap, currentRelPath = ""): void {
|
|
62
|
+
const entries = readdirSync(dir);
|
|
63
|
+
|
|
64
|
+
for (const entry of entries) {
|
|
65
|
+
const fullPath = join(dir, entry);
|
|
66
|
+
const stats = statSync(fullPath);
|
|
67
|
+
const relPath = join(currentRelPath, entry);
|
|
68
|
+
|
|
69
|
+
if (stats.isDirectory()) {
|
|
70
|
+
exportsWalk(fullPath, exportsMap, relPath);
|
|
71
|
+
} else if (extname(entry) === ".js" && entry !== "index.js" && !isTestFile(entry)) {
|
|
72
|
+
const target = {
|
|
73
|
+
import: `./dist/esm/${relPath}`,
|
|
74
|
+
require: `./dist/cjs/${relPath}`,
|
|
75
|
+
types: `./dist/esm/${
|
|
76
|
+
// biome-ignore lint/performance/useTopLevelRegex: <explanation>
|
|
77
|
+
relPath.replace(/\.js$/, ".d.ts")
|
|
78
|
+
}`,
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
exportsMap[`./${relPath}`] = target;
|
|
82
|
+
// exportsMap[`./${relPath.replace(/\.js$/, "")}`] = target;
|
|
83
|
+
exportsMap[`./${basename(entry, extname(entry))}`] = target;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
71
86
|
}
|
|
72
87
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
78
|
-
console.log("✅ package.json exports updated with", Object.keys(exportsMap).length, "entries");
|
|
79
|
-
|
|
80
|
-
// Generate package.json for CJS modules
|
|
81
|
-
const cjsPackageJson = {
|
|
82
|
-
type: "commonjs"
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
// Generate package.json for ESM modules
|
|
86
|
-
const esmPackageJson = {
|
|
87
|
-
type: "module"
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
// Write the package.json files
|
|
91
|
-
fs.writeFileSync(
|
|
92
|
-
path.join(process.cwd(), 'dist', 'cjs', 'package.json'),
|
|
93
|
-
JSON.stringify(cjsPackageJson, null, 2)
|
|
94
|
-
);
|
|
95
|
-
|
|
96
|
-
fs.writeFileSync(
|
|
97
|
-
path.join(process.cwd(), 'dist', 'esm', 'package.json'),
|
|
98
|
-
JSON.stringify(esmPackageJson, null, 2)
|
|
99
|
-
);
|
|
100
|
-
|
|
101
|
-
console.log('✅ Generated package.json files in dist folders');
|
|
88
|
+
function isTestFile(fileName: string): boolean {
|
|
89
|
+
return fileName.endsWith(".test.js") || fileName.endsWith(".spec.js");
|
|
90
|
+
}
|
package/vitest.config.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { defineConfig } from "vitest/config";
|
|
2
2
|
|
|
3
3
|
export default defineConfig({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
});
|
|
4
|
+
test: {
|
|
5
|
+
environment: "node",
|
|
6
|
+
watch: false,
|
|
7
|
+
include: ["src/**/*.test.ts"],
|
|
8
|
+
maxConcurrency: 1, // Avoid API throttling
|
|
9
|
+
retry: 1,
|
|
10
|
+
poolOptions: {
|
|
11
|
+
threads: {
|
|
12
|
+
maxThreads: 1, // Avoid API throttling
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
sequence: {
|
|
16
|
+
concurrent: false,
|
|
17
|
+
},
|
|
18
|
+
testTimeout: 16000,
|
|
19
|
+
},
|
|
20
|
+
});
|