Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: GopeedLab/gopeed-js
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.1.0
Choose a base ref
...
head repository: GopeedLab/gopeed-js
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: refs/heads/main
Choose a head ref

Commits on Oct 18, 2023

  1. Copy the full SHA
    517df4f View commit details

Commits on Oct 19, 2023

  1. feat: update types

    monkeyWie committed Oct 19, 2023
    Copy the full SHA
    d590b80 View commit details
  2. fix: template match

    monkeyWie committed Oct 19, 2023
    Copy the full SHA
    a09f752 View commit details
  3. fix: gopeed events type

    monkeyWie committed Oct 19, 2023
    Copy the full SHA
    ba95c10 View commit details

Commits on Nov 24, 2023

  1. Copy the full SHA
    6fdcc3c View commit details
  2. fix: docment site link

    monkeyWie committed Nov 24, 2023
    Copy the full SHA
    7c99677 View commit details

Commits on Dec 4, 2023

  1. feat: global declare

    monkeyWie committed Dec 4, 2023
    Copy the full SHA
    5515fb6 View commit details
  2. fix: redeclare variable

    monkeyWie committed Dec 4, 2023
    Copy the full SHA
    17a08e1 View commit details
  3. fix: gopeed types define

    monkeyWie committed Dec 4, 2023
    Copy the full SHA
    a8ed5c1 View commit details

Commits on Dec 5, 2023

  1. feat: export all types

    monkeyWie committed Dec 5, 2023
    Copy the full SHA
    94a9f75 View commit details
  2. fix: event types

    monkeyWie committed Dec 5, 2023
    Copy the full SHA
    674e952 View commit details
  3. fix: lock.yaml

    monkeyWie committed Dec 5, 2023
    Copy the full SHA
    aa8d80b View commit details
  4. Copy the full SHA
    453fe21 View commit details

Commits on Dec 12, 2023

  1. feat: update gopeed types

    monkeyWie committed Dec 12, 2023
    Copy the full SHA
    0d61cad View commit details

Commits on Jan 30, 2024

  1. feat: add delete tasks api

    monkeyWie committed Jan 30, 2024
    Copy the full SHA
    588fb40 View commit details

Commits on Mar 23, 2024

  1. Copy the full SHA
    7116d79 View commit details

Commits on Mar 24, 2024

  1. Copy the full SHA
    52d292c View commit details
  2. Copy the full SHA
    1859080 View commit details

Commits on Apr 24, 2024

  1. build: update pnpm

    monkeyWie committed Apr 24, 2024
    Copy the full SHA
    32ee871 View commit details
  2. build: fix pnpm version

    monkeyWie committed Apr 24, 2024
    Copy the full SHA
    0e93265 View commit details

Commits on May 20, 2024

  1. feat: add new api types

    monkeyWie committed May 20, 2024
    Copy the full SHA
    27f2eb4 View commit details

Commits on Jul 23, 2024

  1. Copy the full SHA
    e80bf27 View commit details

Commits on Aug 5, 2024

  1. Copy the full SHA
    5c0bffa View commit details

Commits on Aug 13, 2024

  1. Copy the full SHA
    0611008 View commit details

Commits on Aug 20, 2024

  1. feat: update models

    monkeyWie committed Aug 20, 2024
    Copy the full SHA
    bb4da4f View commit details
  2. fix: task stats api

    monkeyWie committed Aug 20, 2024
    Copy the full SHA
    873c8a7 View commit details
  3. docs: update

    monkeyWie committed Aug 20, 2024
    Copy the full SHA
    21440b6 View commit details

Commits on Sep 21, 2024

  1. feat: update batch api

    monkeyWie committed Sep 21, 2024
    Copy the full SHA
    682bac1 View commit details
  2. fix: URLSearchParams size

    monkeyWie committed Sep 21, 2024
    Copy the full SHA
    ecde405 View commit details

Commits on Dec 22, 2024

  1. Copy the full SHA
    ae61fcc View commit details
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

# Gopeed Javascript Monorepo

