@junobuild/core-peer 1.2.1 → 2.0.0

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.
Files changed (69) hide show
  1. package/dist/browser/index.js +1 -1
  2. package/dist/browser/index.js.map +4 -4
  3. package/dist/node/index.mjs +1 -1
  4. package/dist/node/index.mjs.map +4 -4
  5. package/dist/types/{constants → auth/constants}/auth.constants.d.ts +1 -0
  6. package/dist/types/auth/helpers/progress.helpers.d.ts +6 -0
  7. package/dist/types/auth/helpers/window.helpers.d.ts +3 -0
  8. package/dist/types/auth/providers/_auth-client.providers.d.ts +74 -0
  9. package/dist/types/auth/providers/internet-identity.providers.d.ts +28 -0
  10. package/dist/types/auth/providers/nfid.providers.d.ts +28 -0
  11. package/dist/types/auth/providers/webauthn.providers.d.ts +40 -0
  12. package/dist/types/auth/services/_user.services.d.ts +11 -0
  13. package/dist/types/auth/services/auth-timout.services.d.ts +3 -0
  14. package/dist/types/{services → auth/services}/auth.services.d.ts +25 -6
  15. package/dist/types/auth/services/user-webauthn.services.d.ts +8 -0
  16. package/dist/types/{stores → auth/stores}/auth.store.d.ts +3 -3
  17. package/dist/types/auth/types/auth-client.d.ts +43 -0
  18. package/dist/types/auth/types/auth.d.ts +63 -0
  19. package/dist/types/{types → auth/types}/errors.d.ts +6 -0
  20. package/dist/types/auth/types/internet-identity.d.ts +23 -0
  21. package/dist/types/auth/types/nfid.d.ts +22 -0
  22. package/dist/types/auth/types/progress.d.ts +20 -0
  23. package/dist/types/auth/types/provider.d.ts +32 -0
  24. package/dist/types/auth/types/user.d.ts +23 -0
  25. package/dist/types/auth/types/webauthn.d.ts +74 -0
  26. package/dist/types/{utils → auth/utils}/auth.utils.d.ts +1 -0
  27. package/dist/types/{api → datastore/api}/doc.api.d.ts +2 -2
  28. package/dist/types/{services → datastore/services}/doc.services.d.ts +3 -3
  29. package/dist/types/{types → datastore/types}/doc.d.ts +1 -1
  30. package/dist/types/{services → functions/services}/functions.services.d.ts +1 -1
  31. package/dist/types/index.d.ts +32 -22
  32. package/dist/types/{api → storage/api}/storage.api.d.ts +2 -2
  33. package/dist/types/{services → storage/services}/storage.services.d.ts +4 -4
  34. package/dist/types/{types/storage.types.d.ts → storage/types/storage.d.ts} +1 -1
  35. package/dist/workers/auth.worker.js +4 -4
  36. package/dist/workers/auth.worker.js.map +3 -3
  37. package/package.json +3 -3
  38. package/dist/types/providers/auth.providers.d.ts +0 -79
  39. package/dist/types/services/_user.services.d.ts +0 -2
  40. package/dist/types/services/auth-timout.services.d.ts +0 -3
  41. package/dist/types/types/auth.d.ts +0 -90
  42. package/dist/workers/_auth.worker.handler.js +0 -43
  43. package/dist/workers/_auth.worker.handler.js.map +0 -7
  44. /package/dist/types/{types → auth/types}/post-message.d.ts +0 -0
  45. /package/dist/types/{utils → auth/utils}/events.utils.d.ts +0 -0
  46. /package/dist/types/{utils → auth/utils}/window.utils.d.ts +0 -0
  47. /package/dist/types/{workers/_auth.worker.handler.d.ts → auth/workers/auth.worker.d.ts} +0 -0
  48. /package/dist/types/{api → core/api}/actor.api.d.ts +0 -0
  49. /package/dist/types/{constants → core/constants}/call-options.constants.d.ts +0 -0
  50. /package/dist/types/{constants → core/constants}/container.constants.d.ts +0 -0
  51. /package/dist/types/{services/_identity.services.d.ts → core/services/identity.services.d.ts} +0 -0
  52. /package/dist/types/{stores → core/stores}/_agent.factory.d.ts +0 -0
  53. /package/dist/types/{stores → core/stores}/_store.d.ts +0 -0
  54. /package/dist/types/{stores → core/stores}/actor.store.d.ts +0 -0
  55. /package/dist/types/{stores → core/stores}/agent.store.d.ts +0 -0
  56. /package/dist/types/{stores → core/stores}/env.store.d.ts +0 -0
  57. /package/dist/types/{types → core/types}/actor.d.ts +0 -0
  58. /package/dist/types/{types → core/types}/call-options.d.ts +0 -0
  59. /package/dist/types/{types → core/types}/env.d.ts +0 -0
  60. /package/dist/types/{types → core/types}/list.d.ts +0 -0
  61. /package/dist/types/{types → core/types}/satellite.d.ts +0 -0
  62. /package/dist/types/{types → core/types}/subscription.d.ts +0 -0
  63. /package/dist/types/{types → core/types}/utility.d.ts +0 -0
  64. /package/dist/types/{utils → core/utils}/env.utils.d.ts +0 -0
  65. /package/dist/types/{utils → core/utils}/list.utils.d.ts +0 -0
  66. /package/dist/types/{utils → core/utils}/window.env.utils.d.ts +0 -0
  67. /package/dist/types/{utils → datastore/utils}/data.utils.d.ts +0 -0
  68. /package/dist/types/{utils → datastore/utils}/doc.utils.d.ts +0 -0
  69. /package/dist/types/{utils → storage/utils}/crypto.utils.d.ts +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/index.ts", "../../src/services/auth-timout.services.ts", "../../src/stores/_store.ts", "../../src/stores/auth.store.ts", "../../src/utils/events.utils.ts", "../../src/services/auth.services.ts", "../../src/constants/auth.constants.ts", "../../src/providers/auth.providers.ts", "../../src/constants/container.constants.ts", "../../src/stores/env.store.ts", "../../src/utils/window.utils.ts", "../../../utils/src/utils/did.utils.ts", "../../../utils/src/utils/env.utils.ts", "../../src/stores/actor.store.ts", "../../src/stores/agent.store.ts", "../../src/stores/_agent.factory.ts", "../../src/types/errors.ts", "../../src/utils/auth.utils.ts", "../../src/services/_user.services.ts", "../../../errors/src/utils.ts", "../../../errors/src/constants/cdn.constants.ts", "../../../errors/src/constants/collections.constants.ts", "../../../errors/src/constants/satellite.constants.ts", "../../../errors/src/constants/shared.constants.ts", "../../src/api/doc.api.ts", "../../src/utils/data.utils.ts", "../../src/utils/doc.utils.ts", "../../src/utils/list.utils.ts", "../../src/api/actor.api.ts", "../../../ic-client/src/actor/api/actor.api.ts", "../../../../node_modules/@dfinity/utils/src/enums/token.enums.ts", "../../../../node_modules/@dfinity/utils/src/constants/constants.ts", "../../../../node_modules/@dfinity/utils/src/parser/token.ts", "../../../../node_modules/@dfinity/utils/src/services/canister.ts", "../../../../node_modules/@dfinity/utils/src/utils/nullish.utils.ts", "../../../../node_modules/@dfinity/utils/src/services/query.ts", "../../../../node_modules/@dfinity/utils/src/utils/actor.utils.ts", "../../../../node_modules/@dfinity/utils/src/utils/agent.utils.ts", "../../../../node_modules/@dfinity/utils/src/utils/asserts.utils.ts", "../../../../node_modules/@dfinity/utils/src/utils/arrays.utils.ts", "../../../../node_modules/@dfinity/utils/src/utils/base32.utils.ts", "../../../../node_modules/@dfinity/utils/src/utils/base64.utils.ts", "../../../../node_modules/@dfinity/utils/src/utils/crc.utils.ts", "../../../../node_modules/@dfinity/utils/src/utils/json.utils.ts", "../../../../node_modules/@dfinity/utils/src/utils/crypto.utils.ts", "../../../../node_modules/@dfinity/utils/src/utils/date.utils.ts", "../../../../node_modules/@dfinity/utils/src/utils/debounce.utils.ts", "../../../../node_modules/@dfinity/utils/src/utils/did.utils.ts", "../../../../node_modules/@dfinity/utils/src/utils/principal.utils.ts", "../../../../node_modules/@dfinity/utils/src/utils/version.utils.ts", "../../../ic-client/src/declarations/mission_control/mission_control.factory.did.js", "../../../ic-client/src/declarations/orbiter/orbiter.factory.did.js", "../../../ic-client/src/declarations/orbiter/orbiter.factory.certified.did.js", "../../../ic-client/src/declarations/deprecated/satellite-deprecated-no-scope.factory.did.js", "../../../ic-client/src/declarations/deprecated/satellite-deprecated-version.factory.did.js", "../../../ic-client/src/declarations/deprecated/orbiter-deprecated-version.factory.did.js", "../../../ic-client/src/declarations/deprecated/mission_control-deprecated-version.factory.did.js", "../../../ic-client/src/declarations/deprecated/satellite-deprecated.factory.did.js", "../../../ic-client/src/declarations/satellite/satellite.factory.did.js", "../../../ic-client/src/declarations/satellite/satellite.factory.certified.did.js", "../../../ic-client/src/declarations/console/console.factory.did.js", "../../../ic-client/src/declarations/console/console.factory.certified.did.js", "../../../ic-client/src/declarations/sputnik/sputnik.factory.did.js", "../../../ic-client/src/actor/utils/agent.utils.ts", "../../../ic-client/src/actor/api/agent.api.ts", "../../src/utils/env.utils.ts", "../../src/constants/call-options.constants.ts", "../../src/services/_identity.services.ts", "../../src/services/doc.services.ts", "../../src/utils/window.env.utils.ts", "../../src/services/functions.services.ts", "../../src/services/storage.services.ts", "../../src/api/storage.api.ts", "../../../storage/src/services/upload.services.ts", "../../src/utils/crypto.utils.ts"],
4
- "sourcesContent": ["import {assertNonNullish} from '@dfinity/utils';\nimport type {Asset, AssetEncoding, AssetKey, EncodingType, Storage} from '@junobuild/storage';\nimport {initAuthTimeoutWorker} from './services/auth-timout.services';\nimport {initAuth} from './services/auth.services';\nimport {AuthStore} from './stores/auth.store';\nimport {EnvStore} from './stores/env.store';\nimport type {User} from './types/auth';\nimport type {Environment, UserEnvironment} from './types/env';\nimport type {Unsubscribe} from './types/subscription';\nimport {envContainer, envSatelliteId} from './utils/window.env.utils';\nexport * from './providers/auth.providers';\nexport {getIdentityOnce, signIn, signOut, unsafeIdentity} from './services/auth.services';\nexport * from './services/doc.services';\nexport * from './services/functions.services';\nexport * from './services/storage.services';\nexport type * from './types/auth';\nexport type * from './types/doc';\nexport type * from './types/env';\nexport * from './types/errors';\nexport {ListOrder, ListPaginate, ListParams, ListResults} from './types/list';\nexport type * from './types/satellite';\nexport type * from './types/storage.types';\nexport type * from './types/subscription';\nexport type * from './types/utility';\nexport type {Asset, AssetEncoding, AssetKey, EncodingType, Storage};\n\nconst parseEnv = (userEnv?: UserEnvironment): Environment => {\n const satelliteId = userEnv?.satelliteId ?? envSatelliteId();\n\n assertNonNullish(satelliteId, 'Satellite ID is not configured. Juno cannot be initialized.');\n\n const container = userEnv?.container ?? envContainer();\n\n return {\n satelliteId,\n internetIdentityId: userEnv?.internetIdentityId,\n workers: userEnv?.workers,\n container\n };\n};\n\n/**\n * Initializes Juno with the provided optional environment parameters.\n * If no environment is provided, the variables injected by the Vite or NextJS plugins will be used.\n * @deprecated Use {@link initSatellite} instead.\n * @param {UserEnvironment} [userEnv] - The optional user environment configuration.\n * @returns {Promise<Unsubscribe[]>} A promise that resolves to an array of unsubscribe functions.\n */\nexport const initJuno = (userEnv?: UserEnvironment): Promise<Unsubscribe[]> =>\n initSatellite(userEnv);\n\n/**\n * Initializes a Juno satellite with the provided optional environment parameters.\n * If no environment is provided, the variables injected by the Vite or NextJS plugins will be used.\n * @param {UserEnvironment} [userEnv] - The optional user environment configuration.\n * @returns {Promise<Unsubscribe[]>} A promise that resolves to an array of unsubscribe functions.\n */\nexport const initSatellite = async (userEnv?: UserEnvironment): Promise<Unsubscribe[]> => {\n const env = parseEnv(userEnv);\n\n EnvStore.getInstance().set(env);\n\n await initAuth();\n\n const authSubscribe =\n env.workers?.auth !== undefined ? initAuthTimeoutWorker(env.workers.auth) : undefined;\n\n return [...(authSubscribe ? [authSubscribe] : [])];\n};\n\n/**\n * Subscribes to authentication state changes. i.e. each time a user signs in or signs out, the callback will be triggered.\n * @param {function(User | null): void} callback - The callback function to execute when the authentication state changes.\n * @returns {Unsubscribe} A function to unsubscribe from the authentication state changes.\n */\nexport const authSubscribe = (callback: (authUser: User | null) => void): Unsubscribe =>\n AuthStore.getInstance().subscribe(callback);\n", "import {isNullish} from '@dfinity/utils';\nimport {AuthStore} from '../stores/auth.store';\nimport type {User} from '../types/auth';\nimport type {EnvironmentWorker} from '../types/env';\nimport type {PostMessage, PostMessageDataResponseAuth} from '../types/post-message';\nimport type {Unsubscribe} from '../types/subscription';\nimport {emit} from '../utils/events.utils';\nimport {signOut} from './auth.services';\n\nexport const initAuthTimeoutWorker = (auth: EnvironmentWorker): Unsubscribe => {\n const workerUrl = auth === true ? './workers/auth.worker.js' : auth;\n const worker = new Worker(workerUrl);\n\n const timeoutSignOut = async () => {\n emit({message: 'junoSignOutAuthTimer'});\n await signOut();\n };\n\n worker.onmessage = async ({data}: MessageEvent<PostMessage<PostMessageDataResponseAuth>>) => {\n const {msg, data: value} = data;\n\n switch (msg) {\n case 'junoSignOutAuthTimer':\n await timeoutSignOut();\n return;\n case 'junoDelegationRemainingTime':\n emit({message: 'junoDelegationRemainingTime', detail: value?.authRemainingTime});\n return;\n }\n };\n\n return AuthStore.getInstance().subscribe((user: User | null) => {\n if (isNullish(user)) {\n worker.postMessage({msg: 'junoStopAuthTimer'});\n return;\n }\n\n worker.postMessage({msg: 'junoStartAuthTimer'});\n });\n};\n", "export abstract class Store<T> {\n private callbacks: {id: symbol; callback: (data: T | null) => void}[] = [];\n\n protected populate(data: T | null) {\n this.callbacks.forEach(({callback}: {id: symbol; callback: (data: T | null) => void}) =>\n callback(data)\n );\n }\n\n subscribe(callback: (data: T | null) => void): () => void {\n const callbackId = Symbol();\n this.callbacks.push({id: callbackId, callback});\n\n return () =>\n (this.callbacks = this.callbacks.filter(\n ({id}: {id: symbol; callback: (data: T | null) => void}) => id !== callbackId\n ));\n }\n}\n", "import type {User} from '../types/auth';\nimport type {Unsubscribe} from '../types/subscription';\nimport {Store} from './_store';\n\nexport class AuthStore extends Store<User | null> {\n private static instance: AuthStore;\n\n private authUser: User | null = null;\n\n private constructor() {\n super();\n }\n\n static getInstance() {\n if (!AuthStore.instance) {\n AuthStore.instance = new AuthStore();\n }\n return AuthStore.instance;\n }\n\n set(authUser: User | null) {\n this.authUser = authUser;\n\n this.populate(authUser);\n }\n\n get(): User | null {\n return this.authUser;\n }\n\n override subscribe(callback: (data: User | null) => void): Unsubscribe {\n const unsubscribe: () => void = super.subscribe(callback);\n\n callback(this.authUser);\n\n return unsubscribe;\n }\n\n reset() {\n this.authUser = null;\n\n this.populate(this.authUser);\n }\n}\n", "export const emit = <T>({message, detail}: {message: string; detail?: T | undefined}) => {\n const $event: CustomEvent<T> = new CustomEvent<T>(message, {detail, bubbles: true});\n document.dispatchEvent($event);\n};\n", "import type {Identity} from '@dfinity/agent';\nimport {type AuthClient, ERROR_USER_INTERRUPT} from '@dfinity/auth-client';\nimport {isNullish} from '@dfinity/utils';\nimport {\n ALLOW_PIN_AUTHENTICATION,\n DELEGATION_IDENTITY_EXPIRATION\n} from '../constants/auth.constants';\nimport {InternetIdentityProvider} from '../providers/auth.providers';\nimport {ActorStore} from '../stores/actor.store';\nimport {AgentStore} from '../stores/agent.store';\nimport {AuthStore} from '../stores/auth.store';\nimport type {Provider, SignInOptions} from '../types/auth';\nimport {SignInError, SignInInitError, SignInUserInterruptError} from '../types/errors';\nimport {createAuthClient} from '../utils/auth.utils';\nimport {initUser} from './_user.services';\n\nlet authClient: AuthClient | undefined | null;\n\nexport const initAuth = async (provider?: Provider) => {\n authClient = authClient ?? (await createAuthClient());\n\n const isAuthenticated: boolean = (await authClient?.isAuthenticated()) ?? false;\n\n if (!isAuthenticated) {\n return;\n }\n\n const user = await initUser(provider);\n AuthStore.getInstance().set(user);\n};\n\n/**\n * Signs in a user with the specified options.\n *\n * @param {SignInOptions} [options] - The options for signing in.\n * @returns {Promise<void>} A promise that resolves when the sign-in process is complete and the authenticated user is initialized.\n * @throws {SignInError} If the sign-in process fails or no authentication client is available.\n */\nexport const signIn = (options?: SignInOptions): Promise<void> =>\n /* eslint-disable no-async-promise-executor */\n new Promise<void>(async (resolve, reject) => {\n if (isNullish(authClient)) {\n reject(\n new SignInInitError(\n 'No client is ready to perform a sign-in. Have you initialized the Satellite?'\n )\n );\n return;\n }\n\n const provider = options?.provider ?? new InternetIdentityProvider({});\n\n await authClient.login({\n onSuccess: async () => {\n await initAuth(provider.id);\n resolve();\n },\n onError: (error?: string) => {\n if (error === ERROR_USER_INTERRUPT) {\n reject(new SignInUserInterruptError(error));\n return;\n }\n\n reject(new SignInError(error));\n },\n maxTimeToLive: options?.maxTimeToLive ?? DELEGATION_IDENTITY_EXPIRATION,\n allowPinAuthentication: options?.allowPin ?? ALLOW_PIN_AUTHENTICATION,\n ...(options?.derivationOrigin !== undefined && {derivationOrigin: options.derivationOrigin}),\n ...provider.signInOptions({\n windowed: options?.windowed\n })\n });\n });\n\n/**\n * Signs out the current user.\n * @returns {Promise<void>} A promise that resolves when the sign-out process is complete.\n */\nexport const signOut = async (): Promise<void> => {\n await resetAuth();\n\n // Recreate an HttpClient immediately because next sign-in, if window is not reloaded, would fail if the agent is created within the process.\n // For example, Safari blocks the Internet Identity (II) window if the agent is created during the interaction.\n // Agent-js must be created either globally or at least before performing a sign-in.\n authClient = await createAuthClient();\n};\n\n/**\n * \u2139\uFE0F Exposed for testing purpose only. Should not be leaked to consumer or used by the library.\n */\nexport const resetAuth = async () => {\n await authClient?.logout();\n\n // Reset local object otherwise next sign in (sign in - sign out - sign in) might not work out - i.e. agent-js might not recreate the delegation or identity if not resetted\n // Technically we do not need this since we recreate the agent below. We just keep it to make the reset explicit.\n authClient = null;\n\n AuthStore.getInstance().reset();\n\n ActorStore.getInstance().reset();\n AgentStore.getInstance().reset();\n};\n\nexport const getIdentity = (): Identity | undefined => authClient?.getIdentity();\n\n/**\n * Returns the identity of a signed-in user or an anonymous identity.\n * This function is useful for loading an identity in web workers.\n * Used to imperatively get the identity. Please be certain before using it.\n * @returns {Promise<Identity>} A promise that resolves to the identity of the user or an anonymous identity.\n */\nexport const unsafeIdentity = async (): Promise<Identity> =>\n (authClient ?? (await createAuthClient())).getIdentity();\n\n/**\n * Returns the current identity if the user is authenticated.\n *\n * \u26A0\uFE0F Use this function imperatively only. Do **not** persist the identity in global state.\n * It is intended for short-lived or one-time operations.\n *\n * Typical use case is to enable developers to implement custom features for the Internet Computer:\n * - Passing the identity to temporarily create an actor or agent to call a canister\n * - Signing a message or making a one-time authenticated call\n *\n * @returns The authenticated identity, or null if unavailable.\n */\nexport const getIdentityOnce = async (): Promise<Identity | null> => {\n const user = AuthStore.getInstance().get();\n\n if (isNullish(user)) {\n return null;\n }\n\n const authenticated = (await authClient?.isAuthenticated()) ?? false;\n\n if (!authenticated) {\n return null;\n }\n\n return authClient?.getIdentity() ?? null;\n};\n", "// How long the delegation identity should remain valid?\n// e.g. BigInt(7 * 24 * 60 * 60 * 1000 * 1000 * 1000) = 7 days in nanoseconds\n// For Juno: 4 hours\nexport const DELEGATION_IDENTITY_EXPIRATION = BigInt(4 * 60 * 60 * 1000 * 1000 * 1000);\n\n// We consider PIN authentication as \"insecure\" because users can easily lose their PIN if they do not register a passphrase, especially since Safari clears the browser cache every two weeks in cases of inactivity.\n// That's why we disable it by default.\nexport const ALLOW_PIN_AUTHENTICATION = false;\n\nexport const II_POPUP: {width: number; height: number} = {width: 576, height: 576};\nexport const NFID_POPUP: {width: number; height: number} = {width: 505, height: 705};\n\nexport const INTERNET_COMPUTER_ORG = 'internetcomputer.org';\n\n// Worker\nexport const AUTH_TIMER_INTERVAL = 1000;\n", "import {isNullish, nonNullish} from '@dfinity/utils';\nimport {II_POPUP, INTERNET_COMPUTER_ORG, NFID_POPUP} from '../constants/auth.constants';\nimport {DOCKER_CONTAINER_URL, DOCKER_INTERNET_IDENTITY_ID} from '../constants/container.constants';\nimport {EnvStore} from '../stores/env.store';\nimport type {\n InternetIdentityConfig,\n InternetIdentityDomain,\n NFIDConfig,\n Provider,\n SignInOptions\n} from '../types/auth';\nimport {popupCenter} from '../utils/window.utils';\n\n/**\n * Options for signing in with an authentication provider.\n * @interface AuthProviderSignInOptions\n */\nexport interface AuthProviderSignInOptions {\n /**\n * The URL of the identity provider - commonly Internet Identity.\n */\n identityProvider: string;\n /**\n * Optional features for the window opener.\n */\n windowOpenerFeatures?: string;\n}\n\n/**\n * Common traits for all authentication providers\n * @interface AuthProvider\n */\nexport interface AuthProvider {\n /**\n * The unique identifier of the provider.\n */\n readonly id: Provider;\n /**\n * Method to get the sign-in options for the provider.\n * @param options - The sign-in options.\n * @returns The sign-in options for the provider that can be use to effectively perform a sign-in.\n */\n signInOptions: (options: Pick<SignInOptions, 'windowed'>) => AuthProviderSignInOptions;\n}\n\n/**\n * Internet Identity authentication provider.\n * @class InternetIdentityProvider\n * @implements {AuthProvider}\n */\nexport class InternetIdentityProvider implements AuthProvider {\n #domain?: InternetIdentityDomain;\n\n /**\n * Creates an instance of InternetIdentityProvider.\n * @param {InternetIdentityConfig} config - The configuration for Internet Identity.\n */\n constructor({domain}: InternetIdentityConfig) {\n this.#domain = domain;\n }\n\n /**\n * Gets the identifier of the provider.\n * @returns {Provider} The identifier of the provider - `internet_identity`.\n */\n get id(): Provider {\n return 'internet_identity';\n }\n\n /**\n * Gets the sign-in options for Internet Identity.\n * @param {Pick<SignInOptions, 'windowed'>} options - The sign-in options.\n * @returns {AuthProviderSignInOptions} The sign-in options for Internet Identity.\n */\n signInOptions({windowed}: Pick<SignInOptions, 'windowed'>): AuthProviderSignInOptions {\n const identityProviderUrl = (): string => {\n const container = EnvStore.getInstance().get()?.container;\n\n // Production\n if (isNullish(container) || container === false) {\n return `https://identity.${this.#domain ?? INTERNET_COMPUTER_ORG}`;\n }\n\n const env = EnvStore.getInstance().get();\n\n const internetIdentityId =\n nonNullish(env) && nonNullish(env?.internetIdentityId)\n ? env.internetIdentityId\n : DOCKER_INTERNET_IDENTITY_ID;\n\n const {host: containerHost, protocol} = new URL(\n container === true ? DOCKER_CONTAINER_URL : container\n );\n\n return /apple/i.test(navigator?.vendor)\n ? `${protocol}//${containerHost}?canisterId=${internetIdentityId}`\n : `${protocol}//${internetIdentityId}.${containerHost.replace('127.0.0.1', 'localhost')}`;\n };\n\n return {\n ...(windowed !== false && {\n windowOpenerFeatures: popupCenter(II_POPUP)\n }),\n identityProvider: identityProviderUrl()\n };\n }\n}\n\n/**\n * NFID authentication provider.\n * @class NFIDProvider\n * @implements {AuthProvider}\n */\nexport class NFIDProvider implements AuthProvider {\n #appName: string;\n #logoUrl: string;\n\n /**\n * Creates an instance of NFIDProvider.\n * @param {NFIDConfig} config - The configuration for NFID.\n */\n constructor({appName, logoUrl}: NFIDConfig) {\n this.#appName = appName;\n this.#logoUrl = logoUrl;\n }\n\n /**\n * Gets the identifier of the provider.\n * @returns {Provider} The identifier of the provider- nfid.\n */\n get id(): Provider {\n return 'nfid';\n }\n\n /**\n * Gets the sign-in options for NFID.\n * @param {Pick<SignInOptions, 'windowed'>} options - The sign-in options.\n * @returns {AuthProviderSignInOptions} The sign-in options to effectively sign-in with NFID.\n */\n signInOptions({windowed}: Pick<SignInOptions, 'windowed'>): AuthProviderSignInOptions {\n return {\n ...(windowed !== false && {\n windowOpenerFeatures: popupCenter(NFID_POPUP)\n }),\n identityProvider: `https://nfid.one/authenticate/?applicationName=${encodeURI(\n this.#appName\n )}&applicationLogo=${encodeURI(this.#logoUrl)}`\n };\n }\n}\n", "export const DOCKER_CONTAINER_URL = 'http://127.0.0.1:5987';\nexport const DOCKER_INTERNET_IDENTITY_ID = 'rdmx6-jaaaa-aaaaa-aaadq-cai';\n", "import type {Environment} from '../types/env';\nimport {Store} from './_store';\n\nexport class EnvStore extends Store<Environment | undefined> {\n private static instance: EnvStore;\n\n private env: Environment | undefined | null;\n\n private constructor() {\n super();\n }\n\n static getInstance() {\n if (!EnvStore.instance) {\n EnvStore.instance = new EnvStore();\n }\n return EnvStore.instance;\n }\n\n set(env: Environment | undefined) {\n this.env = env;\n\n this.populate(env);\n }\n\n get(): Environment | undefined | null {\n return this.env;\n }\n\n reset() {\n this.env = null;\n }\n\n override subscribe(callback: (data: Environment | null | undefined) => void): () => void {\n const unsubscribe: () => void = super.subscribe(callback);\n\n callback(this.env);\n\n return unsubscribe;\n }\n}\n", "import {isNullish} from '@dfinity/utils';\nimport {isBrowser} from '@junobuild/utils';\n\nexport const popupCenter = ({\n width,\n height\n}: {\n width: number;\n height: number;\n}): string | undefined => {\n if (!isBrowser()) {\n return undefined;\n }\n\n if (isNullish(window) || isNullish(window.top)) {\n return undefined;\n }\n\n const {\n top: {innerWidth, innerHeight}\n } = window;\n\n const y = innerHeight / 2 + screenY - height / 2;\n const x = innerWidth / 2 + screenX - width / 2;\n\n return `toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=${width}, height=${height}, top=${y}, left=${x}`;\n};\n", "import {jsonReplacer, jsonReviver} from '@dfinity/utils';\n\n/**\n * Converts data to a Uint8Array for transmission or storage.\n * @template T\n * @param {T} data - The data to convert.\n * @returns {Promise<Uint8Array>} A promise that resolves to a Uint8Array representation of the data.\n */\nexport const toArray = async <T>(data: T): Promise<Uint8Array> => {\n const blob: Blob = new Blob([JSON.stringify(data, jsonReplacer)], {\n type: 'application/json; charset=utf-8'\n });\n return new Uint8Array(await blob.arrayBuffer());\n};\n\n/**\n * Converts a Uint8Array or number array back to the original data type.\n * @template T\n * @param {(Uint8Array | number[])} data - The array to convert.\n * @returns {Promise<T>} A promise that resolves to the original data.\n */\nexport const fromArray = async <T>(data: Uint8Array | number[]): Promise<T> => {\n const blob: Blob = new Blob([data instanceof Uint8Array ? data : new Uint8Array(data)], {\n type: 'application/json; charset=utf-8'\n });\n return JSON.parse(await blob.text(), jsonReviver);\n};\n", "/**\n * Checks if the current environment is a browser.\n * @returns {boolean} True if the current environment is a browser, false otherwise.\n */\nexport const isBrowser = (): boolean => typeof window !== `undefined`;\n", "import {Actor, type ActorMethod, type ActorSubclass} from '@dfinity/agent';\nimport type {IDL} from '@dfinity/candid';\nimport {isNullish} from '@dfinity/utils';\nimport type {ActorKey} from '../types/actor';\nimport type {SatelliteContext} from '../types/satellite';\nimport {AgentStore} from './agent.store';\n\ntype ActorParams = {\n idlFactory: IDL.InterfaceFactory;\n} & Required<Pick<SatelliteContext, 'satelliteId' | 'identity'>> &\n Pick<SatelliteContext, 'container'>;\n\ntype ActorRecord = Record<string, ActorMethod>;\n\nexport class ActorStore {\n private static instance: ActorStore;\n\n #actors: Record<string, ActorSubclass<ActorRecord>> | undefined | null = undefined;\n\n private constructor() {}\n\n static getInstance() {\n if (isNullish(ActorStore.instance)) {\n ActorStore.instance = new ActorStore();\n }\n return ActorStore.instance;\n }\n\n async getActor<T = ActorRecord>({\n satelliteId,\n identity,\n actorKey,\n ...rest\n }: ActorParams & {actorKey: ActorKey}): Promise<ActorSubclass<T>> {\n const key = `${actorKey}#${identity.getPrincipal().toText()}#${satelliteId};`;\n\n if (isNullish(this.#actors) || isNullish(this.#actors[key])) {\n const actor = await this.createActor({satelliteId, identity, ...rest});\n\n this.#actors = {\n ...(this.#actors ?? {}),\n [key]: actor\n };\n\n return actor as ActorSubclass<T>;\n }\n\n return this.#actors[key] as ActorSubclass<T>;\n }\n\n reset() {\n this.#actors = null;\n }\n\n private async createActor<T = ActorRecord>({\n idlFactory,\n satelliteId: canisterId,\n ...rest\n }: ActorParams): Promise<ActorSubclass<T>> {\n const agent = await AgentStore.getInstance().getAgent(rest);\n\n return Actor.createActor(idlFactory, {\n agent,\n canisterId\n });\n }\n}\n", "import type {Agent, HttpAgent} from '@dfinity/agent';\nimport {isNullish} from '@dfinity/utils';\nimport {type CreateAgentParams, createAgent} from './_agent.factory';\n\nexport class AgentStore {\n private static instance: AgentStore;\n\n #agents: Record<string, HttpAgent> | undefined | null = undefined;\n\n private constructor() {}\n\n static getInstance() {\n if (isNullish(AgentStore.instance)) {\n AgentStore.instance = new AgentStore();\n }\n return AgentStore.instance;\n }\n\n async getAgent({identity, ...rest}: CreateAgentParams): Promise<Agent> {\n const key = identity.getPrincipal().toText();\n\n if (isNullish(this.#agents) || isNullish(this.#agents[key])) {\n const agent = await createAgent({identity, ...rest});\n\n this.#agents = {\n ...(this.#agents ?? {}),\n [key]: agent\n };\n\n return agent;\n }\n\n return this.#agents[key];\n }\n\n reset() {\n this.#agents = null;\n }\n}\n", "import {HttpAgent} from '@dfinity/agent';\nimport {nonNullish} from '@dfinity/utils';\nimport {DOCKER_CONTAINER_URL} from '../constants/container.constants';\nimport type {SatelliteContext} from '../types/satellite';\n\nexport type CreateAgentParams = Required<Pick<SatelliteContext, 'identity'>> &\n Pick<SatelliteContext, 'container'>;\n\nexport const createAgent = async ({identity, container}: CreateAgentParams): Promise<HttpAgent> => {\n const localActor = nonNullish(container) && container !== false;\n\n const host = localActor\n ? container === true\n ? DOCKER_CONTAINER_URL\n : container\n : 'https://icp-api.io';\n\n const shouldFetchRootKey = nonNullish(container);\n\n return await HttpAgent.create({\n identity,\n shouldFetchRootKey,\n host\n });\n};\n", "export class SignInError extends Error {}\nexport class SignInInitError extends Error {}\nexport class SignInUserInterruptError extends Error {}\n\nexport class InitError extends Error {}\n\nexport class ListError extends Error {}\n", "import {AuthClient} from '@dfinity/auth-client';\n\nexport const createAuthClient = (): Promise<AuthClient> =>\n AuthClient.create({\n idleOptions: {\n disableIdle: true,\n disableDefaultIdleCallback: true\n }\n });\n", "import type {Identity} from '@dfinity/agent';\nimport {isNullish, nonNullish} from '@dfinity/utils';\nimport {isSatelliteError, JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE} from '@junobuild/errors';\nimport type {Provider, User, UserData} from '../types/auth';\nimport {InitError} from '../types/errors';\nimport {getIdentity} from './auth.services';\nimport {getDoc, setDoc} from './doc.services';\n\nexport const initUser = async (provider?: Provider): Promise<User> => {\n const identity: Identity | undefined = getIdentity();\n\n if (isNullish(identity)) {\n throw new InitError('No identity to initialize the user. Have you initialized Juno?');\n }\n\n const userId = identity.getPrincipal().toText();\n\n const loadUser = (): Promise<User | undefined> =>\n getDoc<UserData>({\n collection: `#user`,\n key: userId\n });\n\n const user = await loadUser();\n\n if (nonNullish(user)) {\n return user;\n }\n\n try {\n return await createUser({userId, provider});\n } catch (error: unknown) {\n // When a user signs in for the first time and get user returns `undefined`,\n // a new user entry is created. If the browser is reloaded and get user\n // still returns `undefined`, another try is made to create user entry, which is not\n // allowed since only the controller can update users, assuming the entry has been\n // created in the meantime. To prevent errors, we reload the user data,\n // as the issue indicates the user entity exists.\n if (isSatelliteError({error, type: JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE})) {\n const userOnCreateError = await loadUser();\n\n if (nonNullish(userOnCreateError)) {\n return userOnCreateError;\n }\n }\n\n throw error;\n }\n};\n\nconst createUser = ({\n userId,\n ...rest\n}: {\n userId: string;\n} & UserData): Promise<User> =>\n setDoc<UserData>({\n collection: `#user`,\n doc: {\n key: userId,\n data: rest\n }\n });\n", "export const isSatelliteError = ({error, type}: {error: unknown; type: string}): boolean => {\n if (typeof error === 'string') {\n return error.includes(type);\n }\n\n if (error instanceof Error) {\n return error.message.includes(type);\n }\n\n return false;\n};\n", "export const JUNO_CDN_PROPOSALS_ERROR_CANNOT_SUBMIT = 'juno.cdn.proposals.error.cannot_submit';\nexport const JUNO_CDN_PROPOSALS_ERROR_CANNOT_SUBMIT_INVALID_STATUS =\n 'juno.cdn.proposals.error.cannot_submit_invalid_status';\n\nexport const JUNO_CDN_PROPOSALS_ERROR_CANNOT_REJECT = 'juno.cdn.proposals.error.cannot_reject';\nexport const JUNO_CDN_PROPOSALS_ERROR_CANNOT_REJECT_INVALID_STATUS =\n 'juno.cdn.proposals.error.cannot_reject_invalid_status';\n\nexport const JUNO_CDN_PROPOSALS_ERROR_CANNOT_COMMIT = 'juno.cdn.proposals.error.cannot_commit';\nexport const JUNO_CDN_PROPOSALS_ERROR_CANNOT_COMMIT_INVALID_STATUS =\n 'juno.cdn.proposals.error.cannot_commit_invalid_status';\n\nexport const JUNO_CDN_PROPOSALS_ERROR_INVALID_HASH = 'juno.cdn.proposals.error.invalid_hash';\n\nexport const JUNO_CDN_PROPOSALS_ERROR_UNKNOWN_TYPE = 'juno.cdn.proposals.error.unknown_type';\n\nexport const JUNO_CDN_PROPOSALS_ERROR_EMPTY_CONTENT_CHUNKS =\n 'juno.cdn.proposals.error.empty_content_chunks';\nexport const JUNO_CDN_PROPOSALS_ERROR_NOT_CONTENT_CHUNKS_AT_INDEX =\n 'juno.cdn.proposals.error.no_content_chunks_at_index';\n\nexport const JUNO_CDN_PROPOSALS_ERROR_EMPTY_ASSETS = 'juno.cdn.proposals.error.empty_assets';\nexport const JUNO_CDN_PROPOSALS_ERROR_CANNOT_DELETE_ASSETS =\n 'juno.cdn.proposals.error.cannot_delete_assets';\nexport const JUNO_CDN_PROPOSALS_ERROR_CANNOT_DELETE_ASSETS_INVALID_STATUS =\n 'juno.cdn.proposals.error.cannot_delete_assets_invalid_status';\n\nexport const JUNO_CDN_PROPOSALS_ERROR_NEXT_ID_CONVERT = 'juno.cdn.proposals.error.next_id_convert';\nexport const JUNO_CDN_PROPOSALS_ERROR_NEXT_ID_OVERFLOW =\n 'juno.cdn.proposals.error.next_id_overflow';\n\nexport const JUNO_CDN_STORAGE_ERROR_CANNOT_INSERT_ASSET_UNKNOWN_REFERENCE_ID =\n 'juno.cdn.storage.error.cannot_insert_asset_unknown_reference_id';\nexport const JUNO_CDN_STORAGE_ERROR_CANNOT_GET_ASSET_UNKNOWN_REFERENCE_ID =\n 'juno.cdn.storage.error.cannot_get_asset_unknown_reference_id';\nexport const JUNO_CDN_STORAGE_ERROR_CANNOT_INSERT_ASSET_ENCODING_UNKNOWN_REFERENCE_ID =\n 'juno.cdn.storage.error.cannot_insert_asset_encoding_unknown_reference_id';\n\nexport const JUNO_CDN_STORAGE_ERROR_NO_PROPOSAL_FOUND = 'juno.cdn.storage.error.no_proposal_found';\n\nexport const JUNO_CDN_STORAGE_ERROR_INVALID_RELEASES_PATH =\n 'juno.cdn.storage.error.invalid_releases_path';\n\nexport const JUNO_CDN_STORAGE_ERROR_MISSING_RELEASES_DESCRIPTION =\n 'juno.cdn.storage.error.missing_releases_description';\n\nexport const JUNO_CDN_STORAGE_ERROR_INVALID_RELEASES_DESCRIPTION =\n 'juno.cdn.storage.error.invalid_releases_description';\n\nexport const JUNO_CDN_STORAGE_ERROR_INVALID_COLLECTION =\n 'juno.cdn.storage.error.invalid_collection';\n", "export const JUNO_COLLECTIONS_ERROR_MODIFY_RESERVED_COLLECTION =\n 'juno.collections.error.modify_reserved_collection';\nexport const JUNO_COLLECTIONS_ERROR_RESERVED_NAME = 'juno.collections.error.reserved_name';\nexport const JUNO_COLLECTIONS_ERROR_RESERVED_COLLECTION =\n 'juno.collections.error.reserved_collection';\nexport const JUNO_COLLECTIONS_ERROR_RATE_CONFIG_ENABLED =\n 'juno.collections.error.rate_config_enabled';\nexport const JUNO_COLLECTIONS_ERROR_DELETE_PREFIX_RESERVED =\n 'juno.collections.error.prefix_deletion';\nexport const JUNO_COLLECTIONS_ERROR_COLLECTION_NOT_EMPTY = 'juno.collections.error.not_empty';\nexport const JUNO_COLLECTIONS_ERROR_COLLECTION_NOT_FOUND = 'juno.collections.error.not_found';\nexport const JUNO_COLLECTIONS_ERROR_PREFIX_RESERVED = 'juno.collections.error.prefix_reserved';\n", "export const JUNO_ERROR_NO_TIMESTAMP_PROVIDED = 'juno.error.no_timestamp_provided';\nexport const JUNO_ERROR_TIMESTAMP_OUTDATED_OR_FUTURE = 'juno.error.timestamp_outdated_or_future';\nexport const JUNO_ERROR_NO_VERSION_PROVIDED = 'juno.error.no_version_provided';\nexport const JUNO_ERROR_VERSION_OUTDATED_OR_FUTURE = 'juno.error.version_outdated_or_future';\n\nexport const JUNO_DATASTORE_ERROR_CANNOT_WRITE = 'juno.datastore.error.cannot_write';\nexport const JUNO_DATASTORE_ERROR_CANNOT_READ = 'juno.datastore.error.cannot_read';\n\nexport const JUNO_STORAGE_ERROR_UPLOAD_NOT_ALLOWED = 'juno.storage.error.upload_not_allowed';\nexport const JUNO_STORAGE_ERROR_SET_NOT_ALLOWED = 'juno.storage.error.set_not_allowed';\nexport const JUNO_STORAGE_ERROR_CANNOT_COMMIT_INVALID_COLLECTION =\n 'juno.storage.error.cannot_commit_invalid_collection';\nexport const JUNO_STORAGE_ERROR_CANNOT_COMMIT_BATCH = 'juno.storage.error.cannot_commit_batch';\nexport const JUNO_STORAGE_ERROR_ASSET_NOT_FOUND = 'juno.storage.error.asset_not_found';\nexport const JUNO_STORAGE_ERROR_CANNOT_READ_ASSET = 'juno.storage.error.cannot_read_asset';\nexport const JUNO_STORAGE_ERROR_UPLOAD_PATH_COLLECTION_PREFIX =\n 'juno.storage.error.upload_path_collection_prefix';\nexport const JUNO_STORAGE_ERROR_RESERVED_ASSET = 'juno.storage.error.reserved_asset';\nexport const JUNO_STORAGE_ERROR_BATCH_NOT_FOUND = 'juno.storage.error.batch_not_found';\nexport const JUNO_STORAGE_ERROR_CHUNK_NOT_FOUND = 'juno.storage.error.chunk_not_found';\nexport const JUNO_STORAGE_ERROR_CHUNK_NOT_INCLUDED_IN_BATCH =\n 'juno.storage.error.chunk_not_included_in_batch';\nexport const JUNO_STORAGE_ERROR_CHUNK_TO_COMMIT_NOT_FOUND =\n 'juno.storage.error.chunk_to_commit_not_found';\nexport const JUNO_STORAGE_ERROR_ASSET_MAX_ALLOWED_SIZE =\n 'juno.storage.error.asset_max_allowed_size';\n\nexport const JUNO_AUTH_ERROR_NOT_ADMIN_CONTROLLER = 'juno.auth.error.not_admin_controller';\nexport const JUNO_AUTH_ERROR_INVALID_ORIGIN = 'juno.auth.error.invalid_origin';\nexport const JUNO_AUTH_ERROR_NOT_WRITE_CONTROLLER = 'juno.auth.error.not_write_controller';\nexport const JUNO_AUTH_ERROR_NOT_CONTROLLER = 'juno.auth.error.not_controller';\nexport const JUNO_AUTH_ERROR_CALLER_NOT_ALLOWED = 'juno.auth.error.caller.not_allowed';\n\nexport const JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE = 'juno.datastore.error.user.cannot_update';\nexport const JUNO_DATASTORE_ERROR_USER_INVALID_DATA = 'juno.datastore.error.user.invalid_data';\nexport const JUNO_DATASTORE_ERROR_USER_CALLER_KEY = 'juno.datastore.error.user.caller_key';\nexport const JUNO_DATASTORE_ERROR_USER_KEY_NO_PRINCIPAL =\n 'juno.datastore.error.user.key_no_principal';\nexport const JUNO_DATASTORE_ERROR_USER_NOT_ALLOWED = 'juno.datastore.error.user.not_allowed';\n\nexport const JUNO_DATASTORE_ERROR_USER_USAGE_CHANGE_LIMIT_REACHED =\n 'juno.datastore.error.user.usage.change_limit_reached';\nexport const JUNO_DATASTORE_ERROR_USER_USAGE_INVALID_DATA =\n 'juno.datastore.error.user.usage.invalid_data';\n\nexport const JUNO_DATASTORE_ERROR_USER_WEBAUTHN_CANNOT_UPDATE =\n 'juno.datastore.error.user.webauthn.cannot_update';\nexport const JUNO_DATASTORE_ERROR_USER_WEBAUTHN_INVALID_DATA =\n 'juno.datastore.error.user.webauthn.invalid_data';\nexport const JUNO_DATASTORE_ERROR_USER_WEBAUTHN_CALLER_KEY =\n 'juno.datastore.error.user.webauthn.caller_key';\n", "export const JUNO_ERROR_CONTROLLERS_MAX_NUMBER = 'juno.error.controllers.max_number';\nexport const JUNO_ERROR_CONTROLLERS_ANONYMOUS_NOT_ALLOWED =\n 'juno.error.controllers.anonymous_not_allowed';\nexport const JUNO_ERROR_CONTROLLERS_REVOKED_NOT_ALLOWED =\n 'juno.error.controllers.revoked_not_allowed';\n\nexport const JUNO_ERROR_MEMORY_STABLE_EXCEEDED = 'juno.error.memory.stable_exceeded';\nexport const JUNO_ERROR_MEMORY_HEAP_EXCEEDED = 'juno.error.memory.heap_exceeded';\n\nexport const JUNO_ERROR_CYCLES_DEPOSIT_BALANCE_LOW = 'juno.error.cycles.deposit_balance_low';\nexport const JUNO_ERROR_CYCLES_DEPOSIT_FAILED = 'juno.error.cycles.deposit_failed';\n\nexport const JUNO_ERROR_CANISTER_CREATE_FAILED = 'juno.error.canister.create_failed';\nexport const JUNO_ERROR_CANISTER_INSTALL_CODE_FAILED = 'juno.error.canister.install_code_failed';\n\nexport const JUNO_ERROR_SEGMENT_STOP_FAILED = 'juno.error.segment.stop_failed';\nexport const JUNO_ERROR_SEGMENT_DELETE_FAILED = 'juno.error.segment.delete_failed';\n\nexport const JUNO_ERROR_CMC_CALL_LEDGER_FAILED = 'juno.error.cmc.call_ledger_failed';\nexport const JUNO_ERROR_CMC_LEDGER_TRANSFER_FAILED = 'juno.error.cmc.ledger_transfer_failed';\nexport const JUNO_ERROR_CMC_TOP_UP_FAILED = 'juno.error.cmc.top_up_failed';\nexport const JUNO_ERROR_CMC_CALL_CREATE_CANISTER_FAILED =\n 'juno.error.cmc.call_create_canister_failed';\nexport const JUNO_ERROR_CMC_CREATE_CANISTER_FAILED = 'juno.error.cmc.create_canister_failed';\nexport const JUNO_ERROR_CMC_INSTALL_CODE_FAILED = 'juno.error.cmc.install_code_failed';\n\nexport const JUNO_ERROR_INVALID_REGEX = 'juno.error.invalid_regex';\n", "import {fromNullable, isNullish, nonNullish} from '@dfinity/utils';\nimport type {SatelliteDid} from '@junobuild/ic-client/actor';\nimport type {ActorReadParams, ActorUpdateParams} from '../types/actor';\nimport type {Doc} from '../types/doc';\nimport type {ListParams, ListResults} from '../types/list';\nimport type {ExcludeDate} from '../types/utility';\nimport {mapData} from '../utils/data.utils';\nimport {fromDoc, toDelDoc, toSetDoc} from '../utils/doc.utils';\nimport {toListParams} from '../utils/list.utils';\nimport {getSatelliteActor} from './actor.api';\n\nexport const getDoc = async <D>({\n collection,\n key,\n ...rest\n}: {\n collection: string;\n} & ActorReadParams &\n Pick<Doc<D>, 'key'>): Promise<Doc<D> | undefined> => {\n const {get_doc} = await getSatelliteActor(rest);\n\n const doc = fromNullable(await get_doc(collection, key));\n\n if (isNullish(doc)) {\n return undefined;\n }\n\n return fromDoc({doc, key});\n};\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const getManyDocs = async ({\n docs,\n ...rest\n}: {\n docs: ({collection: string} & Pick<Doc<any>, 'key'>)[];\n} & ActorReadParams): Promise<(Doc<any> | undefined)[]> => {\n const {get_many_docs} = await getSatelliteActor(rest);\n\n const payload: [string, string][] = docs.map(({collection, key}) => [collection, key]);\n\n const resultsDocs = await get_many_docs(payload);\n\n const results: (Doc<any> | undefined)[] = [];\n for (const [key, resultDoc] of resultsDocs) {\n const doc = fromNullable(resultDoc);\n results.push(nonNullish(doc) ? await fromDoc({key, doc}) : undefined);\n }\n\n return results;\n};\n/* eslint-enable */\n\nexport const setDoc = async <D>({\n collection,\n doc,\n ...rest\n}: {\n collection: string;\n doc: Doc<D>;\n} & ActorUpdateParams): Promise<Doc<D>> => {\n const {set_doc} = await getSatelliteActor(rest);\n\n const {key} = doc;\n\n const setDoc = await toSetDoc(doc);\n\n const updatedDoc = await set_doc(collection, key, setDoc);\n\n return await fromDoc({key, doc: updatedDoc});\n};\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const setManyDocs = async ({\n docs,\n ...rest\n}: {\n docs: {collection: string; doc: Doc<any>}[];\n} & ActorUpdateParams): Promise<Doc<any>[]> => {\n const {set_many_docs} = await getSatelliteActor(rest);\n\n const payload: [string, string, SatelliteDid.SetDoc][] = [];\n for (const {collection, doc} of docs) {\n const {key} = doc;\n payload.push([collection, key, await toSetDoc(doc)]);\n }\n\n const updatedDocs = await set_many_docs(payload);\n\n const results: Doc<any>[] = [];\n for (const [key, updatedDoc] of updatedDocs) {\n results.push(await fromDoc({key, doc: updatedDoc}));\n }\n\n return results;\n};\n/* eslint-enable */\n\nexport const deleteDoc = async <D>({\n collection,\n doc,\n ...rest\n}: {\n collection: string;\n doc: Doc<D>;\n} & ActorUpdateParams): Promise<void> => {\n const {del_doc} = await getSatelliteActor(rest);\n\n const {key} = doc;\n\n return del_doc(collection, key, toDelDoc(doc));\n};\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const deleteManyDocs = async ({\n docs,\n ...rest\n}: {\n docs: {collection: string; doc: Doc<any>}[];\n} & ActorUpdateParams): Promise<void> => {\n const {del_many_docs} = await getSatelliteActor(rest);\n\n const payload: [string, string, SatelliteDid.DelDoc][] = docs.map(({collection, doc}) => [\n collection,\n doc.key,\n toDelDoc(doc)\n ]);\n\n await del_many_docs(payload);\n};\n/* eslint-enable */\n\nexport const deleteFilteredDocs = async ({\n collection,\n filter,\n ...rest\n}: {\n collection: string;\n filter: ListParams;\n} & ActorUpdateParams): Promise<void> => {\n const {del_filtered_docs} = await getSatelliteActor(rest);\n\n return del_filtered_docs(collection, toListParams(filter));\n};\n\nexport const listDocs = async <D>({\n collection,\n filter,\n ...rest\n}: {\n collection: string;\n filter: ListParams;\n} & ActorReadParams): Promise<ListResults<Doc<D>>> => {\n const {list_docs} = await getSatelliteActor(rest);\n\n const {items, items_page, items_length, matches_length, matches_pages} = await list_docs(\n collection,\n toListParams(filter)\n );\n\n const docs: Doc<D>[] = [];\n\n for (const [key, item] of items) {\n const {data: dataArray, owner, description, version, ...rest} = item;\n\n docs.push({\n key,\n description: fromNullable(description),\n owner: owner.toText(),\n data: await mapData<ExcludeDate<D>>({data: dataArray}),\n version: fromNullable(version),\n ...rest\n });\n }\n\n return {\n items: docs,\n items_length,\n items_page: fromNullable(items_page),\n matches_length,\n matches_pages: fromNullable(matches_pages)\n };\n};\n\nexport const countDocs = async ({\n collection,\n filter,\n ...rest\n}: {\n collection: string;\n filter: ListParams;\n} & ActorReadParams): Promise<bigint> => {\n const {count_docs} = await getSatelliteActor(rest);\n\n return count_docs(collection, toListParams(filter));\n};\n", "import type {SatelliteDid} from '@junobuild/ic-client/actor';\nimport {fromArray} from '@junobuild/utils';\n\nexport const mapData = async <D>({data}: Pick<SatelliteDid.Doc, 'data'>): Promise<D> => {\n try {\n return await fromArray<D>(data);\n } catch (err: unknown) {\n console.error('The data parsing has failed, mapping to undefined as a fallback.', err);\n return undefined as D;\n }\n};\n", "import {fromNullable, toNullable} from '@dfinity/utils';\nimport type {SatelliteDid} from '@junobuild/ic-client/actor';\nimport {fromArray, toArray} from '@junobuild/utils';\nimport type {Doc} from '../types/doc';\nimport type {ExcludeDate} from '../types/utility';\n\nexport const toSetDoc = async <D>(doc: Doc<D>): Promise<SatelliteDid.SetDoc> => {\n const {data, version, description} = doc;\n\n return {\n description: toNullable(description),\n data: await toArray<ExcludeDate<D>>(data),\n version: toNullable(version)\n };\n};\n\nexport const toDelDoc = <D>(doc: Doc<D>): SatelliteDid.DelDoc => {\n const {version} = doc;\n\n return {\n version: toNullable(version)\n };\n};\n\nexport const fromDoc = async <D>({\n doc,\n key\n}: {\n doc: SatelliteDid.Doc;\n key: string;\n}): Promise<Doc<D>> => {\n const {owner, version, description: docDescription, data, ...rest} = doc;\n\n return {\n key,\n description: fromNullable(docDescription),\n owner: owner.toText(),\n data: await fromArray<ExcludeDate<D>>(data),\n version: fromNullable(version),\n ...rest\n };\n};\n", "import {Principal} from '@dfinity/principal';\nimport {isNullish, toNullable} from '@dfinity/utils';\nimport type {SatelliteDid} from '@junobuild/ic-client/actor';\nimport {ListError} from '../types/errors';\nimport type {ListParams, ListTimestampMatcher} from '../types/list';\n\nconst toListMatcherTimestamp = (\n matcher?: ListTimestampMatcher\n): [] | [SatelliteDid.TimestampMatcher] => {\n if (isNullish(matcher)) {\n return toNullable();\n }\n\n switch (matcher.matcher) {\n case 'equal':\n return toNullable({Equal: matcher.timestamp});\n case 'greaterThan':\n return toNullable({GreaterThan: matcher.timestamp});\n case 'lessThan':\n return toNullable({LessThan: matcher.timestamp});\n case 'between':\n return toNullable({Between: [matcher.timestamps.start, matcher.timestamps.end]});\n default:\n throw new ListError('Invalid list matcher for timestamp', matcher);\n }\n};\n\nexport const toListParams = ({\n matcher,\n paginate,\n order,\n owner\n}: ListParams): SatelliteDid.ListParams => ({\n matcher: isNullish(matcher)\n ? []\n : [\n {\n key: toNullable(matcher.key),\n description: toNullable(matcher.description),\n created_at: toListMatcherTimestamp(matcher.createdAt),\n updated_at: toListMatcherTimestamp(matcher.updatedAt)\n }\n ],\n paginate: toNullable(\n isNullish(paginate)\n ? undefined\n : {\n start_after: toNullable(paginate.startAfter),\n limit: toNullable(isNullish(paginate.limit) ? undefined : BigInt(paginate.limit))\n }\n ),\n order: toNullable(\n isNullish(order)\n ? undefined\n : {\n desc: order.desc,\n field:\n order.field === 'created_at'\n ? {CreatedAt: null}\n : order.field === 'updated_at'\n ? {UpdatedAt: null}\n : {Keys: null}\n }\n ),\n owner: toNullable(\n isNullish(owner) ? undefined : typeof owner === 'string' ? Principal.fromText(owner) : owner\n )\n});\n", "import type {ActorMethod, ActorSubclass} from '@dfinity/agent';\nimport type {IDL} from '@dfinity/candid';\nimport {assertNonNullish} from '@dfinity/utils';\nimport {\n idlCertifiedFactorySatellite,\n idlFactorySatellite,\n type SatelliteActor\n} from '@junobuild/ic-client/actor';\nimport {ActorStore} from '../stores/actor.store';\nimport type {ActorKey} from '../types/actor';\nimport type {CallOptions} from '../types/call-options';\nimport type {SatelliteContext} from '../types/satellite';\nimport {customOrEnvContainer, customOrEnvSatelliteId} from '../utils/env.utils';\n\nexport const getSatelliteActor = ({\n satellite,\n options: {certified}\n}: {\n satellite: SatelliteContext;\n options: CallOptions;\n}): Promise<SatelliteActor> =>\n getActor({\n idlFactory: certified ? idlCertifiedFactorySatellite : idlFactorySatellite,\n actorKey: `stock#${certified ? 'update' : 'query'}`,\n ...satellite\n });\n\nexport const getSatelliteExtendedActor = <T = Record<string, ActorMethod>>({\n idlFactory,\n ...rest\n}: SatelliteContext & {idlFactory: IDL.InterfaceFactory}): Promise<ActorSubclass<T>> =>\n getActor({\n idlFactory,\n actorKey: 'extended#query',\n ...rest\n });\n\nconst getActor = async <T = Record<string, ActorMethod>>({\n satelliteId: customSatelliteId,\n container: customContainer,\n ...rest\n}: SatelliteContext & {idlFactory: IDL.InterfaceFactory; actorKey: ActorKey}): Promise<\n ActorSubclass<T>\n> => {\n const {satelliteId} = customOrEnvSatelliteId({satelliteId: customSatelliteId});\n\n assertNonNullish(satelliteId, 'No satellite ID defined. Did you initialize Juno?');\n\n const {container} = customOrEnvContainer({container: customContainer});\n\n return await ActorStore.getInstance().getActor({\n satelliteId,\n container,\n ...rest\n });\n};\n", "import {Actor, type ActorConfig, type ActorMethod, type ActorSubclass} from '@dfinity/agent';\nimport type {IDL} from '@dfinity/candid';\nimport type {Principal} from '@dfinity/principal';\nimport {isNullish} from '@dfinity/utils';\nimport type {\n ActorParameters,\n ConsoleParameters,\n MissionControlParameters,\n OrbiterParameters,\n SatelliteParameters\n} from '../types/actor';\nimport {\n idlCertifiedFactoryConsole,\n idlCertifiedFactoryOrbiter,\n idlCertifiedFactorySatellite,\n idlDeprecatedFactoryMissionControlVersion,\n idlDeprecatedFactoryOrbiterVersion,\n idlDeprecatedFactorySatellite,\n idlDeprecatedFactorySatelliteNoScope,\n idlDeprecatedFactorySatelliteVersion,\n idlFactoryConsole,\n idlFactoryMissionControl,\n idlFactoryOrbiter,\n idlFactorySatellite,\n type ConsoleActor,\n type DeprecatedMissionControlVersionActor,\n type DeprecatedOrbiterVersionActor,\n type DeprecatedSatelliteActor,\n type DeprecatedSatelliteNoScopeActor,\n type DeprecatedSatelliteVersionActor,\n type MissionControlActor,\n type OrbiterActor,\n type SatelliteActor\n} from './actor.factory';\nimport {useOrInitAgent} from './agent.api';\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 certified = false,\n ...rest\n}: SatelliteParameters & {certified?: boolean}): Promise<SatelliteActor> =>\n getActor({\n canisterId: satelliteId,\n ...rest,\n idlFactory: certified ? idlCertifiedFactorySatellite : 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 = ({\n orbiterId,\n certified = false,\n ...rest\n}: OrbiterParameters & {certified?: boolean}): Promise<OrbiterActor> =>\n getActor({\n canisterId: orbiterId,\n ...rest,\n idlFactory: certified ? idlCertifiedFactoryOrbiter : 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 getConsoleActor = ({\n consoleId,\n certified = false,\n ...rest\n}: ConsoleParameters & {certified?: boolean}): Promise<ConsoleActor> =>\n getActor({\n canisterId: consoleId,\n ...rest,\n idlFactory: certified ? idlCertifiedFactoryConsole : idlFactoryConsole\n });\n\nexport const getActor = <T>({\n canisterId,\n idlFactory,\n ...rest\n}: ActorParameters & {\n canisterId: Principal | 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\nconst createActor = async <T = Record<string, ActorMethod>>({\n canisterId,\n idlFactory,\n config,\n ...rest\n}: {\n idlFactory: IDL.InterfaceFactory;\n canisterId: Principal | string;\n config?: Pick<ActorConfig, 'callTransform' | 'queryTransform'>;\n} & ActorParameters): Promise<ActorSubclass<T>> => {\n const agent = await useOrInitAgent(rest);\n\n // Creates an actor with using the candid interface and the HttpAgent\n return Actor.createActor(idlFactory, {\n agent,\n canisterId,\n ...(config ?? {})\n });\n};\n", "export enum FromStringToTokenError {\n FractionalMoreThan8Decimals,\n InvalidFormat,\n FractionalTooManyDecimals,\n}\n", "export const E8S_PER_TOKEN = BigInt(100000000);\n", "import { E8S_PER_TOKEN } from \"../constants/constants\";\nimport { FromStringToTokenError } from \"../enums/token.enums\";\n\nconst DECIMALS_CONVERSION_SUPPORTED = 8;\n\n/**\n * Receives a string representing a number and returns the big int or error.\n *\n * @param amount - in string format\n * @returns bigint | FromStringToTokenError\n */\nexport const convertStringToE8s = (\n value: string,\n): bigint | FromStringToTokenError => {\n // replace exponential format (1e-4) with plain (0.0001)\n // doesn't support decimals for values >= ~1e16\n let amount = value.includes(\"e\")\n ? Number(value).toLocaleString(\"en\", {\n useGrouping: false,\n maximumFractionDigits: 20,\n })\n : value;\n\n // Remove all instances of \",\" and \"'\".\n amount = amount.trim().replace(/[,']/g, \"\");\n\n // Verify that the string is of the format 1234.5678\n const regexMatch = amount.match(/\\d*(\\.\\d*)?/);\n if (!regexMatch || regexMatch[0] !== amount) {\n return FromStringToTokenError.InvalidFormat;\n }\n\n const [integral, fractional] = amount.split(\".\");\n\n let e8s = BigInt(0);\n\n if (integral) {\n try {\n e8s += BigInt(integral) * E8S_PER_TOKEN;\n } catch {\n return FromStringToTokenError.InvalidFormat;\n }\n }\n\n if (fractional) {\n if (fractional.length > 8) {\n return FromStringToTokenError.FractionalMoreThan8Decimals;\n }\n try {\n e8s += BigInt(fractional.padEnd(8, \"0\"));\n } catch {\n return FromStringToTokenError.InvalidFormat;\n }\n }\n\n return e8s;\n};\n\n/**\n * Receives a string representing a number and returns the big int or error.\n *\n * @param amount - in string format\n * @returns bigint | FromStringToTokenError\n */\nconst convertStringToUlps = ({\n amount,\n decimals,\n}: {\n amount: string;\n decimals: number;\n}): bigint | FromStringToTokenError => {\n // Remove all instances of \",\" and \"'\".\n amount = amount.trim().replace(/[,']/g, \"\");\n\n // Verify that the string is of the format 1234.5678\n const regexMatch = amount.match(/\\d*(\\.\\d*)?/);\n if (!regexMatch || regexMatch[0] !== amount) {\n return FromStringToTokenError.InvalidFormat;\n }\n\n const [integral, fractional] = amount.split(\".\");\n\n let ulps = 0n;\n const ulpsPerToken = 10n ** BigInt(decimals);\n\n if (integral) {\n try {\n ulps += BigInt(integral) * ulpsPerToken;\n } catch {\n return FromStringToTokenError.InvalidFormat;\n }\n }\n\n if (fractional) {\n if (fractional.length > decimals) {\n return FromStringToTokenError.FractionalTooManyDecimals;\n }\n try {\n ulps += BigInt(fractional.padEnd(decimals, \"0\"));\n } catch {\n return FromStringToTokenError.InvalidFormat;\n }\n }\n\n return ulps;\n};\n\nexport interface Token {\n symbol: string;\n name: string;\n decimals: number;\n logo?: string;\n}\n\n// TODO: Remove this token and use the value from ICP ledger\nexport const ICPToken: Token = {\n symbol: \"ICP\",\n name: \"Internet Computer\",\n decimals: 8,\n};\n\n/**\n * Deprecated. Use TokenAmountV2 instead which supports decimals !== 8.\n *\n * Represents an amount of tokens.\n *\n * @param e8s - The amount of tokens in bigint.\n * @param token - The token type.\n */\nexport class TokenAmount {\n private constructor(\n protected e8s: bigint,\n public token: Token,\n ) {\n if (token.decimals !== 8) {\n throw new Error(\"Use TokenAmountV2 for number of decimals other than 8\");\n }\n }\n\n /**\n * Initialize from a bigint. Bigint are considered e8s.\n *\n * @param {amount: bigint; token?: Token;} params\n * @param {bigint} params.amount The amount in bigint format.\n * @param {Token} params.token The token type.\n */\n public static fromE8s({\n amount,\n token,\n }: {\n amount: bigint;\n token: Token;\n }): TokenAmount {\n return new TokenAmount(amount, token);\n }\n\n /**\n * Initialize from a string. Accepted formats:\n *\n * 1234567.8901\n * 1'234'567.8901\n * 1,234,567.8901\n *\n * @param {amount: string; token?: Token;} params\n * @param {string} params.amount The amount in string format.\n * @param {Token} params.token The token type.\n */\n public static fromString({\n amount,\n token,\n }: {\n amount: string;\n token: Token;\n }): TokenAmount | FromStringToTokenError {\n // If parsing the number fails because of the number of decimals, we still\n // want the error to be about the number of decimals and not about the\n // parsing.\n if (token.decimals !== 8) {\n throw new Error(\"Use TokenAmountV2 for number of decimals other than 8\");\n }\n const e8s = convertStringToE8s(amount);\n\n if (typeof e8s === \"bigint\") {\n return new TokenAmount(e8s, token);\n }\n return e8s;\n }\n\n /**\n * Initialize from a number.\n *\n * 1 integer is considered E8S_PER_TOKEN\n *\n * @param {amount: number; token?: Token;} params\n * @param {string} params.amount The amount in number format.\n * @param {Token} params.token The token type.\n */\n public static fromNumber({\n amount,\n token,\n }: {\n amount: number;\n token: Token;\n }): TokenAmount {\n const tokenAmount = TokenAmount.fromString({\n amount: amount.toString(),\n token,\n });\n if (tokenAmount instanceof TokenAmount) {\n return tokenAmount;\n }\n if (tokenAmount === FromStringToTokenError.FractionalMoreThan8Decimals) {\n throw new Error(`Number ${amount} has more than 8 decimals`);\n }\n\n // This should never happen\n throw new Error(`Invalid number ${amount}`);\n }\n\n /**\n *\n * @returns The amount of e8s.\n */\n public toE8s(): bigint {\n return this.e8s;\n }\n}\n\n/**\n * Represents an amount of tokens.\n *\n * @param upls - The amount of tokens in units in the last place. If the token\n * supports N decimals, 10^N ulp = 1 token.\n * @param token - The token type.\n */\nexport class TokenAmountV2 {\n private constructor(\n protected ulps: bigint,\n public token: Token,\n ) {}\n\n /**\n * Initialize from a bigint. Bigint are considered ulps.\n *\n * @param {amount: bigint; token?: Token;} params\n * @param {bigint} params.amount The amount in bigint format.\n * @param {Token} params.token The token type.\n */\n public static fromUlps({\n amount,\n token,\n }: {\n amount: bigint;\n token: Token;\n }): TokenAmountV2 {\n return new TokenAmountV2(amount, token);\n }\n\n /**\n * Initialize from a string. Accepted formats:\n *\n * 1234567.8901\n * 1'234'567.8901\n * 1,234,567.8901\n *\n * @param {amount: string; token?: Token;} params\n * @param {string} params.amount The amount in string format.\n * @param {Token} params.token The token type.\n */\n public static fromString({\n amount,\n token,\n }: {\n amount: string;\n token: Token;\n }): TokenAmountV2 | FromStringToTokenError {\n const ulps = convertStringToUlps({ amount, decimals: token.decimals });\n\n if (typeof ulps === \"bigint\") {\n return new TokenAmountV2(ulps, token);\n }\n return ulps;\n }\n\n /**\n * Initialize from a number.\n *\n * 1 integer is considered 10^{token.decimals} ulps\n *\n * @param {amount: number; token?: Token;} params\n * @param {string} params.amount The amount in number format.\n * @param {Token} params.token The token type.\n */\n public static fromNumber({\n amount,\n token,\n }: {\n amount: number;\n token: Token;\n }): TokenAmountV2 {\n const tokenAmount = TokenAmountV2.fromString({\n amount: amount.toFixed(\n Math.min(DECIMALS_CONVERSION_SUPPORTED, token.decimals),\n ),\n token,\n });\n if (tokenAmount instanceof TokenAmountV2) {\n return tokenAmount;\n }\n if (tokenAmount === FromStringToTokenError.FractionalTooManyDecimals) {\n throw new Error(\n `Number ${amount} has more than ${token.decimals} decimals`,\n );\n }\n\n // This should never happen\n throw new Error(`Invalid number ${amount}`);\n }\n\n /**\n *\n * @returns The amount of ulps.\n */\n public toUlps(): bigint {\n return this.ulps;\n }\n\n /**\n *\n * @returns The amount of ulps in e8s precision\n */\n public toE8s(): bigint {\n if (this.token.decimals < 8) {\n return this.ulps * 10n ** BigInt(8 - this.token.decimals);\n } else if (this.token.decimals === 8) {\n return this.ulps;\n } else {\n return this.ulps / 10n ** BigInt(this.token.decimals - 8);\n }\n }\n}\n", "import type { Principal } from \"@dfinity/principal\";\nimport type { QueryParams } from \"../types/query.params\";\n\nexport abstract class Canister<T> {\n protected constructor(\n private readonly id: Principal,\n protected readonly service: T,\n protected readonly certifiedService: T,\n ) {}\n\n get canisterId(): Principal {\n return this.id;\n }\n\n protected caller = ({ certified = true }: QueryParams): T =>\n certified ? this.certifiedService : this.service;\n}\n", "/**\n * Checks if a given argument is null or undefined.\n *\n * @template T - The type of the argument.\n * @param {T | undefined | null} argument - The argument to check.\n * @returns {argument is undefined | null} `true` if the argument is null or undefined; otherwise, `false`.\n */\nexport const isNullish = <T>(\n argument: T | undefined | null,\n): argument is undefined | null => argument === null || argument === undefined;\n\n/**\n * Checks if a given argument is neither null nor undefined.\n *\n * @template T - The type of the argument.\n * @param {T | undefined | null} argument - The argument to check.\n * @returns {argument is NonNullable<T>} `true` if the argument is not null or undefined; otherwise, `false`.\n */\nexport const nonNullish = <T>(\n argument: T | undefined | null,\n): argument is NonNullable<T> => !isNullish(argument);\n\n/**\n * Checks if a given value is not null, not undefined, and not an empty string.\n *\n * @param {string | undefined | null} value - The value to check.\n * @returns {boolean} `true` if the value is not null, not undefined, and not an empty string; otherwise, `false`.\n */\nexport const notEmptyString = (\n value: string | undefined | null,\n): value is string => nonNullish(value) && value !== \"\";\n\n/**\n * Checks if a given value is null, undefined, or an empty string.\n *\n * @param {string | undefined | null} value - The value to check.\n * @returns {value is undefined | null | \"\"} Type predicate indicating if the value is null, undefined, or an empty string.\n */\nexport const isEmptyString = (\n value: string | undefined | null,\n): value is undefined | null | \"\" => !notEmptyString(value);\n", "import type { QueryAndUpdateParams } from \"../types/query-and-update.params\";\nimport { isNullish } from \"../utils/nullish.utils\";\n\n/**\n * This service performs a query (not-certified) call and/or an update (certified) call, and handles the results.\n *\n * It is useful because it can do both type of calls for security reasons.\n * For example, malicious nodes can forge transactions and balance when calling an Index canister, if no update is performed to certify the results.\n *\n * Furthermore, it can handle the results of the calls in different ways:\n * - `query` only performs a query call.\n * - `update` only performs an update call.\n * - `query_and_update` performs both calls.\n *\n * The resolution can be:\n * - `all_settled` waits for all calls to settle.\n * - `race` waits for the first call to settle (typically, `query` is the fastest one).\n *\n * Once the call(s) are done, the response is handled by the `onLoad` callback.\n * However, if an error occurs, it is handled by the error callbacks, if provided: one for the query call and one for the update call.\n *\n * @param {QueryAndUpdateParams<R, E>} params The parameters to perform the request.\n * @param {QueryAndUpdateRequest<R>} params.request The request to perform.\n * @param {QueryAndUpdateOnResponse<R>} params.onLoad The callback to handle the response of the request.\n * @param {QueryAndUpdateOnQueryError<E>} [params.onQueryError] The callback to handle the error of the `query` request.\n * @param {QueryAndUpdateOnUpdateError<E>} [params.onUpdateError] The callback to handle the error of the `update` request.\n * @param {QueryAndUpdateStrategy} [params.strategy=\"query_and_update\"] The strategy to use. Default is `query_and_update`.\n * @param {QueryAndUpdateIdentity} params.identity The identity to use for the request.\n * @param {QueryAndUpdatePromiseResolution} [params.resolution=\"race\"] The resolution to use. Default is `race`.\n *\n * @template R The type of the response.\n * @template E The type of the error.\n *\n * @returns A promise that resolves when the request is done.\n */\nexport const queryAndUpdate = async <R, E = unknown>({\n request,\n onLoad,\n onQueryError,\n onUpdateError,\n strategy = \"query_and_update\",\n identity,\n resolution = \"race\",\n}: QueryAndUpdateParams<R, E>): Promise<void> => {\n let certifiedDone = false;\n\n const queryOrUpdate = (certified: boolean) =>\n request({ certified, identity })\n .then((response) => {\n if (certifiedDone) {\n return;\n }\n\n onLoad({ certified, response });\n })\n .catch((error: E) => {\n if (!certified) {\n onQueryError?.({ error, identity });\n }\n\n if (certifiedDone) {\n return;\n }\n\n if (isNullish(onUpdateError)) {\n return;\n }\n\n console.error(error);\n\n if (!certified) {\n return;\n }\n\n onUpdateError({ error, identity });\n })\n .finally(() => (certifiedDone = certifiedDone || certified));\n\n const requests: Array<Promise<void>> =\n strategy === \"query\"\n ? [queryOrUpdate(false)]\n : strategy === \"update\"\n ? [queryOrUpdate(true)]\n : [queryOrUpdate(false), queryOrUpdate(true)];\n\n await (resolution === \"all_settled\"\n ? Promise.allSettled(requests)\n : Promise.race(requests));\n};\n", "import type { ActorConfig, ActorSubclass, Agent } from \"@dfinity/agent\";\nimport { Actor } from \"@dfinity/agent\";\nimport type { IDL } from \"@dfinity/candid\";\nimport type { Principal } from \"@dfinity/principal\";\nimport type { CanisterOptions } from \"../types/canister.options\";\nimport { defaultAgent } from \"./agent.utils\";\n\ntype RequiredCanisterOptions<T> = Required<\n Pick<CanisterOptions<T>, \"canisterId\">\n> &\n Omit<CanisterOptions<T>, \"canisterId\">;\n\nexport const createServices = <T>({\n options: {\n canisterId,\n serviceOverride,\n certifiedServiceOverride,\n agent: agentOption,\n callTransform,\n queryTransform,\n },\n idlFactory,\n certifiedIdlFactory,\n}: {\n options: RequiredCanisterOptions<T> &\n Pick<ActorConfig, \"queryTransform\" | \"callTransform\">;\n idlFactory: IDL.InterfaceFactory;\n certifiedIdlFactory: IDL.InterfaceFactory;\n}): {\n service: ActorSubclass<T>;\n certifiedService: ActorSubclass<T>;\n agent: Agent;\n canisterId: Principal;\n} => {\n const agent: Agent = agentOption ?? defaultAgent();\n\n const service: ActorSubclass<T> =\n serviceOverride ??\n Actor.createActor<T>(idlFactory, {\n agent,\n canisterId,\n callTransform,\n queryTransform,\n });\n\n const certifiedService: ActorSubclass<T> =\n certifiedServiceOverride ??\n Actor.createActor<T>(certifiedIdlFactory, {\n agent,\n canisterId,\n callTransform,\n queryTransform,\n });\n\n return { service, certifiedService, agent, canisterId };\n};\n", "import type { Agent, Identity } from \"@dfinity/agent\";\nimport { AnonymousIdentity, HttpAgent } from \"@dfinity/agent\";\nimport type { CreateAgentParams } from \"../types/agent.utils\";\nimport { isNullish, nonNullish } from \"./nullish.utils\";\n\n/**\n * Get a default agent that connects to mainnet with the anonymous identity.\n * @returns The default agent to use\n */\nexport const defaultAgent = (): Agent =>\n HttpAgent.createSync({\n host: \"https://icp-api.io\",\n identity: new AnonymousIdentity(),\n });\n\n/**\n * Create an agent for a given identity\n *\n * @param {CreateAgentParams} params The parameters to create a new HTTP agent\n * @param {Identity} params.identity A mandatory identity to use for the agent\n * @param {string} params.host An optional host to connect to, particularly useful for local development\n * @param {boolean} params.fetchRootKey Fetch root key for certificate validation during local development or on testnet\n * @param {boolean} params.verifyQuerySignatures Check for signatures in the state tree signed by the node that replies to queries - i.e. certify responses.\n * @param {number} params.retryTimes Set the number of retries the agent should perform before error.\n */\nexport const createAgent = async ({\n identity,\n host,\n fetchRootKey = false,\n verifyQuerySignatures = false,\n retryTimes,\n}: CreateAgentParams): Promise<HttpAgent> => {\n return await HttpAgent.create({\n identity,\n ...(nonNullish(host) && { host }),\n verifyQuerySignatures,\n ...(nonNullish(retryTimes) && { retryTimes }),\n shouldFetchRootKey: fetchRootKey,\n });\n};\n\nexport type AgentManagerConfig = Pick<\n CreateAgentParams,\n \"fetchRootKey\" | \"host\"\n>;\n\n/**\n * AgentManager class manages HttpAgent instances for different identities.\n *\n * It caches agents by identity to optimise resource usage and avoid unnecessary agent creation.\n * Provides functionality to create new agents, retrieve cached agents, and clear the cache when needed.\n */\nexport class AgentManager {\n private agents: Record<string, HttpAgent> | undefined | null = undefined;\n\n private constructor(private readonly config: AgentManagerConfig) {}\n\n /**\n * Static factory method to create a new AgentManager instance.\n *\n * This method serves as an alternative to directly using the private constructor,\n * making it more convenient to create instances of `AgentManager` using a simple and clear method.\n *\n * @param {AgentManagerConfig} config - Configuration options for the AgentManager instance.\n * @param {boolean} config.fetchRootKey - Whether to fetch the root key for certificate validation.\n * @param {string} config.host - The host to connect to.\n * @returns {AgentManager} A new instance of `AgentManager`.\n */\n public static create(config: AgentManagerConfig): AgentManager {\n return new AgentManager(config);\n }\n\n /**\n * Get or create an HTTP agent for a given identity.\n *\n * If the agent for the specified identity has been created and cached, it is retrieved from the cache.\n * If no agent exists for the identity, a new one is created, cached, and then returned.\n *\n * @param {Identity} identity - The identity to be used to create the agent.\n * @returns {Promise<HttpAgent>} The HttpAgent associated with the given identity.\n */\n public getAgent = async ({\n identity,\n }: {\n identity: Identity;\n }): Promise<HttpAgent> => {\n const key = identity.getPrincipal().toText();\n\n if (isNullish(this.agents) || isNullish(this.agents[key])) {\n const agent = await createAgent({\n identity,\n fetchRootKey: this.config.fetchRootKey,\n host: this.config.host,\n verifyQuerySignatures: true,\n });\n\n this.agents = {\n ...(this.agents ?? {}),\n [key]: agent,\n };\n\n return agent;\n }\n\n return this.agents[key];\n };\n\n /**\n * Clear the cache of HTTP agents.\n *\n * This method removes all cached agents, forcing new agent creation on the next request for any identity.\n * Useful when identities have changed or if you want to reset all active connections.\n */\n public clearAgents = (): void => {\n this.agents = null;\n };\n}\n", "export class InvalidPercentageError extends Error {}\nexport class NullishError extends Error {}\n\nexport const assertNonNullish: <T>(\n value: T,\n message?: string,\n) => asserts value is NonNullable<T> = <T>(\n value: T,\n message?: string,\n): void => {\n if (value === null || value === undefined) {\n throw new NullishError(message);\n }\n};\n\nexport const asNonNullish = <T>(value: T, message?: string): NonNullable<T> => {\n assertNonNullish(value, message);\n return value;\n};\n\nexport const assertPercentageNumber = (percentage: number) => {\n if (percentage < 0 || percentage > 100) {\n throw new InvalidPercentageError(\n `${percentage} is not a valid percentage number.`,\n );\n }\n};\n", "import { assertNonNullish } from \"./asserts.utils\";\n\nexport const uint8ArrayToBigInt = (array: Uint8Array): bigint => {\n const view = new DataView(array.buffer, array.byteOffset, array.byteLength);\n if (typeof view.getBigUint64 === \"function\") {\n return view.getBigUint64(0);\n } else {\n const high = BigInt(view.getUint32(0));\n const low = BigInt(view.getUint32(4));\n\n return (high << BigInt(32)) + low;\n }\n};\n\nexport const bigIntToUint8Array = (value: bigint): Uint8Array => {\n const buffer = new ArrayBuffer(8);\n const view = new DataView(buffer);\n if (typeof view.setBigUint64 === \"function\") {\n view.setBigUint64(0, value);\n } else {\n const high = Number(value >> BigInt(32));\n const low = Number(value & BigInt(0xffffffff));\n\n view.setUint32(0, high);\n view.setUint32(4, low);\n }\n\n return new Uint8Array(buffer);\n};\n\nexport const numberToUint8Array = (value: number): Uint8Array => {\n const view = new DataView(new ArrayBuffer(8));\n for (let index = 7; index >= 0; --index) {\n view.setUint8(index, value % 256);\n value = value >> 8;\n }\n return new Uint8Array(view.buffer);\n};\n\nexport const arrayBufferToUint8Array = (buffer: ArrayBuffer): Uint8Array =>\n new Uint8Array(buffer);\n\nexport const uint8ArrayToArrayOfNumber = (array: Uint8Array): Array<number> =>\n Array.from(array);\n\nexport const arrayOfNumberToUint8Array = (numbers: Array<number>): Uint8Array =>\n new Uint8Array(numbers);\n\nexport const asciiStringToByteArray = (text: string): Array<number> =>\n Array.from(text).map((c) => c.charCodeAt(0));\n\nexport const hexStringToUint8Array = (hexString: string): Uint8Array => {\n const matches = hexString.match(/.{1,2}/g);\n\n assertNonNullish(matches, \"Invalid hex string.\");\n\n return Uint8Array.from(matches.map((byte) => parseInt(byte, 16)));\n};\n\nexport const uint8ArrayToHexString = (bytes: Uint8Array | number[]) => {\n if (!(bytes instanceof Uint8Array)) {\n bytes = Uint8Array.from(bytes);\n }\n return bytes.reduce(\n (str, byte) => str + byte.toString(16).padStart(2, \"0\"),\n \"\",\n );\n};\n\nexport const candidNumberArrayToBigInt = (array: number[]): bigint => {\n let result = 0n;\n for (let i = array.length - 1; i >= 0; i--) {\n result = (result << 32n) + BigInt(array[i]);\n }\n return result;\n};\n", "import { assertNonNullish } from \"./asserts.utils\";\n\nconst ALPHABET = \"abcdefghijklmnopqrstuvwxyz234567\";\n\n// Build a lookup table for decoding.\nconst LOOKUP_TABLE: Record<string, number> = Object.create(null);\nfor (let i = 0; i < ALPHABET.length; i++) {\n LOOKUP_TABLE[ALPHABET[i]] = i;\n}\n\n// Add aliases for rfc4648.\nLOOKUP_TABLE[\"0\"] = LOOKUP_TABLE.o;\nLOOKUP_TABLE[\"1\"] = LOOKUP_TABLE.i;\n\n/**\n * Encode an Uint8Array to a base32 string.\n *\n * @param input The input array to encode.\n * @returns A Base32 string encoding the input.\n */\nexport const encodeBase32 = (input: Uint8Array): string => {\n // How many bits will we skip from the first byte.\n let skip = 0;\n // 5 high bits, carry from one byte to the next.\n let bits = 0;\n\n // The output string in base32.\n let output = \"\";\n\n function encodeByte(byte: number): number {\n if (skip < 0) {\n // we have a carry from the previous byte\n bits |= byte >> -skip;\n } else {\n // no carry\n bits = (byte << skip) & 248;\n }\n\n if (skip > 3) {\n // Not enough data to produce a character, get us another one\n skip -= 8;\n return 1;\n }\n\n if (skip < 4) {\n // produce a character\n output += ALPHABET[bits >> 3];\n skip += 5;\n }\n\n return 0;\n }\n\n for (let i = 0; i < input.length; ) {\n i += encodeByte(input[i]);\n }\n\n return output + (skip < 0 ? ALPHABET[bits >> 3] : \"\");\n};\n\n/**\n * Decode a base32 string to Uint8Array.\n *\n * @param input The input string to decode.\n * @param input The base32 encoded string to decode.\n */\nexport function decodeBase32(input: string): Uint8Array {\n // how many bits we have from the previous character.\n let skip = 0;\n // current byte we're producing.\n let byte = 0;\n\n const output = new Uint8Array(((input.length * 4) / 3) | 0);\n let o = 0;\n\n function decodeChar(char: string) {\n // Consume a character from the stream, store\n // the output in this.output. As before, better\n // to use update().\n let val = LOOKUP_TABLE[char.toLowerCase()];\n assertNonNullish(val, `Invalid character: ${JSON.stringify(char)}`);\n\n // move to the high bits\n val <<= 3;\n byte |= val >>> skip;\n skip += 5;\n\n if (skip >= 8) {\n // We have enough bytes to produce an output\n output[o++] = byte;\n skip -= 8;\n\n if (skip > 0) {\n byte = (val << (5 - skip)) & 255;\n } else {\n byte = 0;\n }\n }\n }\n\n for (const c of input) {\n decodeChar(c);\n }\n\n return output.slice(0, o);\n}\n", "/**\n * Converts a Uint8Array (binary data) to a base64 encoded string.\n *\n * @param {Uint8Array} uint8Array - The Uint8Array containing binary data to be encoded.\n * @returns {string} - The base64 encoded string representation of the binary data.\n */\nexport const uint8ArrayToBase64 = (uint8Array: Uint8Array): string =>\n btoa(String.fromCharCode(...new Uint8Array(uint8Array)));\n\n/**\n * Converts a base64 encoded string to a Uint8Array (binary data).\n *\n * @param {string} base64String - The base64 encoded string to be decoded.\n * @returns {Uint8Array} - The Uint8Array representation of the decoded binary data.\n */\nexport const base64ToUint8Array = (base64String: string): Uint8Array =>\n Uint8Array.from(atob(base64String), (c) => c.charCodeAt(0));\n", "// This file is translated to JavaScript from\n// https://lxp32.github.io/docs/a-simple-example-crc32-calculation/\nconst lookUpTable: Uint32Array = new Uint32Array([\n 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,\n 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,\n 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2,\n 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,\n 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,\n 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,\n 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c,\n 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,\n 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423,\n 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,\n 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106,\n 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,\n 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d,\n 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,\n 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,\n 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,\n 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7,\n 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,\n 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa,\n 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,\n 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81,\n 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,\n 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84,\n 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,\n 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,\n 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,\n 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e,\n 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,\n 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55,\n 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,\n 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28,\n 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,\n 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f,\n 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,\n 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,\n 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,\n 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69,\n 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,\n 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc,\n 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,\n 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693,\n 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,\n 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d,\n]);\n\nconst crc32 = (bytes: Uint8Array): number => {\n let crc = -1;\n\n for (let i = 0; i < bytes.length; i++) {\n const byte = bytes[i];\n const t = (byte ^ crc) & 0xff;\n crc = lookUpTable[t] ^ (crc >>> 8);\n }\n\n return (crc ^ -1) >>> 0;\n};\n\nexport const bigEndianCrc32 = (bytes: Uint8Array): Uint8Array => {\n const checksumArrayBuf = new ArrayBuffer(4);\n const view = new DataView(checksumArrayBuf);\n view.setUint32(0, crc32(bytes), false);\n return new Uint8Array(checksumArrayBuf);\n};\n", "import { Principal } from \"@dfinity/principal\";\nimport { nonNullish } from \"./nullish.utils\";\n\nconst JSON_KEY_BIGINT = \"__bigint__\";\nconst JSON_KEY_PRINCIPAL = \"__principal__\";\nconst JSON_KEY_UINT8ARRAY = \"__uint8array__\";\n\n/**\n * A custom replacer for `JSON.stringify` that converts specific types not natively supported\n * by the API into JSON-compatible formats.\n *\n * Supported conversions:\n * - `BigInt` \u2192 `{ \"__bigint__\": string }`\n * - `Principal` \u2192 `{ \"__principal__\": string }`\n * - `Uint8Array` \u2192 `{ \"__uint8array__\": number[] }`\n *\n * @param {string} _key - Ignored. Only provided for API compatibility.\n * @param {unknown} value - The value to transform before stringification.\n * @returns {unknown} The transformed value if it matches a known type, otherwise the original value.\n */\nexport const jsonReplacer = (_key: string, value: unknown): unknown => {\n if (typeof value === \"bigint\") {\n return { [JSON_KEY_BIGINT]: `${value}` };\n }\n\n if (nonNullish(value) && value instanceof Principal) {\n return { [JSON_KEY_PRINCIPAL]: value.toText() };\n }\n\n if (nonNullish(value) && value instanceof Uint8Array) {\n return { [JSON_KEY_UINT8ARRAY]: Array.from(value) };\n }\n\n return value;\n};\n\n/**\n * A custom reviver for `JSON.parse` that reconstructs specific types from their JSON-encoded representations.\n *\n * This reverses the transformations applied by `jsonReplacer`, restoring the original types.\n *\n * Supported conversions:\n * - `{ \"__bigint__\": string }` \u2192 `BigInt`\n * - `{ \"__principal__\": string }` \u2192 `Principal`\n * - `{ \"__uint8array__\": number[] }` \u2192 `Uint8Array`\n *\n * @param {string} _key - Ignored but provided for API compatibility.\n * @param {unknown} value - The parsed value to transform.\n * @returns {unknown} The reconstructed value if it matches a known type, otherwise the original value.\n */\nexport const jsonReviver = (_key: string, value: unknown): unknown => {\n const mapValue = <T>(key: string): T => (value as Record<string, T>)[key];\n\n if (\n nonNullish(value) &&\n typeof value === \"object\" &&\n JSON_KEY_BIGINT in value\n ) {\n return BigInt(mapValue(JSON_KEY_BIGINT));\n }\n\n if (\n nonNullish(value) &&\n typeof value === \"object\" &&\n JSON_KEY_PRINCIPAL in value\n ) {\n return Principal.fromText(mapValue(JSON_KEY_PRINCIPAL));\n }\n\n if (\n nonNullish(value) &&\n typeof value === \"object\" &&\n JSON_KEY_UINT8ARRAY in value\n ) {\n return Uint8Array.from(mapValue(JSON_KEY_UINT8ARRAY));\n }\n\n return value;\n};\n", "import { uint8ArrayToHexString } from \"./arrays.utils\";\nimport { jsonReplacer } from \"./json.utils\";\n\n/**\n * Generates a SHA-256 hash from the given object.\n *\n * The object is first stringified using a custom `jsonReplacer`, then\n * hashed using the SubtleCrypto API. The resulting hash is returned as a hex string.\n *\n * @template T - The type of the input object.\n * @param {T} params - The object to hash.\n * @returns {Promise<string>} A promise that resolves to the hex string of the SHA-256 hash.\n */\nexport const hashObject = async <T extends object>(\n params: T,\n): Promise<string> => {\n const jsonString = JSON.stringify(params, jsonReplacer);\n\n return await hashText(jsonString);\n};\n\n/**\n * Generates a SHA-256 hash from a plain text string.\n *\n * The string is UTF-8 encoded and hashed using the SubtleCrypto API.\n * The resulting hash is returned as a hexadecimal string.\n *\n * @param {string} text - The text to hash.\n * @returns {Promise<string>} A promise that resolves to the hex string of the SHA-256 hash.\n */\nexport const hashText = async (text: string): Promise<string> => {\n const dataBuffer = new TextEncoder().encode(text);\n const hashBuffer = await crypto.subtle.digest(\"SHA-256\", dataBuffer);\n\n return uint8ArrayToHexString(new Uint8Array(hashBuffer));\n};\n", "const SECONDS_IN_MINUTE = 60;\nconst MINUTES_IN_HOUR = 60;\nconst HOURS_IN_DAY = 24;\nconst DAYS_IN_NON_LEAP_YEAR = 365;\n\nexport interface I18nSecondsToDuration {\n year: string;\n year_plural: string;\n month: string;\n month_plural: string;\n day: string;\n day_plural: string;\n hour: string;\n hour_plural: string;\n minute: string;\n minute_plural: string;\n second: string;\n second_plural: string;\n}\n\nconst EN_TIME: I18nSecondsToDuration = {\n year: \"year\",\n year_plural: \"years\",\n month: \"month\",\n month_plural: \"months\",\n day: \"day\",\n day_plural: \"days\",\n hour: \"hour\",\n hour_plural: \"hours\",\n minute: \"minute\",\n minute_plural: \"minutes\",\n second: \"second\",\n second_plural: \"seconds\",\n};\n\n/**\n * Convert seconds to a human-readable duration, such as \"6 days, 10 hours.\"\n * @param {Object} options - The options object.\n * @param {bigint} options.seconds - The number of seconds to convert.\n * @param {I18nSecondsToDuration} [options.i18n] - The i18n object for customizing language and units. Defaults to English.\n * @returns {string} The human-readable duration string.\n */\nexport const secondsToDuration = ({\n seconds,\n i18n = EN_TIME,\n}: {\n seconds: bigint;\n i18n?: I18nSecondsToDuration;\n}): string => {\n let minutes = seconds / BigInt(SECONDS_IN_MINUTE);\n\n let hours = minutes / BigInt(MINUTES_IN_HOUR);\n minutes -= hours * BigInt(MINUTES_IN_HOUR);\n\n let days = hours / BigInt(HOURS_IN_DAY);\n hours -= days * BigInt(HOURS_IN_DAY);\n\n const years = fullYearsInDays(days);\n days -= daysInYears(years);\n\n const periods = [\n createLabel(\"year\", years),\n createLabel(\"day\", days),\n createLabel(\"hour\", hours),\n createLabel(\"minute\", minutes),\n ...(seconds > BigInt(0) && seconds < BigInt(60)\n ? [createLabel(\"second\", seconds)]\n : []),\n ];\n\n return periods\n .filter(({ amount }) => amount > 0)\n .slice(0, 2)\n .map(\n (labelInfo) =>\n `${labelInfo.amount} ${\n labelInfo.amount === 1\n ? i18n[labelInfo.labelKey]\n : i18n[`${labelInfo.labelKey}_plural`]\n }`,\n )\n .join(\", \");\n};\n\nconst fullYearsInDays = (days: bigint): bigint => {\n // Use integer division.\n let years = days / BigInt(DAYS_IN_NON_LEAP_YEAR);\n while (daysInYears(years) > days) {\n years--;\n }\n return years;\n};\n\nconst daysInYears = (years: bigint): bigint => {\n // Use integer division.\n const leapDays = years / BigInt(4);\n return years * BigInt(DAYS_IN_NON_LEAP_YEAR) + leapDays;\n};\n\ntype LabelKey = \"year\" | \"month\" | \"day\" | \"hour\" | \"minute\" | \"second\";\ntype LabelInfo = {\n labelKey: LabelKey;\n amount: number;\n};\nconst createLabel = (labelKey: LabelKey, amount: bigint): LabelInfo => ({\n labelKey,\n amount: Number(amount),\n});\n\nconst NANOSECONDS_PER_MILLISECOND = 1_000_000n;\n\n/**\n * Returns the current timestamp in nanoseconds as a `bigint`.\n *\n * @returns {bigint} The current timestamp in nanoseconds.\n */\nexport const nowInBigIntNanoSeconds = (): bigint =>\n BigInt(Date.now()) * NANOSECONDS_PER_MILLISECOND;\n\n/**\n * Converts a given `Date` object to a timestamp in nanoseconds as a `bigint`.\n *\n * @param {Date} date - The `Date` object to convert.\n * @returns {bigint} The timestamp in nanoseconds.\n */\nexport const toBigIntNanoSeconds = (date: Date): bigint =>\n BigInt(date.getTime()) * NANOSECONDS_PER_MILLISECOND;\n", "/**\n * Creates a debounced version of the provided function.\n *\n * The debounced function postpones its execution until after a certain amount of time\n * has elapsed since the last time it was invoked. This is useful for limiting the rate\n * at which a function is called (e.g. in response to user input or events).\n *\n * @param {Function} func - The function to debounce. It will only be called after no new calls happen within the specified timeout.\n * @param {number} [timeout=300] - The debounce delay in milliseconds. Defaults to 300ms if not provided or invalid.\n * @returns {(args: unknown[]) => void} A debounced version of the original function.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport const debounce = (func: Function, timeout?: number) => {\n let timer: NodeJS.Timer | undefined;\n\n return (...args: unknown[]) => {\n const next = () => func(...args);\n\n if (timer) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore TypeScript global and window confusion even if we are using @types/node\n clearTimeout(timer);\n }\n\n timer = setTimeout(\n next,\n timeout !== undefined && timeout > 0 ? timeout : 300,\n );\n };\n};\n", "import { assertNonNullish } from \"./asserts.utils\";\nimport { nonNullish } from \"./nullish.utils\";\n\n/**\n * Converts a value into a Candid-style variant representation of an optional value.\n *\n * @template T The type of the value.\n * @param {T | null | undefined} value - The value to convert into a Candid-style variant.\n * @returns {[] | [T]} A Candid-style variant representation: an empty array for `null` and `undefined` or an array with the value.\n */\nexport const toNullable = <T>(value?: T | null): [] | [T] => {\n return nonNullish(value) ? [value] : [];\n};\n\n/**\n * Extracts the value from a Candid-style variant representation of an optional value.\n *\n * @template T The type of the value.\n * @param {[] | [T]} value - A Candid-style variant representing an optional value.\n * @returns {T | undefined} The extracted value, or `undefined` if the array is empty.\n */\nexport const fromNullable = <T>(value: [] | [T]): T | undefined => {\n return value?.[0];\n};\n\n/**\n * Extracts the value from a Candid-style variant representation of an optional value,\n * ensuring the value is defined. Throws an error if the array is empty or the value is nullish.\n *\n * @template T The type of the value.\n * @param {[] | [T]} value - A Candid-style variant representing an optional value.\n * @returns {T} The extracted value.\n * @throws {Error} If the array is empty or the value is nullish.\n */\nexport const fromDefinedNullable = <T>(value: [] | [T]): T => {\n const result = fromNullable(value);\n\n assertNonNullish(result);\n\n return result;\n};\n\n/**\n * Extracts the value from a nullish Candid-style variant representation.\n *\n * @template T The type of the value.\n * @param {([] | [T]) | undefined} value - A Candid-style variant or `undefined`.\n * @returns {T | undefined} The extracted value, or `undefined` if the input is nullish or the array is empty.\n */\nexport const fromNullishNullable = <T>(\n value: ([] | [T]) | undefined,\n): T | undefined => fromNullable(value ?? []);\n", "import type { Principal } from \"@dfinity/principal\";\n\n/**\n * Convert a principal to a Uint8Array 32 length.\n * e.g. Useful to convert a canister ID when topping up cycles with the Cmc canister\n * @param principal The principal that needs to be converted to Subaccount\n */\nexport const principalToSubAccount = (principal: Principal): Uint8Array => {\n const bytes: Uint8Array = principal.toUint8Array();\n const subAccount: Uint8Array = new Uint8Array(32);\n subAccount[0] = bytes.length;\n subAccount.set(bytes, 1);\n return subAccount;\n};\n", "const AMOUNT_VERSION_PARTS = 3;\nconst addZeros = (nums: number[], amountZeros: number): number[] =>\n amountZeros > nums.length\n ? [...nums, ...[...Array(amountZeros - nums.length).keys()].map(() => 0)]\n : nums;\n\nconst convertToNumber = (versionStringPart: string): number => {\n if (!Number.isNaN(Number(versionStringPart))) {\n return Number(versionStringPart);\n }\n const strippedVersion = versionStringPart.split(\"\").reduce((acc, char) => {\n if (Number.isNaN(Number(char))) {\n return acc;\n }\n return acc + char;\n }, \"\");\n return Number(strippedVersion);\n};\n/**\n * Returns true if the current version is smaller than the minVersion, false if equal or bigger.\n * Tags after patch version are ignored, e.g. 1.0.0-beta.1 is considered equal to 1.0.0.\n *\n * @param {Object} params\n * @param {string} params.minVersion Ex: \"1.0.0\"\n * @param {string} params.currentVersion Ex: \"2.0.0\"\n * @returns boolean\n */\nexport const smallerVersion = ({\n minVersion,\n currentVersion,\n}: {\n minVersion: string;\n currentVersion: string;\n}): boolean => {\n const minVersionStandarized = addZeros(\n minVersion.split(\".\").map(convertToNumber),\n AMOUNT_VERSION_PARTS,\n ).join(\".\");\n const currentVersionStandarized = addZeros(\n currentVersion.split(\".\").map(convertToNumber),\n AMOUNT_VERSION_PARTS,\n ).join(\".\");\n // Versions need to have the same number of parts to be comparable\n // Source: https://stackoverflow.com/a/65687141\n return (\n currentVersionStandarized.localeCompare(minVersionStandarized, undefined, {\n numeric: true,\n sensitivity: \"base\",\n }) < 0\n );\n};\n", "// @ts-ignore\nexport const idlFactory = ({IDL}) => {\n const MissionControlArgs = IDL.Record({user: IDL.Principal});\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 const MissionControlArgs = IDL.Record({user: IDL.Principal});\n return [MissionControlArgs];\n};\n", "// @ts-ignore\nexport const idlFactory = ({IDL}) => {\n const SegmentArgs = IDL.Record({controllers: IDL.Vec(IDL.Principal)});\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 const SegmentArgs = IDL.Record({controllers: IDL.Vec(IDL.Principal)});\n return [SegmentArgs];\n};\n", "// @ts-ignore\nexport const idlFactory = ({IDL}) => {\n const SegmentArgs = IDL.Record({controllers: IDL.Vec(IDL.Principal)});\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([GetAnalytics], [IDL.Vec(IDL.Tuple(AnalyticKey, PageView))], []),\n get_page_views_analytics_clients: IDL.Func([GetAnalytics], [AnalyticsClientsPageViews], []),\n get_page_views_analytics_metrics: IDL.Func([GetAnalytics], [AnalyticsMetricsPageViews], []),\n get_page_views_analytics_top_10: IDL.Func([GetAnalytics], [AnalyticsTop10PageViews], []),\n get_performance_metrics: IDL.Func(\n [GetAnalytics],\n [IDL.Vec(IDL.Tuple(AnalyticKey, PerformanceMetric))],\n []\n ),\n get_performance_metrics_analytics_web_vitals: IDL.Func(\n [GetAnalytics],\n [AnalyticsWebVitalsPerformanceMetrics],\n []\n ),\n get_track_events: IDL.Func([GetAnalytics], [IDL.Vec(IDL.Tuple(AnalyticKey, TrackEvent))], []),\n get_track_events_analytics: IDL.Func([GetAnalytics], [AnalyticsTrackEvents], []),\n http_request: IDL.Func([HttpRequest], [HttpResponse], []),\n http_request_update: IDL.Func([HttpRequest], [HttpResponse], []),\n list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], []),\n list_satellite_configs: IDL.Func(\n [],\n [IDL.Vec(IDL.Tuple(IDL.Principal, OrbiterSatelliteConfig))],\n []\n ),\n memory_size: IDL.Func([], [MemorySize], []),\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 const SegmentArgs = IDL.Record({controllers: IDL.Vec(IDL.Principal)});\n return [SegmentArgs];\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.Text, IDL.Text))], [], []),\n del_many_docs: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, DelDoc))], [], []),\n del_rule: IDL.Func([CollectionType, IDL.Text, DelRule], [], []),\n deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),\n get_asset: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(AssetNoContent)], ['query']),\n get_auth_config: IDL.Func([], [IDL.Opt(AuthenticationConfig)], ['query']),\n get_config: IDL.Func([], [Config], []),\n get_db_config: IDL.Func([], [IDL.Opt(DbConfig)], ['query']),\n get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], ['query']),\n get_many_assets: IDL.Func(\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(AssetNoContent)))],\n ['query']\n ),\n get_many_docs: IDL.Func(\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(Doc)))],\n ['query']\n ),\n get_rule: IDL.Func([CollectionType, IDL.Text], [IDL.Opt(Rule)], ['query']),\n get_storage_config: IDL.Func([], [StorageConfig], ['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.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([CollectionType], [IDL.Vec(IDL.Tuple(IDL.Text, Rule))], ['query']),\n memory_size: IDL.Func([], [MemorySize], ['query']),\n set_auth_config: IDL.Func([AuthenticationConfig], [], []),\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_db_config: IDL.Func([DbConfig], [], []),\n set_doc: IDL.Func([IDL.Text, IDL.Text, SetDoc], [Doc], []),\n set_many_docs: IDL.Func(\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, SetDoc))],\n [IDL.Vec(IDL.Tuple(IDL.Text, Doc))],\n []\n ),\n set_rule: IDL.Func([CollectionType, IDL.Text, SetRule], [Rule], []),\n set_storage_config: IDL.Func([StorageConfig], [], []),\n upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),\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 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 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 PageViewDevice = IDL.Record({\n inner_height: IDL.Nat16,\n inner_width: IDL.Nat16\n });\n const PageView = IDL.Record({\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 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 AnalyticsDevicesPageViews = IDL.Record({\n desktop: IDL.Float64,\n others: IDL.Float64,\n mobile: IDL.Float64\n });\n const AnalyticsClientsPageViews = IDL.Record({\n browsers: AnalyticsBrowsersPageViews,\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 });\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 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 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 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 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 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 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 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 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 MonitoringHistoryCycles = IDL.Record({\n deposited_cycles: IDL.Opt(CyclesBalance),\n cycles: CyclesBalance\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 });\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 version: IDL.Func([], [IDL.Text], ['query'])\n });\n};\n// @ts-ignore\nexport const init = ({IDL}) => {\n return [];\n};\n", "export 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 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.Principal)], ['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};\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 CommitProposal = IDL.Record({\n sha256: IDL.Vec(IDL.Nat8),\n proposal_id: 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 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 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 DeleteProposalAssets = IDL.Record({\n proposal_ids: IDL.Vec(IDL.Nat)\n });\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 AuthenticationRules = IDL.Record({\n allowed_callers: IDL.Vec(IDL.Principal)\n });\n const AuthenticationConfig = IDL.Record({\n updated_at: IDL.Opt(IDL.Nat64),\n created_at: IDL.Opt(IDL.Nat64),\n version: IDL.Opt(IDL.Nat64),\n internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n rules: IDL.Opt(AuthenticationRules)\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 updated_at: IDL.Opt(IDL.Nat64),\n created_at: IDL.Opt(IDL.Nat64),\n version: IDL.Opt(IDL.Nat64),\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 updated_at: IDL.Opt(IDL.Nat64),\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 created_at: IDL.Opt(IDL.Nat64),\n version: IDL.Opt(IDL.Nat64),\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 ProposalStatus = IDL.Variant({\n Initialized: IDL.Null,\n Failed: IDL.Null,\n Open: IDL.Null,\n Rejected: IDL.Null,\n Executed: IDL.Null,\n Accepted: IDL.Null\n });\n const AssetsUpgradeOptions = IDL.Record({\n clear_existing_assets: IDL.Opt(IDL.Bool)\n });\n const SegmentsDeploymentOptions = IDL.Record({\n orbiter: IDL.Opt(IDL.Text),\n mission_control_version: IDL.Opt(IDL.Text),\n satellite_version: IDL.Opt(IDL.Text)\n });\n const ProposalType = IDL.Variant({\n AssetsUpgrade: AssetsUpgradeOptions,\n SegmentsDeployment: SegmentsDeploymentOptions\n });\n const Proposal = IDL.Record({\n status: ProposalStatus,\n updated_at: IDL.Nat64,\n sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),\n executed_at: IDL.Opt(IDL.Nat64),\n owner: IDL.Principal,\n created_at: IDL.Nat64,\n version: IDL.Opt(IDL.Nat64),\n proposal_type: ProposalType\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 ListProposalsOrder = IDL.Record({desc: IDL.Bool});\n const ListProposalsPaginate = IDL.Record({\n start_after: IDL.Opt(IDL.Nat),\n limit: IDL.Opt(IDL.Nat)\n });\n const ListProposalsParams = IDL.Record({\n order: IDL.Opt(ListProposalsOrder),\n paginate: IDL.Opt(ListProposalsPaginate)\n });\n const ProposalKey = IDL.Record({proposal_id: IDL.Nat});\n const ListProposalResults = IDL.Record({\n matches_length: IDL.Nat64,\n items: IDL.Vec(IDL.Tuple(ProposalKey, Proposal)),\n items_length: IDL.Nat64\n });\n const ListRulesMatcher = IDL.Record({include_system: IDL.Bool});\n const ListRulesParams = IDL.Record({matcher: IDL.Opt(ListRulesMatcher)});\n const ListRulesResults = IDL.Record({\n matches_length: IDL.Nat64,\n items: IDL.Vec(IDL.Tuple(IDL.Text, Rule)),\n items_length: IDL.Nat64\n });\n const MemorySize = IDL.Record({stable: IDL.Nat64, heap: IDL.Nat64});\n const SetAuthenticationConfig = IDL.Record({\n version: IDL.Opt(IDL.Nat64),\n internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n rules: IDL.Opt(AuthenticationRules)\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 SetControllersArgs = IDL.Record({\n controller: SetController,\n controllers: IDL.Vec(IDL.Principal)\n });\n const SetDbConfig = IDL.Record({\n version: IDL.Opt(IDL.Nat64),\n max_memory_size: IDL.Opt(ConfigMaxMemorySize)\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 SetStorageConfig = 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 version: IDL.Opt(IDL.Nat64),\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 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 commit_asset_upload: IDL.Func([CommitBatch], [], []),\n commit_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n commit_proposal_asset_upload: IDL.Func([CommitBatch], [], []),\n commit_proposal_many_assets_upload: IDL.Func([IDL.Vec(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 count_proposals: IDL.Func([], [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.Text, IDL.Text))], [], []),\n del_many_docs: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, DelDoc))], [], []),\n del_rule: IDL.Func([CollectionType, IDL.Text, DelRule], [], []),\n delete_proposal_assets: IDL.Func([DeleteProposalAssets], [], []),\n deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),\n get_asset: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(AssetNoContent)], ['query']),\n get_auth_config: IDL.Func([], [IDL.Opt(AuthenticationConfig)], ['query']),\n get_config: IDL.Func([], [Config], []),\n get_db_config: IDL.Func([], [IDL.Opt(DbConfig)], ['query']),\n get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], ['query']),\n get_many_assets: IDL.Func(\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(AssetNoContent)))],\n ['query']\n ),\n get_many_docs: IDL.Func(\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(Doc)))],\n ['query']\n ),\n get_proposal: IDL.Func([IDL.Nat], [IDL.Opt(Proposal)], ['query']),\n get_rule: IDL.Func([CollectionType, IDL.Text], [IDL.Opt(Rule)], ['query']),\n get_storage_config: IDL.Func([], [StorageConfig], ['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 init_proposal: IDL.Func([ProposalType], [IDL.Nat, Proposal], []),\n init_proposal_asset_upload: IDL.Func([InitAssetKey, IDL.Nat], [InitUploadResult], []),\n init_proposal_many_assets_upload: IDL.Func(\n [IDL.Vec(InitAssetKey), IDL.Nat],\n [IDL.Vec(IDL.Tuple(IDL.Text, InitUploadResult))],\n []\n ),\n list_assets: IDL.Func([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_proposals: IDL.Func([ListProposalsParams], [ListProposalResults], ['query']),\n list_rules: IDL.Func([CollectionType, ListRulesParams], [ListRulesResults], ['query']),\n memory_size: IDL.Func([], [MemorySize], ['query']),\n reject_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n set_auth_config: IDL.Func([SetAuthenticationConfig], [AuthenticationConfig], []),\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_db_config: IDL.Func([SetDbConfig], [DbConfig], []),\n set_doc: IDL.Func([IDL.Text, IDL.Text, SetDoc], [Doc], []),\n set_many_docs: IDL.Func(\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, SetDoc))],\n [IDL.Vec(IDL.Tuple(IDL.Text, Doc))],\n []\n ),\n set_rule: IDL.Func([CollectionType, IDL.Text, SetRule], [Rule], []),\n set_storage_config: IDL.Func([SetStorageConfig], [StorageConfig], []),\n submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),\n upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),\n upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])\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 CommitProposal = IDL.Record({\n sha256: IDL.Vec(IDL.Nat8),\n proposal_id: 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 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 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 DeleteProposalAssets = IDL.Record({\n proposal_ids: IDL.Vec(IDL.Nat)\n });\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 AuthenticationRules = IDL.Record({\n allowed_callers: IDL.Vec(IDL.Principal)\n });\n const AuthenticationConfig = IDL.Record({\n updated_at: IDL.Opt(IDL.Nat64),\n created_at: IDL.Opt(IDL.Nat64),\n version: IDL.Opt(IDL.Nat64),\n internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n rules: IDL.Opt(AuthenticationRules)\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 updated_at: IDL.Opt(IDL.Nat64),\n created_at: IDL.Opt(IDL.Nat64),\n version: IDL.Opt(IDL.Nat64),\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 updated_at: IDL.Opt(IDL.Nat64),\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 created_at: IDL.Opt(IDL.Nat64),\n version: IDL.Opt(IDL.Nat64),\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 ProposalStatus = IDL.Variant({\n Initialized: IDL.Null,\n Failed: IDL.Null,\n Open: IDL.Null,\n Rejected: IDL.Null,\n Executed: IDL.Null,\n Accepted: IDL.Null\n });\n const AssetsUpgradeOptions = IDL.Record({\n clear_existing_assets: IDL.Opt(IDL.Bool)\n });\n const SegmentsDeploymentOptions = IDL.Record({\n orbiter: IDL.Opt(IDL.Text),\n mission_control_version: IDL.Opt(IDL.Text),\n satellite_version: IDL.Opt(IDL.Text)\n });\n const ProposalType = IDL.Variant({\n AssetsUpgrade: AssetsUpgradeOptions,\n SegmentsDeployment: SegmentsDeploymentOptions\n });\n const Proposal = IDL.Record({\n status: ProposalStatus,\n updated_at: IDL.Nat64,\n sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),\n executed_at: IDL.Opt(IDL.Nat64),\n owner: IDL.Principal,\n created_at: IDL.Nat64,\n version: IDL.Opt(IDL.Nat64),\n proposal_type: ProposalType\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([], [], [])\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 ListProposalsOrder = IDL.Record({desc: IDL.Bool});\n const ListProposalsPaginate = IDL.Record({\n start_after: IDL.Opt(IDL.Nat),\n limit: IDL.Opt(IDL.Nat)\n });\n const ListProposalsParams = IDL.Record({\n order: IDL.Opt(ListProposalsOrder),\n paginate: IDL.Opt(ListProposalsPaginate)\n });\n const ProposalKey = IDL.Record({proposal_id: IDL.Nat});\n const ListProposalResults = IDL.Record({\n matches_length: IDL.Nat64,\n items: IDL.Vec(IDL.Tuple(ProposalKey, Proposal)),\n items_length: IDL.Nat64\n });\n const ListRulesMatcher = IDL.Record({include_system: IDL.Bool});\n const ListRulesParams = IDL.Record({matcher: IDL.Opt(ListRulesMatcher)});\n const ListRulesResults = IDL.Record({\n matches_length: IDL.Nat64,\n items: IDL.Vec(IDL.Tuple(IDL.Text, Rule)),\n items_length: IDL.Nat64\n });\n const MemorySize = IDL.Record({stable: IDL.Nat64, heap: IDL.Nat64});\n const SetAuthenticationConfig = IDL.Record({\n version: IDL.Opt(IDL.Nat64),\n internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n rules: IDL.Opt(AuthenticationRules)\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 SetControllersArgs = IDL.Record({\n controller: SetController,\n controllers: IDL.Vec(IDL.Principal)\n });\n const SetDbConfig = IDL.Record({\n version: IDL.Opt(IDL.Nat64),\n max_memory_size: IDL.Opt(ConfigMaxMemorySize)\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 SetStorageConfig = 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 version: IDL.Opt(IDL.Nat64),\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 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 commit_asset_upload: IDL.Func([CommitBatch], [], []),\n commit_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n commit_proposal_asset_upload: IDL.Func([CommitBatch], [], []),\n commit_proposal_many_assets_upload: IDL.Func([IDL.Vec(CommitBatch)], [], []),\n count_assets: IDL.Func([IDL.Text, ListParams], [IDL.Nat64], []),\n count_collection_assets: IDL.Func([IDL.Text], [IDL.Nat64], []),\n count_collection_docs: IDL.Func([IDL.Text], [IDL.Nat64], []),\n count_docs: IDL.Func([IDL.Text, ListParams], [IDL.Nat64], []),\n count_proposals: IDL.Func([], [IDL.Nat64], []),\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.Text, IDL.Text))], [], []),\n del_many_docs: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, DelDoc))], [], []),\n del_rule: IDL.Func([CollectionType, IDL.Text, DelRule], [], []),\n delete_proposal_assets: IDL.Func([DeleteProposalAssets], [], []),\n deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),\n get_asset: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(AssetNoContent)], []),\n get_auth_config: IDL.Func([], [IDL.Opt(AuthenticationConfig)], []),\n get_config: IDL.Func([], [Config], []),\n get_db_config: IDL.Func([], [IDL.Opt(DbConfig)], []),\n get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], []),\n get_many_assets: IDL.Func(\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(AssetNoContent)))],\n []\n ),\n get_many_docs: IDL.Func(\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(Doc)))],\n []\n ),\n get_proposal: IDL.Func([IDL.Nat], [IDL.Opt(Proposal)], []),\n get_rule: IDL.Func([CollectionType, IDL.Text], [IDL.Opt(Rule)], []),\n get_storage_config: IDL.Func([], [StorageConfig], []),\n http_request: IDL.Func([HttpRequest], [HttpResponse], []),\n http_request_streaming_callback: IDL.Func(\n [StreamingCallbackToken],\n [StreamingCallbackHttpResponse],\n []\n ),\n init_asset_upload: IDL.Func([InitAssetKey], [InitUploadResult], []),\n init_proposal: IDL.Func([ProposalType], [IDL.Nat, Proposal], []),\n init_proposal_asset_upload: IDL.Func([InitAssetKey, IDL.Nat], [InitUploadResult], []),\n init_proposal_many_assets_upload: IDL.Func(\n [IDL.Vec(InitAssetKey), IDL.Nat],\n [IDL.Vec(IDL.Tuple(IDL.Text, InitUploadResult))],\n []\n ),\n list_assets: IDL.Func([IDL.Text, ListParams], [ListResults], []),\n list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], []),\n list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], []),\n list_docs: IDL.Func([IDL.Text, ListParams], [ListResults_1], []),\n list_proposals: IDL.Func([ListProposalsParams], [ListProposalResults], []),\n list_rules: IDL.Func([CollectionType, ListRulesParams], [ListRulesResults], []),\n memory_size: IDL.Func([], [MemorySize], []),\n reject_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n set_auth_config: IDL.Func([SetAuthenticationConfig], [AuthenticationConfig], []),\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_db_config: IDL.Func([SetDbConfig], [DbConfig], []),\n set_doc: IDL.Func([IDL.Text, IDL.Text, SetDoc], [Doc], []),\n set_many_docs: IDL.Func(\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, SetDoc))],\n [IDL.Vec(IDL.Tuple(IDL.Text, Doc))],\n []\n ),\n set_rule: IDL.Func([CollectionType, IDL.Text, SetRule], [Rule], []),\n set_storage_config: IDL.Func([SetStorageConfig], [StorageConfig], []),\n submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),\n upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),\n upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])\n });\n};\n// @ts-ignore\nexport const init = ({IDL}) => {\n return [];\n};\n", "// @ts-ignore\nexport const idlFactory = ({IDL}) => {\n const Tokens = IDL.Record({e8s: IDL.Nat64});\n const AssertMissionControlCenterArgs = IDL.Record({\n mission_control_id: IDL.Principal,\n user: IDL.Principal\n });\n const CommitProposal = IDL.Record({\n sha256: IDL.Vec(IDL.Nat8),\n proposal_id: IDL.Nat\n });\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 CreateCanisterArgs = IDL.Record({\n block_index: IDL.Opt(IDL.Nat64),\n subnet_id: IDL.Opt(IDL.Principal),\n user: IDL.Principal\n });\n const DeleteControllersArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal)\n });\n const DeleteProposalAssets = IDL.Record({\n proposal_ids: IDL.Vec(IDL.Nat)\n });\n const StorageConfigIFrame = IDL.Variant({\n Deny: IDL.Null,\n AllowAny: IDL.Null,\n SameOrigin: IDL.Null\n });\n const ConfigMaxMemorySize = IDL.Record({\n stable: IDL.Opt(IDL.Nat64),\n heap: IDL.Opt(IDL.Nat64)\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 updated_at: IDL.Opt(IDL.Nat64),\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 created_at: IDL.Opt(IDL.Nat64),\n version: IDL.Opt(IDL.Nat64),\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({storage: StorageConfig});\n const GetCreateCanisterFeeArgs = IDL.Record({user: IDL.Principal});\n const ProposalStatus = IDL.Variant({\n Initialized: IDL.Null,\n Failed: IDL.Null,\n Open: IDL.Null,\n Rejected: IDL.Null,\n Executed: IDL.Null,\n Accepted: IDL.Null\n });\n const AssetsUpgradeOptions = IDL.Record({\n clear_existing_assets: IDL.Opt(IDL.Bool)\n });\n const SegmentsDeploymentOptions = IDL.Record({\n orbiter: IDL.Opt(IDL.Text),\n mission_control_version: IDL.Opt(IDL.Text),\n satellite_version: IDL.Opt(IDL.Text)\n });\n const ProposalType = IDL.Variant({\n AssetsUpgrade: AssetsUpgradeOptions,\n SegmentsDeployment: SegmentsDeploymentOptions\n });\n const Proposal = IDL.Record({\n status: ProposalStatus,\n updated_at: IDL.Nat64,\n sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),\n executed_at: IDL.Opt(IDL.Nat64),\n owner: IDL.Principal,\n created_at: IDL.Nat64,\n version: IDL.Opt(IDL.Nat64),\n proposal_type: ProposalType\n });\n const MissionControl = IDL.Record({\n updated_at: IDL.Nat64,\n credits: Tokens,\n mission_control_id: IDL.Opt(IDL.Principal),\n owner: IDL.Principal,\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 certificate_version: IDL.Opt(IDL.Nat16)\n });\n const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});\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 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 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 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 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 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 PaymentStatus = IDL.Variant({\n Refunded: IDL.Null,\n Acknowledged: IDL.Null,\n Completed: IDL.Null\n });\n const Payment = IDL.Record({\n status: PaymentStatus,\n updated_at: IDL.Nat64,\n block_index_payment: IDL.Nat64,\n mission_control_id: IDL.Opt(IDL.Principal),\n created_at: IDL.Nat64,\n block_index_refunded: IDL.Opt(IDL.Nat64)\n });\n const ListProposalsOrder = IDL.Record({desc: IDL.Bool});\n const ListProposalsPaginate = IDL.Record({\n start_after: IDL.Opt(IDL.Nat),\n limit: IDL.Opt(IDL.Nat)\n });\n const ListProposalsParams = IDL.Record({\n order: IDL.Opt(ListProposalsOrder),\n paginate: IDL.Opt(ListProposalsPaginate)\n });\n const ProposalKey = IDL.Record({proposal_id: IDL.Nat});\n const ListProposalResults = IDL.Record({\n matches_length: IDL.Nat64,\n items: IDL.Vec(IDL.Tuple(ProposalKey, Proposal)),\n items_length: 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 SetControllersArgs = IDL.Record({\n controller: SetController,\n controllers: IDL.Vec(IDL.Principal)\n });\n const SegmentKind = IDL.Variant({\n Orbiter: IDL.Null,\n MissionControl: IDL.Null,\n Satellite: IDL.Null\n });\n const SetStorageConfig = 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 version: IDL.Opt(IDL.Nat64),\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 RateConfig = IDL.Record({\n max_tokens: IDL.Nat64,\n time_per_token_ns: IDL.Nat64\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 add_credits: IDL.Func([IDL.Principal, Tokens], [], []),\n add_invitation_code: IDL.Func([IDL.Text], [], []),\n assert_mission_control_center: IDL.Func([AssertMissionControlCenterArgs], [], ['query']),\n commit_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n commit_proposal_asset_upload: IDL.Func([CommitBatch], [], []),\n commit_proposal_many_assets_upload: IDL.Func([IDL.Vec(CommitBatch)], [], []),\n count_proposals: IDL.Func([], [IDL.Nat64], ['query']),\n create_orbiter: IDL.Func([CreateCanisterArgs], [IDL.Principal], []),\n create_satellite: IDL.Func([CreateCanisterArgs], [IDL.Principal], []),\n del_controllers: IDL.Func([DeleteControllersArgs], [], []),\n del_custom_domain: IDL.Func([IDL.Text], [], []),\n delete_proposal_assets: IDL.Func([DeleteProposalAssets], [], []),\n get_config: IDL.Func([], [Config], ['query']),\n get_create_orbiter_fee: IDL.Func([GetCreateCanisterFeeArgs], [IDL.Opt(Tokens)], ['query']),\n get_create_satellite_fee: IDL.Func([GetCreateCanisterFeeArgs], [IDL.Opt(Tokens)], ['query']),\n get_credits: IDL.Func([], [Tokens], ['query']),\n get_proposal: IDL.Func([IDL.Nat], [IDL.Opt(Proposal)], ['query']),\n get_storage_config: IDL.Func([], [StorageConfig], ['query']),\n get_user_mission_control_center: IDL.Func([], [IDL.Opt(MissionControl)], ['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_proposal: IDL.Func([ProposalType], [IDL.Nat, Proposal], []),\n init_proposal_asset_upload: IDL.Func([InitAssetKey, IDL.Nat], [InitUploadResult], []),\n init_proposal_many_assets_upload: IDL.Func(\n [IDL.Vec(InitAssetKey), IDL.Nat],\n [IDL.Vec(IDL.Tuple(IDL.Text, InitUploadResult))],\n []\n ),\n init_user_mission_control_center: IDL.Func([], [MissionControl], []),\n list_assets: IDL.Func([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_payments: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Nat64, Payment))], ['query']),\n list_proposals: IDL.Func([ListProposalsParams], [ListProposalResults], ['query']),\n list_user_mission_control_centers: IDL.Func(\n [],\n [IDL.Vec(IDL.Tuple(IDL.Principal, MissionControl))],\n ['query']\n ),\n reject_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n set_controllers: IDL.Func([SetControllersArgs], [], []),\n set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),\n set_fee: IDL.Func([SegmentKind, Tokens], [], []),\n set_storage_config: IDL.Func([SetStorageConfig], [StorageConfig], []),\n submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),\n update_rate_config: IDL.Func([SegmentKind, RateConfig], [], []),\n upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])\n });\n};\n// @ts-ignore\nexport const init = ({IDL}) => {\n return [];\n};\n", "// @ts-ignore\nexport const idlFactory = ({IDL}) => {\n const Tokens = IDL.Record({e8s: IDL.Nat64});\n const AssertMissionControlCenterArgs = IDL.Record({\n mission_control_id: IDL.Principal,\n user: IDL.Principal\n });\n const CommitProposal = IDL.Record({\n sha256: IDL.Vec(IDL.Nat8),\n proposal_id: IDL.Nat\n });\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 CreateCanisterArgs = IDL.Record({\n block_index: IDL.Opt(IDL.Nat64),\n subnet_id: IDL.Opt(IDL.Principal),\n user: IDL.Principal\n });\n const DeleteControllersArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal)\n });\n const DeleteProposalAssets = IDL.Record({\n proposal_ids: IDL.Vec(IDL.Nat)\n });\n const StorageConfigIFrame = IDL.Variant({\n Deny: IDL.Null,\n AllowAny: IDL.Null,\n SameOrigin: IDL.Null\n });\n const ConfigMaxMemorySize = IDL.Record({\n stable: IDL.Opt(IDL.Nat64),\n heap: IDL.Opt(IDL.Nat64)\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 updated_at: IDL.Opt(IDL.Nat64),\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 created_at: IDL.Opt(IDL.Nat64),\n version: IDL.Opt(IDL.Nat64),\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({storage: StorageConfig});\n const GetCreateCanisterFeeArgs = IDL.Record({user: IDL.Principal});\n const ProposalStatus = IDL.Variant({\n Initialized: IDL.Null,\n Failed: IDL.Null,\n Open: IDL.Null,\n Rejected: IDL.Null,\n Executed: IDL.Null,\n Accepted: IDL.Null\n });\n const AssetsUpgradeOptions = IDL.Record({\n clear_existing_assets: IDL.Opt(IDL.Bool)\n });\n const SegmentsDeploymentOptions = IDL.Record({\n orbiter: IDL.Opt(IDL.Text),\n mission_control_version: IDL.Opt(IDL.Text),\n satellite_version: IDL.Opt(IDL.Text)\n });\n const ProposalType = IDL.Variant({\n AssetsUpgrade: AssetsUpgradeOptions,\n SegmentsDeployment: SegmentsDeploymentOptions\n });\n const Proposal = IDL.Record({\n status: ProposalStatus,\n updated_at: IDL.Nat64,\n sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),\n executed_at: IDL.Opt(IDL.Nat64),\n owner: IDL.Principal,\n created_at: IDL.Nat64,\n version: IDL.Opt(IDL.Nat64),\n proposal_type: ProposalType\n });\n const MissionControl = IDL.Record({\n updated_at: IDL.Nat64,\n credits: Tokens,\n mission_control_id: IDL.Opt(IDL.Principal),\n owner: IDL.Principal,\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 certificate_version: IDL.Opt(IDL.Nat16)\n });\n const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});\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([], [], [])\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 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 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 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 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 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 PaymentStatus = IDL.Variant({\n Refunded: IDL.Null,\n Acknowledged: IDL.Null,\n Completed: IDL.Null\n });\n const Payment = IDL.Record({\n status: PaymentStatus,\n updated_at: IDL.Nat64,\n block_index_payment: IDL.Nat64,\n mission_control_id: IDL.Opt(IDL.Principal),\n created_at: IDL.Nat64,\n block_index_refunded: IDL.Opt(IDL.Nat64)\n });\n const ListProposalsOrder = IDL.Record({desc: IDL.Bool});\n const ListProposalsPaginate = IDL.Record({\n start_after: IDL.Opt(IDL.Nat),\n limit: IDL.Opt(IDL.Nat)\n });\n const ListProposalsParams = IDL.Record({\n order: IDL.Opt(ListProposalsOrder),\n paginate: IDL.Opt(ListProposalsPaginate)\n });\n const ProposalKey = IDL.Record({proposal_id: IDL.Nat});\n const ListProposalResults = IDL.Record({\n matches_length: IDL.Nat64,\n items: IDL.Vec(IDL.Tuple(ProposalKey, Proposal)),\n items_length: 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 SetControllersArgs = IDL.Record({\n controller: SetController,\n controllers: IDL.Vec(IDL.Principal)\n });\n const SegmentKind = IDL.Variant({\n Orbiter: IDL.Null,\n MissionControl: IDL.Null,\n Satellite: IDL.Null\n });\n const SetStorageConfig = 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 version: IDL.Opt(IDL.Nat64),\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 RateConfig = IDL.Record({\n max_tokens: IDL.Nat64,\n time_per_token_ns: IDL.Nat64\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 add_credits: IDL.Func([IDL.Principal, Tokens], [], []),\n add_invitation_code: IDL.Func([IDL.Text], [], []),\n assert_mission_control_center: IDL.Func([AssertMissionControlCenterArgs], [], []),\n commit_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n commit_proposal_asset_upload: IDL.Func([CommitBatch], [], []),\n commit_proposal_many_assets_upload: IDL.Func([IDL.Vec(CommitBatch)], [], []),\n count_proposals: IDL.Func([], [IDL.Nat64], []),\n create_orbiter: IDL.Func([CreateCanisterArgs], [IDL.Principal], []),\n create_satellite: IDL.Func([CreateCanisterArgs], [IDL.Principal], []),\n del_controllers: IDL.Func([DeleteControllersArgs], [], []),\n del_custom_domain: IDL.Func([IDL.Text], [], []),\n delete_proposal_assets: IDL.Func([DeleteProposalAssets], [], []),\n get_config: IDL.Func([], [Config], []),\n get_create_orbiter_fee: IDL.Func([GetCreateCanisterFeeArgs], [IDL.Opt(Tokens)], []),\n get_create_satellite_fee: IDL.Func([GetCreateCanisterFeeArgs], [IDL.Opt(Tokens)], []),\n get_credits: IDL.Func([], [Tokens], []),\n get_proposal: IDL.Func([IDL.Nat], [IDL.Opt(Proposal)], []),\n get_storage_config: IDL.Func([], [StorageConfig], []),\n get_user_mission_control_center: IDL.Func([], [IDL.Opt(MissionControl)], []),\n http_request: IDL.Func([HttpRequest], [HttpResponse], []),\n http_request_streaming_callback: IDL.Func(\n [StreamingCallbackToken],\n [StreamingCallbackHttpResponse],\n []\n ),\n init_proposal: IDL.Func([ProposalType], [IDL.Nat, Proposal], []),\n init_proposal_asset_upload: IDL.Func([InitAssetKey, IDL.Nat], [InitUploadResult], []),\n init_proposal_many_assets_upload: IDL.Func(\n [IDL.Vec(InitAssetKey), IDL.Nat],\n [IDL.Vec(IDL.Tuple(IDL.Text, InitUploadResult))],\n []\n ),\n init_user_mission_control_center: IDL.Func([], [MissionControl], []),\n list_assets: IDL.Func([IDL.Text, ListParams], [ListResults], []),\n list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], []),\n list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], []),\n list_payments: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Nat64, Payment))], []),\n list_proposals: IDL.Func([ListProposalsParams], [ListProposalResults], []),\n list_user_mission_control_centers: IDL.Func(\n [],\n [IDL.Vec(IDL.Tuple(IDL.Principal, MissionControl))],\n []\n ),\n reject_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n set_controllers: IDL.Func([SetControllersArgs], [], []),\n set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),\n set_fee: IDL.Func([SegmentKind, Tokens], [], []),\n set_storage_config: IDL.Func([SetStorageConfig], [StorageConfig], []),\n submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),\n update_rate_config: IDL.Func([SegmentKind, RateConfig], [], []),\n upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])\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 CommitProposal = IDL.Record({\n sha256: IDL.Vec(IDL.Nat8),\n proposal_id: 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 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 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 DeleteProposalAssets = IDL.Record({\n proposal_ids: IDL.Vec(IDL.Nat)\n });\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 AuthenticationRules = IDL.Record({\n allowed_callers: IDL.Vec(IDL.Principal)\n });\n const AuthenticationConfig = IDL.Record({\n updated_at: IDL.Opt(IDL.Nat64),\n created_at: IDL.Opt(IDL.Nat64),\n version: IDL.Opt(IDL.Nat64),\n internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n rules: IDL.Opt(AuthenticationRules)\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 updated_at: IDL.Opt(IDL.Nat64),\n created_at: IDL.Opt(IDL.Nat64),\n version: IDL.Opt(IDL.Nat64),\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 updated_at: IDL.Opt(IDL.Nat64),\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 created_at: IDL.Opt(IDL.Nat64),\n version: IDL.Opt(IDL.Nat64),\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 ProposalStatus = IDL.Variant({\n Initialized: IDL.Null,\n Failed: IDL.Null,\n Open: IDL.Null,\n Rejected: IDL.Null,\n Executed: IDL.Null,\n Accepted: IDL.Null\n });\n const AssetsUpgradeOptions = IDL.Record({\n clear_existing_assets: IDL.Opt(IDL.Bool)\n });\n const SegmentsDeploymentOptions = IDL.Record({\n orbiter: IDL.Opt(IDL.Text),\n mission_control_version: IDL.Opt(IDL.Text),\n satellite_version: IDL.Opt(IDL.Text)\n });\n const ProposalType = IDL.Variant({\n AssetsUpgrade: AssetsUpgradeOptions,\n SegmentsDeployment: SegmentsDeploymentOptions\n });\n const Proposal = IDL.Record({\n status: ProposalStatus,\n updated_at: IDL.Nat64,\n sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),\n executed_at: IDL.Opt(IDL.Nat64),\n owner: IDL.Principal,\n created_at: IDL.Nat64,\n version: IDL.Opt(IDL.Nat64),\n proposal_type: ProposalType\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 ListProposalsOrder = IDL.Record({desc: IDL.Bool});\n const ListProposalsPaginate = IDL.Record({\n start_after: IDL.Opt(IDL.Nat),\n limit: IDL.Opt(IDL.Nat)\n });\n const ListProposalsParams = IDL.Record({\n order: IDL.Opt(ListProposalsOrder),\n paginate: IDL.Opt(ListProposalsPaginate)\n });\n const ProposalKey = IDL.Record({proposal_id: IDL.Nat});\n const ListProposalResults = IDL.Record({\n matches_length: IDL.Nat64,\n items: IDL.Vec(IDL.Tuple(ProposalKey, Proposal)),\n items_length: IDL.Nat64\n });\n const ListRulesMatcher = IDL.Record({include_system: IDL.Bool});\n const ListRulesParams = IDL.Record({matcher: IDL.Opt(ListRulesMatcher)});\n const ListRulesResults = IDL.Record({\n matches_length: IDL.Nat64,\n items: IDL.Vec(IDL.Tuple(IDL.Text, Rule)),\n items_length: IDL.Nat64\n });\n const MemorySize = IDL.Record({stable: IDL.Nat64, heap: IDL.Nat64});\n const SetAuthenticationConfig = IDL.Record({\n version: IDL.Opt(IDL.Nat64),\n internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n rules: IDL.Opt(AuthenticationRules)\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 SetControllersArgs = IDL.Record({\n controller: SetController,\n controllers: IDL.Vec(IDL.Principal)\n });\n const SetDbConfig = IDL.Record({\n version: IDL.Opt(IDL.Nat64),\n max_memory_size: IDL.Opt(ConfigMaxMemorySize)\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 SetStorageConfig = 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 version: IDL.Opt(IDL.Nat64),\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 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 commit_asset_upload: IDL.Func([CommitBatch], [], []),\n commit_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n commit_proposal_asset_upload: IDL.Func([CommitBatch], [], []),\n commit_proposal_many_assets_upload: IDL.Func([IDL.Vec(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 count_proposals: IDL.Func([], [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.Text, IDL.Text))], [], []),\n del_many_docs: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, DelDoc))], [], []),\n del_rule: IDL.Func([CollectionType, IDL.Text, DelRule], [], []),\n delete_proposal_assets: IDL.Func([DeleteProposalAssets], [], []),\n deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),\n get_asset: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(AssetNoContent)], ['query']),\n get_auth_config: IDL.Func([], [IDL.Opt(AuthenticationConfig)], ['query']),\n get_config: IDL.Func([], [Config], []),\n get_db_config: IDL.Func([], [IDL.Opt(DbConfig)], ['query']),\n get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], ['query']),\n get_many_assets: IDL.Func(\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(AssetNoContent)))],\n ['query']\n ),\n get_many_docs: IDL.Func(\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(Doc)))],\n ['query']\n ),\n get_proposal: IDL.Func([IDL.Nat], [IDL.Opt(Proposal)], ['query']),\n get_rule: IDL.Func([CollectionType, IDL.Text], [IDL.Opt(Rule)], ['query']),\n get_storage_config: IDL.Func([], [StorageConfig], ['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 init_proposal: IDL.Func([ProposalType], [IDL.Nat, Proposal], []),\n init_proposal_asset_upload: IDL.Func([InitAssetKey, IDL.Nat], [InitUploadResult], []),\n init_proposal_many_assets_upload: IDL.Func(\n [IDL.Vec(InitAssetKey), IDL.Nat],\n [IDL.Vec(IDL.Tuple(IDL.Text, InitUploadResult))],\n []\n ),\n list_assets: IDL.Func([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_proposals: IDL.Func([ListProposalsParams], [ListProposalResults], ['query']),\n list_rules: IDL.Func([CollectionType, ListRulesParams], [ListRulesResults], ['query']),\n memory_size: IDL.Func([], [MemorySize], ['query']),\n reject_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n set_auth_config: IDL.Func([SetAuthenticationConfig], [AuthenticationConfig], []),\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_db_config: IDL.Func([SetDbConfig], [DbConfig], []),\n set_doc: IDL.Func([IDL.Text, IDL.Text, SetDoc], [Doc], []),\n set_many_docs: IDL.Func(\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, SetDoc))],\n [IDL.Vec(IDL.Tuple(IDL.Text, Doc))],\n []\n ),\n set_rule: IDL.Func([CollectionType, IDL.Text, SetRule], [Rule], []),\n set_storage_config: IDL.Func([SetStorageConfig], [StorageConfig], []),\n submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),\n upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),\n upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])\n });\n};\n// @ts-ignore\nexport const init = ({IDL}) => {\n return [];\n};\n", "import {HttpAgent} from '@dfinity/agent';\nimport type {ActorParameters} from '../types/actor';\n\n// We have this in a utils because we want to mock it for test purposes.\n// Not really happy with that, I welcome better ideas!\nexport const createAgent = async ({\n identity,\n host,\n localActor\n}: Pick<ActorParameters, 'identity'> & {host: string; localActor: boolean}) =>\n await HttpAgent.create({\n identity,\n host,\n retryTimes: 10,\n shouldFetchRootKey: localActor\n });\n", "import type {HttpAgent} from '@dfinity/agent';\nimport {nonNullish} from '@dfinity/utils';\nimport type {ActorParameters} from '../types/actor';\nimport {createAgent} from '../utils/agent.utils';\n\nexport const useOrInitAgent = async ({agent, ...rest}: ActorParameters): Promise<HttpAgent> =>\n agent ?? (await initAgent(rest));\n\nconst initAgent = async ({\n identity,\n container\n}: Omit<ActorParameters, 'agent'>): Promise<HttpAgent> => {\n const localActor = nonNullish(container) && container !== false;\n\n const host = localActor\n ? container === true\n ? 'http://127.0.0.1:5987'\n : container\n : 'https://icp-api.io';\n\n return await createAgent({\n identity,\n host,\n localActor\n });\n};\n", "import {nonNullish} from '@dfinity/utils';\nimport {DOCKER_CONTAINER_URL} from '../constants/container.constants';\nimport {EnvStore} from '../stores/env.store';\nimport type {SatelliteContext} from '../types/satellite';\n\nexport const satelliteUrl = ({\n satelliteId: customSatelliteId,\n container: customContainer\n}: SatelliteContext): string => {\n const {satelliteId} = customOrEnvSatelliteId({satelliteId: customSatelliteId});\n const {container} = customOrEnvContainer({container: customContainer});\n\n if (nonNullish(container) && container !== false) {\n const {host: containerHost, protocol} = new URL(\n container === true ? DOCKER_CONTAINER_URL : container\n );\n return `${protocol}//${satelliteId ?? 'unknown'}.${containerHost.replace('127.0.0.1', 'localhost')}`;\n }\n\n return `https://${satelliteId ?? 'unknown'}.icp0.io`;\n};\n\nexport const customOrEnvSatelliteId = ({\n satelliteId\n}: Pick<SatelliteContext, 'satelliteId'>): Pick<SatelliteContext, 'satelliteId'> =>\n nonNullish(satelliteId)\n ? {satelliteId}\n : (EnvStore.getInstance().get() ?? {satelliteId: undefined});\n\nexport const customOrEnvContainer = ({\n container: customContainer\n}: Pick<SatelliteContext, 'container'>): Pick<SatelliteContext, 'container'> =>\n nonNullish(customContainer)\n ? {container: customContainer}\n : (EnvStore.getInstance().get() ?? {container: undefined});\n", "import type {ReadOptions} from '../types/call-options';\n\n/**\n * Default options for read operations.\n *\n * For backwards compatibility and because most developers probably prioritize speed over\n * additional security when fetching read-only data from the Internet Computer,\n * read operations are performed in an uncertified way by default.\n */\nexport const DEFAULT_READ_OPTIONS: ReadOptions = {certified: false};\n", "import {AnonymousIdentity, type Identity} from '@dfinity/agent';\nimport {nonNullish} from '@dfinity/utils';\nimport {getIdentity as getAuthIdentity} from './auth.services';\n\nexport const getAnyIdentity = (identity?: Identity): Identity => {\n if (nonNullish(identity)) {\n return identity;\n }\n\n return getAuthIdentity() ?? new AnonymousIdentity();\n};\n", "import {\n countDocs as countDocsApi,\n deleteDoc as deleteDocApi,\n deleteFilteredDocs as deleteFilteredDocsApi,\n deleteManyDocs as deleteManyDocsApi,\n getDoc as getDocApi,\n getManyDocs as getManyDocsApi,\n listDocs as listDocsApi,\n setDoc as setDocApi,\n setManyDocs as setManyDocsApi\n} from '../api/doc.api';\nimport {DEFAULT_READ_OPTIONS} from '../constants/call-options.constants';\nimport type {ReadOptions} from '../types/call-options';\nimport type {Doc} from '../types/doc';\nimport type {ListParams, ListResults} from '../types/list';\nimport type {SatelliteOptions} from '../types/satellite';\nimport {getAnyIdentity} from './_identity.services';\n\n/**\n * Retrieves a single document from a collection.\n *\n * @template D\n * @param {Object} params - The parameters for retrieving the document.\n * @param {string} params.collection - The name of the collection.\n * @param {string} params.key - The key of the document to retrieve.\n * @param {ReadOptions} [params.options] - Call options controlling certification. Defaults to uncertified reads for performance unless specified.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<Doc<D> | undefined>} A promise that resolves to the document or undefined if not found.\n */\nexport const getDoc = async <D>({\n satellite,\n options,\n ...rest\n}: {\n collection: string;\n satellite?: SatelliteOptions;\n options?: ReadOptions;\n} & Pick<Doc<D>, 'key'>): Promise<Doc<D> | undefined> => {\n const identity = getAnyIdentity(satellite?.identity);\n\n return await getDocApi({\n ...rest,\n satellite: {...satellite, identity},\n options: options ?? DEFAULT_READ_OPTIONS\n });\n};\n\n/**\n * Retrieves multiple documents from a single or different collections in a single call.\n *\n * @param {Object} params - The parameters for retrieving the documents.\n * @param {Array} params.docs - The list of documents with their collections and keys.\n * @param {ReadOptions} [params.options] - Call options controlling certification. Defaults to uncertified reads for performance unless specified.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<Array<Doc<any> | undefined>>} A promise that resolves to an array of documents or undefined if not found.\n */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const getManyDocs = async ({\n satellite,\n options,\n ...rest\n}: {\n docs: ({collection: string} & Pick<Doc<any>, 'key'>)[];\n satellite?: SatelliteOptions;\n options?: ReadOptions;\n}): Promise<(Doc<any> | undefined)[]> => {\n const identity = getAnyIdentity(satellite?.identity);\n\n return await getManyDocsApi({\n ...rest,\n satellite: {...satellite, identity},\n options: options ?? DEFAULT_READ_OPTIONS\n });\n};\n/* eslint-enable */\n\n/**\n * Adds or updates a single document in a collection.\n *\n * @template D\n * @param {Object} params - The parameters for adding or updating the document.\n * @param {string} params.collection - The name of the collection.\n * @param {Doc<D>} params.doc - The document to add or update.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<Doc<D>>} A promise that resolves to the added or updated document.\n */\nexport const setDoc = async <D>({\n satellite,\n ...rest\n}: {\n collection: string;\n doc: Doc<D>;\n satellite?: SatelliteOptions;\n}): Promise<Doc<D>> => {\n const identity = getAnyIdentity(satellite?.identity);\n\n return await setDocApi({\n ...rest,\n satellite: {...satellite, identity},\n options: {certified: true}\n });\n};\n\n/**\n * Adds or updates multiple documents in a or different collections.\n *\n * @param {Object} params - The parameters for adding or updating the documents.\n * @param {Array} params.docs - The list of documents with their collections and data.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<Array<Doc<any>>>} A promise that resolves to an array of added or updated documents.\n */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const setManyDocs = async ({\n satellite,\n ...rest\n}: {\n docs: {collection: string; doc: Doc<any>}[];\n satellite?: SatelliteOptions;\n}): Promise<Doc<any>[]> => {\n const identity = getAnyIdentity(satellite?.identity);\n\n return await setManyDocsApi({\n ...rest,\n satellite: {...satellite, identity},\n options: {certified: true}\n });\n};\n/* eslint-enable */\n\n/**\n * Deletes a single document from a collection.\n *\n * @template D\n * @param {Object} params - The parameters for deleting the document.\n * @param {string} params.collection - The name of the collection.\n * @param {Doc<D>} params.doc - The document to delete.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<void>} A promise that resolves when the document is deleted.\n */\nexport const deleteDoc = async <D>({\n satellite,\n ...rest\n}: {\n collection: string;\n doc: Doc<D>;\n satellite?: SatelliteOptions;\n}): Promise<void> => {\n const identity = getAnyIdentity(satellite?.identity);\n\n return await deleteDocApi({\n ...rest,\n satellite: {...satellite, identity},\n options: {certified: true}\n });\n};\n\n/**\n * Deletes multiple documents from a or different collections.\n *\n * @param {Object} params - The parameters for deleting the documents.\n * @param {Array} params.docs - The list of documents with their collections and data.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<void>} A promise that resolves when the documents are deleted.\n */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const deleteManyDocs = async ({\n satellite,\n ...rest\n}: {\n docs: {collection: string; doc: Doc<any>}[];\n satellite?: SatelliteOptions;\n}): Promise<void> => {\n const identity = getAnyIdentity(satellite?.identity);\n\n return await deleteManyDocsApi({\n ...rest,\n satellite: {...satellite, identity},\n options: {certified: true}\n });\n};\n/* eslint-enable */\n\n/**\n * Deletes documents from a collection with optional filtering.\n *\n * @param {Object} params - The parameters for deleting documents.\n * @param {string} params.collection - The name of the collection.\n * @param {ListParams} [params.filter] - The filter criteria to match documents for deletion.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<void>} A promise that resolves when the documents are deleted.\n */\nexport const deleteFilteredDocs = async ({\n satellite,\n filter,\n ...rest\n}: {\n collection: string;\n filter?: ListParams;\n satellite?: SatelliteOptions;\n}): Promise<void> => {\n const identity = getAnyIdentity(satellite?.identity);\n\n return await deleteFilteredDocsApi({\n ...rest,\n filter: filter ?? {},\n satellite: {...satellite, identity},\n options: {certified: true}\n });\n};\n\n/**\n * Lists documents in a collection with optional filtering.\n *\n * @template D\n * @param {Object} params - The parameters for listing the documents.\n * @param {string} params.collection - The name of the collection.\n * @param {ListParams} [params.filter] - Optional filter parameters.\n * @param {ReadOptions} [params.options] - Call options controlling certification. Defaults to uncertified reads for performance unless specified.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<ListResults<Doc<D>>>} A promise that resolves to the list of documents.\n */\nexport const listDocs = async <D>({\n satellite,\n options,\n filter,\n ...rest\n}: {\n collection: string;\n filter?: ListParams;\n satellite?: SatelliteOptions;\n options?: ReadOptions;\n}): Promise<ListResults<Doc<D>>> => {\n const identity = getAnyIdentity(satellite?.identity);\n\n return await listDocsApi<D>({\n ...rest,\n filter: filter ?? {},\n satellite: {...satellite, identity},\n options: options ?? DEFAULT_READ_OPTIONS\n });\n};\n\n/**\n * Counts documents in a collection with optional filtering.\n *\n * @param {Object} params - The parameters for counting the documents.\n * @param {string} params.collection - The name of the collection.\n * @param {ListParams} [params.filter] - Optional filter parameters.\n * @param {ReadOptions} [params.options] - Call options controlling certification. Defaults to uncertified reads for performance unless specified.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<bigint>} A promise that resolves to the count of documents as a bigint.\n */\nexport const countDocs = async ({\n satellite,\n options,\n filter,\n ...rest\n}: {\n collection: string;\n filter?: ListParams;\n satellite?: SatelliteOptions;\n options?: ReadOptions;\n}): Promise<bigint> => {\n const identity = getAnyIdentity(satellite?.identity);\n\n return await countDocsApi({\n ...rest,\n filter: filter ?? {},\n satellite: {...satellite, identity},\n options: options ?? DEFAULT_READ_OPTIONS\n });\n};\n", "// TODO: duplicated because those should not be bundled in web worker. We can avoid this by transforming utils into a library of modules.\ninterface ImportMeta {\n env: Record<string, string> | undefined;\n}\n\nexport const envSatelliteId = (): string | undefined => {\n const viteEnvSatelliteId = (): string | undefined =>\n typeof import.meta !== 'undefined' &&\n typeof (import.meta as unknown as ImportMeta).env !== 'undefined'\n ? ((import.meta as unknown as ImportMeta).env?.VITE_SATELLITE_ID ??\n (import.meta as unknown as ImportMeta).env?.PUBLIC_SATELLITE_ID)\n : undefined;\n\n return typeof process !== 'undefined'\n ? (process.env?.NEXT_PUBLIC_SATELLITE_ID ?? viteEnvSatelliteId())\n : viteEnvSatelliteId();\n};\n\nexport const envContainer = (): string | undefined => {\n const viteEnvContainer = (): string | undefined =>\n typeof import.meta !== 'undefined' &&\n typeof (import.meta as unknown as ImportMeta).env !== 'undefined'\n ? ((import.meta as unknown as ImportMeta).env?.VITE_CONTAINER ??\n (import.meta as unknown as ImportMeta).env?.PUBLIC_CONTAINER)\n : undefined;\n\n return typeof process !== 'undefined'\n ? (process.env?.NEXT_PUBLIC_CONTAINER ?? viteEnvContainer())\n : viteEnvContainer();\n};\n", "import type {ActorSubclass} from '@dfinity/agent';\nimport type {ActorMethod} from '@dfinity/agent/lib/esm/actor';\nimport type {IDL} from '@dfinity/candid';\nimport {getSatelliteExtendedActor as getSatelliteExtendedActorApi} from '../api/actor.api';\nimport type {SatelliteOptions} from '../types/satellite';\nimport {getAnyIdentity} from './_identity.services';\n\n/**\n * Returns an extended satellite actor instance using the provided IDL factory and satellite options.\n *\n * This function is intended for advanced use cases where developers have implemented\n * custom endpoints in their serverless functions using the extended build type.\n *\n * In most cases, developers should not need to call this directly.\n * Extended actors are typically mapped and handled automatically.\n *\n * @template T - The actor interface type.\n *\n * @param {Object} params - The parameters for creating the actor.\n * @param {IDL.InterfaceFactory} params.idlFactory - The IDL factory defining the custom actor interface.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only.\n * In browser environments, configuration is automatically inherited from `initSatellite()`.\n *\n * @returns {Promise<ActorSubclass<T>>} A promise that resolves to the extended actor instance.\n */\nexport const getSatelliteExtendedActor = async <T = Record<string, ActorMethod>>({\n idlFactory,\n satellite\n}: {\n idlFactory: IDL.InterfaceFactory;\n satellite?: SatelliteOptions;\n}): Promise<ActorSubclass<T>> => {\n const identity = getAnyIdentity(satellite?.identity);\n\n return await getSatelliteExtendedActorApi({\n idlFactory,\n ...satellite,\n identity\n });\n};\n", "import {fromNullable, nonNullish} from '@dfinity/utils';\nimport type {SatelliteDid} from '@junobuild/ic-client/actor';\nimport type {Asset, AssetEncoding, AssetKey, Storage} from '@junobuild/storage';\nimport {\n countAssets as countAssetsApi,\n deleteAsset as deleteAssetApi,\n deleteFilteredAssets as deleteFilteredAssetsApi,\n deleteManyAssets as deleteManyAssetsApi,\n getAsset as getAssetApi,\n getManyAssets as getManyAssetsApi,\n listAssets as listAssetsApi,\n uploadAsset as uploadAssetApi\n} from '../api/storage.api';\nimport {DEFAULT_READ_OPTIONS} from '../constants/call-options.constants';\nimport type {ReadOptions} from '../types/call-options';\nimport type {ListParams} from '../types/list';\nimport type {SatelliteOptions} from '../types/satellite';\nimport type {Assets} from '../types/storage.types';\nimport {sha256ToBase64String} from '../utils/crypto.utils';\nimport {satelliteUrl} from '../utils/env.utils';\nimport {getAnyIdentity} from './_identity.services';\n\n/**\n * Uploads a blob to the storage.\n *\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<AssetKey>} A promise that resolves to the asset key.\n */\nexport const uploadBlob = (params: Storage & {satellite?: SatelliteOptions}): Promise<AssetKey> =>\n uploadAssetIC(params);\n\n/**\n * Uploads a file to the storage.\n *\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<AssetKey>} A promise that resolves to the asset key.\n */\nexport const uploadFile = (\n params: Partial<Pick<Storage, 'filename'>> &\n Omit<Storage, 'filename' | 'data'> & {data: File} & {satellite?: SatelliteOptions}\n): Promise<AssetKey> =>\n uploadAssetIC({\n filename: params.data.name,\n ...params\n });\n\nconst uploadAssetIC = async ({\n filename: storageFilename,\n data,\n collection,\n headers = [],\n fullPath: storagePath,\n token,\n satellite: satelliteOptions,\n encoding,\n description\n}: Storage & {satellite?: SatelliteOptions}): Promise<AssetKey> => {\n const identity = getAnyIdentity(satelliteOptions?.identity);\n\n // The IC certification does not currently support encoding\n const filename: string = decodeURI(storageFilename);\n const fullPath: string = storagePath ?? `/${collection}/${filename}`;\n\n const satellite = {...satelliteOptions, identity};\n\n await uploadAssetApi({\n asset: {\n data,\n filename,\n collection,\n token,\n headers,\n fullPath,\n encoding,\n description\n },\n satellite,\n options: {certified: true}\n });\n\n return {\n downloadUrl: downloadUrl({\n satellite,\n assetKey: {\n fullPath,\n token\n }\n }),\n fullPath,\n name: filename\n };\n};\n\n/**\n * Lists assets in a collection with optional filtering.\n *\n * @param {Object} params - The parameters for listing the assets.\n * @param {string} params.collection - The name of the collection.\n * @param {ListParams} [params.filter] - The filter parameters.\n * @param {ReadOptions} [params.options] - Call options controlling certification. Defaults to uncertified reads for performance unless specified.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<Assets>} A promise that resolves to the list of assets.\n */\nexport const listAssets = async ({\n collection,\n filter,\n satellite: satelliteOptions,\n options\n}: {\n collection: string;\n filter?: ListParams;\n satellite?: SatelliteOptions;\n options?: ReadOptions;\n}): Promise<Assets> => {\n const satellite = {...satelliteOptions, identity: getAnyIdentity(satelliteOptions?.identity)};\n\n const {items, ...rest} = await listAssetsApi({\n collection,\n filter: filter ?? {},\n satellite,\n options: options ?? DEFAULT_READ_OPTIONS\n });\n\n const assets = items.map(\n ({\n key: {full_path: fullPath, token: t, name, owner, description},\n headers,\n encodings,\n created_at,\n updated_at\n }: SatelliteDid.AssetNoContent) => {\n const token = fromNullable(t);\n\n return {\n fullPath,\n description: fromNullable(description),\n name,\n downloadUrl: downloadUrl({\n satellite,\n assetKey: {fullPath, token}\n }),\n token,\n headers,\n encodings: encodings.reduce<Record<string, AssetEncoding>>(\n (acc, [type, {modified, sha256, total_length}]) => ({\n ...acc,\n [type]: {\n modified,\n sha256: sha256ToBase64String(sha256),\n total_length\n }\n }),\n {}\n ),\n owner: owner.toText(),\n created_at,\n updated_at\n } as Asset;\n }\n );\n\n return {\n items: assets,\n assets,\n ...rest\n };\n};\n\n/**\n * Counts assets in a collection with optional filtering.\n *\n * @param {Object} params - The parameters for counting the assets.\n * @param {string} params.collection - The name of the collection.\n * @param {ListParams} [params.filter] - The filter parameters for narrowing down the count.\n * @param {ReadOptions} [params.options] - Call options controlling certification. Defaults to uncertified reads for performance unless specified.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<bigint>} A promise that resolves to the count of assets as a bigint.\n */\nexport const countAssets = async ({\n collection,\n filter,\n satellite: satelliteOptions,\n options\n}: {\n collection: string;\n filter?: ListParams;\n satellite?: SatelliteOptions;\n options?: ReadOptions;\n}): Promise<bigint> => {\n const satellite = {...satelliteOptions, identity: getAnyIdentity(satelliteOptions?.identity)};\n\n return await countAssetsApi({\n collection,\n satellite,\n filter: filter ?? {},\n options: options ?? DEFAULT_READ_OPTIONS\n });\n};\n\n/**\n * Deletes an asset from the storage.\n *\n * @param {Object} params - The parameters for deleting the asset.\n * @param {string} params.collection - The name of the collection.\n * @param {string} params.fullPath - The full path of the asset.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<void>} A promise that resolves when the asset is deleted.\n */\nexport const deleteAsset = ({\n collection,\n fullPath,\n satellite\n}: {\n collection: string;\n satellite?: SatelliteOptions;\n} & Pick<AssetKey, 'fullPath'>): Promise<void> =>\n deleteAssetApi({\n collection,\n fullPath,\n satellite: {...satellite, identity: getAnyIdentity(satellite?.identity)},\n options: {certified: true}\n });\n\n/**\n * Deletes multiple assets from the storage.\n *\n * @param {Object} params - The parameters for deleting the assets.\n * @param {Array} params.assets - The list of assets with their collections and full paths.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<void>} A promise that resolves when the assets are deleted.\n */\nexport const deleteManyAssets = ({\n assets,\n satellite\n}: {\n assets: ({collection: string} & Pick<AssetKey, 'fullPath'>)[];\n satellite?: SatelliteOptions;\n}): Promise<void> =>\n deleteManyAssetsApi({\n assets,\n satellite: {...satellite, identity: getAnyIdentity(satellite?.identity)},\n options: {certified: true}\n });\n\n/**\n * Deletes multiple assets from a collection based on filtering criteria.\n *\n * @param {Object} params - The parameters for deleting the assets.\n * @param {string} params.collection - The name of the collection from which to delete assets.\n * @param {ListParams} [params.filter] - The filter criteria to match assets for deletion.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<void>} A promise that resolves when the assets matching the filter criteria are deleted.\n */\nexport const deleteFilteredAssets = async ({\n collection,\n satellite: satelliteOptions,\n filter\n}: {\n collection: string;\n satellite?: SatelliteOptions;\n filter?: ListParams;\n}): Promise<void> => {\n const satellite = {...satelliteOptions, identity: getAnyIdentity(satelliteOptions?.identity)};\n\n return await deleteFilteredAssetsApi({\n collection,\n satellite,\n filter: filter ?? {},\n options: {certified: true}\n });\n};\n\n/**\n * Retrieves an asset from the storage.\n *\n * @param {Object} params - The parameters for retrieving the asset.\n * @param {string} params.collection - The name of the collection.\n * @param {string} params.fullPath - The full path of the asset.\n * @param {ReadOptions} [params.options] - Call options controlling certification. Defaults to uncertified reads for performance unless specified.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<AssetNoContent | undefined>} A promise that resolves to the asset or undefined if not found.\n */\nexport const getAsset = async ({\n satellite,\n options,\n ...rest\n}: {\n collection: string;\n satellite?: SatelliteOptions;\n options?: ReadOptions;\n} & Pick<AssetKey, 'fullPath'>): Promise<SatelliteDid.AssetNoContent | undefined> => {\n const identity = getAnyIdentity(satellite?.identity);\n\n return await getAssetApi({\n ...rest,\n satellite: {...satellite, identity},\n options: options ?? DEFAULT_READ_OPTIONS\n });\n};\n\n/**\n * Retrieves multiple assets from the storage.\n *\n * @param {Object} params - The parameters for retrieving the assets.\n * @param {Array} params.assets - The list of assets with their collections and full paths.\n * @param {ReadOptions} [params.options] - Call options controlling certification. Defaults to uncertified reads for performance unless specified.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<Array<AssetNoContent | undefined>>} A promise that resolves to an array of assets or undefined if not found.\n */\nexport const getManyAssets = async ({\n satellite,\n options,\n ...rest\n}: {\n assets: ({collection: string} & Pick<AssetKey, 'fullPath'>)[];\n satellite?: SatelliteOptions;\n options?: ReadOptions;\n}): Promise<(SatelliteDid.AssetNoContent | undefined)[]> => {\n const identity = getAnyIdentity(satellite?.identity);\n\n return await getManyAssetsApi({\n ...rest,\n satellite: {...satellite, identity},\n options: options ?? DEFAULT_READ_OPTIONS\n });\n};\n\n/**\n * Returns a public URL for accessing a specific asset stored on a Satellite.\n *\n * This URL can be used to:\n * - Open the file directly in a browser\n * - Embed the asset in HTML elements like `<img src=\"...\">`, `<video src=\"...\">`, or `<a href=\"...\">`\n * - Programmatically download or display the asset in your application\n *\n * ### Example\n * ```ts\n * const url = downloadUrl({\n * assetKey: {\n * fullPath: '/images/logo.png',\n * }\n * });\n *\n * // Usage in an <img> tag\n * <img src={url} alt=\"Logo\" />\n * ```\n *\n * @param {Object} params - Parameters for generating the URL.\n * @param {Object} params.assetKey - Identifies the asset to generate the URL for.\n * @param {string} params.assetKey.fullPath - The full path of the asset (e.g., `/folder/file.jpg`).\n * @param {string} [params.assetKey.token] - Optional access token for accessing protected assets.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {string} A full URL pointing to the asset.\n */\nexport const downloadUrl = ({\n assetKey: {fullPath, token},\n satellite: satelliteOptions\n}: {\n assetKey: Pick<Asset, 'fullPath' | 'token'>;\n} & {satellite?: SatelliteOptions}): string => {\n const satellite = {...satelliteOptions, identity: getAnyIdentity(satelliteOptions?.identity)};\n\n return `${satelliteUrl(satellite)}${fullPath}${nonNullish(token) ? `?token=${token}` : ''}`;\n};\n", "import {fromNullable} from '@dfinity/utils';\nimport type {SatelliteDid} from '@junobuild/ic-client/actor';\nimport {\n uploadAsset as uploadAssetStorage,\n type AssetKey,\n type UploadAsset\n} from '@junobuild/storage';\nimport type {ActorReadParams, ActorUpdateParams} from '../types/actor';\nimport type {ListParams, ListResults} from '../types/list';\nimport {toListParams} from '../utils/list.utils';\nimport {getSatelliteActor} from './actor.api';\n\nexport const uploadAsset = async ({\n asset,\n ...rest\n}: {asset: UploadAsset} & ActorUpdateParams): Promise<void> => {\n const actor = await getSatelliteActor(rest);\n\n await uploadAssetStorage({\n actor,\n asset\n });\n};\n\nexport const listAssets = async ({\n collection,\n filter,\n ...rest\n}: {\n collection: string;\n filter: ListParams;\n} & ActorReadParams): Promise<ListResults<SatelliteDid.AssetNoContent>> => {\n const {list_assets} = await getSatelliteActor(rest);\n\n const {\n items: assets,\n items_length,\n items_page,\n matches_length,\n matches_pages\n } = await list_assets(collection, toListParams(filter));\n\n return {\n items: assets.map(([_, asset]) => asset),\n items_length,\n items_page: fromNullable(items_page),\n matches_length,\n matches_pages: fromNullable(matches_pages)\n };\n};\n\nexport const countAssets = async ({\n collection,\n filter,\n ...rest\n}: {\n collection: string;\n filter: ListParams;\n} & ActorReadParams): Promise<bigint> => {\n const {count_assets} = await getSatelliteActor(rest);\n\n return count_assets(collection, toListParams(filter));\n};\n\nexport const deleteAsset = async ({\n collection,\n fullPath,\n ...rest\n}: {\n collection: string;\n} & ActorUpdateParams &\n Pick<AssetKey, 'fullPath'>): Promise<void> => {\n const actor = await getSatelliteActor(rest);\n\n return actor.del_asset(collection, fullPath);\n};\n\nexport const deleteManyAssets = async ({\n assets,\n satellite\n}: {\n assets: ({collection: string} & Pick<AssetKey, 'fullPath'>)[];\n} & ActorUpdateParams): Promise<void> => {\n const {del_many_assets} = await getSatelliteActor({satellite, options: {certified: true}});\n\n const payload: [string, string][] = assets.map(({collection, fullPath}) => [\n collection,\n fullPath\n ]);\n\n await del_many_assets(payload);\n};\n\nexport const deleteFilteredAssets = async ({\n collection,\n filter,\n ...rest\n}: {\n collection: string;\n filter: ListParams;\n} & ActorUpdateParams): Promise<void> => {\n const {del_filtered_assets} = await getSatelliteActor(rest);\n\n return del_filtered_assets(collection, toListParams(filter));\n};\n\nexport const getAsset = async ({\n collection,\n fullPath,\n ...rest\n}: {\n collection: string;\n} & ActorReadParams &\n Pick<AssetKey, 'fullPath'>): Promise<SatelliteDid.AssetNoContent | undefined> => {\n const {get_asset} = await getSatelliteActor(rest);\n return fromNullable(await get_asset(collection, fullPath));\n};\n\nexport const getManyAssets = async ({\n assets,\n ...rest\n}: {\n assets: ({collection: string} & Pick<AssetKey, 'fullPath'>)[];\n} & ActorReadParams): Promise<(SatelliteDid.AssetNoContent | undefined)[]> => {\n const {get_many_assets} = await getSatelliteActor(rest);\n\n const payload: [string, string][] = assets.map(({collection, fullPath}) => [\n collection,\n fullPath\n ]);\n\n const resultsAssets = await get_many_assets(payload);\n\n return resultsAssets.map(([_, resultAsset]) => fromNullable(resultAsset));\n};\n", "import {assertNonNullish, toNullable} from '@dfinity/utils';\nimport type {ConsoleDid, SatelliteDid} from '@junobuild/ic-client/actor';\nimport {isBrowser} from '@junobuild/utils';\nimport {UPLOAD_CHUNK_SIZE} from '../constants/upload.constants';\nimport type {EncodingType} from '../types/storage';\nimport type {UploadAsset, UploadParams, UploadWithProposalParams} from '../types/upload';\n\ntype InitAssetKey = SatelliteDid.InitAssetKey | ConsoleDid.InitAssetKey;\ntype UploadChunk = SatelliteDid.UploadChunk | ConsoleDid.UploadChunk;\ntype CommitBatch = SatelliteDid.CommitBatch | ConsoleDid.CommitBatch;\n\nexport const uploadAsset = async ({\n asset: {data, headers, ...restAsset},\n actor,\n progress\n}: {\n asset: UploadAsset;\n} & UploadParams): Promise<void> => {\n const {init_asset_upload, upload_asset_chunk, commit_asset_upload} = actor;\n\n const {batch_id: batchId} = await init_asset_upload(mapInitAssetUploadParams(restAsset));\n\n progress?.onInitiatedBatch();\n\n const {chunkIds} = await uploadChunks({data, uploadFn: upload_asset_chunk, batchId});\n\n progress?.onUploadedFileChunks(restAsset.fullPath);\n\n await commitAsset({\n commitFn: commit_asset_upload,\n batchId,\n data,\n headers,\n chunkIds\n });\n\n progress?.onCommittedBatch();\n};\n\nexport const uploadAssetWithProposal = async ({\n asset: {data, headers, ...restAsset},\n proposalId,\n actor,\n progress\n}: {\n asset: UploadAsset;\n} & UploadWithProposalParams): Promise<void> => {\n const {init_proposal_asset_upload, upload_proposal_asset_chunk, commit_proposal_asset_upload} =\n actor;\n\n progress?.onInitiatedBatch();\n\n const {batch_id: batchId} = await init_proposal_asset_upload(\n mapInitAssetUploadParams(restAsset),\n proposalId\n );\n\n const {chunkIds} = await uploadChunks({data, uploadFn: upload_proposal_asset_chunk, batchId});\n\n progress?.onUploadedFileChunks(restAsset.fullPath);\n\n await commitAsset({\n commitFn: commit_proposal_asset_upload,\n batchId,\n data,\n headers,\n chunkIds\n });\n\n progress?.onCommittedBatch();\n};\n\nexport const uploadAssetsWithProposal = async ({\n assets,\n proposalId,\n actor,\n progress\n}: {\n assets: UploadAsset[];\n} & UploadWithProposalParams): Promise<void> => {\n const {\n init_proposal_many_assets_upload,\n upload_proposal_asset_chunk,\n commit_proposal_many_assets_upload\n } = actor;\n\n const batchIds = await init_proposal_many_assets_upload(\n assets.map(mapInitAssetUploadParams),\n proposalId\n );\n\n progress?.onInitiatedBatch();\n\n const uploadAssetChunk = async ({\n fullPath,\n data,\n headers\n }: UploadAsset): Promise<BatchToCommit> => {\n const initializedBatch = batchIds.find(([batchIdFullPath]) => batchIdFullPath === fullPath);\n\n assertNonNullish(initializedBatch);\n\n const [_, initUpload] = initializedBatch;\n const {batch_id: batchId} = initUpload;\n\n const {chunkIds} = await uploadChunks({data, uploadFn: upload_proposal_asset_chunk, batchId});\n\n progress?.onUploadedFileChunks(fullPath);\n\n return {\n batchId,\n headers,\n chunkIds,\n data\n };\n };\n\n const batchAndChunkIdsToCommit = await Promise.all(assets.map(uploadAssetChunk));\n\n await commit_proposal_many_assets_upload(batchAndChunkIdsToCommit.map(mapCommitBatch));\n\n progress?.onCommittedBatch();\n};\n\nconst mapInitAssetUploadParams = ({\n filename,\n collection,\n token,\n fullPath,\n encoding,\n description\n}: Omit<UploadAsset, 'headers' | 'data'>): InitAssetKey => ({\n collection,\n full_path: fullPath,\n name: filename,\n token: toNullable<string>(token),\n encoding_type: toNullable<EncodingType>(encoding),\n description: toNullable(description)\n});\n\ntype BatchToCommit = {\n batchId: bigint;\n chunkIds: UploadChunkResult[];\n} & Pick<UploadAsset, 'headers' | 'data'>;\n\nconst mapCommitBatch = ({batchId, chunkIds, headers, data}: BatchToCommit): CommitBatch => {\n const contentType: [[string, string]] | undefined =\n headers.find(([type, _]) => type.toLowerCase() === 'content-type') === undefined &&\n data.type !== undefined &&\n data.type !== ''\n ? [['Content-Type', data.type]]\n : undefined;\n\n return {\n batch_id: batchId,\n chunk_ids: chunkIds.map(({chunk_id}: UploadChunkResult) => chunk_id),\n headers: [...headers, ...(contentType ?? [])]\n };\n};\n\nconst commitAsset = async ({\n commitFn,\n ...rest\n}: {\n commitFn: (commitBatch: CommitBatch) => Promise<void>;\n batchId: bigint;\n chunkIds: UploadChunkResult[];\n} & Pick<UploadAsset, 'headers' | 'data'>) => {\n const commitBatch = mapCommitBatch(rest);\n await commitFn(commitBatch);\n};\n\nconst uploadChunks = async ({\n data,\n uploadFn,\n batchId\n}: {\n batchId: bigint;\n} & Pick<UploadAsset, 'data'> &\n Pick<UploadChunkParams, 'uploadFn'>): Promise<{chunkIds: UploadChunkResult[]}> => {\n const uploadChunks: UploadChunkParams[] = [];\n\n // Prevent transforming chunk to arrayBuffer error: The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.\n const clone: Blob = isBrowser() ? new Blob([await data.arrayBuffer()]) : data;\n\n // Split data into chunks\n let orderId = 0n;\n for (let start = 0; start < clone.size; start += UPLOAD_CHUNK_SIZE) {\n const chunk: Blob = clone.slice(start, start + UPLOAD_CHUNK_SIZE);\n\n uploadChunks.push({\n batchId,\n chunk,\n uploadFn,\n orderId\n });\n\n orderId++;\n }\n\n // Upload chunks to the IC in batch - i.e. 12 chunks uploaded at a time.\n let chunkIds: UploadChunkResult[] = [];\n for await (const results of batchUploadChunks({uploadChunks})) {\n chunkIds = [...chunkIds, ...results];\n }\n\n return {chunkIds};\n};\n\nasync function* batchUploadChunks({\n uploadChunks,\n limit = 12\n}: {\n uploadChunks: UploadChunkParams[];\n limit?: number;\n}): AsyncGenerator<UploadChunkResult[], void> {\n for (let i = 0; i < uploadChunks.length; i = i + limit) {\n const batch = uploadChunks.slice(i, i + limit);\n const result = await Promise.all(batch.map((params) => uploadChunk(params)));\n yield result;\n }\n}\n\ninterface UploadChunkResult {\n chunk_id: bigint;\n}\n\ninterface UploadChunkParams {\n batchId: bigint;\n chunk: Blob;\n uploadFn: (uploadChunk: UploadChunk) => Promise<UploadChunkResult>;\n orderId: bigint;\n}\n\nconst uploadChunk = async ({\n batchId,\n chunk,\n uploadFn,\n orderId\n}: UploadChunkParams): Promise<UploadChunkResult> =>\n uploadFn({\n batch_id: batchId,\n content: new Uint8Array(await chunk.arrayBuffer()),\n order_id: toNullable(orderId)\n });\n", "export const sha256ToBase64String = (sha256: Iterable<number>): string =>\n btoa([...sha256].map((c) => String.fromCharCode(c)).join(''));\n"],
5
- "mappings": ";;AAAA,OAAQ,oBAAAA,OAAuB,iBCA/B,OAAQ,aAAAC,OAAgB,iBCAjB,IAAeC,EAAf,KAAwB,CACrB,UAAgE,CAAC,EAE/D,SAASC,EAAgB,CACjC,KAAK,UAAU,QAAQ,CAAC,CAAC,SAAAC,CAAQ,IAC/BA,EAASD,CAAI,CACf,CACF,CAEA,UAAUC,EAAgD,CACxD,IAAMC,EAAa,OAAO,EAC1B,YAAK,UAAU,KAAK,CAAC,GAAIA,EAAY,SAAAD,CAAQ,CAAC,EAEvC,IACJ,KAAK,UAAY,KAAK,UAAU,OAC/B,CAAC,CAAC,GAAAE,CAAE,IAAwDA,IAAOD,CACrE,CACJ,CACF,ECdO,IAAME,EAAN,MAAMC,UAAkBC,CAAmB,CAChD,OAAe,SAEP,SAAwB,KAExB,aAAc,CACpB,MAAM,CACR,CAEA,OAAO,aAAc,CACnB,OAAKD,EAAU,WACbA,EAAU,SAAW,IAAIA,GAEpBA,EAAU,QACnB,CAEA,IAAIE,EAAuB,CACzB,KAAK,SAAWA,EAEhB,KAAK,SAASA,CAAQ,CACxB,CAEA,KAAmB,CACjB,OAAO,KAAK,QACd,CAES,UAAUC,EAAoD,CACrE,IAAMC,EAA0B,MAAM,UAAUD,CAAQ,EAExD,OAAAA,EAAS,KAAK,QAAQ,EAEfC,CACT,CAEA,OAAQ,CACN,KAAK,SAAW,KAEhB,KAAK,SAAS,KAAK,QAAQ,CA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IAAID,CAAG,EAE9B,MAAME,GAAS,EAEf,IAAMC,EACJH,EAAI,SAAS,OAAS,OAAYI,GAAsBJ,EAAI,QAAQ,IAAI,EAAI,OAE9E,MAAO,CAAC,GAAIG,EAAgB,CAACA,CAAa,EAAI,CAAC,CAAE,CACnD,EAOaA,GAAiBE,GAC5BC,EAAU,YAAY,EAAE,UAAUD,CAAQ",
6
- "names": ["assertNonNullish", "isNullish", "Store", "data", "callback", "callbackId", "id", "AuthStore", "_AuthStore", "Store", "authUser", "callback", "unsubscribe", "emit", "message", "detail", "$event", "ERROR_USER_INTERRUPT", "isNullish", "DELEGATION_IDENTITY_EXPIRATION", "ALLOW_PIN_AUTHENTICATION", "II_POPUP", "NFID_POPUP", "INTERNET_COMPUTER_ORG", "isNullish", "nonNullish", "DOCKER_CONTAINER_URL", "DOCKER_INTERNET_IDENTITY_ID", "EnvStore", "_EnvStore", "Store", "env", "callback", "unsubscribe", "isNullish", "jsonReplacer", "jsonReviver", "toArray", "data", "blob", "fromArray", "isBrowser", "popupCenter", "width", "height", "p", "isNullish", "innerWidth", "innerHeight", "y", "x", "InternetIdentityProvider", "#domain", "domain", "windowed", "identityProviderUrl", "container", "EnvStore", "isNullish", "INTERNET_COMPUTER_ORG", "env", "internetIdentityId", "nonNullish", "DOCKER_INTERNET_IDENTITY_ID", "containerHost", "protocol", "DOCKER_CONTAINER_URL", "popupCenter", "II_POPUP", "NFIDProvider", "#appName", "#logoUrl", "appName", "logoUrl", "NFID_POPUP", "Actor", "isNullish", "isNullish", "HttpAgent", "nonNullish", "createAgent", "identity", "container", "host", "nonNullish", "DOCKER_CONTAINER_URL", "shouldFetchRootKey", "HttpAgent", "AgentStore", "_AgentStore", "#agents", "isNullish", "identity", "rest", "key", "agent", "createAgent", "ActorStore", "_ActorStore", "#actors", "isNullish", "satelliteId", "identity", "actorKey", "rest", "key", "actor", "idlFactory", "canisterId", "agent", "AgentStore", "Actor", "SignInError", "SignInInitError", "SignInUserInterruptError", "InitError", "ListError", "AuthClient", "createAuthClient", "isNullish", "nonNullish", "isSatelliteError", "error", "type", "JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE", "fromNullable", "isNullish", "nonNullish", "mapData", "data", "i", "err", "fromNullable", "toNullable", "toSetDoc", "doc", "data", "version", "description", "toNullable", "a", "toDelDoc", "fromDoc", "key", "owner", "docDescription", "rest", "fromNullable", "i", "Principal", "isNullish", "toNullable", "toListMatcherTimestamp", "matcher", "isNullish", "toNullable", "ListError", "toListParams", "paginate", "order", "owner", "Principal", "assertNonNullish", "Actor", "HttpAgent", "FromStringToTokenError", "E8S_PER_TOKEN", "ALPHABET", "LOOKUP_TABLE", "i", "lookUpTable", "idlFactory", "IDL", "CommitBatch", "CommitProposal", "ListOrderField", "ListOrder", "TimestampMatcher", "ListMatcher", "ListPaginate", "ListParams", "DeleteControllersArgs", "ControllerScope", "Controller", "DelDoc", "CollectionType", "DelRule", "DeleteProposalAssets", "DepositCyclesArgs", "AssetKey", "AssetEncodingNoContent", "AssetNoContent", "AuthenticationConfigInternetIdentity", "AuthenticationRules", "AuthenticationConfig", "ConfigMaxMemorySize", "DbConfig", "StorageConfigIFrame", "StorageConfigRawAccess", "StorageConfigRedirect", "StorageConfig", "Config", "Doc", "ProposalStatus", "AssetsUpgradeOptions", "SegmentsDeploymentOptions", "ProposalType", "Proposal", "Memory", "Permission", "RateConfig", "Rule", "HttpRequest", "StreamingCallbackToken", "StreamingStrategy", "HttpResponse", "StreamingCallbackHttpResponse", "InitAssetKey", "InitUploadResult", "ListResults", "CustomDomain", "ListResults_1", "ListProposalsOrder", "ListProposalsPaginate", "ListProposalsParams", "ProposalKey", "ListProposalResults", "ListRulesMatcher", "ListRulesParams", "ListRulesResults", "MemorySize", "SetAuthenticationConfig", "SetController", "SetControllersArgs", "SetDbConfig", "SetDoc", "SetRule", "SetStorageConfig", "UploadChunk", "UploadChunkResult", "nonNullish", "satelliteUrl", "customSatelliteId", "customContainer", "satelliteId", "customOrEnvSatelliteId", "container", "customOrEnvContainer", "nonNullish", "containerHost", "protocol", "DOCKER_CONTAINER_URL", "EnvStore", "getSatelliteActor", "satellite", "certified", "getActor", "Pt", "ht", "getSatelliteExtendedActor", "idlFactory", "rest", "customSatelliteId", "customContainer", "satelliteId", "customOrEnvSatelliteId", "assertNonNullish", "container", "customOrEnvContainer", "ActorStore", "getDoc", "collection", "key", "rest", "get_doc", "getSatelliteActor", "doc", "fromNullable", "isNullish", "fromDoc", "getManyDocs", "docs", "get_many_docs", "payload", "resultsDocs", "results", "resultDoc", "nonNullish", "setDoc", "set_doc", "toSetDoc", "updatedDoc", "setManyDocs", "set_many_docs", "updatedDocs", "deleteDoc", "del_doc", "toDelDoc", "deleteManyDocs", "del_many_docs", "deleteFilteredDocs", "filter", "del_filtered_docs", "toListParams", "listDocs", "list_docs", "items", "items_page", "items_length", "matches_length", "matches_pages", "item", "dataArray", "owner", "description", "version", "mapData", "countDocs", "count_docs", "DEFAULT_READ_OPTIONS", "AnonymousIdentity", "nonNullish", "getAnyIdentity", "identity", "nonNullish", "getIdentity", "AnonymousIdentity", "getDoc", "satellite", "options", "rest", "identity", "getAnyIdentity", "DEFAULT_READ_OPTIONS", "getManyDocs", "setDoc", "setManyDocs", "deleteDoc", "deleteManyDocs", "deleteFilteredDocs", "filter", "listDocs", "countDocs", "initUser", "provider", "identity", "getIdentity", "isNullish", "InitError", "userId", "loadUser", "getDoc", "user", "nonNullish", "createUser", "error", "t", "R_", "userOnCreateError", "rest", "setDoc", "authClient", "initAuth", "provider", "createAuthClient", "user", "initUser", "AuthStore", "signIn", "options", "resolve", "reject", "isNullish", "SignInInitError", "InternetIdentityProvider", "error", "ERROR_USER_INTERRUPT", "SignInUserInterruptError", "SignInError", "DELEGATION_IDENTITY_EXPIRATION", "ALLOW_PIN_AUTHENTICATION", "signOut", "resetAuth", "ActorStore", "AgentStore", "getIdentity", "unsafeIdentity", "getIdentityOnce", "initAuthTimeoutWorker", "auth", "workerUrl", "worker", "timeoutSignOut", "emit", "signOut", "data", "msg", "value", "AuthStore", "user", "isNullish", "envSatelliteId", "viteEnvSatelliteId", "envContainer", "viteEnvContainer", "getSatelliteExtendedActor", "idlFactory", "satellite", "identity", "getAnyIdentity", "fromNullable", "nonNullish", "fromNullable", "assertNonNullish", "toNullable", "uploadAsset", "data", "headers", "restAsset", "actor", "progress", "init_asset_upload", "upload_asset_chunk", "commit_asset_upload", "batchId", "mapInitAssetUploadParams", "chunkIds", "uploadChunks", "commitAsset", "mapInitAssetUploadParams", "filename", "collection", "token", "fullPath", "encoding", "description", "toNullable", "mapCommitBatch", "batchId", "chunkIds", "headers", "data", "contentType", "type", "_", "chunk_id", "commitAsset", "commitFn", "rest", "commitBatch", "uploadChunks", "uploadFn", "clone", "isBrowser", "orderId", "start", "chunk", "results", "batchUploadChunks", "limit", "i", "batch", "params", "uploadChunk", "uploadAsset", "asset", "rest", "actor", "getSatelliteActor", "K", "listAssets", "collection", "filter", "list_assets", "assets", "items_length", "items_page", "matches_length", "matches_pages", "toListParams", "_", "fromNullable", "countAssets", "count_assets", "deleteAsset", "fullPath", "deleteManyAssets", "satellite", "del_many_assets", "payload", "deleteFilteredAssets", "del_filtered_assets", "getAsset", "get_asset", "getManyAssets", "get_many_assets", "resultAsset", "sha256ToBase64String", "sha256", "c", "uploadBlob", "params", "uploadAssetIC", "uploadFile", "storageFilename", "data", "collection", "headers", "storagePath", "token", "satelliteOptions", "encoding", "description", "identity", "getAnyIdentity", "filename", "fullPath", "satellite", "uploadAsset", "downloadUrl", "listAssets", "filter", "options", "items", "rest", "DEFAULT_READ_OPTIONS", "assets", "t", "name", "owner", "encodings", "created_at", "updated_at", "fromNullable", "acc", "type", "modified", "sha256", "total_length", "sha256ToBase64String", "countAssets", "deleteAsset", "deleteManyAssets", "deleteFilteredAssets", "getAsset", "getManyAssets", "satelliteUrl", "nonNullish", "parseEnv", "userEnv", "satelliteId", "envSatelliteId", "assertNonNullish", "container", "envContainer", "initJuno", "initSatellite", "env", "EnvStore", "initAuth", "authSubscribe", "initAuthTimeoutWorker", "callback", "AuthStore"]
3
+ "sources": ["../../src/index.ts", "../../../ic-client/src/webauthn/aaguid.ts", "../../../ic-client/src/webauthn/agent-js/cose-utils.ts", "../../../ic-client/src/webauthn/agent-js/cose-key.ts", "../../../ic-client/src/webauthn/credential.ts", "../../../ic-client/src/webauthn/errors.ts", "../../../ic-client/src/webauthn/identity.ts", "../../../ic-client/src/webauthn/_constants.ts", "../../../ic-client/src/webauthn/_options.ts", "../../../ic-client/src/webauthn/_progress.ts", "../../../ic-client/src/webauthn/types/progress.ts", "../../../ic-client/src/webauthn/utils.ts", "../../src/auth/services/auth-timout.services.ts", "../../src/core/stores/_store.ts", "../../src/auth/stores/auth.store.ts", "../../src/auth/utils/events.utils.ts", "../../src/auth/services/auth.services.ts", "../../src/core/stores/actor.store.ts", "../../src/core/stores/agent.store.ts", "../../src/core/stores/_agent.factory.ts", "../../src/core/constants/container.constants.ts", "../../src/auth/helpers/window.helpers.ts", "../../src/auth/providers/internet-identity.providers.ts", "../../src/core/stores/env.store.ts", "../../src/auth/constants/auth.constants.ts", "../../src/auth/utils/window.utils.ts", "../../../utils/src/utils/did.utils.ts", "../../../utils/src/utils/env.utils.ts", "../../src/auth/providers/_auth-client.providers.ts", "../../src/auth/helpers/progress.helpers.ts", "../../src/auth/types/auth-client.ts", "../../src/auth/types/errors.ts", "../../src/auth/providers/nfid.providers.ts", "../../src/auth/providers/webauthn.providers.ts", "../../src/core/constants/call-options.constants.ts", "../../src/core/services/identity.services.ts", "../../src/datastore/api/doc.api.ts", "../../src/core/api/actor.api.ts", "../../../ic-client/src/actor/api/actor.api.ts", "../../../ic-client/src/declarations/mission_control/mission_control.factory.did.js", "../../../ic-client/src/declarations/orbiter/orbiter.factory.did.js", "../../../ic-client/src/declarations/orbiter/orbiter.factory.certified.did.js", "../../../ic-client/src/declarations/deprecated/satellite-deprecated-no-scope.factory.did.js", "../../../ic-client/src/declarations/deprecated/satellite-deprecated-version.factory.did.js", "../../../ic-client/src/declarations/deprecated/orbiter-deprecated-version.factory.did.js", "../../../ic-client/src/declarations/deprecated/mission_control-deprecated-version.factory.did.js", "../../../ic-client/src/declarations/deprecated/satellite-deprecated.factory.did.js", "../../../ic-client/src/declarations/satellite/satellite.factory.did.js", "../../../ic-client/src/declarations/satellite/satellite.factory.certified.did.js", "../../../ic-client/src/declarations/console/console.factory.did.js", "../../../ic-client/src/declarations/console/console.factory.certified.did.js", "../../../ic-client/src/declarations/sputnik/sputnik.factory.did.js", "../../../ic-client/src/actor/api/agent.api.ts", "../../../ic-client/src/actor/utils/agent.utils.ts", "../../src/core/utils/env.utils.ts", "../../src/core/utils/list.utils.ts", "../../src/datastore/utils/data.utils.ts", "../../src/datastore/utils/doc.utils.ts", "../../src/datastore/services/doc.services.ts", "../../src/auth/services/user-webauthn.services.ts", "../../src/auth/types/webauthn.ts", "../../src/auth/utils/auth.utils.ts", "../../src/auth/services/_user.services.ts", "../../../errors/src/utils.ts", "../../../errors/src/constants/cdn.constants.ts", "../../../errors/src/constants/collections.constants.ts", "../../../errors/src/constants/satellite.constants.ts", "../../../errors/src/constants/shared.constants.ts", "../../src/core/utils/window.env.utils.ts", "../../src/functions/services/functions.services.ts", "../../src/storage/services/storage.services.ts", "../../src/storage/api/storage.api.ts", "../../../storage/src/services/upload.services.ts", "../../src/storage/utils/crypto.utils.ts"],
4
+ "sourcesContent": ["import {assertNonNullish} from '@dfinity/utils';\nimport {isWebAuthnAvailable} from '@junobuild/ic-client/webauthn';\nimport type {Asset, AssetEncoding, AssetKey, EncodingType, Storage} from '@junobuild/storage';\nimport {initAuthTimeoutWorker} from './auth/services/auth-timout.services';\nimport {loadAuth} from './auth/services/auth.services';\nimport {AuthStore} from './auth/stores/auth.store';\nimport type {User} from './auth/types/user';\nimport {EnvStore} from './core/stores/env.store';\nimport type {Environment, UserEnvironment} from './core/types/env';\nimport type {Unsubscribe} from './core/types/subscription';\nimport {envContainer, envSatelliteId} from './core/utils/window.env.utils';\nexport * from './auth/providers/internet-identity.providers';\nexport * from './auth/providers/nfid.providers';\nexport {\n getIdentityOnce,\n signIn,\n signOut,\n signUp,\n unsafeIdentity\n} from './auth/services/auth.services';\nexport type * from './auth/types/auth';\nexport * from './auth/types/auth-client';\nexport * from './auth/types/errors';\nexport type * from './auth/types/progress';\nexport type * from './auth/types/provider';\nexport type * from './auth/types/user';\nexport * from './auth/types/webauthn';\nexport type * from './core/types/env';\nexport {ListOrder, ListPaginate, ListParams, ListResults} from './core/types/list';\nexport type * from './core/types/satellite';\nexport type * from './core/types/subscription';\nexport type * from './core/types/utility';\nexport * from './datastore/services/doc.services';\nexport type * from './datastore/types/doc';\nexport * from './functions/services/functions.services';\nexport * from './storage/services/storage.services';\nexport type * from './storage/types/storage';\nexport {isWebAuthnAvailable};\nexport type {Asset, AssetEncoding, AssetKey, EncodingType, Storage};\n\nconst parseEnv = (userEnv?: UserEnvironment): Environment => {\n const satelliteId = userEnv?.satelliteId ?? envSatelliteId();\n\n assertNonNullish(satelliteId, 'Satellite ID is not configured. Juno cannot be initialized.');\n\n const container = userEnv?.container ?? envContainer();\n\n return {\n satelliteId,\n internetIdentityId: userEnv?.internetIdentityId,\n workers: userEnv?.workers,\n container\n };\n};\n\n/**\n * @deprecated Use {@link initSatellite} instead.\n */\nexport const initJuno = (userEnv?: UserEnvironment): Promise<Unsubscribe[]> =>\n initSatellite(userEnv);\n\n/**\n * Initializes a Satellite with the provided optional environment parameters.\n * If no environment is provided, the variables injected by the Vite or NextJS plugins will be used.\n * @param {UserEnvironment} [userEnv] - The optional user environment configuration.\n * @returns {Promise<Unsubscribe[]>} A promise that resolves to an array of unsubscribe functions.\n */\nexport const initSatellite = async (userEnv?: UserEnvironment): Promise<Unsubscribe[]> => {\n const env = parseEnv(userEnv);\n\n EnvStore.getInstance().set(env);\n\n await loadAuth();\n\n const authSubscribe =\n env.workers?.auth !== undefined ? initAuthTimeoutWorker(env.workers.auth) : undefined;\n\n return [...(authSubscribe ? [authSubscribe] : [])];\n};\n\n/**\n * Subscribes to authentication state changes. i.e. each time a user signs in or signs out, the callback will be triggered.\n * @param {function(User | null): void} callback - The callback function to execute when the authentication state changes.\n * @returns {Unsubscribe} A function to unsubscribe from the authentication state changes.\n */\nexport const onAuthStateChange = (callback: (authUser: User | null) => void): Unsubscribe =>\n AuthStore.getInstance().subscribe(callback);\n\n/**\n * @deprecated Use {@link onAuthStateChange} instead.\n */\nexport const authSubscribe = onAuthStateChange;\nexport {InternetIdentityConfig, InternetIdentityDomain} from './auth/types/internet-identity';\nexport {NFIDConfig} from './auth/types/nfid';\n", "import {uint8ArrayToArrayOfNumber} from '@dfinity/utils';\n\n/**\n * Extracts the AAGUID (Authenticator Attestation GUID) from a WebAuthn data buffer.\n *\n * The AAGUID is a 16-byte value located at offsets 37..53 within `authenticatorData`\n * when **attested credential data** is present (i.e., during registration/attestation).\n *\n * For assertion (sign-in) responses, `authenticatorData` is typically 37 bytes and\n * does not include an AAGUID.\n *\n * If the extracted value is all zeros (`00000000-0000-0000-0000-000000000000`),\n * this function returns `{ unknownProvider: null }` since some passkey providers\n * intentionally use a zero AAGUID.\n *\n * @param {Object} params\n * @param {Uint8Array} params.authData - The WebAuthn `authenticatorData` bytes.\n * @returns {{aaguid: string; bytes: Uint8Array} | {invalidAuthData: null} | {unknownProvider: null}}\n * - { aaguidText, aaguidBytes } for valid AAGUID\n * - { unknownProvider: null } for all-zero AAGUID\n * - { invalidAuthData: null } if `authData` is invalid (too short, too long, etc.)\n *\n * @see https://web.dev/articles/webauthn-aaguid\n */\nexport const extractAAGUID = ({\n authData\n}: {\n authData: Uint8Array;\n}):\n | {aaguidText: string; aaguidBytes: Uint8Array}\n | {invalidAuthData: null}\n | {unknownProvider: null} => {\n if (authData.byteLength < 37) {\n return {invalidAuthData: null};\n }\n\n if (authData.byteLength < 53) {\n return {invalidAuthData: null};\n }\n\n const bytes = authData.slice(37, 53);\n\n const result = bytesToAAGUID({bytes});\n\n if ('aaguid' in result) {\n return {aaguidBytes: bytes, aaguidText: result.aaguid};\n }\n\n return {unknownProvider: null};\n};\n\n/**\n * Convert 16 AAGUID bytes to canonical UUID string (lowercase, hyphenated).\n *\n * Returns:\n * - { aaguid } for non-zero AAGUIDs\n * - { unknownProvider: null } for all-zero AAGUID\n * - { invalidBytes: null } if length \u2260 16\n *\n * @param {{bytes: Uint8Array | number[]}} params\n * @returns {{aaguid: string} | {invalidBytes: null} | {unknownProvider: null}}\n */\nexport const bytesToAAGUID = ({\n bytes\n}: {\n bytes: Uint8Array | number[];\n}): {aaguid: string} | {invalidBytes: null} | {unknownProvider: null} => {\n if (bytes.length !== 16) {\n return {invalidBytes: null};\n }\n\n const hex = (bytes instanceof Uint8Array ? uint8ArrayToArrayOfNumber(bytes) : bytes)\n .map((byte) => byte.toString(16).padStart(2, '0'))\n .join('');\n\n const aaguid = hex.replace(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/, '$1-$2-$3-$4-$5');\n\n // \"00000000-0000-0000-0000-0000000000000\" represents an unknown passkey provider. Some passkey providers use this AAGUID intentionally.\n // Source: https://web.dev/articles/webauthn-aaguid\n if (aaguid === '00000000-0000-0000-0000-000000000000') {\n return {unknownProvider: null};\n }\n\n return {aaguid};\n};\n", "import {DER_COSE_OID, wrapDER, type DerEncodedPublicKey} from '@dfinity/agent';\n\n/**\n * \u26A0\uFE0F !!!WARNING!!! \u26A0\uFE0F\n * This module is a copy/paste of the webauthn functions not exposed by Agent-js.\n * It is therefore not covered by any tests (\u203C\uFE0F) in this library.\n *\n * @see https://github.com/dfinity/agent-js/blob/main/packages/identity/src/identity/webauthn.ts\n */\n\n/**\n * From the documentation;\n * The authData is a byte array described in the spec. Parsing it will involve slicing bytes from\n * the array and converting them into usable objects.\n *\n * See https://webauthn.guide/#registration (subsection \"Example: Parsing the authenticator data\").\n * @param authData The authData field of the attestation response.\n * @returns The COSE key of the authData.\n */\nexport function _authDataToCose(authData: Uint8Array): Uint8Array {\n const dataView = new DataView(new ArrayBuffer(2));\n const idLenBytes = authData.slice(53, 55);\n [...new Uint8Array(idLenBytes)].forEach((v, i) => dataView.setUint8(i, v));\n const credentialIdLength = dataView.getUint16(0);\n\n // Get the public key object.\n return authData.slice(55 + credentialIdLength);\n}\n\nexport function _coseToDerEncodedBlob(cose: Uint8Array): DerEncodedPublicKey {\n return wrapDER(cose.buffer as ArrayBuffer, DER_COSE_OID).buffer as DerEncodedPublicKey;\n}\n", "import type {DerEncodedPublicKey, PublicKey} from '@dfinity/agent';\nimport {_coseToDerEncodedBlob} from './cose-utils';\n\n/**\n * \u26A0\uFE0F !!!WARNING!!! \u26A0\uFE0F\n * This module is a copy/paste of the webauthn classes not exposed by Agent-js.\n * It is therefore not covered by any tests (\u203C\uFE0F) in this library.\n *\n * @see https://github.com/dfinity/agent-js/blob/main/packages/identity/src/identity/webauthn.ts\n */\n\n/**\n * COSE-encoded key (CBOR Object Signing and Encryption).\n * serialized as a Uint8Array.\n */\nexport type CoseEncodedKey = Uint8Array;\n\nexport class CosePublicKey implements PublicKey {\n protected _encodedKey: DerEncodedPublicKey;\n\n public constructor(protected _cose: CoseEncodedKey) {\n this._encodedKey = _coseToDerEncodedBlob(_cose);\n }\n\n public toDer(): DerEncodedPublicKey {\n return this._encodedKey;\n }\n}\n", "import type {PublicKey} from '@dfinity/agent';\nimport {uint8ArrayToBase64} from '@dfinity/utils';\nimport {extractAAGUID} from './aaguid';\nimport {type CoseEncodedKey, CosePublicKey} from './agent-js/cose-key';\n\n/**\n * Arguments to initialize a WebAuthn object.\n */\nexport interface InitWebAuthnCredentialArgs {\n /**\n * The credential ID (authenticator\u2019s `rawId`) as bytes.\n */\n rawId: Uint8Array;\n\n /**\n * COSE-encoded public key extracted from attestation/authData.\n */\n cose: CoseEncodedKey;\n}\n\nexport interface InitWebAuthnNewCredentialArgs extends InitWebAuthnCredentialArgs {\n /**\n * The authenticator data from the attestation.\n */\n authData: Uint8Array;\n}\n\n/**\n * A wrapper around a WebAuthn credential that provides various base information such as its ID or public key.\n */\nexport abstract class WebAuthnCredential {\n readonly #credentialId: Uint8Array;\n readonly #publicKey: CosePublicKey;\n\n /**\n * @param args - {@link InitWebAuthnCredentialArgs} used to initialize the credential.\n * @param args.rawId - Credential ID (`rawId`) as bytes.\n * @param args.cose - COSE-encoded public key.\n */\n constructor({rawId: credentialId, cose}: InitWebAuthnCredentialArgs) {\n this.#credentialId = credentialId;\n this.#publicKey = new CosePublicKey(cose);\n }\n\n /**\n * Returns the public key for this credential.\n */\n getPublicKey(): PublicKey {\n return this.#publicKey;\n }\n\n /**\n * Returns the credential ID as bytes.\n */\n getCredentialId(): Uint8Array {\n return this.#credentialId;\n }\n\n /**\n * Returns the credential ID as textual representation (a base64 string).\n */\n getCredentialIdText(): string {\n return uint8ArrayToBase64(this.#credentialId);\n }\n}\n\n/**\n * A wrapper around a newly created WebAuthn credential.\n * It is created using `navigator.credentials.create` which provides an attestation.\n */\nexport class WebAuthnNewCredential extends WebAuthnCredential {\n readonly #aaguidText: string | undefined;\n readonly #aaguidBytes: Uint8Array | undefined;\n\n /**\n * @param args - {@link InitWebAuthnNewCredentialArgs} used to initialize the credential.\n * @param args.rawId - Credential ID (`rawId`) as bytes.\n * @param args.cose - COSE-encoded public key.\n * @params args.authData - Authenticator data from the attestation.\n */\n constructor({authData, ...rest}: InitWebAuthnNewCredentialArgs) {\n super(rest);\n\n const optionAaguid = extractAAGUID({authData});\n this.#aaguidText = 'aaguidText' in optionAaguid ? optionAaguid.aaguidText : undefined;\n this.#aaguidBytes = 'aaguidBytes' in optionAaguid ? optionAaguid.aaguidBytes : undefined;\n }\n\n /**\n * Returns AAGUID (Authenticator Attestation GUID).\n */\n getAAGUID(): Uint8Array | undefined {\n return this.#aaguidBytes;\n }\n\n /**\n * Returns the textual representation of the AAGUID (Authenticator Attestation GUID).\n */\n getAAGUIDText(): string | undefined {\n return this.#aaguidText;\n }\n}\n\n/**\n * A wrapper around a retrieval of existing WebAuthn credential.\n * It is created using `navigator.credentials.get` which provides an assertion.\n */\nexport class WebAuthnExistingCredential extends WebAuthnCredential {}\n", "export class WebAuthnIdentityHostnameError extends Error {}\nexport class WebAuthnIdentityCredentialNotInitializedError extends Error {}\nexport class WebAuthnIdentityCreateCredentialOnTheDeviceError extends Error {}\nexport class WebAuthnIdentityCredentialNotPublicKeyError extends Error {}\nexport class WebAuthnIdentityNoAttestationError extends Error {}\nexport class WebAuthnIdentityInvalidCredentialIdError extends Error {}\nexport class WebAuthnIdentityEncodeCborSignatureError extends Error {}\n// https://developer.mozilla.org/en-US/docs/Web/API/AuthenticatorAssertionResponse/authenticatorData\nexport class WebAuthnIdentityNoAuthenticatorDataError extends Error {}\n// https://developer.mozilla.org/en-US/docs/Web/API/AuthenticatorAssertionResponse/signature\nexport class WebAuthnIdentityNoSignatureError extends Error {}\n", "import {Cbor, type PublicKey, type Signature, SignIdentity} from '@dfinity/agent';\nimport {arrayBufferToUint8Array, isNullish, uint8ArraysEqual} from '@dfinity/utils';\nimport {AUTHENTICATOR_ABORT_TIMEOUT} from './_constants';\nimport {createPasskeyOptions, retrievePasskeyOptions} from './_options';\nimport {execute} from './_progress';\nimport {_authDataToCose} from './agent-js/cose-utils';\nimport {\n type InitWebAuthnNewCredentialArgs,\n type WebAuthnCredential,\n WebAuthnExistingCredential,\n WebAuthnNewCredential\n} from './credential';\nimport {\n WebAuthnIdentityCreateCredentialOnTheDeviceError,\n WebAuthnIdentityCredentialNotInitializedError,\n WebAuthnIdentityCredentialNotPublicKeyError,\n WebAuthnIdentityEncodeCborSignatureError,\n WebAuthnIdentityInvalidCredentialIdError,\n WebAuthnIdentityNoAttestationError,\n WebAuthnIdentityNoAuthenticatorDataError\n} from './errors';\nimport type {\n AuthenticatorOptions,\n CreateWebAuthnIdentityWithExistingCredentialArgs,\n CreateWebAuthnIdentityWithNewCredentialArgs,\n RetrievePublicKeyFn\n} from './types/identity';\nimport type {PasskeyOptions} from './types/passkey';\nimport {\n type WebAuthnSignProgressArgs,\n type WebAuthnSignProgressFn,\n WebAuthnSignProgressStep\n} from './types/progress';\n\ntype PublicKeyCredentialWithAttachment = Omit<PublicKeyCredential, 'response'> & {\n response: AuthenticatorAssertionResponse & {\n attestationObject?: ArrayBuffer;\n };\n};\n\nconst createAbortSignal = ({\n timeout\n}: Pick<AuthenticatorOptions<PasskeyOptions>, 'timeout'>): AbortSignal =>\n AbortSignal.timeout(timeout ?? AUTHENTICATOR_ABORT_TIMEOUT);\n\nconst retrieveCredentials = async ({\n challenge,\n credentialIds,\n passkeyOptions,\n timeout\n}: {\n challenge: Uint8Array;\n credentialIds?: Uint8Array[];\n} & AuthenticatorOptions<PasskeyOptions>): Promise<Credential | null> =>\n await navigator.credentials.get({\n publicKey: {\n ...retrievePasskeyOptions(passkeyOptions),\n challenge: challenge.buffer as BufferSource,\n allowCredentials: (credentialIds ?? []).map((id) => ({\n id: id.buffer as BufferSource,\n type: 'public-key'\n }))\n },\n signal: createAbortSignal({timeout})\n });\n\ntype WebAuthnState<T extends WebAuthnCredential> =\n | {status: 'pending'; retrievePublicKey: RetrievePublicKeyFn}\n | {status: 'initialized'; credential: T};\n\nconst assertWebAuthnStateInitialized: <T extends WebAuthnCredential>(\n state: WebAuthnState<T>\n) => asserts state is {\n status: 'initialized';\n credential: T;\n} = <T extends WebAuthnCredential>(state: WebAuthnState<T>): void => {\n if (state.status !== 'initialized') {\n throw new WebAuthnIdentityCredentialNotInitializedError();\n }\n};\n\nconst assertNonNullishCredential: (\n credential: Credential | null\n) => asserts credential is Credential = (credential: Credential | null): void => {\n if (isNullish(credential)) {\n throw new WebAuthnIdentityCreateCredentialOnTheDeviceError();\n }\n};\n\nconst assertCredentialPublicKey: (\n credential: Credential\n) => asserts credential is PublicKeyCredentialWithAttachment = ({type}: Credential): void => {\n if (type !== 'public-key') {\n throw new WebAuthnIdentityCredentialNotPublicKeyError();\n }\n};\n\n/**\n * A signing identity for the Internet Computer, backed by a WebAuthn credential.\n *\n * Use one of the factory methods to construct an instance:\n * - {@link WebAuthnIdentity.createWithNewCredential} to create a new passkey on the device.\n * - {@link WebAuthnIdentity.createWithExistingCredential} to use an existing passkey.\n *\n * @template T Concrete credential type for this identity\n * ({@link WebAuthnNewCredential} or {@link WebAuthnExistingCredential}).\n */\nexport class WebAuthnIdentity<T extends WebAuthnCredential> extends SignIdentity {\n readonly #onSignProgress: WebAuthnSignProgressFn | undefined;\n #state: WebAuthnState<T>;\n\n /**\n * @hidden Use the factory methods instead.\n *\n * Initializes the identity in either:\n * - **pending** state (existing-credential path; public key not yet known), or\n * - **initialized** state (new-credential path; public key known immediately).\n *\n * @private\n */\n private constructor({\n onProgress,\n ...args\n }: WebAuthnSignProgressArgs &\n (\n | InitWebAuthnNewCredentialArgs\n | Pick<CreateWebAuthnIdentityWithExistingCredentialArgs, 'retrievePublicKey'>\n )) {\n super();\n\n this.#onSignProgress = onProgress;\n\n if ('retrievePublicKey' in args) {\n const {retrievePublicKey} = args;\n\n this.#state = {\n status: 'pending',\n retrievePublicKey\n };\n\n return;\n }\n\n this.#state = WebAuthnIdentity.#createInitializedState({\n credential: new WebAuthnNewCredential(args)\n });\n }\n\n static #createInitializedState<T extends WebAuthnCredential>({\n credential\n }: {\n credential: WebAuthnNewCredential | WebAuthnExistingCredential;\n }): WebAuthnState<T> {\n return {\n status: 'initialized',\n credential: credential as T\n };\n }\n\n /**\n * Creates a new passkey on the device and returns an initialized identity.\n *\n * If you chain `create` and `sign`, the user will be prompted twice to authenticate\n * with their authenticator. You can track progress via the `onProgress` callback.\n *\n * @param args {@link CreateWebAuthnIdentityWithNewCredentialArgs} Options to create the passkey.\n * @returns A {@link WebAuthnIdentity} parameterized with {@link WebAuthnNewCredential}.\n */\n static async createWithNewCredential({\n passkeyOptions,\n timeout,\n ...restArgs\n }: CreateWebAuthnIdentityWithNewCredentialArgs = {}): Promise<\n WebAuthnIdentity<WebAuthnNewCredential>\n > {\n const credential = await navigator.credentials.create({\n publicKey: createPasskeyOptions(passkeyOptions),\n signal: createAbortSignal({timeout})\n });\n\n assertNonNullishCredential(credential);\n assertCredentialPublicKey(credential);\n\n const {\n response: {attestationObject},\n rawId\n } = credential;\n\n if (isNullish(attestationObject)) {\n throw new WebAuthnIdentityNoAttestationError();\n }\n\n // We have to parse the attestationObject as CBOR to ultimately retrieve the public key.\n // Similar as what's implemented in AgentJS.\n const {authData} = Cbor.decode<{authData: Uint8Array}>(attestationObject);\n\n const cose = _authDataToCose(authData);\n\n return new WebAuthnIdentity<WebAuthnNewCredential>({\n ...restArgs,\n rawId: arrayBufferToUint8Array(rawId),\n cose,\n authData\n });\n }\n\n /**\n * Creates an identity for an existing passkey.\n *\n * @param args {@link CreateWebAuthnIdentityWithExistingCredentialArgs} Options to retrieve the passkey.\n * @returns A {@link WebAuthnIdentity} parameterized with {@link WebAuthnExistingCredential}.\n */\n // We use async for consistency reason and because it might be future prone.\n // eslint-disable-next-line require-await\n static async createWithExistingCredential(\n args: CreateWebAuthnIdentityWithExistingCredentialArgs\n ): Promise<WebAuthnIdentity<WebAuthnExistingCredential>> {\n return new WebAuthnIdentity<WebAuthnExistingCredential>(args);\n }\n\n /**\n * Returns the credential\u2019s public key.\n *\n * @returns {PublicKey}\n * @throws WebAuthnIdentityCredentialNotInitializedError if the identity has not signed\n * any request yet.\n */\n override getPublicKey(): PublicKey {\n assertWebAuthnStateInitialized(this.#state);\n\n const {credential} = this.#state;\n\n return credential.getPublicKey();\n }\n\n /**\n * Returns the concrete credential wrapper for this identity.\n *\n * For identities created with:\n * - `createWithNewCredential` \u2192 {@link WebAuthnNewCredential}\n * - `createWithExistingCredential` \u2192 {@link WebAuthnExistingCredential}\n *\n * @throws WebAuthnIdentityCredentialNotInitializedError if the identity has not signed\n * any request yet.\n */\n getCredential(): T {\n assertWebAuthnStateInitialized(this.#state);\n\n const {credential} = this.#state;\n\n return credential;\n }\n\n /**\n * Signs an arbitrary blob using the platform authenticator.\n *\n * @param blob Bytes to sign (used as the WebAuthn challenge).\n * @returns {Promise<Signature>} CBOR-encoded signature payload.\n */\n override async sign(blob: ArrayBuffer): Promise<Signature> {\n // 1. Request user credential (navigator.credentials.get)\n const requestCredential = async (): Promise<PublicKeyCredential> => {\n const credential = await retrieveCredentials({\n challenge: arrayBufferToUint8Array(blob),\n ...(this.#state.status === 'initialized' && {\n credentialIds: [this.#state.credential.getCredentialId()]\n })\n });\n\n assertNonNullishCredential(credential);\n assertCredentialPublicKey(credential);\n\n return credential;\n };\n\n const credential = await execute({\n fn: requestCredential,\n step: WebAuthnSignProgressStep.RequestingUserCredential,\n onProgress: this.#onSignProgress\n });\n\n // 2. Assert credential ID if already initialized or load public key from backend and init state\n const finalizingCredential = async () => {\n const {rawId} = credential;\n\n // If the state was already initialized - credentials.create - then we \"only\"\n // assert that the rawId retrieved by credentials.get is equals to the one already known.\n if (this.#state.status === 'initialized') {\n if (\n !uint8ArraysEqual({\n a: this.#state.credential.getCredentialId(),\n b: arrayBufferToUint8Array(rawId)\n })\n ) {\n throw new WebAuthnIdentityInvalidCredentialIdError();\n }\n\n return;\n }\n\n // If the state was pending, we need to retrieve the public key for the credential\n // that was saved during a previous sign-up\n // because credentials.get does not provide an attestation.\n const {retrievePublicKey} = this.#state;\n\n const cose = await retrievePublicKey({\n credentialId: arrayBufferToUint8Array(rawId)\n });\n\n this.#state = WebAuthnIdentity.#createInitializedState({\n credential: new WebAuthnExistingCredential({\n rawId: arrayBufferToUint8Array(rawId),\n cose\n })\n });\n };\n\n await execute({\n fn: finalizingCredential,\n step: WebAuthnSignProgressStep.FinalizingCredential,\n onProgress: this.#onSignProgress\n });\n\n // 3. Sign the request\n // eslint-disable-next-line require-await\n const encodeSignature = async (): Promise<Signature> => {\n const {response} = credential;\n\n const {clientDataJSON} = response;\n\n // Only the response of type AuthenticatorAssertionResponse provides authenticatorData and signature\n // which is the type of response we are expecting.\n const {authenticatorData, signature} =\n 'authenticatorData' in response && 'signature' in response\n ? (response as AuthenticatorAssertionResponse)\n : {};\n\n if (isNullish(authenticatorData)) {\n throw new WebAuthnIdentityNoAuthenticatorDataError();\n }\n\n if (isNullish(signature)) {\n throw new WebAuthnIdentityNoAuthenticatorDataError();\n }\n\n const encoded = Cbor.encode({\n authenticator_data: authenticatorData,\n client_data_json: new TextDecoder().decode(clientDataJSON),\n signature: arrayBufferToUint8Array(signature)\n });\n\n if (isNullish(encoded)) {\n throw new WebAuthnIdentityEncodeCborSignatureError();\n }\n\n // Similar as AgentJS code.\n Object.assign(encoded, {\n __signature__: undefined\n });\n\n return encoded as Signature;\n };\n\n return await execute({\n fn: encodeSignature,\n step: WebAuthnSignProgressStep.Signing,\n onProgress: this.#onSignProgress\n });\n }\n}\n", "// See https://www.iana.org/assignments/cose/cose.xhtml#algorithms for a complete\n// list of these algorithms. We only list the ones we support here.\n//\n// According Google tutorial, https://web.dev/articles/passkey-registration, specifying\n// support for ECDSA with P-256 (-7) and RSA PKCS#1 (-257) gives complete coverage.\nexport const PUBLIC_KEY_COSE_ALGORITHMS = {\n ECDSA_WITH_SHA256: -7,\n RSA_WITH_SHA256: -257\n};\n\nexport const AUTHENTICATOR_ABORT_TIMEOUT = 60000;\n", "import {isNullish} from '@dfinity/utils';\nimport {PUBLIC_KEY_COSE_ALGORITHMS} from './_constants';\nimport {WebAuthnIdentityHostnameError} from './errors';\nimport type {CreatePasskeyOptions, PasskeyOptions} from './types/passkey';\n\nconst randomValue = (): BufferSource => window.crypto.getRandomValues(new Uint8Array(16));\n\n/**\n * When creating a passkey, the challenge can simply be a random value.\n * Since the server doesn\u2019t need to verify the authenticity of the key,\n * it doesn\u2019t have to generate the challenge itself.\n *\n * In contrast, when signing a request with our credentials,\n * the request itself becomes the data (blob), the challenge, that must be signed.\n */\nconst createChallenge = (): BufferSource => randomValue();\n\n/**\n * The user ID is set to a random value, which holds little relevance\n * for the end user beyond being unique.\n *\n * Ultimately, once signed in, the user's actual identifier will be\n * the public key (principal) of the identity used to interact with the IC.\n */\nconst createUserId = (): BufferSource => randomValue();\n\nconst hostname = (): string => {\n const {\n location: {href}\n } = window;\n\n const url = URL.parse(href);\n\n if (isNullish(url)) {\n throw new WebAuthnIdentityHostnameError();\n }\n\n const {hostname} = url;\n\n return hostname;\n};\n\nconst relyingPartyId = ({appId}: Pick<PasskeyOptions, 'appId'>): string => appId?.id ?? hostname();\n\nexport const createPasskeyOptions = ({\n appId,\n user: userOptions\n}: CreatePasskeyOptions = {}): PublicKeyCredentialCreationOptions => {\n const {\n document: {title: name}\n } = window;\n\n const relyingParty = (): Pick<PublicKeyCredentialCreationOptions, 'rp'> => ({\n rp: {\n // Note: deprecated in WebAuthn L3\n name: appId?.name ?? name,\n id: relyingPartyId({appId})\n }\n });\n\n const user = (): Pick<PublicKeyCredentialCreationOptions, 'user'> => ({\n user: {\n id: createUserId(),\n name: userOptions?.name ?? userOptions?.displayName ?? name,\n displayName: userOptions?.displayName ?? name\n }\n });\n\n return {\n // We want to receive the attestation statement as generated by the authenticator\n attestation: 'direct',\n challenge: createChallenge(),\n ...relyingParty(),\n ...user(),\n pubKeyCredParams: Object.values(PUBLIC_KEY_COSE_ALGORITHMS).map((algorithm) => ({\n type: 'public-key',\n alg: algorithm\n })),\n excludeCredentials: [],\n authenticatorSelection: {\n // At least for now, we want a simplified flow and therefore indicates that we want a\n // platform authenticator ((an authenticator embedded to the platform device).\n authenticatorAttachment: 'platform',\n userVerification: 'preferred',\n // Along with requireResidentKey, make passkey discoverable,\n residentKey: 'required',\n requireResidentKey: true\n }\n };\n};\n\nexport const retrievePasskeyOptions = (\n options: PasskeyOptions = {}\n): Omit<PublicKeyCredentialRequestOptions, 'challenge'> => ({\n rpId: relyingPartyId(options),\n allowCredentials: [],\n userVerification: 'required'\n});\n", "import type {WebAuthnSignProgress, WebAuthnSignProgressArgs} from './types/progress';\n\nexport const execute = async <T>({\n fn,\n step,\n onProgress\n}: {\n fn: () => Promise<T>;\n} & Pick<WebAuthnSignProgress, 'step'> &\n WebAuthnSignProgressArgs): Promise<T> => {\n onProgress?.({\n step,\n state: 'in_progress'\n });\n\n try {\n const result = await fn();\n\n onProgress?.({\n step,\n state: 'success'\n });\n\n return result;\n } catch (err: unknown) {\n onProgress?.({\n step,\n state: 'error'\n });\n\n throw err;\n }\n};\n", "/**\n * Progress steps in the WebAuthn signing flow.\n */\nexport enum WebAuthnSignProgressStep {\n /** Calling `navigator.credentials.get` to obtain an assertion. */\n RequestingUserCredential,\n /** Verifying/initializing the credential (e.g., ID match, loading public key). */\n FinalizingCredential,\n /** Producing the signature and encoding the result. */\n Signing\n}\n\n/**\n * Status of the current step.\n */\nexport type WebAuthnSignProgressState = 'in_progress' | 'success' | 'error';\n\n/**\n * Payload emitted on progress updates.\n */\nexport interface WebAuthnSignProgress {\n /** The step being executed. */\n step: WebAuthnSignProgressStep;\n /** State of that step. */\n state: WebAuthnSignProgressState;\n}\n\n/**\n * Callback invoked on each progress update.\n */\nexport type WebAuthnSignProgressFn = (progress: WebAuthnSignProgress) => void;\n\n/**\n * Optional handler for progress updates.\n */\nexport interface WebAuthnSignProgressArgs {\n onProgress?: WebAuthnSignProgressFn;\n}\n", "import {nonNullish} from '@dfinity/utils';\n\n/**\n * Checks if a user-verifying platform authenticator (passkeys) is available on this device / browser.\n *\n * Returns `true` when:\n * 1) `window.PublicKeyCredential` exists, and\n * 2) the browser reports a user-verifying **platform** authenticator is available\n * (e.g., Touch ID, Windows Hello, Android biometrics/PIN).\n *\n * @returns {Promise<boolean>} `true` if an authenticator is available, otherwise `false`.\n */\nexport const isWebAuthnAvailable = async (): Promise<boolean> => {\n if (\n nonNullish(window.PublicKeyCredential) &&\n 'isUserVerifyingPlatformAuthenticatorAvailable' in PublicKeyCredential\n ) {\n return await PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable();\n }\n\n return false;\n};\n", "import {isNullish} from '@dfinity/utils';\nimport type {EnvironmentWorker} from '../../core/types/env';\nimport type {Unsubscribe} from '../../core/types/subscription';\nimport {AuthStore} from '../stores/auth.store';\nimport type {PostMessage, PostMessageDataResponseAuth} from '../types/post-message';\nimport type {User} from '../types/user';\nimport {emit} from '../utils/events.utils';\nimport {signOut} from './auth.services';\n\nexport const initAuthTimeoutWorker = (auth: EnvironmentWorker): Unsubscribe => {\n const workerUrl = auth === true ? './workers/auth.worker.js' : auth;\n const worker = new Worker(workerUrl);\n\n const timeoutSignOut = async () => {\n emit({message: 'junoSignOutAuthTimer'});\n await signOut();\n };\n\n worker.onmessage = async ({data}: MessageEvent<PostMessage<PostMessageDataResponseAuth>>) => {\n const {msg, data: value} = data;\n\n switch (msg) {\n case 'junoSignOutAuthTimer':\n await timeoutSignOut();\n return;\n case 'junoDelegationRemainingTime':\n emit({message: 'junoDelegationRemainingTime', detail: value?.authRemainingTime});\n return;\n }\n };\n\n return AuthStore.getInstance().subscribe((user: User | null) => {\n if (isNullish(user)) {\n worker.postMessage({msg: 'junoStopAuthTimer'});\n return;\n }\n\n worker.postMessage({msg: 'junoStartAuthTimer'});\n });\n};\n", "export abstract class Store<T> {\n private callbacks: {id: symbol; callback: (data: T | null) => void}[] = [];\n\n protected populate(data: T | null) {\n this.callbacks.forEach(({callback}: {id: symbol; callback: (data: T | null) => void}) =>\n callback(data)\n );\n }\n\n subscribe(callback: (data: T | null) => void): () => void {\n const callbackId = Symbol();\n this.callbacks.push({id: callbackId, callback});\n\n return () =>\n (this.callbacks = this.callbacks.filter(\n ({id}: {id: symbol; callback: (data: T | null) => void}) => id !== callbackId\n ));\n }\n}\n", "import {Store} from '../../core/stores/_store';\nimport type {Unsubscribe} from '../../core/types/subscription';\n\nimport type {User} from '../types/user';\n\nexport class AuthStore extends Store<User | null> {\n private static instance: AuthStore;\n\n private authUser: User | null = null;\n\n private constructor() {\n super();\n }\n\n static getInstance() {\n if (!AuthStore.instance) {\n AuthStore.instance = new AuthStore();\n }\n return AuthStore.instance;\n }\n\n set(authUser: User | null) {\n this.authUser = authUser;\n\n this.populate(authUser);\n }\n\n get(): User | null {\n return this.authUser;\n }\n\n override subscribe(callback: (data: User | null) => void): Unsubscribe {\n const unsubscribe: () => void = super.subscribe(callback);\n\n callback(this.authUser);\n\n return unsubscribe;\n }\n\n reset() {\n this.authUser = null;\n\n this.populate(this.authUser);\n }\n}\n", "export const emit = <T>({message, detail}: {message: string; detail?: T | undefined}) => {\n const $event: CustomEvent<T> = new CustomEvent<T>(message, {detail, bubbles: true});\n document.dispatchEvent($event);\n};\n", "import type {Identity} from '@dfinity/agent';\nimport type {AuthClient} from '@dfinity/auth-client';\nimport {isNullish} from '@dfinity/utils';\nimport {ActorStore} from '../../core/stores/actor.store';\nimport {AgentStore} from '../../core/stores/agent.store';\nimport {executeWithWindowGuard} from '../helpers/window.helpers';\nimport {InternetIdentityProvider} from '../providers/internet-identity.providers';\nimport {NFIDProvider} from '../providers/nfid.providers';\nimport {WebAuthnProvider} from '../providers/webauthn.providers';\nimport {AuthStore} from '../stores/auth.store';\nimport type {SignInOptions, SignOutOptions, SignUpOptions} from '../types/auth';\nimport {SignInProviderNotSupportedError, SignUpProviderNotSupportedError} from '../types/errors';\nimport type {Provider} from '../types/provider';\nimport type {User} from '../types/user';\nimport {createAuthClient, resetAuthClient} from '../utils/auth.utils';\nimport {initUser, loadUser} from './_user.services';\n\nlet authClient: AuthClient | undefined | null;\n\n/**\n * Initialize the authClient and load the existing user.\n * Executed when the library is initialized through initSatellite.\n */\nexport const loadAuth = async () => {\n const init = async () => {\n const {user} = await loadUser();\n AuthStore.getInstance().set(user ?? null);\n };\n\n await authenticate({fn: init});\n};\n\n/**\n * Initialize the authClient, load the user passed as parameter.\n * Executed on sign-up.\n */\nconst loadAuthWithUser = async ({user}: {user: User}) => {\n // eslint-disable-next-line require-await\n const init = async () => {\n AuthStore.getInstance().set(user);\n };\n\n await authenticate({fn: init});\n};\n\n/**\n * Initialize the authClient, load or create a new user.\n * Executed on sign-in.\n */\nexport const createAuth = async ({provider}: {provider: Provider}) => {\n const init = async () => {\n const user = await initUser({provider});\n AuthStore.getInstance().set(user);\n };\n\n await authenticate({fn: init});\n};\n\n/**\n * Initializes a new `AuthClient`, checks authentication state,\n * and executes the provided function if already authenticated.\n *\n * - Always creates a fresh `AuthClient` using {@link createAuthClient}.\n * - If the client is **not authenticated**, it resets the client via {@link resetAuthClient}\n * to ensure a clean session.\n * - If authenticated, it runs the given async function `fn`.\n *\n * @param {Object} params\n * @param {() => Promise<void>} params.fn - The asynchronous function to execute when authenticated.\n *\n * @returns {Promise<void>} Resolves when authentication is handled and the provided function is executed (if applicable).\n */\nconst authenticate = async ({fn}: {fn: () => Promise<void>}) => {\n authClient = await createAuthClient();\n\n const isAuthenticated = await authClient.isAuthenticated();\n\n if (!isAuthenticated) {\n authClient = await resetAuthClient();\n return;\n }\n\n await fn();\n};\n\n/**\n * Signs in a user with the specified options.\n *\n * @default Signs in by default with Internet Identity\n * @param {SignInOptions} [options] - The options for signing in including the provider to use for the process.\n * @returns {Promise<void>} A promise that resolves when the sign-in process is complete and the authenticated user is initialized.\n */\nexport const signIn = async (options: SignInOptions): Promise<void> => {\n const fn = async () => await signInWithProvider(options);\n\n const disableWindowGuard = Object.values(options)[0].context?.windowGuard === false;\n\n if (disableWindowGuard) {\n await fn();\n return;\n }\n\n await executeWithWindowGuard({fn});\n};\n\n/**\n * Signs up to create a new user with the specified options.\n *\n * @param {SignUpOptions} [options] - The options for signing up including the provider to use for the process.\n * @returns {Promise<void>} A promise that resolves when the sign-up process is complete and the user is authenticated.\n */\nexport const signUp = async (options: SignUpOptions): Promise<void> => {\n const fn = async () => await signUpWithProvider(options);\n\n const disableWindowGuard = Object.values(options)?.[0].context?.windowGuard === false;\n\n if (disableWindowGuard) {\n await fn();\n return;\n }\n\n await executeWithWindowGuard({fn});\n};\n\nconst signInWithProvider = async (options: SignInOptions): Promise<void> => {\n if ('webauthn' in options) {\n const {\n webauthn: {options: signInOptions}\n } = options;\n\n await new WebAuthnProvider().signIn({\n options: signInOptions,\n loadAuth\n });\n return;\n }\n\n if ('nfid' in options) {\n const {\n nfid: {options: nfidOptions}\n } = options;\n\n const {appName, logoUrl, ...signInOptions} = nfidOptions ?? {};\n\n await new NFIDProvider({appName, logoUrl}).signIn({\n options: signInOptions,\n authClient,\n initAuth: createAuth\n });\n return;\n }\n\n if ('internet_identity' in options) {\n const {\n internet_identity: {options: iiOptions}\n } = options;\n\n const {domain, ...signInOptions} = iiOptions ?? {};\n\n await new InternetIdentityProvider({domain}).signIn({\n options: signInOptions,\n authClient,\n initAuth: createAuth\n });\n return;\n }\n\n throw new SignInProviderNotSupportedError(\n 'An unknown or unsupported provider was provided for sign-in.'\n );\n};\n\nconst signUpWithProvider = async (options: SignUpOptions): Promise<void> => {\n if ('webauthn' in options) {\n const {\n webauthn: {options: signUpOptions}\n } = options;\n\n await new WebAuthnProvider().signUp({\n options: signUpOptions,\n loadAuthWithUser\n });\n return;\n }\n\n throw new SignUpProviderNotSupportedError(\n 'An unknown or unsupported provider was provided for sign-up.'\n );\n};\n\n/**\n * Signs out the current user.\n * @returns {Promise<void>} A promise that resolves when the sign-out process is complete.\n */\nexport const signOut = async (options?: SignOutOptions): Promise<void> => {\n await resetAuth();\n\n // Recreate an HttpClient immediately because next sign-in, if window is not reloaded, would fail if the agent is created within the process.\n // For example, Safari blocks the Internet Identity (II) window if the agent is created during the interaction.\n // Agent-js must be created either globally or at least before performing a sign-in.\n // We proceed with this reset regardless of the window reloading. This way we ensure it is reset not matter what.\n authClient = await createAuthClient();\n\n if (options?.windowReload === false) {\n return;\n }\n\n window.location.reload();\n};\n\n/**\n * \u2139\uFE0F Exposed for testing purpose only. Should not be leaked to consumer or used by the library.\n */\nexport const resetAuth = async () => {\n await authClient?.logout();\n\n // Reset local object otherwise next sign in (sign in - sign out - sign in) might not work out - i.e. agent-js might not recreate the delegation or identity if not resetted\n // Technically we do not need this since we recreate the agent below. We just keep it to make the reset explicit.\n authClient = null;\n\n AuthStore.getInstance().reset();\n\n ActorStore.getInstance().reset();\n AgentStore.getInstance().reset();\n};\n\nexport const getIdentity = (): Identity | undefined => authClient?.getIdentity();\n\n/**\n * Returns the identity of a signed-in user or an anonymous identity.\n * This function is useful for loading an identity in web workers.\n * Used to imperatively get the identity. Please be certain before using it.\n * @returns {Promise<Identity>} A promise that resolves to the identity of the user or an anonymous identity.\n */\nexport const unsafeIdentity = async (): Promise<Identity> =>\n (authClient ?? (await createAuthClient())).getIdentity();\n\n/**\n * Returns the current identity if the user is authenticated.\n *\n * \u26A0\uFE0F Use this function imperatively only. Do **not** persist the identity in global state.\n * It is intended for short-lived or one-time operations.\n *\n * Typical use case is to enable developers to implement custom features for the Internet Computer:\n * - Passing the identity to temporarily create an actor or agent to call a canister\n * - Signing a message or making a one-time authenticated call\n *\n * @returns The authenticated identity, or null if unavailable.\n */\nexport const getIdentityOnce = async (): Promise<Identity | null> => {\n const user = AuthStore.getInstance().get();\n\n if (isNullish(user)) {\n return null;\n }\n\n const authenticated = (await authClient?.isAuthenticated()) ?? false;\n\n if (!authenticated) {\n return null;\n }\n\n return authClient?.getIdentity() ?? null;\n};\n", "import {Actor, type ActorMethod, type ActorSubclass} from '@dfinity/agent';\nimport type {IDL} from '@dfinity/candid';\nimport {isNullish} from '@dfinity/utils';\nimport type {ActorKey} from '../types/actor';\nimport type {SatelliteContext} from '../types/satellite';\nimport {AgentStore} from './agent.store';\n\ntype ActorParams = {\n idlFactory: IDL.InterfaceFactory;\n} & Required<Pick<SatelliteContext, 'satelliteId' | 'identity'>> &\n Pick<SatelliteContext, 'container'>;\n\ntype ActorRecord = Record<string, ActorMethod>;\n\nexport class ActorStore {\n private static instance: ActorStore;\n\n #actors: Record<string, ActorSubclass<ActorRecord>> | undefined | null = undefined;\n\n private constructor() {}\n\n static getInstance() {\n if (isNullish(ActorStore.instance)) {\n ActorStore.instance = new ActorStore();\n }\n return ActorStore.instance;\n }\n\n async getActor<T = ActorRecord>({\n satelliteId,\n identity,\n actorKey,\n ...rest\n }: ActorParams & {actorKey: ActorKey}): Promise<ActorSubclass<T>> {\n const key = `${actorKey}#${identity.getPrincipal().toText()}#${satelliteId};`;\n\n if (isNullish(this.#actors) || isNullish(this.#actors[key])) {\n const actor = await this.createActor({satelliteId, identity, ...rest});\n\n this.#actors = {\n ...(this.#actors ?? {}),\n [key]: actor\n };\n\n return actor as ActorSubclass<T>;\n }\n\n return this.#actors[key] as ActorSubclass<T>;\n }\n\n reset() {\n this.#actors = null;\n }\n\n private async createActor<T = ActorRecord>({\n idlFactory,\n satelliteId: canisterId,\n ...rest\n }: ActorParams): Promise<ActorSubclass<T>> {\n const agent = await AgentStore.getInstance().getAgent(rest);\n\n return Actor.createActor(idlFactory, {\n agent,\n canisterId\n });\n }\n}\n", "import type {Agent, HttpAgent} from '@dfinity/agent';\nimport {isNullish} from '@dfinity/utils';\nimport {type CreateAgentParams, createAgent} from './_agent.factory';\n\nexport class AgentStore {\n private static instance: AgentStore;\n\n #agents: Record<string, HttpAgent> | undefined | null = undefined;\n\n private constructor() {}\n\n static getInstance() {\n if (isNullish(AgentStore.instance)) {\n AgentStore.instance = new AgentStore();\n }\n return AgentStore.instance;\n }\n\n async getAgent({identity, ...rest}: CreateAgentParams): Promise<Agent> {\n const key = identity.getPrincipal().toText();\n\n if (isNullish(this.#agents) || isNullish(this.#agents[key])) {\n const agent = await createAgent({identity, ...rest});\n\n this.#agents = {\n ...(this.#agents ?? {}),\n [key]: agent\n };\n\n return agent;\n }\n\n return this.#agents[key];\n }\n\n reset() {\n this.#agents = null;\n }\n}\n", "import {HttpAgent} from '@dfinity/agent';\nimport {nonNullish} from '@dfinity/utils';\nimport {DOCKER_CONTAINER_URL} from '../constants/container.constants';\nimport type {SatelliteContext} from '../types/satellite';\n\nexport type CreateAgentParams = Required<Pick<SatelliteContext, 'identity'>> &\n Pick<SatelliteContext, 'container'>;\n\nexport const createAgent = async ({identity, container}: CreateAgentParams): Promise<HttpAgent> => {\n const localActor = nonNullish(container) && container !== false;\n\n const host = localActor\n ? container === true\n ? DOCKER_CONTAINER_URL\n : container\n : 'https://icp-api.io';\n\n const shouldFetchRootKey = nonNullish(container);\n\n return await HttpAgent.create({\n identity,\n shouldFetchRootKey,\n host\n });\n};\n", "export const DOCKER_CONTAINER_URL = 'http://127.0.0.1:5987';\nexport const DOCKER_INTERNET_IDENTITY_ID = 'rdmx6-jaaaa-aaaaa-aaadq-cai';\n", "const onBeforeUnload = ($event: BeforeUnloadEvent) => {\n $event.preventDefault();\n return ($event.returnValue = 'Are you sure you want to exit?');\n};\n\nconst addBeforeUnload = () => {\n window.addEventListener('beforeunload', onBeforeUnload, {capture: true});\n};\n\nconst removeBeforeUnload = () => {\n window.removeEventListener('beforeunload', onBeforeUnload, {capture: true});\n};\n\nexport const executeWithWindowGuard = async <T>({fn}: {fn: () => Promise<T>}): Promise<T> => {\n try {\n addBeforeUnload();\n\n return await fn();\n } finally {\n removeBeforeUnload();\n }\n};\n", "import {isNullish, nonNullish} from '@dfinity/utils';\nimport {\n DOCKER_CONTAINER_URL,\n DOCKER_INTERNET_IDENTITY_ID\n} from '../../core/constants/container.constants';\nimport {EnvStore} from '../../core/stores/env.store';\nimport {II_POPUP, INTERNET_COMPUTER_ORG} from '../constants/auth.constants';\nimport type {AuthClientSignInOptions} from '../types/auth-client';\nimport type {InternetIdentityConfig, InternetIdentityDomain} from '../types/internet-identity';\nimport type {Provider} from '../types/provider';\nimport {popupCenter} from '../utils/window.utils';\nimport {AuthClientProvider, type AuthProviderSignInOptions} from './_auth-client.providers';\n\n/**\n * Internet Identity authentication provider.\n * @class InternetIdentityProvider\n * @implements {AuthProvider}\n */\nexport class InternetIdentityProvider extends AuthClientProvider {\n #domain?: InternetIdentityDomain;\n\n /**\n * Creates an instance of InternetIdentityProvider.\n * @param {InternetIdentityConfig} config - The configuration for Internet Identity.\n */\n constructor({domain}: InternetIdentityConfig) {\n super();\n\n this.#domain = domain;\n }\n\n /**\n * Gets the identifier of the provider.\n * @returns {Provider} The identifier of the provider - `internet_identity`.\n */\n override get id(): Provider {\n return 'internet_identity';\n }\n\n /**\n * Gets the sign-in options for Internet Identity.\n * @param {Pick<SignInOptions, 'windowed'>} options - The sign-in options.\n * @returns {AuthProviderSignInOptions} The sign-in options for Internet Identity.\n */\n override signInOptions({\n windowed\n }: Pick<AuthClientSignInOptions, 'windowed'>): AuthProviderSignInOptions {\n const identityProviderUrl = (): string => {\n const container = EnvStore.getInstance().get()?.container;\n\n // Production\n if (isNullish(container) || container === false) {\n return `https://identity.${this.#domain ?? INTERNET_COMPUTER_ORG}`;\n }\n\n const env = EnvStore.getInstance().get();\n\n const internetIdentityId =\n nonNullish(env) && nonNullish(env?.internetIdentityId)\n ? env.internetIdentityId\n : DOCKER_INTERNET_IDENTITY_ID;\n\n const {host: containerHost, protocol} = new URL(\n container === true ? DOCKER_CONTAINER_URL : container\n );\n\n return /apple/i.test(navigator?.vendor)\n ? `${protocol}//${containerHost}?canisterId=${internetIdentityId}`\n : `${protocol}//${internetIdentityId}.${containerHost.replace('127.0.0.1', 'localhost')}`;\n };\n\n return {\n ...(windowed !== false && {\n windowOpenerFeatures: popupCenter(II_POPUP)\n }),\n identityProvider: identityProviderUrl()\n };\n }\n}\n", "import type {Environment} from '../types/env';\nimport {Store} from './_store';\n\nexport class EnvStore extends Store<Environment | undefined> {\n private static instance: EnvStore;\n\n private env: Environment | undefined | null;\n\n private constructor() {\n super();\n }\n\n static getInstance() {\n if (!EnvStore.instance) {\n EnvStore.instance = new EnvStore();\n }\n return EnvStore.instance;\n }\n\n set(env: Environment | undefined) {\n this.env = env;\n\n this.populate(env);\n }\n\n get(): Environment | undefined | null {\n return this.env;\n }\n\n reset() {\n this.env = null;\n }\n\n override subscribe(callback: (data: Environment | null | undefined) => void): () => void {\n const unsubscribe: () => void = super.subscribe(callback);\n\n callback(this.env);\n\n return unsubscribe;\n }\n}\n", "// How long the delegation identity should remain valid?\n// e.g. BigInt(7 * 24 * 60 * 60 * 1000 * 1000 * 1000) = 7 days in nanoseconds\n// For Juno: 4 hours\nexport const DELEGATION_IDENTITY_EXPIRATION_IN_MILLISECONDS = 4 * 60 * 60 * 1000;\nexport const DELEGATION_IDENTITY_EXPIRATION = BigInt(\n DELEGATION_IDENTITY_EXPIRATION_IN_MILLISECONDS * 1000 * 1000\n);\n\n// We consider PIN authentication as \"insecure\" because users can easily lose their PIN if they do not register a passphrase, especially since Safari clears the browser cache every two weeks in cases of inactivity.\n// That's why we disable it by default.\nexport const ALLOW_PIN_AUTHENTICATION = false;\n\nexport const II_POPUP: {width: number; height: number} = {width: 576, height: 576};\nexport const NFID_POPUP: {width: number; height: number} = {width: 505, height: 705};\n\nexport const INTERNET_COMPUTER_ORG = 'internetcomputer.org';\n\n// Worker\nexport const AUTH_TIMER_INTERVAL = 1000;\n", "import {isNullish} from '@dfinity/utils';\nimport {isBrowser} from '@junobuild/utils';\n\nexport const popupCenter = ({\n width,\n height\n}: {\n width: number;\n height: number;\n}): string | undefined => {\n if (!isBrowser()) {\n return undefined;\n }\n\n if (isNullish(window) || isNullish(window.top)) {\n return undefined;\n }\n\n const {\n top: {innerWidth, innerHeight}\n } = window;\n\n const y = innerHeight / 2 + screenY - height / 2;\n const x = innerWidth / 2 + screenX - width / 2;\n\n return `toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=${width}, height=${height}, top=${y}, left=${x}`;\n};\n", "import {jsonReplacer, jsonReviver} from '@dfinity/utils';\n\n/**\n * Converts data to a Uint8Array for transmission or storage.\n * @template T\n * @param {T} data - The data to convert.\n * @returns {Promise<Uint8Array>} A promise that resolves to a Uint8Array representation of the data.\n */\nexport const toArray = async <T>(data: T): Promise<Uint8Array> => {\n const blob: Blob = new Blob([JSON.stringify(data, jsonReplacer)], {\n type: 'application/json; charset=utf-8'\n });\n return new Uint8Array(await blob.arrayBuffer());\n};\n\n/**\n * Converts a Uint8Array or number array back to the original data type.\n * @template T\n * @param {(Uint8Array | number[])} data - The array to convert.\n * @returns {Promise<T>} A promise that resolves to the original data.\n */\nexport const fromArray = async <T>(data: Uint8Array | number[]): Promise<T> => {\n const blob: Blob = new Blob([data instanceof Uint8Array ? data : new Uint8Array(data)], {\n type: 'application/json; charset=utf-8'\n });\n return JSON.parse(await blob.text(), jsonReviver);\n};\n", "/**\n * Checks if the current environment is a browser.\n * @returns {boolean} True if the current environment is a browser, false otherwise.\n */\nexport const isBrowser = (): boolean => typeof window !== `undefined`;\n", "import {type AuthClient, ERROR_USER_INTERRUPT} from '@dfinity/auth-client';\nimport {isNullish} from '@dfinity/utils';\nimport {\n ALLOW_PIN_AUTHENTICATION,\n DELEGATION_IDENTITY_EXPIRATION\n} from '../constants/auth.constants';\nimport {execute} from '../helpers/progress.helpers';\nimport {type AuthClientSignInOptions, AuthClientSignInProgressStep} from '../types/auth-client';\nimport {SignInError, SignInInitError, SignInUserInterruptError} from '../types/errors';\nimport type {Provider} from '../types/provider';\n\n/**\n * Common traits for all authentication providers\n * @interface AuthProvider\n */\nexport interface AuthProvider {\n /**\n * The unique identifier of the provider.\n */\n readonly id: Provider;\n}\n\n/**\n * Options for signing in with an authentication provider.\n * @interface AuthProviderSignInOptions\n */\nexport interface AuthProviderSignInOptions {\n /**\n * The URL of the identity provider - commonly Internet Identity.\n */\n identityProvider: string;\n /**\n * Optional features for the window opener.\n */\n windowOpenerFeatures?: string;\n}\n\n/**\n * Abstract base class for all authentication providers that integrate with the `@dfinity/auth-client`.\n *\n * @abstract\n * @class AuthClientProvider\n * @implements {AuthProvider}\n */\nexport abstract class AuthClientProvider implements AuthProvider {\n /**\n * The unique identifier of the provider.\n *\n * @abstract\n * @type {Provider}\n */\n abstract get id(): Provider;\n\n /**\n * Returns the sign-in options for the provider.\n *\n * Note: set as public instead of protected for testing purposes.\n *\n * @abstract\n * @param {Pick<SignInOptions, 'windowed'>} options - Options controlling window behavior.\n * @returns {AuthProviderSignInOptions} Provider-specific sign-in options.\n */\n abstract signInOptions(\n options: Pick<AuthClientSignInOptions, 'windowed'>\n ): AuthProviderSignInOptions;\n\n /**\n * Signs in a user with the given authentication provider.\n *\n * @param {Object} params - The sign-in parameters.\n * @param {AuthClientSignInOptions} [params.options] - Optional configuration for the login request.\n * @param {AuthClient | undefined | null} params.authClient - The AuthClient instance in its current state.\n * @param {initAuth} params.initAuth - The function to load or initialize the user. Provided as a callback to avoid recursive import.\n *\n * @returns {Promise<void>} Resolves if the sign-in is successful. Rejects with:\n * - {@link SignInInitError} if no AuthClient is available.\n * - {@link SignInUserInterruptError} if the user cancels the login.\n * - {@link SignInError} for other errors during sign-in.\n */\n async signIn({\n options,\n authClient,\n initAuth\n }: {\n options?: AuthClientSignInOptions;\n authClient: AuthClient | undefined | null;\n initAuth: (params: {provider: Provider}) => Promise<void>;\n }): Promise<void> {\n // 1. Sign-in or sign-up with third party provider\n const login = async () => await this.#loginWithAuthClient({options, authClient});\n\n await execute({\n fn: login,\n step: AuthClientSignInProgressStep.AuthorizingWithProvider,\n onProgress: options?.onProgress\n });\n\n // 2. Create or load the user for the authentication\n const runAuth = async () => await initAuth({provider: this.id});\n\n await execute({\n fn: runAuth,\n step: AuthClientSignInProgressStep.CreatingOrRetrievingUser,\n onProgress: options?.onProgress\n });\n }\n\n #loginWithAuthClient({\n options,\n authClient\n }: {\n options?: Omit<AuthClientSignInOptions, 'onProgress'>;\n authClient: AuthClient | undefined | null;\n }): Promise<void> {\n /* eslint-disable no-async-promise-executor */\n return new Promise<void>(async (resolve, reject) => {\n if (isNullish(authClient)) {\n reject(\n new SignInInitError(\n 'No client is ready to perform a sign-in. Have you initialized the Satellite?'\n )\n );\n return;\n }\n\n await authClient.login({\n onSuccess: resolve,\n onError: (error?: string) => {\n if (error === ERROR_USER_INTERRUPT) {\n reject(new SignInUserInterruptError(error));\n return;\n }\n\n reject(new SignInError(error));\n },\n maxTimeToLive: options?.maxTimeToLiveInNanoseconds ?? DELEGATION_IDENTITY_EXPIRATION,\n allowPinAuthentication: options?.allowPin ?? ALLOW_PIN_AUTHENTICATION,\n ...(options?.derivationOrigin !== undefined && {\n derivationOrigin: options.derivationOrigin\n }),\n ...this.signInOptions({\n windowed: options?.windowed\n })\n });\n });\n }\n}\n", "import type {SignProgressFn} from '../types/progress';\n\nexport const execute = async <T, Step>({\n fn,\n step,\n onProgress\n}: {\n fn: () => Promise<T>;\n step: Step;\n onProgress?: SignProgressFn<Step>;\n}): Promise<T> => {\n onProgress?.({\n step,\n state: 'in_progress'\n });\n\n try {\n const result = await fn();\n\n onProgress?.({\n step,\n state: 'success'\n });\n\n return result;\n } catch (err: unknown) {\n onProgress?.({\n step,\n state: 'error'\n });\n\n throw err;\n }\n};\n", "import type {SignProgressFn} from './progress';\n\n/**\n * Enum representing the different steps of the sign-in flow with Internet Identity or NFID.\n */\nexport enum AuthClientSignInProgressStep {\n /** User is authenticating with the identity provider (II / NFID). */\n AuthorizingWithProvider,\n /** App is creating a new user or retrieving an existing one after authorization. */\n CreatingOrRetrievingUser\n}\n\n/**\n * Interface representing sign-in options when using an AuthClient based provider.\n * @interface AuthClientSignInOptions\n */\nexport interface AuthClientSignInOptions {\n /**\n * Maximum time to live for the session in nanoseconds. Cannot be extended.\n * @type {bigint}\n */\n maxTimeToLiveInNanoseconds?: bigint;\n\n /**\n * Origin for derivation. Useful when sign-in using the same domain - e.g. sign-in on www.hello.com for hello.com.\n * @type {(string | URL)}\n */\n derivationOrigin?: string | URL;\n\n /**\n * Whether to open the sign-in window.\n * @default true\n * @type {boolean}\n */\n windowed?: boolean;\n\n /**\n * Whether to allow the infamous PIN authentication.\n * @default false\n * @type {boolean}\n */\n allowPin?: boolean;\n\n /**\n * Optional callback to receive progress updates about the sign-in flow.\n * Useful for showing UI feedback such as loading indicators or status messages.\n */\n onProgress?: SignProgressFn<AuthClientSignInProgressStep>;\n}\n", "export class SignInError extends Error {}\nexport class SignInInitError extends Error {}\nexport class SignInUserInterruptError extends Error {}\nexport class SignInProviderNotSupportedError extends Error {}\n\nexport class WebAuthnSignInRetrievePublicKeyError extends Error {}\n\nexport class SignUpProviderNotSupportedError extends Error {}\n\nexport class InitError extends Error {}\n\nexport class ListError extends Error {}\n", "import {NFID_POPUP} from '../constants/auth.constants';\nimport type {AuthClientSignInOptions} from '../types/auth-client';\nimport type {NFIDConfig} from '../types/nfid';\nimport type {Provider} from '../types/provider';\nimport {popupCenter} from '../utils/window.utils';\nimport {AuthClientProvider, type AuthProviderSignInOptions} from './_auth-client.providers';\n\n/**\n * NFID authentication provider.\n * @class NFIDProvider\n * @implements {AuthProvider}\n */\nexport class NFIDProvider extends AuthClientProvider {\n #appName: string;\n #logoUrl: string;\n\n /**\n * Creates an instance of NFIDProvider.\n * @param {NFIDConfig} config - The configuration for NFID.\n */\n constructor({appName, logoUrl}: NFIDConfig) {\n super();\n\n this.#appName = appName;\n this.#logoUrl = logoUrl;\n }\n\n /**\n * Gets the identifier of the provider.\n * @returns {Provider} The identifier of the provider- nfid.\n */\n override get id(): Provider {\n return 'nfid';\n }\n\n /**\n * Gets the sign-in options for NFID.\n * @param {Pick<SignInOptions, 'windowed'>} options - The sign-in options.\n * @returns {AuthProviderSignInOptions} The sign-in options to effectively sign-in with NFID.\n */\n override signInOptions({\n windowed\n }: Pick<AuthClientSignInOptions, 'windowed'>): AuthProviderSignInOptions {\n return {\n ...(windowed !== false && {\n windowOpenerFeatures: popupCenter(NFID_POPUP)\n }),\n identityProvider: `https://nfid.one/authenticate/?applicationName=${encodeURI(\n this.#appName\n )}&applicationLogo=${encodeURI(this.#logoUrl)}`\n };\n }\n}\n", "import {type SignIdentity, AnonymousIdentity} from '@dfinity/agent';\nimport {IdbStorage, KEY_STORAGE_DELEGATION, KEY_STORAGE_KEY} from '@dfinity/auth-client';\nimport {\n DelegationChain,\n DelegationIdentity,\n DER_COSE_OID,\n ECDSAKeyIdentity,\n unwrapDER\n} from '@dfinity/identity';\nimport {isNullish, uint8ArrayToBase64} from '@dfinity/utils';\nimport {\n type RetrievePublicKeyFn,\n type WebAuthnNewCredential,\n type WebAuthnSignProgressFn,\n WebAuthnIdentity,\n WebAuthnSignProgressStep\n} from '@junobuild/ic-client/webauthn';\nimport {EnvStore} from '../../core/stores/env.store';\nimport {getDoc} from '../../datastore/services/doc.services';\nimport {DELEGATION_IDENTITY_EXPIRATION_IN_MILLISECONDS} from '../constants/auth.constants';\nimport {execute} from '../helpers/progress.helpers';\nimport {createWebAuthnUser} from '../services/user-webauthn.services';\nimport {SignInInitError, WebAuthnSignInRetrievePublicKeyError} from '../types/errors';\nimport type {Provider} from '../types/provider';\nimport type {User} from '../types/user';\nimport {\n type WebAuthnSignInOptions,\n type WebAuthnSignUpOptions,\n WebAuthnSignInProgressStep,\n WebAuthnSignUpProgressStep\n} from '../types/webauthn';\nimport type {AuthProvider} from './_auth-client.providers';\n\ninterface SessionDelegationIdentity {\n delegationIdentity: DelegationIdentity;\n sessionKey: ECDSAKeyIdentity;\n}\n\nexport class WebAuthnProvider implements AuthProvider {\n /**\n * Gets the identifier of the provider.\n * @returns {Provider} The identifier of the provider is webauthn.\n */\n get id(): Provider {\n return 'webauthn';\n }\n\n /**\n * Signs up a user by creating a new passkey.\n *\n * @param {Object} params - The sign-up parameters.\n * @param {WebAuthnSignUpOptions} [params.options] - Optional configuration for the login request.\n * @param {loadAuth} params.loadAuthWithUser - The function to load the authentication with the user. Provided as a callback to avoid recursive import.\n *\n * @returns {Promise<void>} Resolves if the sign-up is successful.\n */\n async signUp({\n options: {onProgress, maxTimeToLiveInMilliseconds, passkey: passkeyOptions} = {},\n loadAuthWithUser\n }: {\n options?: WebAuthnSignUpOptions;\n loadAuthWithUser: (params: {user: User}) => Promise<void>;\n }) {\n const {satelliteId} = EnvStore.getInstance().get() ?? {satelliteId: undefined};\n\n if (isNullish(satelliteId)) {\n throw new SignInInitError('Satellite ID not set. Have you initialized the Satellite?');\n }\n\n const onSignProgress: WebAuthnSignProgressFn = ({step, state}) => {\n switch (step) {\n case WebAuthnSignProgressStep.RequestingUserCredential:\n onProgress?.({\n step: WebAuthnSignUpProgressStep.ValidatingUserCredential,\n state\n });\n break;\n case WebAuthnSignProgressStep.FinalizingCredential:\n onProgress?.({\n step: WebAuthnSignUpProgressStep.FinalizingCredential,\n state\n });\n break;\n case WebAuthnSignProgressStep.Signing:\n onProgress?.({\n step: WebAuthnSignUpProgressStep.Signing,\n state\n });\n break;\n }\n };\n\n // 1. Create passkey\n const createPasskey = async (): Promise<WebAuthnIdentity<WebAuthnNewCredential>> =>\n await WebAuthnIdentity.createWithNewCredential({\n onProgress: onSignProgress,\n passkeyOptions\n });\n\n const passkeyIdentity = await execute({\n fn: createPasskey,\n step: WebAuthnSignUpProgressStep.CreatingUserCredential,\n onProgress\n });\n\n // 2. Create session delegation. This will require the user the sign the session using their authenticator.\n // i.e. they will have to use their authenticator a second time after create.\n const {delegationIdentity, sessionKey} = await this.#createSessionDelegation({\n identity: passkeyIdentity,\n maxTimeToLiveInMilliseconds\n });\n\n // 3. Make update calls to create user and save public key.\n // Note: We create the user before saving the session identity to avoid\n // a race condition where the user would reload the window and the lib\n // would try to retrieve and undefined user for the delegation saved in indexeddb.\n const register = async () =>\n await createWebAuthnUser({\n delegationIdentity,\n passkeyIdentity,\n satelliteId\n });\n\n const user = await execute({\n fn: register,\n step: WebAuthnSignUpProgressStep.RegisteringUser,\n onProgress\n });\n\n // 4. Save session identity for loading it with auth client\n const saveSession = async () =>\n await this.#saveSessionIdentityForAuthClient({delegationIdentity, sessionKey});\n\n await execute({\n fn: saveSession,\n step: WebAuthnSignUpProgressStep.FinalizingSession,\n onProgress\n });\n\n // 5. Load the user for the authentication\n const loadAuth = async () => await loadAuthWithUser({user});\n\n await execute({\n fn: loadAuth,\n step: WebAuthnSignUpProgressStep.RegisteringUser,\n onProgress\n });\n }\n\n /**\n * Signs in a user with an existing passkey.\n *\n * @param {Object} params - The sign-in parameters.\n * @param {WebAuthnSignInOptions} [params.options] - Optional configuration for the login request.\n * @param {loadAuth} params.loadAuth - The function to load the user. Provided as a callback to avoid recursive import.\n *\n * @returns {Promise<void>} Resolves if the sign-in is successful.\n */\n async signIn({\n options: {onProgress, maxTimeToLiveInMilliseconds} = {},\n loadAuth\n }: {\n options?: WebAuthnSignInOptions;\n loadAuth: () => Promise<void>;\n }) {\n const {satelliteId} = EnvStore.getInstance().get() ?? {satelliteId: undefined};\n\n if (isNullish(satelliteId)) {\n throw new SignInInitError('Satellite ID not set. Have you initialized the Satellite?');\n }\n\n const retrievePublicKey: RetrievePublicKeyFn = async ({credentialId}) => {\n const doc = await getDoc({\n collection: '#user-webauthn',\n key: uint8ArrayToBase64(credentialId),\n options: {\n certified: true\n },\n satellite: {\n identity: new AnonymousIdentity(),\n satelliteId\n }\n });\n\n if (isNullish(doc)) {\n throw new WebAuthnSignInRetrievePublicKeyError(\n 'No public key found for the selected passkey.'\n );\n }\n\n const {data} = doc;\n\n const {publicKey} = data as {publicKey: Uint8Array};\n\n return unwrapDER(publicKey.buffer as ArrayBuffer, DER_COSE_OID);\n };\n\n const onSignProgress: WebAuthnSignProgressFn = ({step, state}) => {\n switch (step) {\n case WebAuthnSignProgressStep.RequestingUserCredential:\n onProgress?.({\n step: WebAuthnSignInProgressStep.RequestingUserCredential,\n state\n });\n break;\n case WebAuthnSignProgressStep.FinalizingCredential:\n onProgress?.({\n step: WebAuthnSignInProgressStep.FinalizingCredential,\n state\n });\n break;\n case WebAuthnSignProgressStep.Signing:\n onProgress?.({\n step: WebAuthnSignInProgressStep.Signing,\n state\n });\n break;\n }\n };\n\n const passkeyIdentity = await WebAuthnIdentity.createWithExistingCredential({\n retrievePublicKey,\n onProgress: onSignProgress\n });\n\n // When the signing of the session occurs, the Identity.sign is triggered\n // which in turns lead to:\n // 1. Get passkey (navigator.credentials.get)\n // 2. Retrieve the public key from the backend\n // 3. Create signature\n const {delegationIdentity, sessionKey} = await this.#createSessionDelegation({\n identity: passkeyIdentity,\n maxTimeToLiveInMilliseconds\n });\n\n // 4. Save session identity for loading it with auth client\n const saveSession = async () =>\n await this.#saveSessionIdentityForAuthClient({delegationIdentity, sessionKey});\n\n await execute({\n fn: saveSession,\n step: WebAuthnSignInProgressStep.FinalizingSession,\n onProgress\n });\n\n // 5. Load the user\n await execute({\n fn: loadAuth,\n step: WebAuthnSignInProgressStep.RetrievingUser,\n onProgress\n });\n }\n\n async #createSessionDelegation({\n identity,\n maxTimeToLiveInMilliseconds\n }: {identity: SignIdentity} & Pick<\n WebAuthnSignInOptions,\n 'maxTimeToLiveInMilliseconds'\n >): Promise<SessionDelegationIdentity> {\n const sessionKey = await ECDSAKeyIdentity.generate({extractable: false});\n\n const sessionLengthInMilliseconds =\n maxTimeToLiveInMilliseconds ?? DELEGATION_IDENTITY_EXPIRATION_IN_MILLISECONDS;\n\n // We do not provide any particular targets. This delegation is meant to work\n // on the Internet Computer with any canister.\n const chain = await DelegationChain.create(\n identity,\n sessionKey.getPublicKey(),\n new Date(Date.now() + sessionLengthInMilliseconds)\n );\n\n const delegationIdentity = DelegationIdentity.fromDelegation(sessionKey, chain);\n\n return {delegationIdentity, sessionKey};\n }\n\n async #saveSessionIdentityForAuthClient({\n sessionKey,\n delegationIdentity\n }: SessionDelegationIdentity) {\n const storage = new IdbStorage();\n\n await Promise.all([\n storage.set(KEY_STORAGE_KEY, sessionKey.getKeyPair()),\n storage.set(\n KEY_STORAGE_DELEGATION,\n JSON.stringify(delegationIdentity.getDelegation().toJSON())\n )\n ]);\n }\n}\n", "import type {ReadOptions} from '../types/call-options';\n\n/**\n * Default options for read operations.\n *\n * For backwards compatibility and because most developers probably prioritize speed over\n * additional security when fetching read-only data from the Internet Computer,\n * read operations are performed in an uncertified way by default.\n */\nexport const DEFAULT_READ_OPTIONS: ReadOptions = {certified: false};\n", "import {AnonymousIdentity, type Identity} from '@dfinity/agent';\nimport {nonNullish} from '@dfinity/utils';\nimport {getIdentity as getAuthIdentity} from '../../auth/services/auth.services';\n\nexport const getAnyIdentity = (identity?: Identity): Identity => {\n if (nonNullish(identity)) {\n return identity;\n }\n\n return getAuthIdentity() ?? new AnonymousIdentity();\n};\n", "import {fromNullable, isNullish, nonNullish} from '@dfinity/utils';\nimport type {SatelliteDid} from '@junobuild/ic-client/actor';\nimport {getSatelliteActor} from '../../core/api/actor.api';\nimport type {ActorReadParams, ActorUpdateParams} from '../../core/types/actor';\nimport type {ListParams, ListResults} from '../../core/types/list';\nimport type {ExcludeDate} from '../../core/types/utility';\nimport {toListParams} from '../../core/utils/list.utils';\nimport type {Doc} from '../types/doc';\nimport {mapData} from '../utils/data.utils';\nimport {fromDoc, toDelDoc, toSetDoc} from '../utils/doc.utils';\n\nexport const getDoc = async <D>({\n collection,\n key,\n ...rest\n}: {\n collection: string;\n} & ActorReadParams &\n Pick<Doc<D>, 'key'>): Promise<Doc<D> | undefined> => {\n const {get_doc} = await getSatelliteActor(rest);\n\n const doc = fromNullable(await get_doc(collection, key));\n\n if (isNullish(doc)) {\n return undefined;\n }\n\n return fromDoc({doc, key});\n};\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const getManyDocs = async ({\n docs,\n ...rest\n}: {\n docs: ({collection: string} & Pick<Doc<any>, 'key'>)[];\n} & ActorReadParams): Promise<(Doc<any> | undefined)[]> => {\n const {get_many_docs} = await getSatelliteActor(rest);\n\n const payload: [string, string][] = docs.map(({collection, key}) => [collection, key]);\n\n const resultsDocs = await get_many_docs(payload);\n\n const results: (Doc<any> | undefined)[] = [];\n for (const [key, resultDoc] of resultsDocs) {\n const doc = fromNullable(resultDoc);\n results.push(nonNullish(doc) ? await fromDoc({key, doc}) : undefined);\n }\n\n return results;\n};\n/* eslint-enable */\n\nexport const setDoc = async <D>({\n collection,\n doc,\n ...rest\n}: {\n collection: string;\n doc: Doc<D>;\n} & ActorUpdateParams): Promise<Doc<D>> => {\n const {set_doc} = await getSatelliteActor(rest);\n\n const {key} = doc;\n\n const setDoc = await toSetDoc(doc);\n\n const updatedDoc = await set_doc(collection, key, setDoc);\n\n return await fromDoc({key, doc: updatedDoc});\n};\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const setManyDocs = async ({\n docs,\n ...rest\n}: {\n docs: {collection: string; doc: Doc<any>}[];\n} & ActorUpdateParams): Promise<Doc<any>[]> => {\n const {set_many_docs} = await getSatelliteActor(rest);\n\n const payload: [string, string, SatelliteDid.SetDoc][] = [];\n for (const {collection, doc} of docs) {\n const {key} = doc;\n payload.push([collection, key, await toSetDoc(doc)]);\n }\n\n const updatedDocs = await set_many_docs(payload);\n\n const results: Doc<any>[] = [];\n for (const [key, updatedDoc] of updatedDocs) {\n results.push(await fromDoc({key, doc: updatedDoc}));\n }\n\n return results;\n};\n/* eslint-enable */\n\nexport const deleteDoc = async <D>({\n collection,\n doc,\n ...rest\n}: {\n collection: string;\n doc: Doc<D>;\n} & ActorUpdateParams): Promise<void> => {\n const {del_doc} = await getSatelliteActor(rest);\n\n const {key} = doc;\n\n return del_doc(collection, key, toDelDoc(doc));\n};\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const deleteManyDocs = async ({\n docs,\n ...rest\n}: {\n docs: {collection: string; doc: Doc<any>}[];\n} & ActorUpdateParams): Promise<void> => {\n const {del_many_docs} = await getSatelliteActor(rest);\n\n const payload: [string, string, SatelliteDid.DelDoc][] = docs.map(({collection, doc}) => [\n collection,\n doc.key,\n toDelDoc(doc)\n ]);\n\n await del_many_docs(payload);\n};\n/* eslint-enable */\n\nexport const deleteFilteredDocs = async ({\n collection,\n filter,\n ...rest\n}: {\n collection: string;\n filter: ListParams;\n} & ActorUpdateParams): Promise<void> => {\n const {del_filtered_docs} = await getSatelliteActor(rest);\n\n return del_filtered_docs(collection, toListParams(filter));\n};\n\nexport const listDocs = async <D>({\n collection,\n filter,\n ...rest\n}: {\n collection: string;\n filter: ListParams;\n} & ActorReadParams): Promise<ListResults<Doc<D>>> => {\n const {list_docs} = await getSatelliteActor(rest);\n\n const {items, items_page, items_length, matches_length, matches_pages} = await list_docs(\n collection,\n toListParams(filter)\n );\n\n const docs: Doc<D>[] = [];\n\n for (const [key, item] of items) {\n const {data: dataArray, owner, description, version, ...rest} = item;\n\n docs.push({\n key,\n description: fromNullable(description),\n owner: owner.toText(),\n data: await mapData<ExcludeDate<D>>({data: dataArray}),\n version: fromNullable(version),\n ...rest\n });\n }\n\n return {\n items: docs,\n items_length,\n items_page: fromNullable(items_page),\n matches_length,\n matches_pages: fromNullable(matches_pages)\n };\n};\n\nexport const countDocs = async ({\n collection,\n filter,\n ...rest\n}: {\n collection: string;\n filter: ListParams;\n} & ActorReadParams): Promise<bigint> => {\n const {count_docs} = await getSatelliteActor(rest);\n\n return count_docs(collection, toListParams(filter));\n};\n", "import type {ActorMethod, ActorSubclass} from '@dfinity/agent';\nimport type {IDL} from '@dfinity/candid';\nimport {assertNonNullish} from '@dfinity/utils';\nimport {\n idlCertifiedFactorySatellite,\n idlFactorySatellite,\n type SatelliteActor\n} from '@junobuild/ic-client/actor';\nimport {ActorStore} from '../stores/actor.store';\nimport type {ActorKey} from '../types/actor';\nimport type {CallOptions} from '../types/call-options';\nimport type {SatelliteContext} from '../types/satellite';\nimport {customOrEnvContainer, customOrEnvSatelliteId} from '../utils/env.utils';\n\nexport const getSatelliteActor = ({\n satellite,\n options: {certified}\n}: {\n satellite: SatelliteContext;\n options: CallOptions;\n}): Promise<SatelliteActor> =>\n getActor({\n idlFactory: certified ? idlCertifiedFactorySatellite : idlFactorySatellite,\n actorKey: `stock#${certified ? 'update' : 'query'}`,\n ...satellite\n });\n\nexport const getSatelliteExtendedActor = <T = Record<string, ActorMethod>>({\n idlFactory,\n ...rest\n}: SatelliteContext & {idlFactory: IDL.InterfaceFactory}): Promise<ActorSubclass<T>> =>\n getActor({\n idlFactory,\n actorKey: 'extended#query',\n ...rest\n });\n\nconst getActor = async <T = Record<string, ActorMethod>>({\n satelliteId: customSatelliteId,\n container: customContainer,\n ...rest\n}: SatelliteContext & {idlFactory: IDL.InterfaceFactory; actorKey: ActorKey}): Promise<\n ActorSubclass<T>\n> => {\n const {satelliteId} = customOrEnvSatelliteId({satelliteId: customSatelliteId});\n\n assertNonNullish(satelliteId, 'No satellite ID defined. Did you initialize Juno?');\n\n const {container} = customOrEnvContainer({container: customContainer});\n\n return await ActorStore.getInstance().getActor({\n satelliteId,\n container,\n ...rest\n });\n};\n", "import {Actor, type ActorConfig, type ActorMethod, type ActorSubclass} from '@dfinity/agent';\nimport type {IDL} from '@dfinity/candid';\nimport type {Principal} from '@dfinity/principal';\nimport {isNullish} from '@dfinity/utils';\nimport type {\n ActorParameters,\n ConsoleParameters,\n MissionControlParameters,\n OrbiterParameters,\n SatelliteParameters\n} from '../types/actor';\nimport {\n idlCertifiedFactoryConsole,\n idlCertifiedFactoryOrbiter,\n idlCertifiedFactorySatellite,\n idlDeprecatedFactoryMissionControlVersion,\n idlDeprecatedFactoryOrbiterVersion,\n idlDeprecatedFactorySatellite,\n idlDeprecatedFactorySatelliteNoScope,\n idlDeprecatedFactorySatelliteVersion,\n idlFactoryConsole,\n idlFactoryMissionControl,\n idlFactoryOrbiter,\n idlFactorySatellite,\n type ConsoleActor,\n type DeprecatedMissionControlVersionActor,\n type DeprecatedOrbiterVersionActor,\n type DeprecatedSatelliteActor,\n type DeprecatedSatelliteNoScopeActor,\n type DeprecatedSatelliteVersionActor,\n type MissionControlActor,\n type OrbiterActor,\n type SatelliteActor\n} from './actor.factory';\nimport {useOrInitAgent} from './agent.api';\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 certified = false,\n ...rest\n}: SatelliteParameters & {certified?: boolean}): Promise<SatelliteActor> =>\n getActor({\n canisterId: satelliteId,\n ...rest,\n idlFactory: certified ? idlCertifiedFactorySatellite : 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 = ({\n orbiterId,\n certified = false,\n ...rest\n}: OrbiterParameters & {certified?: boolean}): Promise<OrbiterActor> =>\n getActor({\n canisterId: orbiterId,\n ...rest,\n idlFactory: certified ? idlCertifiedFactoryOrbiter : 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 getConsoleActor = ({\n consoleId,\n certified = false,\n ...rest\n}: ConsoleParameters & {certified?: boolean}): Promise<ConsoleActor> =>\n getActor({\n canisterId: consoleId,\n ...rest,\n idlFactory: certified ? idlCertifiedFactoryConsole : idlFactoryConsole\n });\n\nexport const getActor = <T>({\n canisterId,\n idlFactory,\n ...rest\n}: ActorParameters & {\n canisterId: Principal | 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\nconst createActor = async <T = Record<string, ActorMethod>>({\n canisterId,\n idlFactory,\n config,\n ...rest\n}: {\n idlFactory: IDL.InterfaceFactory;\n canisterId: Principal | string;\n config?: Pick<ActorConfig, 'callTransform' | 'queryTransform'>;\n} & ActorParameters): Promise<ActorSubclass<T>> => {\n const agent = await useOrInitAgent(rest);\n\n // Creates an actor with using the candid interface and the HttpAgent\n return Actor.createActor(idlFactory, {\n agent,\n canisterId,\n ...(config ?? {})\n });\n};\n", "// @ts-ignore\nexport const idlFactory = ({IDL}) => {\n const MissionControlArgs = IDL.Record({user: IDL.Principal});\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 const MissionControlArgs = IDL.Record({user: IDL.Principal});\n return [MissionControlArgs];\n};\n", "// @ts-ignore\nexport const idlFactory = ({IDL}) => {\n const SegmentArgs = IDL.Record({controllers: IDL.Vec(IDL.Principal)});\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 const SegmentArgs = IDL.Record({controllers: IDL.Vec(IDL.Principal)});\n return [SegmentArgs];\n};\n", "// @ts-ignore\nexport const idlFactory = ({IDL}) => {\n const SegmentArgs = IDL.Record({controllers: IDL.Vec(IDL.Principal)});\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([GetAnalytics], [IDL.Vec(IDL.Tuple(AnalyticKey, PageView))], []),\n get_page_views_analytics_clients: IDL.Func([GetAnalytics], [AnalyticsClientsPageViews], []),\n get_page_views_analytics_metrics: IDL.Func([GetAnalytics], [AnalyticsMetricsPageViews], []),\n get_page_views_analytics_top_10: IDL.Func([GetAnalytics], [AnalyticsTop10PageViews], []),\n get_performance_metrics: IDL.Func(\n [GetAnalytics],\n [IDL.Vec(IDL.Tuple(AnalyticKey, PerformanceMetric))],\n []\n ),\n get_performance_metrics_analytics_web_vitals: IDL.Func(\n [GetAnalytics],\n [AnalyticsWebVitalsPerformanceMetrics],\n []\n ),\n get_track_events: IDL.Func([GetAnalytics], [IDL.Vec(IDL.Tuple(AnalyticKey, TrackEvent))], []),\n get_track_events_analytics: IDL.Func([GetAnalytics], [AnalyticsTrackEvents], []),\n http_request: IDL.Func([HttpRequest], [HttpResponse], []),\n http_request_update: IDL.Func([HttpRequest], [HttpResponse], []),\n list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], []),\n list_satellite_configs: IDL.Func(\n [],\n [IDL.Vec(IDL.Tuple(IDL.Principal, OrbiterSatelliteConfig))],\n []\n ),\n memory_size: IDL.Func([], [MemorySize], []),\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 const SegmentArgs = IDL.Record({controllers: IDL.Vec(IDL.Principal)});\n return [SegmentArgs];\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.Text, IDL.Text))], [], []),\n del_many_docs: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, DelDoc))], [], []),\n del_rule: IDL.Func([CollectionType, IDL.Text, DelRule], [], []),\n deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),\n get_asset: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(AssetNoContent)], ['query']),\n get_auth_config: IDL.Func([], [IDL.Opt(AuthenticationConfig)], ['query']),\n get_config: IDL.Func([], [Config], []),\n get_db_config: IDL.Func([], [IDL.Opt(DbConfig)], ['query']),\n get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], ['query']),\n get_many_assets: IDL.Func(\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(AssetNoContent)))],\n ['query']\n ),\n get_many_docs: IDL.Func(\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(Doc)))],\n ['query']\n ),\n get_rule: IDL.Func([CollectionType, IDL.Text], [IDL.Opt(Rule)], ['query']),\n get_storage_config: IDL.Func([], [StorageConfig], ['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.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([CollectionType], [IDL.Vec(IDL.Tuple(IDL.Text, Rule))], ['query']),\n memory_size: IDL.Func([], [MemorySize], ['query']),\n set_auth_config: IDL.Func([AuthenticationConfig], [], []),\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_db_config: IDL.Func([DbConfig], [], []),\n set_doc: IDL.Func([IDL.Text, IDL.Text, SetDoc], [Doc], []),\n set_many_docs: IDL.Func(\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, SetDoc))],\n [IDL.Vec(IDL.Tuple(IDL.Text, Doc))],\n []\n ),\n set_rule: IDL.Func([CollectionType, IDL.Text, SetRule], [Rule], []),\n set_storage_config: IDL.Func([StorageConfig], [], []),\n upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),\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 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 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 PageViewDevice = IDL.Record({\n inner_height: IDL.Nat16,\n inner_width: IDL.Nat16\n });\n const PageView = IDL.Record({\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 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 AnalyticsDevicesPageViews = IDL.Record({\n desktop: IDL.Float64,\n others: IDL.Float64,\n mobile: IDL.Float64\n });\n const AnalyticsClientsPageViews = IDL.Record({\n browsers: AnalyticsBrowsersPageViews,\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 });\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 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 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 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 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 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 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 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 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 MonitoringHistoryCycles = IDL.Record({\n deposited_cycles: IDL.Opt(CyclesBalance),\n cycles: CyclesBalance\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 });\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 version: IDL.Func([], [IDL.Text], ['query'])\n });\n};\n// @ts-ignore\nexport const init = ({IDL}) => {\n return [];\n};\n", "export 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 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.Principal)], ['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};\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 CommitProposal = IDL.Record({\n sha256: IDL.Vec(IDL.Nat8),\n proposal_id: 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 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 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 DeleteProposalAssets = IDL.Record({\n proposal_ids: IDL.Vec(IDL.Nat)\n });\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 AuthenticationRules = IDL.Record({\n allowed_callers: IDL.Vec(IDL.Principal)\n });\n const AuthenticationConfig = IDL.Record({\n updated_at: IDL.Opt(IDL.Nat64),\n created_at: IDL.Opt(IDL.Nat64),\n version: IDL.Opt(IDL.Nat64),\n internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n rules: IDL.Opt(AuthenticationRules)\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 updated_at: IDL.Opt(IDL.Nat64),\n created_at: IDL.Opt(IDL.Nat64),\n version: IDL.Opt(IDL.Nat64),\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 updated_at: IDL.Opt(IDL.Nat64),\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 created_at: IDL.Opt(IDL.Nat64),\n version: IDL.Opt(IDL.Nat64),\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 ProposalStatus = IDL.Variant({\n Initialized: IDL.Null,\n Failed: IDL.Null,\n Open: IDL.Null,\n Rejected: IDL.Null,\n Executed: IDL.Null,\n Accepted: IDL.Null\n });\n const AssetsUpgradeOptions = IDL.Record({\n clear_existing_assets: IDL.Opt(IDL.Bool)\n });\n const SegmentsDeploymentOptions = IDL.Record({\n orbiter: IDL.Opt(IDL.Text),\n mission_control_version: IDL.Opt(IDL.Text),\n satellite_version: IDL.Opt(IDL.Text)\n });\n const ProposalType = IDL.Variant({\n AssetsUpgrade: AssetsUpgradeOptions,\n SegmentsDeployment: SegmentsDeploymentOptions\n });\n const Proposal = IDL.Record({\n status: ProposalStatus,\n updated_at: IDL.Nat64,\n sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),\n executed_at: IDL.Opt(IDL.Nat64),\n owner: IDL.Principal,\n created_at: IDL.Nat64,\n version: IDL.Opt(IDL.Nat64),\n proposal_type: ProposalType\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 ListProposalsOrder = IDL.Record({desc: IDL.Bool});\n const ListProposalsPaginate = IDL.Record({\n start_after: IDL.Opt(IDL.Nat),\n limit: IDL.Opt(IDL.Nat)\n });\n const ListProposalsParams = IDL.Record({\n order: IDL.Opt(ListProposalsOrder),\n paginate: IDL.Opt(ListProposalsPaginate)\n });\n const ProposalKey = IDL.Record({proposal_id: IDL.Nat});\n const ListProposalResults = IDL.Record({\n matches_length: IDL.Nat64,\n items: IDL.Vec(IDL.Tuple(ProposalKey, Proposal)),\n items_length: IDL.Nat64\n });\n const ListRulesMatcher = IDL.Record({include_system: IDL.Bool});\n const ListRulesParams = IDL.Record({matcher: IDL.Opt(ListRulesMatcher)});\n const ListRulesResults = IDL.Record({\n matches_length: IDL.Nat64,\n items: IDL.Vec(IDL.Tuple(IDL.Text, Rule)),\n items_length: IDL.Nat64\n });\n const MemorySize = IDL.Record({stable: IDL.Nat64, heap: IDL.Nat64});\n const SetAuthenticationConfig = IDL.Record({\n version: IDL.Opt(IDL.Nat64),\n internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n rules: IDL.Opt(AuthenticationRules)\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 SetControllersArgs = IDL.Record({\n controller: SetController,\n controllers: IDL.Vec(IDL.Principal)\n });\n const SetDbConfig = IDL.Record({\n version: IDL.Opt(IDL.Nat64),\n max_memory_size: IDL.Opt(ConfigMaxMemorySize)\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 SetStorageConfig = 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 version: IDL.Opt(IDL.Nat64),\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 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 commit_asset_upload: IDL.Func([CommitBatch], [], []),\n commit_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n commit_proposal_asset_upload: IDL.Func([CommitBatch], [], []),\n commit_proposal_many_assets_upload: IDL.Func([IDL.Vec(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 count_proposals: IDL.Func([], [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.Text, IDL.Text))], [], []),\n del_many_docs: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, DelDoc))], [], []),\n del_rule: IDL.Func([CollectionType, IDL.Text, DelRule], [], []),\n delete_proposal_assets: IDL.Func([DeleteProposalAssets], [], []),\n deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),\n get_asset: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(AssetNoContent)], ['query']),\n get_auth_config: IDL.Func([], [IDL.Opt(AuthenticationConfig)], ['query']),\n get_config: IDL.Func([], [Config], []),\n get_db_config: IDL.Func([], [IDL.Opt(DbConfig)], ['query']),\n get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], ['query']),\n get_many_assets: IDL.Func(\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(AssetNoContent)))],\n ['query']\n ),\n get_many_docs: IDL.Func(\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(Doc)))],\n ['query']\n ),\n get_proposal: IDL.Func([IDL.Nat], [IDL.Opt(Proposal)], ['query']),\n get_rule: IDL.Func([CollectionType, IDL.Text], [IDL.Opt(Rule)], ['query']),\n get_storage_config: IDL.Func([], [StorageConfig], ['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 init_proposal: IDL.Func([ProposalType], [IDL.Nat, Proposal], []),\n init_proposal_asset_upload: IDL.Func([InitAssetKey, IDL.Nat], [InitUploadResult], []),\n init_proposal_many_assets_upload: IDL.Func(\n [IDL.Vec(InitAssetKey), IDL.Nat],\n [IDL.Vec(IDL.Tuple(IDL.Text, InitUploadResult))],\n []\n ),\n list_assets: IDL.Func([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_proposals: IDL.Func([ListProposalsParams], [ListProposalResults], ['query']),\n list_rules: IDL.Func([CollectionType, ListRulesParams], [ListRulesResults], ['query']),\n memory_size: IDL.Func([], [MemorySize], ['query']),\n reject_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n set_auth_config: IDL.Func([SetAuthenticationConfig], [AuthenticationConfig], []),\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_db_config: IDL.Func([SetDbConfig], [DbConfig], []),\n set_doc: IDL.Func([IDL.Text, IDL.Text, SetDoc], [Doc], []),\n set_many_docs: IDL.Func(\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, SetDoc))],\n [IDL.Vec(IDL.Tuple(IDL.Text, Doc))],\n []\n ),\n set_rule: IDL.Func([CollectionType, IDL.Text, SetRule], [Rule], []),\n set_storage_config: IDL.Func([SetStorageConfig], [StorageConfig], []),\n submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),\n upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),\n upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])\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 CommitProposal = IDL.Record({\n sha256: IDL.Vec(IDL.Nat8),\n proposal_id: 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 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 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 DeleteProposalAssets = IDL.Record({\n proposal_ids: IDL.Vec(IDL.Nat)\n });\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 AuthenticationRules = IDL.Record({\n allowed_callers: IDL.Vec(IDL.Principal)\n });\n const AuthenticationConfig = IDL.Record({\n updated_at: IDL.Opt(IDL.Nat64),\n created_at: IDL.Opt(IDL.Nat64),\n version: IDL.Opt(IDL.Nat64),\n internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n rules: IDL.Opt(AuthenticationRules)\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 updated_at: IDL.Opt(IDL.Nat64),\n created_at: IDL.Opt(IDL.Nat64),\n version: IDL.Opt(IDL.Nat64),\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 updated_at: IDL.Opt(IDL.Nat64),\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 created_at: IDL.Opt(IDL.Nat64),\n version: IDL.Opt(IDL.Nat64),\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 ProposalStatus = IDL.Variant({\n Initialized: IDL.Null,\n Failed: IDL.Null,\n Open: IDL.Null,\n Rejected: IDL.Null,\n Executed: IDL.Null,\n Accepted: IDL.Null\n });\n const AssetsUpgradeOptions = IDL.Record({\n clear_existing_assets: IDL.Opt(IDL.Bool)\n });\n const SegmentsDeploymentOptions = IDL.Record({\n orbiter: IDL.Opt(IDL.Text),\n mission_control_version: IDL.Opt(IDL.Text),\n satellite_version: IDL.Opt(IDL.Text)\n });\n const ProposalType = IDL.Variant({\n AssetsUpgrade: AssetsUpgradeOptions,\n SegmentsDeployment: SegmentsDeploymentOptions\n });\n const Proposal = IDL.Record({\n status: ProposalStatus,\n updated_at: IDL.Nat64,\n sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),\n executed_at: IDL.Opt(IDL.Nat64),\n owner: IDL.Principal,\n created_at: IDL.Nat64,\n version: IDL.Opt(IDL.Nat64),\n proposal_type: ProposalType\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([], [], [])\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 ListProposalsOrder = IDL.Record({desc: IDL.Bool});\n const ListProposalsPaginate = IDL.Record({\n start_after: IDL.Opt(IDL.Nat),\n limit: IDL.Opt(IDL.Nat)\n });\n const ListProposalsParams = IDL.Record({\n order: IDL.Opt(ListProposalsOrder),\n paginate: IDL.Opt(ListProposalsPaginate)\n });\n const ProposalKey = IDL.Record({proposal_id: IDL.Nat});\n const ListProposalResults = IDL.Record({\n matches_length: IDL.Nat64,\n items: IDL.Vec(IDL.Tuple(ProposalKey, Proposal)),\n items_length: IDL.Nat64\n });\n const ListRulesMatcher = IDL.Record({include_system: IDL.Bool});\n const ListRulesParams = IDL.Record({matcher: IDL.Opt(ListRulesMatcher)});\n const ListRulesResults = IDL.Record({\n matches_length: IDL.Nat64,\n items: IDL.Vec(IDL.Tuple(IDL.Text, Rule)),\n items_length: IDL.Nat64\n });\n const MemorySize = IDL.Record({stable: IDL.Nat64, heap: IDL.Nat64});\n const SetAuthenticationConfig = IDL.Record({\n version: IDL.Opt(IDL.Nat64),\n internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n rules: IDL.Opt(AuthenticationRules)\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 SetControllersArgs = IDL.Record({\n controller: SetController,\n controllers: IDL.Vec(IDL.Principal)\n });\n const SetDbConfig = IDL.Record({\n version: IDL.Opt(IDL.Nat64),\n max_memory_size: IDL.Opt(ConfigMaxMemorySize)\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 SetStorageConfig = 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 version: IDL.Opt(IDL.Nat64),\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 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 commit_asset_upload: IDL.Func([CommitBatch], [], []),\n commit_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n commit_proposal_asset_upload: IDL.Func([CommitBatch], [], []),\n commit_proposal_many_assets_upload: IDL.Func([IDL.Vec(CommitBatch)], [], []),\n count_assets: IDL.Func([IDL.Text, ListParams], [IDL.Nat64], []),\n count_collection_assets: IDL.Func([IDL.Text], [IDL.Nat64], []),\n count_collection_docs: IDL.Func([IDL.Text], [IDL.Nat64], []),\n count_docs: IDL.Func([IDL.Text, ListParams], [IDL.Nat64], []),\n count_proposals: IDL.Func([], [IDL.Nat64], []),\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.Text, IDL.Text))], [], []),\n del_many_docs: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, DelDoc))], [], []),\n del_rule: IDL.Func([CollectionType, IDL.Text, DelRule], [], []),\n delete_proposal_assets: IDL.Func([DeleteProposalAssets], [], []),\n deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),\n get_asset: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(AssetNoContent)], []),\n get_auth_config: IDL.Func([], [IDL.Opt(AuthenticationConfig)], []),\n get_config: IDL.Func([], [Config], []),\n get_db_config: IDL.Func([], [IDL.Opt(DbConfig)], []),\n get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], []),\n get_many_assets: IDL.Func(\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(AssetNoContent)))],\n []\n ),\n get_many_docs: IDL.Func(\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(Doc)))],\n []\n ),\n get_proposal: IDL.Func([IDL.Nat], [IDL.Opt(Proposal)], []),\n get_rule: IDL.Func([CollectionType, IDL.Text], [IDL.Opt(Rule)], []),\n get_storage_config: IDL.Func([], [StorageConfig], []),\n http_request: IDL.Func([HttpRequest], [HttpResponse], []),\n http_request_streaming_callback: IDL.Func(\n [StreamingCallbackToken],\n [StreamingCallbackHttpResponse],\n []\n ),\n init_asset_upload: IDL.Func([InitAssetKey], [InitUploadResult], []),\n init_proposal: IDL.Func([ProposalType], [IDL.Nat, Proposal], []),\n init_proposal_asset_upload: IDL.Func([InitAssetKey, IDL.Nat], [InitUploadResult], []),\n init_proposal_many_assets_upload: IDL.Func(\n [IDL.Vec(InitAssetKey), IDL.Nat],\n [IDL.Vec(IDL.Tuple(IDL.Text, InitUploadResult))],\n []\n ),\n list_assets: IDL.Func([IDL.Text, ListParams], [ListResults], []),\n list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], []),\n list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], []),\n list_docs: IDL.Func([IDL.Text, ListParams], [ListResults_1], []),\n list_proposals: IDL.Func([ListProposalsParams], [ListProposalResults], []),\n list_rules: IDL.Func([CollectionType, ListRulesParams], [ListRulesResults], []),\n memory_size: IDL.Func([], [MemorySize], []),\n reject_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n set_auth_config: IDL.Func([SetAuthenticationConfig], [AuthenticationConfig], []),\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_db_config: IDL.Func([SetDbConfig], [DbConfig], []),\n set_doc: IDL.Func([IDL.Text, IDL.Text, SetDoc], [Doc], []),\n set_many_docs: IDL.Func(\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, SetDoc))],\n [IDL.Vec(IDL.Tuple(IDL.Text, Doc))],\n []\n ),\n set_rule: IDL.Func([CollectionType, IDL.Text, SetRule], [Rule], []),\n set_storage_config: IDL.Func([SetStorageConfig], [StorageConfig], []),\n submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),\n upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),\n upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])\n });\n};\n// @ts-ignore\nexport const init = ({IDL}) => {\n return [];\n};\n", "// @ts-ignore\nexport const idlFactory = ({IDL}) => {\n const Tokens = IDL.Record({e8s: IDL.Nat64});\n const AssertMissionControlCenterArgs = IDL.Record({\n mission_control_id: IDL.Principal,\n user: IDL.Principal\n });\n const CommitProposal = IDL.Record({\n sha256: IDL.Vec(IDL.Nat8),\n proposal_id: IDL.Nat\n });\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 CreateCanisterArgs = IDL.Record({\n block_index: IDL.Opt(IDL.Nat64),\n subnet_id: IDL.Opt(IDL.Principal),\n user: IDL.Principal\n });\n const DeleteControllersArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal)\n });\n const DeleteProposalAssets = IDL.Record({\n proposal_ids: IDL.Vec(IDL.Nat)\n });\n const StorageConfigIFrame = IDL.Variant({\n Deny: IDL.Null,\n AllowAny: IDL.Null,\n SameOrigin: IDL.Null\n });\n const ConfigMaxMemorySize = IDL.Record({\n stable: IDL.Opt(IDL.Nat64),\n heap: IDL.Opt(IDL.Nat64)\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 updated_at: IDL.Opt(IDL.Nat64),\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 created_at: IDL.Opt(IDL.Nat64),\n version: IDL.Opt(IDL.Nat64),\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({storage: StorageConfig});\n const GetCreateCanisterFeeArgs = IDL.Record({user: IDL.Principal});\n const ProposalStatus = IDL.Variant({\n Initialized: IDL.Null,\n Failed: IDL.Null,\n Open: IDL.Null,\n Rejected: IDL.Null,\n Executed: IDL.Null,\n Accepted: IDL.Null\n });\n const AssetsUpgradeOptions = IDL.Record({\n clear_existing_assets: IDL.Opt(IDL.Bool)\n });\n const SegmentsDeploymentOptions = IDL.Record({\n orbiter: IDL.Opt(IDL.Text),\n mission_control_version: IDL.Opt(IDL.Text),\n satellite_version: IDL.Opt(IDL.Text)\n });\n const ProposalType = IDL.Variant({\n AssetsUpgrade: AssetsUpgradeOptions,\n SegmentsDeployment: SegmentsDeploymentOptions\n });\n const Proposal = IDL.Record({\n status: ProposalStatus,\n updated_at: IDL.Nat64,\n sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),\n executed_at: IDL.Opt(IDL.Nat64),\n owner: IDL.Principal,\n created_at: IDL.Nat64,\n version: IDL.Opt(IDL.Nat64),\n proposal_type: ProposalType\n });\n const MissionControl = IDL.Record({\n updated_at: IDL.Nat64,\n credits: Tokens,\n mission_control_id: IDL.Opt(IDL.Principal),\n owner: IDL.Principal,\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 certificate_version: IDL.Opt(IDL.Nat16)\n });\n const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});\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 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 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 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 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 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 PaymentStatus = IDL.Variant({\n Refunded: IDL.Null,\n Acknowledged: IDL.Null,\n Completed: IDL.Null\n });\n const Payment = IDL.Record({\n status: PaymentStatus,\n updated_at: IDL.Nat64,\n block_index_payment: IDL.Nat64,\n mission_control_id: IDL.Opt(IDL.Principal),\n created_at: IDL.Nat64,\n block_index_refunded: IDL.Opt(IDL.Nat64)\n });\n const ListProposalsOrder = IDL.Record({desc: IDL.Bool});\n const ListProposalsPaginate = IDL.Record({\n start_after: IDL.Opt(IDL.Nat),\n limit: IDL.Opt(IDL.Nat)\n });\n const ListProposalsParams = IDL.Record({\n order: IDL.Opt(ListProposalsOrder),\n paginate: IDL.Opt(ListProposalsPaginate)\n });\n const ProposalKey = IDL.Record({proposal_id: IDL.Nat});\n const ListProposalResults = IDL.Record({\n matches_length: IDL.Nat64,\n items: IDL.Vec(IDL.Tuple(ProposalKey, Proposal)),\n items_length: 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 SetControllersArgs = IDL.Record({\n controller: SetController,\n controllers: IDL.Vec(IDL.Principal)\n });\n const SegmentKind = IDL.Variant({\n Orbiter: IDL.Null,\n MissionControl: IDL.Null,\n Satellite: IDL.Null\n });\n const SetStorageConfig = 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 version: IDL.Opt(IDL.Nat64),\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 RateConfig = IDL.Record({\n max_tokens: IDL.Nat64,\n time_per_token_ns: IDL.Nat64\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 add_credits: IDL.Func([IDL.Principal, Tokens], [], []),\n add_invitation_code: IDL.Func([IDL.Text], [], []),\n assert_mission_control_center: IDL.Func([AssertMissionControlCenterArgs], [], ['query']),\n commit_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n commit_proposal_asset_upload: IDL.Func([CommitBatch], [], []),\n commit_proposal_many_assets_upload: IDL.Func([IDL.Vec(CommitBatch)], [], []),\n count_proposals: IDL.Func([], [IDL.Nat64], ['query']),\n create_orbiter: IDL.Func([CreateCanisterArgs], [IDL.Principal], []),\n create_satellite: IDL.Func([CreateCanisterArgs], [IDL.Principal], []),\n del_controllers: IDL.Func([DeleteControllersArgs], [], []),\n del_custom_domain: IDL.Func([IDL.Text], [], []),\n delete_proposal_assets: IDL.Func([DeleteProposalAssets], [], []),\n get_config: IDL.Func([], [Config], ['query']),\n get_create_orbiter_fee: IDL.Func([GetCreateCanisterFeeArgs], [IDL.Opt(Tokens)], ['query']),\n get_create_satellite_fee: IDL.Func([GetCreateCanisterFeeArgs], [IDL.Opt(Tokens)], ['query']),\n get_credits: IDL.Func([], [Tokens], ['query']),\n get_proposal: IDL.Func([IDL.Nat], [IDL.Opt(Proposal)], ['query']),\n get_storage_config: IDL.Func([], [StorageConfig], ['query']),\n get_user_mission_control_center: IDL.Func([], [IDL.Opt(MissionControl)], ['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_proposal: IDL.Func([ProposalType], [IDL.Nat, Proposal], []),\n init_proposal_asset_upload: IDL.Func([InitAssetKey, IDL.Nat], [InitUploadResult], []),\n init_proposal_many_assets_upload: IDL.Func(\n [IDL.Vec(InitAssetKey), IDL.Nat],\n [IDL.Vec(IDL.Tuple(IDL.Text, InitUploadResult))],\n []\n ),\n init_user_mission_control_center: IDL.Func([], [MissionControl], []),\n list_assets: IDL.Func([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_payments: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Nat64, Payment))], ['query']),\n list_proposals: IDL.Func([ListProposalsParams], [ListProposalResults], ['query']),\n list_user_mission_control_centers: IDL.Func(\n [],\n [IDL.Vec(IDL.Tuple(IDL.Principal, MissionControl))],\n ['query']\n ),\n reject_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n set_controllers: IDL.Func([SetControllersArgs], [], []),\n set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),\n set_fee: IDL.Func([SegmentKind, Tokens], [], []),\n set_storage_config: IDL.Func([SetStorageConfig], [StorageConfig], []),\n submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),\n update_rate_config: IDL.Func([SegmentKind, RateConfig], [], []),\n upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])\n });\n};\n// @ts-ignore\nexport const init = ({IDL}) => {\n return [];\n};\n", "// @ts-ignore\nexport const idlFactory = ({IDL}) => {\n const Tokens = IDL.Record({e8s: IDL.Nat64});\n const AssertMissionControlCenterArgs = IDL.Record({\n mission_control_id: IDL.Principal,\n user: IDL.Principal\n });\n const CommitProposal = IDL.Record({\n sha256: IDL.Vec(IDL.Nat8),\n proposal_id: IDL.Nat\n });\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 CreateCanisterArgs = IDL.Record({\n block_index: IDL.Opt(IDL.Nat64),\n subnet_id: IDL.Opt(IDL.Principal),\n user: IDL.Principal\n });\n const DeleteControllersArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal)\n });\n const DeleteProposalAssets = IDL.Record({\n proposal_ids: IDL.Vec(IDL.Nat)\n });\n const StorageConfigIFrame = IDL.Variant({\n Deny: IDL.Null,\n AllowAny: IDL.Null,\n SameOrigin: IDL.Null\n });\n const ConfigMaxMemorySize = IDL.Record({\n stable: IDL.Opt(IDL.Nat64),\n heap: IDL.Opt(IDL.Nat64)\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 updated_at: IDL.Opt(IDL.Nat64),\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 created_at: IDL.Opt(IDL.Nat64),\n version: IDL.Opt(IDL.Nat64),\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({storage: StorageConfig});\n const GetCreateCanisterFeeArgs = IDL.Record({user: IDL.Principal});\n const ProposalStatus = IDL.Variant({\n Initialized: IDL.Null,\n Failed: IDL.Null,\n Open: IDL.Null,\n Rejected: IDL.Null,\n Executed: IDL.Null,\n Accepted: IDL.Null\n });\n const AssetsUpgradeOptions = IDL.Record({\n clear_existing_assets: IDL.Opt(IDL.Bool)\n });\n const SegmentsDeploymentOptions = IDL.Record({\n orbiter: IDL.Opt(IDL.Text),\n mission_control_version: IDL.Opt(IDL.Text),\n satellite_version: IDL.Opt(IDL.Text)\n });\n const ProposalType = IDL.Variant({\n AssetsUpgrade: AssetsUpgradeOptions,\n SegmentsDeployment: SegmentsDeploymentOptions\n });\n const Proposal = IDL.Record({\n status: ProposalStatus,\n updated_at: IDL.Nat64,\n sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),\n executed_at: IDL.Opt(IDL.Nat64),\n owner: IDL.Principal,\n created_at: IDL.Nat64,\n version: IDL.Opt(IDL.Nat64),\n proposal_type: ProposalType\n });\n const MissionControl = IDL.Record({\n updated_at: IDL.Nat64,\n credits: Tokens,\n mission_control_id: IDL.Opt(IDL.Principal),\n owner: IDL.Principal,\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 certificate_version: IDL.Opt(IDL.Nat16)\n });\n const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});\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([], [], [])\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 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 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 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 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 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 PaymentStatus = IDL.Variant({\n Refunded: IDL.Null,\n Acknowledged: IDL.Null,\n Completed: IDL.Null\n });\n const Payment = IDL.Record({\n status: PaymentStatus,\n updated_at: IDL.Nat64,\n block_index_payment: IDL.Nat64,\n mission_control_id: IDL.Opt(IDL.Principal),\n created_at: IDL.Nat64,\n block_index_refunded: IDL.Opt(IDL.Nat64)\n });\n const ListProposalsOrder = IDL.Record({desc: IDL.Bool});\n const ListProposalsPaginate = IDL.Record({\n start_after: IDL.Opt(IDL.Nat),\n limit: IDL.Opt(IDL.Nat)\n });\n const ListProposalsParams = IDL.Record({\n order: IDL.Opt(ListProposalsOrder),\n paginate: IDL.Opt(ListProposalsPaginate)\n });\n const ProposalKey = IDL.Record({proposal_id: IDL.Nat});\n const ListProposalResults = IDL.Record({\n matches_length: IDL.Nat64,\n items: IDL.Vec(IDL.Tuple(ProposalKey, Proposal)),\n items_length: 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 SetControllersArgs = IDL.Record({\n controller: SetController,\n controllers: IDL.Vec(IDL.Principal)\n });\n const SegmentKind = IDL.Variant({\n Orbiter: IDL.Null,\n MissionControl: IDL.Null,\n Satellite: IDL.Null\n });\n const SetStorageConfig = 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 version: IDL.Opt(IDL.Nat64),\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 RateConfig = IDL.Record({\n max_tokens: IDL.Nat64,\n time_per_token_ns: IDL.Nat64\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 add_credits: IDL.Func([IDL.Principal, Tokens], [], []),\n add_invitation_code: IDL.Func([IDL.Text], [], []),\n assert_mission_control_center: IDL.Func([AssertMissionControlCenterArgs], [], []),\n commit_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n commit_proposal_asset_upload: IDL.Func([CommitBatch], [], []),\n commit_proposal_many_assets_upload: IDL.Func([IDL.Vec(CommitBatch)], [], []),\n count_proposals: IDL.Func([], [IDL.Nat64], []),\n create_orbiter: IDL.Func([CreateCanisterArgs], [IDL.Principal], []),\n create_satellite: IDL.Func([CreateCanisterArgs], [IDL.Principal], []),\n del_controllers: IDL.Func([DeleteControllersArgs], [], []),\n del_custom_domain: IDL.Func([IDL.Text], [], []),\n delete_proposal_assets: IDL.Func([DeleteProposalAssets], [], []),\n get_config: IDL.Func([], [Config], []),\n get_create_orbiter_fee: IDL.Func([GetCreateCanisterFeeArgs], [IDL.Opt(Tokens)], []),\n get_create_satellite_fee: IDL.Func([GetCreateCanisterFeeArgs], [IDL.Opt(Tokens)], []),\n get_credits: IDL.Func([], [Tokens], []),\n get_proposal: IDL.Func([IDL.Nat], [IDL.Opt(Proposal)], []),\n get_storage_config: IDL.Func([], [StorageConfig], []),\n get_user_mission_control_center: IDL.Func([], [IDL.Opt(MissionControl)], []),\n http_request: IDL.Func([HttpRequest], [HttpResponse], []),\n http_request_streaming_callback: IDL.Func(\n [StreamingCallbackToken],\n [StreamingCallbackHttpResponse],\n []\n ),\n init_proposal: IDL.Func([ProposalType], [IDL.Nat, Proposal], []),\n init_proposal_asset_upload: IDL.Func([InitAssetKey, IDL.Nat], [InitUploadResult], []),\n init_proposal_many_assets_upload: IDL.Func(\n [IDL.Vec(InitAssetKey), IDL.Nat],\n [IDL.Vec(IDL.Tuple(IDL.Text, InitUploadResult))],\n []\n ),\n init_user_mission_control_center: IDL.Func([], [MissionControl], []),\n list_assets: IDL.Func([IDL.Text, ListParams], [ListResults], []),\n list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], []),\n list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], []),\n list_payments: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Nat64, Payment))], []),\n list_proposals: IDL.Func([ListProposalsParams], [ListProposalResults], []),\n list_user_mission_control_centers: IDL.Func(\n [],\n [IDL.Vec(IDL.Tuple(IDL.Principal, MissionControl))],\n []\n ),\n reject_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n set_controllers: IDL.Func([SetControllersArgs], [], []),\n set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),\n set_fee: IDL.Func([SegmentKind, Tokens], [], []),\n set_storage_config: IDL.Func([SetStorageConfig], [StorageConfig], []),\n submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),\n update_rate_config: IDL.Func([SegmentKind, RateConfig], [], []),\n upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])\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 CommitProposal = IDL.Record({\n sha256: IDL.Vec(IDL.Nat8),\n proposal_id: 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 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 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 DeleteProposalAssets = IDL.Record({\n proposal_ids: IDL.Vec(IDL.Nat)\n });\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 AuthenticationRules = IDL.Record({\n allowed_callers: IDL.Vec(IDL.Principal)\n });\n const AuthenticationConfig = IDL.Record({\n updated_at: IDL.Opt(IDL.Nat64),\n created_at: IDL.Opt(IDL.Nat64),\n version: IDL.Opt(IDL.Nat64),\n internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n rules: IDL.Opt(AuthenticationRules)\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 updated_at: IDL.Opt(IDL.Nat64),\n created_at: IDL.Opt(IDL.Nat64),\n version: IDL.Opt(IDL.Nat64),\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 updated_at: IDL.Opt(IDL.Nat64),\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 created_at: IDL.Opt(IDL.Nat64),\n version: IDL.Opt(IDL.Nat64),\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 ProposalStatus = IDL.Variant({\n Initialized: IDL.Null,\n Failed: IDL.Null,\n Open: IDL.Null,\n Rejected: IDL.Null,\n Executed: IDL.Null,\n Accepted: IDL.Null\n });\n const AssetsUpgradeOptions = IDL.Record({\n clear_existing_assets: IDL.Opt(IDL.Bool)\n });\n const SegmentsDeploymentOptions = IDL.Record({\n orbiter: IDL.Opt(IDL.Text),\n mission_control_version: IDL.Opt(IDL.Text),\n satellite_version: IDL.Opt(IDL.Text)\n });\n const ProposalType = IDL.Variant({\n AssetsUpgrade: AssetsUpgradeOptions,\n SegmentsDeployment: SegmentsDeploymentOptions\n });\n const Proposal = IDL.Record({\n status: ProposalStatus,\n updated_at: IDL.Nat64,\n sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),\n executed_at: IDL.Opt(IDL.Nat64),\n owner: IDL.Principal,\n created_at: IDL.Nat64,\n version: IDL.Opt(IDL.Nat64),\n proposal_type: ProposalType\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 ListProposalsOrder = IDL.Record({desc: IDL.Bool});\n const ListProposalsPaginate = IDL.Record({\n start_after: IDL.Opt(IDL.Nat),\n limit: IDL.Opt(IDL.Nat)\n });\n const ListProposalsParams = IDL.Record({\n order: IDL.Opt(ListProposalsOrder),\n paginate: IDL.Opt(ListProposalsPaginate)\n });\n const ProposalKey = IDL.Record({proposal_id: IDL.Nat});\n const ListProposalResults = IDL.Record({\n matches_length: IDL.Nat64,\n items: IDL.Vec(IDL.Tuple(ProposalKey, Proposal)),\n items_length: IDL.Nat64\n });\n const ListRulesMatcher = IDL.Record({include_system: IDL.Bool});\n const ListRulesParams = IDL.Record({matcher: IDL.Opt(ListRulesMatcher)});\n const ListRulesResults = IDL.Record({\n matches_length: IDL.Nat64,\n items: IDL.Vec(IDL.Tuple(IDL.Text, Rule)),\n items_length: IDL.Nat64\n });\n const MemorySize = IDL.Record({stable: IDL.Nat64, heap: IDL.Nat64});\n const SetAuthenticationConfig = IDL.Record({\n version: IDL.Opt(IDL.Nat64),\n internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n rules: IDL.Opt(AuthenticationRules)\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 SetControllersArgs = IDL.Record({\n controller: SetController,\n controllers: IDL.Vec(IDL.Principal)\n });\n const SetDbConfig = IDL.Record({\n version: IDL.Opt(IDL.Nat64),\n max_memory_size: IDL.Opt(ConfigMaxMemorySize)\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 SetStorageConfig = 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 version: IDL.Opt(IDL.Nat64),\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 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 commit_asset_upload: IDL.Func([CommitBatch], [], []),\n commit_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n commit_proposal_asset_upload: IDL.Func([CommitBatch], [], []),\n commit_proposal_many_assets_upload: IDL.Func([IDL.Vec(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 count_proposals: IDL.Func([], [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.Text, IDL.Text))], [], []),\n del_many_docs: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, DelDoc))], [], []),\n del_rule: IDL.Func([CollectionType, IDL.Text, DelRule], [], []),\n delete_proposal_assets: IDL.Func([DeleteProposalAssets], [], []),\n deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),\n get_asset: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(AssetNoContent)], ['query']),\n get_auth_config: IDL.Func([], [IDL.Opt(AuthenticationConfig)], ['query']),\n get_config: IDL.Func([], [Config], []),\n get_db_config: IDL.Func([], [IDL.Opt(DbConfig)], ['query']),\n get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], ['query']),\n get_many_assets: IDL.Func(\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(AssetNoContent)))],\n ['query']\n ),\n get_many_docs: IDL.Func(\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(Doc)))],\n ['query']\n ),\n get_proposal: IDL.Func([IDL.Nat], [IDL.Opt(Proposal)], ['query']),\n get_rule: IDL.Func([CollectionType, IDL.Text], [IDL.Opt(Rule)], ['query']),\n get_storage_config: IDL.Func([], [StorageConfig], ['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 init_proposal: IDL.Func([ProposalType], [IDL.Nat, Proposal], []),\n init_proposal_asset_upload: IDL.Func([InitAssetKey, IDL.Nat], [InitUploadResult], []),\n init_proposal_many_assets_upload: IDL.Func(\n [IDL.Vec(InitAssetKey), IDL.Nat],\n [IDL.Vec(IDL.Tuple(IDL.Text, InitUploadResult))],\n []\n ),\n list_assets: IDL.Func([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_proposals: IDL.Func([ListProposalsParams], [ListProposalResults], ['query']),\n list_rules: IDL.Func([CollectionType, ListRulesParams], [ListRulesResults], ['query']),\n memory_size: IDL.Func([], [MemorySize], ['query']),\n reject_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n set_auth_config: IDL.Func([SetAuthenticationConfig], [AuthenticationConfig], []),\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_db_config: IDL.Func([SetDbConfig], [DbConfig], []),\n set_doc: IDL.Func([IDL.Text, IDL.Text, SetDoc], [Doc], []),\n set_many_docs: IDL.Func(\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, SetDoc))],\n [IDL.Vec(IDL.Tuple(IDL.Text, Doc))],\n []\n ),\n set_rule: IDL.Func([CollectionType, IDL.Text, SetRule], [Rule], []),\n set_storage_config: IDL.Func([SetStorageConfig], [StorageConfig], []),\n submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),\n upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),\n upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])\n });\n};\n// @ts-ignore\nexport const init = ({IDL}) => {\n return [];\n};\n", "import type {HttpAgent} from '@dfinity/agent';\nimport {nonNullish} from '@dfinity/utils';\nimport type {ActorParameters} from '../types/actor';\nimport {createAgent} from '../utils/agent.utils';\n\nexport const useOrInitAgent = async ({agent, ...rest}: ActorParameters): Promise<HttpAgent> =>\n agent ?? (await initAgent(rest));\n\nconst initAgent = async ({\n identity,\n container\n}: Omit<ActorParameters, 'agent'>): Promise<HttpAgent> => {\n const localActor = nonNullish(container) && container !== false;\n\n const host = localActor\n ? container === true\n ? 'http://127.0.0.1:5987'\n : container\n : 'https://icp-api.io';\n\n return await createAgent({\n identity,\n host,\n localActor\n });\n};\n", "import {HttpAgent} from '@dfinity/agent';\nimport type {ActorParameters} from '../types/actor';\n\n// We have this in a utils because we want to mock it for test purposes.\n// Not really happy with that, I welcome better ideas!\nexport const createAgent = async ({\n identity,\n host,\n localActor\n}: Pick<ActorParameters, 'identity'> & {host: string; localActor: boolean}) =>\n await HttpAgent.create({\n identity,\n host,\n retryTimes: 10,\n shouldFetchRootKey: localActor\n });\n", "import {nonNullish} from '@dfinity/utils';\nimport {DOCKER_CONTAINER_URL} from '../constants/container.constants';\nimport {EnvStore} from '../stores/env.store';\nimport type {SatelliteContext} from '../types/satellite';\n\nexport const satelliteUrl = ({\n satelliteId: customSatelliteId,\n container: customContainer\n}: SatelliteContext): string => {\n const {satelliteId} = customOrEnvSatelliteId({satelliteId: customSatelliteId});\n const {container} = customOrEnvContainer({container: customContainer});\n\n if (nonNullish(container) && container !== false) {\n const {host: containerHost, protocol} = new URL(\n container === true ? DOCKER_CONTAINER_URL : container\n );\n return `${protocol}//${satelliteId ?? 'unknown'}.${containerHost.replace('127.0.0.1', 'localhost')}`;\n }\n\n return `https://${satelliteId ?? 'unknown'}.icp0.io`;\n};\n\nexport const customOrEnvSatelliteId = ({\n satelliteId\n}: Pick<SatelliteContext, 'satelliteId'>): Pick<SatelliteContext, 'satelliteId'> =>\n nonNullish(satelliteId)\n ? {satelliteId}\n : (EnvStore.getInstance().get() ?? {satelliteId: undefined});\n\nexport const customOrEnvContainer = ({\n container: customContainer\n}: Pick<SatelliteContext, 'container'>): Pick<SatelliteContext, 'container'> =>\n nonNullish(customContainer)\n ? {container: customContainer}\n : (EnvStore.getInstance().get() ?? {container: undefined});\n", "import {Principal} from '@dfinity/principal';\nimport {isNullish, toNullable} from '@dfinity/utils';\nimport type {SatelliteDid} from '@junobuild/ic-client/actor';\nimport {ListError} from '../../auth/types/errors';\nimport type {ListParams, ListTimestampMatcher} from '../types/list';\n\nconst toListMatcherTimestamp = (\n matcher?: ListTimestampMatcher\n): [] | [SatelliteDid.TimestampMatcher] => {\n if (isNullish(matcher)) {\n return toNullable();\n }\n\n switch (matcher.matcher) {\n case 'equal':\n return toNullable({Equal: matcher.timestamp});\n case 'greaterThan':\n return toNullable({GreaterThan: matcher.timestamp});\n case 'lessThan':\n return toNullable({LessThan: matcher.timestamp});\n case 'between':\n return toNullable({Between: [matcher.timestamps.start, matcher.timestamps.end]});\n default:\n throw new ListError('Invalid list matcher for timestamp', matcher);\n }\n};\n\nexport const toListParams = ({\n matcher,\n paginate,\n order,\n owner\n}: ListParams): SatelliteDid.ListParams => ({\n matcher: isNullish(matcher)\n ? []\n : [\n {\n key: toNullable(matcher.key),\n description: toNullable(matcher.description),\n created_at: toListMatcherTimestamp(matcher.createdAt),\n updated_at: toListMatcherTimestamp(matcher.updatedAt)\n }\n ],\n paginate: toNullable(\n isNullish(paginate)\n ? undefined\n : {\n start_after: toNullable(paginate.startAfter),\n limit: toNullable(isNullish(paginate.limit) ? undefined : BigInt(paginate.limit))\n }\n ),\n order: toNullable(\n isNullish(order)\n ? undefined\n : {\n desc: order.desc,\n field:\n order.field === 'created_at'\n ? {CreatedAt: null}\n : order.field === 'updated_at'\n ? {UpdatedAt: null}\n : {Keys: null}\n }\n ),\n owner: toNullable(\n isNullish(owner) ? undefined : typeof owner === 'string' ? Principal.fromText(owner) : owner\n )\n});\n", "import type {SatelliteDid} from '@junobuild/ic-client/actor';\nimport {fromArray} from '@junobuild/utils';\n\nexport const mapData = async <D>({data}: Pick<SatelliteDid.Doc, 'data'>): Promise<D> => {\n try {\n return await fromArray<D>(data);\n } catch (err: unknown) {\n console.error('The data parsing has failed, mapping to undefined as a fallback.', err);\n return undefined as D;\n }\n};\n", "import {fromNullable, toNullable} from '@dfinity/utils';\nimport type {SatelliteDid} from '@junobuild/ic-client/actor';\nimport {fromArray, toArray} from '@junobuild/utils';\nimport type {ExcludeDate} from '../../core/types/utility';\nimport type {Doc} from '../types/doc';\n\nexport const toSetDoc = async <D>(doc: Doc<D>): Promise<SatelliteDid.SetDoc> => {\n const {data, version, description} = doc;\n\n return {\n description: toNullable(description),\n data: await toArray<ExcludeDate<D>>(data),\n version: toNullable(version)\n };\n};\n\nexport const toDelDoc = <D>(doc: Doc<D>): SatelliteDid.DelDoc => {\n const {version} = doc;\n\n return {\n version: toNullable(version)\n };\n};\n\nexport const fromDoc = async <D>({\n doc,\n key\n}: {\n doc: SatelliteDid.Doc;\n key: string;\n}): Promise<Doc<D>> => {\n const {owner, version, description: docDescription, data, ...rest} = doc;\n\n return {\n key,\n description: fromNullable(docDescription),\n owner: owner.toText(),\n data: await fromArray<ExcludeDate<D>>(data),\n version: fromNullable(version),\n ...rest\n };\n};\n", "import {DEFAULT_READ_OPTIONS} from '../../core/constants/call-options.constants';\nimport {getAnyIdentity} from '../../core/services/identity.services';\nimport type {ReadOptions} from '../../core/types/call-options';\nimport type {ListParams, ListResults} from '../../core/types/list';\nimport type {SatelliteOptions} from '../../core/types/satellite';\nimport {\n countDocs as countDocsApi,\n deleteDoc as deleteDocApi,\n deleteFilteredDocs as deleteFilteredDocsApi,\n deleteManyDocs as deleteManyDocsApi,\n getDoc as getDocApi,\n getManyDocs as getManyDocsApi,\n listDocs as listDocsApi,\n setDoc as setDocApi,\n setManyDocs as setManyDocsApi\n} from '../api/doc.api';\nimport type {Doc} from '../types/doc';\n\n/**\n * Retrieves a single document from a collection.\n *\n * @template D\n * @param {Object} params - The parameters for retrieving the document.\n * @param {string} params.collection - The name of the collection.\n * @param {string} params.key - The key of the document to retrieve.\n * @param {ReadOptions} [params.options] - Call options controlling certification. Defaults to uncertified reads for performance unless specified.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<Doc<D> | undefined>} A promise that resolves to the document or undefined if not found.\n */\nexport const getDoc = async <D>({\n satellite,\n options,\n ...rest\n}: {\n collection: string;\n satellite?: SatelliteOptions;\n options?: ReadOptions;\n} & Pick<Doc<D>, 'key'>): Promise<Doc<D> | undefined> => {\n const identity = getAnyIdentity(satellite?.identity);\n\n return await getDocApi({\n ...rest,\n satellite: {...satellite, identity},\n options: options ?? DEFAULT_READ_OPTIONS\n });\n};\n\n/**\n * Retrieves multiple documents from a single or different collections in a single call.\n *\n * @param {Object} params - The parameters for retrieving the documents.\n * @param {Array} params.docs - The list of documents with their collections and keys.\n * @param {ReadOptions} [params.options] - Call options controlling certification. Defaults to uncertified reads for performance unless specified.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<Array<Doc<any> | undefined>>} A promise that resolves to an array of documents or undefined if not found.\n */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const getManyDocs = async ({\n satellite,\n options,\n ...rest\n}: {\n docs: ({collection: string} & Pick<Doc<any>, 'key'>)[];\n satellite?: SatelliteOptions;\n options?: ReadOptions;\n}): Promise<(Doc<any> | undefined)[]> => {\n const identity = getAnyIdentity(satellite?.identity);\n\n return await getManyDocsApi({\n ...rest,\n satellite: {...satellite, identity},\n options: options ?? DEFAULT_READ_OPTIONS\n });\n};\n/* eslint-enable */\n\n/**\n * Adds or updates a single document in a collection.\n *\n * @template D\n * @param {Object} params - The parameters for adding or updating the document.\n * @param {string} params.collection - The name of the collection.\n * @param {Doc<D>} params.doc - The document to add or update.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<Doc<D>>} A promise that resolves to the added or updated document.\n */\nexport const setDoc = async <D>({\n satellite,\n ...rest\n}: {\n collection: string;\n doc: Doc<D>;\n satellite?: SatelliteOptions;\n}): Promise<Doc<D>> => {\n const identity = getAnyIdentity(satellite?.identity);\n\n return await setDocApi({\n ...rest,\n satellite: {...satellite, identity},\n options: {certified: true}\n });\n};\n\n/**\n * Adds or updates multiple documents in a or different collections.\n *\n * @param {Object} params - The parameters for adding or updating the documents.\n * @param {Array} params.docs - The list of documents with their collections and data.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<Array<Doc<any>>>} A promise that resolves to an array of added or updated documents.\n */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const setManyDocs = async ({\n satellite,\n ...rest\n}: {\n docs: {collection: string; doc: Doc<any>}[];\n satellite?: SatelliteOptions;\n}): Promise<Doc<any>[]> => {\n const identity = getAnyIdentity(satellite?.identity);\n\n return await setManyDocsApi({\n ...rest,\n satellite: {...satellite, identity},\n options: {certified: true}\n });\n};\n/* eslint-enable */\n\n/**\n * Deletes a single document from a collection.\n *\n * @template D\n * @param {Object} params - The parameters for deleting the document.\n * @param {string} params.collection - The name of the collection.\n * @param {Doc<D>} params.doc - The document to delete.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<void>} A promise that resolves when the document is deleted.\n */\nexport const deleteDoc = async <D>({\n satellite,\n ...rest\n}: {\n collection: string;\n doc: Doc<D>;\n satellite?: SatelliteOptions;\n}): Promise<void> => {\n const identity = getAnyIdentity(satellite?.identity);\n\n return await deleteDocApi({\n ...rest,\n satellite: {...satellite, identity},\n options: {certified: true}\n });\n};\n\n/**\n * Deletes multiple documents from a or different collections.\n *\n * @param {Object} params - The parameters for deleting the documents.\n * @param {Array} params.docs - The list of documents with their collections and data.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<void>} A promise that resolves when the documents are deleted.\n */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const deleteManyDocs = async ({\n satellite,\n ...rest\n}: {\n docs: {collection: string; doc: Doc<any>}[];\n satellite?: SatelliteOptions;\n}): Promise<void> => {\n const identity = getAnyIdentity(satellite?.identity);\n\n return await deleteManyDocsApi({\n ...rest,\n satellite: {...satellite, identity},\n options: {certified: true}\n });\n};\n/* eslint-enable */\n\n/**\n * Deletes documents from a collection with optional filtering.\n *\n * @param {Object} params - The parameters for deleting documents.\n * @param {string} params.collection - The name of the collection.\n * @param {ListParams} [params.filter] - The filter criteria to match documents for deletion.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<void>} A promise that resolves when the documents are deleted.\n */\nexport const deleteFilteredDocs = async ({\n satellite,\n filter,\n ...rest\n}: {\n collection: string;\n filter?: ListParams;\n satellite?: SatelliteOptions;\n}): Promise<void> => {\n const identity = getAnyIdentity(satellite?.identity);\n\n return await deleteFilteredDocsApi({\n ...rest,\n filter: filter ?? {},\n satellite: {...satellite, identity},\n options: {certified: true}\n });\n};\n\n/**\n * Lists documents in a collection with optional filtering.\n *\n * @template D\n * @param {Object} params - The parameters for listing the documents.\n * @param {string} params.collection - The name of the collection.\n * @param {ListParams} [params.filter] - Optional filter parameters.\n * @param {ReadOptions} [params.options] - Call options controlling certification. Defaults to uncertified reads for performance unless specified.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<ListResults<Doc<D>>>} A promise that resolves to the list of documents.\n */\nexport const listDocs = async <D>({\n satellite,\n options,\n filter,\n ...rest\n}: {\n collection: string;\n filter?: ListParams;\n satellite?: SatelliteOptions;\n options?: ReadOptions;\n}): Promise<ListResults<Doc<D>>> => {\n const identity = getAnyIdentity(satellite?.identity);\n\n return await listDocsApi<D>({\n ...rest,\n filter: filter ?? {},\n satellite: {...satellite, identity},\n options: options ?? DEFAULT_READ_OPTIONS\n });\n};\n\n/**\n * Counts documents in a collection with optional filtering.\n *\n * @param {Object} params - The parameters for counting the documents.\n * @param {string} params.collection - The name of the collection.\n * @param {ListParams} [params.filter] - Optional filter parameters.\n * @param {ReadOptions} [params.options] - Call options controlling certification. Defaults to uncertified reads for performance unless specified.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<bigint>} A promise that resolves to the count of documents as a bigint.\n */\nexport const countDocs = async ({\n satellite,\n options,\n filter,\n ...rest\n}: {\n collection: string;\n filter?: ListParams;\n satellite?: SatelliteOptions;\n options?: ReadOptions;\n}): Promise<bigint> => {\n const identity = getAnyIdentity(satellite?.identity);\n\n return await countDocsApi({\n ...rest,\n filter: filter ?? {},\n satellite: {...satellite, identity},\n options: options ?? DEFAULT_READ_OPTIONS\n });\n};\n", "import type {Identity} from '@dfinity/agent';\nimport {arrayBufferToUint8Array, nonNullish, uint8ArrayToArrayOfNumber} from '@dfinity/utils';\nimport type {WebAuthnIdentity, WebAuthnNewCredential} from '@junobuild/ic-client/webauthn';\nimport type {Environment} from '../../core/types/env';\nimport {setManyDocs} from '../../datastore/services/doc.services';\nimport type {User} from '../types/user';\n\nexport const createWebAuthnUser = async ({\n delegationIdentity,\n passkeyIdentity,\n satelliteId\n}: {\n delegationIdentity: Identity;\n passkeyIdentity: WebAuthnIdentity<WebAuthnNewCredential>;\n} & Pick<Environment, 'satelliteId'>): Promise<User> => {\n // We serialize the AAGUID as number[] instead of Uint8Array because\n // it results in slightly smaller JSON output with the stringifier.\n // When reading the data, we support both formats.\n const aaguid = passkeyIdentity.getCredential().getAAGUID();\n\n const [user, _] = await setManyDocs({\n docs: [\n {\n collection: '#user',\n doc: {\n key: delegationIdentity.getPrincipal().toText(),\n data: {\n provider: 'webauthn',\n providerData: {\n webauthn: {\n ...(nonNullish(aaguid) && {aaguid: uint8ArrayToArrayOfNumber(aaguid)})\n }\n }\n }\n }\n },\n {\n collection: '#user-webauthn',\n doc: {\n key: passkeyIdentity.getCredential().getCredentialIdText(),\n data: {\n publicKey: arrayBufferToUint8Array(passkeyIdentity.getPublicKey().toDer())\n }\n }\n }\n ],\n satellite: {\n identity: delegationIdentity,\n satelliteId\n }\n });\n\n return user;\n};\n", "import type {CreatePasskeyOptions} from '@junobuild/ic-client/webauthn';\nimport type {SignProgressFn} from './progress';\n\n/**\n * Enum representing the different steps of the WebAuthn sign-in flow.\n */\nexport enum WebAuthnSignInProgressStep {\n /** Requesting a passkey (credential) from the user */\n RequestingUserCredential,\n /** Validating and finalizing the credential provided by the user */\n FinalizingCredential,\n /** Signing the authentication challenge with the user's credential */\n Signing,\n /** Completing the session setup after signing */\n FinalizingSession,\n /** Retrieving the authenticated user information */\n RetrievingUser\n}\n\n/**\n * Enum representing the different steps of the WebAuthn sign-up (registration) flow.\n */\nexport enum WebAuthnSignUpProgressStep {\n /** Creating a new passkey (credential) for the user */\n CreatingUserCredential,\n /** Validating the created credential */\n ValidatingUserCredential,\n /** Finalizing the credential for use */\n FinalizingCredential,\n /** Signing the registration challenge. Requires the user to interact again with the authenticator for confirmation. */\n Signing,\n /** Completing the session setup after signing */\n FinalizingSession,\n /** Registering the new user in the system */\n RegisteringUser\n}\n\n/**\n * Interface representing common sign-in and sing-up options when using a WebAuthn (passkey) based provider.\n * @interface WebAuthnSignOptions\n */\nexport interface WebAuthnSignOptions {\n /**\n * Maximum time to live for the session in milliseconds. Cannot be extended.\n * @type {number}\n */\n maxTimeToLiveInMilliseconds?: number;\n}\n\n/**\n * Interface representing sign-in options when using a WebAuthn (passkey) based provider.\n * @interface WebAuthnSignInOptions\n */\nexport interface WebAuthnSignInOptions extends WebAuthnSignOptions {\n /**\n * Optional callback to receive progress updates about the sign-in flow.\n * Useful for showing UI feedback such as loading indicators or status messages.\n */\n onProgress?: SignProgressFn<WebAuthnSignInProgressStep>;\n}\n\n/**\n * Interface representing sign-up options when using a WebAuthn (passkey) based provider.\n * @interface WebAuthnSignUpSessionOptions\n */\nexport interface WebAuthnSignUpOptions extends WebAuthnSignOptions {\n /**\n * Optional callback to receive progress updates about the sign-up flow.\n * Useful for showing UI feedback such as loading indicators or status messages.\n */\n onProgress?: SignProgressFn<WebAuthnSignUpProgressStep>;\n\n /**\n * Options for creating the passkey credential.\n *\n * For example, you can provide a user-friendly display name so the passkey\n * is easier to recognize later.\n */\n passkey?: CreatePasskeyOptions;\n}\n", "import {AuthClient, IdbStorage, KEY_STORAGE_KEY} from '@dfinity/auth-client';\n\nexport const createAuthClient = (): Promise<AuthClient> =>\n AuthClient.create({\n idleOptions: {\n disableIdle: true,\n disableDefaultIdleCallback: true\n }\n });\n\nexport const resetAuthClient = async (): Promise<AuthClient> => {\n // Since AgentJS persists the identity key in IndexedDB by default,\n // it can be tampered with and affect the next login with Internet Identity or NFID.\n // To ensure each session starts clean and safe, we clear the stored keys before creating a new AuthClient\n // in case the user is not authenticated.\n const storage = new IdbStorage();\n await storage.remove(KEY_STORAGE_KEY);\n\n return await createAuthClient();\n};\n", "import {isNullish, nonNullish} from '@dfinity/utils';\nimport {isSatelliteError, JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE} from '@junobuild/errors';\nimport {getDoc, setDoc} from '../../datastore/services/doc.services';\nimport {InitError} from '../types/errors';\nimport type {Provider} from '../types/provider';\nimport type {User, UserData} from '../types/user';\nimport {getIdentity} from './auth.services';\n\ntype UserId = string;\n\nexport const initUser = async ({provider}: {provider: Provider}): Promise<User> => {\n const {user, userId} = await loadUser();\n\n // For returning users we do not need to create a user entry.\n // Sign-in, sign-out, and sign-in again.\n if (nonNullish(user)) {\n return user;\n }\n\n try {\n return await createUser({userId, provider});\n } catch (error: unknown) {\n // It's unlikely, but since updating a user is restricted to the controller,\n // we want to guard against a rare race condition where a user attempts\n // to create a user entry that already exists. In such a case, instead of\n // throwing, we retry loading the user data. If that succeeds, it provides\n // a more graceful UX.\n //\n // With the new flow introduced in core library v2, this scenario should\n // never occur, but the handling remains given it was already implemented\n // with the earlier flow where user creation could happen during init.\n if (isSatelliteError({error, type: JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE})) {\n const userOnCreateError = await getUser({userId});\n\n if (nonNullish(userOnCreateError)) {\n return userOnCreateError;\n }\n }\n\n throw error;\n }\n};\n\nexport const loadUser = async (): Promise<{userId: UserId; user: User | undefined}> => {\n const identity = getIdentity();\n\n if (isNullish(identity)) {\n throw new InitError('No identity to initialize the user. Have you initialized Juno?');\n }\n\n const userId = identity.getPrincipal().toText();\n\n const user = await getUser({userId});\n\n return {\n userId,\n user\n };\n};\n\nconst getUser = ({userId}: {userId: UserId}): Promise<User | undefined> =>\n getDoc<UserData>({\n collection: `#user`,\n key: userId\n });\n\nconst createUser = ({\n userId,\n ...rest\n}: {\n userId: string;\n} & UserData): Promise<User> =>\n setDoc<UserData>({\n collection: `#user`,\n doc: {\n key: userId,\n data: rest\n }\n });\n", "export const isSatelliteError = ({error, type}: {error: unknown; type: string}): boolean => {\n if (typeof error === 'string') {\n return error.includes(type);\n }\n\n if (error instanceof Error) {\n return error.message.includes(type);\n }\n\n return false;\n};\n", "export const JUNO_CDN_PROPOSALS_ERROR_CANNOT_SUBMIT = 'juno.cdn.proposals.error.cannot_submit';\nexport const JUNO_CDN_PROPOSALS_ERROR_CANNOT_SUBMIT_INVALID_STATUS =\n 'juno.cdn.proposals.error.cannot_submit_invalid_status';\n\nexport const JUNO_CDN_PROPOSALS_ERROR_CANNOT_REJECT = 'juno.cdn.proposals.error.cannot_reject';\nexport const JUNO_CDN_PROPOSALS_ERROR_CANNOT_REJECT_INVALID_STATUS =\n 'juno.cdn.proposals.error.cannot_reject_invalid_status';\n\nexport const JUNO_CDN_PROPOSALS_ERROR_CANNOT_COMMIT = 'juno.cdn.proposals.error.cannot_commit';\nexport const JUNO_CDN_PROPOSALS_ERROR_CANNOT_COMMIT_INVALID_STATUS =\n 'juno.cdn.proposals.error.cannot_commit_invalid_status';\n\nexport const JUNO_CDN_PROPOSALS_ERROR_INVALID_HASH = 'juno.cdn.proposals.error.invalid_hash';\n\nexport const JUNO_CDN_PROPOSALS_ERROR_UNKNOWN_TYPE = 'juno.cdn.proposals.error.unknown_type';\n\nexport const JUNO_CDN_PROPOSALS_ERROR_EMPTY_CONTENT_CHUNKS =\n 'juno.cdn.proposals.error.empty_content_chunks';\nexport const JUNO_CDN_PROPOSALS_ERROR_NOT_CONTENT_CHUNKS_AT_INDEX =\n 'juno.cdn.proposals.error.no_content_chunks_at_index';\n\nexport const JUNO_CDN_PROPOSALS_ERROR_EMPTY_ASSETS = 'juno.cdn.proposals.error.empty_assets';\nexport const JUNO_CDN_PROPOSALS_ERROR_CANNOT_DELETE_ASSETS =\n 'juno.cdn.proposals.error.cannot_delete_assets';\nexport const JUNO_CDN_PROPOSALS_ERROR_CANNOT_DELETE_ASSETS_INVALID_STATUS =\n 'juno.cdn.proposals.error.cannot_delete_assets_invalid_status';\n\nexport const JUNO_CDN_PROPOSALS_ERROR_NEXT_ID_CONVERT = 'juno.cdn.proposals.error.next_id_convert';\nexport const JUNO_CDN_PROPOSALS_ERROR_NEXT_ID_OVERFLOW =\n 'juno.cdn.proposals.error.next_id_overflow';\n\nexport const JUNO_CDN_STORAGE_ERROR_CANNOT_INSERT_ASSET_UNKNOWN_REFERENCE_ID =\n 'juno.cdn.storage.error.cannot_insert_asset_unknown_reference_id';\nexport const JUNO_CDN_STORAGE_ERROR_CANNOT_GET_ASSET_UNKNOWN_REFERENCE_ID =\n 'juno.cdn.storage.error.cannot_get_asset_unknown_reference_id';\nexport const JUNO_CDN_STORAGE_ERROR_CANNOT_INSERT_ASSET_ENCODING_UNKNOWN_REFERENCE_ID =\n 'juno.cdn.storage.error.cannot_insert_asset_encoding_unknown_reference_id';\n\nexport const JUNO_CDN_STORAGE_ERROR_NO_PROPOSAL_FOUND = 'juno.cdn.storage.error.no_proposal_found';\n\nexport const JUNO_CDN_STORAGE_ERROR_INVALID_RELEASES_PATH =\n 'juno.cdn.storage.error.invalid_releases_path';\n\nexport const JUNO_CDN_STORAGE_ERROR_MISSING_RELEASES_DESCRIPTION =\n 'juno.cdn.storage.error.missing_releases_description';\n\nexport const JUNO_CDN_STORAGE_ERROR_INVALID_RELEASES_DESCRIPTION =\n 'juno.cdn.storage.error.invalid_releases_description';\n\nexport const JUNO_CDN_STORAGE_ERROR_INVALID_COLLECTION =\n 'juno.cdn.storage.error.invalid_collection';\n", "export const JUNO_COLLECTIONS_ERROR_MODIFY_RESERVED_COLLECTION =\n 'juno.collections.error.modify_reserved_collection';\nexport const JUNO_COLLECTIONS_ERROR_RESERVED_NAME = 'juno.collections.error.reserved_name';\nexport const JUNO_COLLECTIONS_ERROR_RESERVED_COLLECTION =\n 'juno.collections.error.reserved_collection';\nexport const JUNO_COLLECTIONS_ERROR_RATE_CONFIG_ENABLED =\n 'juno.collections.error.rate_config_enabled';\nexport const JUNO_COLLECTIONS_ERROR_DELETE_PREFIX_RESERVED =\n 'juno.collections.error.prefix_deletion';\nexport const JUNO_COLLECTIONS_ERROR_COLLECTION_NOT_EMPTY = 'juno.collections.error.not_empty';\nexport const JUNO_COLLECTIONS_ERROR_COLLECTION_NOT_FOUND = 'juno.collections.error.not_found';\nexport const JUNO_COLLECTIONS_ERROR_PREFIX_RESERVED = 'juno.collections.error.prefix_reserved';\n", "export const JUNO_ERROR_NO_TIMESTAMP_PROVIDED = 'juno.error.no_timestamp_provided';\nexport const JUNO_ERROR_TIMESTAMP_OUTDATED_OR_FUTURE = 'juno.error.timestamp_outdated_or_future';\nexport const JUNO_ERROR_NO_VERSION_PROVIDED = 'juno.error.no_version_provided';\nexport const JUNO_ERROR_VERSION_OUTDATED_OR_FUTURE = 'juno.error.version_outdated_or_future';\n\nexport const JUNO_DATASTORE_ERROR_CANNOT_WRITE = 'juno.datastore.error.cannot_write';\nexport const JUNO_DATASTORE_ERROR_CANNOT_READ = 'juno.datastore.error.cannot_read';\n\nexport const JUNO_STORAGE_ERROR_UPLOAD_NOT_ALLOWED = 'juno.storage.error.upload_not_allowed';\nexport const JUNO_STORAGE_ERROR_SET_NOT_ALLOWED = 'juno.storage.error.set_not_allowed';\nexport const JUNO_STORAGE_ERROR_CANNOT_COMMIT_INVALID_COLLECTION =\n 'juno.storage.error.cannot_commit_invalid_collection';\nexport const JUNO_STORAGE_ERROR_CANNOT_COMMIT_BATCH = 'juno.storage.error.cannot_commit_batch';\nexport const JUNO_STORAGE_ERROR_ASSET_NOT_FOUND = 'juno.storage.error.asset_not_found';\nexport const JUNO_STORAGE_ERROR_CANNOT_READ_ASSET = 'juno.storage.error.cannot_read_asset';\nexport const JUNO_STORAGE_ERROR_UPLOAD_PATH_COLLECTION_PREFIX =\n 'juno.storage.error.upload_path_collection_prefix';\nexport const JUNO_STORAGE_ERROR_RESERVED_ASSET = 'juno.storage.error.reserved_asset';\nexport const JUNO_STORAGE_ERROR_BATCH_NOT_FOUND = 'juno.storage.error.batch_not_found';\nexport const JUNO_STORAGE_ERROR_CHUNK_NOT_FOUND = 'juno.storage.error.chunk_not_found';\nexport const JUNO_STORAGE_ERROR_CHUNK_NOT_INCLUDED_IN_BATCH =\n 'juno.storage.error.chunk_not_included_in_batch';\nexport const JUNO_STORAGE_ERROR_CHUNK_TO_COMMIT_NOT_FOUND =\n 'juno.storage.error.chunk_to_commit_not_found';\nexport const JUNO_STORAGE_ERROR_ASSET_MAX_ALLOWED_SIZE =\n 'juno.storage.error.asset_max_allowed_size';\n\nexport const JUNO_AUTH_ERROR_NOT_ADMIN_CONTROLLER = 'juno.auth.error.not_admin_controller';\nexport const JUNO_AUTH_ERROR_INVALID_ORIGIN = 'juno.auth.error.invalid_origin';\nexport const JUNO_AUTH_ERROR_NOT_WRITE_CONTROLLER = 'juno.auth.error.not_write_controller';\nexport const JUNO_AUTH_ERROR_NOT_CONTROLLER = 'juno.auth.error.not_controller';\nexport const JUNO_AUTH_ERROR_CALLER_NOT_ALLOWED = 'juno.auth.error.caller.not_allowed';\n\nexport const JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE = 'juno.datastore.error.user.cannot_update';\nexport const JUNO_DATASTORE_ERROR_USER_INVALID_DATA = 'juno.datastore.error.user.invalid_data';\nexport const JUNO_DATASTORE_ERROR_USER_CALLER_KEY = 'juno.datastore.error.user.caller_key';\nexport const JUNO_DATASTORE_ERROR_USER_KEY_NO_PRINCIPAL =\n 'juno.datastore.error.user.key_no_principal';\nexport const JUNO_DATASTORE_ERROR_USER_NOT_ALLOWED = 'juno.datastore.error.user.not_allowed';\nexport const JUNO_DATASTORE_ERROR_USER_AAGUID_INVALID_LENGTH =\n 'juno.datastore.error.user.webauthn.aaguid_invalid_length';\nexport const JUNO_DATASTORE_ERROR_USER_PROVIDER_INVALID_DATA =\n 'juno.datastore.error.user.webauthn.provider_invalid_data';\nexport const JUNO_DATASTORE_ERROR_USER_PROVIDER_WEBAUTHN_INVALID_DATA =\n 'juno.datastore.error.user.webauthn.provider_webauthn_invalid_data';\n\nexport const JUNO_DATASTORE_ERROR_USER_USAGE_CHANGE_LIMIT_REACHED =\n 'juno.datastore.error.user.usage.change_limit_reached';\nexport const JUNO_DATASTORE_ERROR_USER_USAGE_INVALID_DATA =\n 'juno.datastore.error.user.usage.invalid_data';\n\nexport const JUNO_DATASTORE_ERROR_USER_WEBAUTHN_CANNOT_UPDATE =\n 'juno.datastore.error.user.webauthn.cannot_update';\nexport const JUNO_DATASTORE_ERROR_USER_WEBAUTHN_INVALID_DATA =\n 'juno.datastore.error.user.webauthn.invalid_data';\nexport const JUNO_DATASTORE_ERROR_USER_WEBAUTHN_CALLER_KEY =\n 'juno.datastore.error.user.webauthn.caller_key';\n", "export const JUNO_ERROR_CONTROLLERS_MAX_NUMBER = 'juno.error.controllers.max_number';\nexport const JUNO_ERROR_CONTROLLERS_ANONYMOUS_NOT_ALLOWED =\n 'juno.error.controllers.anonymous_not_allowed';\nexport const JUNO_ERROR_CONTROLLERS_REVOKED_NOT_ALLOWED =\n 'juno.error.controllers.revoked_not_allowed';\n\nexport const JUNO_ERROR_MEMORY_STABLE_EXCEEDED = 'juno.error.memory.stable_exceeded';\nexport const JUNO_ERROR_MEMORY_HEAP_EXCEEDED = 'juno.error.memory.heap_exceeded';\n\nexport const JUNO_ERROR_CYCLES_DEPOSIT_BALANCE_LOW = 'juno.error.cycles.deposit_balance_low';\nexport const JUNO_ERROR_CYCLES_DEPOSIT_FAILED = 'juno.error.cycles.deposit_failed';\n\nexport const JUNO_ERROR_CANISTER_CREATE_FAILED = 'juno.error.canister.create_failed';\nexport const JUNO_ERROR_CANISTER_INSTALL_CODE_FAILED = 'juno.error.canister.install_code_failed';\n\nexport const JUNO_ERROR_SEGMENT_STOP_FAILED = 'juno.error.segment.stop_failed';\nexport const JUNO_ERROR_SEGMENT_DELETE_FAILED = 'juno.error.segment.delete_failed';\n\nexport const JUNO_ERROR_CMC_CALL_LEDGER_FAILED = 'juno.error.cmc.call_ledger_failed';\nexport const JUNO_ERROR_CMC_LEDGER_TRANSFER_FAILED = 'juno.error.cmc.ledger_transfer_failed';\nexport const JUNO_ERROR_CMC_TOP_UP_FAILED = 'juno.error.cmc.top_up_failed';\nexport const JUNO_ERROR_CMC_CALL_CREATE_CANISTER_FAILED =\n 'juno.error.cmc.call_create_canister_failed';\nexport const JUNO_ERROR_CMC_CREATE_CANISTER_FAILED = 'juno.error.cmc.create_canister_failed';\nexport const JUNO_ERROR_CMC_INSTALL_CODE_FAILED = 'juno.error.cmc.install_code_failed';\n\nexport const JUNO_ERROR_INVALID_REGEX = 'juno.error.invalid_regex';\n", "// TODO: duplicated because those should not be bundled in web worker. We can avoid this by transforming utils into a library of modules.\ninterface ImportMeta {\n env: Record<string, string> | undefined;\n}\n\nexport const envSatelliteId = (): string | undefined => {\n const viteEnvSatelliteId = (): string | undefined =>\n typeof import.meta !== 'undefined' &&\n typeof (import.meta as unknown as ImportMeta).env !== 'undefined'\n ? ((import.meta as unknown as ImportMeta).env?.VITE_SATELLITE_ID ??\n (import.meta as unknown as ImportMeta).env?.PUBLIC_SATELLITE_ID)\n : undefined;\n\n return typeof process !== 'undefined'\n ? (process.env?.NEXT_PUBLIC_SATELLITE_ID ?? viteEnvSatelliteId())\n : viteEnvSatelliteId();\n};\n\nexport const envContainer = (): string | undefined => {\n const viteEnvContainer = (): string | undefined =>\n typeof import.meta !== 'undefined' &&\n typeof (import.meta as unknown as ImportMeta).env !== 'undefined'\n ? ((import.meta as unknown as ImportMeta).env?.VITE_CONTAINER ??\n (import.meta as unknown as ImportMeta).env?.PUBLIC_CONTAINER)\n : undefined;\n\n return typeof process !== 'undefined'\n ? (process.env?.NEXT_PUBLIC_CONTAINER ?? viteEnvContainer())\n : viteEnvContainer();\n};\n", "import type {ActorSubclass} from '@dfinity/agent';\nimport type {ActorMethod} from '@dfinity/agent/lib/esm/actor';\nimport type {IDL} from '@dfinity/candid';\nimport {getSatelliteExtendedActor as getSatelliteExtendedActorApi} from '../../core/api/actor.api';\nimport {getAnyIdentity} from '../../core/services/identity.services';\nimport type {SatelliteOptions} from '../../core/types/satellite';\n\n/**\n * Returns an extended satellite actor instance using the provided IDL factory and satellite options.\n *\n * This function is intended for advanced use cases where developers have implemented\n * custom endpoints in their serverless functions using the extended build type.\n *\n * In most cases, developers should not need to call this directly.\n * Extended actors are typically mapped and handled automatically.\n *\n * @template T - The actor interface type.\n *\n * @param {Object} params - The parameters for creating the actor.\n * @param {IDL.InterfaceFactory} params.idlFactory - The IDL factory defining the custom actor interface.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only.\n * In browser environments, configuration is automatically inherited from `initSatellite()`.\n *\n * @returns {Promise<ActorSubclass<T>>} A promise that resolves to the extended actor instance.\n */\nexport const getSatelliteExtendedActor = async <T = Record<string, ActorMethod>>({\n idlFactory,\n satellite\n}: {\n idlFactory: IDL.InterfaceFactory;\n satellite?: SatelliteOptions;\n}): Promise<ActorSubclass<T>> => {\n const identity = getAnyIdentity(satellite?.identity);\n\n return await getSatelliteExtendedActorApi({\n idlFactory,\n ...satellite,\n identity\n });\n};\n", "import {fromNullable, nonNullish} from '@dfinity/utils';\nimport type {SatelliteDid} from '@junobuild/ic-client/actor';\nimport type {Asset, AssetEncoding, AssetKey, Storage} from '@junobuild/storage';\nimport {DEFAULT_READ_OPTIONS} from '../../core/constants/call-options.constants';\nimport {getAnyIdentity} from '../../core/services/identity.services';\nimport type {ReadOptions} from '../../core/types/call-options';\nimport type {ListParams} from '../../core/types/list';\nimport type {SatelliteOptions} from '../../core/types/satellite';\nimport {satelliteUrl} from '../../core/utils/env.utils';\nimport {\n countAssets as countAssetsApi,\n deleteAsset as deleteAssetApi,\n deleteFilteredAssets as deleteFilteredAssetsApi,\n deleteManyAssets as deleteManyAssetsApi,\n getAsset as getAssetApi,\n getManyAssets as getManyAssetsApi,\n listAssets as listAssetsApi,\n uploadAsset as uploadAssetApi\n} from '../api/storage.api';\nimport type {Assets} from '../types/storage';\nimport {sha256ToBase64String} from '../utils/crypto.utils';\n\n/**\n * Uploads a blob to the storage.\n *\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<AssetKey>} A promise that resolves to the asset key.\n */\nexport const uploadBlob = (params: Storage & {satellite?: SatelliteOptions}): Promise<AssetKey> =>\n uploadAssetIC(params);\n\n/**\n * Uploads a file to the storage.\n *\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<AssetKey>} A promise that resolves to the asset key.\n */\nexport const uploadFile = (\n params: Partial<Pick<Storage, 'filename'>> &\n Omit<Storage, 'filename' | 'data'> & {data: File} & {satellite?: SatelliteOptions}\n): Promise<AssetKey> =>\n uploadAssetIC({\n filename: params.data.name,\n ...params\n });\n\nconst uploadAssetIC = async ({\n filename: storageFilename,\n data,\n collection,\n headers = [],\n fullPath: storagePath,\n token,\n satellite: satelliteOptions,\n encoding,\n description\n}: Storage & {satellite?: SatelliteOptions}): Promise<AssetKey> => {\n const identity = getAnyIdentity(satelliteOptions?.identity);\n\n // The IC certification does not currently support encoding\n const filename: string = decodeURI(storageFilename);\n const fullPath: string = storagePath ?? `/${collection}/${filename}`;\n\n const satellite = {...satelliteOptions, identity};\n\n await uploadAssetApi({\n asset: {\n data,\n filename,\n collection,\n token,\n headers,\n fullPath,\n encoding,\n description\n },\n satellite,\n options: {certified: true}\n });\n\n return {\n downloadUrl: downloadUrl({\n satellite,\n assetKey: {\n fullPath,\n token\n }\n }),\n fullPath,\n name: filename\n };\n};\n\n/**\n * Lists assets in a collection with optional filtering.\n *\n * @param {Object} params - The parameters for listing the assets.\n * @param {string} params.collection - The name of the collection.\n * @param {ListParams} [params.filter] - The filter parameters.\n * @param {ReadOptions} [params.options] - Call options controlling certification. Defaults to uncertified reads for performance unless specified.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<Assets>} A promise that resolves to the list of assets.\n */\nexport const listAssets = async ({\n collection,\n filter,\n satellite: satelliteOptions,\n options\n}: {\n collection: string;\n filter?: ListParams;\n satellite?: SatelliteOptions;\n options?: ReadOptions;\n}): Promise<Assets> => {\n const satellite = {...satelliteOptions, identity: getAnyIdentity(satelliteOptions?.identity)};\n\n const {items, ...rest} = await listAssetsApi({\n collection,\n filter: filter ?? {},\n satellite,\n options: options ?? DEFAULT_READ_OPTIONS\n });\n\n const assets = items.map(\n ({\n key: {full_path: fullPath, token: t, name, owner, description},\n headers,\n encodings,\n created_at,\n updated_at\n }: SatelliteDid.AssetNoContent) => {\n const token = fromNullable(t);\n\n return {\n fullPath,\n description: fromNullable(description),\n name,\n downloadUrl: downloadUrl({\n satellite,\n assetKey: {fullPath, token}\n }),\n token,\n headers,\n encodings: encodings.reduce<Record<string, AssetEncoding>>(\n (acc, [type, {modified, sha256, total_length}]) => ({\n ...acc,\n [type]: {\n modified,\n sha256: sha256ToBase64String(sha256),\n total_length\n }\n }),\n {}\n ),\n owner: owner.toText(),\n created_at,\n updated_at\n } as Asset;\n }\n );\n\n return {\n items: assets,\n assets,\n ...rest\n };\n};\n\n/**\n * Counts assets in a collection with optional filtering.\n *\n * @param {Object} params - The parameters for counting the assets.\n * @param {string} params.collection - The name of the collection.\n * @param {ListParams} [params.filter] - The filter parameters for narrowing down the count.\n * @param {ReadOptions} [params.options] - Call options controlling certification. Defaults to uncertified reads for performance unless specified.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<bigint>} A promise that resolves to the count of assets as a bigint.\n */\nexport const countAssets = async ({\n collection,\n filter,\n satellite: satelliteOptions,\n options\n}: {\n collection: string;\n filter?: ListParams;\n satellite?: SatelliteOptions;\n options?: ReadOptions;\n}): Promise<bigint> => {\n const satellite = {...satelliteOptions, identity: getAnyIdentity(satelliteOptions?.identity)};\n\n return await countAssetsApi({\n collection,\n satellite,\n filter: filter ?? {},\n options: options ?? DEFAULT_READ_OPTIONS\n });\n};\n\n/**\n * Deletes an asset from the storage.\n *\n * @param {Object} params - The parameters for deleting the asset.\n * @param {string} params.collection - The name of the collection.\n * @param {string} params.fullPath - The full path of the asset.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<void>} A promise that resolves when the asset is deleted.\n */\nexport const deleteAsset = ({\n collection,\n fullPath,\n satellite\n}: {\n collection: string;\n satellite?: SatelliteOptions;\n} & Pick<AssetKey, 'fullPath'>): Promise<void> =>\n deleteAssetApi({\n collection,\n fullPath,\n satellite: {...satellite, identity: getAnyIdentity(satellite?.identity)},\n options: {certified: true}\n });\n\n/**\n * Deletes multiple assets from the storage.\n *\n * @param {Object} params - The parameters for deleting the assets.\n * @param {Array} params.assets - The list of assets with their collections and full paths.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<void>} A promise that resolves when the assets are deleted.\n */\nexport const deleteManyAssets = ({\n assets,\n satellite\n}: {\n assets: ({collection: string} & Pick<AssetKey, 'fullPath'>)[];\n satellite?: SatelliteOptions;\n}): Promise<void> =>\n deleteManyAssetsApi({\n assets,\n satellite: {...satellite, identity: getAnyIdentity(satellite?.identity)},\n options: {certified: true}\n });\n\n/**\n * Deletes multiple assets from a collection based on filtering criteria.\n *\n * @param {Object} params - The parameters for deleting the assets.\n * @param {string} params.collection - The name of the collection from which to delete assets.\n * @param {ListParams} [params.filter] - The filter criteria to match assets for deletion.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<void>} A promise that resolves when the assets matching the filter criteria are deleted.\n */\nexport const deleteFilteredAssets = async ({\n collection,\n satellite: satelliteOptions,\n filter\n}: {\n collection: string;\n satellite?: SatelliteOptions;\n filter?: ListParams;\n}): Promise<void> => {\n const satellite = {...satelliteOptions, identity: getAnyIdentity(satelliteOptions?.identity)};\n\n return await deleteFilteredAssetsApi({\n collection,\n satellite,\n filter: filter ?? {},\n options: {certified: true}\n });\n};\n\n/**\n * Retrieves an asset from the storage.\n *\n * @param {Object} params - The parameters for retrieving the asset.\n * @param {string} params.collection - The name of the collection.\n * @param {string} params.fullPath - The full path of the asset.\n * @param {ReadOptions} [params.options] - Call options controlling certification. Defaults to uncertified reads for performance unless specified.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<AssetNoContent | undefined>} A promise that resolves to the asset or undefined if not found.\n */\nexport const getAsset = async ({\n satellite,\n options,\n ...rest\n}: {\n collection: string;\n satellite?: SatelliteOptions;\n options?: ReadOptions;\n} & Pick<AssetKey, 'fullPath'>): Promise<SatelliteDid.AssetNoContent | undefined> => {\n const identity = getAnyIdentity(satellite?.identity);\n\n return await getAssetApi({\n ...rest,\n satellite: {...satellite, identity},\n options: options ?? DEFAULT_READ_OPTIONS\n });\n};\n\n/**\n * Retrieves multiple assets from the storage.\n *\n * @param {Object} params - The parameters for retrieving the assets.\n * @param {Array} params.assets - The list of assets with their collections and full paths.\n * @param {ReadOptions} [params.options] - Call options controlling certification. Defaults to uncertified reads for performance unless specified.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {Promise<Array<AssetNoContent | undefined>>} A promise that resolves to an array of assets or undefined if not found.\n */\nexport const getManyAssets = async ({\n satellite,\n options,\n ...rest\n}: {\n assets: ({collection: string} & Pick<AssetKey, 'fullPath'>)[];\n satellite?: SatelliteOptions;\n options?: ReadOptions;\n}): Promise<(SatelliteDid.AssetNoContent | undefined)[]> => {\n const identity = getAnyIdentity(satellite?.identity);\n\n return await getManyAssetsApi({\n ...rest,\n satellite: {...satellite, identity},\n options: options ?? DEFAULT_READ_OPTIONS\n });\n};\n\n/**\n * Returns a public URL for accessing a specific asset stored on a Satellite.\n *\n * This URL can be used to:\n * - Open the file directly in a browser\n * - Embed the asset in HTML elements like `<img src=\"...\">`, `<video src=\"...\">`, or `<a href=\"...\">`\n * - Programmatically download or display the asset in your application\n *\n * ### Example\n * ```ts\n * const url = downloadUrl({\n * assetKey: {\n * fullPath: '/images/logo.png',\n * }\n * });\n *\n * // Usage in an <img> tag\n * <img src={url} alt=\"Logo\" />\n * ```\n *\n * @param {Object} params - Parameters for generating the URL.\n * @param {Object} params.assetKey - Identifies the asset to generate the URL for.\n * @param {string} params.assetKey.fullPath - The full path of the asset (e.g., `/folder/file.jpg`).\n * @param {string} [params.assetKey.token] - Optional access token for accessing protected assets.\n * @param {SatelliteOptions} [params.satellite] - Options to specify a satellite in a NodeJS environment only. In browser environments, the satellite configuration is inherited from the initialization through `initSatellite()`.\n * @returns {string} A full URL pointing to the asset.\n */\nexport const downloadUrl = ({\n assetKey: {fullPath, token},\n satellite: satelliteOptions\n}: {\n assetKey: Pick<Asset, 'fullPath' | 'token'>;\n} & {satellite?: SatelliteOptions}): string => {\n const satellite = {...satelliteOptions, identity: getAnyIdentity(satelliteOptions?.identity)};\n\n return `${satelliteUrl(satellite)}${fullPath}${nonNullish(token) ? `?token=${token}` : ''}`;\n};\n", "import {fromNullable} from '@dfinity/utils';\nimport type {SatelliteDid} from '@junobuild/ic-client/actor';\nimport {\n uploadAsset as uploadAssetStorage,\n type AssetKey,\n type UploadAsset\n} from '@junobuild/storage';\nimport {getSatelliteActor} from '../../core/api/actor.api';\nimport type {ActorReadParams, ActorUpdateParams} from '../../core/types/actor';\nimport type {ListParams, ListResults} from '../../core/types/list';\nimport {toListParams} from '../../core/utils/list.utils';\n\nexport const uploadAsset = async ({\n asset,\n ...rest\n}: {asset: UploadAsset} & ActorUpdateParams): Promise<void> => {\n const actor = await getSatelliteActor(rest);\n\n await uploadAssetStorage({\n actor,\n asset\n });\n};\n\nexport const listAssets = async ({\n collection,\n filter,\n ...rest\n}: {\n collection: string;\n filter: ListParams;\n} & ActorReadParams): Promise<ListResults<SatelliteDid.AssetNoContent>> => {\n const {list_assets} = await getSatelliteActor(rest);\n\n const {\n items: assets,\n items_length,\n items_page,\n matches_length,\n matches_pages\n } = await list_assets(collection, toListParams(filter));\n\n return {\n items: assets.map(([_, asset]) => asset),\n items_length,\n items_page: fromNullable(items_page),\n matches_length,\n matches_pages: fromNullable(matches_pages)\n };\n};\n\nexport const countAssets = async ({\n collection,\n filter,\n ...rest\n}: {\n collection: string;\n filter: ListParams;\n} & ActorReadParams): Promise<bigint> => {\n const {count_assets} = await getSatelliteActor(rest);\n\n return count_assets(collection, toListParams(filter));\n};\n\nexport const deleteAsset = async ({\n collection,\n fullPath,\n ...rest\n}: {\n collection: string;\n} & ActorUpdateParams &\n Pick<AssetKey, 'fullPath'>): Promise<void> => {\n const actor = await getSatelliteActor(rest);\n\n return actor.del_asset(collection, fullPath);\n};\n\nexport const deleteManyAssets = async ({\n assets,\n satellite\n}: {\n assets: ({collection: string} & Pick<AssetKey, 'fullPath'>)[];\n} & ActorUpdateParams): Promise<void> => {\n const {del_many_assets} = await getSatelliteActor({satellite, options: {certified: true}});\n\n const payload: [string, string][] = assets.map(({collection, fullPath}) => [\n collection,\n fullPath\n ]);\n\n await del_many_assets(payload);\n};\n\nexport const deleteFilteredAssets = async ({\n collection,\n filter,\n ...rest\n}: {\n collection: string;\n filter: ListParams;\n} & ActorUpdateParams): Promise<void> => {\n const {del_filtered_assets} = await getSatelliteActor(rest);\n\n return del_filtered_assets(collection, toListParams(filter));\n};\n\nexport const getAsset = async ({\n collection,\n fullPath,\n ...rest\n}: {\n collection: string;\n} & ActorReadParams &\n Pick<AssetKey, 'fullPath'>): Promise<SatelliteDid.AssetNoContent | undefined> => {\n const {get_asset} = await getSatelliteActor(rest);\n return fromNullable(await get_asset(collection, fullPath));\n};\n\nexport const getManyAssets = async ({\n assets,\n ...rest\n}: {\n assets: ({collection: string} & Pick<AssetKey, 'fullPath'>)[];\n} & ActorReadParams): Promise<(SatelliteDid.AssetNoContent | undefined)[]> => {\n const {get_many_assets} = await getSatelliteActor(rest);\n\n const payload: [string, string][] = assets.map(({collection, fullPath}) => [\n collection,\n fullPath\n ]);\n\n const resultsAssets = await get_many_assets(payload);\n\n return resultsAssets.map(([_, resultAsset]) => fromNullable(resultAsset));\n};\n", "import {assertNonNullish, toNullable} from '@dfinity/utils';\nimport type {ConsoleDid, SatelliteDid} from '@junobuild/ic-client/actor';\nimport {isBrowser} from '@junobuild/utils';\nimport {UPLOAD_CHUNK_SIZE} from '../constants/upload.constants';\nimport type {EncodingType} from '../types/storage';\nimport type {UploadAsset, UploadParams, UploadWithProposalParams} from '../types/upload';\n\ntype InitAssetKey = SatelliteDid.InitAssetKey | ConsoleDid.InitAssetKey;\ntype UploadChunk = SatelliteDid.UploadChunk | ConsoleDid.UploadChunk;\ntype CommitBatch = SatelliteDid.CommitBatch | ConsoleDid.CommitBatch;\n\nexport const uploadAsset = async ({\n asset: {data, headers, ...restAsset},\n actor,\n progress\n}: {\n asset: UploadAsset;\n} & UploadParams): Promise<void> => {\n const {init_asset_upload, upload_asset_chunk, commit_asset_upload} = actor;\n\n const {batch_id: batchId} = await init_asset_upload(mapInitAssetUploadParams(restAsset));\n\n progress?.onInitiatedBatch();\n\n const {chunkIds} = await uploadChunks({data, uploadFn: upload_asset_chunk, batchId});\n\n progress?.onUploadedFileChunks(restAsset.fullPath);\n\n await commitAsset({\n commitFn: commit_asset_upload,\n batchId,\n data,\n headers,\n chunkIds\n });\n\n progress?.onCommittedBatch();\n};\n\nexport const uploadAssetWithProposal = async ({\n asset: {data, headers, ...restAsset},\n proposalId,\n actor,\n progress\n}: {\n asset: UploadAsset;\n} & UploadWithProposalParams): Promise<void> => {\n const {init_proposal_asset_upload, upload_proposal_asset_chunk, commit_proposal_asset_upload} =\n actor;\n\n progress?.onInitiatedBatch();\n\n const {batch_id: batchId} = await init_proposal_asset_upload(\n mapInitAssetUploadParams(restAsset),\n proposalId\n );\n\n const {chunkIds} = await uploadChunks({data, uploadFn: upload_proposal_asset_chunk, batchId});\n\n progress?.onUploadedFileChunks(restAsset.fullPath);\n\n await commitAsset({\n commitFn: commit_proposal_asset_upload,\n batchId,\n data,\n headers,\n chunkIds\n });\n\n progress?.onCommittedBatch();\n};\n\nexport const uploadAssetsWithProposal = async ({\n assets,\n proposalId,\n actor,\n progress\n}: {\n assets: UploadAsset[];\n} & UploadWithProposalParams): Promise<void> => {\n const {\n init_proposal_many_assets_upload,\n upload_proposal_asset_chunk,\n commit_proposal_many_assets_upload\n } = actor;\n\n const batchIds = await init_proposal_many_assets_upload(\n assets.map(mapInitAssetUploadParams),\n proposalId\n );\n\n progress?.onInitiatedBatch();\n\n const uploadAssetChunk = async ({\n fullPath,\n data,\n headers\n }: UploadAsset): Promise<BatchToCommit> => {\n const initializedBatch = batchIds.find(([batchIdFullPath]) => batchIdFullPath === fullPath);\n\n assertNonNullish(initializedBatch);\n\n const [_, initUpload] = initializedBatch;\n const {batch_id: batchId} = initUpload;\n\n const {chunkIds} = await uploadChunks({data, uploadFn: upload_proposal_asset_chunk, batchId});\n\n progress?.onUploadedFileChunks(fullPath);\n\n return {\n batchId,\n headers,\n chunkIds,\n data\n };\n };\n\n const batchAndChunkIdsToCommit = await Promise.all(assets.map(uploadAssetChunk));\n\n await commit_proposal_many_assets_upload(batchAndChunkIdsToCommit.map(mapCommitBatch));\n\n progress?.onCommittedBatch();\n};\n\nconst mapInitAssetUploadParams = ({\n filename,\n collection,\n token,\n fullPath,\n encoding,\n description\n}: Omit<UploadAsset, 'headers' | 'data'>): InitAssetKey => ({\n collection,\n full_path: fullPath,\n name: filename,\n token: toNullable<string>(token),\n encoding_type: toNullable<EncodingType>(encoding),\n description: toNullable(description)\n});\n\ntype BatchToCommit = {\n batchId: bigint;\n chunkIds: UploadChunkResult[];\n} & Pick<UploadAsset, 'headers' | 'data'>;\n\nconst mapCommitBatch = ({batchId, chunkIds, headers, data}: BatchToCommit): CommitBatch => {\n const contentType: [[string, string]] | undefined =\n headers.find(([type, _]) => type.toLowerCase() === 'content-type') === undefined &&\n data.type !== undefined &&\n data.type !== ''\n ? [['Content-Type', data.type]]\n : undefined;\n\n return {\n batch_id: batchId,\n chunk_ids: chunkIds.map(({chunk_id}: UploadChunkResult) => chunk_id),\n headers: [...headers, ...(contentType ?? [])]\n };\n};\n\nconst commitAsset = async ({\n commitFn,\n ...rest\n}: {\n commitFn: (commitBatch: CommitBatch) => Promise<void>;\n batchId: bigint;\n chunkIds: UploadChunkResult[];\n} & Pick<UploadAsset, 'headers' | 'data'>) => {\n const commitBatch = mapCommitBatch(rest);\n await commitFn(commitBatch);\n};\n\nconst uploadChunks = async ({\n data,\n uploadFn,\n batchId\n}: {\n batchId: bigint;\n} & Pick<UploadAsset, 'data'> &\n Pick<UploadChunkParams, 'uploadFn'>): Promise<{chunkIds: UploadChunkResult[]}> => {\n const uploadChunks: UploadChunkParams[] = [];\n\n // Prevent transforming chunk to arrayBuffer error: The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.\n const clone: Blob = isBrowser() ? new Blob([await data.arrayBuffer()]) : data;\n\n // Split data into chunks\n let orderId = 0n;\n for (let start = 0; start < clone.size; start += UPLOAD_CHUNK_SIZE) {\n const chunk: Blob = clone.slice(start, start + UPLOAD_CHUNK_SIZE);\n\n uploadChunks.push({\n batchId,\n chunk,\n uploadFn,\n orderId\n });\n\n orderId++;\n }\n\n // Upload chunks to the IC in batch - i.e. 12 chunks uploaded at a time.\n let chunkIds: UploadChunkResult[] = [];\n for await (const results of batchUploadChunks({uploadChunks})) {\n chunkIds = [...chunkIds, ...results];\n }\n\n return {chunkIds};\n};\n\nasync function* batchUploadChunks({\n uploadChunks,\n limit = 12\n}: {\n uploadChunks: UploadChunkParams[];\n limit?: number;\n}): AsyncGenerator<UploadChunkResult[], void> {\n for (let i = 0; i < uploadChunks.length; i = i + limit) {\n const batch = uploadChunks.slice(i, i + limit);\n const result = await Promise.all(batch.map((params) => uploadChunk(params)));\n yield result;\n }\n}\n\ninterface UploadChunkResult {\n chunk_id: bigint;\n}\n\ninterface UploadChunkParams {\n batchId: bigint;\n chunk: Blob;\n uploadFn: (uploadChunk: UploadChunk) => Promise<UploadChunkResult>;\n orderId: bigint;\n}\n\nconst uploadChunk = async ({\n batchId,\n chunk,\n uploadFn,\n orderId\n}: UploadChunkParams): Promise<UploadChunkResult> =>\n uploadFn({\n batch_id: batchId,\n content: new Uint8Array(await chunk.arrayBuffer()),\n order_id: toNullable(orderId)\n });\n", "export const sha256ToBase64String = (sha256: Iterable<number>): string =>\n btoa([...sha256].map((c) => String.fromCharCode(c)).join(''));\n"],
5
+ "mappings": ";;AAAA,OAAQ,oBAAAA,OAAuB,iBCA/B,OAAQ,6BAAAC,OAAgC,iBCAxC,OAAQ,gBAAAC,GAAc,WAAAC,OAAwC,iBEC9D,OAAQ,sBAAAC,OAAyB,iBEDjC,OAAQ,QAAAC,GAAsC,gBAAAC,OAAmB,iBACjE,OAAQ,2BAAAC,EAAyB,aAAAC,GAAW,oBAAAC,OAAuB,iBEDnE,OAAQ,aAAAD,OAAgB,iBGAxB,OAAQ,cAAAE,OAAiB,iBVwBlB,IAAMC,GAAgB,CAAC,CAC5B,SAAAC,CACF,IAK+B,CAC7B,GAAIA,EAAS,WAAa,GACxB,MAAO,CAAC,gBAAiB,IAAI,EAG/B,GAAIA,EAAS,WAAa,GACxB,MAAO,CAAC,gBAAiB,IAAI,EAG/B,IAAMC,EAAQD,EAAS,MAAM,GAAI,EAAE,EAE7BE,EAASC,GAAc,CAAC,MAAAF,CAAK,CAAC,EAEpC,MAAI,WAAYC,EACP,CAAC,YAAaD,EAAO,WAAYC,EAAO,MAAM,EAGhD,CAAC,gBAAiB,IAAI,CAC/B,EAaaC,GAAgB,CAAC,CAC5B,MAAAF,CACF,IAEyE,CACvE,GAAIA,EAAM,SAAW,GACnB,MAAO,CAAC,aAAc,IAAI,EAO5B,IAAMG,GAJOH,aAAiB,WAAaZ,GAA0BY,CAAK,EAAIA,GAC3E,IAAKI,GAASA,EAAK,SAAS,EAAE,EAAE,SAAS,EAAG,GAAG,CAAC,EAChD,KAAK,EAAE,EAES,QAAQ,oCAAqC,gB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sD,CACxF,IAAMQ,EAAMT,GAASC,CAAO,EAE5BS,EAAS,YAAY,EAAE,IAAID,CAAG,EAE9B,MAAME,GAAS,EAEf,IAAMC,EACJH,EAAI,SAAS,OAAS,OAAYI,GAAsBJ,EAAI,QAAQ,IAAI,EAAI,OAE9E,MAAO,CAAC,GAAIG,EAAgB,CAACA,CAAa,EAAI,CAAC,CAAE,CACnD,EAOaE,GAAqBC,GAChCC,EAAU,YAAY,EAAE,UAAUD,CAAQ,EAK/BH,GAAgBE",
6
+ "names": ["assertNonNullish", "uint8ArrayToArrayOfNumber", "DER_COSE_OID", "wrapDER", "uint8ArrayToBase64", "Cbor", "SignIdentity", "arrayBufferToUint8Array", "isNullish", "uint8ArraysEqual", "nonNullish", "extractAAGUID", "authData", "bytes", "result", "bytesToAAGUID", "aaguid", "byte", "_authDataToCose", "dataView", "idLenBytes", "v", "i", "credentialIdLength", "_coseToDerEncodedBlob", "cose", "CosePublicKey", "_cose", "WebAuthnCredential", "#credentialId", "#publicKey", "credentialId", "WebAuthnNewCredential", "#aaguidText", "#aaguidBytes", "rest", "optionAaguid", "WebAuthnExistingCredential", "WebAuthnIdentityHostnameError", "WebAuthnIdentityCredentialNotInitializedError", "WebAuthnIdentityCreateCredentialOnTheDeviceError", "WebAuthnIdentityCredentialNotPublicKeyError", "WebAuthnIdentityNoAttestationError", "WebAuthnIdentityInvalidCredentialIdError", "WebAuthnIdentityEncodeCborSignatureError", "WebAuthnIdentityNoAuthenticatorDataError", "PUBLIC_KEY_COSE_ALGORITHMS", "AUTHENTICATOR_ABORT_TIMEOUT", "randomValue", "createChallenge", "createUserId", "hostname", "href", "url", "isNullish", "WebAuthnIdentityHostnameError", "relyingPartyId", "appId", "createPasskeyOptions", "userOptions", "name", "relyingParty", "user", "algorithm", "retrievePasskeyOptions", "options", "execute", "fn", "step", "onProgress", "result", "err", "WebAuthnSignProgressStep", "createAbortSignal", "timeout", "retrieveCredentials", "challenge", "credentialIds", "passkeyOptions", "id", "assertWebAuthnStateInitialized", "state", "WebAuthnIdentityCredentialNotInitializedError", "assertNonNullishCredential", "credential", "WebAuthnIdentityCreateCredentialOnTheDeviceError", "assertCredentialPublicKey", "type", "WebAuthnIdentityCredentialNotPublicKeyError", "WebAuthnIdentity", "_WebAuthnIdentity", "SignIdentity", "#onSignProgress", "#state", "args", "retrievePublicKey", "#createInitializedState", "WebAuthnNewCredential", "restArgs", "attestationObject", "rawId", "WebAuthnIdentityNoAttestationError", "authData", "Cbor", "cose", "_authDataToCose", "arrayBufferToUint8Array", "blob", "uint8ArraysEqual", "WebAuthnIdentityInvalidCredentialIdError", "WebAuthnExistingCredential", "response", "clientDataJSON", "authenticatorData", "signature", "WebAuthnIdentityNoAuthenticatorDataError", "encoded", "WebAuthnIdentityEncodeCborSignatureError", "isWebAuthnAvailable", "nonNullish", "isNullish", "Store", "data", "callback", "callbackId", "id", "AuthStore", "_AuthStore", "Store", "authUser", "callback", "unsubscribe", "emit", "message", "detail", "$event", "isNullish", "Actor", "isNullish", "isNullish", "HttpAgent", "nonNullish", "DOCKER_CONTAINER_URL", "DOCKER_INTERNET_IDENTITY_ID", "createAgent", "identity", "container", "host", "nonNullish", "DOCKER_CONTAINER_URL", "shouldFetchRootKey", "HttpAgent", "AgentStore", "_AgentStore", "#agents", "isNullish", "identity", "rest", "key", "agent", "createAgent", "ActorStore", "_ActorStore", "#actors", "isNullish", "satelliteId", "identity", "actorKey", "rest", "key", "actor", "idlFactory", "canisterId", "agent", "AgentStore", "Actor", "onBeforeUnload", "$event", "addBeforeUnload", "removeBeforeUnload", "executeWithWindowGuard", "fn", "isNullish", "nonNullish", "EnvStore", "_EnvStore", "Store", "env", "callback", "unsubscribe", "DELEGATION_IDENTITY_EXPIRATION", "ALLOW_PIN_AUTHENTICATION", "II_POPUP", "NFID_POPUP", "INTERNET_COMPUTER_ORG", "isNullish", "jsonReplacer", "jsonReviver", "toArray", "data", "blob", "fromArray", "isBrowser", "popupCenter", "width", "height", "p", "isNullish", "innerWidth", "innerHeight", "y", "x", "ERROR_USER_INTERRUPT", "isNullish", "execute", "fn", "step", "onProgress", "result", "err", "AuthClientSignInProgressStep", "SignInError", "SignInInitError", "SignInUserInterruptError", "SignInProviderNotSupportedError", "WebAuthnSignInRetrievePublicKeyError", "SignUpProviderNotSupportedError", "InitError", "ListError", "AuthClientProvider", "options", "authClient", "initAuth", "execute", "#loginWithAuthClient", "resolve", "reject", "isNullish", "SignInInitError", "error", "ERROR_USER_INTERRUPT", "SignInUserInterruptError", "SignInError", "DELEGATION_IDENTITY_EXPIRATION", "ALLOW_PIN_AUTHENTICATION", "InternetIdentityProvider", "AuthClientProvider", "#domain", "domain", "windowed", "identityProviderUrl", "container", "EnvStore", "isNullish", "INTERNET_COMPUTER_ORG", "env", "internetIdentityId", "nonNullish", "DOCKER_INTERNET_IDENTITY_ID", "containerHost", "protocol", "DOCKER_CONTAINER_URL", "popupCenter", "II_POPUP", "NFIDProvider", "AuthClientProvider", "#appName", "#logoUrl", "appName", "logoUrl", "windowed", "popupCenter", "NFID_POPUP", "AnonymousIdentity", "IdbStorage", "KEY_STORAGE_DELEGATION", "KEY_STORAGE_KEY", "DelegationChain", "DelegationIdentity", "DER_COSE_OID", "ECDSAKeyIdentity", "unwrapDER", "isNullish", "uint8ArrayToBase64", "DEFAULT_READ_OPTIONS", "AnonymousIdentity", "nonNullish", "getAnyIdentity", "identity", "nonNullish", "getIdentity", "AnonymousIdentity", "fromNullable", "isNullish", "nonNullish", "assertNonNullish", "Actor", "isNullish", "nonNullish", "HttpAgent", "idlFactory", "IDL", "CommitBatch", "CommitProposal", "ListOrderField", "ListOrder", "TimestampMatcher", "ListMatcher", "ListPaginate", "ListParams", "DeleteControllersArgs", "ControllerScope", "Controller", "DelDoc", "CollectionType", "DelRule", "DeleteProposalAssets", "DepositCyclesArgs", "AssetKey", "AssetEncodingNoContent", "AssetNoContent", "AuthenticationConfigInternetIdentity", "AuthenticationRules", "AuthenticationConfig", "ConfigMaxMemorySize", "DbConfig", "StorageConfigIFrame", "StorageConfigRawAccess", "StorageConfigRedirect", "StorageConfig", "Config", "Doc", "ProposalStatus", "AssetsUpgradeOptions", "SegmentsDeploymentOptions", "ProposalType", "Proposal", "Memory", "Permission", "RateConfig", "Rule", "HttpRequest", "StreamingCallbackToken", "StreamingStrategy", "HttpResponse", "StreamingCallbackHttpResponse", "InitAssetKey", "InitUploadResult", "ListResults", "CustomDomain", "ListResults_1", "ListProposalsOrder", "ListProposalsPaginate", "ListProposalsParams", "ProposalKey", "ListProposalResults", "ListRulesMatcher", "ListRulesParams", "ListRulesResults", "MemorySize", "SetAuthenticationConfig", "SetController", "SetControllersArgs", "SetDbConfig", "SetDoc", "SetRule", "SetStorageConfig", "UploadChunk", "UploadChunkResult", "nonNullish", "satelliteUrl", "customSatelliteId", "customContainer", "satelliteId", "customOrEnvSatelliteId", "container", "customOrEnvContainer", "nonNullish", "containerHost", "protocol", "DOCKER_CONTAINER_URL", "EnvStore", "getSatelliteActor", "satellite", "certified", "getActor", "ft", "Vt", "getSatelliteExtendedActor", "idlFactory", "rest", "customSatelliteId", "customContainer", "satelliteId", "customOrEnvSatelliteId", "assertNonNullish", "container", "customOrEnvContainer", "ActorStore", "Principal", "isNullish", "toNullable", "toListMatcherTimestamp", "matcher", "isNullish", "toNullable", "ListError", "toListParams", "paginate", "order", "owner", "Principal", "mapData", "data", "i", "err", "fromNullable", "toNullable", "toSetDoc", "doc", "data", "version", "description", "toNullable", "a", "toDelDoc", "fromDoc", "key", "owner", "docDescription", "rest", "fromNullable", "i", "getDoc", "collection", "key", "rest", "get_doc", "getSatelliteActor", "doc", "fromNullable", "isNullish", "fromDoc", "getManyDocs", "docs", "get_many_docs", "payload", "resultsDocs", "results", "resultDoc", "nonNullish", "setDoc", "set_doc", "toSetDoc", "updatedDoc", "setManyDocs", "set_many_docs", "updatedDocs", "deleteDoc", "del_doc", "toDelDoc", "deleteManyDocs", "del_many_docs", "deleteFilteredDocs", "filter", "del_filtered_docs", "toListParams", "listDocs", "list_docs", "items", "items_page", "items_length", "matches_length", "matches_pages", "item", "dataArray", "owner", "description", "version", "mapData", "countDocs", "count_docs", "getDoc", "satellite", "options", "rest", "identity", "getAnyIdentity", "DEFAULT_READ_OPTIONS", "getManyDocs", "setDoc", "setManyDocs", "deleteDoc", "deleteManyDocs", "deleteFilteredDocs", "filter", "listDocs", "countDocs", "arrayBufferToUint8Array", "nonNullish", "uint8ArrayToArrayOfNumber", "createWebAuthnUser", "delegationIdentity", "passkeyIdentity", "satelliteId", "aaguid", "user", "_", "setManyDocs", "nonNullish", "uint8ArrayToArrayOfNumber", "arrayBufferToUint8Array", "WebAuthnSignInProgressStep", "WebAuthnSignUpProgressStep", "WebAuthnProvider", "onProgress", "maxTimeToLiveInMilliseconds", "passkeyOptions", "loadAuthWithUser", "satelliteId", "EnvStore", "isNullish", "SignInInitError", "onSignProgress", "step", "state", "N", "passkeyIdentity", "execute", "F", "delegationIdentity", "sessionKey", "#createSessionDelegation", "user", "createWebAuthnUser", "#saveSessionIdentityForAuthClient", "loadAuth", "retrievePublicKey", "credentialId", "doc", "getDoc", "uint8ArrayToBase64", "AnonymousIdentity", "WebAuthnSignInRetrievePublicKeyError", "data", "publicKey", "unwrapDER", "DER_COSE_OID", "identity", "ECDSAKeyIdentity", "sessionLengthInMilliseconds", "chain", "DelegationChain", "DelegationIdentity", "storage", "IdbStorage", "KEY_STORAGE_KEY", "KEY_STORAGE_DELEGATION", "AuthClient", "IdbStorage", "KEY_STORAGE_KEY", "createAuthClient", "resetAuthClient", "isNullish", "nonNullish", "isSatelliteError", "error", "type", "JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE", "initUser", "provider", "user", "userId", "loadUser", "nonNullish", "createUser", "error", "t", "R_", "userOnCreateError", "getUser", "identity", "getIdentity", "isNullish", "InitError", "getDoc", "rest", "setDoc", "authClient", "loadAuth", "authenticate", "user", "loadUser", "AuthStore", "loadAuthWithUser", "createAuth", "provider", "initUser", "fn", "createAuthClient", "resetAuthClient", "signIn", "options", "signInWithProvider", "executeWithWindowGuard", "signUp", "signUpWithProvider", "signInOptions", "WebAuthnProvider", "nfidOptions", "appName", "logoUrl", "NFIDProvider", "iiOptions", "domain", "InternetIdentityProvider", "SignInProviderNotSupportedError", "signUpOptions", "SignUpProviderNotSupportedError", "signOut", "resetAuth", "ActorStore", "AgentStore", "getIdentity", "unsafeIdentity", "getIdentityOnce", "isNullish", "initAuthTimeoutWorker", "auth", "workerUrl", "worker", "timeoutSignOut", "emit", "signOut", "data", "msg", "value", "AuthStore", "user", "isNullish", "envSatelliteId", "viteEnvSatelliteId", "envContainer", "viteEnvContainer", "getSatelliteExtendedActor", "idlFactory", "satellite", "identity", "getAnyIdentity", "fromNullable", "nonNullish", "fromNullable", "assertNonNullish", "toNullable", "uploadAsset", "data", "headers", "restAsset", "actor", "progress", "init_asset_upload", "upload_asset_chunk", "commit_asset_upload", "batchId", "mapInitAssetUploadParams", "chunkIds", "uploadChunks", "commitAsset", "mapInitAssetUploadParams", "filename", "collection", "token", "fullPath", "encoding", "description", "toNullable", "mapCommitBatch", "batchId", "chunkIds", "headers", "data", "contentType", "type", "_", "chunk_id", "commitAsset", "commitFn", "rest", "commitBatch", "uploadChunks", "uploadFn", "clone", "isBrowser", "orderId", "start", "chunk", "results", "batchUploadChunks", "limit", "i", "batch", "params", "uploadChunk", "uploadAsset", "asset", "rest", "actor", "getSatelliteActor", "K", "listAssets", "collection", "filter", "list_assets", "assets", "items_length", "items_page", "matches_length", "matches_pages", "toListParams", "fromNullable", "countAssets", "count_assets", "deleteAsset", "fullPath", "deleteManyAssets", "satellite", "del_many_assets", "payload", "deleteFilteredAssets", "del_filtered_assets", "getAsset", "get_asset", "getManyAssets", "get_many_assets", "_", "resultAsset", "sha256ToBase64String", "sha256", "c", "uploadBlob", "params", "uploadAssetIC", "uploadFile", "storageFilename", "data", "collection", "headers", "storagePath", "token", "satelliteOptions", "encoding", "description", "identity", "getAnyIdentity", "filename", "fullPath", "satellite", "uploadAsset", "downloadUrl", "listAssets", "filter", "options", "items", "rest", "DEFAULT_READ_OPTIONS", "assets", "t", "name", "owner", "encodings", "created_at", "updated_at", "fromNullable", "acc", "type", "modified", "sha256", "total_length", "sha256ToBase64String", "countAssets", "deleteAsset", "deleteManyAssets", "deleteFilteredAssets", "getAsset", "getManyAssets", "satelliteUrl", "nonNullish", "parseEnv", "userEnv", "satelliteId", "envSatelliteId", "assertNonNullish", "container", "envContainer", "initJuno", "initSatellite", "env", "EnvStore", "loadAuth", "authSubscribe", "initAuthTimeoutWorker", "onAuthStateChange", "callback", "AuthStore"]
7
7
  }