@junobuild/admin 0.0.58-next-2024-11-25.2 → 0.0.58-next-2024-11-26
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/dist/browser/index.js +6 -6
- package/dist/browser/index.js.map +4 -4
- package/dist/node/index.mjs +7 -7
- package/dist/node/index.mjs.map +4 -4
- package/dist/types/api/ic.api.d.ts +8 -0
- package/dist/types/handlers/upgrade.handlers.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/services/mission-control.upgrade.services.d.ts +10 -10
- package/dist/types/services/orbiter.upgrade.services.d.ts +11 -13
- package/dist/types/services/satellite.upgrade.services.d.ts +14 -15
- package/dist/types/types/upgrade.types.d.ts +7 -0
- package/package.json +1 -1
|
@@ -3,6 +3,14 @@ import { type chunk_hash, type InstallChunkedCodeParams, type UploadChunkParams,
|
|
|
3
3
|
import type { CanisterStatusResponse } from '@dfinity/ic-management/dist/types/types/ic-management.responses';
|
|
4
4
|
import { Principal } from '@dfinity/principal';
|
|
5
5
|
import type { ActorParameters } from '../types/actor.types';
|
|
6
|
+
export declare const canisterStop: ({ canisterId, actor }: {
|
|
7
|
+
canisterId: Principal;
|
|
8
|
+
actor: ActorParameters;
|
|
9
|
+
}) => Promise<void>;
|
|
10
|
+
export declare const canisterStart: ({ canisterId, actor }: {
|
|
11
|
+
canisterId: Principal;
|
|
12
|
+
actor: ActorParameters;
|
|
13
|
+
}) => Promise<void>;
|
|
6
14
|
export declare const installCode: ({ actor, code }: {
|
|
7
15
|
actor: ActorParameters;
|
|
8
16
|
code: InstallCodeParams;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { UpgradeCodeParams } from '../types/upgrade.types';
|
|
2
|
-
export declare const upgrade: ({ wasmModule, ...rest }: UpgradeCodeParams) => Promise<void>;
|
|
2
|
+
export declare const upgrade: ({ wasmModule, canisterId, actor, onProgress, ...rest }: UpgradeCodeParams) => Promise<void>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -21,5 +21,5 @@ export type * from './types/build.types';
|
|
|
21
21
|
export type * from './types/controllers.types';
|
|
22
22
|
export type * from './types/customdomain.types';
|
|
23
23
|
export type * from './types/releases.types';
|
|
24
|
-
export
|
|
24
|
+
export * from './types/upgrade.types';
|
|
25
25
|
export * from './utils/crypto.utils';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { MissionControlParameters } from '../types/actor.types';
|
|
2
|
+
import { UpgradeCodeParams } from '../types/upgrade.types';
|
|
2
3
|
/**
|
|
3
4
|
* Upgrades the Mission Control with the provided WASM module.
|
|
4
|
-
* @param {Object} params - The parameters for upgrading Mission Control.
|
|
5
|
-
* @param {MissionControlParameters} params.missionControl - The Mission Control parameters.
|
|
6
|
-
* @param {Uint8Array} params.
|
|
7
|
-
* @param {boolean} [params.preClearChunks] -
|
|
8
|
-
* @
|
|
9
|
-
* @
|
|
5
|
+
* @param {Object} params - The parameters for upgrading the Mission Control.
|
|
6
|
+
* @param {MissionControlParameters} params.missionControl - The Mission Control parameters, including the actor and mission control ID.
|
|
7
|
+
* @param {Uint8Array} params.wasmModule - The WASM module to be installed during the upgrade.
|
|
8
|
+
* @param {boolean} [params.preClearChunks] - Optional. Whether to force clearing chunks before uploading a chunked WASM module. Recommended if the WASM exceeds 2MB.
|
|
9
|
+
* @param {function} [params.onProgress] - Optional. Callback function to report progress during the upgrade process.
|
|
10
|
+
* @throws {Error} Will throw an error if the mission control principal is not defined.
|
|
11
|
+
* @returns {Promise<void>} Resolves when the upgrade process is complete.
|
|
10
12
|
*/
|
|
11
|
-
export declare const upgradeMissionControl: ({ missionControl,
|
|
13
|
+
export declare const upgradeMissionControl: ({ missionControl, ...rest }: {
|
|
12
14
|
missionControl: MissionControlParameters;
|
|
13
|
-
|
|
14
|
-
preClearChunks?: boolean;
|
|
15
|
-
}) => Promise<void>;
|
|
15
|
+
} & Pick<UpgradeCodeParams, "wasmModule" | "preClearChunks" | "onProgress">) => Promise<void>;
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import { Principal } from '@dfinity/principal';
|
|
2
1
|
import type { OrbiterParameters } from '../types/actor.types';
|
|
2
|
+
import { UpgradeCodeParams } from '../types/upgrade.types';
|
|
3
3
|
/**
|
|
4
4
|
* Upgrades the Orbiter with the provided WASM module.
|
|
5
5
|
* @param {Object} params - The parameters for upgrading the Orbiter.
|
|
6
|
-
* @param {OrbiterParameters} params.orbiter - The Orbiter parameters.
|
|
7
|
-
* @param {Principal} [params.missionControlId] - The
|
|
8
|
-
* @param {Uint8Array} params.
|
|
9
|
-
* @param {boolean} [params.reset=false] -
|
|
10
|
-
* @param {boolean} [params.preClearChunks] -
|
|
11
|
-
* @
|
|
12
|
-
* @
|
|
6
|
+
* @param {OrbiterParameters} params.orbiter - The Orbiter parameters, including the actor and orbiter ID.
|
|
7
|
+
* @param {Principal} [params.missionControlId] - Optional. The Mission Control ID to potentially store WASM chunks, enabling reuse across installations.
|
|
8
|
+
* @param {Uint8Array} params.wasmModule - The WASM module to be installed during the upgrade.
|
|
9
|
+
* @param {boolean} [params.reset=false] - Optional. Indicates whether to reset the Orbiter (reinstall) instead of performing an upgrade. Defaults to `false`.
|
|
10
|
+
* @param {boolean} [params.preClearChunks] - Optional. Forces clearing existing chunks before uploading a chunked WASM module. Recommended if the WASM exceeds 2MB.
|
|
11
|
+
* @param {function} [params.onProgress] - Optional. Callback function to track progress during the upgrade process.
|
|
12
|
+
* @throws {Error} Will throw an error if the Orbiter principal is not defined.
|
|
13
|
+
* @returns {Promise<void>} Resolves when the upgrade process is complete.
|
|
13
14
|
*/
|
|
14
|
-
export declare const upgradeOrbiter: ({ orbiter,
|
|
15
|
+
export declare const upgradeOrbiter: ({ orbiter, reset, ...rest }: {
|
|
15
16
|
orbiter: OrbiterParameters;
|
|
16
|
-
missionControlId?: Principal;
|
|
17
|
-
wasmModule: Uint8Array;
|
|
18
17
|
reset?: boolean;
|
|
19
|
-
|
|
20
|
-
}) => Promise<void>;
|
|
18
|
+
} & Pick<UpgradeCodeParams, "wasmModule" | "missionControlId" | "preClearChunks" | "onProgress">) => Promise<void>;
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { Principal } from '@dfinity/principal';
|
|
2
1
|
import type { SatelliteParameters } from '../types/actor.types';
|
|
2
|
+
import { UpgradeCodeParams } from '../types/upgrade.types';
|
|
3
3
|
/**
|
|
4
|
-
* Upgrades
|
|
4
|
+
* Upgrades a satellite with the provided WASM module.
|
|
5
5
|
* @param {Object} params - The parameters for upgrading the satellite.
|
|
6
|
-
* @param {SatelliteParameters} params.satellite - The satellite parameters.
|
|
7
|
-
* @param {Principal} [params.missionControlId] - The
|
|
8
|
-
* @param {Uint8Array} params.
|
|
9
|
-
* @param {boolean} params.deprecated -
|
|
10
|
-
* @param {boolean} params.deprecatedNoScope -
|
|
11
|
-
* @param {boolean} [params.reset=false] -
|
|
12
|
-
* @param {boolean} [params.preClearChunks] -
|
|
13
|
-
* @
|
|
6
|
+
* @param {SatelliteParameters} params.satellite - The satellite parameters, including the actor and satellite ID.
|
|
7
|
+
* @param {Principal} [params.missionControlId] - Optional. The Mission Control ID to potentially store WASM chunks, enabling reuse across installations.
|
|
8
|
+
* @param {Uint8Array} params.wasmModule - The WASM module to be installed during the upgrade.
|
|
9
|
+
* @param {boolean} params.deprecated - Indicates whether the upgrade is deprecated.
|
|
10
|
+
* @param {boolean} params.deprecatedNoScope - Indicates whether the upgrade is deprecated and has no scope.
|
|
11
|
+
* @param {boolean} [params.reset=false] - Optional. Specifies whether to reset the satellite (reinstall) instead of performing an upgrade. Defaults to `false`.
|
|
12
|
+
* @param {boolean} [params.preClearChunks] - Optional. Forces clearing existing chunks before uploading a chunked WASM module. Recommended if the WASM exceeds 2MB.
|
|
13
|
+
* @param {function} [params.onProgress] - Optional. Callback function to track progress during the upgrade process.
|
|
14
|
+
* @throws {Error} Will throw an error if the satellite parameters are invalid or missing required fields.
|
|
15
|
+
* @returns {Promise<void>} Resolves when the upgrade process is complete.
|
|
14
16
|
*/
|
|
15
|
-
export declare const upgradeSatellite: ({ satellite,
|
|
17
|
+
export declare const upgradeSatellite: ({ satellite, deprecated, deprecatedNoScope, reset, ...rest }: {
|
|
16
18
|
satellite: SatelliteParameters;
|
|
17
|
-
missionControlId?: Principal;
|
|
18
|
-
wasmModule: Uint8Array;
|
|
19
19
|
deprecated: boolean;
|
|
20
20
|
deprecatedNoScope: boolean;
|
|
21
21
|
reset?: boolean;
|
|
22
|
-
|
|
23
|
-
}) => Promise<void>;
|
|
22
|
+
} & Pick<UpgradeCodeParams, "wasmModule" | "missionControlId" | "preClearChunks" | "onProgress">) => Promise<void>;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { canister_install_mode } from '@dfinity/ic-management';
|
|
2
2
|
import { Principal } from '@dfinity/principal';
|
|
3
3
|
import { ActorParameters } from './actor.types';
|
|
4
|
+
export declare enum UpgradeCodeProgress {
|
|
5
|
+
AssertingExistingCode = 0,
|
|
6
|
+
StoppingCanister = 1,
|
|
7
|
+
UpgradingCode = 2,
|
|
8
|
+
RestartingCanister = 3
|
|
9
|
+
}
|
|
4
10
|
export interface UpgradeCodeParams {
|
|
5
11
|
actor: ActorParameters;
|
|
6
12
|
canisterId: Principal;
|
|
@@ -9,4 +15,5 @@ export interface UpgradeCodeParams {
|
|
|
9
15
|
arg: Uint8Array;
|
|
10
16
|
mode: canister_install_mode;
|
|
11
17
|
preClearChunks?: boolean;
|
|
18
|
+
onProgress?: (progress: UpgradeCodeProgress) => void;
|
|
12
19
|
}
|
package/package.json
CHANGED