@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.
@@ -340,6 +340,12 @@ interface HellobillHandlerSet {
340
340
  * Scoped to the partner's access_token — no session_token required.
341
341
  */
342
342
  serviceSlots: (req: HellobillRequest, res: HellobillResponse) => Promise<void>;
343
+ /**
344
+ * Proxies GET /partner/loa/:id/document.
345
+ * Reads the loa id from req.query.loa_id or req.params.id.
346
+ * Scoped to the partner's access_token — no session_token required.
347
+ */
348
+ loaDocument: (req: HellobillRequest, res: HellobillResponse) => Promise<void>;
343
349
  /**
344
350
  * Optional webhook receiver. Present only when `opts.webhook` is supplied to
345
351
  * `createHellobillHandler`. The Express adapter mounts POST /webhooks when
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { T as TokenStorage, L as Logger } from './index-lPvEf5hZ.cjs';
2
- export { C as CreateHellobillHandlerOptions, H as HellobillHandlerSet, a as HellobillRequest, b as HellobillResponse, I as InMemoryTokenStorage, c as InMemoryWebhookDedupeStore, d as TokenManager, e as TokenManagerOptions, U as UnknownWebhookEventError, V as VerifyWebhookOptions, W as WebhookDedupeStore, f as WebhookHandlerContext, g as WebhookHandlerOptions, h as WebhookHandlers, i as WebhookVerificationError, j as createHellobillHandler, k as createWebhookHandler, v as verifyWebhook, l as verifyWebhookSignature } from './index-lPvEf5hZ.cjs';
1
+ import { T as TokenStorage, L as Logger } from './index-9PkSdjVq.cjs';
2
+ export { C as CreateHellobillHandlerOptions, H as HellobillHandlerSet, a as HellobillRequest, b as HellobillResponse, I as InMemoryTokenStorage, c as InMemoryWebhookDedupeStore, d as TokenManager, e as TokenManagerOptions, U as UnknownWebhookEventError, V as VerifyWebhookOptions, W as WebhookDedupeStore, f as WebhookHandlerContext, g as WebhookHandlerOptions, h as WebhookHandlers, i as WebhookVerificationError, j as createHellobillHandler, k as createWebhookHandler, v as verifyWebhook, l as verifyWebhookSignature } from './index-9PkSdjVq.cjs';
3
3
  import { R as RequestId, S as SessionPayload, a as SessionResponse, b as SessionGetResponse, P as ProductsQuery, c as ProductsResponse, d as PropertyDetailResponse, L as LoaListResponse, C as CreateCustomerInput, e as CustomerCreateResponse, f as CustomerId, g as CustomerStatusResponse, B as BankDetailsRequest, h as BankDetailsResponse } from './webhooks-Cv4e8oXp.cjs';
4
4
  export { A as Address, i as AddressObject, j as AddressesObject, k as ApiVersion, l as AppDeeplinks, m as BankDetailsCollected, n as BankDetailsConsent, o as BankDetailsObject, p as BankDetailsStatus, q as BillType, r as BreakdownCoverProduct, s as BroadbandProduct, t as BuildingStyle, u as BuildingType, v as CacheStatus, w as ClientMode, x as Consent, y as ContextEntry, z as CouncilTaxProduct, D as Customer, E as CustomerType, F as DataCompleteness, G as DiscoveryStatus, H as Email, I as EnergyProduct, J as Environment, K as EpcRating, M as FinalRead, N as FuelType, O as HeatingType, Q as HomeInsuranceProduct, T as IdempotencyKey, U as IsoDate, V as IsoDateTime, W as LoASignature, X as LoaId, Y as LoaRecord, Z as LocationRole, _ as MaskedSortCode, $ as Meters, a0 as MobileProduct, a1 as MoveIn, a2 as MoveObject, a3 as MoveOut, a4 as MoveOutNotificationFailed, a5 as MoveOutNotificationSent, a6 as MoveOutNotifyFlags, a7 as MoveOutReason, a8 as MoveOutStatus, a9 as NearbyPoi, aa as OccupantObject, ab as OccupantType, ac as OnboardingInfo, ad as OverallStatus, ae as Paginated, af as Person, ag as PhoneNumber, ah as Postcode, ai as Product, aj as ProductBase, ak as ProductCategory, al as ProductConfidence, am as ProductId, an as ProductSetup, ao as PropertyDetailObject, ap as PropertyLocation, aq as PropertyObject, ar as PropertyType, as as PropertyTypeCode, at as PropertyTypeSubcode, au as ProvidedFieldPath, av as SESSION_IDEMPOTENCY_TTL_MS, aw as SavingsSummaryResponse, ax as SelectedProduct, ay as SessionAccountCreated, az as SessionAppDeferred, aA as SessionAppInstalled, aB as SessionDetailsConfirmed, aC as SessionEmbedOpened, aD as SessionLoaSigned, aE as SessionProductsSelected, aF as SetupStatus, aG as SetupStatusChanged, aH as SignatureImage, aI as StoredBankDetails, aJ as SubscriptionChanged, aK as SubscriptionStatus, aL as TvLicenceProduct, aM as Url, aN as WaterProduct, aO as WebhookEvent, aP as WebhookEventBase, aQ as WebhookEventId, aR as WebhookEventType } from './webhooks-Cv4e8oXp.cjs';
5
5
  import { ErrorEnvelope } from './types/index.cjs';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { T as TokenStorage, L as Logger } from './index-D81ftBQo.js';
2
- export { C as CreateHellobillHandlerOptions, H as HellobillHandlerSet, a as HellobillRequest, b as HellobillResponse, I as InMemoryTokenStorage, c as InMemoryWebhookDedupeStore, d as TokenManager, e as TokenManagerOptions, U as UnknownWebhookEventError, V as VerifyWebhookOptions, W as WebhookDedupeStore, f as WebhookHandlerContext, g as WebhookHandlerOptions, h as WebhookHandlers, i as WebhookVerificationError, j as createHellobillHandler, k as createWebhookHandler, v as verifyWebhook, l as verifyWebhookSignature } from './index-D81ftBQo.js';
1
+ import { T as TokenStorage, L as Logger } from './index-BAETgMms.js';
2
+ export { C as CreateHellobillHandlerOptions, H as HellobillHandlerSet, a as HellobillRequest, b as HellobillResponse, I as InMemoryTokenStorage, c as InMemoryWebhookDedupeStore, d as TokenManager, e as TokenManagerOptions, U as UnknownWebhookEventError, V as VerifyWebhookOptions, W as WebhookDedupeStore, f as WebhookHandlerContext, g as WebhookHandlerOptions, h as WebhookHandlers, i as WebhookVerificationError, j as createHellobillHandler, k as createWebhookHandler, v as verifyWebhook, l as verifyWebhookSignature } from './index-BAETgMms.js';
3
3
  import { R as RequestId, S as SessionPayload, a as SessionResponse, b as SessionGetResponse, P as ProductsQuery, c as ProductsResponse, d as PropertyDetailResponse, L as LoaListResponse, C as CreateCustomerInput, e as CustomerCreateResponse, f as CustomerId, g as CustomerStatusResponse, B as BankDetailsRequest, h as BankDetailsResponse } from './webhooks-Cv4e8oXp.js';
4
4
  export { A as Address, i as AddressObject, j as AddressesObject, k as ApiVersion, l as AppDeeplinks, m as BankDetailsCollected, n as BankDetailsConsent, o as BankDetailsObject, p as BankDetailsStatus, q as BillType, r as BreakdownCoverProduct, s as BroadbandProduct, t as BuildingStyle, u as BuildingType, v as CacheStatus, w as ClientMode, x as Consent, y as ContextEntry, z as CouncilTaxProduct, D as Customer, E as CustomerType, F as DataCompleteness, G as DiscoveryStatus, H as Email, I as EnergyProduct, J as Environment, K as EpcRating, M as FinalRead, N as FuelType, O as HeatingType, Q as HomeInsuranceProduct, T as IdempotencyKey, U as IsoDate, V as IsoDateTime, W as LoASignature, X as LoaId, Y as LoaRecord, Z as LocationRole, _ as MaskedSortCode, $ as Meters, a0 as MobileProduct, a1 as MoveIn, a2 as MoveObject, a3 as MoveOut, a4 as MoveOutNotificationFailed, a5 as MoveOutNotificationSent, a6 as MoveOutNotifyFlags, a7 as MoveOutReason, a8 as MoveOutStatus, a9 as NearbyPoi, aa as OccupantObject, ab as OccupantType, ac as OnboardingInfo, ad as OverallStatus, ae as Paginated, af as Person, ag as PhoneNumber, ah as Postcode, ai as Product, aj as ProductBase, ak as ProductCategory, al as ProductConfidence, am as ProductId, an as ProductSetup, ao as PropertyDetailObject, ap as PropertyLocation, aq as PropertyObject, ar as PropertyType, as as PropertyTypeCode, at as PropertyTypeSubcode, au as ProvidedFieldPath, av as SESSION_IDEMPOTENCY_TTL_MS, aw as SavingsSummaryResponse, ax as SelectedProduct, ay as SessionAccountCreated, az as SessionAppDeferred, aA as SessionAppInstalled, aB as SessionDetailsConfirmed, aC as SessionEmbedOpened, aD as SessionLoaSigned, aE as SessionProductsSelected, aF as SetupStatus, aG as SetupStatusChanged, aH as SignatureImage, aI as StoredBankDetails, aJ as SubscriptionChanged, aK as SubscriptionStatus, aL as TvLicenceProduct, aM as Url, aN as WaterProduct, aO as WebhookEvent, aP as WebhookEventBase, aQ as WebhookEventId, aR as WebhookEventType } from './webhooks-Cv4e8oXp.js';
5
5
  import { ErrorEnvelope } from './types/index.js';
package/dist/index.js CHANGED
@@ -972,6 +972,21 @@ function createHellobillHandler(opts) {
972
972
  if (!result2) return;
973
973
  passthroughUpstream(res, result2.status, result2.body, result2.requestId, result2.headers);
974
974
  };
975
+ const loaDocument = async (req, res) => {
976
+ const rawLoa = req.query.loa_id ?? req.params?.id;
977
+ const loaId = Array.isArray(rawLoa) ? rawLoa[0] : rawLoa;
978
+ if (!loaId) {
979
+ sendError(res, 400, "validation.missing_required_field", "loa_id query parameter required");
980
+ return;
981
+ }
982
+ const result2 = await safeCallUpstream(res, {
983
+ method: "GET",
984
+ path: `/partner/loa/${encodeURIComponent(loaId)}/document`,
985
+ logger
986
+ });
987
+ if (!result2) return;
988
+ passthroughUpstream(res, result2.status, result2.body, result2.requestId, result2.headers);
989
+ };
975
990
  const webhookHandler = opts.webhook ? createWebhookHandler({ ...opts.webhook, logger: opts.webhook.logger ?? opts.logger }) : void 0;
976
991
  const result = {
977
992
  session,
@@ -983,7 +998,8 @@ function createHellobillHandler(opts) {
983
998
  property,
984
999
  sessions: { list: sessionsList, get: sessionsGet },
985
1000
  savingsSummary,
986
- serviceSlots
1001
+ serviceSlots,
1002
+ loaDocument
987
1003
  };
988
1004
  if (webhookHandler !== void 0) {
989
1005
  result.webhook = webhookHandler;