@hello-bill/node 2.2.0-beta.3 → 2.2.0-beta.5

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/dist/express/index.d.cts +3 -2
  3. package/dist/express/index.d.ts +3 -2
  4. package/dist/express/index.js +18 -0
  5. package/dist/express/index.js.map +1 -1
  6. package/dist/express/index.mjs +18 -0
  7. package/dist/express/index.mjs.map +1 -1
  8. package/dist/hono/index.d.cts +2 -2
  9. package/dist/hono/index.d.ts +2 -2
  10. package/dist/hono/index.js +17 -0
  11. package/dist/hono/index.js.map +1 -1
  12. package/dist/hono/index.mjs +17 -0
  13. package/dist/hono/index.mjs.map +1 -1
  14. package/dist/{index-weK_H8io.d.cts → index-D1Y88dmC.d.cts} +12 -1
  15. package/dist/{index-CtQgDuFR.d.ts → index-sSyUfAhM.d.ts} +12 -1
  16. package/dist/index.d.cts +4 -4
  17. package/dist/index.d.ts +4 -4
  18. package/dist/index.js +17 -0
  19. package/dist/index.js.map +1 -1
  20. package/dist/index.mjs +17 -0
  21. package/dist/index.mjs.map +1 -1
  22. package/dist/koa/index.d.cts +2 -2
  23. package/dist/koa/index.d.ts +2 -2
  24. package/dist/koa/index.js +17 -0
  25. package/dist/koa/index.js.map +1 -1
  26. package/dist/koa/index.mjs +17 -0
  27. package/dist/koa/index.mjs.map +1 -1
  28. package/dist/next/index.d.cts +2 -2
  29. package/dist/next/index.d.ts +2 -2
  30. package/dist/next/index.js +17 -0
  31. package/dist/next/index.js.map +1 -1
  32. package/dist/next/index.mjs +17 -0
  33. package/dist/next/index.mjs.map +1 -1
  34. package/dist/types/index.d.cts +2 -2
  35. package/dist/types/index.d.ts +2 -2
  36. package/dist/types/index.js.map +1 -1
  37. package/dist/types/index.mjs.map +1 -1
  38. package/dist/webhook/index.d.cts +2 -2
  39. package/dist/webhook/index.d.ts +2 -2
  40. package/dist/{webhooks-iwkEPw9n.d.cts → webhooks-CfpQ4PEE.d.cts} +9 -0
  41. package/dist/{webhooks-iwkEPw9n.d.ts → webhooks-CfpQ4PEE.d.ts} +9 -0
  42. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { aS as WebhookEvent, aF as SessionEmbedOpened, aE as SessionDetailsConfirmed, aH as SessionProductsSelected, aG as SessionLoaSigned, aB as SessionAccountCreated, aD as SessionAppInstalled, aC as SessionAppDeferred, aM as SubscriptionChanged, aJ as SetupStatusChanged, a8 as MoveOutNotificationSent, a7 as MoveOutNotificationFailed, m as BankDetailsCollected, S as SessionPayload } from './webhooks-iwkEPw9n.cjs';
1
+ import { aS as WebhookEvent, aF as SessionEmbedOpened, aE as SessionDetailsConfirmed, aH as SessionProductsSelected, aG as SessionLoaSigned, aB as SessionAccountCreated, aD as SessionAppInstalled, aC as SessionAppDeferred, aM as SubscriptionChanged, aJ as SetupStatusChanged, a8 as MoveOutNotificationSent, a7 as MoveOutNotificationFailed, m as BankDetailsCollected, S as SessionPayload } from './webhooks-CfpQ4PEE.cjs';
2
2
 