Gopeed development kit for javascript, please refer to [docs](https://docs.gopeed.com/dev).
Gopeed development kit for javascript, please refer to [docs](https://docs.gopeed.com/dev.html).

## Build

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"private": true,
"version": "1.1.0",
"packageManager": "pnpm@8.6.1",
"version": "1.6.1",
"type": "module",
"scripts": {
"build": "rollup -c",
2 changes: 1 addition & 1 deletion packages/create-gopeed-ext/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-gopeed-ext",
"version": "1.1.0",
"version": "1.6.1",
"keywords": [
"gopeed"
],
6 changes: 3 additions & 3 deletions packages/create-gopeed-ext/templates/pure/manifest.json
Original file line number Diff line number Diff line change
@@ -12,9 +12,9 @@
"scripts": [
{
"event": "onResolve",
"matches": [
"*://github.com/*"
],
"match": {
"urls": ["*://github.com/*"]
},
"entry": "dist/index.js"
}
],
7 changes: 6 additions & 1 deletion packages/create-gopeed-ext/templates/webpack/.eslintrc
Original file line number Diff line number Diff line change
@@ -17,6 +17,11 @@
"prettier/prettier": "error"
},
"env": {
"browser": true
"browser": true,
"node": true
},
"globals": {
"gopeed": true,
"MessageError": true
}
}
6 changes: 3 additions & 3 deletions packages/create-gopeed-ext/templates/webpack/manifest.json
Original file line number Diff line number Diff line change
@@ -12,9 +12,9 @@
"scripts": [
{
"event": "onResolve",
"matches": [
"*://github.com/*"
],
"match": {
"urls": ["*://github.com/*"]
},
"entry": "dist/index.js"
}
],
12 changes: 4 additions & 8 deletions packages/create-gopeed-ext/templates/webpack/package.json
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "webpack --mode production --watch",
"dev": "webpack --mode development --watch",
"build": "webpack --mode production"
},
"keywords": [],
@@ -20,14 +20,10 @@
"eslint": "^8.51.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"gopeed": "^1.1.0",
"@gopeed/types": "^1.1.0",
"gopeed": "^1.6.1",
"gopeed-polyfill-webpack-plugin": "^1.0.6",
"prettier": "^3.0.3",
"webpack": "^5.75.0",
"webpack-cli": "^5.0.1"
},
"dependencies": {
"crypto-browserify-pure": "^1.0.0",
"node-polyfill-webpack-plugin": "^2.0.1"
}
}
}
2 changes: 0 additions & 2 deletions packages/create-gopeed-ext/templates/webpack/src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import gopeed from 'gopeed';

