Skip to content

Commit

Permalink
feat: add plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
adolphnov committed Aug 24, 2024
1 parent f09ef75 commit 0f52b07
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/buildinfo.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/timestamp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions plugins/bin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"url": "https://lookup.binlist.net/{{DATA}}",
"method": "GET",
"response": {
"content": {
"input_type": "json",
"output_type": "markdown",
"output": "**卡BIN信息如下**\n卡品牌: {{scheme}}\n卡类型: {{type}}\n卡种类: {{brand}}\n发卡行: {{bank.name}}\n是否预付: {{#if prepaid}}是{{#else}}否{{/if}}\n发卡国家: {{country.emoji}}{{country.name}}\n币种: {{country.currency}}"
},
"error": {
"input_type": "text",
"output_type": "text",
"output": "Error: {{.}}"
}
}
}
16 changes: 16 additions & 0 deletions plugins/news60s.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"url": "https://60s.viki.moe/?v2=1",
"method": "GET",
"response": {
"content": {
"input_type": "json",
"output_type": "markdown",
"output": "**每日60s看世界**\n{{#each news in data.news}}\n- {{.}}\n{{/each}}\n> {{data.tip}}\n\n[Data Source]({{data.url}})[API Source](https://github.com/vikiboss/60s)\n[cover]({{data.cover}})\nUpdateTime: {{data.updated}}"
},
"error": {
"input_type": "json",
"output_type": "text",
"output": "Error: {{message}}"
}
}
}
1 change: 1 addition & 0 deletions src/plugins/interpolate.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable style/indent */
/* eslint-disable regexp/no-potentially-useless-backreference */
const INTERPOLATE_LOOP_REGEXP = /\{\{#each(?::(\w+))?\s+(\w+)\s+in\s+([\w.[\]]+)\}\}([\s\S]*?)\{\{\/each(?::\1)?\}\}/g;
const INTERPOLATE_CONDITION_REGEXP = /\{\{#if(?::(\w+))?\s+([\w.[\]]+)\}\}([\s\S]*?)(?:\{\{#else(?::\1)?\}\}([\s\S]*?))?\{\{\/if(?::\1)?\}\}/g;
Expand Down
1 change: 1 addition & 0 deletions src/plugins/interpolate_test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable style/indent */
import { interpolate } from './interpolate.js';

{
Expand Down
1 change: 1 addition & 0 deletions src/plugins/template.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable style/indent */
import {
TemplateBodyTypeForm,
TemplateBodyTypeJson,
Expand Down
1 change: 1 addition & 0 deletions src/plugins/template_test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable style/indent */
import fs from 'node:fs';
import { executeRequest } from './template.js';

Expand Down

0 comments on commit 0f52b07

Please sign in to comment.