3
3
  interface TokenStorage {
4
4
  get(clientId: string): Promise<{
@@ -326,6 +326,17 @@ interface HellobillHandlerSet {
326
326
  list: (req: HellobillRequest, res: HellobillResponse) => Promise<void>;
327
327
  get: (req: HellobillRequest, res: HellobillResponse) => Promise<void>;
328
328
  };
329
+ /**
330
+ * Browser-facing session recovery: re-mints a fresh session_token for an
331
+ * existing session so a returning customer can resume onboarding. Proxies
332
+ * POST /partner/sessions/:id/resume using the partner's M2M access token —
333
+ * no session_token is required or forwarded (partner-credential-scoped, like
334
+ * `sessions.get`). Reads the session id from `req.params.id`. The fresh
335
+ * session_token, embed_base_url and snapshot flow back to the browser; the
336
+ * M2M credential never does. A partner-API 404 (unknown/expired session) is
337
+ * forwarded verbatim with its status preserved.
338
+ */
339
+ sessionResume: (req: HellobillRequest, res: HellobillResponse) => Promise<void>;
329
340
  /**
330
341
  * Proxies GET /partner/customers/:id/savings-summary.
331
342
  * Reads customer_id from req.query.customer_id or req.params.id.
@@ -1,4 +1,4 @@
1
- import { aS as WebhookEvent, aF as SessionEmbedOpened, aE as SessionDetailsConfirmed, aH as SessionProductsSelected, aG as SessionLoaSigned, aB as SessionAccountCreated, aD as SessionAppInstalled, aC as SessionAppDeferred, aM as SubscriptionChanged, aJ as SetupStatusChanged, a8 as MoveOutNotificationSent, a7 as MoveOutNotificationFailed, m as BankDetailsCollected, S as SessionPayload } from './webhooks-iwkEPw9n.js';
1
+ import { aS as WebhookEvent, aF as SessionEmbedOpened, aE as SessionDetailsConfirmed, aH as SessionProductsSelected, aG as SessionLoaSigned, aB as SessionAccountCreated, aD as SessionAppInstalled, aC as SessionAppDeferred, aM as SubscriptionChanged, aJ as SetupStatusChanged, a8 as MoveOutNotificationSent, a7 as MoveOutNotificationFailed, m as BankDetailsCollected, S as SessionPayload } from './webhooks-CfpQ4PEE.js';
2
2
 
3
3
  interface TokenStorage {
4
4
  get(clientId: string): Promise<{
@@ -326,6 +326,17 @@ interface HellobillHandlerSet {
326
326
  list: (req: HellobillRequest, res: HellobillResponse) => Promise<void>;
327
327
  get: (req: HellobillRequest, res: HellobillResponse) => Promise<void>;
328
328
  };
329
+ /**
330
+ * Browser-facing session recovery: re-mints a fresh session_token for an
331
+ * existing session so a returning customer can resume onboarding. Proxies
332
+ * POST /partner/sessions/:id/resume using the partner's M2M access token —
333
+ * no session_token is required or forwarded (partner-credential-scoped, like
334
+ * `sessions.get`). Reads the session id from `req.params.id`. The fresh
335
+ * session_token, embed_base_url and snapshot flow back to the browser; the
336
+ * M2M credential never does. A partner-API 404 (unknown/expired session) is
337
+ * forwarded verbatim with its status preserved.
338
+ */
339
+ sessionResume: (req: HellobillRequest, res: HellobillResponse) => Promise<void>;
329
340
  /**
330
341
  * Proxies GET /partner/customers/:id/savings-summary.
331
342
  * Reads customer_id from req.query.customer_id or req.params.id.
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import { T as TokenStorage, L as Logger } from './index-weK_H8io.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-weK_H8io.cjs';
3
- import { R as RequestId, C as CreateCustomerInput, B as BankDetailsRequest, a as CustomerCreateResponse, b as BankDetailsResponse, S as SessionPayload, c as SessionResponse, d as SessionGetResponse, P as ProductsQuery, e as ProductsResponse, f as PropertyDetailResponse, L as LoaListResponse, g as CustomerId, h as CustomerStatusResponse } from './webhooks-iwkEPw9n.cjs';
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 CreditCheckAddress, E as CreditCheckObject, F as Customer, G as CustomerType, H as DataCompleteness, I as DiscoveryStatus, J as Email, K as EnergyProduct, M as Environment, N as EpcRating, O as FeatureFlags, Q as FinalRead, T as FuelType, U as HeatingType, V as HomeInsuranceProduct, W as IdempotencyKey, X as IsoDate, Y as IsoDateTime, Z as LoASignature, _ as LoaId, $ as LoaRecord, a0 as LocationRole, a1 as MaskedSortCode, a2 as Meters, a3 as MobileProduct, a4 as MoveIn, a5 as MoveObject, a6 as MoveOut, a7 as MoveOutNotificationFailed, a8 as MoveOutNotificationSent, a9 as MoveOutNotifyFlags, aa as MoveOutReason, ab as MoveOutStatus, ac as NearbyPoi, ad as OccupantObject, ae as OccupantType, af as OnboardingInfo, ag as OverallStatus, ah as Paginated, ai as Person, aj as PhoneNumber, ak as Postcode, al as Product, am as ProductBase, an as ProductCategory, ao as ProductConfidence, ap as ProductId, aq as ProductSetup, ar as PropertyDetailObject, as as PropertyLocation, at as PropertyObject, au as PropertyType, av as PropertyTypeCode, aw as PropertyTypeSubcode, ax as ProvidedFieldPath, ay as SESSION_IDEMPOTENCY_TTL_MS, az as SavingsSummaryResponse, aA as SelectedProduct, aB as SessionAccountCreated, aC as SessionAppDeferred, aD as SessionAppInstalled, aE as SessionDetailsConfirmed, aF as SessionEmbedOpened, aG as SessionLoaSigned, aH as SessionProductsSelected, aI as SetupStatus, aJ as SetupStatusChanged, aK as SignatureImage, aL as StoredBankDetails, aM as SubscriptionChanged, aN as SubscriptionStatus, aO as Title, aP as TvLicenceProduct, aQ as Url, aR as WaterProduct, aS as WebhookEvent, aT as WebhookEventBase, aU as WebhookEventId, aV as WebhookEventType } from './webhooks-iwkEPw9n.cjs';
1
+ import { T as TokenStorage, L as Logger } from './index-D1Y88dmC.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-D1Y88dmC.cjs';
3
+ import { R as RequestId, C as CreateCustomerInput, B as BankDetailsRequest, a as CustomerCreateResponse, b as BankDetailsResponse, S as SessionPayload, c as SessionResponse, d as SessionGetResponse, P as ProductsQuery, e as ProductsResponse, f as PropertyDetailResponse, L as LoaListResponse, g as CustomerId, h as CustomerStatusResponse } from './webhooks-CfpQ4PEE.cjs';
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 CreditCheckAddress, E as CreditCheckObject, F as Customer, G as CustomerType, H as DataCompleteness, I as DiscoveryStatus, J as Email, K as EnergyProduct, M as Environment, N as EpcRating, O as FeatureFlags, Q as FinalRead, T as FuelType, U as HeatingType, V as HomeInsuranceProduct, W as IdempotencyKey, X as IsoDate, Y as IsoDateTime, Z as LoASignature, _ as LoaId, $ as LoaRecord, a0 as LocationRole, a1 as MaskedSortCode, a2 as Meters, a3 as MobileProduct, a4 as MoveIn, a5 as MoveObject, a6 as MoveOut, a7 as MoveOutNotificationFailed, a8 as MoveOutNotificationSent, a9 as MoveOutNotifyFlags, aa as MoveOutReason, ab as MoveOutStatus, ac as NearbyPoi, ad as OccupantObject, ae as OccupantType, af as OnboardingInfo, ag as OverallStatus, ah as Paginated, ai as Person, aj as PhoneNumber, ak as Postcode, al as Product, am as ProductBase, an as ProductCategory, ao as ProductConfidence, ap as ProductId, aq as ProductSetup, ar as PropertyDetailObject, as as PropertyLocation, at as PropertyObject, au as PropertyType, av as PropertyTypeCode, aw as PropertyTypeSubcode, ax as ProvidedFieldPath, ay as SESSION_IDEMPOTENCY_TTL_MS, az as SavingsSummaryResponse, aA as SelectedProduct, aB as SessionAccountCreated, aC as SessionAppDeferred, aD as SessionAppInstalled, aE as SessionDetailsConfirmed, aF as SessionEmbedOpened, aG as SessionLoaSigned, aH as SessionProductsSelected, aI as SetupStatus, aJ as SetupStatusChanged, aK as SignatureImage, aL as StoredBankDetails, aM as SubscriptionChanged, aN as SubscriptionStatus, aO as Title, aP as TvLicenceProduct, aQ as Url, aR as WaterProduct, aS as WebhookEvent, aT as WebhookEventBase, aU as WebhookEventId, aV as WebhookEventType } from './webhooks-CfpQ4PEE.cjs';
5
5
  import { ErrorEnvelope } from './types/index.cjs';
6
6
  export { AnyvanSlot, AnyvanSlotsResponse, ErrorCode, ErrorType, RETRYABLE_HTTP_STATUSES } from './types/index.cjs';
7
7
 
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { T as TokenStorage, L as Logger } from './index-CtQgDuFR.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-CtQgDuFR.js';
3
- import { R as RequestId, C as CreateCustomerInput, B as BankDetailsRequest, a as CustomerCreateResponse, b as BankDetailsResponse, S as SessionPayload, c as SessionResponse, d as SessionGetResponse, P as ProductsQuery, e as ProductsResponse, f as PropertyDetailResponse, L as LoaListResponse, g as CustomerId, h as CustomerStatusResponse } from './webhooks-iwkEPw9n.js';
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 CreditCheckAddress, E as CreditCheckObject, F as Customer, G as CustomerType, H as DataCompleteness, I as DiscoveryStatus, J as Email, K as EnergyProduct, M as Environment, N as EpcRating, O as FeatureFlags, Q as FinalRead, T as FuelType, U as HeatingType, V as HomeInsuranceProduct, W as IdempotencyKey, X as IsoDate, Y as IsoDateTime, Z as LoASignature, _ as LoaId, $ as LoaRecord, a0 as LocationRole, a1 as MaskedSortCode, a2 as Meters, a3 as MobileProduct, a4 as MoveIn, a5 as MoveObject, a6 as MoveOut, a7 as MoveOutNotificationFailed, a8 as MoveOutNotificationSent, a9 as MoveOutNotifyFlags, aa as MoveOutReason, ab as MoveOutStatus, ac as NearbyPoi, ad as OccupantObject, ae as OccupantType, af as OnboardingInfo, ag as OverallStatus, ah as Paginated, ai as Person, aj as PhoneNumber, ak as Postcode, al as Product, am as ProductBase, an as ProductCategory, ao as ProductConfidence, ap as ProductId, aq as ProductSetup, ar as PropertyDetailObject, as as PropertyLocation, at as PropertyObject, au as PropertyType, av as PropertyTypeCode, aw as PropertyTypeSubcode, ax as ProvidedFieldPath, ay as SESSION_IDEMPOTENCY_TTL_MS, az as SavingsSummaryResponse, aA as SelectedProduct, aB as SessionAccountCreated, aC as SessionAppDeferred, aD as SessionAppInstalled, aE as SessionDetailsConfirmed, aF as SessionEmbedOpened, aG as SessionLoaSigned, aH as SessionProductsSelected, aI as SetupStatus, aJ as SetupStatusChanged, aK as SignatureImage, aL as StoredBankDetails, aM as SubscriptionChanged, aN as SubscriptionStatus, aO as Title, aP as TvLicenceProduct, aQ as Url, aR as WaterProduct, aS as WebhookEvent, aT as WebhookEventBase, aU as WebhookEventId, aV as WebhookEventType } from './webhooks-iwkEPw9n.js';
1
+ import { T as TokenStorage, L as Logger } from './index-sSyUfAhM.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-sSyUfAhM.js';
3
+ import { R as RequestId, C as CreateCustomerInput, B as BankDetailsRequest, a as CustomerCreateResponse, b as BankDetailsResponse, S as SessionPayload, c as SessionResponse, d as SessionGetResponse, P as ProductsQuery, e as ProductsResponse, f as PropertyDetailResponse, L as LoaListResponse, g as CustomerId, h as CustomerStatusResponse } from './webhooks-CfpQ4PEE.js';
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 CreditCheckAddress, E as CreditCheckObject, F as Customer, G as CustomerType, H as DataCompleteness, I as DiscoveryStatus, J as Email, K as EnergyProduct, M as Environment, N as EpcRating, O as FeatureFlags, Q as FinalRead, T as FuelType, U as HeatingType, V as HomeInsuranceProduct, W as IdempotencyKey, X as IsoDate, Y as IsoDateTime, Z as LoASignature, _ as LoaId, $ as LoaRecord, a0 as LocationRole, a1 as MaskedSortCode, a2 as Meters, a3 as MobileProduct, a4 as MoveIn, a5 as MoveObject, a6 as MoveOut, a7 as MoveOutNotificationFailed, a8 as MoveOutNotificationSent, a9 as MoveOutNotifyFlags, aa as MoveOutReason, ab as MoveOutStatus, ac as NearbyPoi, ad as OccupantObject, ae as OccupantType, af as OnboardingInfo, ag as OverallStatus, ah as Paginated, ai as Person, aj as PhoneNumber, ak as Postcode, al as Product, am as ProductBase, an as ProductCategory, ao as ProductConfidence, ap as ProductId, aq as ProductSetup, ar as PropertyDetailObject, as as PropertyLocation, at as PropertyObject, au as PropertyType, av as PropertyTypeCode, aw as PropertyTypeSubcode, ax as ProvidedFieldPath, ay as SESSION_IDEMPOTENCY_TTL_MS, az as SavingsSummaryResponse, aA as SelectedProduct, aB as SessionAccountCreated, aC as SessionAppDeferred, aD as SessionAppInstalled, aE as SessionDetailsConfirmed, aF as SessionEmbedOpened, aG as SessionLoaSigned, aH as SessionProductsSelected, aI as SetupStatus, aJ as SetupStatusChanged, aK as SignatureImage, aL as StoredBankDetails, aM as SubscriptionChanged, aN as SubscriptionStatus, aO as Title, aP as TvLicenceProduct, aQ as Url, aR as WaterProduct, aS as WebhookEvent, aT as WebhookEventBase, aU as WebhookEventId, aV as WebhookEventType } from './webhooks-CfpQ4PEE.js';
5
5
  import { ErrorEnvelope } from './types/index.js';
6
6
  export { AnyvanSlot, AnyvanSlotsResponse, ErrorCode, ErrorType, RETRYABLE_HTTP_STATUSES } from './types/index.js';
7
7
 
package/dist/index.js CHANGED
@@ -935,6 +935,22 @@ function createHellobillHandler(opts) {
935
935
  if (!result2) return;
936
936
  passthroughUpstream(res, result2.status, result2.body, result2.requestId, result2.headers);
937
937
  };
938
+ const sessionResume = async (req, res) => {
939
+ const id = typeof req.params?.id === "string" ? req.params.id : void 0;
940
+ if (!id || id.length === 0) {
941
+ sendError(res, 400, "validation.missing_required_field", "sessions/:id/resume requires a non-empty id path param");
942
+ return;
943
+ }
944
+ const result2 = await safeCallUpstream(res, {
945
+ method: "POST",
946
+ path: `/partner/sessions/${encodeURIComponent(id)}/resume`,
947
+ body: req.body,
948
+ idempotencyKey: inboundIdempotencyKey(req) ?? idempotencyKeyFactory(),
949
+ logger
950
+ });
951
+ if (!result2) return;
952
+ passthroughUpstream(res, result2.status, result2.body, result2.requestId, result2.headers);
953
+ };
938
954
  const savingsSummary = async (req, res) => {
939
955
  const rawCustomer = req.query.customer_id ?? req.params?.id;
940
956
  const customerId = Array.isArray(rawCustomer) ? rawCustomer[0] : rawCustomer;
@@ -1005,6 +1021,7 @@ function createHellobillHandler(opts) {
1005
1021
  products,
1006
1022
  property,
1007
1023
  sessions: { list: sessionsList, get: sessionsGet },
1024
+ sessionResume,
1008
1025
  savingsSummary,
1009
1026
  serviceSlots,
1010
1027
  loaDocument