mirror of
https://github.com/AIsouler/GKD_subscription.git
synced 2025-12-19 00:05:19 +08:00
chore: test
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* @type {import('prettier').Config}
|
* @type {import('prettier').Config}
|
||||||
*/
|
*/
|
||||||
module.exports = {
|
export default {
|
||||||
tabWidth: 2,
|
tabWidth: 2,
|
||||||
singleQuote: true,
|
singleQuote: true,
|
||||||
trailingComma: 'all',
|
trailingComma: 'all',
|
||||||
7
dist/test.json
vendored
Normal file
7
dist/test.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"name": "GKD-我测你们码",
|
||||||
|
"version": 0,
|
||||||
|
"author": "lisonge",
|
||||||
|
"supportUrl": "https://github.com/gkd-kit/subscription",
|
||||||
|
"apps": []
|
||||||
|
}
|
||||||
27
package.json
27
package.json
@@ -6,24 +6,25 @@
|
|||||||
"unpkg": "./dist/gkd.json",
|
"unpkg": "./dist/gkd.json",
|
||||||
"jsdelivr": "./dist/gkd.json",
|
"jsdelivr": "./dist/gkd.json",
|
||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"./dist"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsx ./src/main.ts"
|
"build": "tsx ./src/main.ts"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"devDependencies": {
|
||||||
"@gkd-kit/selector": "0.0.4",
|
"@gkd-kit/selector": "0.0.10",
|
||||||
"@types/lodash": "^4.14.194",
|
"@types/lodash": "^4.14.195",
|
||||||
"@types/node": "^20",
|
"@types/node": "^20.4.2",
|
||||||
"@types/prettier": "2.7.3",
|
"@types/prettier": "2.7.3",
|
||||||
"dayjs": "^1.11.7",
|
"ajv": "8.12.0",
|
||||||
"dotenv": "^16.2.0",
|
"dayjs": "^1.11.9",
|
||||||
|
"dotenv": "^16.3.1",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^3.0.1",
|
||||||
"qiniu": "^7.8.0",
|
"qiniu": "^7.9.0",
|
||||||
"tsx": "^3.12.6",
|
"tsx": "^3.12.7",
|
||||||
"typescript": "^5.0.4",
|
"typescript": "^5.1.6",
|
||||||
"undici": "^5.22.1"
|
"undici": "^5.23.0"
|
||||||
},
|
},
|
||||||
"author": "lisonge",
|
"author": "lisonge",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -36,6 +37,6 @@
|
|||||||
"url": "git+https://github.com/gkd-kit/subscription.git"
|
"url": "git+https://github.com/gkd-kit/subscription.git"
|
||||||
},
|
},
|
||||||
"volta": {
|
"volta": {
|
||||||
"node": "20.3.0"
|
"node": "20.5.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
443
pnpm-lock.yaml
generated
443
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,5 @@
|
|||||||
import SelectorKit from '@gkd-kit/selector';
|
import SelectorKit from '@gkd-kit/selector';
|
||||||
|
|
||||||
const { CommonSelector } = SelectorKit.li.songe.selector;
|
|
||||||
|
|
||||||
export const parseSelector = (source: string) => {
|
export const parseSelector = (source: string) => {
|
||||||
return CommonSelector.Companion.parse(source);
|
return SelectorKit.CommonSelector.Companion.parse(source);
|
||||||
};
|
};
|
||||||
|
|||||||
51
src/types.ts
51
src/types.ts
@@ -1,33 +1,25 @@
|
|||||||
export type IArray<T> = T | T[];
|
export type IArray<T> = T | T[];
|
||||||
|
|
||||||
export type SubscriptionConfig = {
|
type NumberFilter = {
|
||||||
name?: string;
|
minimum?: number;
|
||||||
version?: number;
|
maximum?: number;
|
||||||
author?: string;
|
enum?: number[];
|
||||||
/**
|
};
|
||||||
* https url
|
type StringFilter = {
|
||||||
* android file path
|
pattern?: string;
|
||||||
*/
|
maxLength?: number;
|
||||||
updateUrl?: string;
|
minLength?: number;
|
||||||
/**
|
enum?: string[];
|
||||||
* https url
|
|
||||||
* android schema url, qq group
|
|
||||||
*/
|
|
||||||
supportUrl?: string;
|
|
||||||
apps?: AppConfig[];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
type NumberFilter = {};
|
|
||||||
type StringFilter = {};
|
|
||||||
|
|
||||||
type CommonProps = {
|
type CommonProps = {
|
||||||
activityIds?: IArray<string>;
|
activityIds?: IArray<string>;
|
||||||
excludeActivityIds?: IArray<string>;
|
excludeActivityIds?: IArray<string>;
|
||||||
cd?: number;
|
cd?: number;
|
||||||
// https://github.com/ajv-validator/ajv
|
|
||||||
appFilter?: {
|
appFilter?: {
|
||||||
versionName: StringFilter;
|
name?: StringFilter;
|
||||||
versionCode: NumberFilter;
|
versionName?: StringFilter;
|
||||||
|
versionCode?: NumberFilter;
|
||||||
};
|
};
|
||||||
deviceFilter?: {
|
deviceFilter?: {
|
||||||
device?: StringFilter;
|
device?: StringFilter;
|
||||||
@@ -63,6 +55,23 @@ type RuleConfig = {
|
|||||||
preKeys?: IArray<number>;
|
preKeys?: IArray<number>;
|
||||||
} & CommonProps;
|
} & CommonProps;
|
||||||
|
|
||||||
|
export type SubscriptionConfig = {
|
||||||
|
name?: string;
|
||||||
|
version?: number;
|
||||||
|
author?: string;
|
||||||
|
/**
|
||||||
|
* https url
|
||||||
|
* android file path
|
||||||
|
*/
|
||||||
|
updateUrl?: string;
|
||||||
|
/**
|
||||||
|
* https url
|
||||||
|
* android schema url, qq group
|
||||||
|
*/
|
||||||
|
supportUrl?: string;
|
||||||
|
apps?: AppConfig[];
|
||||||
|
};
|
||||||
|
|
||||||
export const defineSubsConfig = (config: SubscriptionConfig) => {
|
export const defineSubsConfig = (config: SubscriptionConfig) => {
|
||||||
return JSON.stringify(config, undefined, 2);
|
return JSON.stringify(config, undefined, 2);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user