@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/dist/next/index.d.ts
CHANGED
package/dist/next/index.js
CHANGED
|
@@ -930,6 +930,21 @@ function createHellobillHandler(opts) {
|
|
|
930
930
|
if (!result2) return;
|
|
931
931
|
passthroughUpstream(res, result2.status, result2.body, result2.requestId, result2.headers);
|
|
932
932
|
};
|
|
933
|
+
const loaDocument = async (req, res) => {
|
|
934
|
+
const rawLoa = req.query.loa_id ?? req.params?.id;
|
|
935
|
+
const loaId = Array.isArray(rawLoa) ? rawLoa[0] : rawLoa;
|
|
936
|
+
if (!loaId) {
|
|
937
|
+
sendError(res, 400, "validation.missing_required_field", "loa_id query parameter required");
|
|
938
|
+
return;
|
|
939
|
+
}
|
|
940
|
+
const result2 = await safeCallUpstream(res, {
|
|
941
|
+
method: "GET",
|
|
942
|
+
path: `/partner/loa/${encodeURIComponent(loaId)}/document`,
|
|
943
|
+
logger
|
|
944
|
+
});
|
|
945
|
+
if (!result2) return;
|
|
946
|
+
passthroughUpstream(res, result2.status, result2.body, result2.requestId, result2.headers);
|
|
947
|
+
};
|
|
933
948
|
const webhookHandler = opts.webhook ? createWebhookHandler({ ...opts.webhook, logger: opts.webhook.logger ?? opts.logger }) : void 0;
|
|
934
949
|
const result = {
|
|
935
950
|
session,
|
|
@@ -941,7 +956,8 @@ function createHellobillHandler(opts) {
|
|
|
941
956
|
property,
|
|
942
957
|
sessions: { list: sessionsList, get: sessionsGet },
|
|
943
958
|
savingsSummary,
|
|
944
|
-
serviceSlots
|
|
959
|
+
serviceSlots,
|
|
960
|
+
loaDocument
|
|
945
961
|
};
|
|
946
962
|
if (webhookHandler !== void 0) {
|
|
947
963
|
result.webhook = webhookHandler;
|
|
@@ -1070,6 +1086,12 @@ function createHellobillHandler2(opts) {
|
|
|
1070
1086
|
await handlers.sessions.list(hbReq, res);
|
|
1071
1087
|
} else if (segment === "sessions" && slug[1] && method === "GET") {
|
|
1072
1088
|
await handlers.sessions.get(hbReq, res);
|
|
1089
|
+
} else if (segment === "service-slots" && method === "GET") {
|
|
1090
|
+
await handlers.serviceSlots(hbReq, res);
|
|
1091
|
+
} else if (segment === "savings-summary" && method === "GET") {
|
|
1092
|
+
await handlers.savingsSummary(hbReq, res);
|
|
1093
|
+
} else if (segment === "loa-document" && method === "GET") {
|
|
1094
|
+
await handlers.loaDocument(hbReq, res);
|
|
1073
1095
|
} else if (segment === "webhooks" && method === "POST" && handlers.webhook) {
|
|
1074
1096
|
await handlers.webhook(hbReq, res);
|
|
1075
1097
|
} else if (segment === "webhooks" && method === "POST" && !handlers.webhook) {
|