taiwan-payment-skill 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,25 +1,25 @@
1
- {
2
- "platform": "trae",
3
- "displayName": "Trae",
4
- "installType": "full",
5
- "folderStructure": {
6
- "root": ".trae",
7
- "skillPath": "skills/taiwan-payment",
8
- "filename": "SKILL.md",
9
- "globalRoot": "~/.trae"
10
- },
11
- "frontmatter": {
12
- "name": "taiwan-payment",
13
- "description": "Taiwan Payment API integration specialist for ECPay, NewebPay, and PAYUNi payment gateways. Use when developing payment systems, implementing credit card, ATM, CVS, or e-wallet payments, or working with Taiwan payment gateway APIs. Handles encryption (SHA256, AES-256-CBC, AES-256-GCM), API requests, and service provider differences.",
14
- "user-invocable": "true"
15
- },
16
- "sections": {
17
- "examples": true,
18
- "references": true,
19
- "scripts": true,
20
- "quickReference": false
21
- },
22
- "title": "Taiwan Payment Development Skill",
23
- "description": "Comprehensive guide for Taiwan Payment Gateway integration (ECPay, NewebPay, PAYUNi)",
24
- "skillOrWorkflow": "Skill"
25
- }
1
+ {
2
+ "platform": "trae",
3
+ "displayName": "Trae",
4
+ "installType": "full",
5
+ "folderStructure": {
6
+ "root": ".trae",
7
+ "skillPath": "skills/taiwan-invoice",
8
+ "filename": "SKILL.md"
9
+ },
10
+ "scriptPath": "skills/taiwan-invoice/scripts",
11
+ "frontmatter": {
12
+ "name": "taiwan-invoice",
13
+ "description": "Taiwan E-Invoice API integration for ECPay, SmilePay, and Amego.",
14
+ "user-invocable": "true"
15
+ },
16
+ "sections": {
17
+ "examples": true,
18
+ "references": true,
19
+ "scripts": true,
20
+ "quickReference": false
21
+ },
22
+ "title": "Taiwan E-Invoice Skill",
23
+ "description": "Comprehensive guide for Taiwan E-Invoice API integration. Supports ECPay, SmilePay, and Amego providers with B2C/B2B invoice operations.",
24
+ "skillOrWorkflow": "Skill"
25
+ }
@@ -1,25 +1,25 @@
1
- {
2
- "platform": "windsurf",
3
- "displayName": "Windsurf",
4
- "installType": "full",
5
- "folderStructure": {
6
- "root": ".windsurf",
7
- "skillPath": "skills/taiwan-payment",
8
- "filename": "SKILL.md",
9
- "globalRoot": "~/.windsurf"
10
- },
11
- "frontmatter": {
12
- "name": "taiwan-payment",
13
- "description": "Taiwan Payment API integration specialist for ECPay, NewebPay, and PAYUNi payment gateways. Use when developing payment systems, implementing credit card, ATM, CVS, or e-wallet payments, or working with Taiwan payment gateway APIs. Handles encryption (SHA256, AES-256-CBC, AES-256-GCM), API requests, and service provider differences.",
14
- "user-invocable": "true"
15
- },
16
- "sections": {
17
- "examples": true,
18
- "references": true,
19
- "scripts": true,
20
- "quickReference": false
21
- },
22
- "title": "Taiwan Payment Development Skill",
23
- "description": "Comprehensive guide for Taiwan Payment Gateway integration (ECPay, NewebPay, PAYUNi)",
24
- "skillOrWorkflow": "Skill"
25
- }
1
+ {
2
+ "platform": "windsurf",
3
+ "displayName": "Windsurf",
4
+ "installType": "full",
5
+ "folderStructure": {
6
+ "root": ".windsurf",
7
+ "skillPath": "skills/taiwan-invoice",
8
+ "filename": "SKILL.md"
9
+ },
10
+ "scriptPath": "skills/taiwan-invoice/scripts",
11
+ "frontmatter": {
12
+ "name": "taiwan-invoice",
13
+ "description": "Taiwan E-Invoice API integration specialist for ECPay, SmilePay, and Amego. Provides B2C/B2B invoice issuance, void, allowance, query, and print functionality.",
14
+ "user-invocable": "true"
15
+ },
16
+ "sections": {
17
+ "examples": true,
18
+ "references": true,
19
+ "scripts": true,
20
+ "quickReference": false
21
+ },
22
+ "title": "Taiwan E-Invoice Skill",
23
+ "description": "Comprehensive guide for Taiwan E-Invoice API integration. Supports ECPay, SmilePay, and Amego providers with B2C/B2B invoice operations.",
24
+ "skillOrWorkflow": "Skill"
25
+ }
package/dist/index.js CHANGED
@@ -16760,23 +16760,62 @@ function getAITypeDescription(aiType) {
16760
16760
  // src/utils/logger.ts
16761
16761
  var import_chalk = __toESM(require_source());
16762
16762
  var logger = {
16763
- title(text) {
16763
+ info: (msg) => console.log(import_chalk.default.blue("info"), msg),
16764
+ success: (msg) => console.log(import_chalk.default.green("success"), msg),
16765
+ warn: (msg) => console.log(import_chalk.default.yellow("warn"), msg),
16766
+ error: (msg) => console.log(import_chalk.default.red("error"), msg),
16767
+ title: (msg) => {
16764
16768
  console.log();
16765
- console.log(import_chalk.default.bold.cyan(` ${text}`));
16769
+ console.log(import_chalk.default.bold.red(" \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557") + import_chalk.default.bold.yellow(" \u2588\u2588\u2588\u2588\u2588\u2557 ") + import_chalk.default.bold.green(" \u2588\u2588\u2557") + import_chalk.default.bold.cyan(" \u2588\u2588\u2557 \u2588\u2588\u2557") + import_chalk.default.bold.blue(" \u2588\u2588\u2588\u2588\u2588\u2557 ") + import_chalk.default.bold.magenta(" \u2588\u2588\u2588\u2557 \u2588\u2588\u2557"));
16770
+ console.log(import_chalk.default.bold.red(" \u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D") + import_chalk.default.bold.yellow(" \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557") + import_chalk.default.bold.green(" \u2588\u2588\u2551") + import_chalk.default.bold.cyan(" \u2588\u2588\u2551 \u2588\u2588\u2551") + import_chalk.default.bold.blue(" \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557") + import_chalk.default.bold.magenta(" \u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551"));
16771
+ console.log(import_chalk.default.bold.red(" \u2588\u2588\u2551 ") + import_chalk.default.bold.yellow(" \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551") + import_chalk.default.bold.green(" \u2588\u2588\u2551") + import_chalk.default.bold.cyan(" \u2588\u2588\u2551 \u2588\u2557 \u2588\u2588\u2551") + import_chalk.default.bold.blue(" \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551") + import_chalk.default.bold.magenta(" \u2588\u2588\u2554\u2588\u2588\u2557 \u2588\u2588\u2551"));
16772
+ console.log(import_chalk.default.bold.red(" \u2588\u2588\u2551 ") + import_chalk.default.bold.yellow(" \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551") + import_chalk.default.bold.green(" \u2588\u2588\u2551") + import_chalk.default.bold.cyan(" \u2588\u2588\u2551\u2588\u2588\u2588\u2557\u2588\u2588\u2551") + import_chalk.default.bold.blue(" \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551") + import_chalk.default.bold.magenta(" \u2588\u2588\u2551\u255A\u2588\u2588\u2557\u2588\u2588\u2551"));
16773
+ console.log(import_chalk.default.bold.red(" \u2588\u2588\u2551 ") + import_chalk.default.bold.yellow(" \u2588\u2588\u2551 \u2588\u2588\u2551") + import_chalk.default.bold.green(" \u2588\u2588\u2551") + import_chalk.default.bold.cyan(" \u255A\u2588\u2588\u2588\u2554\u2588\u2588\u2588\u2554\u255D") + import_chalk.default.bold.blue(" \u2588\u2588\u2551 \u2588\u2588\u2551") + import_chalk.default.bold.magenta(" \u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2551"));
16774
+ console.log(import_chalk.default.bold.red(" \u255A\u2550\u255D ") + import_chalk.default.bold.yellow(" \u255A\u2550\u255D \u255A\u2550\u255D") + import_chalk.default.bold.green(" \u255A\u2550\u255D") + import_chalk.default.bold.cyan(" \u255A\u2550\u2550\u255D\u255A\u2550\u2550\u255D ") + import_chalk.default.bold.blue(" \u255A\u2550\u255D \u255A\u2550\u255D") + import_chalk.default.bold.magenta(" \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D"));
16775
+ console.log();
16776
+ console.log(import_chalk.default.bold.cyan(" \u91D1\u6D41\u6574\u5408\u6280\u80FD\u5305"));
16777
+ console.log(import_chalk.default.bold.yellow(` ${msg}`));
16766
16778
  console.log();
16767
16779
  },
16768
- info(text) {
16769
- console.log(import_chalk.default.blue(" \u2139"), text);
16770
- },
16771
- success(text) {
16772
- console.log(import_chalk.default.green(" \u2713"), text);
16773
- },
16774
- warn(text) {
16775
- console.log(import_chalk.default.yellow(" \u26A0"), text);
16780
+ box: (msg) => {
16781
+ const getVisualWidth = (str) => {
16782
+ let width = 0;
16783
+ for (const char of str) {
16784
+ const code = char.charCodeAt(0);
16785
+ if (code >= 19968 && code <= 40959 || // CJK Ideographs
16786
+ code >= 12288 && code <= 12351 || // CJK Symbols and Punctuation
16787
+ code >= 12352 && code <= 12447 || // Hiragana
16788
+ code >= 12448 && code <= 12543 || // Katakana
16789
+ code >= 44032 && code <= 55215 || // Hangul
16790
+ code >= 65280 && code <= 65519) {
16791
+ width += 2;
16792
+ } else {
16793
+ width += 1;
16794
+ }
16795
+ }
16796
+ return width;
16797
+ };
16798
+ const lines = msg.split("\n");
16799
+ const stripAnsi = (str) => str.replace(/\x1b\[[0-9;]*[a-zA-Z]/g, "");
16800
+ const maxWidth = Math.max(...lines.map((l) => getVisualWidth(stripAnsi(l))));
16801
+ const boxWidth = maxWidth + 2;
16802
+ console.log();
16803
+ console.log(import_chalk.default.green("\u256D" + "\u2500".repeat(boxWidth) + "\u256E"));
16804
+ const headerText = " \u5B8C\u6210 ";
16805
+ const headerWidth = getVisualWidth(headerText);
16806
+ const headerPadding = boxWidth - headerWidth;
16807
+ console.log(import_chalk.default.green("\u2502") + import_chalk.default.bold.green(headerText) + " ".repeat(headerPadding) + import_chalk.default.green("\u2502"));
16808
+ console.log(import_chalk.default.green("\u251C" + "\u2500".repeat(boxWidth) + "\u2524"));
16809
+ lines.forEach((line) => {
16810
+ const cleanLine = stripAnsi(line);
16811
+ const visualWidth = getVisualWidth(cleanLine);
16812
+ const padding = boxWidth - visualWidth - 2;
16813
+ console.log(import_chalk.default.green("\u2502 ") + line + " ".repeat(Math.max(0, padding)) + import_chalk.default.green(" \u2502"));
16814
+ });
16815
+ console.log(import_chalk.default.green("\u2570" + "\u2500".repeat(boxWidth) + "\u256F"));
16816
+ console.log();
16776
16817
  },
16777
- error(text) {
16778
- console.log(import_chalk.default.red(" \u2716"), text);
16779
- }
16818
+ dim: (msg) => console.log(import_chalk.default.dim(msg))
16780
16819
  };
16781
16820
 
16782
16821
  // src/utils/progress.ts
@@ -16847,21 +16886,45 @@ async function initCommand(options) {
16847
16886
  if (detected.length > 0) {
16848
16887
  logger.info(`Detected: ${detected.map((t) => import_chalk3.default.cyan(t)).join(", ")}`);
16849
16888
  }
16850
- const response = await (0, import_prompts.default)({
16851
- type: "select",
16852
- name: "aiType",
16853
- message: "Select AI assistant to install for:",
16854
- choices: AI_TYPES.map((type) => ({
16855
- title: getAITypeDescription(type),
16856
- value: type
16857
- })),
16858
- initial: suggested ? AI_TYPES.indexOf(suggested) : 0
16859
- });
16889
+ const response = await (0, import_prompts.default)([
16890
+ {
16891
+ type: "select",
16892
+ name: "aiType",
16893
+ message: "\u4F60\u60F3\u88DD\u5728\u54EA\u500B AI \u52A9\u624B\uFF1F",
16894
+ choices: AI_TYPES.map((type) => ({
16895
+ title: getAITypeDescription(type),
16896
+ value: type
16897
+ })),
16898
+ initial: suggested ? AI_TYPES.indexOf(suggested) : 0
16899
+ },
16900
+ {
16901
+ type: (prev) => prev !== "all" && prev !== "windsurf" ? "toggle" : null,
16902
+ name: "global",
16903
+ message: "\u8981\u5168\u57DF\u5B89\u88DD\u55CE\uFF1F\uFF08\u6240\u6709\u5C08\u6848\u90FD\u80FD\u7528\uFF09",
16904
+ initial: false,
16905
+ active: "\u8981",
16906
+ inactive: "\u4E0D\u8981"
16907
+ },
16908
+ {
16909
+ type: "toggle",
16910
+ name: "force",
16911
+ message: "\u6A94\u6848\u5982\u679C\u5DF2\u7D93\u5B58\u5728\u8981\u8986\u84CB\u55CE\uFF1F",
16912
+ initial: false,
16913
+ active: "\u8981",
16914
+ inactive: "\u4E0D\u8981"
16915
+ }
16916
+ ]);
16860
16917
  if (!response.aiType) {
16861
16918
  logger.warn("Installation cancelled");
16862
16919
  return;
16863
16920
  }
16864
16921
  aiType = response.aiType;
16922
+ if (options.global === void 0 && response.global !== void 0) {
16923
+ options.global = response.global;
16924
+ }
16925
+ if (options.force === void 0 && response.force !== void 0) {
16926
+ options.force = response.force;
16927
+ }
16865
16928
  }
16866
16929
  let targetDir = process.cwd();
16867
16930
  if (options.global && aiType !== "all") {
@@ -16902,14 +16965,49 @@ async function initCommand(options) {
16902
16965
  console.log();
16903
16966
  logger.info("Installed folders:");
16904
16967
  copiedFolders.forEach((folder) => {
16905
- console.log(` ${import_chalk3.default.green("\u2713")} ${folder}`);
16968
+ console.log(` ${import_chalk3.default.green("\u25CF")} ${folder}`);
16906
16969
  });
16907
16970
  console.log();
16908
- logger.success("Taiwan Payment Skill installed successfully!");
16971
+ logger.box(
16972
+ `\u53F0\u7063\u91D1\u6D41\u6280\u80FD\u5305\u5B89\u88DD\u6210\u529F\uFF01
16973
+
16974
+ \u5DF2\u5B89\u88DD\u5230: ${import_chalk3.default.cyan(copiedFolders[0])}
16975
+
16976
+ \u4E0B\u4E00\u6B65\uFF1A
16977
+ 1. \u91CD\u65B0\u555F\u52D5\u4F60\u7684 AI \u52A9\u624B
16978
+ 2. \u8A66\u8A66\u770B\uFF1A\u300C\u5E6B\u6211\u6574\u5408\u7DA0\u754C\u91D1\u6D41 API\u300D`
16979
+ );
16909
16980
  console.log();
16910
- console.log(import_chalk3.default.bold("Next steps:"));
16911
- console.log(import_chalk3.default.dim(" 1. Restart your AI coding assistant"));
16912
- console.log(import_chalk3.default.dim(' 2. Try: "Help me integrate ECPay payment API"'));
16981
+ const tutorialResponse = await (0, import_prompts.default)({
16982
+ type: "toggle",
16983
+ name: "showTutorial",
16984
+ message: "\u8981\u770B\u5FEB\u901F\u4E0A\u624B\u6307\u5357\u55CE\uFF1F",
16985
+ initial: true,
16986
+ active: "\u8981",
16987
+ inactive: "\u4E0D\u7528"
16988
+ });
16989
+ if (tutorialResponse.showTutorial) {
16990
+ console.log();
16991
+ console.log(import_chalk3.default.bold.cyan("\u5FEB\u901F\u4E0A\u624B\u6307\u5357"));
16992
+ console.log();
16993
+ console.log(import_chalk3.default.yellow("\u652F\u63F4\u7684\u91D1\u6D41\u5E73\u53F0\uFF1A"));
16994
+ console.log(import_chalk3.default.dim(" \u2022 \u7DA0\u754C\u91D1\u6D41 (ECPay)"));
16995
+ console.log(import_chalk3.default.dim(" \u2022 \u85CD\u65B0\u91D1\u6D41 (NewebPay)"));
16996
+ console.log(import_chalk3.default.dim(" \u2022 \u7D71\u4E00\u91D1\u6D41 (PayUni)"));
16997
+ console.log();
16998
+ console.log(import_chalk3.default.yellow("\u5E38\u898B\u4F7F\u7528\u7BC4\u4F8B\uFF1A"));
16999
+ console.log(import_chalk3.default.dim(" 1. \u300C\u5E6B\u6211\u6574\u5408\u7DA0\u754C\u4FE1\u7528\u5361\u652F\u4ED8\u300D"));
17000
+ console.log(import_chalk3.default.dim(" 2. \u300C\u6211\u8981\u5BE6\u4F5C ATM \u865B\u64EC\u5E33\u865F\u4ED8\u6B3E\u300D"));
17001
+ console.log(import_chalk3.default.dim(" 3. \u300C\u8655\u7406\u91D1\u6D41\u56DE\u8ABF\u901A\u77E5\u300D"));
17002
+ console.log();
17003
+ console.log(import_chalk3.default.yellow("\u6280\u80FD\u5305\u5167\u5BB9\uFF1A"));
17004
+ console.log(import_chalk3.default.dim(" \u2022 API \u6587\u4EF6\u53C3\u8003 (references/)"));
17005
+ console.log(import_chalk3.default.dim(" \u2022 \u7A0B\u5F0F\u78BC\u7BC4\u4F8B (EXAMPLES.md)"));
17006
+ console.log(import_chalk3.default.dim(" \u2022 \u6E2C\u8A66\u5DE5\u5177 (scripts/)"));
17007
+ console.log();
17008
+ console.log(import_chalk3.default.green("\u63D0\u793A\uFF1A\u91CD\u555F AI \u52A9\u624B\u5F8C\uFF0C\u76F4\u63A5\u7528\u4E2D\u6587\u63CF\u8FF0\u4F60\u8981\u505A\u4EC0\u9EBC\u5C31\u53EF\u4EE5\u4E86\uFF01"));
17009
+ console.log();
17010
+ }
16913
17011
  console.log();
16914
17012
  } catch (error) {
16915
17013
  logger.error("Installation failed");
@@ -16946,7 +17044,7 @@ function listCommand() {
16946
17044
  console.log(` ${import_chalk4.default.dim("\u2500".repeat(45))}`);
16947
17045
  for (const platform of PLATFORMS) {
16948
17046
  const isDetected = detected.includes(platform.name);
16949
- const status = isDetected ? import_chalk4.default.green("\u2713 Detected") : import_chalk4.default.dim("Available");
17047
+ const status = isDetected ? import_chalk4.default.green("\u25CF Detected") : import_chalk4.default.dim("Available");
16950
17048
  const name = isDetected ? import_chalk4.default.cyan(platform.name.padEnd(15)) : platform.name.padEnd(15);
16951
17049
  console.log(` ${name} ${import_chalk4.default.dim(platform.folder.padEnd(12))} ${status}`);
16952
17050
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taiwan-payment-skill",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "AI-powered Taiwan Payment Gateway integration toolkit for Claude Code and other AI coding assistants",
5
5
  "keywords": [
6
6
  "taiwan",