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
6 changes: 3 additions & 3 deletions src/export_command/wikimedia_function/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
await bot?.request({
'action': Action.logout,
'token': bot.editToken
});
}, { method: 'POST' });
// clear bot
bot = undefined;
vscode.window.showInformationMessage('result: Success');
Expand Down Expand Up @@ -56,7 +56,7 @@
apiUrl: config.get("transferProtocol") as string + config.get('host') + config.get("apiPath")
});
// TODO:
const response: any = await bot.login(userInfo);

Check warning on line 59 in src/export_command/wikimedia_function/bot.ts

View workflow job for this annotation

GitHub Actions / Build and Test (20)

Unexpected any. Specify a different type

Check warning on line 59 in src/export_command/wikimedia_function/bot.ts

View workflow job for this annotation

GitHub Actions / Build and Test (22)

Unexpected any. Specify a different type
if (response.result === 'Success') {
vscode.window.showInformationMessage(`User "${response.lgusername}"(UserID:"${response.lguserid}") Login Result is "${response.result}". Login Token is "${response.token}".`
);
Expand Down Expand Up @@ -99,7 +99,7 @@
case 'Always':
return await login() ? bot : undefined;
case 'Never':
vscode.window.showWarningMessage('You are not logged in. Please log in and try again.');
vscode.window.showWarningMessage('Notice: You are not logged in.');
return undefined;
case 'Ask me':
default:
Expand Down Expand Up @@ -131,8 +131,8 @@
meta: Meta.siteInfo,
};

const result: unknown = await tBot.request(args);
const result: unknown = await tBot.request(args, { method: 'GET' });
const re: any = result as any;

Check warning on line 135 in src/export_command/wikimedia_function/bot.ts

View workflow job for this annotation

GitHub Actions / Build and Test (20)

Unexpected any. Specify a different type

Check warning on line 135 in src/export_command/wikimedia_function/bot.ts

View workflow job for this annotation

GitHub Actions / Build and Test (20)

Unexpected any. Specify a different type

Check warning on line 135 in src/export_command/wikimedia_function/bot.ts

View workflow job for this annotation

GitHub Actions / Build and Test (22)

Unexpected any. Specify a different type

Check warning on line 135 in src/export_command/wikimedia_function/bot.ts

View workflow job for this annotation

GitHub Actions / Build and Test (22)

Unexpected any. Specify a different type
// TODO: cast

const generator: string = re.query.general.generator;
Expand Down
10 changes: 5 additions & 5 deletions src/export_command/wikimedia_function/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
meta: 'tokens',
type: 'csrf'
};
const result: unknown = await bot.request(args);
const result: unknown = await bot.request(args, { method: 'GET' });
const reNew: TokensResult = TokensConvert.toResult(result);
const token: string | undefined = reNew.query?.tokens?.csrftoken;
if (token) {
Expand All @@ -47,7 +47,7 @@
action: "tokens",
type: "edit"
};
const result: unknown = await bot.request(args);
const result: unknown = await bot.request(args, { method: 'GET' });
const reOld: OldTokensResult = OldTokensConvert.toResult(result);
const token: string | undefined = reOld.tokens?.edittoken;
if (token) {
Expand Down Expand Up @@ -120,7 +120,7 @@
// if (config.get("redirect")) {
// args['redirect'] = "true";
// }
const result: any = await tBot.request(args);
const result: any = await tBot.request(args, { method: 'POST' });

Check warning on line 123 in src/export_command/wikimedia_function/page.ts

View workflow job for this annotation

GitHub Actions / Build and Test (20)

Unexpected any. Specify a different type

Check warning on line 123 in src/export_command/wikimedia_function/page.ts

View workflow job for this annotation

GitHub Actions / Build and Test (22)

Unexpected any. Specify a different type
// TODO: Convert
if (result.edit.nochange !== undefined) {
vscode.window.showWarningMessage(
Expand Down Expand Up @@ -253,7 +253,7 @@
const barMessage: vscode.Disposable = vscode.window.setStatusBarMessage("Wikitext: Getting code...");
try {
// get request result
const result: unknown = await tBot.request(args);
const result: unknown = await tBot.request(args, { method: 'GET' });
// console.log(result);
// Convert result as class
const re: ReadPageResult = ReadPageConvert.toResult(result);
Expand Down Expand Up @@ -361,7 +361,7 @@

const tagList: (number | string)[] = [];
for (; ;) {
const result: unknown = await tBot.request(args);
const result: unknown = await tBot.request(args, { method: 'GET' });
const re: TagsResult = TagsConvert.toResult(result);

tagList.push(
Expand Down
2 changes: 1 addition & 1 deletion src/export_command/wikimedia_function/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export async function showViewer(currentPanel: vscode.WebviewPanel | string, vie

const barMessage: vscode.Disposable = vscode.window.setStatusBarMessage("Wikitext: Getting view...");
try {
const result: unknown = await tBot.request(args);
const result: unknown = await tBot.request(args, { method: 'GET' });
const re: GetViewResult = ViewConvert.toResult(result);
if (!re.parse) { return undefined; }

Expand Down
1 change: 1 addition & 0 deletions src/extension-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { baseUriProcess } from './export_command/uri_function/uri';
import { addWebCiteFactory } from './export_command/cite_function/web';
import { WikitextCommandRegistrar } from './export_command/commandRegistrar';
import { client, restartLspFactory } from './export_command/vscode_function/wikiparser';
import './mwbot-patch';

export async function activate(context: vscode.ExtensionContext): Promise<void> {
console.log("Wikitext Extension is active.");
Expand Down
1 change: 1 addition & 0 deletions src/extension-web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import * as vscode from 'vscode';
import { closeEditorFactory } from './export_command/wikimedia_function/page';
import { WikitextCommandRegistrar } from './export_command/commandRegistrar';
import { client, restartLspFactory } from './export_command/vscode_function/wikiparser';
import './mwbot-patch';

export async function activate(context: vscode.ExtensionContext): Promise<void> {
function showUnsupportedMessageFactory() {
Expand Down
Loading
Loading