@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.
package/dist/index.mjs CHANGED
@@ -970,6 +970,21 @@ function createHellobillHandler(opts) {
970
970
  if (!result2) return;
971
971
  passthroughUpstream(res, result2.status, result2.body, result2.requestId, result2.headers);
972
972
  };
973
+ const loaDocument = async (req, res) => {
974
+ const rawLoa = req.query.loa_id ?? req.params?.id;
975
+ const loaId = Array.isArray(rawLoa) ? rawLoa[0] : rawLoa;
976
+ if (!loaId) {
977
+ sendError(res, 400, "validation.missing_required_field", "loa_id query parameter required");
978
+ return;
979
+ }
980
+ const result2 = await safeCallUpstream(res, {
981
+ method: "GET",
982
+ path: `/partner/loa/${encodeURIComponent(loaId)}/document`,
983
+ logger
984
+ });
985
+ if (!result2) return;
986
+ passthroughUpstream(res, result2.status, result2.body, result2.requestId, result2.headers);
987
+ };
973
988
  const webhookHandler = opts.webhook ? createWebhookHandler({ ...opts.webhook, logger: opts.webhook.logger ?? opts.logger }) : void 0;
974
989
  const result = {
975
990
  session,
@@ -981,7 +996,8 @@ function createHellobillHandler(opts) {
981
996
  property,
982
997
  sessions: { list: sessionsList, get: sessionsGet },
983
998
  savingsSummary,
984
- serviceSlots
999
+ serviceSlots,
1000
+ loaDocument
985
1001
  };
986
1002
  if (webhookHandler !== void 0) {
987
1003
  result.webhook = webhookHandler;