@junobuild/admin 0.0.60 → 0.0.61

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.
@@ -1,5 +1,6 @@
1
1
  import { CanisterStatus } from '@dfinity/agent';
2
- import { type chunk_hash, type InstallChunkedCodeParams, type UploadChunkParams, InstallCodeParams } from '@dfinity/ic-management';
2
+ import { type chunk_hash, type InstallChunkedCodeParams, type UploadChunkParams, InstallCodeParams, list_canister_snapshots_result, snapshot_id } from '@dfinity/ic-management';
3
+ import type { take_canister_snapshot_result } from '@dfinity/ic-management/dist/candid/ic-management';
3
4
  import type { CanisterStatusResponse } from '@dfinity/ic-management/dist/types/types/ic-management.responses';
4
5
  import { Principal } from '@dfinity/principal';
5
6
  import type { ActorParameters } from '../types/actor.types';
@@ -39,3 +40,12 @@ export declare const canisterMetadata: ({ canisterId, path, ...rest }: ActorPara
39
40
  canisterId: string | undefined;
40
41
  path: string;
41
42
  }) => Promise<CanisterStatus.Status | undefined>;
43
+ export declare const listCanisterSnapshots: ({ actor, canisterId }: {
44
+ actor: ActorParameters;
45
+ canisterId: Principal;
46
+ }) => Promise<list_canister_snapshots_result>;
47
+ export declare const takeCanisterSnapshot: ({ actor, ...rest }: {
48
+ actor: ActorParameters;
49
+ canisterId: Principal;
50
+ snapshotId?: snapshot_id;
51
+ }) => Promise<take_canister_snapshot_result>;
@@ -1,4 +1,4 @@
1
1
  import { UpgradeCodeParams } from '../types/upgrade.types';
2
- export declare const upgrade: ({ wasmModule, canisterId, actor, onProgress, ...rest }: UpgradeCodeParams & {
2
+ export declare const upgrade: ({ wasmModule, canisterId, actor, onProgress, takeSnapshot, ...rest }: UpgradeCodeParams & {
3
3
  reset?: boolean;
4
4
  }) => Promise<void>;
@@ -6,10 +6,11 @@ import { UpgradeCodeParams } from '../types/upgrade.types';
6
6
  * @param {MissionControlParameters} params.missionControl - The Mission Control parameters, including the actor and mission control ID.
7
7
  * @param {Uint8Array} params.wasmModule - The WASM module to be installed during the upgrade.
8
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 {boolean} [params.takeSnapshot=true] - Optional. Whether to take a snapshot before performing the upgrade. Defaults to true.
9
10
  * @param {function} [params.onProgress] - Optional. Callback function to report progress during the upgrade process.
10
11
  * @throws {Error} Will throw an error if the mission control principal is not defined.
11
12
  * @returns {Promise<void>} Resolves when the upgrade process is complete.
12
13
  */
13
14
  export declare const upgradeMissionControl: ({ missionControl, ...rest }: {
14
15
  missionControl: MissionControlParameters;
15
- } & Pick<UpgradeCodeParams, "wasmModule" | "preClearChunks" | "onProgress">) => Promise<void>;
16
+ } & Pick<UpgradeCodeParams, "wasmModule" | "preClearChunks" | "takeSnapshot" | "onProgress">) => Promise<void>;
@@ -8,6 +8,7 @@ import { UpgradeCodeParams } from '../types/upgrade.types';
8
8
  * @param {Uint8Array} params.wasmModule - The WASM module to be installed during the upgrade.
9
9
  * @param {boolean} [params.reset=false] - Optional. Indicates whether to reset the Orbiter (reinstall) instead of performing an upgrade. Defaults to `false`.
10
10
  * @param {boolean} [params.preClearChunks] - Optional. Forces clearing existing chunks before uploading a chunked WASM module. Recommended if the WASM exceeds 2MB.
11
+ * @param {boolean} [params.takeSnapshot=true] - Optional. Whether to take a snapshot before performing the upgrade. Defaults to true.
11
12
  * @param {function} [params.onProgress] - Optional. Callback function to track progress during the upgrade process.
12
13
  * @throws {Error} Will throw an error if the Orbiter principal is not defined.
13
14
  * @returns {Promise<void>} Resolves when the upgrade process is complete.
@@ -15,4 +16,4 @@ import { UpgradeCodeParams } from '../types/upgrade.types';
15
16
  export declare const upgradeOrbiter: ({ orbiter, reset, ...rest }: {
16
17
  orbiter: OrbiterParameters;
17
18
  reset?: boolean;
18
- } & Pick<UpgradeCodeParams, "wasmModule" | "missionControlId" | "preClearChunks" | "onProgress">) => Promise<void>;
19
+ } & Pick<UpgradeCodeParams, "wasmModule" | "missionControlId" | "preClearChunks" | "takeSnapshot" | "onProgress">) => Promise<void>;
@@ -10,6 +10,7 @@ import { UpgradeCodeParams } from '../types/upgrade.types';
10
10
  * @param {boolean} params.deprecatedNoScope - Indicates whether the upgrade is deprecated and has no scope.
11
11
  * @param {boolean} [params.reset=false] - Optional. Specifies whether to reset the satellite (reinstall) instead of performing an upgrade. Defaults to `false`.
12
12
  * @param {boolean} [params.preClearChunks] - Optional. Forces clearing existing chunks before uploading a chunked WASM module. Recommended if the WASM exceeds 2MB.
13
+ * @param {boolean} [params.takeSnapshot=true] - Optional. Whether to take a snapshot before performing the upgrade. Defaults to true.
13
14
  * @param {function} [params.onProgress] - Optional. Callback function to track progress during the upgrade process.
14
15
  * @throws {Error} Will throw an error if the satellite parameters are invalid or missing required fields.
15
16
  * @returns {Promise<void>} Resolves when the upgrade process is complete.
@@ -19,4 +20,4 @@ export declare const upgradeSatellite: ({ satellite, deprecated, deprecatedNoSco
19
20
  deprecated: boolean;
20
21
  deprecatedNoScope: boolean;
21
22
  reset?: boolean;
22
- } & Pick<UpgradeCodeParams, "wasmModule" | "missionControlId" | "preClearChunks" | "onProgress">) => Promise<void>;
23
+ } & Pick<UpgradeCodeParams, "wasmModule" | "missionControlId" | "preClearChunks" | "takeSnapshot" | "onProgress">) => Promise<void>;
@@ -4,8 +4,9 @@ import { ActorParameters } from './actor.types';
4
4
  export declare enum UpgradeCodeProgressStep {
5
5
  AssertingExistingCode = 0,
6
6
  StoppingCanister = 1,
7
- UpgradingCode = 2,
8
- RestartingCanister = 3
7
+ TakingSnapshot = 2,
8
+ UpgradingCode = 3,
9
+ RestartingCanister = 4
9
10
  }
10
11
  export type UpgradeCodeProgressState = 'in_progress' | 'success' | 'error';
11
12
  export interface UpgradeCodeProgress {
@@ -20,5 +21,6 @@ export interface UpgradeCodeParams {
20
21
  arg: Uint8Array;
21
22
  mode: canister_install_mode;
22
23
  preClearChunks?: boolean;
24
+ takeSnapshot?: boolean;
23
25
  onProgress?: (progress: UpgradeCodeProgress) => void;
24
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@junobuild/admin",
3
- "version": "0.0.60",
3
+ "version": "0.0.61",
4
4
  "description": "A library for interfacing with admin features of Juno",
5
5
  "author": "David Dal Busco (https://daviddalbusco.com)",
6
6
  "license": "MIT",