@hello-bill/node 2.1.0-beta.2 → 2.1.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/CHANGELOG.md +14 -0
- package/dist/express/index.d.cts +1 -1
- package/dist/express/index.d.ts +1 -1
- package/dist/express/index.js +20 -1
- package/dist/express/index.js.map +1 -1
- package/dist/express/index.mjs +20 -1
- package/dist/express/index.mjs.map +1 -1
- package/dist/hono/index.d.cts +1 -1
- package/dist/hono/index.d.ts +1 -1
- package/dist/hono/index.js +20 -1
- package/dist/hono/index.js.map +1 -1
- package/dist/hono/index.mjs +20 -1
- package/dist/hono/index.mjs.map +1 -1
- package/dist/{index-lPvEf5hZ.d.cts → index-9PkSdjVq.d.cts} +6 -0
- package/dist/{index-D81ftBQo.d.ts → index-BAETgMms.d.ts} +6 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -1
- package/dist/index.mjs.map +1 -1
- package/dist/koa/index.d.cts +1 -1
- package/dist/koa/index.d.ts +1 -1
- package/dist/koa/index.js +20 -1
- package/dist/koa/index.js.map +1 -1
- package/dist/koa/index.mjs +20 -1
- package/dist/koa/index.mjs.map +1 -1
- package/dist/next/index.d.cts +1 -1
- package/dist/next/index.d.ts +1 -1
- package/dist/next/index.js +23 -1
- package/dist/next/index.js.map +1 -1
- package/dist/next/index.mjs +23 -1
- package/dist/next/index.mjs.map +1 -1
- package/dist/webhook/index.d.cts +1 -1
- package/dist/webhook/index.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.1.0
|
|
4
|
+
|
|
5
|
+
## 2.1.0-beta.3
|
|
6
|
+
|
|
7
|
+
### Patch Changes
|
|
8
|
+
|
|
9
|
+
- Fix the embed's data-route parity between the SDK and the node middleware. The
|
|
10
|
+
SDK middleware client now calls short, baseEndpoint-relative paths
|
|
11
|
+
(`/service-slots`, `/savings-summary`, `/loa-document`) consistent with the
|
|
12
|
+
other routes, and the node SDK mounts those three routes on all four framework
|
|
13
|
+
adapters (express, hono, koa, next), with a new `loaDocument` proxy handler.
|
|
14
|
+
Previously the SDK called full upstream paths the node middleware never served,
|
|
15
|
+
so service-slots, savings-summary, and loa-document bridge calls 404'd.
|
|
16
|
+
|
|
3
17
|
## 2.1.0-beta.2
|
|
4
18
|
|
|
5
19
|
## 2.1.0-beta.1
|
package/dist/express/index.d.cts
CHANGED
package/dist/express/index.d.ts
CHANGED
package/dist/express/index.js
CHANGED
|
@@ -932,6 +932,21 @@ function createHellobillHandler(opts) {
|
|
|
932
932
|
if (!result2) return;
|
|
933
933
|
passthroughUpstream(res, result2.status, result2.body, result2.requestId, result2.headers);
|
|
934
934
|
};
|
|
935
|
+
const loaDocument = async (req, res) => {
|
|
936
|
+
const rawLoa = req.query.loa_id ?? req.params?.id;
|
|
937
|
+
const loaId = Array.isArray(rawLoa) ? rawLoa[0] : rawLoa;
|
|
938
|
+
if (!loaId) {
|
|
939
|
+
sendError(res, 400, "validation.missing_required_field", "loa_id query parameter required");
|
|
940
|
+
return;
|
|
941
|
+
}
|
|
942
|
+
const result2 = await safeCallUpstream(res, {
|
|
943
|
+
method: "GET",
|
|
944
|
+
path: `/partner/loa/${encodeURIComponent(loaId)}/document`,
|
|
945
|
+
logger
|
|
946
|
+
});
|
|
947
|
+
if (!result2) return;
|
|
948
|
+
passthroughUpstream(res, result2.status, result2.body, result2.requestId, result2.headers);
|
|
949
|
+
};
|
|
935
950
|
const webhookHandler = opts.webhook ? createWebhookHandler({ ...opts.webhook, logger: opts.webhook.logger ?? opts.logger }) : void 0;
|
|
936
951
|
const result = {
|
|
937
952
|
session,
|
|
@@ -943,7 +958,8 @@ function createHellobillHandler(opts) {
|
|
|
943
958
|
property,
|
|
944
959
|
sessions: { list: sessionsList, get: sessionsGet },
|
|
945
960
|
savingsSummary,
|
|
946
|
-
serviceSlots
|
|
961
|
+
serviceSlots,
|
|
962
|
+
loaDocument
|
|
947
963
|
};
|
|
948
964
|
if (webhookHandler !== void 0) {
|
|
949
965
|
result.webhook = webhookHandler;
|
|
@@ -1032,6 +1048,9 @@ function createHellobillRouter(opts) {
|
|
|
1032
1048
|
router.get("/property", asyncWrap(handlers.property));
|
|
1033
1049
|
router.get("/sessions", asyncWrap(handlers.sessions.list));
|
|
1034
1050
|
router.get("/sessions/:id", asyncWrap(handlers.sessions.get));
|
|
1051
|
+
router.get("/service-slots", asyncWrap(handlers.serviceSlots));
|
|
1052
|
+
router.get("/savings-summary", asyncWrap(handlers.savingsSummary));
|
|
1053
|
+
router.get("/loa-document", asyncWrap(handlers.loaDocument));
|
|
1035
1054
|
router.use(
|
|
1036
1055
|
(err, _req, res, _next) => {
|
|
1037
1056
|
opts.logger?.error?.("hellobill.router_error", { message: err?.message });
|