Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/services/deploy/deploy.execute.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Asset[]> =>
await listAssets({
startAfter,
env: {
env,
satellite: satelliteConfig
}
satellite
});

const uploadFile = async ({
Expand Down
11 changes: 5 additions & 6 deletions src/services/deploy/deploy.list.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Asset[]> => {
const {assets, items_page, matches_pages} = await listAssetsLib({
collection: DAPP_COLLECTION,
satellite: await satelliteParameters(env),
satellite,
filter: {
order: {
desc: true,
Expand All @@ -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];
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/satellite.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<SatelliteParametersWithId> => {
Expand Down