@junobuild/admin
Version:
A library for interfacing with admin features of Juno
4 lines • 271 kB
Source Map (JSON)
{
"version": 3,
"sources": ["../../src/errors/upgrade.errors.ts", "../../src/errors/version.errors.ts", "../../src/helpers/crypto.helpers.ts", "../../src/helpers/package.helpers.ts", "../../src/helpers/version.helpers.ts", "../../src/helpers/wasm.helpers.ts", "../../src/api/actor.api.ts", "../../declarations/mission_control/mission_control.factory.did.js", "../../declarations/orbiter/orbiter.factory.did.js", "../../declarations/satellite/satellite-deprecated-no-scope.factory.did.js", "../../declarations/satellite/satellite-deprecated-version.factory.did.js", "../../declarations/orbiter/orbiter-deprecated-version.factory.did.js", "../../declarations/mission_control/mission_control-deprecated-version.factory.did.js", "../../declarations/satellite/satellite-deprecated.factory.did.js", "../../declarations/satellite/satellite.factory.did.js", "../../src/utils/actor.utils.ts", "../../src/api/mission-control.api.ts", "../../src/utils/controllers.utils.ts", "../../src/services/mission-control.controllers.services.ts", "../../src/services/mission-control.upgrade.services.ts", "../../src/constants/upgrade.constants.ts", "../../src/handlers/upgrade.handlers.ts", "../../src/api/ic.api.ts", "../../src/types/upgrade.types.ts", "../../src/handlers/upgrade.chunks.handlers.ts", "../../src/handlers/upgrade.single.handlers.ts", "../../src/utils/idl.utils.ts", "../../src/services/mission-control.version.services.ts", "../../src/services/package.services.ts", "../../src/services/module.upgrade.services.ts", "../../src/api/orbiter.api.ts", "../../src/services/orbiter.controllers.services.ts", "../../src/services/orbiter.memory.services.ts", "../../src/services/orbiter.upgrade.services.ts", "../../src/services/orbiter.version.services.ts", "../../src/api/satellite.api.ts", "../../src/services/satellite.assets.services.ts", "../../src/services/satellite.config.services.ts", "../../src/utils/memory.utils.ts", "../../src/services/satellite.controllers.services.ts", "../../src/services/satellite.docs.services.ts", "../../src/services/satellite.domains.services.ts", "../../src/services/satellite.memory.services.ts", "../../src/utils/rule.utils.ts", "../../src/constants/rules.constants.ts", "../../src/services/satellite.rules.services.ts", "../../src/services/satellite.upgrade.services.ts", "../../src/services/satellite.version.services.ts"],
"sourcesContent": ["export class UpgradeCodeUnchangedError extends Error {\n constructor() {\n super(\n 'The Wasm code for the upgrade is identical to the code currently installed. No upgrade is necessary.'\n );\n }\n}\n", "import {\n JUNO_PACKAGE_MISSION_CONTROL_ID,\n JUNO_PACKAGE_ORBITER_ID,\n JUNO_PACKAGE_SATELLITE_ID\n} from '@junobuild/config';\n\nexport class SatelliteMissingDependencyError extends Error {\n constructor() {\n super(`Invalid dependency tree: required module ${JUNO_PACKAGE_SATELLITE_ID} is missing.`);\n }\n}\n\nexport class MissionControlVersionError extends Error {\n constructor() {\n super(`Invalid package: the provided module name is not ${JUNO_PACKAGE_MISSION_CONTROL_ID}.`);\n }\n}\n\nexport class OrbiterVersionError extends Error {\n constructor() {\n super(`Invalid package: the provided module name is not ${JUNO_PACKAGE_ORBITER_ID}.`);\n }\n}\n", "// Sources:\n// https://stackoverflow.com/a/70891826/5404186\n// https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest\n\nconst digestSha256 = (data: ArrayBuffer | Uint8Array<ArrayBufferLike>): Promise<ArrayBuffer> =>\n crypto.subtle.digest('SHA-256', data);\n\nconst sha256ToHex = (hashBuffer: ArrayBuffer): string => {\n const hashArray = Array.from(new Uint8Array(hashBuffer));\n return hashArray.map((b) => b.toString(16).padStart(2, '0')).join('');\n};\n\nexport const blobSha256 = async (blob: Blob): Promise<string> => {\n const hashBuffer = await digestSha256(await blob.arrayBuffer());\n return sha256ToHex(hashBuffer);\n};\n\nexport const uint8ArraySha256 = async (data: Uint8Array): Promise<string> => {\n const hashBuffer = await digestSha256(data);\n return sha256ToHex(hashBuffer);\n};\n", "import type {JunoPackageDependencies} from '@junobuild/config';\n\n/**\n * Finds a specific dependency in a `JunoPackageDependencies` map.\n *\n * @param {Object} params - The parameters for the search.\n * @param {string} params.dependencyId - The ID of the dependency to look for.\n * @param {JunoPackageDependencies | undefined} params.dependencies - The full list of dependencies, or `undefined`.\n *\n * @returns {[string, string] | undefined} A tuple containing the dependency ID and version if found, or `undefined` if not found or no dependencies are present.\n */\nexport const findJunoPackageDependency = ({\n dependencyId,\n dependencies\n}: {\n dependencyId: string;\n dependencies: JunoPackageDependencies | undefined;\n}): [string, string] | undefined =>\n Object.entries(dependencies ?? {}).find(([key, _]) => key === dependencyId);\n", "import {major, minor, patch} from 'semver';\n\n/**\n * Checks if the selected version can be upgraded from the current version.\n * @param {Object} params - The parameters for the version check.\n * @param {string} params.currentVersion - The current version.\n * @param {string} params.selectedVersion - The selected version.\n * @returns {Object} An object indicating whether the upgrade can proceed.\n * @returns {boolean} returns.canUpgrade - Whether the selected version can be upgraded from the current version.\n */\nexport const checkUpgradeVersion = ({\n currentVersion,\n selectedVersion\n}: {\n currentVersion: string;\n selectedVersion: string;\n}): {canUpgrade: boolean} => {\n const currentMajor = major(currentVersion);\n const selectedMajor = major(selectedVersion);\n const currentMinor = minor(currentVersion);\n const selectedMinor = minor(selectedVersion);\n const currentPath = patch(currentVersion);\n const selectedPath = patch(selectedVersion);\n\n if (\n currentMajor < selectedMajor - 1 ||\n currentMinor < selectedMinor - 1 ||\n currentPath < selectedPath - 1\n ) {\n return {canUpgrade: false};\n }\n\n return {canUpgrade: true};\n};\n", "import {isNullish, nonNullish} from '@dfinity/utils';\nimport {type JunoPackage, JUNO_PACKAGE_SATELLITE_ID, JunoPackageSchema} from '@junobuild/config';\nimport type {BuildType} from '../types/build.types';\nimport {findJunoPackageDependency} from './package.helpers';\n\n/**\n * Extracts the build type from a provided Juno package or falls back to a deprecated detection method.\n *\n * @param {Object} params\n * @param {JunoPackage | undefined} params.junoPackage - The parsed Juno package metadata.\n * @param {Uint8Array} params.wasm - The WASM binary to inspect if no package is provided.\n * @returns {Promise<BuildType | undefined>} The build type (`'stock'` or `'extended'`) or `undefined` if undetermined.\n */\nexport const extractBuildType = async ({\n junoPackage,\n wasm\n}: {\n junoPackage: JunoPackage | undefined;\n wasm: Uint8Array;\n}): Promise<BuildType | undefined> => {\n if (isNullish(junoPackage)) {\n return await readDeprecatedBuildType({wasm});\n }\n\n const {name, dependencies} = junoPackage;\n\n if (name === JUNO_PACKAGE_SATELLITE_ID) {\n return 'stock';\n }\n\n const satelliteDependency = findJunoPackageDependency({\n dependencies,\n dependencyId: JUNO_PACKAGE_SATELLITE_ID\n });\n\n return nonNullish(satelliteDependency) ? 'extended' : undefined;\n};\n\n/**\n * @deprecated Modern WASM build use JunoPackage.\n */\nconst readDeprecatedBuildType = async ({\n wasm\n}: {\n wasm: Uint8Array;\n}): Promise<BuildType | undefined> => {\n const buildType = await customSection({wasm, sectionName: 'icp:public juno:build'});\n\n return nonNullish(buildType) && ['stock', 'extended'].includes(buildType)\n ? (buildType as BuildType)\n : undefined;\n};\n\n/**\n * Reads and parses the Juno package from the custom section of a WASM binary.\n *\n * @param {Object} params\n * @param {Uint8Array} params.wasm - The WASM binary containing the embedded custom section.\n * @returns {Promise<JunoPackage | undefined>} The parsed Juno package if present and valid, otherwise `undefined`.\n */\nexport const readCustomSectionJunoPackage = async ({\n wasm\n}: {\n wasm: Uint8Array;\n}): Promise<JunoPackage | undefined> => {\n const section = await customSection({wasm, sectionName: 'icp:public juno:package'});\n\n if (isNullish(section)) {\n return undefined;\n }\n\n const pkg = JSON.parse(section);\n\n const {success, data} = JunoPackageSchema.safeParse(pkg);\n return success ? data : undefined;\n};\n\nconst customSection = async ({\n sectionName,\n wasm\n}: {\n sectionName: string;\n wasm: Uint8Array;\n}): Promise<string | undefined> => {\n const wasmModule = await WebAssembly.compile(wasm);\n\n const pkgSections = WebAssembly.Module.customSections(wasmModule, sectionName);\n\n const [pkgBuffer] = pkgSections;\n\n return nonNullish(pkgBuffer) ? new TextDecoder().decode(pkgBuffer) : undefined;\n};\n", "import type {IDL} from '@dfinity/candid';\nimport {isNullish} from '@dfinity/utils';\nimport type {_SERVICE as DeprecatedMissionControlVersionActor} from '../../declarations/mission_control/mission_control-deprecated-version.did';\nimport type {_SERVICE as MissionControlActor} from '../../declarations/mission_control/mission_control.did';\n// eslint-disable-next-line import/no-relative-parent-imports\nimport {idlFactory as idlFactoryMissionControl} from '../../declarations/mission_control/mission_control.factory.did.js';\nimport type {_SERVICE as DeprecatedOrbiterVersionActor} from '../../declarations/orbiter/orbiter-deprecated-version.did';\nimport type {_SERVICE as OrbiterActor} from '../../declarations/orbiter/orbiter.did';\n// eslint-disable-next-line import/no-relative-parent-imports\nimport {idlFactory as idlFactoryOrbiter} from '../../declarations/orbiter/orbiter.factory.did.js';\nimport type {_SERVICE as DeprecatedSatelliteNoScopeActor} from '../../declarations/satellite/satellite-deprecated-no-scope.did';\nimport type {_SERVICE as DeprecatedSatelliteVersionActor} from '../../declarations/satellite/satellite-deprecated-version.did';\n// eslint-disable-next-line import/no-relative-parent-imports\nimport {idlFactory as idlDeprecatedFactorySatelliteNoScope} from '../../declarations/satellite/satellite-deprecated-no-scope.factory.did.js';\n// eslint-disable-next-line import/no-relative-parent-imports\nimport {idlFactory as idlDeprecatedFactorySatelliteVersion} from '../../declarations/satellite/satellite-deprecated-version.factory.did.js';\n// eslint-disable-next-line import/no-relative-parent-imports\nimport {idlFactory as idlDeprecatedFactoryOrbiterVersion} from '../../declarations/orbiter/orbiter-deprecated-version.factory.did.js';\n// eslint-disable-next-line import/no-relative-parent-imports\nimport {idlFactory as idlDeprecatedFactoryMissionControlVersion} from '../../declarations/mission_control/mission_control-deprecated-version.factory.did.js';\nimport type {_SERVICE as DeprecatedSatelliteActor} from '../../declarations/satellite/satellite-deprecated.did';\n// eslint-disable-next-line import/no-relative-parent-imports\nimport {idlFactory as idlDeprecatedFactorySatellite} from '../../declarations/satellite/satellite-deprecated.factory.did.js';\nimport type {_SERVICE as SatelliteActor} from '../../declarations/satellite/satellite.did';\n// eslint-disable-next-line import/no-relative-parent-imports\nimport {idlFactory as idlFactorySatellite} from '../../declarations/satellite/satellite.factory.did.js';\nimport type {\n ActorParameters,\n MissionControlParameters,\n OrbiterParameters,\n SatelliteParameters\n} from '../types/actor.types';\nimport {createActor} from '../utils/actor.utils';\n\n/**\n * @deprecated TODO: for backwards compatibility - to be removed\n */\nexport const getDeprecatedSatelliteActor = ({\n satelliteId,\n ...rest\n}: SatelliteParameters): Promise<DeprecatedSatelliteActor> =>\n getActor({\n canisterId: satelliteId,\n ...rest,\n idlFactory: idlDeprecatedFactorySatellite\n });\n\nexport const getSatelliteActor = ({\n satelliteId,\n ...rest\n}: SatelliteParameters): Promise<SatelliteActor> =>\n getActor({\n canisterId: satelliteId,\n ...rest,\n idlFactory: idlFactorySatellite\n });\n\n/**\n * @deprecated TODO: for backwards compatibility - to be removed\n */\nexport const getDeprecatedSatelliteNoScopeActor = ({\n satelliteId,\n ...rest\n}: SatelliteParameters): Promise<DeprecatedSatelliteNoScopeActor> =>\n getActor({\n canisterId: satelliteId,\n ...rest,\n idlFactory: idlDeprecatedFactorySatelliteNoScope\n });\n\n/**\n * @deprecated TODO: for backwards compatibility - to be removed\n */\nexport const getDeprecatedSatelliteVersionActor = ({\n satelliteId,\n ...rest\n}: SatelliteParameters): Promise<DeprecatedSatelliteVersionActor> =>\n getActor({\n canisterId: satelliteId,\n ...rest,\n idlFactory: idlDeprecatedFactorySatelliteVersion\n });\n\nexport const getMissionControlActor = ({\n missionControlId,\n ...rest\n}: MissionControlParameters): Promise<MissionControlActor> =>\n getActor({\n canisterId: missionControlId,\n ...rest,\n idlFactory: idlFactoryMissionControl\n });\n\n/**\n * @deprecated TODO: for backwards compatibility - to be removed\n */\nexport const getDeprecatedMissionControlVersionActor = ({\n missionControlId,\n ...rest\n}: MissionControlParameters): Promise<DeprecatedMissionControlVersionActor> =>\n getActor({\n canisterId: missionControlId,\n ...rest,\n idlFactory: idlDeprecatedFactoryMissionControlVersion\n });\n\nexport const getOrbiterActor = ({orbiterId, ...rest}: OrbiterParameters): Promise<OrbiterActor> =>\n getActor({\n canisterId: orbiterId,\n ...rest,\n idlFactory: idlFactoryOrbiter\n });\n\n/**\n * @deprecated TODO: for backwards compatibility - to be removed\n */\nexport const getDeprecatedOrbiterVersionActor = ({\n orbiterId,\n ...rest\n}: OrbiterParameters): Promise<DeprecatedOrbiterVersionActor> =>\n getActor({\n canisterId: orbiterId,\n ...rest,\n idlFactory: idlDeprecatedFactoryOrbiterVersion\n });\n\nexport const getActor = <T>({\n canisterId,\n idlFactory,\n ...rest\n}: ActorParameters & {\n canisterId: string | undefined;\n idlFactory: IDL.InterfaceFactory;\n}): Promise<T> => {\n if (isNullish(canisterId)) {\n throw new Error('No canister ID provided.');\n }\n\n return createActor({\n canisterId,\n idlFactory,\n ...rest\n });\n};\n", "// @ts-ignore\nexport const idlFactory = ({IDL}) => {\n const CyclesThreshold = IDL.Record({\n fund_cycles: IDL.Nat,\n min_cycles: IDL.Nat\n });\n const CyclesMonitoringStrategy = IDL.Variant({\n BelowThreshold: CyclesThreshold\n });\n const CyclesMonitoring = IDL.Record({\n strategy: IDL.Opt(CyclesMonitoringStrategy),\n enabled: IDL.Bool\n });\n const Monitoring = IDL.Record({cycles: IDL.Opt(CyclesMonitoring)});\n const Settings = IDL.Record({monitoring: IDL.Opt(Monitoring)});\n const Orbiter = IDL.Record({\n updated_at: IDL.Nat64,\n orbiter_id: IDL.Principal,\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n created_at: IDL.Nat64,\n settings: IDL.Opt(Settings)\n });\n const CreateCanisterConfig = IDL.Record({\n subnet_id: IDL.Opt(IDL.Principal),\n name: IDL.Opt(IDL.Text)\n });\n const Satellite = IDL.Record({\n updated_at: IDL.Nat64,\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n created_at: IDL.Nat64,\n satellite_id: IDL.Principal,\n settings: IDL.Opt(Settings)\n });\n const DepositCyclesArgs = IDL.Record({\n cycles: IDL.Nat,\n destination_id: IDL.Principal\n });\n const DepositedCyclesEmailNotification = IDL.Record({\n to: IDL.Opt(IDL.Text),\n enabled: IDL.Bool\n });\n const CyclesMonitoringConfig = IDL.Record({\n notification: IDL.Opt(DepositedCyclesEmailNotification),\n default_strategy: IDL.Opt(CyclesMonitoringStrategy)\n });\n const MonitoringConfig = IDL.Record({\n cycles: IDL.Opt(CyclesMonitoringConfig)\n });\n const Config = IDL.Record({monitoring: IDL.Opt(MonitoringConfig)});\n const GetMonitoringHistory = IDL.Record({\n to: IDL.Opt(IDL.Nat64),\n from: IDL.Opt(IDL.Nat64),\n segment_id: IDL.Principal\n });\n const MonitoringHistoryKey = IDL.Record({\n segment_id: IDL.Principal,\n created_at: IDL.Nat64,\n nonce: IDL.Int32\n });\n const CyclesBalance = IDL.Record({\n timestamp: IDL.Nat64,\n amount: IDL.Nat\n });\n const FundingErrorCode = IDL.Variant({\n BalanceCheckFailed: IDL.Null,\n ObtainCyclesFailed: IDL.Null,\n DepositFailed: IDL.Null,\n InsufficientCycles: IDL.Null,\n Other: IDL.Text\n });\n const FundingFailure = IDL.Record({\n timestamp: IDL.Nat64,\n error_code: FundingErrorCode\n });\n const MonitoringHistoryCycles = IDL.Record({\n deposited_cycles: IDL.Opt(CyclesBalance),\n cycles: CyclesBalance,\n funding_failure: IDL.Opt(FundingFailure)\n });\n const MonitoringHistory = IDL.Record({\n cycles: IDL.Opt(MonitoringHistoryCycles)\n });\n const CyclesMonitoringStatus = IDL.Record({\n monitored_ids: IDL.Vec(IDL.Principal),\n running: IDL.Bool\n });\n const MonitoringStatus = IDL.Record({\n cycles: IDL.Opt(CyclesMonitoringStatus)\n });\n const MissionControlSettings = IDL.Record({\n updated_at: IDL.Nat64,\n created_at: IDL.Nat64,\n monitoring: IDL.Opt(Monitoring)\n });\n const User = IDL.Record({\n updated_at: IDL.Nat64,\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n user: IDL.Opt(IDL.Principal),\n created_at: IDL.Nat64,\n config: IDL.Opt(Config)\n });\n const Tokens = IDL.Record({e8s: IDL.Nat64});\n const Timestamp = IDL.Record({timestamp_nanos: IDL.Nat64});\n const TransferArgs = IDL.Record({\n to: IDL.Vec(IDL.Nat8),\n fee: Tokens,\n memo: IDL.Nat64,\n from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),\n created_at_time: IDL.Opt(Timestamp),\n amount: Tokens\n });\n const TransferError = IDL.Variant({\n TxTooOld: IDL.Record({allowed_window_nanos: IDL.Nat64}),\n BadFee: IDL.Record({expected_fee: Tokens}),\n TxDuplicate: IDL.Record({duplicate_of: IDL.Nat64}),\n TxCreatedInFuture: IDL.Null,\n InsufficientFunds: IDL.Record({balance: Tokens})\n });\n const Result = IDL.Variant({Ok: IDL.Nat64, Err: TransferError});\n const Account = IDL.Record({\n owner: IDL.Principal,\n subaccount: IDL.Opt(IDL.Vec(IDL.Nat8))\n });\n const TransferArg = IDL.Record({\n to: Account,\n fee: IDL.Opt(IDL.Nat),\n memo: IDL.Opt(IDL.Vec(IDL.Nat8)),\n from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),\n created_at_time: IDL.Opt(IDL.Nat64),\n amount: IDL.Nat\n });\n const TransferError_1 = IDL.Variant({\n GenericError: IDL.Record({\n message: IDL.Text,\n error_code: IDL.Nat\n }),\n TemporarilyUnavailable: IDL.Null,\n BadBurn: IDL.Record({min_burn_amount: IDL.Nat}),\n Duplicate: IDL.Record({duplicate_of: IDL.Nat}),\n BadFee: IDL.Record({expected_fee: IDL.Nat}),\n CreatedInFuture: IDL.Record({ledger_time: IDL.Nat64}),\n TooOld: IDL.Null,\n InsufficientFunds: IDL.Record({balance: IDL.Nat})\n });\n const Result_1 = IDL.Variant({Ok: IDL.Nat, Err: TransferError_1});\n const ControllerScope = IDL.Variant({\n Write: IDL.Null,\n Admin: IDL.Null,\n Submit: IDL.Null\n });\n const Controller = IDL.Record({\n updated_at: IDL.Nat64,\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n created_at: IDL.Nat64,\n scope: ControllerScope,\n expires_at: IDL.Opt(IDL.Nat64)\n });\n const SetController = IDL.Record({\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n scope: ControllerScope,\n expires_at: IDL.Opt(IDL.Nat64)\n });\n const SegmentsMonitoringStrategy = IDL.Record({\n ids: IDL.Vec(IDL.Principal),\n strategy: CyclesMonitoringStrategy\n });\n const CyclesMonitoringStartConfig = IDL.Record({\n orbiters_strategy: IDL.Opt(SegmentsMonitoringStrategy),\n mission_control_strategy: IDL.Opt(CyclesMonitoringStrategy),\n satellites_strategy: IDL.Opt(SegmentsMonitoringStrategy)\n });\n const MonitoringStartConfig = IDL.Record({\n cycles_config: IDL.Opt(CyclesMonitoringStartConfig)\n });\n const CyclesMonitoringStopConfig = IDL.Record({\n satellite_ids: IDL.Opt(IDL.Vec(IDL.Principal)),\n try_mission_control: IDL.Opt(IDL.Bool),\n orbiter_ids: IDL.Opt(IDL.Vec(IDL.Principal))\n });\n const MonitoringStopConfig = IDL.Record({\n cycles_config: IDL.Opt(CyclesMonitoringStopConfig)\n });\n return IDL.Service({\n add_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal)], [], []),\n add_satellites_controllers: IDL.Func([IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal)], [], []),\n create_orbiter: IDL.Func([IDL.Opt(IDL.Text)], [Orbiter], []),\n create_orbiter_with_config: IDL.Func([CreateCanisterConfig], [Orbiter], []),\n create_satellite: IDL.Func([IDL.Text], [Satellite], []),\n create_satellite_with_config: IDL.Func([CreateCanisterConfig], [Satellite], []),\n del_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal)], [], []),\n del_orbiter: IDL.Func([IDL.Principal, IDL.Nat], [], []),\n del_orbiters_controllers: IDL.Func([IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal)], [], []),\n del_satellite: IDL.Func([IDL.Principal, IDL.Nat], [], []),\n del_satellites_controllers: IDL.Func([IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal)], [], []),\n deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),\n get_config: IDL.Func([], [IDL.Opt(Config)], ['query']),\n get_metadata: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))], ['query']),\n get_monitoring_history: IDL.Func(\n [GetMonitoringHistory],\n [IDL.Vec(IDL.Tuple(MonitoringHistoryKey, MonitoringHistory))],\n ['query']\n ),\n get_monitoring_status: IDL.Func([], [MonitoringStatus], ['query']),\n get_settings: IDL.Func([], [IDL.Opt(MissionControlSettings)], ['query']),\n get_user: IDL.Func([], [IDL.Principal], ['query']),\n get_user_data: IDL.Func([], [User], ['query']),\n icp_transfer: IDL.Func([TransferArgs], [Result], []),\n icrc_transfer: IDL.Func([IDL.Principal, TransferArg], [Result_1], []),\n list_mission_control_controllers: IDL.Func(\n [],\n [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],\n ['query']\n ),\n list_orbiters: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Orbiter))], ['query']),\n list_satellites: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Satellite))], ['query']),\n remove_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal)], [], []),\n remove_satellites_controllers: IDL.Func(\n [IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal)],\n [],\n []\n ),\n set_config: IDL.Func([IDL.Opt(Config)], [], []),\n set_metadata: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))], [], []),\n set_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal), SetController], [], []),\n set_orbiter: IDL.Func([IDL.Principal, IDL.Opt(IDL.Text)], [Orbiter], []),\n set_orbiter_metadata: IDL.Func(\n [IDL.Principal, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n [Orbiter],\n []\n ),\n set_orbiters_controllers: IDL.Func(\n [IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal), SetController],\n [],\n []\n ),\n set_satellite: IDL.Func([IDL.Principal, IDL.Opt(IDL.Text)], [Satellite], []),\n set_satellite_metadata: IDL.Func(\n [IDL.Principal, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n [Satellite],\n []\n ),\n set_satellites_controllers: IDL.Func(\n [IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal), SetController],\n [],\n []\n ),\n start_monitoring: IDL.Func([], [], []),\n stop_monitoring: IDL.Func([], [], []),\n top_up: IDL.Func([IDL.Principal, Tokens], [], []),\n unset_orbiter: IDL.Func([IDL.Principal], [], []),\n unset_satellite: IDL.Func([IDL.Principal], [], []),\n update_and_start_monitoring: IDL.Func([MonitoringStartConfig], [], []),\n update_and_stop_monitoring: IDL.Func([MonitoringStopConfig], [], [])\n });\n};\n// @ts-ignore\nexport const init = ({IDL}) => {\n return [];\n};\n", "// @ts-ignore\nexport const idlFactory = ({IDL}) => {\n const DeleteControllersArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal)\n });\n const ControllerScope = IDL.Variant({\n Write: IDL.Null,\n Admin: IDL.Null,\n Submit: IDL.Null\n });\n const Controller = IDL.Record({\n updated_at: IDL.Nat64,\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n created_at: IDL.Nat64,\n scope: ControllerScope,\n expires_at: IDL.Opt(IDL.Nat64)\n });\n const DelSatelliteConfig = IDL.Record({version: IDL.Opt(IDL.Nat64)});\n const DepositCyclesArgs = IDL.Record({\n cycles: IDL.Nat,\n destination_id: IDL.Principal\n });\n const GetAnalytics = IDL.Record({\n to: IDL.Opt(IDL.Nat64),\n from: IDL.Opt(IDL.Nat64),\n satellite_id: IDL.Opt(IDL.Principal)\n });\n const AnalyticKey = IDL.Record({\n key: IDL.Text,\n collected_at: IDL.Nat64\n });\n const PageViewClient = IDL.Record({\n os: IDL.Text,\n device: IDL.Opt(IDL.Text),\n browser: IDL.Text\n });\n const PageViewCampaign = IDL.Record({\n utm_content: IDL.Opt(IDL.Text),\n utm_medium: IDL.Opt(IDL.Text),\n utm_source: IDL.Text,\n utm_term: IDL.Opt(IDL.Text),\n utm_campaign: IDL.Opt(IDL.Text)\n });\n const PageViewDevice = IDL.Record({\n inner_height: IDL.Nat16,\n screen_height: IDL.Opt(IDL.Nat16),\n screen_width: IDL.Opt(IDL.Nat16),\n inner_width: IDL.Nat16\n });\n const PageView = IDL.Record({\n client: IDL.Opt(PageViewClient),\n title: IDL.Text,\n updated_at: IDL.Nat64,\n referrer: IDL.Opt(IDL.Text),\n time_zone: IDL.Text,\n session_id: IDL.Text,\n campaign: IDL.Opt(PageViewCampaign),\n href: IDL.Text,\n created_at: IDL.Nat64,\n satellite_id: IDL.Principal,\n device: PageViewDevice,\n version: IDL.Opt(IDL.Nat64),\n user_agent: IDL.Opt(IDL.Text)\n });\n const AnalyticsBrowsersPageViews = IDL.Record({\n safari: IDL.Float64,\n opera: IDL.Float64,\n others: IDL.Float64,\n firefox: IDL.Float64,\n chrome: IDL.Float64\n });\n const AnalyticsOperatingSystemsPageViews = IDL.Record({\n ios: IDL.Float64,\n macos: IDL.Float64,\n others: IDL.Float64,\n linux: IDL.Float64,\n android: IDL.Float64,\n windows: IDL.Float64\n });\n const AnalyticsDevicesPageViews = IDL.Record({\n desktop: IDL.Float64,\n laptop: IDL.Opt(IDL.Float64),\n others: IDL.Float64,\n tablet: IDL.Opt(IDL.Float64),\n mobile: IDL.Float64\n });\n const AnalyticsClientsPageViews = IDL.Record({\n browsers: AnalyticsBrowsersPageViews,\n operating_systems: IDL.Opt(AnalyticsOperatingSystemsPageViews),\n devices: AnalyticsDevicesPageViews\n });\n const CalendarDate = IDL.Record({\n day: IDL.Nat8,\n month: IDL.Nat8,\n year: IDL.Int32\n });\n const AnalyticsMetricsPageViews = IDL.Record({\n bounce_rate: IDL.Float64,\n average_page_views_per_session: IDL.Float64,\n daily_total_page_views: IDL.Vec(IDL.Tuple(CalendarDate, IDL.Nat32)),\n total_page_views: IDL.Nat32,\n unique_page_views: IDL.Nat64,\n unique_sessions: IDL.Nat64\n });\n const AnalyticsTop10PageViews = IDL.Record({\n referrers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32)),\n pages: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32)),\n utm_campaigns: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32))),\n utm_sources: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32))),\n time_zones: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32)))\n });\n const NavigationType = IDL.Variant({\n Navigate: IDL.Null,\n Restore: IDL.Null,\n Reload: IDL.Null,\n BackForward: IDL.Null,\n BackForwardCache: IDL.Null,\n Prerender: IDL.Null\n });\n const WebVitalsMetric = IDL.Record({\n id: IDL.Text,\n value: IDL.Float64,\n navigation_type: IDL.Opt(NavigationType),\n delta: IDL.Float64\n });\n const PerformanceData = IDL.Variant({WebVitalsMetric: WebVitalsMetric});\n const PerformanceMetricName = IDL.Variant({\n CLS: IDL.Null,\n FCP: IDL.Null,\n INP: IDL.Null,\n LCP: IDL.Null,\n TTFB: IDL.Null\n });\n const PerformanceMetric = IDL.Record({\n updated_at: IDL.Nat64,\n session_id: IDL.Text,\n data: PerformanceData,\n href: IDL.Text,\n metric_name: PerformanceMetricName,\n created_at: IDL.Nat64,\n satellite_id: IDL.Principal,\n version: IDL.Opt(IDL.Nat64)\n });\n const AnalyticsWebVitalsPageMetrics = IDL.Record({\n cls: IDL.Opt(IDL.Float64),\n fcp: IDL.Opt(IDL.Float64),\n inp: IDL.Opt(IDL.Float64),\n lcp: IDL.Opt(IDL.Float64),\n ttfb: IDL.Opt(IDL.Float64)\n });\n const AnalyticsWebVitalsPerformanceMetrics = IDL.Record({\n overall: AnalyticsWebVitalsPageMetrics,\n pages: IDL.Vec(IDL.Tuple(IDL.Text, AnalyticsWebVitalsPageMetrics))\n });\n const TrackEvent = IDL.Record({\n updated_at: IDL.Nat64,\n session_id: IDL.Text,\n metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))),\n name: IDL.Text,\n created_at: IDL.Nat64,\n satellite_id: IDL.Principal,\n version: IDL.Opt(IDL.Nat64)\n });\n const AnalyticsTrackEvents = IDL.Record({\n total: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat32))\n });\n const HttpRequest = IDL.Record({\n url: IDL.Text,\n method: IDL.Text,\n body: IDL.Vec(IDL.Nat8),\n headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n certificate_version: IDL.Opt(IDL.Nat16)\n });\n const HttpResponse = IDL.Record({\n body: IDL.Vec(IDL.Nat8),\n headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n upgrade: IDL.Opt(IDL.Bool),\n status_code: IDL.Nat16\n });\n const OrbiterSatelliteFeatures = IDL.Record({\n performance_metrics: IDL.Bool,\n track_events: IDL.Bool,\n page_views: IDL.Bool\n });\n const OrbiterSatelliteConfig = IDL.Record({\n updated_at: IDL.Nat64,\n features: IDL.Opt(OrbiterSatelliteFeatures),\n restricted_origin: IDL.Opt(IDL.Text),\n created_at: IDL.Nat64,\n version: IDL.Opt(IDL.Nat64)\n });\n const MemorySize = IDL.Record({stable: IDL.Nat64, heap: IDL.Nat64});\n const SetController = IDL.Record({\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n scope: ControllerScope,\n expires_at: IDL.Opt(IDL.Nat64)\n });\n const SetControllersArgs = IDL.Record({\n controller: SetController,\n controllers: IDL.Vec(IDL.Principal)\n });\n const SetPageView = IDL.Record({\n client: IDL.Opt(PageViewClient),\n title: IDL.Text,\n updated_at: IDL.Opt(IDL.Nat64),\n referrer: IDL.Opt(IDL.Text),\n time_zone: IDL.Text,\n session_id: IDL.Text,\n campaign: IDL.Opt(PageViewCampaign),\n href: IDL.Text,\n satellite_id: IDL.Principal,\n device: PageViewDevice,\n version: IDL.Opt(IDL.Nat64),\n user_agent: IDL.Opt(IDL.Text)\n });\n const Result = IDL.Variant({Ok: PageView, Err: IDL.Text});\n const Result_1 = IDL.Variant({\n Ok: IDL.Null,\n Err: IDL.Vec(IDL.Tuple(AnalyticKey, IDL.Text))\n });\n const SetPerformanceMetric = IDL.Record({\n session_id: IDL.Text,\n data: PerformanceData,\n href: IDL.Text,\n metric_name: PerformanceMetricName,\n satellite_id: IDL.Principal,\n version: IDL.Opt(IDL.Nat64),\n user_agent: IDL.Opt(IDL.Text)\n });\n const Result_2 = IDL.Variant({Ok: PerformanceMetric, Err: IDL.Text});\n const SetSatelliteConfig = IDL.Record({\n features: IDL.Opt(OrbiterSatelliteFeatures),\n restricted_origin: IDL.Opt(IDL.Text),\n version: IDL.Opt(IDL.Nat64)\n });\n const SetTrackEvent = IDL.Record({\n updated_at: IDL.Opt(IDL.Nat64),\n session_id: IDL.Text,\n metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))),\n name: IDL.Text,\n satellite_id: IDL.Principal,\n version: IDL.Opt(IDL.Nat64),\n user_agent: IDL.Opt(IDL.Text)\n });\n const Result_3 = IDL.Variant({Ok: TrackEvent, Err: IDL.Text});\n return IDL.Service({\n del_controllers: IDL.Func(\n [DeleteControllersArgs],\n [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],\n []\n ),\n del_satellite_config: IDL.Func([IDL.Principal, DelSatelliteConfig], [], []),\n deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),\n get_page_views: IDL.Func(\n [GetAnalytics],\n [IDL.Vec(IDL.Tuple(AnalyticKey, PageView))],\n ['query']\n ),\n get_page_views_analytics_clients: IDL.Func(\n [GetAnalytics],\n [AnalyticsClientsPageViews],\n ['query']\n ),\n get_page_views_analytics_metrics: IDL.Func(\n [GetAnalytics],\n [AnalyticsMetricsPageViews],\n ['query']\n ),\n get_page_views_analytics_top_10: IDL.Func([GetAnalytics], [AnalyticsTop10PageViews], ['query']),\n get_performance_metrics: IDL.Func(\n [GetAnalytics],\n [IDL.Vec(IDL.Tuple(AnalyticKey, PerformanceMetric))],\n ['query']\n ),\n get_performance_metrics_analytics_web_vitals: IDL.Func(\n [GetAnalytics],\n [AnalyticsWebVitalsPerformanceMetrics],\n ['query']\n ),\n get_track_events: IDL.Func(\n [GetAnalytics],\n [IDL.Vec(IDL.Tuple(AnalyticKey, TrackEvent))],\n ['query']\n ),\n get_track_events_analytics: IDL.Func([GetAnalytics], [AnalyticsTrackEvents], ['query']),\n http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),\n http_request_update: IDL.Func([HttpRequest], [HttpResponse], []),\n list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], ['query']),\n list_satellite_configs: IDL.Func(\n [],\n [IDL.Vec(IDL.Tuple(IDL.Principal, OrbiterSatelliteConfig))],\n ['query']\n ),\n memory_size: IDL.Func([], [MemorySize], ['query']),\n set_controllers: IDL.Func(\n [SetControllersArgs],\n [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],\n []\n ),\n set_page_view: IDL.Func([AnalyticKey, SetPageView], [Result], []),\n set_page_views: IDL.Func([IDL.Vec(IDL.Tuple(AnalyticKey, SetPageView))], [Result_1], []),\n set_performance_metric: IDL.Func([AnalyticKey, SetPerformanceMetric], [Result_2], []),\n set_performance_metrics: IDL.Func(\n [IDL.Vec(IDL.Tuple(AnalyticKey, SetPerformanceMetric))],\n [Result_1],\n []\n ),\n set_satellite_configs: IDL.Func(\n [IDL.Vec(IDL.Tuple(IDL.Principal, SetSatelliteConfig))],\n [IDL.Vec(IDL.Tuple(IDL.Principal, OrbiterSatelliteConfig))],\n []\n ),\n set_track_event: IDL.Func([AnalyticKey, SetTrackEvent], [Result_3], []),\n set_track_events: IDL.Func([IDL.Vec(IDL.Tuple(AnalyticKey, SetTrackEvent))], [Result_1], [])\n });\n};\n// @ts-ignore\nexport const init = ({IDL}) => {\n return [];\n};\n", "// @ts-ignore\nexport const idlFactory = ({IDL}) => {\n const CommitBatch = IDL.Record({\n batch_id: IDL.Nat,\n headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n chunk_ids: IDL.Vec(IDL.Nat)\n });\n const DeleteControllersArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal)\n });\n const Controller = IDL.Record({\n updated_at: IDL.Nat64,\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n created_at: IDL.Nat64,\n expires_at: IDL.Opt(IDL.Nat64)\n });\n const DelDoc = IDL.Record({updated_at: IDL.Opt(IDL.Nat64)});\n const StorageConfig = IDL.Record({\n headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))))\n });\n const Config = IDL.Record({storage: StorageConfig});\n const Doc = IDL.Record({\n updated_at: IDL.Nat64,\n owner: IDL.Principal,\n data: IDL.Vec(IDL.Nat8),\n created_at: IDL.Nat64\n });\n const HttpRequest = IDL.Record({\n url: IDL.Text,\n method: IDL.Text,\n body: IDL.Vec(IDL.Nat8),\n headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))\n });\n const StreamingCallbackToken = IDL.Record({\n token: IDL.Opt(IDL.Text),\n sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),\n headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n index: IDL.Nat64,\n encoding_type: IDL.Text,\n full_path: IDL.Text\n });\n const StreamingStrategy = IDL.Variant({\n Callback: IDL.Record({\n token: StreamingCallbackToken,\n callback: IDL.Func([], [], [])\n })\n });\n const HttpResponse = IDL.Record({\n body: IDL.Vec(IDL.Nat8),\n headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n streaming_strategy: IDL.Opt(StreamingStrategy),\n status_code: IDL.Nat16\n });\n const StreamingCallbackHttpResponse = IDL.Record({\n token: IDL.Opt(StreamingCallbackToken),\n body: IDL.Vec(IDL.Nat8)\n });\n const InitAssetKey = IDL.Record({\n token: IDL.Opt(IDL.Text),\n collection: IDL.Text,\n name: IDL.Text,\n encoding_type: IDL.Opt(IDL.Text),\n full_path: IDL.Text\n });\n const InitUploadResult = IDL.Record({batch_id: IDL.Nat});\n const ListOrderField = IDL.Variant({\n UpdatedAt: IDL.Null,\n Keys: IDL.Null,\n CreatedAt: IDL.Null\n });\n const ListOrder = IDL.Record({field: ListOrderField, desc: IDL.Bool});\n const ListPaginate = IDL.Record({\n start_after: IDL.Opt(IDL.Text),\n limit: IDL.Opt(IDL.Nat64)\n });\n const ListParams = IDL.Record({\n order: IDL.Opt(ListOrder),\n owner: IDL.Opt(IDL.Principal),\n matcher: IDL.Opt(IDL.Text),\n paginate: IDL.Opt(ListPaginate)\n });\n const AssetKey = IDL.Record({\n token: IDL.Opt(IDL.Text),\n collection: IDL.Text,\n owner: IDL.Principal,\n name: IDL.Text,\n full_path: IDL.Text\n });\n const AssetEncodingNoContent = IDL.Record({\n modified: IDL.Nat64,\n sha256: IDL.Vec(IDL.Nat8),\n total_length: IDL.Nat\n });\n const AssetNoContent = IDL.Record({\n key: AssetKey,\n updated_at: IDL.Nat64,\n encodings: IDL.Vec(IDL.Tuple(IDL.Text, AssetEncodingNoContent)),\n headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n created_at: IDL.Nat64\n });\n const ListResults = IDL.Record({\n matches_length: IDL.Nat64,\n length: IDL.Nat64,\n items: IDL.Vec(IDL.Tuple(IDL.Text, AssetNoContent))\n });\n const CustomDomain = IDL.Record({\n updated_at: IDL.Nat64,\n created_at: IDL.Nat64,\n bn_id: IDL.Opt(IDL.Text)\n });\n const ListResults_1 = IDL.Record({\n matches_length: IDL.Nat64,\n length: IDL.Nat64,\n items: IDL.Vec(IDL.Tuple(IDL.Text, Doc))\n });\n const RulesType = IDL.Variant({Db: IDL.Null, Storage: IDL.Null});\n const Permission = IDL.Variant({\n Controllers: IDL.Null,\n Private: IDL.Null,\n Public: IDL.Null,\n Managed: IDL.Null\n });\n const Rule = IDL.Record({\n updated_at: IDL.Nat64,\n max_size: IDL.Opt(IDL.Nat),\n read: Permission,\n created_at: IDL.Nat64,\n write: Permission\n });\n const SetController = IDL.Record({\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n expires_at: IDL.Opt(IDL.Nat64)\n });\n const SetControllersArgs = IDL.Record({\n controller: SetController,\n controllers: IDL.Vec(IDL.Principal)\n });\n const SetDoc = IDL.Record({\n updated_at: IDL.Opt(IDL.Nat64),\n data: IDL.Vec(IDL.Nat8)\n });\n const SetRule = IDL.Record({\n updated_at: IDL.Opt(IDL.Nat64),\n max_size: IDL.Opt(IDL.Nat),\n read: Permission,\n write: Permission\n });\n const Chunk = IDL.Record({\n content: IDL.Vec(IDL.Nat8),\n batch_id: IDL.Nat\n });\n const UploadChunk = IDL.Record({chunk_id: IDL.Nat});\n return IDL.Service({\n commit_asset_upload: IDL.Func([CommitBatch], [], []),\n del_asset: IDL.Func([IDL.Text, IDL.Text], [], []),\n del_assets: IDL.Func([IDL.Opt(IDL.Text)], [], []),\n del_controllers: IDL.Func(\n [DeleteControllersArgs],\n [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],\n []\n ),\n del_custom_domain: IDL.Func([IDL.Text], [], []),\n del_doc: IDL.Func([IDL.Text, IDL.Text, DelDoc], [], []),\n get_config: IDL.Func([], [Config], []),\n get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], ['query']),\n http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),\n http_request_streaming_callback: IDL.Func(\n [StreamingCallbackToken],\n [StreamingCallbackHttpResponse],\n ['query']\n ),\n init_asset_upload: IDL.Func([InitAssetKey], [InitUploadResult], []),\n list_assets: IDL.Func([IDL.Opt(IDL.Text), ListParams], [ListResults], ['query']),\n list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], ['query']),\n list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], ['query']),\n list_docs: IDL.Func([IDL.Text, ListParams], [ListResults_1], ['query']),\n list_rules: IDL.Func([RulesType], [IDL.Vec(IDL.Tuple(IDL.Text, Rule))], ['query']),\n set_config: IDL.Func([Config], [], []),\n set_controllers: IDL.Func(\n [SetControllersArgs],\n [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],\n []\n ),\n set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),\n set_doc: IDL.Func([IDL.Text, IDL.Text, SetDoc], [Doc], []),\n set_rule: IDL.Func([RulesType, IDL.Text, SetRule], [], []),\n upload_asset_chunk: IDL.Func([Chunk], [UploadChunk], []),\n version: IDL.Func([], [IDL.Text], ['query'])\n });\n};\n// @ts-ignore\nexport const init = ({IDL}) => {\n return [];\n};\n", "// @ts-ignore\nexport const idlFactory = ({IDL}) => {\n const CommitBatch = IDL.Record({\n batch_id: IDL.Nat,\n headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n chunk_ids: IDL.Vec(IDL.Nat)\n });\n const ListOrderField = IDL.Variant({\n UpdatedAt: IDL.Null,\n Keys: IDL.Null,\n CreatedAt: IDL.Null\n });\n const ListOrder = IDL.Record({field: ListOrderField, desc: IDL.Bool});\n const TimestampMatcher = IDL.Variant({\n Equal: IDL.Nat64,\n Between: IDL.Tuple(IDL.Nat64, IDL.Nat64),\n GreaterThan: IDL.Nat64,\n LessThan: IDL.Nat64\n });\n const ListMatcher = IDL.Record({\n key: IDL.Opt(IDL.Text),\n updated_at: IDL.Opt(TimestampMatcher),\n description: IDL.Opt(IDL.Text),\n created_at: IDL.Opt(TimestampMatcher)\n });\n const ListPaginate = IDL.Record({\n start_after: IDL.Opt(IDL.Text),\n limit: IDL.Opt(IDL.Nat64)\n });\n const ListParams = IDL.Record({\n order: IDL.Opt(ListOrder),\n owner: IDL.Opt(IDL.Principal),\n matcher: IDL.Opt(ListMatcher),\n paginate: IDL.Opt(ListPaginate)\n });\n const DeleteControllersArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal)\n });\n const ControllerScope = IDL.Variant({\n Write: IDL.Null,\n Admin: IDL.Null\n });\n const Controller = IDL.Record({\n updated_at: IDL.Nat64,\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n created_at: IDL.Nat64,\n scope: ControllerScope,\n expires_at: IDL.Opt(IDL.Nat64)\n });\n const DelDoc = IDL.Record({version: IDL.Opt(IDL.Nat64)});\n const CollectionType = IDL.Variant({Db: IDL.Null, Storage: IDL.Null});\n const DelRule = IDL.Record({version: IDL.Opt(IDL.Nat64)});\n const DepositCyclesArgs = IDL.Record({\n cycles: IDL.Nat,\n destination_id: IDL.Principal\n });\n const AssetKey = IDL.Record({\n token: IDL.Opt(IDL.Text),\n collection: IDL.Text,\n owner: IDL.Principal,\n name: IDL.Text,\n description: IDL.Opt(IDL.Text),\n full_path: IDL.Text\n });\n const AssetEncodingNoContent = IDL.Record({\n modified: IDL.Nat64,\n sha256: IDL.Vec(IDL.Nat8),\n total_length: IDL.Nat\n });\n const AssetNoContent = IDL.Record({\n key: AssetKey,\n updated_at: IDL.Nat64,\n encodings: IDL.Vec(IDL.Tuple(IDL.Text, AssetEncodingNoContent)),\n headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n created_at: IDL.Nat64,\n version: IDL.Opt(IDL.Nat64)\n });\n const AuthenticationConfigInternetIdentity = IDL.Record({\n derivation_origin: IDL.Opt(IDL.Text),\n external_alternative_origins: IDL.Opt(IDL.Vec(IDL.Text))\n });\n const AuthenticationConfig = IDL.Record({\n internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity)\n });\n const ConfigMaxMemorySize = IDL.Record({\n stable: IDL.Opt(IDL.Nat64),\n heap: IDL.Opt(IDL.Nat64)\n });\n const DbConfig = IDL.Record({\n max_memory_size: IDL.Opt(ConfigMaxMemorySize)\n });\n const StorageConfigIFrame = IDL.Variant({\n Deny: IDL.Null,\n AllowAny: IDL.Null,\n SameOrigin: IDL.Null\n });\n const StorageConfigRawAccess = IDL.Variant({\n Deny: IDL.Null,\n Allow: IDL.Null\n });\n const StorageConfigRedirect = IDL.Record({\n status_code: IDL.Nat16,\n location: IDL.Text\n });\n const StorageConfig = IDL.Record({\n iframe: IDL.Opt(StorageConfigIFrame),\n rewrites: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)))),\n max_memory_size: IDL.Opt(ConfigMaxMemorySize),\n raw_access: IDL.Opt(StorageConfigRawAccess),\n redirects: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, StorageConfigRedirect)))\n });\n const Config = IDL.Record({\n db: IDL.Opt(DbConfig),\n authentication: IDL.Opt(AuthenticationConfig),\n storage: StorageConfig\n });\n const Doc = IDL.Record({\n updated_at: IDL.Nat64,\n owner: IDL.Principal,\n data: IDL.Vec(IDL.Nat8),\n description: IDL.Opt(IDL.Text),\n created_at: IDL.Nat64,\n version: IDL.Opt(IDL.Nat64)\n });\n const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});\n const Permission = IDL.Variant({\n Controllers: IDL.Null,\n Private: IDL.Null,\n Public: IDL.Null,\n Managed: IDL.Null\n });\n const RateConfig = IDL.Record({\n max_tokens: IDL.Nat64,\n time_per_token_ns: IDL.Nat64\n });\n const Rule = IDL.Record({\n max_capacity: IDL.Opt(IDL.Nat32),\n memory: IDL.Opt(Memory),\n updated_at: IDL.Nat64,\n max_size: IDL.Opt(IDL.Nat),\n read: Permission,\n created_at: IDL.Nat64,\n version: IDL.Opt(IDL.Nat64),\n mutable_permissions: IDL.Opt(IDL.Bool),\n rate_config: IDL.Opt(RateConfig),\n write: Permission,\n max_changes_per_user: IDL.Opt(IDL.Nat32)\n });\n const HttpRequest = IDL.Record({\n url: IDL.Text,\n method: IDL.Text,\n body: IDL.Vec(IDL.Nat8),\n headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n certificate_version: IDL.Opt(IDL.Nat16)\n });\n const StreamingCallbackToken = IDL.Record({\n memory: Memory,\n token: IDL.Opt(IDL.Text),\n sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),\n headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n index: IDL.Nat64,\n encoding_type: IDL.Text,\n full_path: IDL.Text\n });\n const StreamingStrategy = IDL.Variant({\n Callback: IDL.Record({\n token: StreamingCallbackToken,\n callback: IDL.Func([], [], ['query'])\n })\n });\n const HttpResponse = IDL.Record({\n body: IDL.Vec(IDL.Nat8),\n headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n streaming_strategy: IDL.Opt(StreamingStrategy),\n status_code: IDL.Nat16\n });\n const StreamingCallbackHttpResponse = IDL.Record({\n token: IDL.Opt(StreamingCallbackToken),\n body: IDL.Vec(IDL.Nat8)\n });\n const InitAssetKey = IDL.Record({\n token: IDL.Opt(IDL.Text),\n collection: IDL.Text,\n name: IDL.Text,\n description: IDL.Opt(IDL.Text),\n encoding_type: IDL.Opt(IDL.Text),\n full_path: IDL.Text\n });\n const InitUploadResult = IDL.Record({batch_id: IDL.Nat});\n const ListResults = IDL.Record({\n matches_pages: IDL.Opt(IDL.Nat64),\n matches_length: IDL.Nat64,\n items_page: IDL.Opt(IDL.Nat64),\n items: IDL.Vec(IDL.Tuple(IDL.Text, AssetNoContent)),\n items_length: IDL.Nat64\n });\n const CustomDomain = IDL.Record({\n updated_at: IDL.Nat64,\n created_at: IDL.Nat64,\n version: IDL.Opt(IDL.Nat64),\n bn_id: IDL.Opt(IDL.Text)\n });\n const ListResults_1 = IDL.Record({\n matches_pages: IDL.Opt(IDL.Nat64),\n matches_length: IDL.Nat64,\n items_page: IDL.Opt(IDL.Nat64),\n items: IDL.Vec(IDL.Tuple(IDL.Text, Doc)),\n items_length: IDL.Nat64\n });\n const MemorySize = IDL.Record({stable: IDL.Nat64, heap: IDL.Nat64});\n const SetController = IDL.Record({\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n scope: ControllerScope,\n expires_at: IDL.Opt(IDL.Nat64)\n });\n const SetControllersArgs = IDL.Record({\n controller: SetController,\n controllers: IDL.Vec(IDL.Principal)\n });\n const SetDoc = IDL.Record({\n data: IDL.Vec(IDL.Nat8),\n description: IDL.Opt(IDL.Text),\n version: IDL.Opt(IDL.Nat64)\n });\n const SetRule = IDL.Record({\n max_capacity: IDL.Opt(IDL.Nat32),\n memory: IDL.Opt(Memory),\n max_size: IDL.Opt(IDL.Nat),\n read: Permission,\n version: IDL.Opt(IDL.Nat64),\n mutable_permissions: IDL.Opt(IDL.Bool),\n rate_config: IDL.Opt(RateConfig),\n write: Permission,\n max_changes_per_user: IDL.Opt(IDL.Nat32)\n });\n const UploadChunk = IDL.Record({\n content: IDL.Vec(IDL.Nat8),\n batch_id: IDL.Nat,\n order_id: IDL.Opt(IDL.Nat)\n });\n const UploadChunkResult = IDL.Record({chunk_id: IDL.Nat});\n return IDL.Service({\n build_version: IDL.Func([], [IDL.Text], ['query']),\n commit_asset_upload: IDL.Func([CommitBatch], [], []),\n count_assets: IDL.Func([IDL.Text, ListParams], [IDL.Nat64], ['query']),\n count_collection_assets: IDL.Func([IDL.Text], [IDL.Nat64], ['query']),\n count_collection_docs: IDL.Func([IDL.Text], [IDL.Nat64], ['query']),\n count_docs: IDL.Func([IDL.Text, ListParams], [IDL.Nat64], ['query']),\n del_asset: IDL.Func([IDL.Text, IDL.Text], [], []),\n del_assets: IDL.Func([IDL.Text], [], []),\n del_controllers: IDL.Func(\n [DeleteControllersArgs],\n [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],\n []\n ),\n del_custom_domain: IDL.Func([IDL.Text], [], []),\n del_doc: IDL.Func([IDL.Text, IDL.Text, DelDoc], [], []),\n del_docs: IDL.Func([IDL.Text], [], []),\n del_filtered_assets: IDL.Func([IDL.Text, ListParams], [], []),\n del_filtered_docs: IDL.Func([IDL.Text, ListParams], [], []),\n del_many_assets: IDL.Func([IDL.Vec(IDL.Tuple(IDL.T