punchout-simulator 0.1.4 → 0.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 +13 -2
- package/dist/server/cli.js +447 -242
- package/dist/server/cli.js.map +1 -1
- package/dist/web/assets/{cssMode-DLffFuN6.js → cssMode-B-got2hv.js} +1 -1
- package/dist/web/assets/{freemarker2-zfr9jUGh.js → freemarker2-RnkeBrE4.js} +1 -1
- package/dist/web/assets/{handlebars-M_QseyaG.js → handlebars-54KQc4Ip.js} +1 -1
- package/dist/web/assets/{html-BRMBHmCq.js → html-BHfOj4V7.js} +1 -1
- package/dist/web/assets/{htmlMode-CicmEJMR.js → htmlMode-Chd2dG7N.js} +1 -1
- package/dist/web/assets/{index-sxaLM6ld.css → index-9LlIENcD.css} +1 -1
- package/dist/web/assets/{index-Cm4lvUlh.js → index-CdJNNMRn.js} +206 -206
- package/dist/web/assets/{javascript-D6_vZEGx.js → javascript-DfxvokuB.js} +1 -1
- package/dist/web/assets/{jsonMode-CTxq7vAq.js → jsonMode-VBut9FUK.js} +1 -1
- package/dist/web/assets/{liquid-BUpPE-Wb.js → liquid-BnObGKeE.js} +1 -1
- package/dist/web/assets/{mdx-ymOE7fzM.js → mdx-DugOiDtO.js} +1 -1
- package/dist/web/assets/{python-Db74sog5.js → python-BctDjJVU.js} +1 -1
- package/dist/web/assets/{razor-BxQoOni_.js → razor-wtD6sxeJ.js} +1 -1
- package/dist/web/assets/{tsMode-C9sm5xMG.js → tsMode-DcIWDCPt.js} +1 -1
- package/dist/web/assets/{typescript-Ctr2X0xG.js → typescript-amfHwAlg.js} +1 -1
- package/dist/web/assets/{xml-DGpUXjuk.js → xml-CRuxB8WJ.js} +1 -1
- package/dist/web/assets/{yaml-6Dpo9WGU.js → yaml-D_zXW3Py.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -124,7 +124,7 @@ backend, so there is no CORS between them).
|
|
|
124
124
|
| XML parsing | `fast-xml-parser` |
|
|
125
125
|
| cXML building | template literals (full control over shape/ordering/`xml:lang`) |
|
|
126
126
|
| multipart/related | hand-assembled (`Buffer` + boundary) |
|
|
127
|
-
| Storage | `lowdb` (`config.json`) for connections · append-only JSONL per session for logs · separate files for attachments |
|
|
127
|
+
| Storage | `lowdb` (`config.json`) for buyers/suppliers/connections · append-only JSONL per session for logs · separate files for attachments |
|
|
128
128
|
|
|
129
129
|
```
|
|
130
130
|
src/
|
|
@@ -133,9 +133,20 @@ src/
|
|
|
133
133
|
└─ cxml/ build · parse · validate · multipart · types
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
+
### Data model
|
|
137
|
+
|
|
138
|
+
The config is normalized into three entities:
|
|
139
|
+
|
|
140
|
+
- **Buyer** — a reusable party holding its own cXML identity (the `From` credential).
|
|
141
|
+
- **Supplier** — a reusable party holding its cXML identity (`To`) plus its **endpoints** (PunchOut URL, Order URL) and an optional mock catalog. Endpoints are intrinsic to the supplier — defined once, not per relationship.
|
|
142
|
+
- **Connection** — the edge pairing one Buyer with one Supplier. It holds only what is specific to that pair: which side the tool simulates (`mode`), the `sharedSecret`, an optional per-pair Sender identity override (defaults to the buyer's identity), `authStyle`, and `deploymentMode`.
|
|
143
|
+
|
|
144
|
+
At send time: `From` = buyer identity, `To` = supplier identity, `Sender` = the connection's override (or the buyer), and the request targets the supplier's endpoints. The mock-supplier endpoints are keyed by supplier id (`/sim/<supplierId>/…`).
|
|
145
|
+
|
|
136
146
|
### Endpoints
|
|
137
147
|
|
|
138
|
-
- `*/api/
|
|
148
|
+
- `*/api/buyers`, `*/api/suppliers` — CRUD for the reusable parties
|
|
149
|
+
- `*/api/connections` — CRUD for connection edges (reference a buyer + supplier)
|
|
139
150
|
- `POST /api/connections/:id/setup` — send the SetupRequest, capture + validate the response
|
|
140
151
|
- `POST /api/connections/:id/order` — send the OrderRequest (multipart if attachments), capture + validate
|
|
141
152
|
- `POST /punchout/return` — callback receiving the punchback auto-submit
|