@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 +2 -2
- package/dist/index.js +28 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/lexq-recipes/SKILL.md +6 -6
- package/skills/lexq-rules/SKILL.md +4 -4
- package/skills/lexq-shared/SKILL.md +1 -1
package/package.json
CHANGED
|
@@ -36,7 +36,7 @@ lexq rules create --group-id <gid> --version-id <vid> --json '{
|
|
|
36
36
|
},
|
|
37
37
|
"actions": [{
|
|
38
38
|
"type": "DISCOUNT",
|
|
39
|
-
"parameters": { "method": "PERCENTAGE", "rate": 20, "
|
|
39
|
+
"parameters": { "method": "PERCENTAGE", "rate": 20, "refVar": "payment_amount" }
|
|
40
40
|
}]
|
|
41
41
|
}'
|
|
42
42
|
|
|
@@ -53,7 +53,7 @@ lexq rules create --group-id <gid> --version-id <vid> --json '{
|
|
|
53
53
|
},
|
|
54
54
|
"actions": [{
|
|
55
55
|
"type": "DISCOUNT",
|
|
56
|
-
"parameters": { "method": "PERCENTAGE", "rate": 10, "
|
|
56
|
+
"parameters": { "method": "PERCENTAGE", "rate": 10, "refVar": "payment_amount" }
|
|
57
57
|
}]
|
|
58
58
|
}'
|
|
59
59
|
|
|
@@ -69,7 +69,7 @@ lexq rules create --group-id <gid> --version-id <vid> --json '{
|
|
|
69
69
|
},
|
|
70
70
|
"actions": [{
|
|
71
71
|
"type": "DISCOUNT",
|
|
72
|
-
"parameters": { "method": "PERCENTAGE", "rate": 5, "
|
|
72
|
+
"parameters": { "method": "PERCENTAGE", "rate": 5, "refVar": "payment_amount" }
|
|
73
73
|
}]
|
|
74
74
|
}'
|
|
75
75
|
|
|
@@ -161,7 +161,7 @@ lexq versions clone --group-id <gid> --version-id <v1id>
|
|
|
161
161
|
lexq rules update --group-id <gid> --version-id <v2id> --id <ruleId> --json '{
|
|
162
162
|
"actions": [{
|
|
163
163
|
"type": "DISCOUNT",
|
|
164
|
-
"parameters": { "method": "PERCENTAGE", "rate": 15, "
|
|
164
|
+
"parameters": { "method": "PERCENTAGE", "rate": 15, "refVar": "payment_amount" }
|
|
165
165
|
}]
|
|
166
166
|
}'
|
|
167
167
|
|
|
@@ -289,7 +289,7 @@ lexq rules create --group-id <gid> --version-id <vid> --json '{
|
|
|
289
289
|
"condition": {
|
|
290
290
|
"type": "SINGLE", "field": "customer_tier", "operator": "EQUALS", "value": "VIP", "valueType": "STRING"
|
|
291
291
|
},
|
|
292
|
-
"actions": [{ "type": "DISCOUNT", "parameters": { "method": "PERCENTAGE", "rate": 20, "
|
|
292
|
+
"actions": [{ "type": "DISCOUNT", "parameters": { "method": "PERCENTAGE", "rate": 20, "refVar": "payment_amount" } }]
|
|
293
293
|
}'
|
|
294
294
|
|
|
295
295
|
lexq rules create --group-id <gid> --version-id <vid> --json '{
|
|
@@ -301,7 +301,7 @@ lexq rules create --group-id <gid> --version-id <vid> --json '{
|
|
|
301
301
|
"condition": {
|
|
302
302
|
"type": "SINGLE", "field": "payment_amount", "operator": "GREATER_THAN_OR_EQUAL", "value": 50000, "valueType": "NUMBER"
|
|
303
303
|
},
|
|
304
|
-
"actions": [{ "type": "DISCOUNT", "parameters": { "method": "PERCENTAGE", "rate": 15, "
|
|
304
|
+
"actions": [{ "type": "DISCOUNT", "parameters": { "method": "PERCENTAGE", "rate": 15, "refVar": "payment_amount" } }]
|
|
305
305
|
}'
|
|
306
306
|
|
|
307
307
|
# If a VIP customer pays 50000+, only the 20% VIP discount fires (priority 0 wins).
|
|
@@ -117,7 +117,7 @@ Each rule can have multiple actions. Actions fire sequentially.
|
|
|
117
117
|
|
|
118
118
|
| Type | Description | Key Parameters |
|
|
119
119
|
|---|---|---|
|
|
120
|
-
| `DISCOUNT` | Apply a discount | `method` (PERCENTAGE/FIXED), `rate`, `
|
|
120
|
+
| `DISCOUNT` | Apply a discount | `method` (PERCENTAGE/FIXED), `rate`, `refVar` |
|
|
121
121
|
| `POINT` | Award points | `amount`, `pointType` |
|
|
122
122
|
| `COUPON_ISSUE` | Issue a coupon | `couponId`, `expiryDays` |
|
|
123
123
|
| `BLOCK` | Block the transaction | `reason`, `code` |
|
|
@@ -134,7 +134,7 @@ Each rule can have multiple actions. Actions fire sequentially.
|
|
|
134
134
|
"parameters": {
|
|
135
135
|
"method": "PERCENTAGE",
|
|
136
136
|
"rate": 10,
|
|
137
|
-
"
|
|
137
|
+
"refVar": "payment_amount"
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
```
|
|
@@ -184,7 +184,7 @@ lexq rules create --group-id <gid> --version-id <vid> --json '{
|
|
|
184
184
|
"actions": [
|
|
185
185
|
{
|
|
186
186
|
"type": "DISCOUNT",
|
|
187
|
-
"parameters": { "method": "PERCENTAGE", "rate": 10, "
|
|
187
|
+
"parameters": { "method": "PERCENTAGE", "rate": 10, "refVar": "payment_amount" }
|
|
188
188
|
}
|
|
189
189
|
],
|
|
190
190
|
"isEnabled": true
|
|
@@ -199,7 +199,7 @@ lexq rules update --group-id <gid> --version-id <vid> --id <ruleId> --json '{
|
|
|
199
199
|
"actions": [
|
|
200
200
|
{
|
|
201
201
|
"type": "DISCOUNT",
|
|
202
|
-
"parameters": { "method": "PERCENTAGE", "rate": 15, "
|
|
202
|
+
"parameters": { "method": "PERCENTAGE", "rate": 15, "refVar": "payment_amount" }
|
|
203
203
|
}
|
|
204
204
|
]
|
|
205
205
|
}'
|
|
@@ -11,7 +11,7 @@ LexQ is a **policy execution engine**. Customers define business rules (conditio
|
|
|
11
11
|
```bash
|
|
12
12
|
# Store your API key (persisted at ~/.lexq/config.json)
|
|
13
13
|
lexq auth login
|
|
14
|
-
# Enter your API Key:
|
|
14
|
+
# Enter your API Key: sk_live_xxxxxxxxxxxxx
|
|
15
15
|
|
|
16
16
|
# Verify authentication
|
|
17
17
|
lexq auth whoami
|