gopeed.events.onResolve((ctx) => {
ctx.res = {
name: 'example',
14 changes: 5 additions & 9 deletions packages/create-gopeed-ext/templates/webpack/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
import path from 'path';
import { fileURLToPath } from 'url';
import NodePolyfillPlugin from 'node-polyfill-webpack-plugin';
import GopeedPolyfillPlugin from 'gopeed-polyfill-webpack-plugin';

const __dirname = fileURLToPath(import.meta.url);

export default {
export default (_, argv) => ({
entry: './src/index.js',
output: {
filename: 'index.js',
path: path.resolve(__dirname, '../dist'),
},
resolve: {
fallback: {
crypto: 'crypto-browserify-pure',
},
},
plugins: [new NodePolyfillPlugin()],
devtool: argv.mode === 'production' ? undefined : false,
plugins: [new GopeedPolyfillPlugin()],
module: {
rules: [
{
@@ -26,4 +22,4 @@ export default {
},
],
},
};
});
17 changes: 17 additions & 0 deletions packages/gopeed-openapi/src/v1/IndexController.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable no-unused-vars */
import { Result, ServerInfo } from '@gopeed/types';
import { Controller, Get, Route, Security } from 'tsoa';

@Route('/api/v1')
export class UsersController extends Controller {
/**
* Get server info
* @summary Get server info
*/
@Security('X-Api-Token')
@Get('/info')
public async info(): Promise<Result<ServerInfo>> {
return null as unknown as Result<ServerInfo>;
}
}
6 changes: 3 additions & 3 deletions packages/gopeed-openapi/src/v1/ResolveController.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable no-unused-vars */
import { Request, ResolveResult } from '@gopeed/types';
import { Request, ResolveResult, Result } from '@gopeed/types';
import { Body, Controller, Post, Route, Security } from 'tsoa';

@Route('/api/v1/resolve')
@@ -11,7 +11,7 @@ export class UsersController extends Controller {
*/
@Security('X-Api-Token')
@Post()
public async resolve(@Body() req: Request): Promise<ResolveResult> {
return null as unknown as ResolveResult;
public async resolve(@Body() req: Request): Promise<Result<ResolveResult>> {
return null as unknown as Result<ResolveResult>;
}
}
128 changes: 104 additions & 24 deletions packages/gopeed-openapi/src/v1/TaskController.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable no-unused-vars */
import { CreateTaskWithRequest, CreateTaskWithResolveResult, Task, TaskStatus } from '@gopeed/types';
import {
CreateTaskWithRequest,
CreateTaskWithResolveResult,
Task,
TaskStatus,
CreateTaskBatch,
Result,
TaskStats,
} from '@gopeed/types';
import { Body, Controller, Delete, Get, Path, Post, Put, Query, Route, Security, SuccessResponse } from 'tsoa';

@Route('/api/v1/tasks')
@@ -13,19 +21,57 @@ export class UsersController extends Controller {
*/
@Security('X-Api-Token')
@Post()
public async createTask(@Body() req: CreateTaskWithResolveResult | CreateTaskWithRequest): Promise<string> {
return null as unknown as string;
public async createTask(@Body() req: CreateTaskWithResolveResult | CreateTaskWithRequest): Promise<Result<string>> {
return null as unknown as Result<string>;
}

/**
* Create a batch of download tasks
* @summary Create a batch of tasks
*/
@Security('X-Api-Token')
@Post('/batch')
public async createTaskBatch(@Body() req: CreateTaskBatch): Promise<Result<string[]>> {
return null as unknown as Result<string[]>;
}

/**
* Get task info
* @param id - Task id
* @returns
*/
@Security('X-Api-Token')
@Get('{id}')
public async getTask(@Path() id: string): Promise<Result<Task>> {
return null as unknown as Result<Task>;
}

/**
* Get task list
* @summary Get task list
* @param id - Task id, can be multiple
* @param status - Filter by task status, can be multiple
* @param notStatus - Filter by excluding task status, can be multiple
*/
@Security('X-Api-Token')
@Get()
public async getTasks(@Query() status: TaskStatus[] = []): Promise<Task[]> {
return null as unknown as Task[];
public async getTasks(
@Query() id: string[] = [],
@Query() status: TaskStatus[] = [],
@Query() notStatus: TaskStatus[] = []
): Promise<Result<Task[]>> {
return null as unknown as Result<Task[]>;
}

/**
* Get task stats
* @param id - Task id
* @returns
*/
@Security('X-Api-Token')
@Get('{id}/stats')
public async stats(@Path() id: string): Promise<Result<TaskStats>> {
return null as unknown as Result<TaskStats>;
}

/**
@@ -36,42 +82,56 @@ export class UsersController extends Controller {
@Security('X-Api-Token')
@Put('{id}/pause')
@SuccessResponse(200)
public async pauseTask(@Path() id: string): Promise<void> {
return null as unknown as void;
public async pauseTask(@Path() id: string): Promise<Result<void>> {
return null as unknown as Result<void>;
}

/**
* Continue a task
* @summary Continue a task
* @param id - Task id
* Pause a batch of tasks
* @summary Pause a batch of tasks
* @param id - Task id, can be multiple
* @param status - Filter by task status, can be multiple
* @param notStatus - Filter by excluding task status, can be multiple
*/
@Security('X-Api-Token')
@Put('{id}/continue')
@Put('pause')
@SuccessResponse(200)
public async continueTask(@Path() id: string): Promise<void> {
return null as unknown as void;
public async pauseTasks(
@Query() id: string[] = [],
@Query() status: TaskStatus[] = [],
@Query() notStatus: TaskStatus[] = []
): Promise<Result<void>> {
return null as unknown as Result<void>;
}

/**
* Pause all tasks
* @summary Pause all tasks
* Continue a task
* @summary Continue a task
* @param id - Task id
*/
@Security('X-Api-Token')
@Put('pause')
@Put('{id}/continue')
@SuccessResponse(200)
public async pauseAllTasks(): Promise<void> {
return;
public async continueTask(@Path() id: string): Promise<Result<void>> {
return null as unknown as Result<void>;
}

/**
* Continue all tasks
* @summary Continue all tasks
* Continue a batch of tasks
* @summary Continue a batch of tasks
* @param id - Task id, can be multiple
* @param status - Filter by task status, can be multiple
* @param notStatus - Filter by excluding task status, can be multiple
*/
@Security('X-Api-Token')
@Put('continue')
@SuccessResponse(200)
public async continueAllTasks(): Promise<void> {
return;
public async continueTasks(
@Query() id: string[] = [],
@Query() status: TaskStatus[] = [],
@Query() notStatus: TaskStatus[] = []
): Promise<Result<void>> {
return null as unknown as Result<void>;
}

/**
@@ -83,7 +143,27 @@ export class UsersController extends Controller {
@Security('X-Api-Token')
@Delete('{id}')
@SuccessResponse(200)
public async deleteTask(@Path() id: string, @Query() force = false): Promise<void> {
return;
public async deleteTask(@Path() id: string, @Query() force = false): Promise<Result<void>> {
return null as unknown as Result<void>;
}

/**
* Delete tasks
* @summary Delete tasks
* @param id - Task id, can be multiple
* @param status - Filter by task status, can be multiple
* @param notStatus - Filter by excluding task status, can be multiple
* @param force - Also delete files
*/
@Security('X-Api-Token')
@Delete()
@SuccessResponse(200)
public async deleteTasks(
@Query() id: string[] = [],
@Query() status: TaskStatus[] = [],
@Query() notStatus: TaskStatus[] = [],
@Query() force = false
): Promise<Result<void>> {
return null as unknown as Result<void>;
}
}
4 changes: 2 additions & 2 deletions packages/gopeed-rest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gopeed/rest",
"version": "1.1.0",
"version": "1.6.1",
"description": "",
"main": "dist/index.js",
"exports": {
@@ -27,7 +27,7 @@
],
"author": "",
"license": "ISC",
"devDependencies": {
"dependencies": {
"@gopeed/types": "workspace:*"
}
}
Loading