@junobuild/admin 0.1.6 → 0.1.8-next-2025-04-06

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,5 @@
1
1
  import { CanisterStatus } from '@dfinity/agent';
2
- import { type chunk_hash, type InstallChunkedCodeParams, type UploadChunkParams, InstallCodeParams, list_canister_snapshots_result, snapshot_id } from '@dfinity/ic-management';
2
+ import { type chunk_hash, type InstallChunkedCodeParams, type InstallCodeParams, type list_canister_snapshots_result, type snapshot_id, type UploadChunkParams } from '@dfinity/ic-management';
3
3
  import type { take_canister_snapshot_result } from '@dfinity/ic-management/dist/candid/ic-management';
4
4
  import type { CanisterStatusResponse } from '@dfinity/ic-management/dist/types/types/ic-management.responses';
5
5
  import { Principal } from '@dfinity/principal';
@@ -37,7 +37,7 @@ export declare const canisterStatus: ({ actor, canisterId }: {
37
37
  canisterId: Principal;
38
38
  }) => Promise<CanisterStatusResponse>;
39
39
  export declare const canisterMetadata: ({ canisterId, path, ...rest }: ActorParameters & {
40
- canisterId: string | undefined;
40
+ canisterId: Principal | string | undefined;
41
41
  path: string;
42
42
  }) => Promise<CanisterStatus.Status | undefined>;
