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