@hello-bill/node 2.2.0-beta.2 → 2.2.0-beta.4
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/CHANGELOG.md +2 -0
- package/dist/express/index.d.cts +2 -2
- package/dist/express/index.d.ts +2 -2
- package/dist/hono/index.d.cts +2 -2
- package/dist/hono/index.d.ts +2 -2
- package/dist/{index-D425PJZo.d.ts → index-CtQgDuFR.d.ts} +1 -1
- package/dist/{index-DIV4FzH6.d.cts → index-weK_H8io.d.cts} +1 -1
- package/dist/index.d.cts +20 -14
- package/dist/index.d.ts +20 -14
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -0
- package/dist/index.mjs.map +1 -1
- package/dist/koa/index.d.cts +2 -2
- package/dist/koa/index.d.ts +2 -2
- package/dist/next/index.d.cts +2 -2
- package/dist/next/index.d.ts +2 -2
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/webhook/index.d.cts +2 -2
- package/dist/webhook/index.d.ts +2 -2
- package/dist/{webhooks-DKDXYTkz.d.cts → webhooks-iwkEPw9n.d.cts} +1 -1
- package/dist/{webhooks-DKDXYTkz.d.ts → webhooks-iwkEPw9n.d.ts} +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/express/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CreateHellobillHandlerOptions } from '../index-
|
|
2
|
-
import '../webhooks-
|
|
1
|
+
import { C as CreateHellobillHandlerOptions } from '../index-weK_H8io.cjs';
|
|
2
|
+
import '../webhooks-iwkEPw9n.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Express adapter for the framework-agnostic SDK core.
|
package/dist/express/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CreateHellobillHandlerOptions } from '../index-
|
|
2
|
-
import '../webhooks-
|
|
1
|
+
import { C as CreateHellobillHandlerOptions } from '../index-CtQgDuFR.js';
|
|
2
|
+
import '../webhooks-iwkEPw9n.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Express adapter for the framework-agnostic SDK core.
|
package/dist/hono/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CreateHellobillHandlerOptions } from '../index-
|
|
2
|
-
import '../webhooks-
|
|
1
|
+
import { C as CreateHellobillHandlerOptions } from '../index-weK_H8io.cjs';
|
|
2
|
+
import '../webhooks-iwkEPw9n.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Hono adapter for the framework-agnostic SDK core.
|
package/dist/hono/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CreateHellobillHandlerOptions } from '../index-
|
|
2
|
-
import '../webhooks-
|
|
1
|
+
import { C as CreateHellobillHandlerOptions } from '../index-CtQgDuFR.js';
|
|
2
|
+
import '../webhooks-iwkEPw9n.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Hono adapter for the framework-agnostic SDK core.
|
|
@@ -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-
|
|
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';
|
|
2
2
|
|
|
3
3
|
interface TokenStorage {
|
|
4
4
|
get(clientId: string): Promise<{
|
|
@@ -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-
|
|
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';
|
|
2
2
|
|
|
3
3
|
interface TokenStorage {
|
|
4
4
|
get(clientId: string): Promise<{
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { T as TokenStorage, L as Logger } from './index-
|
|
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-
|
|
3
|
-
import { R as RequestId,
|
|
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-
|
|
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';
|
|
5
5
|
import { ErrorEnvelope } from './types/index.cjs';
|
|
6
6
|
export { AnyvanSlot, AnyvanSlotsResponse, ErrorCode, ErrorType, RETRYABLE_HTTP_STATUSES } from './types/index.cjs';
|
|
7
7
|
|
|
@@ -58,25 +58,24 @@ declare class HellobillApiError extends Error {
|
|
|
58
58
|
interface HelloBillPartnerOptions {
|
|
59
59
|
clientId: string;
|
|
60
60
|
clientSecret: string;
|
|
61
|
-
/**
|
|
62
|
-
* Partner API base URL. Defaults to the production endpoint.
|
|
63
|
-
* Override for sandbox proxies or local mock-api testing.
|
|
64
|
-
*/
|
|
65
61
|
apiBaseUrl?: string;
|
|
66
|
-
/** Optional token storage adapter for multi-instance deployments. Default: in-memory. */
|
|
67
62
|
tokenStorage?: TokenStorage;
|
|
68
|
-
/** Custom fetch implementation (for tests). Defaults to globalThis.fetch. */
|
|
69
63
|
fetch?: typeof globalThis.fetch;
|
|
70
|
-
/** Optional logger. Defaults to no-op. */
|
|
71
64
|
logger?: Logger;
|
|
72
|
-
/** Per-attempt upstream request timeout in ms. Default 30_000 (30s). */
|
|
73
65
|
upstreamTimeoutMs?: number;
|
|
74
|
-
/** Optional override for idempotency key generation. Defaults to crypto.randomUUID(). */
|
|
75
66
|
idempotencyKeyFactory?: () => string;
|
|
76
67
|
}
|
|
77
68
|
interface IdempotencyOptions {
|
|
78
69
|
idempotencyKey?: string;
|
|
79
70
|
}
|
|
71
|
+
type CreateCustomerWithBankDetailsInput = {
|
|
72
|
+
readonly customer: CreateCustomerInput;
|
|
73
|
+
readonly bankDetails: BankDetailsRequest;
|
|
74
|
+
};
|
|
75
|
+
type CreateCustomerWithBankDetailsResponse = {
|
|
76
|
+
readonly customer: CustomerCreateResponse;
|
|
77
|
+
readonly bankDetails: BankDetailsResponse;
|
|
78
|
+
};
|
|
80
79
|
interface SessionsListQuery {
|
|
81
80
|
email?: string;
|
|
82
81
|
postcode?: string;
|
|
@@ -106,6 +105,7 @@ interface LoaQuery {
|
|
|
106
105
|
interface PropertyQuery {
|
|
107
106
|
force_refresh?: boolean;
|
|
108
107
|
}
|
|
108
|
+
|
|
109
109
|
declare class HelloBillPartner {
|
|
110
110
|
private readonly tokenManager;
|
|
111
111
|
private readonly apiBaseUrl;
|
|
@@ -129,6 +129,12 @@ declare class HelloBillPartner {
|
|
|
129
129
|
submit: (sessionId: string, payload: BankDetailsRequest, opts?: IdempotencyOptions) => Promise<BankDetailsResponse>;
|
|
130
130
|
get: (sessionId: string) => Promise<BankDetailsResponse>;
|
|
131
131
|
};
|
|
132
|
+
/**
|
|
133
|
+
* Creates a customer, then submits bank details for the same session.
|
|
134
|
+
* Pass opts.idempotencyKey for stable, resumable retries across both POSTs.
|
|
135
|
+
* Without one, each underlying POST uses the configured idempotency key factory.
|
|
136
|
+
*/
|
|
137
|
+
readonly createCustomerWithBankDetails: (sessionId: string, input: CreateCustomerWithBankDetailsInput, opts?: IdempotencyOptions) => Promise<CreateCustomerWithBankDetailsResponse>;
|
|
132
138
|
constructor(opts: HelloBillPartnerOptions);
|
|
133
139
|
/**
|
|
134
140
|
* Shared transport envelope: acquires a token, builds the request,
|
|
@@ -161,4 +167,4 @@ declare class HelloBillPartner {
|
|
|
161
167
|
*/
|
|
162
168
|
declare function buildOnboardingInfo(_productId: string, category: string, location: string, fields: Record<string, unknown>): Record<string, unknown> | undefined;
|
|
163
169
|
|
|
164
|
-
export { BankDetailsRequest, BankDetailsResponse, CreateCustomerInput, CustomerCreateResponse, CustomerId, CustomerStatusResponse, ErrorEnvelope, HelloBillPartner, type HelloBillPartnerOptions, HellobillApiError, type IdempotencyOptions, LoaListResponse, type LoaQuery, Logger, ProductsQuery, ProductsResponse, PropertyDetailResponse, type PropertyQuery, RequestId, type RetryOptions, SessionGetResponse, SessionPayload, SessionResponse, type SessionsListQuery, type SessionsListResponse, TokenStorage, buildOnboardingInfo, defaultIdempotencyKey, retryFetch };
|
|
170
|
+
export { BankDetailsRequest, BankDetailsResponse, CreateCustomerInput, type CreateCustomerWithBankDetailsInput, type CreateCustomerWithBankDetailsResponse, CustomerCreateResponse, CustomerId, CustomerStatusResponse, ErrorEnvelope, HelloBillPartner, type HelloBillPartnerOptions, HellobillApiError, type IdempotencyOptions, LoaListResponse, type LoaQuery, Logger, ProductsQuery, ProductsResponse, PropertyDetailResponse, type PropertyQuery, RequestId, type RetryOptions, SessionGetResponse, SessionPayload, SessionResponse, type SessionsListQuery, type SessionsListResponse, TokenStorage, buildOnboardingInfo, defaultIdempotencyKey, retryFetch };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { T as TokenStorage, L as Logger } from './index-
|
|
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-
|
|
3
|
-
import { R as RequestId,
|
|
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-
|
|
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';
|
|
5
5
|
import { ErrorEnvelope } from './types/index.js';
|
|
6
6
|
export { AnyvanSlot, AnyvanSlotsResponse, ErrorCode, ErrorType, RETRYABLE_HTTP_STATUSES } from './types/index.js';
|
|
7
7
|
|
|
@@ -58,25 +58,24 @@ declare class HellobillApiError extends Error {
|
|
|
58
58
|
interface HelloBillPartnerOptions {
|
|
59
59
|
clientId: string;
|
|
60
60
|
clientSecret: string;
|
|
61
|
-
/**
|
|
62
|
-
* Partner API base URL. Defaults to the production endpoint.
|
|
63
|
-
* Override for sandbox proxies or local mock-api testing.
|
|
64
|
-
*/
|
|
65
61
|
apiBaseUrl?: string;
|
|
66
|
-
/** Optional token storage adapter for multi-instance deployments. Default: in-memory. */
|
|
67
62
|
tokenStorage?: TokenStorage;
|
|
68
|
-
/** Custom fetch implementation (for tests). Defaults to globalThis.fetch. */
|
|
69
63
|
fetch?: typeof globalThis.fetch;
|
|
70
|
-
/** Optional logger. Defaults to no-op. */
|
|
71
64
|
logger?: Logger;
|
|
72
|
-
/** Per-attempt upstream request timeout in ms. Default 30_000 (30s). */
|
|
73
65
|
upstreamTimeoutMs?: number;
|
|
74
|
-
/** Optional override for idempotency key generation. Defaults to crypto.randomUUID(). */
|
|
75
66
|
idempotencyKeyFactory?: () => string;
|
|
76
67
|
}
|
|
77
68
|
interface IdempotencyOptions {
|
|
78
69
|
idempotencyKey?: string;
|
|
79
70
|
}
|
|
71
|
+
type CreateCustomerWithBankDetailsInput = {
|
|
72
|
+
readonly customer: CreateCustomerInput;
|
|
73
|
+
readonly bankDetails: BankDetailsRequest;
|
|
74
|
+
};
|
|
75
|
+
type CreateCustomerWithBankDetailsResponse = {
|
|
76
|
+
readonly customer: CustomerCreateResponse;
|
|
77
|
+
readonly bankDetails: BankDetailsResponse;
|
|
78
|
+
};
|
|
80
79
|
interface SessionsListQuery {
|
|
81
80
|
email?: string;
|
|
82
81
|
postcode?: string;
|
|
@@ -106,6 +105,7 @@ interface LoaQuery {
|
|
|
106
105
|
interface PropertyQuery {
|
|
107
106
|
force_refresh?: boolean;
|
|
108
107
|
}
|
|
108
|
+
|
|
109
109
|
declare class HelloBillPartner {
|
|
110
110
|
private readonly tokenManager;
|
|
111
111
|
private readonly apiBaseUrl;
|
|
@@ -129,6 +129,12 @@ declare class HelloBillPartner {
|
|
|
129
129
|
submit: (sessionId: string, payload: BankDetailsRequest, opts?: IdempotencyOptions) => Promise<BankDetailsResponse>;
|
|
130
130
|
get: (sessionId: string) => Promise<BankDetailsResponse>;
|
|
131
131
|
};
|
|
132
|
+
/**
|
|
133
|
+
* Creates a customer, then submits bank details for the same session.
|
|
134
|
+
* Pass opts.idempotencyKey for stable, resumable retries across both POSTs.
|
|
135
|
+
* Without one, each underlying POST uses the configured idempotency key factory.
|
|
136
|
+
*/
|
|
137
|
+
readonly createCustomerWithBankDetails: (sessionId: string, input: CreateCustomerWithBankDetailsInput, opts?: IdempotencyOptions) => Promise<CreateCustomerWithBankDetailsResponse>;
|
|
132
138
|
constructor(opts: HelloBillPartnerOptions);
|
|
133
139
|
/**
|
|
134
140
|
* Shared transport envelope: acquires a token, builds the request,
|
|
@@ -161,4 +167,4 @@ declare class HelloBillPartner {
|
|
|
161
167
|
*/
|
|
162
168
|
declare function buildOnboardingInfo(_productId: string, category: string, location: string, fields: Record<string, unknown>): Record<string, unknown> | undefined;
|
|
163
169
|
|
|
164
|
-
export { BankDetailsRequest, BankDetailsResponse, CreateCustomerInput, CustomerCreateResponse, CustomerId, CustomerStatusResponse, ErrorEnvelope, HelloBillPartner, type HelloBillPartnerOptions, HellobillApiError, type IdempotencyOptions, LoaListResponse, type LoaQuery, Logger, ProductsQuery, ProductsResponse, PropertyDetailResponse, type PropertyQuery, RequestId, type RetryOptions, SessionGetResponse, SessionPayload, SessionResponse, type SessionsListQuery, type SessionsListResponse, TokenStorage, buildOnboardingInfo, defaultIdempotencyKey, retryFetch };
|
|
170
|
+
export { BankDetailsRequest, BankDetailsResponse, CreateCustomerInput, type CreateCustomerWithBankDetailsInput, type CreateCustomerWithBankDetailsResponse, CustomerCreateResponse, CustomerId, CustomerStatusResponse, ErrorEnvelope, HelloBillPartner, type HelloBillPartnerOptions, HellobillApiError, type IdempotencyOptions, LoaListResponse, type LoaQuery, Logger, ProductsQuery, ProductsResponse, PropertyDetailResponse, type PropertyQuery, RequestId, type RetryOptions, SessionGetResponse, SessionPayload, SessionResponse, type SessionsListQuery, type SessionsListResponse, TokenStorage, buildOnboardingInfo, defaultIdempotencyKey, retryFetch };
|
package/dist/index.js
CHANGED
|
@@ -1027,6 +1027,12 @@ var HelloBillPartner = class {
|
|
|
1027
1027
|
sessions;
|
|
1028
1028
|
customers;
|
|
1029
1029
|
bankDetails;
|
|
1030
|
+
/**
|
|
1031
|
+
* Creates a customer, then submits bank details for the same session.
|
|
1032
|
+
* Pass opts.idempotencyKey for stable, resumable retries across both POSTs.
|
|
1033
|
+
* Without one, each underlying POST uses the configured idempotency key factory.
|
|
1034
|
+
*/
|
|
1035
|
+
createCustomerWithBankDetails;
|
|
1030
1036
|
constructor(opts) {
|
|
1031
1037
|
this.apiBaseUrl = (opts.apiBaseUrl ?? DEFAULT_API_BASE_URL).replace(/\/$/, "");
|
|
1032
1038
|
this.fetchImpl = opts.fetch ?? globalThis.fetch;
|
|
@@ -1102,6 +1108,11 @@ var HelloBillPartner = class {
|
|
|
1102
1108
|
path: `/partner/sessions/${encodeURIComponent(sessionId)}/bank-details`
|
|
1103
1109
|
})
|
|
1104
1110
|
};
|
|
1111
|
+
this.createCustomerWithBankDetails = async (sessionId, input, callOpts) => {
|
|
1112
|
+
const customer = await this.sessions.customers(sessionId, input.customer, callOpts);
|
|
1113
|
+
const bankDetails = await this.bankDetails.submit(sessionId, input.bankDetails, callOpts);
|
|
1114
|
+
return { customer, bankDetails };
|
|
1115
|
+
};
|
|
1105
1116
|
}
|
|
1106
1117
|
/**
|
|
1107
1118
|
* Shared transport envelope: acquires a token, builds the request,
|