43
43
  export declare const listCanisterSnapshots: ({ actor, canisterId }: {
@@ -1,2 +1,2 @@
1
- import { UpgradeCodeParams } from '../types/upgrade.types';
1
+ import type { UpgradeCodeParams } from '../types/upgrade.types';
2
2
  export declare const upgradeChunkedCode: ({ actor, canisterId, missionControlId, wasmModule, preClearChunks: userPreClearChunks, ...rest }: UpgradeCodeParams) => Promise<void>;
@@ -1,4 +1,4 @@
1
- import { UpgradeCodeParams } from '../types/upgrade.types';
1
+ import { type UpgradeCodeParams } from '../types/upgrade.types';
2
2
  export declare const upgrade: ({ wasmModule, canisterId, actor, onProgress, takeSnapshot, ...rest }: UpgradeCodeParams & {
3
3
  reset?: boolean;
4
4
  }) => Promise<void>;
@@ -1,2 +1,2 @@
1
- import { UpgradeCodeParams } from '../types/upgrade.types';
1
+ import type { UpgradeCodeParams } from '../types/upgrade.types';
2
2
  export declare const upgradeSingleChunkCode: ({ actor, ...rest }: UpgradeCodeParams) => Promise<void>;
@@ -7,6 +7,7 @@ export * from './services/orbiter.controllers.services';
7
7
  export * from './services/orbiter.memory.services';
8
8
  export * from './services/orbiter.upgrade.services';
9
9
  export * from './services/orbiter.version.services';
10
+ export * from './services/package.services';
10
11
  export * from './services/releases.services';
11
12
  export * from './services/satellite.assets.services';
12
13
  export * from './services/satellite.config.services';
@@ -1,4 +1,4 @@
1
- import { Principal } from '@dfinity/principal';
1
+ import type { Principal } from '@dfinity/principal';
2
2
  import type { Controller } from '../../declarations/mission_control/mission_control.did';
3
3
  import type { MissionControlParameters } from '../types/actor.types';
4
4
  import type { SetControllerParams } from '../types/controllers.types';
@@ -1,5 +1,5 @@
1
1
  import type { MissionControlParameters } from '../types/actor.types';
2
- import { UpgradeCodeParams } from '../types/upgrade.types';
2
+ import type { UpgradeCodeParams } from '../types/upgrade.types';
3
3
  /**
4
4
  * Upgrades the Mission Control with the provided WASM module.
5
5
  * @param {Object} params - The parameters for upgrading the Mission Control.
@@ -1,4 +1,4 @@
1
- import { Principal } from '@dfinity/principal';
1
+ import type { Principal } from '@dfinity/principal';
2
2
  import type { Controller } from '../../declarations/mission_control/mission_control.did';
3
3
  import type { OrbiterParameters } from '../types/actor.types';
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import type { OrbiterParameters } from '../types/actor.types';
2
- import { UpgradeCodeParams } from '../types/upgrade.types';
2
+ import type { 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.
@@ -0,0 +1,60 @@
1
+ import type { Principal } from '@dfinity/principal';
2
+ import { type JunoPackage } from '@junobuild/config';
3
+ import type { ActorParameters } from '../types/actor.types';
4
+ /**
5
+ * Parameters required to retrieve a `juno:package` metadata section.
6
+ *
7
+ * @typedef {Object} GetJunoPackageParams
8
+ * @property {Principal | string} moduleId - The ID of the canister module (as a Principal or string).
9
+ * @property {ActorParameters} [ActorParameters] - Additional actor parameters for making the canister call.
10
+ */
11
+ export type GetJunoPackageParams = {
12
+ moduleId: Principal | string;
13
+ } & ActorParameters;
14
+ /**
15
+ * Get the `juno:package` metadata from the public custom section of a given module.
16
+ *
17
+ * @param {Object} params - The parameters to fetch the metadata.
18
+ * @param {Principal | string} params.moduleId - The canister ID (as a `Principal` or string) from which to retrieve the metadata.
19
+ * @param {ActorParameters} params - Additional actor parameters required for the call.
20
+ *
21
+ * @returns {Promise<JunoPackage | undefined>} A promise that resolves to the parsed `JunoPackage` metadata, or `undefined` if not found.
22
+ *
23
+ * @throws {ZodError} If the metadata exists but does not conform to the expected `JunoPackage` schema.
24
+ */
25
+ export declare const getJunoPackage: ({ moduleId, ...rest }: GetJunoPackageParams) => Promise<JunoPackage | undefined>;
26
+ /**
27
+ * Retrieves only the `version` field from the `juno:package` metadata.
28
+ *
29
+ * @param {GetJunoPackageParams} params - The parameters to fetch the package version.
30
+ *
31
+ * @returns {Promise<string | undefined>} A promise that resolves to the version string or `undefined` if not found.
32
+ *
33
+ * @throws {ZodError} If the metadata exists but does not conform to the expected `JunoPackage` schema.
34
+ */
35
+ export declare const getJunoPackageVersion: (params: GetJunoPackageParams) => Promise<JunoPackage["version"] | undefined>;
36
+ /**
37
+ * Retrieves the `dependencies` field from the `juno:package` metadata.
38
+ *
39
+ * @param {GetJunoPackageParams} params - The parameters to fetch the package metadata.
40
+ *
41
+ * @returns {Promise<JunoPackage['dependencies'] | undefined>} A promise that resolves to the dependencies object or `undefined` if not found.
42
+ *
43
+ * @throws {ZodError} If the metadata exists but does not conform to the expected `JunoPackage` schema.
44
+ */
45
+ export declare const getJunoPackageDependencies: (params: GetJunoPackageParams) => Promise<JunoPackage["dependencies"] | undefined>;
46
+ /**
47
+ * Finds a specific dependency entry by its ID from the `juno:package` metadata.
48
+ *
49
+ * @param {Object} params - The parameters to fetch and search within the dependencies.
50
+ * @param {string} params.dependencyId - The ID of the dependency to find (e.g., `@junobuild/satellite`).
51
+ * @param {Principal | string} params.moduleId - The canister ID (as a `Principal` or string).
52
+ * @param {ActorParameters} params - Additional actor parameters required for the metadata call.
53
+ *
54
+ * @returns {Promise<[string, string] | undefined>} A promise that resolves to the `[dependencyId, version]` tuple if found, or `undefined` otherwise.
55
+ *
56
+ * @throws {ZodError} If the metadata exists but does not conform to the expected `JunoPackage` schema.
57
+ */
58
+ export declare const findJunoPackageDependency: ({ dependencyId, ...params }: GetJunoPackageParams & {
59
+ dependencyId: string;
60
+ }) => Promise<[string, string] | undefined>;
@@ -1,4 +1,4 @@
1
- import { Principal } from '@dfinity/principal';
1
+ import type { Principal } from '@dfinity/principal';
2
2
  import type { Controller, SetControllersArgs } from '../../declarations/satellite/satellite.did';
3
3
  import type { SatelliteParameters } from '../types/actor.types';
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import type { SatelliteParameters } from '../types/actor.types';
2
- import { UpgradeCodeParams } from '../types/upgrade.types';
2
+ import type { UpgradeCodeParams } from '../types/upgrade.types';
3
3
  /**
4
4
  * Upgrades a satellite with the provided WASM module.
5
5
  * @param {Object} params - The parameters for upgrading the satellite.
@@ -1,6 +1,6 @@
1
1
  import type { canister_install_mode } from '@dfinity/ic-management';
2
- import { Principal } from '@dfinity/principal';
3
- import { ActorParameters } from './actor.types';
2
+ import type { Principal } from '@dfinity/principal';
3
+ import type { ActorParameters } from './actor.types';
4
4
  export declare enum UpgradeCodeProgressStep {
5
5
  AssertingExistingCode = 0,
6
6
  StoppingCanister = 1,
@@ -1,7 +1,7 @@
1
1
  import { HttpAgent, type ActorConfig, type ActorMethod, type ActorSubclass } from '@dfinity/agent';
2
2
  import type { IDL } from '@dfinity/candid';
3
3
  import type { ActorParameters } from '../types/actor.types';
4
- export declare const createActor: <T = Record<string, ActorMethod<unknown[], unknown>>>({ canisterId, idlFactory, config, ...rest }: {
4
+ export declare const createActor: <T = Record<string, ActorMethod>>({ canisterId, idlFactory, config, ...rest }: {
5
5
  idlFactory: IDL.InterfaceFactory;
6
6
  canisterId: string;
7
7
  config?: Pick<ActorConfig, "callTransform" | "queryTransform">;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@junobuild/admin",
3
- "version": "0.1.6",
3
+ "version": "0.1.8-next-2025-04-06",
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",
@@ -50,13 +50,14 @@
50
50
  ],
51
51
  "homepage": "https://juno.build",
52
52
  "peerDependencies": {
53
- "@dfinity/agent": "^2.3.0",
54
- "@dfinity/candid": "^2.3.0",
55
- "@dfinity/ic-management": "^6",
56
- "@dfinity/identity": "^2.3.0",
57
- "@dfinity/principal": "^2.3.0",
58
- "@dfinity/utils": "^2",
53
+ "@dfinity/agent": "*",
54
+ "@dfinity/candid": "*",
55
+ "@dfinity/ic-management": "*",
56
+ "@dfinity/identity": "*",
57
+ "@dfinity/principal": "*",
58
+ "@dfinity/utils": "*",
59
59
  "@junobuild/config": "*",
60
- "semver": "7.*"
60
+ "semver": "*",
61
+ "zod": "*"
61
62
  }
62
- }
63
+ }