diff --git a/debug/launch/graph.ts b/debug/launch/graph.ts index ee86b8863..f2646a551 100644 --- a/debug/launch/graph.ts +++ b/debug/launch/graph.ts @@ -1,9 +1,6 @@ import { Logger, LogLevel } from "@pnp/logging"; import { graphSetup } from "./setup.js"; -import { getRandomString, stringIsNullOrEmpty } from "@pnp/core"; import "@pnp/graph/users"; -import "@pnp/graph/files"; -import { IDriveItemAdd, IDriveItemAddFolder, IFileUploadOptions, IItemOptions, IBundleDef } from "@pnp/graph/files"; declare var process: { exit(code?: number): void }; @@ -11,42 +8,10 @@ export async function Example(settings: any) { const graph = graphSetup(settings); - const fileOptions: IFileUploadOptions = { - content: "This is some test content", - filePathName: "pnpTest.txt", - contentType: "text/plain;charset=utf-8", - }; - - const testUserName = settings.testing.testUser.substring(settings.testing.testUser.lastIndexOf("|") + 1); - const drives = await graph.users.getById(testUserName).drives(); - let driveId = ""; - if (drives.length > 0) { - driveId = drives[0].id; - } - - // Create sample files - let folderId = ""; - let child1Id = ""; - let child2Id = ""; - const testFolderName = `TestFolder_${getRandomString(4)}`; - const driveItemAdd: IDriveItemAddFolder = { - name: testFolderName, - }; - const folder = await graph.users.getById(testUserName).drives.getById(driveId).root.children.addFolder(driveItemAdd); - if (folder != null) { - folderId = folder.id; - const testFileName = `TestFile_${getRandomString(4)}.json`; - const fo = JSON.parse(JSON.stringify(fileOptions)); - fo.filePathName = testFileName; - const child1 = await graph.users.getById(testUserName).drives.getById(driveId).getItemById(folderId).upload(fo); - child1Id = child1.id; - fo.filePathName = `TestFile_${getRandomString(4)}.json`; - const child2 = await graph.users.getById(testUserName).drives.getById(driveId).getItemById(folderId).upload(fo); - child2Id = child2.id; - } + const users = await graph.users(); Logger.log({ - data: folder, + data: users, level: LogLevel.Info, message: "List of Users Data", }); diff --git a/debug/launch/main.ts b/debug/launch/main.ts index 5345d2d94..230ee47d3 100644 --- a/debug/launch/main.ts +++ b/debug/launch/main.ts @@ -8,8 +8,8 @@ import { ITestingSettings } from "../../test/load-settings.js"; // add your debugging imports here and prior to submitting a PR git checkout debug/debug.ts // will allow you to keep all your debugging files locally // comment out the example -// import { Example } from "./sp.js"; -import { Example } from "./graph.js"; +import { Example } from "./sp.js"; +// import { Example } from "./graph.js"; // setup the connection to SharePoint using the settings file, you can // override any of the values as you want here, just be sure not to commit