From 6d2953bc206fcd637ff3b35e12d43e6ee86171d6 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Fri, 30 May 2025 20:48:03 +0200 Subject: [PATCH] feat: pass satellite params instead of env --- src/services/deploy/deploy.execute.services.ts | 7 ++----- src/services/deploy/deploy.list.services.ts | 11 +++++------ src/utils/satellite.utils.ts | 2 +- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/services/deploy/deploy.execute.services.ts b/src/services/deploy/deploy.execute.services.ts index 6b36de40..c1bdbd40 100644 --- a/src/services/deploy/deploy.execute.services.ts +++ b/src/services/deploy/deploy.execute.services.ts @@ -24,15 +24,12 @@ export const executeDeploy = async ({ await assertSatelliteMemorySize(args); }; - const {satellite, env, satelliteConfig} = await assertConfigAndLoadSatelliteContext(args); + const {satellite, satelliteConfig} = await assertConfigAndLoadSatelliteContext(args); const listExistingAssets = async ({startAfter}: {startAfter?: string}): Promise => await listAssets({ startAfter, - env: { - env, - satellite: satelliteConfig - } + satellite }); const uploadFile = async ({ diff --git a/src/services/deploy/deploy.list.services.ts b/src/services/deploy/deploy.list.services.ts index ebdced2e..6bc2c01d 100644 --- a/src/services/deploy/deploy.list.services.ts +++ b/src/services/deploy/deploy.list.services.ts @@ -2,19 +2,18 @@ import type {Asset} from '@junobuild/core'; import {listAssets as listAssetsLib} from '@junobuild/core'; import {DAPP_COLLECTION} from '../../constants/constants'; import {DEPLOY_LIST_ASSETS_PAGINATION} from '../../constants/deploy.constants'; -import type {SatelliteConfigEnv} from '../../types/config'; -import {satelliteParameters} from '../../utils/satellite.utils'; +import type {SatelliteParametersWithId} from '../../types/satellite'; export const listAssets = async ({ startAfter, - env + satellite }: { startAfter?: string; - env: SatelliteConfigEnv; + satellite: SatelliteParametersWithId; }): Promise => { const {assets, items_page, matches_pages} = await listAssetsLib({ collection: DAPP_COLLECTION, - satellite: await satelliteParameters(env), + satellite, filter: { order: { desc: true, @@ -35,7 +34,7 @@ export const listAssets = async ({ if ((items_page ?? 0n) < (matches_pages ?? 0n)) { const nextAssets = await listAssets({ startAfter: last(assets)?.fullPath, - env + satellite }); return [...assets, ...nextAssets]; } diff --git a/src/utils/satellite.utils.ts b/src/utils/satellite.utils.ts index aef73adc..d7dc040c 100644 --- a/src/utils/satellite.utils.ts +++ b/src/utils/satellite.utils.ts @@ -33,7 +33,7 @@ export const assertConfigAndLoadSatelliteContext = async ( return {satellite, satelliteConfig, env}; }; -export const satelliteParameters = async ({ +const satelliteParameters = async ({ satellite: {satelliteId: deprecatedSatelliteId, id, ids}, env: {mode} }: SatelliteConfigEnv): Promise => {