hookwright 1.1.0 → 1.2.0
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 +16 -1
- package/dist/cli.js +566 -303
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -53,6 +53,10 @@ Then **Integrations → Cashfree One Click Checkout** builds the payload:
|
|
|
53
53
|
5. Pre-flight report — every check, the full field coverage table, the signed request and the complete payload
|
|
54
54
|
6. A **ready-to-paste `curl` is copied to your clipboard** automatically, then send
|
|
55
55
|
|
|
56
|
+
The report page is a compact status board with a command bar — `s` send · `c` copy curl · `j` copy json · `u` curl · `p` payload · `f` fields · `v` checks · `r` request. Panels are collapsed by default, so you see the verdict first and the detail only when you ask for it.
|
|
57
|
+
|
|
58
|
+
`esc` walks back one step at a time through the whole flow (report → mode → discount → quantity → variant → products → event), and only leaves the integration from the first step.
|
|
59
|
+
|
|
56
60
|
### The curl is built for pasting
|
|
57
61
|
|
|
58
62
|
The command is emitted in the exact shape Postman itself exports — `curl --location --request POST` with unindented `--header` / `--data` lines — and the body is inlined, never `@file`. Drop it straight into **Postman → Import → Raw text**, a colleague's terminal, or a bug report.
|
|
@@ -120,6 +124,17 @@ Each provider owns its gate, signature scheme, field map, payload shape and summ
|
|
|
120
124
|
- **Razorpay Magic** is root-level, uses capitalised shipping keys (`Shipping_address.Address1`) and sends `line_items_total` as a **string in paise** — matching [Razorpay's abandoned cart webhook docs](https://razorpay.com/docs/payments/magic-checkout/abandoned-cart/). Its gate is "non-empty `abandoned_checkout_url`" rather than an exact value.
|
|
121
125
|
- **Nitro** keys off `eventName` and requires `eventVal.customer.phone` on *every* event, parsed against root `country`. Choose the event with `--event`, or from the menu in the UI.
|
|
122
126
|
|
|
127
|
+
Nitro's eight events are about different things, so each asks for a different subject:
|
|
128
|
+
|
|
129
|
+
| event | you pick | cart |
|
|
130
|
+
|---|---|---|
|
|
131
|
+
| `view` | nothing | — |
|
|
132
|
+
| `category_view` | one collection (fetched from Shopify, custom **and** smart) | — |
|
|
133
|
+
| `product_view` | one product | — |
|
|
134
|
+
| `addtocart` · `removefromcart` · `checkout` · `orders/create` · `orders/updated` | products and quantities | ✅ |
|
|
135
|
+
|
|
136
|
+
A page view has no cart, so it is never asked for a discount; a category view emits the collection's real id, title and URL and carries no line items.
|
|
137
|
+
|
|
123
138
|
Adding one is a single file in `src/providers/` exporting `buildPayload`, `sign`, `webhookUrl`, `summarize`, a `gate` and a `fieldMap` — see [docs/cashfree-occ.md](docs/cashfree-occ.md).
|
|
124
139
|
|
|
125
140
|
## Development
|
|
@@ -127,7 +142,7 @@ Adding one is a single file in `src/providers/` exporting `buildPayload`, `sign`
|
|
|
127
142
|
```bash
|
|
128
143
|
npm install
|
|
129
144
|
npm run dev # esbuild watch
|
|
130
|
-
npm test #
|
|
145
|
+
npm test # 185 tests, no network required
|
|
131
146
|
npm start # build + run
|
|
132
147
|
```
|
|
133
148
|
|