diff --git a/packages/upload-api/src/types.ts b/packages/upload-api/src/types.ts index b7ec08ba2..38b8bb582 100644 --- a/packages/upload-api/src/types.ts +++ b/packages/upload-api/src/types.ts @@ -156,7 +156,7 @@ export type { RateLimitsStorage, RateLimit } from './types/rate-limits.js' import { PlansStorage } from './types/plans.js' export type { PlansStorage } from './types/plans.js' import { SubscriptionsStorage } from './types/subscriptions.js' -export type { SubscriptionsStorage } from './types/subscriptions.js' +export type { SubscriptionsStorage } export interface Service extends StorefrontService { store: { diff --git a/packages/upload-api/src/types/subscriptions.ts b/packages/upload-api/src/types/subscriptions.ts index 9804a07b2..e35d437c2 100644 --- a/packages/upload-api/src/types/subscriptions.ts +++ b/packages/upload-api/src/types/subscriptions.ts @@ -7,6 +7,6 @@ import { export interface SubscriptionsStorage { list: ( - account: AccountDID + customer: AccountDID ) => Promise> } diff --git a/packages/upload-api/test/storage/subscriptions-storage.js b/packages/upload-api/test/storage/subscriptions-storage.js index f4d9786f2..39798a57a 100644 --- a/packages/upload-api/test/storage/subscriptions-storage.js +++ b/packages/upload-api/test/storage/subscriptions-storage.js @@ -11,17 +11,17 @@ export class SubscriptionsStorage { this.provisionsStore = provisions } - /** @param {import('../types.js').AccountDID} account */ - async list(account) { + /** @param {import('../types.js').AccountDID} customer */ + async list(customer) { /** @type {import('../types.js').SubscriptionListItem[]} */ const results = [] const entries = Object.entries(this.provisionsStore.provisions) - for (const [subscription, { customer, provider, consumer }] of entries) { - if (customer !== account) continue + for (const [subscription, provision] of entries) { + if (provision.customer !== customer) continue results.push({ subscription, - provider, - consumers: [consumer] + provider: provision.provider, + consumers: [provision.consumer] }) } return { ok: { results } }