Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,7 @@
- Significant changes in behavior + available commands
- Changes to file tree view
- Changes to credential authentication + caching
- Initial support for custom controls
- Initial support for custom controls

## [0.3.1]
- Path bug
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"url": "https://github.com/Root16/bamboo"
},
"description": "Enables users to create, update, and publish Web Resources and Custom Controls for Microsoft Power Platform — directly from VS Code.",
"version": "0.3.0",
"version": "0.3.1",
"icon": "resources/bamboo-green.png",
"engines": {
"vscode": "^1.73.0"
Expand Down
17 changes: 5 additions & 12 deletions src/classes/syncer/BambooManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
public static workspaceConfigFileName: string = 'bamboo.conf.json';
public static workspaceTokenCacheFolderName: string = '.bamboo_tokens';

private static ExceptionMessages = {

Check warning on line 12 in src/classes/syncer/BambooManager.ts

View workflow job for this annotation

GitHub Actions / test-extension-frontend

Class Property name `ExceptionMessages` must match one of the following formats: camelCase
UnableToAuthenticateToD365: "Unable to authenticate with the CRM instance. Please check your connection details.",

Check warning on line 13 in src/classes/syncer/BambooManager.ts

View workflow job for this annotation

GitHub Actions / test-extension-frontend

Object Literal Property name `UnableToAuthenticateToD365` must match one of the following formats: camelCase
CantFindBambooConfig: "Cannot find bamboo config file.",

Check warning on line 14 in src/classes/syncer/BambooManager.ts

View workflow job for this annotation

GitHub Actions / test-extension-frontend

Object Literal Property name `CantFindBambooConfig` must match one of the following formats: camelCase
UndefinedWorkspace: "Cannot activate Bamboo. Workspace is undefined.",

Check warning on line 15 in src/classes/syncer/BambooManager.ts

View workflow job for this annotation

GitHub Actions / test-extension-frontend

Object Literal Property name `UndefinedWorkspace` must match one of the following formats: camelCase
NoBambooConfig: `There is no ${BambooManager.workspaceConfigFileName} in the root of the current workspace!`,

Check warning on line 16 in src/classes/syncer/BambooManager.ts

View workflow job for this annotation

GitHub Actions / test-extension-frontend

Object Literal Property name `NoBambooConfig` must match one of the following formats: camelCase
};

private static instance: BambooManager;
Expand Down Expand Up @@ -104,8 +104,8 @@
const rawData = JSON.parse(jsonString);

const credentialTypeMap: Record<string, CredentialType> = {
ClientSecret: CredentialType.ClientSecret,

Check warning on line 107 in src/classes/syncer/BambooManager.ts

View workflow job for this annotation

GitHub Actions / test-extension-frontend

Object Literal Property name `ClientSecret` must match one of the following formats: camelCase
OAuth: CredentialType.OAuth,

Check warning on line 108 in src/classes/syncer/BambooManager.ts

View workflow job for this annotation

GitHub Actions / test-extension-frontend

Object Literal Property name `OAuth` must match one of the following formats: camelCase
};

return {
Expand Down Expand Up @@ -134,32 +134,25 @@

return tokenCacheFolder;
}

public static async getTokenCacheFilePath(): Promise<string | null> {
let currentWorkspaceFolders = vscode.workspace.workspaceFolders;
if (currentWorkspaceFolders === undefined || currentWorkspaceFolders?.length > 1) {
logErrorMessage(BambooManager.ExceptionMessages.UndefinedWorkspace, VerboseSetting.High);
return null;
}

const workspacePath = currentWorkspaceFolders![0].uri.path;

const tokenFileFolderPath = await BambooManager.getTokenCacheFolderPath()

const tokenFileFolderPath = await BambooManager.getTokenCacheFolderPath();
if (tokenFileFolderPath === null) return null;

Check warning on line 145 in src/classes/syncer/BambooManager.ts

View workflow job for this annotation

GitHub Actions / test-extension-frontend

Expected { after 'if' condition

const cacheFile = path.join(
(
tokenFileFolderPath
).path, "tokenCache.json");
const tokenFileFolderPathStr = tokenFileFolderPath instanceof vscode.Uri ? tokenFileFolderPath.fsPath : tokenFileFolderPath;

const tokenCacheFilePath = path.join(tokenFileFolderPathStr, "tokenCache.json");

//TODO
const normalizedPath = path.resolve(cacheFile).replace("\\c:", "");
const normalizedPath = path.resolve(tokenCacheFilePath);

return normalizedPath;
}


public async getToken(): Promise<string | null> {
const bambooConfig = await this.getConfig();

Expand Down
Loading