Skip to content

Commit

Permalink
fix: npm fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
andymac4182 committed Apr 18, 2023
1 parent 47c4bf9 commit 206269c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -12,6 +12,6 @@
"packages/*"
],
"lint-staged": {
"src/**/*": "prettier --write --ignore-unknown"
"packages/**/*": "npm run fmt -ws --if-present"
}
}
17 changes: 10 additions & 7 deletions packages/lib/src/Publisher.ts
Expand Up @@ -69,14 +69,14 @@ export interface ConfluenceAdfFile {
export interface ConfluenceNode {
file: ConfluenceAdfFile;
version: number;
lastUpdatedBy: string,
lastUpdatedBy: string;
existingAdf: string;
parentPageId: string;
}
export interface ConfluenceTreeNode {
file: ConfluenceAdfFile;
version: number;
lastUpdatedBy: string,
lastUpdatedBy: string;
existingAdf: string;
children: ConfluenceTreeNode[];
}
Expand Down Expand Up @@ -109,8 +109,9 @@ export class Publisher {
}

async publish(publishFilter?: string) {
if(!this.myAccountId) {
const currentUser = await this.confluenceClient.users.getCurrentUser();
if (!this.myAccountId) {
const currentUser =
await this.confluenceClient.users.getCurrentUser();
this.myAccountId = currentUser.accountId;
}

Expand Down Expand Up @@ -186,7 +187,7 @@ export class Publisher {
node.version,
node.existingAdf,
node.file,
node.lastUpdatedBy,
node.lastUpdatedBy
);

return {
Expand All @@ -213,10 +214,12 @@ export class Publisher {
pageVersionNumber: number,
currentContents: string,
adfFile: ConfluenceAdfFile,
lastUpdatedBy: string,
lastUpdatedBy: string
): Promise<UploadAdfFileResult> {
if (lastUpdatedBy !== this.myAccountId) {
throw new Error(`Page last updated by another user. Won't publish over their changes. MyAccountId: ${this.myAccountId}, Last Updated By: ${lastUpdatedBy}`);
throw new Error(
`Page last updated by another user. Won't publish over their changes. MyAccountId: ${this.myAccountId}, Last Updated By: ${lastUpdatedBy}`
);
}

const result: UploadAdfFileResult = {
Expand Down
9 changes: 6 additions & 3 deletions packages/lib/src/TreeConfluence.ts
Expand Up @@ -145,7 +145,8 @@ async function ensurePageExists(
id: contentById.id,
title: file.pageTitle,
version: contentById?.version?.number ?? 1,
lastUpdatedBy: contentById?.version?.by?.accountId ?? "NO ACCOUNT ID",
lastUpdatedBy:
contentById?.version?.by?.accountId ?? "NO ACCOUNT ID",
existingAdf: contentById?.body?.atlas_doc_format?.value,
spaceKey: contentById.space.key,
};
Expand Down Expand Up @@ -180,7 +181,8 @@ async function ensurePageExists(
id: currentPage.id,
title: file.pageTitle,
version: currentPage?.version?.number ?? 1,
lastUpdatedBy: currentPage?.version?.by?.accountId ?? "NO ACCOUNT ID",
lastUpdatedBy:
currentPage?.version?.by?.accountId ?? "NO ACCOUNT ID",
existingAdf: currentPage?.body?.atlas_doc_format?.value,
spaceKey,
};
Expand Down Expand Up @@ -210,7 +212,8 @@ async function ensurePageExists(
id: pageDetails.id,
title: file.pageTitle,
version: pageDetails?.version?.number ?? 1,
lastUpdatedBy: pageDetails?.version?.by?.accountId ?? "NO ACCOUNT ID",
lastUpdatedBy:
pageDetails?.version?.by?.accountId ?? "NO ACCOUNT ID",
existingAdf: pageDetails?.body?.atlas_doc_format?.value,
spaceKey,
};
Expand Down
2 changes: 0 additions & 2 deletions packages/lib/src/adaptors/index.ts
Expand Up @@ -36,5 +36,3 @@ export interface CustomConfluenceClient {
contentLabels: Api.ContentLabels;
users: Api.Users;
}


3 changes: 1 addition & 2 deletions packages/obsidian/src/main.ts
Expand Up @@ -311,8 +311,7 @@ export default class ConfluencePlugin extends Plugin {
this.addSettingTab(new ConfluenceSettingTab(this.app, this));
}

async onunload() {
}
async onunload() {}

async loadSettings() {
this.settings = Object.assign(
Expand Down

0 comments on commit 206269c

Please sign in to comment.