@paybyrd/devagent-test-js 2.1.0-alpha.13 → 2.1.0-alpha.15
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 +5 -8
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -2
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -11,13 +11,10 @@ Used by `devagent-test-service` (Azure DevOps): `web/` (npm) and `widget/` (Yarn
|
|
|
11
11
|
|
|
12
12
|
Build and test: `npm ci && npm test`.
|
|
13
13
|
|
|
14
|
-
## Demo
|
|
14
|
+
## Demo
|
|
15
15
|
|
|
16
|
-
`demo
|
|
16
|
+
`demo/` is a static page that runs `validatePayment` from the built `dist/` (it is not published in the npm package):
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
Then open http://localhost:8000/demo/.
|
|
18
|
+
1. `npm ci && npm run build`
|
|
19
|
+
2. From the repository root: `python3 -m http.server`
|
|
20
|
+
3. Open http://localhost:8000/demo/
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -13,9 +13,8 @@ function validatePayment(request) {
|
|
|
13
13
|
else if (request.reference.length > 50) {
|
|
14
14
|
errors.push("reference must be at most 50 characters");
|
|
15
15
|
}
|
|
16
|
-
// null (JSON payloads, plain JS callers) means "no currency", like undefined
|
|
17
16
|
if (request.currency != null && !SUPPORTED_CURRENCIES.includes(request.currency)) {
|
|
18
|
-
errors.push(
|
|
17
|
+
errors.push("currency must be one of EUR, USD, GBP");
|
|
19
18
|
}
|
|
20
19
|
return { valid: errors.length === 0, errors };
|
|
21
20
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paybyrd/devagent-test-js",
|
|
3
|
-
"version": "2.1.0-alpha.
|
|
3
|
+
"version": "2.1.0-alpha.15",
|
|
4
4
|
"description": "Test package for the Paybyrd dev agent sandbox. Not for use: it has no real functionality.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"license": "UNLICENSED",
|
|
15
15
|
"devDependencies": {
|
|
16
|
+
"jsdom": "26.1.0",
|
|
16
17
|
"typescript": "5.6.3"
|
|
17
18
|
}
|
|
18
19
|
}
|