@lexq/cli 0.1.3 → 0.1.5

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.
package/README.md CHANGED
@@ -48,7 +48,7 @@ lexq rules create --group-id <GROUP_ID> --version-id <VERSION_ID> --json '{
48
48
  },
49
49
  "actions": [{
50
50
  "type": "DISCOUNT",
51
- "parameters": {"method":"PERCENTAGE","rate":10,"referenceFactKey":"payment_amount"}
51
+ "parameters": {"method":"PERCENTAGE","rate":10,"refVar":"payment_amount"}
52
52
  }]
53
53
  }'
54
54
 
@@ -126,7 +126,7 @@ Config is stored at `~/.lexq/config.json`:
126
126
 
127
127
  ```json
128
128
  {
129
- "apiKey": "lxk_xxxxxxxxxxxxx",
129
+ "apiKey": "sk_live_xxxxxxxxxxxxx",
130
130
  "baseUrl": "https://api.lexq.io/api/v1/partners",
131
131
  "format": "json"
132
132
  }
package/dist/index.js CHANGED
@@ -1697,9 +1697,31 @@ ${data.totalElements} total \xB7 page ${data.pageNo + 1}/${data.totalPages}`);
1697
1697
 
1698
1698
  // src/commands/logs.ts
1699
1699
  import "commander";
1700
+
1701
+ // src/types/enums.ts
1702
+ var FailureStatus = ["PENDING", "RESOLVED", "IGNORED"];
1703
+ var FailureAction = ["RETRY", "IGNORE", "RESOLVE"];
1704
+ var TaskCategory = ["INTEGRATION", "INTERNAL"];
1705
+ var TaskType = [
1706
+ // Integration
1707
+ "COUPON_ISSUE",
1708
+ "COUPON_CANCEL",
1709
+ "POINT_EARN",
1710
+ "POINT_USE",
1711
+ "POINT_REFUND",
1712
+ "NOTIFICATION_SEND",
1713
+ "CRM_SYNC_USER",
1714
+ "CRM_ADD_TAG",
1715
+ "WEBHOOK_EXECUTE",
1716
+ // Internal
1717
+ "IMAGE_PROCESSING",
1718
+ "DAILY_SETTLEMENT"
1719
+ ];
1720
+
1721
+ // src/commands/logs.ts
1700
1722
  function registerLogCommands(program) {
1701
1723
  const logs = program.command("logs").description("Failure logs");
1702
- logs.command("list").description("List failure logs").option("--category <category>", "Filter by category (INTEGRATION, INTERNAL)").option("--task-type <taskType>", "Filter by task type (COUPON_ISSUE, POINT_EARN, NOTIFICATION_SEND, WEBHOOK_EXECUTE)").option("--status <status>", "Filter by status (PENDING, RESOLVED, IGNORED)").option("--keyword <keyword>", "Search keyword").option("--start-date <date>", "Start date (yyyy-MM-dd)").option("--end-date <date>", "End date (yyyy-MM-dd)").option("--page <number>", "Page number", "0").option("--size <number>", "Page size", "20").action(async (opts) => {
1724
+ logs.command("list").description("List failure logs").option("--category <category>", "Filter by category (INTEGRATION, INTERNAL)").option("--task-type <taskType>", `Filter by task type (${TaskType.join(", ")})`).option("--status <status>", "Filter by status (PENDING, RESOLVED, IGNORED)").option("--keyword <keyword>", "Search keyword").option("--start-date <date>", "Start date (yyyy-MM-dd)").option("--end-date <date>", "End date (yyyy-MM-dd)").option("--page <number>", "Page number", "0").option("--size <number>", "Page size", "20").action(async (opts) => {
1703
1725
  try {
1704
1726
  const globalOpts = program.opts();
1705
1727
  const format = globalOpts.format ?? "json";
@@ -2697,14 +2719,9 @@ function registerLogTools(server) {
2697
2719
  inputSchema: {
2698
2720
  page: z9.number().int().min(0).default(0).describe("Page number"),
2699
2721
  size: z9.number().int().min(1).max(100).default(20).describe("Page size"),
2700
- category: z9.enum(["INTEGRATION", "INTERNAL"]).optional().describe("Task category"),
2701
- taskType: z9.enum([
2702
- "COUPON_ISSUE",
2703
- "POINT_EARN",
2704
- "NOTIFICATION_SEND",
2705
- "WEBHOOK_EXECUTE"
2706
- ]).optional().describe("Task type"),
2707
- status: z9.enum(["PENDING", "RESOLVED", "IGNORED"]).optional().describe("Log status"),
2722
+ category: z9.enum(TaskCategory).optional().describe("Task category"),
2723
+ taskType: z9.enum(TaskType).optional().describe("Task type"),
2724
+ status: z9.enum(FailureStatus).optional().describe("Log status"),
2708
2725
  keyword: z9.string().optional().describe("Search in refId, refSubId, errorMessage"),
2709
2726
  startDate: z9.string().optional().describe("Start date (yyyy-MM-dd)"),
2710
2727
  endDate: z9.string().optional().describe("End date (yyyy-MM-dd)")
@@ -2739,7 +2756,7 @@ function registerLogTools(server) {
2739
2756
  description: "Process a single failure log: RETRY, RESOLVE, or IGNORE.",
2740
2757
  inputSchema: {
2741
2758
  logId: z9.string().uuid().describe("Failure log ID"),
2742
- action: z9.enum(["RETRY", "RESOLVE", "IGNORE"]).describe("Action to take")
2759
+ action: z9.enum(FailureAction).describe("Action to take")
2743
2760
  }
2744
2761
  },
2745
2762
  async ({ logId, action }) => callApi("POST", `failure-logs/${logId}/actions`, {
@@ -2753,7 +2770,7 @@ function registerLogTools(server) {
2753
2770
  description: "Process multiple failure logs at once. Provide an array of log IDs and the action.",
2754
2771
  inputSchema: {
2755
2772
  logIds: z9.array(z9.string().uuid()).describe("Array of failure log IDs"),
2756
- action: z9.enum(["RETRY", "RESOLVE", "IGNORE"]).describe("Action to apply to all logs")
2773
+ action: z9.enum(FailureAction).describe("Action to apply to all logs")
2757
2774
  }
2758
2775
  },
2759
2776
  async ({ logIds, action }) => callApi("POST", "failure-logs/bulk-actions", {