Skip to content

Commit e75deaf

Browse files
build: bump Juno and DFINTIY libs including ic-mgmt naming and types breaking changes (#438)
Signed-off-by: David Dal Busco <[email protected]>
1 parent 3cf4649 commit e75deaf

File tree

8 files changed

+161
-328
lines changed

8 files changed

+161
-328
lines changed

package-lock.json

Lines changed: 120 additions & 284 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@
2929
"e2e:playwright:install": "playwright install chromium --with-deps"
3030
},
3131
"dependencies": {
32-
"@dfinity/utils": "^4.0.1",
33-
"@dfinity/zod-schemas": "^3.0.1",
34-
"@icp-sdk/canisters": "^2.0.1",
32+
"@dfinity/utils": "^4.0.2",
33+
"@dfinity/zod-schemas": "^3.0.2",
34+
"@icp-sdk/canisters": "^3.0.0",
3535
"@icp-sdk/core": "^4.2.3",
36-
"@junobuild/admin": "^3.0.3",
37-
"@junobuild/cdn": "^2.0.3",
36+
"@junobuild/admin": "^3.1.0",
37+
"@junobuild/cdn": "^2.1.0",
3838
"@junobuild/cli-tools": "^0.9.4",
3939
"@junobuild/config": "^2.7.0",
4040
"@junobuild/config-loader": "^0.4.6",
41-
"@junobuild/core": "^3.3.0",
41+
"@junobuild/core": "^3.3.1",
4242
"@junobuild/did-tools": "^0.3.6",
43-
"@junobuild/ic-client": "^6.0.0",
44-
"@junobuild/storage": "^2.1.0",
43+
"@junobuild/ic-client": "^7.0.0",
44+
"@junobuild/storage": "^2.1.1",
4545
"@junobuild/utils": "^0.2.3",
4646
"chokidar": "^4.0.3",
4747
"conf": "^14.0.0",

src/api/ic.api.ts

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import {
2-
ICManagementCanister,
3-
type list_canister_snapshots_result,
4-
type read_canister_snapshot_data_response,
2+
IcManagementCanister,
3+
type IcManagementDid,
54
type ReadCanisterSnapshotMetadataParams,
65
type ReadCanisterSnapshotMetadataResponse,
7-
type snapshot_id,
86
type SnapshotParams,
9-
type upload_canister_snapshot_metadata_response,
107
type UploadCanisterSnapshotDataParams,
118
type UploadCanisterSnapshotMetadataParams
129
} from '@icp-sdk/canisters/ic-management';
@@ -16,7 +13,7 @@ import {initAgent} from './agent.api';
1613
export const canisterStop = async ({canisterId}: {canisterId: Principal}): Promise<void> => {
1714
const agent = await initAgent();
1815

19-
const {stopCanister} = ICManagementCanister.create({
16+
const {stopCanister} = IcManagementCanister.create({
2017
agent
2118
});
2219

@@ -26,7 +23,7 @@ export const canisterStop = async ({canisterId}: {canisterId: Principal}): Promi
2623
export const canisterStart = async ({canisterId}: {canisterId: Principal}): Promise<void> => {
2724
const agent = await initAgent();
2825

29-
const {startCanister} = ICManagementCanister.create({
26+
const {startCanister} = IcManagementCanister.create({
3027
agent
3128
});
3229

@@ -35,11 +32,11 @@ export const canisterStart = async ({canisterId}: {canisterId: Principal}): Prom
3532

3633
export const takeCanisterSnapshot = async (params: {
3734
canisterId: Principal;
38-
snapshotId?: snapshot_id;
35+
snapshotId?: IcManagementDid.snapshot_id;
3936
}): Promise<void> => {
4037
const agent = await initAgent();
4138

42-
const {takeCanisterSnapshot} = ICManagementCanister.create({
39+
const {takeCanisterSnapshot} = IcManagementCanister.create({
4340
agent
4441
});
4542

@@ -48,10 +45,10 @@ export const takeCanisterSnapshot = async (params: {
4845

4946
export const listCanisterSnapshots = async (params: {
5047
canisterId: Principal;
51-
}): Promise<list_canister_snapshots_result> => {
48+
}): Promise<IcManagementDid.list_canister_snapshots_result> => {
5249
const agent = await initAgent();
5350

54-
const {listCanisterSnapshots} = ICManagementCanister.create({
51+
const {listCanisterSnapshots} = IcManagementCanister.create({
5552
agent
5653
});
5754

@@ -60,11 +57,11 @@ export const listCanisterSnapshots = async (params: {
6057

6158
export const loadCanisterSnapshot = async (params: {
6259
canisterId: Principal;
63-
snapshotId: snapshot_id;
60+
snapshotId: IcManagementDid.snapshot_id;
6461
}): Promise<void> => {
6562
const agent = await initAgent();
6663

67-
const {loadCanisterSnapshot} = ICManagementCanister.create({
64+
const {loadCanisterSnapshot} = IcManagementCanister.create({
6865
agent
6966
});
7067

@@ -73,11 +70,11 @@ export const loadCanisterSnapshot = async (params: {
7370

7471
export const deleteCanisterSnapshot = async (params: {
7572
canisterId: Principal;
76-
snapshotId: snapshot_id;
73+
snapshotId: IcManagementDid.snapshot_id;
7774
}): Promise<void> => {
7875
const agent = await initAgent();
7976

80-
const {deleteCanisterSnapshot} = ICManagementCanister.create({
77+
const {deleteCanisterSnapshot} = IcManagementCanister.create({
8178
agent
8279
});
8380

@@ -89,7 +86,7 @@ export const readCanisterSnapshotMetadata = async (
8986
): Promise<ReadCanisterSnapshotMetadataResponse> => {
9087
const agent = await initAgent();
9188

92-
const {readCanisterSnapshotMetadata} = ICManagementCanister.create({
89+
const {readCanisterSnapshotMetadata} = IcManagementCanister.create({
9390
agent
9491
});
9592

@@ -98,10 +95,10 @@ export const readCanisterSnapshotMetadata = async (
9895

9996
export const readCanisterSnapshotData = async (
10097
params: ReadCanisterSnapshotMetadataParams
101-
): Promise<read_canister_snapshot_data_response> => {
98+
): Promise<IcManagementDid.read_canister_snapshot_data_response> => {
10299
const agent = await initAgent();
103100

104-
const {readCanisterSnapshotData} = ICManagementCanister.create({
101+
const {readCanisterSnapshotData} = IcManagementCanister.create({
105102
agent
106103
});
107104

@@ -110,10 +107,10 @@ export const readCanisterSnapshotData = async (
110107

111108
export const uploadCanisterSnapshotMetadata = async (
112109
params: UploadCanisterSnapshotMetadataParams
113-
): Promise<upload_canister_snapshot_metadata_response> => {
110+
): Promise<IcManagementDid.upload_canister_snapshot_metadata_response> => {
114111
const agent = await initAgent();
115112

116-
const {uploadCanisterSnapshotMetadata} = ICManagementCanister.create({
113+
const {uploadCanisterSnapshotMetadata} = IcManagementCanister.create({
117114
agent
118115
});
119116

@@ -125,7 +122,7 @@ export const uploadCanisterSnapshotData = async (
125122
): Promise<void> => {
126123
const agent = await initAgent();
127124

128-
const {uploadCanisterSnapshotData} = ICManagementCanister.create({
125+
const {uploadCanisterSnapshotData} = IcManagementCanister.create({
129126
agent
130127
});
131128

src/services/config/settings.services.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {isNullish} from '@dfinity/utils';
2-
import {ICManagementCanister, LogVisibility} from '@icp-sdk/canisters/ic-management';
2+
import {IcManagementCanister, LogVisibility} from '@icp-sdk/canisters/ic-management';
33
import {Principal} from '@icp-sdk/core/principal';
44
import type {ModuleSettings} from '@junobuild/config';
55
import {initAgent} from '../../api/agent.api';
@@ -14,7 +14,7 @@ export const getSettings = async ({
1414

1515
const agent = await initAgent();
1616

17-
const {canisterStatus} = ICManagementCanister.create({
17+
const {canisterStatus} = IcManagementCanister.create({
1818
agent
1919
});
2020

@@ -59,7 +59,7 @@ export const setSettings = async ({
5959

6060
const agent = await initAgent();
6161

62-
const {updateSettings} = ICManagementCanister.create({
62+
const {updateSettings} = IcManagementCanister.create({
6363
agent
6464
});
6565

src/services/modules/snapshot/_snapshot.loader.services.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {isNullish, nonNullish} from '@dfinity/utils';
2-
import type {snapshot_id} from '@icp-sdk/canisters/ic-management';
2+
import type {IcManagementDid} from '@icp-sdk/canisters/ic-management';
33
import {encodeSnapshotId} from '@icp-sdk/canisters/ic-management';
44
import {type Principal} from '@icp-sdk/core/principal';
55
import {red} from 'kleur';
@@ -13,7 +13,7 @@ const loadSnapshot = async ({
1313
canisterId
1414
}: {
1515
canisterId: Principal;
16-
}): Promise<snapshot_id | undefined> => {
16+
}): Promise<IcManagementDid.snapshot_id | undefined> => {
1717
const spinner = ora('Loading the existing snapshot...').start();
1818

1919
try {
@@ -33,7 +33,7 @@ export const loadSnapshotAndAssertExist = async ({
3333
}: {
3434
canisterId: Principal;
3535
segment: AssetKey;
36-
}): Promise<{result: 'ok'; snapshotId: snapshot_id} | {result: 'not_found'}> => {
36+
}): Promise<{result: 'ok'; snapshotId: IcManagementDid.snapshot_id} | {result: 'not_found'}> => {
3737
const existingSnapshotId = await loadSnapshot({canisterId});
3838

3939
if (isNullish(existingSnapshotId)) {
@@ -50,7 +50,7 @@ export const loadSnapshotAndAssertOverwrite = async ({
5050
}: {
5151
canisterId: Principal;
5252
segment: AssetKey;
53-
}): Promise<{snapshotId: snapshot_id | undefined}> => {
53+
}): Promise<{snapshotId: IcManagementDid.snapshot_id | undefined}> => {
5454
const existingSnapshotId = await loadSnapshot({canisterId});
5555

5656
if (nonNullish(existingSnapshotId)) {

src/services/modules/snapshot/snapshot.services.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {notEmptyString} from '@dfinity/utils';
2-
import type {snapshot_id} from '@icp-sdk/canisters/ic-management';
2+
import type {IcManagementDid} from '@icp-sdk/canisters/ic-management';
33
import {encodeSnapshotId} from '@icp-sdk/canisters/ic-management';
44
import {Principal} from '@icp-sdk/core/principal';
55
import {nextArg} from '@junobuild/cli-tools';
@@ -195,7 +195,7 @@ const restoreExistingSnapshot = async ({
195195
...rest
196196
}: {
197197
canisterId: Principal;
198-
snapshotId: snapshot_id;
198+
snapshotId: IcManagementDid.snapshot_id;
199199
segment: AssetKey;
200200
}): Promise<void> => {
201201
const spinner = ora('Restoring the snapshot...').start();
@@ -214,7 +214,7 @@ const deleteExistingSnapshot = async ({
214214
...rest
215215
}: {
216216
canisterId: Principal;
217-
snapshotId: snapshot_id;
217+
snapshotId: IcManagementDid.snapshot_id;
218218
segment: AssetKey;
219219
}): Promise<void> => {
220220
const spinner = ora('Deleting the snapshot...').start();
@@ -233,7 +233,7 @@ const takeSnapshot = async ({
233233
...rest
234234
}: {
235235
canisterId: Principal;
236-
snapshotId: snapshot_id | undefined;
236+
snapshotId: IcManagementDid.snapshot_id | undefined;
237237
segment: AssetKey;
238238
}): Promise<void> => {
239239
const spinner = ora('Creating a new snapshot...').start();

src/services/modules/snapshot/snapshot.upload.services.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {arrayBufferToUint8Array, isNullish, jsonReviver} from '@dfinity/utils';
22
import {
33
encodeSnapshotId,
4-
type snapshot_id,
4+
type IcManagementDid,
55
type UploadCanisterSnapshotDataKind
66
} from '@icp-sdk/canisters/ic-management';
77
import {lstatSync} from 'node:fs';
@@ -178,7 +178,7 @@ const uploadMetadata = async ({
178178
},
179179
...rest
180180
}: UploadSnapshotParams & {metadata: ReadCanisterSnapshotMetadataResponse} & SnapshotLog): Promise<{
181-
snapshotId: snapshot_id;
181+
snapshotId: IcManagementDid.snapshot_id;
182182
}> => {
183183
log('Uploading snapshot metadata...');
184184

src/types/snapshot.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {snapshot_id} from '@icp-sdk/canisters/ic-management';
1+
import type {IcManagementDid} from '@icp-sdk/canisters/ic-management';
22
import type {Principal} from '@icp-sdk/core/principal';
33
import type * as z from 'zod';
44
import {
@@ -17,7 +17,7 @@ export type ReadCanisterSnapshotMetadataResponse = z.infer<
1717

1818
export interface DownloadSnapshotParams {
1919
canisterId: Principal;
20-
snapshotId: snapshot_id;
20+
snapshotId: IcManagementDid.snapshot_id;
2121
}
2222

2323
export type UploadSnapshotParams = Omit<DownloadSnapshotParams, 'snapshotId'> &

0 commit comments

Comments
 (0)