@hello-bill/node 2.1.0-beta.2 → 2.1.0-beta.3

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.
@@ -1,4 +1,4 @@
1
- import { C as CreateHellobillHandlerOptions } from '../index-D81ftBQo.js';
1
+ import { C as CreateHellobillHandlerOptions } from '../index-BAETgMms.js';
2
2
  import '../webhooks-Cv4e8oXp.js';
3
3
 
4
4
  /**
@@ -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) {