@junobuild/core-peer 5.3.1 → 5.4.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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../utils/src/utils/asserts.utils.ts", "../../../utils/src/utils/arrays.utils.ts", "../../../utils/src/utils/base64.utils.ts", "../../../utils/src/utils/date.utils.ts", "../../../utils/src/utils/debounce.utils.ts", "../../../utils/src/utils/nullish.utils.ts", "../../../utils/src/utils/did.utils.ts", "
|
|
4
|
-
"sourcesContent": ["export class InvalidPercentageError extends Error {}\nexport class NullishError extends Error {}\n\nexport const assertNonNullish: <T>(\n value: T,\n message?: string\n // eslint-disable-next-line local-rules/prefer-object-params\n) => asserts value is NonNullable<T> = <T>(value: T, message?: string): void => {\n if (value === null || value === undefined) {\n throw new NullishError(message);\n }\n};\n\n// eslint-disable-next-line local-rules/prefer-object-params\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(`${percentage} is not a valid percentage number.`);\n }\n};\n\n/**\n * Utility to enforce exhaustiveness checks in TypeScript.\n *\n * This function should only be called in branches of a `switch` or conditional\n * that should be unreachable if the union type has been fully handled.\n *\n * By typing the parameter as `never`, the compiler will emit an error if\n * a new variant is added to the union but not covered in the logic.\n *\n * @param _ - A value that should be of type `never`. If this is not the case,\n * the TypeScript compiler will flag a type error.\n * @param message - Optional custom error message to include in the thrown error.\n * @throws {Error} Always throws when invoked at runtime.\n *\n */\n// eslint-disable-next-line local-rules/prefer-object-params\nexport const assertNever = (_: never, message?: string): never => {\n throw new Error(message);\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 }\n const high = BigInt(view.getUint32(0));\n const low = BigInt(view.getUint32(4));\n\n return (high << BigInt(32)) + low;\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 => new Uint8Array(buffer);\n\nexport const uint8ArrayToArrayOfNumber = (array: Uint8Array): Array<number> => 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\n/**\n * Compare two Uint8Arrays for byte-level equality.\n *\n * @param {Object} params\n * @param {Uint8Array} params.a - First Uint8Array to compare.\n * @param {Uint8Array} params.b - Second Uint8Array to compare.\n * @returns {boolean} True if both arrays have the same length and identical contents.\n */\nexport const uint8ArraysEqual = ({a, b}: {a: Uint8Array; b: Uint8Array}) =>\n a.length === b.length && a.every((byte, i) => byte === b[i]);\n\nexport const uint8ArrayToHexString = (bytes: Uint8Array | number[]) => {\n if (!(bytes instanceof Uint8Array)) {\n bytes = Uint8Array.from(bytes);\n }\n return bytes.reduce((str, byte) => str + byte.toString(16).padStart(2, '0'), '');\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", "/**\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 // Spreading large Uint8Arrays or using Array.from loses precision when used together with String.fromCharCode.\n // Therefore, we use a chunked loop, which better than a reducer or iterating on every value.\n // Spreading a small chunk - such as 32kb - works as expected.\n const chunkSize = 0x8000; // 32 kb\n const chunks: string[] = [];\n for (let i = 0; i < uint8Array.length; i += chunkSize) {\n chunks.push(String.fromCharCode(...uint8Array.subarray(i, i + chunkSize)));\n }\n return btoa(chunks.join(''));\n};\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", "const 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/no-unsafe-function-type, local-rules/prefer-object-params\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(next, timeout !== undefined && timeout > 0 ? timeout : 300);\n };\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>(argument: T | undefined | null): argument is undefined | null =>\n 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>(argument: T | undefined | null): argument is NonNullable<T> =>\n !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 = (value: string | undefined | null): value is string =>\n 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 = (value: string | undefined | null): value is undefined | null | '' =>\n !notEmptyString(value);\n", "import type {Nullable, NullishNullable} from '../types/did.utils';\nimport {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 {Nullable<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): Nullable<T> => (nonNullish(value) ? [value] : []);\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 {Nullable<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: Nullable<T>): T | undefined => value?.[0];\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 {Nullable<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: Nullable<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 {NullishNullable<T>} 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>(value: NullishNullable<T>): T | undefined =>\n fromNullable(value ?? []);\n", "const alphabet = 'abcdefghijklmnopqrstuvwxyz234567';\n\n// Build a lookup table for decoding.\nconst lookupTable: Record<string, number> = Object.create(null);\nfor (let i = 0; i < alphabet.length; i++) {\n lookupTable[alphabet[i]] = i;\n}\n\n// Add aliases for rfc4648.\nlookupTable['0'] = lookupTable.o;\nlookupTable['1'] = lookupTable.i;\n\n/**\n * @param input The Uint8Array to encode.\n * @returns A Base32 string encoding the input.\n */\nexport function base32Encode(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) {\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 * @param input The base32 encoded string to decode.\n */\nexport function base32Decode(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 = lookupTable[char.toLowerCase()];\n if (val === undefined) {\n throw new Error(`Invalid character: ${JSON.stringify(char)}`);\n }\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", "// 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, 0xe963a535, 0x9e6495a3,\n 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,\n 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,\n 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,\n 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,\n 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,\n 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f,\n 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,\n 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,\n 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,\n 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457,\n 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,\n 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb,\n 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,\n 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,\n 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,\n 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683,\n 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,\n 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7,\n 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,\n 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,\n 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,\n 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f,\n 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,\n 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,\n 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21,\n 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,\n 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,\n 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db,\n 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,\n 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,\n 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d,\n]);\n\n/**\n * Calculate the CRC32 of a Uint8Array.\n * @param buf The Uint8Array to calculate the CRC32 of.\n */\nexport function getCrc32(buf: Uint8Array): number {\n let crc = -1;\n\n for (let i = 0; i < buf.length; i++) {\n const byte = buf[i];\n const t = (byte ^ crc) & 0xff;\n crc = lookUpTable[t] ^ (crc >>> 8);\n }\n\n return (crc ^ -1) >>> 0;\n}\n", "/**\n * Utilities for hex, bytes, CSPRNG.\n * @module\n */\n/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n\n// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// node.js versions earlier than v19 don't declare it in global scope.\n// For node.js, package.json#exports field mapping rewrites import\n// from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated (2025-04-30), we can just drop the import.\nimport { crypto } from '@noble/hashes/crypto';\n\n/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */\nexport function isBytes(a: unknown): a is Uint8Array {\n return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array');\n}\n\n/** Asserts something is positive integer. */\nexport function anumber(n: number): void {\n if (!Number.isSafeInteger(n) || n < 0) throw new Error('positive integer expected, got ' + n);\n}\n\n/** Asserts something is Uint8Array. */\nexport function abytes(b: Uint8Array | undefined, ...lengths: number[]): void {\n if (!isBytes(b)) throw new Error('Uint8Array expected');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length);\n}\n\n/** Asserts something is hash */\nexport function ahash(h: IHash): void {\n if (typeof h !== 'function' || typeof h.create !== 'function')\n throw new Error('Hash should be wrapped by utils.createHasher');\n anumber(h.outputLen);\n anumber(h.blockLen);\n}\n\n/** Asserts a hash instance has not been destroyed / finished */\nexport function aexists(instance: any, checkFinished = true): void {\n if (instance.destroyed) throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished) throw new Error('Hash#digest() has already been called');\n}\n\n/** Asserts output is properly-sized byte array */\nexport function aoutput(out: any, instance: any): void {\n abytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error('digestInto() expects output buffer of length at least ' + min);\n }\n}\n\n/** Generic type encompassing 8/16/32-byte arrays - but not 64-byte. */\n// prettier-ignore\nexport type TypedArray = Int8Array | Uint8ClampedArray | Uint8Array |\n Uint16Array | Int16Array | Uint32Array | Int32Array;\n\n/** Cast u8 / u16 / u32 to u8. */\nexport function u8(arr: TypedArray): Uint8Array {\n return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n\n/** Cast u8 / u16 / u32 to u32. */\nexport function u32(arr: TypedArray): Uint32Array {\n return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n}\n\n/** Zeroize a byte array. Warning: JS provides no guarantees. */\nexport function clean(...arrays: TypedArray[]): void {\n for (let i = 0; i < arrays.length; i++) {\n arrays[i].fill(0);\n }\n}\n\n/** Create DataView of an array for easy byte-level manipulation. */\nexport function createView(arr: TypedArray): DataView {\n return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n\n/** The rotate right (circular right shift) operation for uint32 */\nexport function rotr(word: number, shift: number): number {\n return (word << (32 - shift)) | (word >>> shift);\n}\n\n/** The rotate left (circular left shift) operation for uint32 */\nexport function rotl(word: number, shift: number): number {\n return (word << shift) | ((word >>> (32 - shift)) >>> 0);\n}\n\n/** Is current platform little-endian? Most are. Big-Endian platform: IBM */\nexport const isLE: boolean = /* @__PURE__ */ (() =>\n new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)();\n\n/** The byte swap operation for uint32 */\nexport function byteSwap(word: number): number {\n return (\n ((word << 24) & 0xff000000) |\n ((word << 8) & 0xff0000) |\n ((word >>> 8) & 0xff00) |\n ((word >>> 24) & 0xff)\n );\n}\n/** Conditionally byte swap if on a big-endian platform */\nexport const swap8IfBE: (n: number) => number = isLE\n ? (n: number) => n\n : (n: number) => byteSwap(n);\n\n/** @deprecated */\nexport const byteSwapIfBE: typeof swap8IfBE = swap8IfBE;\n/** In place byte swap for Uint32Array */\nexport function byteSwap32(arr: Uint32Array): Uint32Array {\n for (let i = 0; i < arr.length; i++) {\n arr[i] = byteSwap(arr[i]);\n }\n return arr;\n}\n\nexport const swap32IfBE: (u: Uint32Array) => Uint32Array = isLE\n ? (u: Uint32Array) => u\n : byteSwap32;\n\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\nconst hasHexBuiltin: boolean = /* @__PURE__ */ (() =>\n // @ts-ignore\n typeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')();\n\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) =>\n i.toString(16).padStart(2, '0')\n);\n\n/**\n * Convert byte array to hex string. Uses built-in function, when available.\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nexport function bytesToHex(bytes: Uint8Array): string {\n abytes(bytes);\n // @ts-ignore\n if (hasHexBuiltin) return bytes.toHex();\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\n\n// We use optimized technique to convert hex string to byte array\nconst asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 } as const;\nfunction asciiToBase16(ch: number): number | undefined {\n if (ch >= asciis._0 && ch <= asciis._9) return ch - asciis._0; // '2' => 50-48\n if (ch >= asciis.A && ch <= asciis.F) return ch - (asciis.A - 10); // 'B' => 66-(65-10)\n if (ch >= asciis.a && ch <= asciis.f) return ch - (asciis.a - 10); // 'b' => 98-(97-10)\n return;\n}\n\n/**\n * Convert hex string to byte array. Uses built-in function, when available.\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nexport function hexToBytes(hex: string): Uint8Array {\n if (typeof hex !== 'string') throw new Error('hex string expected, got ' + typeof hex);\n // @ts-ignore\n if (hasHexBuiltin) return Uint8Array.fromHex(hex);\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2) throw new Error('hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi));\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1));\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new Error('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163\n }\n return array;\n}\n\n/**\n * There is no setImmediate in browser and setTimeout is slow.\n * Call of async fn will return Promise, which will be fullfiled only on\n * next scheduler queue processing step and this is exactly what we need.\n */\nexport const nextTick = async (): Promise<void> => {};\n\n/** Returns control to thread each 'tick' ms to avoid blocking. */\nexport async function asyncLoop(\n iters: number,\n tick: number,\n cb: (i: number) => void\n): Promise<void> {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick) continue;\n await nextTick();\n ts += diff;\n }\n}\n\n// Global symbols, but ts doesn't see them: https://github.com/microsoft/TypeScript/issues/31535\ndeclare const TextEncoder: any;\ndeclare const TextDecoder: any;\n\n/**\n * Converts string to bytes using UTF8 encoding.\n * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99])\n */\nexport function utf8ToBytes(str: string): Uint8Array {\n if (typeof str !== 'string') throw new Error('string expected');\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n\n/**\n * Converts bytes to string using UTF8 encoding.\n * @example bytesToUtf8(Uint8Array.from([97, 98, 99])) // 'abc'\n */\nexport function bytesToUtf8(bytes: Uint8Array): string {\n return new TextDecoder().decode(bytes);\n}\n\n/** Accepted input of hash functions. Strings are converted to byte arrays. */\nexport type Input = string | Uint8Array;\n/**\n * Normalizes (non-hex) string or Uint8Array to Uint8Array.\n * Warning: when Uint8Array is passed, it would NOT get copied.\n * Keep in mind for future mutable operations.\n */\nexport function toBytes(data: Input): Uint8Array {\n if (typeof data === 'string') data = utf8ToBytes(data);\n abytes(data);\n return data;\n}\n\n/** KDFs can accept string or Uint8Array for user convenience. */\nexport type KDFInput = string | Uint8Array;\n/**\n * Helper for KDFs: consumes uint8array or string.\n * When string is passed, does utf8 decoding, using TextDecoder.\n */\nexport function kdfInputToBytes(data: KDFInput): Uint8Array {\n if (typeof data === 'string') data = utf8ToBytes(data);\n abytes(data);\n return data;\n}\n\n/** Copies several Uint8Arrays into one. */\nexport function concatBytes(...arrays: Uint8Array[]): Uint8Array {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n abytes(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\n\ntype EmptyObj = {};\nexport function checkOpts<T1 extends EmptyObj, T2 extends EmptyObj>(\n defaults: T1,\n opts?: T2\n): T1 & T2 {\n if (opts !== undefined && {}.toString.call(opts) !== '[object Object]')\n throw new Error('options should be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged as T1 & T2;\n}\n\n/** Hash interface. */\nexport type IHash = {\n (data: Uint8Array): Uint8Array;\n blockLen: number;\n outputLen: number;\n create: any;\n};\n\n/** For runtime check if class implements interface */\nexport abstract class Hash<T extends Hash<T>> {\n abstract blockLen: number; // Bytes per block\n abstract outputLen: number; // Bytes in output\n abstract update(buf: Input): this;\n // Writes digest into buf\n abstract digestInto(buf: Uint8Array): void;\n abstract digest(): Uint8Array;\n /**\n * Resets internal state. Makes Hash instance unusable.\n * Reset is impossible for keyed hashes if key is consumed into state. If digest is not consumed\n * by user, they will need to manually call `destroy()` when zeroing is necessary.\n */\n abstract destroy(): void;\n /**\n * Clones hash instance. Unsafe: doesn't check whether `to` is valid. Can be used as `clone()`\n * when no options are passed.\n * Reasons to use `_cloneInto` instead of clone: 1) performance 2) reuse instance => all internal\n * buffers are overwritten => causes buffer overwrite which is used for digest in some cases.\n * There are no guarantees for clean-up because it's impossible in JS.\n */\n abstract _cloneInto(to?: T): T;\n // Safe version that clones internal state\n abstract clone(): T;\n}\n\n/**\n * XOF: streaming API to read digest in chunks.\n * Same as 'squeeze' in keccak/k12 and 'seek' in blake3, but more generic name.\n * When hash used in XOF mode it is up to user to call '.destroy' afterwards, since we cannot\n * destroy state, next call can require more bytes.\n */\nexport type HashXOF<T extends Hash<T>> = Hash<T> & {\n xof(bytes: number): Uint8Array; // Read 'bytes' bytes from digest stream\n xofInto(buf: Uint8Array): Uint8Array; // read buf.length bytes from digest stream into buf\n};\n\n/** Hash function */\nexport type CHash = ReturnType<typeof createHasher>;\n/** Hash function with output */\nexport type CHashO = ReturnType<typeof createOptHasher>;\n/** XOF with output */\nexport type CHashXO = ReturnType<typeof createXOFer>;\n\n/** Wraps hash function, creating an interface on top of it */\nexport function createHasher<T extends Hash<T>>(\n hashCons: () => Hash<T>\n): {\n (msg: Input): Uint8Array;\n outputLen: number;\n blockLen: number;\n create(): Hash<T>;\n} {\n const hashC = (msg: Input): Uint8Array => hashCons().update(toBytes(msg)).digest();\n const tmp = hashCons();\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = () => hashCons();\n return hashC;\n}\n\nexport function createOptHasher<H extends Hash<H>, T extends Object>(\n hashCons: (opts?: T) => Hash<H>\n): {\n (msg: Input, opts?: T): Uint8Array;\n outputLen: number;\n blockLen: number;\n create(opts?: T): Hash<H>;\n} {\n const hashC = (msg: Input, opts?: T): Uint8Array => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({} as T);\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts?: T) => hashCons(opts);\n return hashC;\n}\n\nexport function createXOFer<H extends HashXOF<H>, T extends Object>(\n hashCons: (opts?: T) => HashXOF<H>\n): {\n (msg: Input, opts?: T): Uint8Array;\n outputLen: number;\n blockLen: number;\n create(opts?: T): HashXOF<H>;\n} {\n const hashC = (msg: Input, opts?: T): Uint8Array => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({} as T);\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts?: T) => hashCons(opts);\n return hashC;\n}\nexport const wrapConstructor: typeof createHasher = createHasher;\nexport const wrapConstructorWithOpts: typeof createOptHasher = createOptHasher;\nexport const wrapXOFConstructorWithOpts: typeof createXOFer = createXOFer;\n\n/** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */\nexport function randomBytes(bytesLength = 32): Uint8Array {\n if (crypto && typeof crypto.getRandomValues === 'function') {\n return crypto.getRandomValues(new Uint8Array(bytesLength));\n }\n // Legacy Node.js compatibility\n if (crypto && typeof crypto.randomBytes === 'function') {\n return Uint8Array.from(crypto.randomBytes(bytesLength));\n }\n throw new Error('crypto.getRandomValues must be defined');\n}\n", "/**\n * Internal Merkle-Damgard hash utils.\n * @module\n */\nimport { type Input, Hash, abytes, aexists, aoutput, clean, createView, toBytes } from './utils.ts';\n\n/** Polyfill for Safari 14. https://caniuse.com/mdn-javascript_builtins_dataview_setbiguint64 */\nexport function setBigUint64(\n view: DataView,\n byteOffset: number,\n value: bigint,\n isLE: boolean\n): void {\n if (typeof view.setBigUint64 === 'function') return view.setBigUint64(byteOffset, value, isLE);\n const _32n = BigInt(32);\n const _u32_max = BigInt(0xffffffff);\n const wh = Number((value >> _32n) & _u32_max);\n const wl = Number(value & _u32_max);\n const h = isLE ? 4 : 0;\n const l = isLE ? 0 : 4;\n view.setUint32(byteOffset + h, wh, isLE);\n view.setUint32(byteOffset + l, wl, isLE);\n}\n\n/** Choice: a ? b : c */\nexport function Chi(a: number, b: number, c: number): number {\n return (a & b) ^ (~a & c);\n}\n\n/** Majority function, true if any two inputs is true. */\nexport function Maj(a: number, b: number, c: number): number {\n return (a & b) ^ (a & c) ^ (b & c);\n}\n\n/**\n * Merkle-Damgard hash construction base class.\n * Could be used to create MD5, RIPEMD, SHA1, SHA2.\n */\nexport abstract class HashMD<T extends HashMD<T>> extends Hash<T> {\n protected abstract process(buf: DataView, offset: number): void;\n protected abstract get(): number[];\n protected abstract set(...args: number[]): void;\n abstract destroy(): void;\n protected abstract roundClean(): void;\n\n readonly blockLen: number;\n readonly outputLen: number;\n readonly padOffset: number;\n readonly isLE: boolean;\n\n // For partial updates less than block size\n protected buffer: Uint8Array;\n protected view: DataView;\n protected finished = false;\n protected length = 0;\n protected pos = 0;\n protected destroyed = false;\n\n constructor(blockLen: number, outputLen: number, padOffset: number, isLE: boolean) {\n super();\n this.blockLen = blockLen;\n this.outputLen = outputLen;\n this.padOffset = padOffset;\n this.isLE = isLE;\n this.buffer = new Uint8Array(blockLen);\n this.view = createView(this.buffer);\n }\n update(data: Input): this {\n aexists(this);\n data = toBytes(data);\n abytes(data);\n const { view, buffer, blockLen } = this;\n const len = data.length;\n for (let pos = 0; pos < len; ) {\n const take = Math.min(blockLen - this.pos, len - pos);\n // Fast path: we have at least one block in input, cast it to view and process\n if (take === blockLen) {\n const dataView = createView(data);\n for (; blockLen <= len - pos; pos += blockLen) this.process(dataView, pos);\n continue;\n }\n buffer.set(data.subarray(pos, pos + take), this.pos);\n this.pos += take;\n pos += take;\n if (this.pos === blockLen) {\n this.process(view, 0);\n this.pos = 0;\n }\n }\n this.length += data.length;\n this.roundClean();\n return this;\n }\n digestInto(out: Uint8Array): void {\n aexists(this);\n aoutput(out, this);\n this.finished = true;\n // Padding\n // We can avoid allocation of buffer for padding completely if it\n // was previously not allocated here. But it won't change performance.\n const { buffer, view, blockLen, isLE } = this;\n let { pos } = this;\n // append the bit '1' to the message\n buffer[pos++] = 0b10000000;\n clean(this.buffer.subarray(pos));\n // we have less than padOffset left in buffer, so we cannot put length in\n // current block, need process it and pad again\n if (this.padOffset > blockLen - pos) {\n this.process(view, 0);\n pos = 0;\n }\n // Pad until full block byte with zeros\n for (let i = pos; i < blockLen; i++) buffer[i] = 0;\n // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that\n // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen.\n // So we just write lowest 64 bits of that value.\n setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE);\n this.process(view, 0);\n const oview = createView(out);\n const len = this.outputLen;\n // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT\n if (len % 4) throw new Error('_sha2: outputLen should be aligned to 32bit');\n const outLen = len / 4;\n const state = this.get();\n if (outLen > state.length) throw new Error('_sha2: outputLen bigger than state');\n for (let i = 0; i < outLen; i++) oview.setUint32(4 * i, state[i], isLE);\n }\n digest(): Uint8Array {\n const { buffer, outputLen } = this;\n this.digestInto(buffer);\n const res = buffer.slice(0, outputLen);\n this.destroy();\n return res;\n }\n _cloneInto(to?: T): T {\n to ||= new (this.constructor as any)() as T;\n to.set(...this.get());\n const { blockLen, buffer, length, finished, destroyed, pos } = this;\n to.destroyed = destroyed;\n to.finished = finished;\n to.length = length;\n to.pos = pos;\n if (length % blockLen) to.buffer.set(buffer);\n return to;\n }\n clone(): T {\n return this._cloneInto();\n }\n}\n\n/**\n * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53.\n * Check out `test/misc/sha2-gen-iv.js` for recomputation guide.\n */\n\n/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */\nexport const SHA256_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,\n]);\n\n/** Initial SHA224 state. Bits 32..64 of frac part of sqrt of primes 23..53 */\nexport const SHA224_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([\n 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4,\n]);\n\n/** Initial SHA384 state. Bits 0..64 of frac part of sqrt of primes 23..53 */\nexport const SHA384_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([\n 0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939,\n 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4,\n]);\n\n/** Initial SHA512 state. Bits 0..64 of frac part of sqrt of primes 2..19 */\nexport const SHA512_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1,\n 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179,\n]);\n", "/**\n * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.\n * SHA256 is the fastest hash implementable in JS, even faster than Blake3.\n * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and\n * [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf).\n * @module\n */\nimport { Chi, HashMD, Maj, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from './_md.ts';\nimport * as u64 from './_u64.ts';\nimport { type CHash, clean, createHasher, rotr } from './utils.ts';\n\n/**\n * Round constants:\n * First 32 bits of fractional parts of the cube roots of the first 64 primes 2..311)\n */\n// prettier-ignore\nconst SHA256_K = /* @__PURE__ */ Uint32Array.from([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\n\n/** Reusable temporary buffer. \"W\" comes straight from spec. */\nconst SHA256_W = /* @__PURE__ */ new Uint32Array(64);\nexport class SHA256 extends HashMD<SHA256> {\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n protected A: number = SHA256_IV[0] | 0;\n protected B: number = SHA256_IV[1] | 0;\n protected C: number = SHA256_IV[2] | 0;\n protected D: number = SHA256_IV[3] | 0;\n protected E: number = SHA256_IV[4] | 0;\n protected F: number = SHA256_IV[5] | 0;\n protected G: number = SHA256_IV[6] | 0;\n protected H: number = SHA256_IV[7] | 0;\n\n constructor(outputLen: number = 32) {\n super(64, outputLen, 8, false);\n }\n protected get(): [number, number, number, number, number, number, number, number] {\n const { A, B, C, D, E, F, G, H } = this;\n return [A, B, C, D, E, F, G, H];\n }\n // prettier-ignore\n protected set(\n A: number, B: number, C: number, D: number, E: number, F: number, G: number, H: number\n ): void {\n this.A = A | 0;\n this.B = B | 0;\n this.C = C | 0;\n this.D = D | 0;\n this.E = E | 0;\n this.F = F | 0;\n this.G = G | 0;\n this.H = H | 0;\n }\n protected process(view: DataView, offset: number): void {\n // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4) SHA256_W[i] = view.getUint32(offset, false);\n for (let i = 16; i < 64; i++) {\n const W15 = SHA256_W[i - 15];\n const W2 = SHA256_W[i - 2];\n const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3);\n const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10);\n SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0;\n }\n // Compression function main loop, 64 rounds\n let { A, B, C, D, E, F, G, H } = this;\n for (let i = 0; i < 64; i++) {\n const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);\n const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);\n const T2 = (sigma0 + Maj(A, B, C)) | 0;\n H = G;\n G = F;\n F = E;\n E = (D + T1) | 0;\n D = C;\n C = B;\n B = A;\n A = (T1 + T2) | 0;\n }\n // Add the compressed chunk to the current hash value\n A = (A + this.A) | 0;\n B = (B + this.B) | 0;\n C = (C + this.C) | 0;\n D = (D + this.D) | 0;\n E = (E + this.E) | 0;\n F = (F + this.F) | 0;\n G = (G + this.G) | 0;\n H = (H + this.H) | 0;\n this.set(A, B, C, D, E, F, G, H);\n }\n protected roundClean(): void {\n clean(SHA256_W);\n }\n destroy(): void {\n this.set(0, 0, 0, 0, 0, 0, 0, 0);\n clean(this.buffer);\n }\n}\n\nexport class SHA224 extends SHA256 {\n protected A: number = SHA224_IV[0] | 0;\n protected B: number = SHA224_IV[1] | 0;\n protected C: number = SHA224_IV[2] | 0;\n protected D: number = SHA224_IV[3] | 0;\n protected E: number = SHA224_IV[4] | 0;\n protected F: number = SHA224_IV[5] | 0;\n protected G: number = SHA224_IV[6] | 0;\n protected H: number = SHA224_IV[7] | 0;\n constructor() {\n super(28);\n }\n}\n\n// SHA2-512 is slower than sha256 in js because u64 operations are slow.\n\n// Round contants\n// First 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409\n// prettier-ignore\nconst K512 = /* @__PURE__ */ (() => u64.split([\n '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',\n '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',\n '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',\n '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',\n '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',\n '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',\n '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',\n '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',\n '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',\n '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',\n '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',\n '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',\n '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',\n '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',\n '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',\n '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',\n '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',\n '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',\n '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',\n '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'\n].map(n => BigInt(n))))();\nconst SHA512_Kh = /* @__PURE__ */ (() => K512[0])();\nconst SHA512_Kl = /* @__PURE__ */ (() => K512[1])();\n\n// Reusable temporary buffers\nconst SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);\nconst SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);\n\nexport class SHA512 extends HashMD<SHA512> {\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n // h -- high 32 bits, l -- low 32 bits\n protected Ah: number = SHA512_IV[0] | 0;\n protected Al: number = SHA512_IV[1] | 0;\n protected Bh: number = SHA512_IV[2] | 0;\n protected Bl: number = SHA512_IV[3] | 0;\n protected Ch: number = SHA512_IV[4] | 0;\n protected Cl: number = SHA512_IV[5] | 0;\n protected Dh: number = SHA512_IV[6] | 0;\n protected Dl: number = SHA512_IV[7] | 0;\n protected Eh: number = SHA512_IV[8] | 0;\n protected El: number = SHA512_IV[9] | 0;\n protected Fh: number = SHA512_IV[10] | 0;\n protected Fl: number = SHA512_IV[11] | 0;\n protected Gh: number = SHA512_IV[12] | 0;\n protected Gl: number = SHA512_IV[13] | 0;\n protected Hh: number = SHA512_IV[14] | 0;\n protected Hl: number = SHA512_IV[15] | 0;\n\n constructor(outputLen: number = 64) {\n super(128, outputLen, 16, false);\n }\n // prettier-ignore\n protected get(): [\n number, number, number, number, number, number, number, number,\n number, number, number, number, number, number, number, number\n ] {\n const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];\n }\n // prettier-ignore\n protected set(\n Ah: number, Al: number, Bh: number, Bl: number, Ch: number, Cl: number, Dh: number, Dl: number,\n Eh: number, El: number, Fh: number, Fl: number, Gh: number, Gl: number, Hh: number, Hl: number\n ): void {\n this.Ah = Ah | 0;\n this.Al = Al | 0;\n this.Bh = Bh | 0;\n this.Bl = Bl | 0;\n this.Ch = Ch | 0;\n this.Cl = Cl | 0;\n this.Dh = Dh | 0;\n this.Dl = Dl | 0;\n this.Eh = Eh | 0;\n this.El = El | 0;\n this.Fh = Fh | 0;\n this.Fl = Fl | 0;\n this.Gh = Gh | 0;\n this.Gl = Gl | 0;\n this.Hh = Hh | 0;\n this.Hl = Hl | 0;\n }\n protected process(view: DataView, offset: number): void {\n // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4) {\n SHA512_W_H[i] = view.getUint32(offset);\n SHA512_W_L[i] = view.getUint32((offset += 4));\n }\n for (let i = 16; i < 80; i++) {\n // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7)\n const W15h = SHA512_W_H[i - 15] | 0;\n const W15l = SHA512_W_L[i - 15] | 0;\n const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);\n const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7);\n // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6)\n const W2h = SHA512_W_H[i - 2] | 0;\n const W2l = SHA512_W_L[i - 2] | 0;\n const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);\n const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);\n // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16];\n const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);\n const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);\n SHA512_W_H[i] = SUMh | 0;\n SHA512_W_L[i] = SUMl | 0;\n }\n let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n // Compression function main loop, 80 rounds\n for (let i = 0; i < 80; i++) {\n // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)\n const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);\n const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);\n //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const CHIh = (Eh & Fh) ^ (~Eh & Gh);\n const CHIl = (El & Fl) ^ (~El & Gl);\n // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]\n // prettier-ignore\n const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);\n const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);\n const T1l = T1ll | 0;\n // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39)\n const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);\n const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);\n const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);\n const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl);\n Hh = Gh | 0;\n Hl = Gl | 0;\n Gh = Fh | 0;\n Gl = Fl | 0;\n Fh = Eh | 0;\n Fl = El | 0;\n ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));\n Dh = Ch | 0;\n Dl = Cl | 0;\n Ch = Bh | 0;\n Cl = Bl | 0;\n Bh = Ah | 0;\n Bl = Al | 0;\n const All = u64.add3L(T1l, sigma0l, MAJl);\n Ah = u64.add3H(All, T1h, sigma0h, MAJh);\n Al = All | 0;\n }\n // Add the compressed chunk to the current hash value\n ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));\n ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));\n ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));\n ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));\n ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));\n ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));\n ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));\n ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));\n this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);\n }\n protected roundClean(): void {\n clean(SHA512_W_H, SHA512_W_L);\n }\n destroy(): void {\n clean(this.buffer);\n this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n }\n}\n\nexport class SHA384 extends SHA512 {\n protected Ah: number = SHA384_IV[0] | 0;\n protected Al: number = SHA384_IV[1] | 0;\n protected Bh: number = SHA384_IV[2] | 0;\n protected Bl: number = SHA384_IV[3] | 0;\n protected Ch: number = SHA384_IV[4] | 0;\n protected Cl: number = SHA384_IV[5] | 0;\n protected Dh: number = SHA384_IV[6] | 0;\n protected Dl: number = SHA384_IV[7] | 0;\n protected Eh: number = SHA384_IV[8] | 0;\n protected El: number = SHA384_IV[9] | 0;\n protected Fh: number = SHA384_IV[10] | 0;\n protected Fl: number = SHA384_IV[11] | 0;\n protected Gh: number = SHA384_IV[12] | 0;\n protected Gl: number = SHA384_IV[13] | 0;\n protected Hh: number = SHA384_IV[14] | 0;\n protected Hl: number = SHA384_IV[15] | 0;\n\n constructor() {\n super(48);\n }\n}\n\n/**\n * Truncated SHA512/256 and SHA512/224.\n * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as \"intermediary\" IV of SHA512/t.\n * Then t hashes string to produce result IV.\n * See `test/misc/sha2-gen-iv.js`.\n */\n\n/** SHA512/224 IV */\nconst T224_IV = /* @__PURE__ */ Uint32Array.from([\n 0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf,\n 0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1,\n]);\n\n/** SHA512/256 IV */\nconst T256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd,\n 0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2,\n]);\n\nexport class SHA512_224 extends SHA512 {\n protected Ah: number = T224_IV[0] | 0;\n protected Al: number = T224_IV[1] | 0;\n protected Bh: number = T224_IV[2] | 0;\n protected Bl: number = T224_IV[3] | 0;\n protected Ch: number = T224_IV[4] | 0;\n protected Cl: number = T224_IV[5] | 0;\n protected Dh: number = T224_IV[6] | 0;\n protected Dl: number = T224_IV[7] | 0;\n protected Eh: number = T224_IV[8] | 0;\n protected El: number = T224_IV[9] | 0;\n protected Fh: number = T224_IV[10] | 0;\n protected Fl: number = T224_IV[11] | 0;\n protected Gh: number = T224_IV[12] | 0;\n protected Gl: number = T224_IV[13] | 0;\n protected Hh: number = T224_IV[14] | 0;\n protected Hl: number = T224_IV[15] | 0;\n\n constructor() {\n super(28);\n }\n}\n\nexport class SHA512_256 extends SHA512 {\n protected Ah: number = T256_IV[0] | 0;\n protected Al: number = T256_IV[1] | 0;\n protected Bh: number = T256_IV[2] | 0;\n protected Bl: number = T256_IV[3] | 0;\n protected Ch: number = T256_IV[4] | 0;\n protected Cl: number = T256_IV[5] | 0;\n protected Dh: number = T256_IV[6] | 0;\n protected Dl: number = T256_IV[7] | 0;\n protected Eh: number = T256_IV[8] | 0;\n protected El: number = T256_IV[9] | 0;\n protected Fh: number = T256_IV[10] | 0;\n protected Fl: number = T256_IV[11] | 0;\n protected Gh: number = T256_IV[12] | 0;\n protected Gl: number = T256_IV[13] | 0;\n protected Hh: number = T256_IV[14] | 0;\n protected Hl: number = T256_IV[15] | 0;\n\n constructor() {\n super(32);\n }\n}\n\n/**\n * SHA2-256 hash function from RFC 4634.\n *\n * It is the fastest JS hash, even faster than Blake3.\n * To break sha256 using birthday attack, attackers need to try 2^128 hashes.\n * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n */\nexport const sha256: CHash = /* @__PURE__ */ createHasher(() => new SHA256());\n/** SHA2-224 hash function from RFC 4634 */\nexport const sha224: CHash = /* @__PURE__ */ createHasher(() => new SHA224());\n\n/** SHA2-512 hash function from RFC 4634. */\nexport const sha512: CHash = /* @__PURE__ */ createHasher(() => new SHA512());\n/** SHA2-384 hash function from RFC 4634. */\nexport const sha384: CHash = /* @__PURE__ */ createHasher(() => new SHA384());\n\n/**\n * SHA2-512/256 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf).\n */\nexport const sha512_256: CHash = /* @__PURE__ */ createHasher(() => new SHA512_256());\n/**\n * SHA2-512/224 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf).\n */\nexport const sha512_224: CHash = /* @__PURE__ */ createHasher(() => new SHA512_224());\n", "import { base32Decode, base32Encode } from './utils/base32.ts';\nimport { getCrc32 } from './utils/getCrc.ts';\nimport { sha224 } from '@noble/hashes/sha2';\nimport { bytesToHex, hexToBytes } from '@noble/hashes/utils';\n\nexport const JSON_KEY_PRINCIPAL = '__principal__';\nconst SELF_AUTHENTICATING_SUFFIX = 2;\nconst ANONYMOUS_SUFFIX = 4;\n\nconst MANAGEMENT_CANISTER_PRINCIPAL_TEXT_STR = 'aaaaa-aa';\n\nexport interface JsonnablePrincipal {\n [JSON_KEY_PRINCIPAL]: string;\n}\n\nexport class Principal {\n public static anonymous(): Principal {\n return new this(new Uint8Array([ANONYMOUS_SUFFIX]));\n }\n\n /**\n * Utility method, returning the principal representing the management canister, decoded from the hex string `'aaaaa-aa'`\n * @returns {Principal} principal of the management canister\n */\n public static managementCanister(): Principal {\n return this.fromText(MANAGEMENT_CANISTER_PRINCIPAL_TEXT_STR);\n }\n\n public static selfAuthenticating(publicKey: Uint8Array): Principal {\n const sha = sha224(publicKey);\n return new this(new Uint8Array([...sha, SELF_AUTHENTICATING_SUFFIX]));\n }\n\n public static from(other: unknown): Principal {\n if (typeof other === 'string') {\n return Principal.fromText(other);\n }\n if (Object.getPrototypeOf(other) === Uint8Array.prototype) {\n return new Principal(other as Uint8Array);\n }\n if (Principal.isPrincipal(other)) {\n return new Principal(other._arr);\n }\n\n throw new Error(`Impossible to convert ${JSON.stringify(other)} to Principal.`);\n }\n\n public static fromHex(hex: string): Principal {\n return new this(hexToBytes(hex));\n }\n\n public static fromText(text: string): Principal {\n let maybePrincipal = text;\n // If formatted as JSON string, parse it first\n if (text.includes(JSON_KEY_PRINCIPAL)) {\n const obj = JSON.parse(text);\n if (JSON_KEY_PRINCIPAL in obj) {\n maybePrincipal = obj[JSON_KEY_PRINCIPAL];\n }\n }\n\n const canisterIdNoDash = maybePrincipal.toLowerCase().replace(/-/g, '');\n\n let arr = base32Decode(canisterIdNoDash);\n arr = arr.slice(4, arr.length);\n\n const principal = new this(arr);\n if (principal.toText() !== maybePrincipal) {\n throw new Error(\n `Principal \"${principal.toText()}\" does not have a valid checksum (original value \"${maybePrincipal}\" may not be a valid Principal ID).`,\n );\n }\n\n return principal;\n }\n\n public static fromUint8Array(arr: Uint8Array): Principal {\n return new this(arr);\n }\n\n public static isPrincipal(other: unknown): other is Principal {\n return (\n other instanceof Principal ||\n (typeof other === 'object' &&\n other !== null &&\n '_isPrincipal' in other &&\n (other as { _isPrincipal: boolean })['_isPrincipal'] === true &&\n '_arr' in other &&\n (other as { _arr: Uint8Array })['_arr'] instanceof Uint8Array)\n );\n }\n\n public readonly _isPrincipal = true;\n\n protected constructor(private _arr: Uint8Array) {}\n\n public isAnonymous(): boolean {\n return this._arr.byteLength === 1 && this._arr[0] === ANONYMOUS_SUFFIX;\n }\n\n public toUint8Array(): Uint8Array {\n return this._arr;\n }\n\n public toHex(): string {\n return bytesToHex(this._arr).toUpperCase();\n }\n\n public toText(): string {\n const checksumArrayBuf = new ArrayBuffer(4);\n const view = new DataView(checksumArrayBuf);\n view.setUint32(0, getCrc32(this._arr));\n const checksum = new Uint8Array(checksumArrayBuf);\n\n const array = new Uint8Array([...checksum, ...this._arr]);\n\n const result = base32Encode(array);\n const matches = result.match(/.{1,5}/g);\n if (!matches) {\n // This should only happen if there's no character, which is unreachable.\n throw new Error();\n }\n return matches.join('-');\n }\n\n public toString(): string {\n return this.toText();\n }\n\n /**\n * Serializes to JSON\n * @returns {JsonnablePrincipal} a JSON object with a single key, {@link JSON_KEY_PRINCIPAL}, whose value is the principal as a string\n */\n public toJSON(): JsonnablePrincipal {\n return { [JSON_KEY_PRINCIPAL]: this.toText() };\n }\n\n /**\n * Utility method taking a Principal to compare against. Used for determining canister ranges in certificate verification\n * @param {Principal} other - a {@link Principal} to compare\n * @returns {'lt' | 'eq' | 'gt'} `'lt' | 'eq' | 'gt'` a string, representing less than, equal to, or greater than\n */\n public compareTo(other: Principal): 'lt' | 'eq' | 'gt' {\n for (let i = 0; i < Math.min(this._arr.length, other._arr.length); i++) {\n if (this._arr[i] < other._arr[i]) {\n return 'lt';\n }\n if (this._arr[i] > other._arr[i]) {\n return 'gt';\n }\n }\n // Here, at least one principal is a prefix of the other principal (they could be the same)\n if (this._arr.length < other._arr.length) {\n return 'lt';\n }\n if (this._arr.length > other._arr.length) {\n return 'gt';\n }\n return 'eq';\n }\n\n /**\n * Utility method checking whether a provided Principal is less than or equal to the current one using the {@link Principal.compareTo} method\n * @param other a {@link Principal} to compare\n * @returns {boolean} boolean\n */\n public ltEq(other: Principal): boolean {\n const cmp = this.compareTo(other);\n return cmp == 'lt' || cmp == 'eq';\n }\n\n /**\n * Utility method checking whether a provided Principal is greater than or equal to the current one using the {@link Principal.compareTo} method\n * @param other a {@link Principal} to compare\n * @returns {boolean} boolean\n */\n public gtEq(other: Principal): boolean {\n const cmp = this.compareTo(other);\n return cmp == 'gt' || cmp == 'eq';\n }\n}\n", "import {Principal} from '@icp-sdk/core/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 */\n// eslint-disable-next-line local-rules/prefer-object-params\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) && Principal.isPrincipal(value)) {\n // isPrincipal asserts if a value is a Principal, but does not assert if the object\n // contains functions such as toText(). That's why we construct a new object.\n return {[JSON_KEY_PRINCIPAL]: Principal.from(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 */\n// eslint-disable-next-line local-rules/prefer-object-params\nexport const jsonReviver = (_key: string, value: unknown): unknown => {\n const mapValue = <T>(key: string): T => (value as Record<string, T>)[key];\n\n if (nonNullish(value) && typeof value === 'object' && JSON_KEY_BIGINT in value) {\n return BigInt(mapValue(JSON_KEY_BIGINT));\n }\n\n if (nonNullish(value) && typeof value === 'object' && JSON_KEY_PRINCIPAL in value) {\n return Principal.fromText(mapValue(JSON_KEY_PRINCIPAL));\n }\n\n if (nonNullish(value) && typeof value === 'object' && JSON_KEY_UINT8ARRAY in value) {\n return Uint8Array.from(mapValue(JSON_KEY_UINT8ARRAY));\n }\n\n return value;\n};\n", "import {jsonReplacer, jsonReviver} from './json.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 = 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 = new Blob(\n [data instanceof Uint8Array ? (data as Uint8Array<ArrayBuffer>) : new Uint8Array(data)],\n {\n type: 'application/json; charset=utf-8'\n }\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", "// Source: https://stackoverflow.com/a/77489094/5404186\nexport const convertCamelToSnake = (str: string): string =>\n str.replace(/([a-zA-Z])(?=[A-Z])/g, '$1_').toLowerCase();\n\nexport const capitalize = (str: string): string => str.charAt(0).toUpperCase() + str.slice(1);\n", "import {uint8ArrayToArrayOfNumber} from '@junobuild/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 '@icp-sdk/core/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, DER_COSE_OID) as DerEncodedPublicKey;\n}\n", "import type {DerEncodedPublicKey} from '@icp-sdk/core/agent';\nimport type {PublicKeyWithToRaw} from '../types/identity';\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 * extended with mandatory toRaw() and encodedKey made private.\n * It is therefore not covered by that many 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 PublicKeyWithToRaw {\n readonly #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 public toRaw(): Uint8Array {\n return new Uint8Array(this.#encodedKey); // Strip __derEncodedPublicKey__\n }\n}\n", "import {uint8ArrayToBase64} from '@junobuild/utils';\nimport {extractAAGUID} from './aaguid';\nimport {type CoseEncodedKey, CosePublicKey} from './agent-js/cose-key';\nimport type {PublicKeyWithToRaw} from './types/identity';\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(): PublicKeyWithToRaw {\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 Signature, SignIdentity} from '@icp-sdk/core/agent';\nimport {arrayBufferToUint8Array, isNullish, uint8ArraysEqual} from '@junobuild/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 PublicKeyWithToRaw,\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}>(\n arrayBufferToUint8Array(attestationObject)\n );\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(): PublicKeyWithToRaw {\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: Uint8Array): Promise<Signature> {\n // 1. Request user credential (navigator.credentials.get)\n const requestCredential = async (): Promise<PublicKeyCredential> => {\n const credential = await retrieveCredentials({\n challenge: 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 {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 try {\n const {hostname} = new URL(href);\n return hostname;\n } catch {\n throw new WebAuthnIdentityHostnameError();\n }\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 '@junobuild/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", "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';\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 {Actor, type ActorMethod, type ActorSubclass} from '@icp-sdk/core/agent';\nimport type {IDL} from '@icp-sdk/core/candid';\nimport {isNullish} from '@junobuild/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 {HttpAgent} from '@icp-sdk/core/agent';\nimport {nonNullish} from '@junobuild/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", "import type {Agent, HttpAgent} from '@icp-sdk/core/agent';\nimport {isNullish} from '@junobuild/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 {\n AuthClient,\n IdbStorage,\n KEY_STORAGE_DELEGATION,\n KEY_STORAGE_KEY\n} from '@icp-sdk/auth/client';\nimport type {DelegationChain, ECDSAKeyIdentity} from '@icp-sdk/core/identity';\nimport {isNullish} from '@junobuild/utils';\n\nexport class AuthClientStore {\n static #instance: AuthClientStore | undefined;\n\n #authClient: AuthClient | undefined | null;\n\n private constructor() {}\n\n static getInstance(): AuthClientStore {\n if (isNullish(this.#instance)) {\n this.#instance = new AuthClientStore();\n }\n\n return this.#instance;\n }\n\n createAuthClient = async (): Promise<AuthClient> => {\n this.#authClient = await AuthClient.create({\n idleOptions: {\n disableIdle: true,\n disableDefaultIdleCallback: true\n }\n });\n\n return this.#authClient;\n };\n\n /**\n * Since icp-js-core persists identity keys in IndexedDB by default,\n * they could be tampered with and affect the next login.\n * To ensure each session starts clean and safe, we clear the stored keys\n * before creating a new AuthClient.\n *\n * We also remove the delegation because `AuthClient.create` does not\n * overwrite or discard an existing delegation \u2014 it reads it from storage\n * and pairs it with whatever key is present. Once the key is cleared and\n * a fresh one generated, the old delegation would reference a different\n * public key, producing an ECDSA P256 signature / delegation mismatch.\n */\n safeCreateAuthClient = async (): Promise<AuthClient> => {\n const storage = new IdbStorage();\n await Promise.all([storage.remove(KEY_STORAGE_KEY), storage.remove(KEY_STORAGE_DELEGATION)]);\n\n return await this.createAuthClient();\n };\n\n getAuthClient = (): AuthClient | undefined | null => this.#authClient;\n\n logout = async (): Promise<void> => {\n await this.#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 this.#authClient = null;\n };\n\n setAuthClientStorage = async ({\n delegationChain,\n sessionKey\n }: {\n delegationChain: DelegationChain;\n sessionKey: ECDSAKeyIdentity;\n }) => {\n const storage = new IdbStorage();\n\n await Promise.all([\n storage.set(KEY_STORAGE_KEY, sessionKey.getKeyPair()),\n storage.set(KEY_STORAGE_DELEGATION, JSON.stringify(delegationChain.toJSON()))\n ]);\n };\n}\n", "import {ActorStore} from '../../core/stores/actor.store';\nimport {AgentStore} from '../../core/stores/agent.store';\nimport {AuthClientStore} from '../stores/auth-client.store';\nimport {AuthStore} from '../stores/auth.store';\nimport type {SignOutOptions} from '../types/auth';\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 await AuthClientStore.getInstance().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 AuthClientStore.getInstance().logout();\n\n AuthStore.getInstance().reset();\n\n ActorStore.getInstance().reset();\n AgentStore.getInstance().reset();\n};\n", "import {isNullish} from '@junobuild/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 './sign-out.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 }\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", "import {isNullish, nonNullish, notEmptyString} from '@junobuild/utils';\nimport type {BroadcastData} from '../types/auth-broadcast';\n\n// If the user has more than one tab open in the same browser,\n// there could be a mismatch of the cached delegation chain vs the identity key of the `authClient` object.\n// This causes the `authClient` to be unable to correctly sign calls, raising Trust Errors.\n// To mitigate this, we use a `BroadcastChannel` to notify other tabs when a login has occurred, so that they can sync their `authClient` object.\nexport class AuthBroadcastChannel {\n static #instance: AuthBroadcastChannel | null;\n\n readonly #bc: BroadcastChannel;\n readonly #emitterId: string;\n\n static readonly CHANNEL_NAME: BroadcastChannel['name'] = 'juno_core_auth_channel';\n static readonly MESSAGE_LOGIN_SUCCESS = 'authClientLoginSuccess';\n\n private constructor() {\n this.#bc = new BroadcastChannel(AuthBroadcastChannel.CHANNEL_NAME);\n this.#emitterId = window.crypto.randomUUID();\n }\n\n static getInstance(): AuthBroadcastChannel {\n if (isNullish(this.#instance)) {\n this.#instance = new AuthBroadcastChannel();\n }\n\n return this.#instance;\n }\n\n onLoginSuccess = (handler: () => Promise<void>) => {\n const {\n location: {origin}\n } = window;\n\n this.#bc.onmessage = async ({origin: eventOrigin, data}) => {\n if (\n eventOrigin === origin &&\n nonNullish(data) &&\n (data as BroadcastData).msg === 'authClientLoginSuccess' &&\n notEmptyString((data as BroadcastData).emitterId) &&\n data.emitterId !== this.#emitterId\n ) {\n await handler();\n }\n };\n };\n\n destroy = () => {\n this.#bc.close();\n AuthBroadcastChannel.#instance = null;\n };\n\n postLoginSuccess = () => {\n const data: BroadcastData = {\n emitterId: this.#emitterId,\n msg: AuthBroadcastChannel.MESSAGE_LOGIN_SUCCESS\n };\n\n this.#bc.postMessage(data);\n };\n\n get __test__only__emitter_id__(): string {\n return this.#emitterId;\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", "import {EnvStore} from '../../core/stores/env.store';\nimport {AuthBroadcastChannel} from '../providers/_auth-broadcast.providers';\nimport {AuthClientStore} from '../stores/auth-client.store';\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 safeCreateAuthClient}\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 * @param {boolean} params.syncTabsOnSuccess - Broadcast the successful authentication to other tabs.\n *\n * @returns {Promise<void>} Resolves when authentication is handled and the provided function is executed (if applicable).\n */\nexport const authenticateWithAuthClient = async ({\n fn,\n syncTabsOnSuccess\n}: {\n fn: () => Promise<void>;\n syncTabsOnSuccess: boolean;\n}) => {\n const {authenticated} = await authenticate({fn});\n\n if (!authenticated) {\n return;\n }\n\n if (!syncTabsOnSuccess) {\n return;\n }\n\n // Even though the parameter is called syncTabsOnSuccess we perform the check\n // on the environment variable here. This way we do not have to duplicate the code.\n const env = EnvStore.getInstance().get();\n\n if (env?.syncTabs === false) {\n return;\n }\n\n syncTabs();\n};\n\n/**\n * Creates a new `AuthClient` instance and checks authentication state,\n * then forwards the result to the provided callback function.\n *\n * Unlike {@link authenticateWithAuthClient}, this function does **not**\n * reuse or reset the existing `AuthClient`, and does **not** perform broadcast logic.\n * It simply ensures a fresh client is always created and reports whether it is authenticated.\n *\n * @param {Object} params\n * @param {(params: {authenticated: boolean}) => Promise<void>} params.fn\n * The function to execute with the result of the authentication status.\n *\n * @returns {Promise<void>} Resolves once the callback has been invoked.\n */\nexport const authenticateWithNewAuthClient = async ({\n fn\n}: {\n fn: (params: {authenticated: boolean}) => Promise<void>;\n}) => {\n const {createAuthClient} = AuthClientStore.getInstance();\n\n const authClient = await createAuthClient();\n\n const isAuthenticated = await authClient.isAuthenticated();\n\n await fn({authenticated: isAuthenticated});\n};\n\nconst authenticate = async ({fn}: {fn: () => Promise<void>}): Promise<{authenticated: boolean}> => {\n const {createAuthClient, safeCreateAuthClient} = AuthClientStore.getInstance();\n\n const authClient = await createAuthClient();\n\n const isAuthenticated = await authClient.isAuthenticated();\n\n if (!isAuthenticated) {\n await safeCreateAuthClient();\n return {authenticated: false};\n }\n\n await fn();\n\n return {authenticated: true};\n};\n\nconst syncTabs = () => {\n try {\n // If the user has more than one tab open in the same browser,\n // there could be a mismatch of the cached delegation chain vs the identity key of the `authClient` object.\n // This causes the `authClient` to be unable to correctly sign calls, raising Trust Errors.\n // To mitigate this, we use a BroadcastChannel to notify other tabs when a login has occurred, so that they can sync their `authClient` object.\n const bc = AuthBroadcastChannel.getInstance();\n bc.postLoginSuccess();\n } catch (err: unknown) {\n // We don't really care if the broadcast channel fails to open or if it fails to post messages.\n // This is a non-critical feature that improves the UX when the app is open in multiple tabs.\n // We just print a warning in the console for debugging purposes.\n console.warn('Auth BroadcastChannel posting failed', err);\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_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_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';\nexport const JUNO_AUTH_ERROR_NOT_CONFIGURED = 'juno.auth.error.not_configured';\nexport const JUNO_AUTH_ERROR_AUTOMATION_NOT_CONFIGURED =\n 'juno.auth.error.automation_not_configured';\nexport const JUNO_AUTH_ERROR_OPENID_DISABLED = 'juno.auth.error.openid_disabled';\n\nexport const JUNO_AUTOMATION_TOKEN_ERROR_MISSING_JTI = 'juno.automation.token.error.missing_jti';\nexport const JUNO_AUTOMATION_TOKEN_ERROR_TOKEN_REUSED = 'juno.automation.token.error.token_reused';\nexport const JUNO_AUTOMATION_WORKFLOW_ERROR_MISSING_REPOSITORY =\n 'juno.automation.workflow.error.missing_repository';\nexport const JUNO_AUTOMATION_WORKFLOW_ERROR_MISSING_RUN_ID =\n 'juno.automation.workflow.error.missing_run_id';\nexport const JUNO_DATASTORE_ERROR_AUTOMATION_CALLER = 'juno.datastore.error.automation.caller';\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_REGISTER_PROVIDER_INVALID_DATA =\n 'juno.datastore.error.user.register.provider_invalid_data';\n\nexport const JUNO_AUTH_ERROR_PROFILE_EMAIL_INVALID_LENGTH =\n 'juno.auth.error.profile.data.email_invalid_length';\nexport const JUNO_AUTH_ERROR_PROFILE_NAME_INVALID_LENGTH =\n 'juno.auth.error.profile.data.name_invalid_length';\nexport const JUNO_AUTH_ERROR_PROFILE_GIVEN_NAME_INVALID_LENGTH =\n 'juno.auth.error.profile.data.given_name_invalid_length';\nexport const JUNO_AUTH_ERROR_PROFILE_FAMILY_NAME_INVALID_LENGTH =\n 'juno.auth.error.profile.data.family_name_invalid_length';\nexport const JUNO_AUTH_ERROR_PROFILE_PREFERRED_USERNAME_INVALID_LENGTH =\n 'juno.auth.error.profile.data.preferred_username_invalid_length';\nexport const JUNO_AUTH_ERROR_PROFILE_LOCALE_INVALID_LENGTH =\n 'juno.auth.error.profile.data.locale_invalid_length';\nexport const JUNO_AUTH_ERROR_PROFILE_PICTURE_INVALID_URL =\n 'juno.auth.error.profile.data.picture_invalid_url';\nexport const JUNO_AUTH_ERROR_PROFILE_PICTURE_INVALID_SCHEME =\n 'juno.auth.error.profile.data.picture_invalid_scheme';\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';\nexport const JUNO_ERROR_CONTROLLERS_ADMIN_NO_EXPIRY = 'juno.error.controllers.admin_no_expire';\nexport const JUNO_ERROR_CONTROLLERS_EXPIRY_IN_PAST = 'juno.error.controllers.expiry_in_past';\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_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 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 '@icp-sdk/core/agent';\nimport {nonNullish} from '@junobuild/utils';\nimport {getIdentity as getAuthIdentity} from '../../auth/services/identity.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 type {Identity} from '@icp-sdk/core/agent';\nimport {isNullish} from '@junobuild/utils';\nimport {AuthClientStore} from '../stores/auth-client.store';\nimport {AuthStore} from '../stores/auth.store';\n\nexport const getIdentity = (): Identity | undefined =>\n AuthClientStore.getInstance().getAuthClient()?.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 const {getAuthClient, createAuthClient} = AuthClientStore.getInstance();\n\n return (getAuthClient() ?? (await createAuthClient())).getIdentity();\n};\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 authClient = AuthClientStore.getInstance().getAuthClient();\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 ActorConfig, type ActorMethod, type ActorSubclass} from '@icp-sdk/core/agent';\nimport type {IDL} from '@icp-sdk/core/candid';\nimport type {Principal} from '@icp-sdk/core/principal';\nimport {isNullish} from '@junobuild/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", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.1.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nexport const idlFactory = ({IDL}) => {\n const InitMissionControlArgs = 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 InitStorageMemory = IDL.Variant({\n Heap: IDL.Null,\n Stable: IDL.Null\n });\n const InitStorageArgs = IDL.Record({\n system_memory: IDL.Opt(InitStorageMemory)\n });\n const CreateSatelliteConfig = IDL.Record({\n subnet_id: IDL.Opt(IDL.Principal),\n storage: IDL.Opt(InitStorageArgs),\n name: IDL.Opt(IDL.Text)\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 AccessKeyKind = IDL.Variant({\n Emulator: IDL.Null,\n Automation: IDL.Null\n });\n const AccessKeyScope = IDL.Variant({\n Write: IDL.Null,\n Admin: IDL.Null,\n Submit: IDL.Null\n });\n const AccessKey = IDL.Record({\n updated_at: IDL.Nat64,\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n created_at: IDL.Nat64,\n scope: AccessKeyScope,\n expires_at: IDL.Opt(IDL.Nat64)\n });\n const SetAccessKey = IDL.Record({\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n scope: AccessKeyScope,\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\n return IDL.Service({\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([CreateSatelliteConfig], [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, AccessKey))],\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 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), SetAccessKey], [], []),\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), SetAccessKey],\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), SetAccessKey],\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\nexport const init = ({IDL}) => {\n const InitMissionControlArgs = IDL.Record({user: IDL.Principal});\n\n return [InitMissionControlArgs];\n};\n", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.1.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nexport const idlFactory = ({IDL}) => {\n const InitOrbiterArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal)\n });\n const DeleteControllersArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal)\n });\n const AccessKeyKind = IDL.Variant({\n Emulator: IDL.Null,\n Automation: IDL.Null\n });\n const AccessKeyScope = IDL.Variant({\n Write: IDL.Null,\n Admin: IDL.Null,\n Submit: IDL.Null\n });\n const AccessKey = IDL.Record({\n updated_at: IDL.Nat64,\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n created_at: IDL.Nat64,\n scope: AccessKeyScope,\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 SetAccessKey = IDL.Record({\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n scope: AccessKeyScope,\n expires_at: IDL.Opt(IDL.Nat64)\n });\n const SetControllersArgs = IDL.Record({\n controller: SetAccessKey,\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\n return IDL.Service({\n del_controllers: IDL.Func(\n [DeleteControllersArgs],\n [IDL.Vec(IDL.Tuple(IDL.Principal, AccessKey))],\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, AccessKey))], ['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, AccessKey))],\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\nexport const init = ({IDL}) => {\n const InitOrbiterArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal)\n });\n\n return [InitOrbiterArgs];\n};\n", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.1.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nexport const idlFactory = ({IDL}) => {\n const InitOrbiterArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal)\n });\n const DeleteControllersArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal)\n });\n const AccessKeyKind = IDL.Variant({\n Emulator: IDL.Null,\n Automation: IDL.Null\n });\n const AccessKeyScope = IDL.Variant({\n Write: IDL.Null,\n Admin: IDL.Null,\n Submit: IDL.Null\n });\n const AccessKey = IDL.Record({\n updated_at: IDL.Nat64,\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n created_at: IDL.Nat64,\n scope: AccessKeyScope,\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 SetAccessKey = IDL.Record({\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n scope: AccessKeyScope,\n expires_at: IDL.Opt(IDL.Nat64)\n });\n const SetControllersArgs = IDL.Record({\n controller: SetAccessKey,\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\n return IDL.Service({\n del_controllers: IDL.Func(\n [DeleteControllersArgs],\n [IDL.Vec(IDL.Tuple(IDL.Principal, AccessKey))],\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, AccessKey))], []),\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, AccessKey))],\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\nexport const init = ({IDL}) => {\n const InitOrbiterArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal)\n });\n\n return [InitOrbiterArgs];\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", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.1.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nexport const idlFactory = ({IDL}) => {\n const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});\n const InitStorageArgs = IDL.Record({system_memory: IDL.Opt(Memory)});\n const InitSatelliteArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal),\n storage: IDL.Opt(InitStorageArgs)\n });\n const OpenIdPrepareDelegationArgs = IDL.Record({\n jwt: IDL.Text,\n session_key: IDL.Vec(IDL.Nat8),\n salt: IDL.Vec(IDL.Nat8)\n });\n const AuthenticationArgs = IDL.Variant({\n OpenId: OpenIdPrepareDelegationArgs\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 PreparedDelegation = IDL.Record({\n user_key: IDL.Vec(IDL.Nat8),\n expiration: IDL.Nat64\n });\n const Authentication = IDL.Record({\n doc: Doc,\n delegation: PreparedDelegation\n });\n const JwtFindProviderError = IDL.Variant({\n BadClaim: IDL.Text,\n BadSig: IDL.Text,\n NoMatchingProvider: IDL.Null\n });\n const JwtVerifyError = IDL.Variant({\n WrongKeyType: IDL.Null,\n MissingKid: IDL.Null,\n BadClaim: IDL.Text,\n BadSig: IDL.Text,\n NoKeyForKid: IDL.Null\n });\n const GetOrRefreshJwksError = IDL.Variant({\n InvalidConfig: IDL.Text,\n MissingKid: IDL.Null,\n BadClaim: IDL.Text,\n KeyNotFoundCooldown: IDL.Null,\n CertificateNotFound: IDL.Null,\n BadSig: IDL.Text,\n MissingLastAttempt: IDL.Text,\n KeyNotFound: IDL.Null,\n FetchFailed: IDL.Text\n });\n const PrepareDelegationError = IDL.Variant({\n JwtFindProvider: JwtFindProviderError,\n GetCachedJwks: IDL.Null,\n JwtVerify: JwtVerifyError,\n GetOrFetchJwks: GetOrRefreshJwksError,\n DeriveSeedFailed: IDL.Text,\n InvalidObservatoryId: IDL.Text\n });\n const AuthenticationError = IDL.Variant({\n PrepareDelegation: PrepareDelegationError,\n RegisterUser: IDL.Text\n });\n const AuthenticateResultResponse = IDL.Variant({\n Ok: Authentication,\n Err: AuthenticationError\n });\n const OpenIdPrepareAutomationArgs = IDL.Record({\n jwt: IDL.Text,\n salt: IDL.Vec(IDL.Nat8)\n });\n const AuthenticateAutomationArgs = IDL.Variant({\n OpenId: OpenIdPrepareAutomationArgs\n });\n const AutomationScope = IDL.Variant({\n Write: IDL.Null,\n Submit: IDL.Null\n });\n const AutomationController = IDL.Record({\n scope: AutomationScope,\n expires_at: IDL.Nat64\n });\n const PrepareAutomationError = IDL.Variant({\n JwtFindProvider: JwtFindProviderError,\n InvalidController: IDL.Text,\n GetCachedJwks: IDL.Null,\n JwtVerify: JwtVerifyError,\n GetOrFetchJwks: GetOrRefreshJwksError,\n ControllerAlreadyExists: IDL.Null,\n InvalidObservatoryId: IDL.Text,\n TooManyControllers: IDL.Text\n });\n const AuthenticationAutomationError = IDL.Variant({\n PrepareAutomation: PrepareAutomationError,\n RegisterController: IDL.Text,\n SaveWorkflowMetadata: IDL.Text,\n SaveUniqueJtiToken: IDL.Text\n });\n const AuthenticateAutomationResultResponse = IDL.Variant({\n Ok: IDL.Tuple(IDL.Principal, AutomationController),\n Err: AuthenticationAutomationError\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 CertifyAssetsCursor = IDL.Variant({\n Heap: IDL.Record({offset: IDL.Nat64}),\n Stable: IDL.Record({key: IDL.Opt(AssetKey)})\n });\n const CertifyAssetsStrategy = IDL.Variant({\n Append: IDL.Null,\n Clear: IDL.Null,\n AppendWithRouting: IDL.Null\n });\n const CertifyAssetsArgs = IDL.Record({\n cursor: CertifyAssetsCursor,\n strategy: CertifyAssetsStrategy,\n chunk_size: IDL.Opt(IDL.Nat32)\n });\n const CertifyAssetsResult = IDL.Record({\n next_cursor: IDL.Opt(CertifyAssetsCursor)\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 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 AccessKeyKind = IDL.Variant({\n Emulator: IDL.Null,\n Automation: IDL.Null\n });\n const AccessKeyScope = IDL.Variant({\n Write: IDL.Null,\n Admin: IDL.Null,\n Submit: IDL.Null\n });\n const AccessKey = IDL.Record({\n updated_at: IDL.Nat64,\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n created_at: IDL.Nat64,\n scope: AccessKeyScope,\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 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 OpenIdDelegationProvider = IDL.Variant({\n GitHub: IDL.Null,\n Google: IDL.Null\n });\n const OpenIdAuthProviderDelegationConfig = IDL.Record({\n targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n max_time_to_live: IDL.Opt(IDL.Nat64)\n });\n const OpenIdAuthProviderConfig = IDL.Record({\n delegation: IDL.Opt(OpenIdAuthProviderDelegationConfig),\n client_id: IDL.Text\n });\n const AuthenticationConfigOpenId = IDL.Record({\n observatory_id: IDL.Opt(IDL.Principal),\n providers: IDL.Vec(IDL.Tuple(OpenIdDelegationProvider, OpenIdAuthProviderConfig))\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 openid: IDL.Opt(AuthenticationConfigOpenId),\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 OpenIdAutomationProvider = IDL.Variant({GitHub: IDL.Null});\n const OpenIdAutomationProviderControllerConfig = IDL.Record({\n scope: IDL.Opt(AutomationScope),\n max_time_to_live: IDL.Opt(IDL.Nat64)\n });\n const RepositoryKey = IDL.Record({owner: IDL.Text, name: IDL.Text});\n const OpenIdAutomationRepositoryConfig = IDL.Record({\n refs: IDL.Opt(IDL.Vec(IDL.Text))\n });\n const OpenIdAutomationProviderConfig = IDL.Record({\n controller: IDL.Opt(OpenIdAutomationProviderControllerConfig),\n repositories: IDL.Vec(IDL.Tuple(RepositoryKey, OpenIdAutomationRepositoryConfig))\n });\n const AutomationConfigOpenId = IDL.Record({\n observatory_id: IDL.Opt(IDL.Principal),\n providers: IDL.Vec(IDL.Tuple(OpenIdAutomationProvider, OpenIdAutomationProviderConfig))\n });\n const AutomationConfig = IDL.Record({\n updated_at: IDL.Opt(IDL.Nat64),\n openid: IDL.Opt(AutomationConfigOpenId),\n created_at: IDL.Opt(IDL.Nat64),\n version: IDL.Opt(IDL.Nat64)\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 automation: IDL.Opt(AutomationConfig)\n });\n const OpenIdGetDelegationArgs = IDL.Record({\n jwt: IDL.Text,\n session_key: IDL.Vec(IDL.Nat8),\n salt: IDL.Vec(IDL.Nat8),\n expiration: IDL.Nat64\n });\n const GetDelegationArgs = IDL.Variant({OpenId: OpenIdGetDelegationArgs});\n const Delegation = IDL.Record({\n pubkey: IDL.Vec(IDL.Nat8),\n targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n expiration: IDL.Nat64\n });\n const SignedDelegation = IDL.Record({\n signature: IDL.Vec(IDL.Nat8),\n delegation: Delegation\n });\n const GetDelegationError = IDL.Variant({\n JwtFindProvider: JwtFindProviderError,\n GetCachedJwks: IDL.Null,\n NoSuchDelegation: IDL.Null,\n JwtVerify: JwtVerifyError,\n GetOrFetchJwks: GetOrRefreshJwksError,\n DeriveSeedFailed: IDL.Text,\n InvalidObservatoryId: IDL.Text\n });\n const GetDelegationResultResponse = IDL.Variant({\n Ok: SignedDelegation,\n Err: GetDelegationError\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 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 openid: IDL.Opt(AuthenticationConfigOpenId),\n version: IDL.Opt(IDL.Nat64),\n internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n rules: IDL.Opt(AuthenticationRules)\n });\n const SetAutomationConfig = IDL.Record({\n openid: IDL.Opt(AutomationConfigOpenId),\n version: IDL.Opt(IDL.Nat64)\n });\n const SetAccessKey = IDL.Record({\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n scope: AccessKeyScope,\n expires_at: IDL.Opt(IDL.Nat64)\n });\n const SetControllersArgs = IDL.Record({\n controller: SetAccessKey,\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 SetStorageConfigOptions = IDL.Record({\n skip_certification: IDL.Opt(IDL.Bool)\n });\n const SetStorageConfigWithOptions = IDL.Record({\n config: SetStorageConfig,\n options: SetStorageConfigOptions\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\n return IDL.Service({\n authenticate: IDL.Func([AuthenticationArgs], [AuthenticateResultResponse], []),\n authenticate_automation: IDL.Func(\n [AuthenticateAutomationArgs],\n [AuthenticateAutomationResultResponse],\n []\n ),\n certify_assets_chunk: IDL.Func([CertifyAssetsArgs], [CertifyAssetsResult], []),\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_controller_self: IDL.Func([], [], []),\n del_controllers: IDL.Func(\n [DeleteControllersArgs],\n [IDL.Vec(IDL.Tuple(IDL.Principal, AccessKey))],\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_automation_config: IDL.Func([], [IDL.Opt(AutomationConfig)], ['query']),\n get_config: IDL.Func([], [Config], []),\n get_db_config: IDL.Func([], [IDL.Opt(DbConfig)], ['query']),\n get_delegation: IDL.Func([GetDelegationArgs], [GetDelegationResultResponse], ['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, AccessKey))], ['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_asset_token: IDL.Func([IDL.Text, IDL.Text, IDL.Opt(IDL.Text)], [], []),\n set_auth_config: IDL.Func([SetAuthenticationConfig], [AuthenticationConfig], []),\n set_automation_config: IDL.Func([SetAutomationConfig], [AutomationConfig], []),\n set_controllers: IDL.Func(\n [SetControllersArgs],\n [IDL.Vec(IDL.Tuple(IDL.Principal, AccessKey))],\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 set_storage_config_with_options: IDL.Func([SetStorageConfigWithOptions], [StorageConfig], []),\n submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),\n switch_storage_system_memory: IDL.Func([], [], []),\n upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),\n upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])\n });\n};\n\nexport const init = ({IDL}) => {\n const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});\n const InitStorageArgs = IDL.Record({system_memory: IDL.Opt(Memory)});\n const InitSatelliteArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal),\n storage: IDL.Opt(InitStorageArgs)\n });\n\n return [InitSatelliteArgs];\n};\n", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.1.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nexport const idlFactory = ({IDL}) => {\n const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});\n const InitStorageArgs = IDL.Record({system_memory: IDL.Opt(Memory)});\n const InitSatelliteArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal),\n storage: IDL.Opt(InitStorageArgs)\n });\n const OpenIdPrepareDelegationArgs = IDL.Record({\n jwt: IDL.Text,\n session_key: IDL.Vec(IDL.Nat8),\n salt: IDL.Vec(IDL.Nat8)\n });\n const AuthenticationArgs = IDL.Variant({\n OpenId: OpenIdPrepareDelegationArgs\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 PreparedDelegation = IDL.Record({\n user_key: IDL.Vec(IDL.Nat8),\n expiration: IDL.Nat64\n });\n const Authentication = IDL.Record({\n doc: Doc,\n delegation: PreparedDelegation\n });\n const JwtFindProviderError = IDL.Variant({\n BadClaim: IDL.Text,\n BadSig: IDL.Text,\n NoMatchingProvider: IDL.Null\n });\n const JwtVerifyError = IDL.Variant({\n WrongKeyType: IDL.Null,\n MissingKid: IDL.Null,\n BadClaim: IDL.Text,\n BadSig: IDL.Text,\n NoKeyForKid: IDL.Null\n });\n const GetOrRefreshJwksError = IDL.Variant({\n InvalidConfig: IDL.Text,\n MissingKid: IDL.Null,\n BadClaim: IDL.Text,\n KeyNotFoundCooldown: IDL.Null,\n CertificateNotFound: IDL.Null,\n BadSig: IDL.Text,\n MissingLastAttempt: IDL.Text,\n KeyNotFound: IDL.Null,\n FetchFailed: IDL.Text\n });\n const PrepareDelegationError = IDL.Variant({\n JwtFindProvider: JwtFindProviderError,\n GetCachedJwks: IDL.Null,\n JwtVerify: JwtVerifyError,\n GetOrFetchJwks: GetOrRefreshJwksError,\n DeriveSeedFailed: IDL.Text,\n InvalidObservatoryId: IDL.Text\n });\n const AuthenticationError = IDL.Variant({\n PrepareDelegation: PrepareDelegationError,\n RegisterUser: IDL.Text\n });\n const AuthenticateResultResponse = IDL.Variant({\n Ok: Authentication,\n Err: AuthenticationError\n });\n const OpenIdPrepareAutomationArgs = IDL.Record({\n jwt: IDL.Text,\n salt: IDL.Vec(IDL.Nat8)\n });\n const AuthenticateAutomationArgs = IDL.Variant({\n OpenId: OpenIdPrepareAutomationArgs\n });\n const AutomationScope = IDL.Variant({\n Write: IDL.Null,\n Submit: IDL.Null\n });\n const AutomationController = IDL.Record({\n scope: AutomationScope,\n expires_at: IDL.Nat64\n });\n const PrepareAutomationError = IDL.Variant({\n JwtFindProvider: JwtFindProviderError,\n InvalidController: IDL.Text,\n GetCachedJwks: IDL.Null,\n JwtVerify: JwtVerifyError,\n GetOrFetchJwks: GetOrRefreshJwksError,\n ControllerAlreadyExists: IDL.Null,\n InvalidObservatoryId: IDL.Text,\n TooManyControllers: IDL.Text\n });\n const AuthenticationAutomationError = IDL.Variant({\n PrepareAutomation: PrepareAutomationError,\n RegisterController: IDL.Text,\n SaveWorkflowMetadata: IDL.Text,\n SaveUniqueJtiToken: IDL.Text\n });\n const AuthenticateAutomationResultResponse = IDL.Variant({\n Ok: IDL.Tuple(IDL.Principal, AutomationController),\n Err: AuthenticationAutomationError\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 CertifyAssetsCursor = IDL.Variant({\n Heap: IDL.Record({offset: IDL.Nat64}),\n Stable: IDL.Record({key: IDL.Opt(AssetKey)})\n });\n const CertifyAssetsStrategy = IDL.Variant({\n Append: IDL.Null,\n Clear: IDL.Null,\n AppendWithRouting: IDL.Null\n });\n const CertifyAssetsArgs = IDL.Record({\n cursor: CertifyAssetsCursor,\n strategy: CertifyAssetsStrategy,\n chunk_size: IDL.Opt(IDL.Nat32)\n });\n const CertifyAssetsResult = IDL.Record({\n next_cursor: IDL.Opt(CertifyAssetsCursor)\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 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 AccessKeyKind = IDL.Variant({\n Emulator: IDL.Null,\n Automation: IDL.Null\n });\n const AccessKeyScope = IDL.Variant({\n Write: IDL.Null,\n Admin: IDL.Null,\n Submit: IDL.Null\n });\n const AccessKey = IDL.Record({\n updated_at: IDL.Nat64,\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n created_at: IDL.Nat64,\n scope: AccessKeyScope,\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 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 OpenIdDelegationProvider = IDL.Variant({\n GitHub: IDL.Null,\n Google: IDL.Null\n });\n const OpenIdAuthProviderDelegationConfig = IDL.Record({\n targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n max_time_to_live: IDL.Opt(IDL.Nat64)\n });\n const OpenIdAuthProviderConfig = IDL.Record({\n delegation: IDL.Opt(OpenIdAuthProviderDelegationConfig),\n client_id: IDL.Text\n });\n const AuthenticationConfigOpenId = IDL.Record({\n observatory_id: IDL.Opt(IDL.Principal),\n providers: IDL.Vec(IDL.Tuple(OpenIdDelegationProvider, OpenIdAuthProviderConfig))\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 openid: IDL.Opt(AuthenticationConfigOpenId),\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 OpenIdAutomationProvider = IDL.Variant({GitHub: IDL.Null});\n const OpenIdAutomationProviderControllerConfig = IDL.Record({\n scope: IDL.Opt(AutomationScope),\n max_time_to_live: IDL.Opt(IDL.Nat64)\n });\n const RepositoryKey = IDL.Record({owner: IDL.Text, name: IDL.Text});\n const OpenIdAutomationRepositoryConfig = IDL.Record({\n refs: IDL.Opt(IDL.Vec(IDL.Text))\n });\n const OpenIdAutomationProviderConfig = IDL.Record({\n controller: IDL.Opt(OpenIdAutomationProviderControllerConfig),\n repositories: IDL.Vec(IDL.Tuple(RepositoryKey, OpenIdAutomationRepositoryConfig))\n });\n const AutomationConfigOpenId = IDL.Record({\n observatory_id: IDL.Opt(IDL.Principal),\n providers: IDL.Vec(IDL.Tuple(OpenIdAutomationProvider, OpenIdAutomationProviderConfig))\n });\n const AutomationConfig = IDL.Record({\n updated_at: IDL.Opt(IDL.Nat64),\n openid: IDL.Opt(AutomationConfigOpenId),\n created_at: IDL.Opt(IDL.Nat64),\n version: IDL.Opt(IDL.Nat64)\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 automation: IDL.Opt(AutomationConfig)\n });\n const OpenIdGetDelegationArgs = IDL.Record({\n jwt: IDL.Text,\n session_key: IDL.Vec(IDL.Nat8),\n salt: IDL.Vec(IDL.Nat8),\n expiration: IDL.Nat64\n });\n const GetDelegationArgs = IDL.Variant({OpenId: OpenIdGetDelegationArgs});\n const Delegation = IDL.Record({\n pubkey: IDL.Vec(IDL.Nat8),\n targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n expiration: IDL.Nat64\n });\n const SignedDelegation = IDL.Record({\n signature: IDL.Vec(IDL.Nat8),\n delegation: Delegation\n });\n const GetDelegationError = IDL.Variant({\n JwtFindProvider: JwtFindProviderError,\n GetCachedJwks: IDL.Null,\n NoSuchDelegation: IDL.Null,\n JwtVerify: JwtVerifyError,\n GetOrFetchJwks: GetOrRefreshJwksError,\n DeriveSeedFailed: IDL.Text,\n InvalidObservatoryId: IDL.Text\n });\n const GetDelegationResultResponse = IDL.Variant({\n Ok: SignedDelegation,\n Err: GetDelegationError\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 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 openid: IDL.Opt(AuthenticationConfigOpenId),\n version: IDL.Opt(IDL.Nat64),\n internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n rules: IDL.Opt(AuthenticationRules)\n });\n const SetAutomationConfig = IDL.Record({\n openid: IDL.Opt(AutomationConfigOpenId),\n version: IDL.Opt(IDL.Nat64)\n });\n const SetAccessKey = IDL.Record({\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n scope: AccessKeyScope,\n expires_at: IDL.Opt(IDL.Nat64)\n });\n const SetControllersArgs = IDL.Record({\n controller: SetAccessKey,\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 SetStorageConfigOptions = IDL.Record({\n skip_certification: IDL.Opt(IDL.Bool)\n });\n const SetStorageConfigWithOptions = IDL.Record({\n config: SetStorageConfig,\n options: SetStorageConfigOptions\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\n return IDL.Service({\n authenticate: IDL.Func([AuthenticationArgs], [AuthenticateResultResponse], []),\n authenticate_automation: IDL.Func(\n [AuthenticateAutomationArgs],\n [AuthenticateAutomationResultResponse],\n []\n ),\n certify_assets_chunk: IDL.Func([CertifyAssetsArgs], [CertifyAssetsResult], []),\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_controller_self: IDL.Func([], [], []),\n del_controllers: IDL.Func(\n [DeleteControllersArgs],\n [IDL.Vec(IDL.Tuple(IDL.Principal, AccessKey))],\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_automation_config: IDL.Func([], [IDL.Opt(AutomationConfig)], []),\n get_config: IDL.Func([], [Config], []),\n get_db_config: IDL.Func([], [IDL.Opt(DbConfig)], []),\n get_delegation: IDL.Func([GetDelegationArgs], [GetDelegationResultResponse], []),\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, AccessKey))], []),\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_asset_token: IDL.Func([IDL.Text, IDL.Text, IDL.Opt(IDL.Text)], [], []),\n set_auth_config: IDL.Func([SetAuthenticationConfig], [AuthenticationConfig], []),\n set_automation_config: IDL.Func([SetAutomationConfig], [AutomationConfig], []),\n set_controllers: IDL.Func(\n [SetControllersArgs],\n [IDL.Vec(IDL.Tuple(IDL.Principal, AccessKey))],\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 set_storage_config_with_options: IDL.Func([SetStorageConfigWithOptions], [StorageConfig], []),\n submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),\n switch_storage_system_memory: IDL.Func([], [], []),\n upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),\n upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])\n });\n};\n\nexport const init = ({IDL}) => {\n const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});\n const InitStorageArgs = IDL.Record({system_memory: IDL.Opt(Memory)});\n const InitSatelliteArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal),\n storage: IDL.Opt(InitStorageArgs)\n });\n\n return [InitSatelliteArgs];\n};\n", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.1.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\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 OpenIdPrepareDelegationArgs = IDL.Record({\n jwt: IDL.Text,\n session_key: IDL.Vec(IDL.Nat8),\n salt: IDL.Vec(IDL.Nat8)\n });\n const AuthenticationArgs = IDL.Variant({\n OpenId: OpenIdPrepareDelegationArgs\n });\n const PreparedDelegation = IDL.Record({\n user_key: IDL.Vec(IDL.Nat8),\n expiration: IDL.Nat64\n });\n const OpenIdDelegationProvider = IDL.Variant({\n GitHub: IDL.Null,\n Google: IDL.Null\n });\n const OpenIdData = IDL.Record({\n name: IDL.Opt(IDL.Text),\n locale: IDL.Opt(IDL.Text),\n family_name: IDL.Opt(IDL.Text),\n email: IDL.Opt(IDL.Text),\n picture: IDL.Opt(IDL.Text),\n given_name: IDL.Opt(IDL.Text),\n preferred_username: IDL.Opt(IDL.Text)\n });\n const OpenId = IDL.Record({\n provider: OpenIdDelegationProvider,\n data: OpenIdData\n });\n const Provider = IDL.Variant({\n InternetIdentity: IDL.Null,\n OpenId: OpenId\n });\n const Account = IDL.Record({\n updated_at: IDL.Nat64,\n credits: Tokens,\n mission_control_id: IDL.Opt(IDL.Principal),\n provider: IDL.Opt(Provider),\n owner: IDL.Principal,\n created_at: IDL.Nat64\n });\n const Authentication = IDL.Record({\n delegation: PreparedDelegation,\n account: Account\n });\n const JwtFindProviderError = IDL.Variant({\n BadClaim: IDL.Text,\n BadSig: IDL.Text,\n NoMatchingProvider: IDL.Null\n });\n const JwtVerifyError = IDL.Variant({\n WrongKeyType: IDL.Null,\n MissingKid: IDL.Null,\n BadClaim: IDL.Text,\n BadSig: IDL.Text,\n NoKeyForKid: IDL.Null\n });\n const GetOrRefreshJwksError = IDL.Variant({\n InvalidConfig: IDL.Text,\n MissingKid: IDL.Null,\n BadClaim: IDL.Text,\n KeyNotFoundCooldown: IDL.Null,\n CertificateNotFound: IDL.Null,\n BadSig: IDL.Text,\n MissingLastAttempt: IDL.Text,\n KeyNotFound: IDL.Null,\n FetchFailed: IDL.Text\n });\n const PrepareDelegationError = IDL.Variant({\n JwtFindProvider: JwtFindProviderError,\n GetCachedJwks: IDL.Null,\n JwtVerify: JwtVerifyError,\n GetOrFetchJwks: GetOrRefreshJwksError,\n DeriveSeedFailed: IDL.Text,\n InvalidObservatoryId: IDL.Text\n });\n const AuthenticationError = IDL.Variant({\n PrepareDelegation: PrepareDelegationError,\n RegisterUser: IDL.Text\n });\n const Result = IDL.Variant({\n Ok: Authentication,\n Err: AuthenticationError\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 CreateMissionControlArgs = IDL.Record({\n subnet_id: IDL.Opt(IDL.Principal)\n });\n const CreateOrbiterArgs = IDL.Record({\n block_index: IDL.Opt(IDL.Nat64),\n subnet_id: IDL.Opt(IDL.Principal),\n name: IDL.Opt(IDL.Text),\n user: IDL.Principal\n });\n const InitStorageMemory = IDL.Variant({\n Heap: IDL.Null,\n Stable: IDL.Null\n });\n const InitStorageArgs = IDL.Record({\n system_memory: IDL.Opt(InitStorageMemory)\n });\n const CreateSatelliteArgs = IDL.Record({\n block_index: IDL.Opt(IDL.Nat64),\n subnet_id: IDL.Opt(IDL.Principal),\n storage: IDL.Opt(InitStorageArgs),\n name: IDL.Opt(IDL.Text),\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 OpenIdAuthProviderDelegationConfig = IDL.Record({\n targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n max_time_to_live: IDL.Opt(IDL.Nat64)\n });\n const OpenIdAuthProviderConfig = IDL.Record({\n delegation: IDL.Opt(OpenIdAuthProviderDelegationConfig),\n client_id: IDL.Text\n });\n const AuthenticationConfigOpenId = IDL.Record({\n observatory_id: IDL.Opt(IDL.Principal),\n providers: IDL.Vec(IDL.Tuple(OpenIdDelegationProvider, OpenIdAuthProviderConfig))\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 openid: IDL.Opt(AuthenticationConfigOpenId),\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 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({\n authentication: IDL.Opt(AuthenticationConfig),\n storage: StorageConfig\n });\n const GetCreateCanisterFeeArgs = IDL.Record({user: IDL.Principal});\n const OpenIdGetDelegationArgs = IDL.Record({\n jwt: IDL.Text,\n session_key: IDL.Vec(IDL.Nat8),\n salt: IDL.Vec(IDL.Nat8),\n expiration: IDL.Nat64\n });\n const GetDelegationArgs = IDL.Variant({OpenId: OpenIdGetDelegationArgs});\n const Delegation = IDL.Record({\n pubkey: IDL.Vec(IDL.Nat8),\n targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n expiration: IDL.Nat64\n });\n const SignedDelegation = IDL.Record({\n signature: IDL.Vec(IDL.Nat8),\n delegation: Delegation\n });\n const GetDelegationError = IDL.Variant({\n JwtFindProvider: JwtFindProviderError,\n GetCachedJwks: IDL.Null,\n NoSuchDelegation: IDL.Null,\n JwtVerify: JwtVerifyError,\n GetOrFetchJwks: GetOrRefreshJwksError,\n DeriveSeedFailed: IDL.Text,\n InvalidObservatoryId: IDL.Text\n });\n const Result_1 = IDL.Variant({\n Ok: SignedDelegation,\n Err: GetDelegationError\n });\n const SegmentKind = IDL.Variant({\n Orbiter: IDL.Null,\n MissionControl: IDL.Null,\n Satellite: IDL.Null\n });\n const CyclesTokens = IDL.Record({e12s: IDL.Nat64});\n const FactoryFee = IDL.Record({\n updated_at: IDL.Nat64,\n fee_cycles: CyclesTokens,\n fee_icp: IDL.Opt(Tokens)\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 RateConfig = IDL.Record({\n max_tokens: IDL.Nat64,\n time_per_token_ns: 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 AccessKeyKind = IDL.Variant({\n Emulator: IDL.Null,\n Automation: IDL.Null\n });\n const AccessKeyScope = IDL.Variant({\n Write: IDL.Null,\n Admin: IDL.Null,\n Submit: IDL.Null\n });\n const AccessKey = IDL.Record({\n updated_at: IDL.Nat64,\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n created_at: IDL.Nat64,\n scope: AccessKeyScope,\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 IcpPayment = 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 IcrcPaymentKey = IDL.Record({\n block_index: IDL.Nat64,\n ledger_id: IDL.Principal\n });\n const Account_1 = IDL.Record({\n owner: IDL.Principal,\n subaccount: IDL.Opt(IDL.Vec(IDL.Nat8))\n });\n const IcrcPayment = IDL.Record({\n status: PaymentStatus,\n updated_at: IDL.Nat64,\n created_at: IDL.Nat64,\n block_index_refunded: IDL.Opt(IDL.Nat64),\n purchaser: Account_1\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 StorableSegmentKind = IDL.Variant({\n Orbiter: IDL.Null,\n Satellite: IDL.Null\n });\n const ListSegmentsArgs = IDL.Record({\n segment_id: IDL.Opt(IDL.Principal),\n segment_kind: IDL.Opt(StorableSegmentKind)\n });\n const SegmentKey = IDL.Record({\n user: IDL.Principal,\n segment_id: IDL.Principal,\n segment_kind: StorableSegmentKind\n });\n const Segment = IDL.Record({\n updated_at: IDL.Nat64,\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n segment_id: IDL.Principal,\n created_at: IDL.Nat64\n });\n const SetAuthenticationConfig = IDL.Record({\n openid: IDL.Opt(AuthenticationConfigOpenId),\n version: IDL.Opt(IDL.Nat64),\n internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n rules: IDL.Opt(AuthenticationRules)\n });\n const SetAccessKey = IDL.Record({\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n scope: AccessKeyScope,\n expires_at: IDL.Opt(IDL.Nat64)\n });\n const SetControllersArgs = IDL.Record({\n controller: SetAccessKey,\n controllers: IDL.Vec(IDL.Principal)\n });\n const FeesArgs = IDL.Record({\n fee_cycles: CyclesTokens,\n fee_icp: IDL.Opt(Tokens)\n });\n const SetSegmentsArgs = IDL.Record({\n metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))),\n segment_id: IDL.Principal,\n segment_kind: StorableSegmentKind\n });\n const SetSegmentMetadataArgs = IDL.Record({\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n segment_id: IDL.Principal,\n segment_kind: StorableSegmentKind\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 UnsetSegmentsArgs = IDL.Record({\n segment_id: IDL.Principal,\n segment_kind: StorableSegmentKind\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\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 authenticate: IDL.Func([AuthenticationArgs], [Result], []),\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_mission_control: IDL.Func([CreateMissionControlArgs], [IDL.Principal], []),\n create_orbiter: IDL.Func([CreateOrbiterArgs], [IDL.Principal], []),\n create_satellite: IDL.Func([CreateSatelliteArgs], [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_account: IDL.Func([], [IDL.Opt(Account)], ['query']),\n get_auth_config: IDL.Func([], [IDL.Opt(AuthenticationConfig)], ['query']),\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_delegation: IDL.Func([GetDelegationArgs], [Result_1], ['query']),\n get_fee: IDL.Func([SegmentKind], [FactoryFee], ['query']),\n get_or_init_account: IDL.Func([], [Account], []),\n get_proposal: IDL.Func([IDL.Nat], [IDL.Opt(Proposal)], ['query']),\n get_rate_config: IDL.Func([SegmentKind], [RateConfig], ['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_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_accounts: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Account))], ['query']),\n list_assets: IDL.Func([IDL.Text, ListParams], [ListResults], ['query']),\n list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, AccessKey))], ['query']),\n list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], ['query']),\n list_icp_payments: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Nat64, IcpPayment))], ['query']),\n list_icrc_payments: IDL.Func([], [IDL.Vec(IDL.Tuple(IcrcPaymentKey, IcrcPayment))], ['query']),\n list_proposals: IDL.Func([ListProposalsParams], [ListProposalResults], ['query']),\n list_segments: IDL.Func(\n [ListSegmentsArgs],\n [IDL.Vec(IDL.Tuple(SegmentKey, Segment))],\n ['query']\n ),\n reject_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n set_auth_config: IDL.Func([SetAuthenticationConfig], [AuthenticationConfig], []),\n set_controllers: IDL.Func([SetControllersArgs], [], []),\n set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),\n set_fee: IDL.Func([SegmentKind, FeesArgs], [], []),\n set_many_segments: IDL.Func([IDL.Vec(SetSegmentsArgs)], [IDL.Vec(Segment)], []),\n set_rate_config: IDL.Func([SegmentKind, RateConfig], [], []),\n set_segment: IDL.Func([SetSegmentsArgs], [Segment], []),\n set_segment_metadata: IDL.Func([SetSegmentMetadataArgs], [Segment], []),\n set_storage_config: IDL.Func([SetStorageConfig], [StorageConfig], []),\n submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),\n unset_many_segments: IDL.Func([IDL.Vec(UnsetSegmentsArgs)], [], []),\n unset_segment: IDL.Func([UnsetSegmentsArgs], [], []),\n upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])\n });\n};\n\nexport const init = ({IDL}) => {\n return [];\n};\n", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.1.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\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 OpenIdPrepareDelegationArgs = IDL.Record({\n jwt: IDL.Text,\n session_key: IDL.Vec(IDL.Nat8),\n salt: IDL.Vec(IDL.Nat8)\n });\n const AuthenticationArgs = IDL.Variant({\n OpenId: OpenIdPrepareDelegationArgs\n });\n const PreparedDelegation = IDL.Record({\n user_key: IDL.Vec(IDL.Nat8),\n expiration: IDL.Nat64\n });\n const OpenIdDelegationProvider = IDL.Variant({\n GitHub: IDL.Null,\n Google: IDL.Null\n });\n const OpenIdData = IDL.Record({\n name: IDL.Opt(IDL.Text),\n locale: IDL.Opt(IDL.Text),\n family_name: IDL.Opt(IDL.Text),\n email: IDL.Opt(IDL.Text),\n picture: IDL.Opt(IDL.Text),\n given_name: IDL.Opt(IDL.Text),\n preferred_username: IDL.Opt(IDL.Text)\n });\n const OpenId = IDL.Record({\n provider: OpenIdDelegationProvider,\n data: OpenIdData\n });\n const Provider = IDL.Variant({\n InternetIdentity: IDL.Null,\n OpenId: OpenId\n });\n const Account = IDL.Record({\n updated_at: IDL.Nat64,\n credits: Tokens,\n mission_control_id: IDL.Opt(IDL.Principal),\n provider: IDL.Opt(Provider),\n owner: IDL.Principal,\n created_at: IDL.Nat64\n });\n const Authentication = IDL.Record({\n delegation: PreparedDelegation,\n account: Account\n });\n const JwtFindProviderError = IDL.Variant({\n BadClaim: IDL.Text,\n BadSig: IDL.Text,\n NoMatchingProvider: IDL.Null\n });\n const JwtVerifyError = IDL.Variant({\n WrongKeyType: IDL.Null,\n MissingKid: IDL.Null,\n BadClaim: IDL.Text,\n BadSig: IDL.Text,\n NoKeyForKid: IDL.Null\n });\n const GetOrRefreshJwksError = IDL.Variant({\n InvalidConfig: IDL.Text,\n MissingKid: IDL.Null,\n BadClaim: IDL.Text,\n KeyNotFoundCooldown: IDL.Null,\n CertificateNotFound: IDL.Null,\n BadSig: IDL.Text,\n MissingLastAttempt: IDL.Text,\n KeyNotFound: IDL.Null,\n FetchFailed: IDL.Text\n });\n const PrepareDelegationError = IDL.Variant({\n JwtFindProvider: JwtFindProviderError,\n GetCachedJwks: IDL.Null,\n JwtVerify: JwtVerifyError,\n GetOrFetchJwks: GetOrRefreshJwksError,\n DeriveSeedFailed: IDL.Text,\n InvalidObservatoryId: IDL.Text\n });\n const AuthenticationError = IDL.Variant({\n PrepareDelegation: PrepareDelegationError,\n RegisterUser: IDL.Text\n });\n const Result = IDL.Variant({\n Ok: Authentication,\n Err: AuthenticationError\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 CreateMissionControlArgs = IDL.Record({\n subnet_id: IDL.Opt(IDL.Principal)\n });\n const CreateOrbiterArgs = IDL.Record({\n block_index: IDL.Opt(IDL.Nat64),\n subnet_id: IDL.Opt(IDL.Principal),\n name: IDL.Opt(IDL.Text),\n user: IDL.Principal\n });\n const InitStorageMemory = IDL.Variant({\n Heap: IDL.Null,\n Stable: IDL.Null\n });\n const InitStorageArgs = IDL.Record({\n system_memory: IDL.Opt(InitStorageMemory)\n });\n const CreateSatelliteArgs = IDL.Record({\n block_index: IDL.Opt(IDL.Nat64),\n subnet_id: IDL.Opt(IDL.Principal),\n storage: IDL.Opt(InitStorageArgs),\n name: IDL.Opt(IDL.Text),\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 OpenIdAuthProviderDelegationConfig = IDL.Record({\n targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n max_time_to_live: IDL.Opt(IDL.Nat64)\n });\n const OpenIdAuthProviderConfig = IDL.Record({\n delegation: IDL.Opt(OpenIdAuthProviderDelegationConfig),\n client_id: IDL.Text\n });\n const AuthenticationConfigOpenId = IDL.Record({\n observatory_id: IDL.Opt(IDL.Principal),\n providers: IDL.Vec(IDL.Tuple(OpenIdDelegationProvider, OpenIdAuthProviderConfig))\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 openid: IDL.Opt(AuthenticationConfigOpenId),\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 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({\n authentication: IDL.Opt(AuthenticationConfig),\n storage: StorageConfig\n });\n const GetCreateCanisterFeeArgs = IDL.Record({user: IDL.Principal});\n const OpenIdGetDelegationArgs = IDL.Record({\n jwt: IDL.Text,\n session_key: IDL.Vec(IDL.Nat8),\n salt: IDL.Vec(IDL.Nat8),\n expiration: IDL.Nat64\n });\n const GetDelegationArgs = IDL.Variant({OpenId: OpenIdGetDelegationArgs});\n const Delegation = IDL.Record({\n pubkey: IDL.Vec(IDL.Nat8),\n targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n expiration: IDL.Nat64\n });\n const SignedDelegation = IDL.Record({\n signature: IDL.Vec(IDL.Nat8),\n delegation: Delegation\n });\n const GetDelegationError = IDL.Variant({\n JwtFindProvider: JwtFindProviderError,\n GetCachedJwks: IDL.Null,\n NoSuchDelegation: IDL.Null,\n JwtVerify: JwtVerifyError,\n GetOrFetchJwks: GetOrRefreshJwksError,\n DeriveSeedFailed: IDL.Text,\n InvalidObservatoryId: IDL.Text\n });\n const Result_1 = IDL.Variant({\n Ok: SignedDelegation,\n Err: GetDelegationError\n });\n const SegmentKind = IDL.Variant({\n Orbiter: IDL.Null,\n MissionControl: IDL.Null,\n Satellite: IDL.Null\n });\n const CyclesTokens = IDL.Record({e12s: IDL.Nat64});\n const FactoryFee = IDL.Record({\n updated_at: IDL.Nat64,\n fee_cycles: CyclesTokens,\n fee_icp: IDL.Opt(Tokens)\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 RateConfig = IDL.Record({\n max_tokens: IDL.Nat64,\n time_per_token_ns: 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 AccessKeyKind = IDL.Variant({\n Emulator: IDL.Null,\n Automation: IDL.Null\n });\n const AccessKeyScope = IDL.Variant({\n Write: IDL.Null,\n Admin: IDL.Null,\n Submit: IDL.Null\n });\n const AccessKey = IDL.Record({\n updated_at: IDL.Nat64,\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n created_at: IDL.Nat64,\n scope: AccessKeyScope,\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 IcpPayment = 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 IcrcPaymentKey = IDL.Record({\n block_index: IDL.Nat64,\n ledger_id: IDL.Principal\n });\n const Account_1 = IDL.Record({\n owner: IDL.Principal,\n subaccount: IDL.Opt(IDL.Vec(IDL.Nat8))\n });\n const IcrcPayment = IDL.Record({\n status: PaymentStatus,\n updated_at: IDL.Nat64,\n created_at: IDL.Nat64,\n block_index_refunded: IDL.Opt(IDL.Nat64),\n purchaser: Account_1\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 StorableSegmentKind = IDL.Variant({\n Orbiter: IDL.Null,\n Satellite: IDL.Null\n });\n const ListSegmentsArgs = IDL.Record({\n segment_id: IDL.Opt(IDL.Principal),\n segment_kind: IDL.Opt(StorableSegmentKind)\n });\n const SegmentKey = IDL.Record({\n user: IDL.Principal,\n segment_id: IDL.Principal,\n segment_kind: StorableSegmentKind\n });\n const Segment = IDL.Record({\n updated_at: IDL.Nat64,\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n segment_id: IDL.Principal,\n created_at: IDL.Nat64\n });\n const SetAuthenticationConfig = IDL.Record({\n openid: IDL.Opt(AuthenticationConfigOpenId),\n version: IDL.Opt(IDL.Nat64),\n internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n rules: IDL.Opt(AuthenticationRules)\n });\n const SetAccessKey = IDL.Record({\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n scope: AccessKeyScope,\n expires_at: IDL.Opt(IDL.Nat64)\n });\n const SetControllersArgs = IDL.Record({\n controller: SetAccessKey,\n controllers: IDL.Vec(IDL.Principal)\n });\n const FeesArgs = IDL.Record({\n fee_cycles: CyclesTokens,\n fee_icp: IDL.Opt(Tokens)\n });\n const SetSegmentsArgs = IDL.Record({\n metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))),\n segment_id: IDL.Principal,\n segment_kind: StorableSegmentKind\n });\n const SetSegmentMetadataArgs = IDL.Record({\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n segment_id: IDL.Principal,\n segment_kind: StorableSegmentKind\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 UnsetSegmentsArgs = IDL.Record({\n segment_id: IDL.Principal,\n segment_kind: StorableSegmentKind\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\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 authenticate: IDL.Func([AuthenticationArgs], [Result], []),\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_mission_control: IDL.Func([CreateMissionControlArgs], [IDL.Principal], []),\n create_orbiter: IDL.Func([CreateOrbiterArgs], [IDL.Principal], []),\n create_satellite: IDL.Func([CreateSatelliteArgs], [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_account: IDL.Func([], [IDL.Opt(Account)], []),\n get_auth_config: IDL.Func([], [IDL.Opt(AuthenticationConfig)], []),\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_delegation: IDL.Func([GetDelegationArgs], [Result_1], []),\n get_fee: IDL.Func([SegmentKind], [FactoryFee], []),\n get_or_init_account: IDL.Func([], [Account], []),\n get_proposal: IDL.Func([IDL.Nat], [IDL.Opt(Proposal)], []),\n get_rate_config: IDL.Func([SegmentKind], [RateConfig], []),\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_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_accounts: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Account))], []),\n list_assets: IDL.Func([IDL.Text, ListParams], [ListResults], []),\n list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, AccessKey))], []),\n list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], []),\n list_icp_payments: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Nat64, IcpPayment))], []),\n list_icrc_payments: IDL.Func([], [IDL.Vec(IDL.Tuple(IcrcPaymentKey, IcrcPayment))], []),\n list_proposals: IDL.Func([ListProposalsParams], [ListProposalResults], []),\n list_segments: IDL.Func([ListSegmentsArgs], [IDL.Vec(IDL.Tuple(SegmentKey, Segment))], []),\n reject_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n set_auth_config: IDL.Func([SetAuthenticationConfig], [AuthenticationConfig], []),\n set_controllers: IDL.Func([SetControllersArgs], [], []),\n set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),\n set_fee: IDL.Func([SegmentKind, FeesArgs], [], []),\n set_many_segments: IDL.Func([IDL.Vec(SetSegmentsArgs)], [IDL.Vec(Segment)], []),\n set_rate_config: IDL.Func([SegmentKind, RateConfig], [], []),\n set_segment: IDL.Func([SetSegmentsArgs], [Segment], []),\n set_segment_metadata: IDL.Func([SetSegmentMetadataArgs], [Segment], []),\n set_storage_config: IDL.Func([SetStorageConfig], [StorageConfig], []),\n submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),\n unset_many_segments: IDL.Func([IDL.Vec(UnsetSegmentsArgs)], [], []),\n unset_segment: IDL.Func([UnsetSegmentsArgs], [], []),\n upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])\n });\n};\n\nexport const init = ({IDL}) => {\n return [];\n};\n", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.1.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nexport const idlFactory = ({IDL}) => {\n const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});\n const InitStorageArgs = IDL.Record({system_memory: IDL.Opt(Memory)});\n const InitSatelliteArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal),\n storage: IDL.Opt(InitStorageArgs)\n });\n const OpenIdPrepareDelegationArgs = IDL.Record({\n jwt: IDL.Text,\n session_key: IDL.Vec(IDL.Nat8),\n salt: IDL.Vec(IDL.Nat8)\n });\n const AuthenticationArgs = IDL.Variant({\n OpenId: OpenIdPrepareDelegationArgs\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 PreparedDelegation = IDL.Record({\n user_key: IDL.Vec(IDL.Nat8),\n expiration: IDL.Nat64\n });\n const Authentication = IDL.Record({\n doc: Doc,\n delegation: PreparedDelegation\n });\n const JwtFindProviderError = IDL.Variant({\n BadClaim: IDL.Text,\n BadSig: IDL.Text,\n NoMatchingProvider: IDL.Null\n });\n const JwtVerifyError = IDL.Variant({\n WrongKeyType: IDL.Null,\n MissingKid: IDL.Null,\n BadClaim: IDL.Text,\n BadSig: IDL.Text,\n NoKeyForKid: IDL.Null\n });\n const GetOrRefreshJwksError = IDL.Variant({\n InvalidConfig: IDL.Text,\n MissingKid: IDL.Null,\n BadClaim: IDL.Text,\n KeyNotFoundCooldown: IDL.Null,\n CertificateNotFound: IDL.Null,\n BadSig: IDL.Text,\n MissingLastAttempt: IDL.Text,\n KeyNotFound: IDL.Null,\n FetchFailed: IDL.Text\n });\n const PrepareDelegationError = IDL.Variant({\n JwtFindProvider: JwtFindProviderError,\n GetCachedJwks: IDL.Null,\n JwtVerify: JwtVerifyError,\n GetOrFetchJwks: GetOrRefreshJwksError,\n DeriveSeedFailed: IDL.Text,\n InvalidObservatoryId: IDL.Text\n });\n const AuthenticationError = IDL.Variant({\n PrepareDelegation: PrepareDelegationError,\n RegisterUser: IDL.Text\n });\n const AuthenticateResultResponse = IDL.Variant({\n Ok: Authentication,\n Err: AuthenticationError\n });\n const OpenIdPrepareAutomationArgs = IDL.Record({\n jwt: IDL.Text,\n salt: IDL.Vec(IDL.Nat8)\n });\n const AuthenticateAutomationArgs = IDL.Variant({\n OpenId: OpenIdPrepareAutomationArgs\n });\n const AutomationScope = IDL.Variant({\n Write: IDL.Null,\n Submit: IDL.Null\n });\n const AutomationController = IDL.Record({\n scope: AutomationScope,\n expires_at: IDL.Nat64\n });\n const PrepareAutomationError = IDL.Variant({\n JwtFindProvider: JwtFindProviderError,\n InvalidController: IDL.Text,\n GetCachedJwks: IDL.Null,\n JwtVerify: JwtVerifyError,\n GetOrFetchJwks: GetOrRefreshJwksError,\n ControllerAlreadyExists: IDL.Null,\n InvalidObservatoryId: IDL.Text,\n TooManyControllers: IDL.Text\n });\n const AuthenticationAutomationError = IDL.Variant({\n PrepareAutomation: PrepareAutomationError,\n RegisterController: IDL.Text,\n SaveWorkflowMetadata: IDL.Text,\n SaveUniqueJtiToken: IDL.Text\n });\n const AuthenticateAutomationResultResponse = IDL.Variant({\n Ok: IDL.Tuple(IDL.Principal, AutomationController),\n Err: AuthenticationAutomationError\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 CertifyAssetsCursor = IDL.Variant({\n Heap: IDL.Record({offset: IDL.Nat64}),\n Stable: IDL.Record({key: IDL.Opt(AssetKey)})\n });\n const CertifyAssetsStrategy = IDL.Variant({\n Append: IDL.Null,\n Clear: IDL.Null,\n AppendWithRouting: IDL.Null\n });\n const CertifyAssetsArgs = IDL.Record({\n cursor: CertifyAssetsCursor,\n strategy: CertifyAssetsStrategy,\n chunk_size: IDL.Opt(IDL.Nat32)\n });\n const CertifyAssetsResult = IDL.Record({\n next_cursor: IDL.Opt(CertifyAssetsCursor)\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 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 AccessKeyKind = IDL.Variant({\n Emulator: IDL.Null,\n Automation: IDL.Null\n });\n const AccessKeyScope = IDL.Variant({\n Write: IDL.Null,\n Admin: IDL.Null,\n Submit: IDL.Null\n });\n const AccessKey = IDL.Record({\n updated_at: IDL.Nat64,\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n created_at: IDL.Nat64,\n scope: AccessKeyScope,\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 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 OpenIdDelegationProvider = IDL.Variant({\n GitHub: IDL.Null,\n Google: IDL.Null\n });\n const OpenIdAuthProviderDelegationConfig = IDL.Record({\n targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n max_time_to_live: IDL.Opt(IDL.Nat64)\n });\n const OpenIdAuthProviderConfig = IDL.Record({\n delegation: IDL.Opt(OpenIdAuthProviderDelegationConfig),\n client_id: IDL.Text\n });\n const AuthenticationConfigOpenId = IDL.Record({\n observatory_id: IDL.Opt(IDL.Principal),\n providers: IDL.Vec(IDL.Tuple(OpenIdDelegationProvider, OpenIdAuthProviderConfig))\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 openid: IDL.Opt(AuthenticationConfigOpenId),\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 OpenIdAutomationProvider = IDL.Variant({GitHub: IDL.Null});\n const OpenIdAutomationProviderControllerConfig = IDL.Record({\n scope: IDL.Opt(AutomationScope),\n max_time_to_live: IDL.Opt(IDL.Nat64)\n });\n const RepositoryKey = IDL.Record({owner: IDL.Text, name: IDL.Text});\n const OpenIdAutomationRepositoryConfig = IDL.Record({\n refs: IDL.Opt(IDL.Vec(IDL.Text))\n });\n const OpenIdAutomationProviderConfig = IDL.Record({\n controller: IDL.Opt(OpenIdAutomationProviderControllerConfig),\n repositories: IDL.Vec(IDL.Tuple(RepositoryKey, OpenIdAutomationRepositoryConfig))\n });\n const AutomationConfigOpenId = IDL.Record({\n observatory_id: IDL.Opt(IDL.Principal),\n providers: IDL.Vec(IDL.Tuple(OpenIdAutomationProvider, OpenIdAutomationProviderConfig))\n });\n const AutomationConfig = IDL.Record({\n updated_at: IDL.Opt(IDL.Nat64),\n openid: IDL.Opt(AutomationConfigOpenId),\n created_at: IDL.Opt(IDL.Nat64),\n version: IDL.Opt(IDL.Nat64)\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 automation: IDL.Opt(AutomationConfig)\n });\n const OpenIdGetDelegationArgs = IDL.Record({\n jwt: IDL.Text,\n session_key: IDL.Vec(IDL.Nat8),\n salt: IDL.Vec(IDL.Nat8),\n expiration: IDL.Nat64\n });\n const GetDelegationArgs = IDL.Variant({OpenId: OpenIdGetDelegationArgs});\n const Delegation = IDL.Record({\n pubkey: IDL.Vec(IDL.Nat8),\n targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n expiration: IDL.Nat64\n });\n const SignedDelegation = IDL.Record({\n signature: IDL.Vec(IDL.Nat8),\n delegation: Delegation\n });\n const GetDelegationError = IDL.Variant({\n JwtFindProvider: JwtFindProviderError,\n GetCachedJwks: IDL.Null,\n NoSuchDelegation: IDL.Null,\n JwtVerify: JwtVerifyError,\n GetOrFetchJwks: GetOrRefreshJwksError,\n DeriveSeedFailed: IDL.Text,\n InvalidObservatoryId: IDL.Text\n });\n const GetDelegationResultResponse = IDL.Variant({\n Ok: SignedDelegation,\n Err: GetDelegationError\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 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 openid: IDL.Opt(AuthenticationConfigOpenId),\n version: IDL.Opt(IDL.Nat64),\n internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n rules: IDL.Opt(AuthenticationRules)\n });\n const SetAutomationConfig = IDL.Record({\n openid: IDL.Opt(AutomationConfigOpenId),\n version: IDL.Opt(IDL.Nat64)\n });\n const SetAccessKey = IDL.Record({\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n scope: AccessKeyScope,\n expires_at: IDL.Opt(IDL.Nat64)\n });\n const SetControllersArgs = IDL.Record({\n controller: SetAccessKey,\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 SetStorageConfigOptions = IDL.Record({\n skip_certification: IDL.Opt(IDL.Bool)\n });\n const SetStorageConfigWithOptions = IDL.Record({\n config: SetStorageConfig,\n options: SetStorageConfigOptions\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\n return IDL.Service({\n authenticate: IDL.Func([AuthenticationArgs], [AuthenticateResultResponse], []),\n authenticate_automation: IDL.Func(\n [AuthenticateAutomationArgs],\n [AuthenticateAutomationResultResponse],\n []\n ),\n certify_assets_chunk: IDL.Func([CertifyAssetsArgs], [CertifyAssetsResult], []),\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_controller_self: IDL.Func([], [], []),\n del_controllers: IDL.Func(\n [DeleteControllersArgs],\n [IDL.Vec(IDL.Tuple(IDL.Principal, AccessKey))],\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_automation_config: IDL.Func([], [IDL.Opt(AutomationConfig)], ['query']),\n get_config: IDL.Func([], [Config], []),\n get_db_config: IDL.Func([], [IDL.Opt(DbConfig)], ['query']),\n get_delegation: IDL.Func([GetDelegationArgs], [GetDelegationResultResponse], ['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, AccessKey))], ['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_asset_token: IDL.Func([IDL.Text, IDL.Text, IDL.Opt(IDL.Text)], [], []),\n set_auth_config: IDL.Func([SetAuthenticationConfig], [AuthenticationConfig], []),\n set_automation_config: IDL.Func([SetAutomationConfig], [AutomationConfig], []),\n set_controllers: IDL.Func(\n [SetControllersArgs],\n [IDL.Vec(IDL.Tuple(IDL.Principal, AccessKey))],\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 set_storage_config_with_options: IDL.Func([SetStorageConfigWithOptions], [StorageConfig], []),\n submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),\n switch_storage_system_memory: IDL.Func([], [], []),\n upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),\n upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])\n });\n};\n\nexport const init = ({IDL}) => {\n const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});\n const InitStorageArgs = IDL.Record({system_memory: IDL.Opt(Memory)});\n const InitSatelliteArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal),\n storage: IDL.Opt(InitStorageArgs)\n });\n\n return [InitSatelliteArgs];\n};\n", "import type {HttpAgent} from '@icp-sdk/core/agent';\nimport {nonNullish} from '@junobuild/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 '@icp-sdk/core/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 '@junobuild/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 {ActorMethod, ActorSubclass} from '@icp-sdk/core/agent';\nimport type {IDL} from '@icp-sdk/core/candid';\nimport {\n idlCertifiedFactorySatellite,\n idlFactorySatellite,\n type SatelliteActor\n} from '@junobuild/ic-client/actor';\nimport {assertNonNullish} from '@junobuild/utils';\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 {Principal} from '@icp-sdk/core/principal';\nimport type {SatelliteDid} from '@junobuild/ic-client/actor';\nimport {isNullish, toNullable} from '@junobuild/utils';\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", "export class SignInError extends Error {}\nexport class SignInInitError extends Error {}\nexport class SignInUserInterruptError extends Error {}\nexport class SignInProviderNotSupportedError extends Error {}\nexport class SignInMissingClientIdError 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 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 type {SatelliteDid} from '@junobuild/ic-client/actor';\nimport {fromArray, fromNullable, toArray, toNullable} 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 type {SatelliteDid} from '@junobuild/ic-client/actor';\nimport {fromNullable, isNullish, nonNullish} from '@junobuild/utils';\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 {DEFAULT_READ_OPTIONS} from '../../core/constants/call-options.constants';\nimport {getAnyIdentity} from '../../core/services/any-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 {isSatelliteError, JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE} from '@junobuild/errors';\nimport {isNullish, nonNullish} from '@junobuild/utils';\nimport {getDoc, setDoc} from '../../datastore/services/doc.services';\nimport {InitError} from '../types/errors';\nimport type {ProviderWithoutData} from '../types/provider';\nimport type {User, UserData, UserDataWithoutProviderData} from '../types/user';\nimport {getIdentity} from './identity.services';\n\ntype UserId = string;\n\nexport const initUser = async ({provider}: {provider: ProviderWithoutData}): 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} & UserDataWithoutProviderData): Promise<User> =>\n setDoc<UserData>({\n collection: `#user`,\n doc: {\n key: userId,\n data: rest\n }\n });\n", "import {AuthStore} from '../stores/auth.store';\nimport type {User} from '../types/user';\nimport {authenticateWithAuthClient, authenticateWithNewAuthClient} from './_auth-client.services';\nimport {loadUser} from './_user.services';\n\n/**\n * Initialize the authClient and load the existing user.\n * Executed when the library is initialized through initSatellite.\n *\n * @param {Object} params\n * @param {boolean} params.syncTabsOnSuccess - Broadcast the successful authentication to other tabs.\n */\nexport const loadAuth = async (\n {syncTabsOnSuccess}: {syncTabsOnSuccess: boolean} = {syncTabsOnSuccess: false}\n) => {\n const init = async () => {\n const {user} = await loadUser();\n AuthStore.getInstance().set(user ?? null);\n };\n\n await authenticateWithAuthClient({fn: init, syncTabsOnSuccess});\n};\n\n/**\n * Reloads the authentication state. Used when login success are being broadcasted.\n *\n * - Always creates a new `AuthClient` using {@link authenticateWithNewAuthClient}.\n * - If not authenticated, clears the current user from the {@link AuthStore}.\n * - If authenticated, reloads the user from storage and updates {@link AuthStore}.\n *\n * @returns {Promise<void>} Resolves when authentication and user state reloading is complete.\n */\nexport const reloadAuth = async () => {\n const init = async ({authenticated}: {authenticated: boolean}) => {\n const resetUser = (): Promise<{user: null}> => Promise.resolve({user: null});\n const fn = authenticated ? loadUser : resetUser;\n const {user} = await fn();\n\n AuthStore.getInstance().set(user ?? null);\n };\n\n await authenticateWithNewAuthClient({fn: init});\n};\n\n/**\n * Initialize the authClient, load the user passed as parameter.\n * Executed on sign-up.\n */\nexport const 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 authenticateWithAuthClient({fn: init, syncTabsOnSuccess: true});\n};\n", "import type {Unsubscribe} from '../../core/types/subscription';\nimport {AuthBroadcastChannel} from '../providers/_auth-broadcast.providers';\nimport {emit} from '../utils/events.utils';\nimport {reloadAuth} from './load.services';\n\nexport const initAuthBroadcastListener = (): Unsubscribe | undefined => {\n try {\n const bc = AuthBroadcastChannel.getInstance();\n\n const onLogin = async () => {\n await reloadAuth();\n emit({message: 'junoSignInReload'});\n };\n\n bc.onLoginSuccess(onLogin);\n\n return () => {\n bc?.destroy();\n };\n } catch (err: unknown) {\n // We don't really care if the broadcast channel fails to open or if it fails to set the message handler.\n // This is a non-critical feature that improves the UX when Juno is open in multiple tabs.\n // We just print a warning in the console for debugging purposes.\n console.warn('Auth BroadcastChannel initialization failed', err);\n return undefined;\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' && typeof process.env !== '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' && typeof process.env !== 'undefined'\n ? (process.env.NEXT_PUBLIC_CONTAINER ?? viteEnvContainer())\n : viteEnvContainer();\n};\n\nexport const envGoogleClientId = (): string | undefined => {\n const viteEnvGoogleClientId = (): 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_GOOGLE_CLIENT_ID ??\n (import.meta as unknown as ImportMeta).env?.PUBLIC_GOOGLE_CLIENT_ID)\n : undefined;\n\n return typeof process !== 'undefined' && typeof process.env !== 'undefined'\n ? (process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID ?? viteEnvGoogleClientId())\n : viteEnvGoogleClientId();\n};\n\nexport const envGitHubClientId = (): string | undefined => {\n const viteEnvGitHubClientId = (): 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_GITHUB_CLIENT_ID ??\n (import.meta as unknown as ImportMeta).env?.PUBLIC_GITHUB_CLIENT_ID)\n : undefined;\n\n return typeof process !== 'undefined' && typeof process.env !== 'undefined'\n ? (process.env.NEXT_PUBLIC_GITHUB_CLIENT_ID ?? viteEnvGitHubClientId())\n : viteEnvGitHubClientId();\n};\n\nexport const envApiUrl = (): string | undefined => {\n const viteEnvApiUrl = (): 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_JUNO_API_URL ??\n (import.meta as unknown as ImportMeta).env?.PUBLIC_JUNO_API_URL)\n : undefined;\n\n return typeof process !== 'undefined' && typeof process.env !== 'undefined'\n ? (process.env.NEXT_PUBLIC_JUNO_API_URL ?? viteEnvApiUrl())\n : viteEnvApiUrl();\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\ninterface PopupSize {\n width: number;\n height: number;\n}\n\nexport const II_DESIGN_V1_POPUP: PopupSize = {width: 576, height: 576};\nexport const II_DESIGN_V2_POPUP: PopupSize = {width: 424, height: 576};\n\nexport const INTERNET_COMPUTER_ORG = 'internetcomputer.org';\nexport const IC0_APP = 'ic0.app';\nexport const ID_AI = 'id.ai';\n\n// Worker\nexport const AUTH_TIMER_INTERVAL = 1000;\n", "import {isBrowser, isNullish} 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 {type AuthClient, ERROR_USER_INTERRUPT} from '@icp-sdk/auth/client';\nimport {isNullish} from '@junobuild/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 {ProviderWithoutData} from '../types/provider';\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 `@icp-sdk/auth/client`.\n *\n * @abstract\n * @class AuthClientProvider\n */\nexport abstract class AuthClientProvider {\n /**\n * The unique identifier of the provider.\n *\n * @abstract\n * @type {Provider}\n */\n abstract get id(): ProviderWithoutData;\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: ProviderWithoutData}) => 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", "import {isEmptyString, isNullish, nonNullish} from '@junobuild/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 {\n IC0_APP,\n ID_AI,\n II_DESIGN_V1_POPUP,\n II_DESIGN_V2_POPUP,\n INTERNET_COMPUTER_ORG\n} from '../constants/auth.constants';\nimport type {AuthClientSignInOptions} from '../types/auth-client';\nimport type {InternetIdentityConfig, InternetIdentityDomain} from '../types/internet-identity';\nimport type {ProviderWithoutData} 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 */\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(): ProviderWithoutData {\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 const identityV1Domain = [INTERNET_COMPUTER_ORG, IC0_APP].includes(this.#domain ?? ID_AI);\n\n if (isEmptyString(this.#domain)) {\n return `https://${ID_AI}`;\n }\n\n if (identityV1Domain) {\n return `https://identity.${this.#domain ?? INTERNET_COMPUTER_ORG}`;\n }\n\n return `https://${this.#domain}`;\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 const identityProvider = identityProviderUrl();\n\n const iiDesignV2 = (): boolean => {\n try {\n const {hostname} = new URL(identityProvider);\n return hostname.includes(ID_AI);\n } catch {\n return false;\n }\n };\n\n return {\n ...(windowed !== false && {\n windowOpenerFeatures: popupCenter(iiDesignV2() ? II_DESIGN_V2_POPUP : II_DESIGN_V1_POPUP)\n }),\n identityProvider\n };\n }\n}\n", "import type {Ed25519KeyIdentity} from '@icp-sdk/core/identity';\nimport {arrayBufferToUint8Array} from '@junobuild/utils';\nimport type {Nonce, Salt} from '../types/nonce';\nimport {toBase64URL} from './url.utils';\n\nconst generateSalt = (): Salt => crypto.getRandomValues(new Uint8Array(32));\n\nconst buildNonce = async ({salt, caller}: {salt: Salt; caller: Ed25519KeyIdentity}) => {\n const principal = caller.getPrincipal().toUint8Array();\n\n const bytes = new Uint8Array(salt.length + principal.byteLength);\n bytes.set(salt);\n bytes.set(principal, salt.length);\n\n const hash = await crypto.subtle.digest('SHA-256', bytes);\n\n return toBase64URL(arrayBufferToUint8Array(hash));\n};\n\nexport const generateNonce = async ({\n caller\n}: {\n caller: Ed25519KeyIdentity;\n}): Promise<{nonce: Nonce; salt: Salt}> => {\n const salt = generateSalt();\n const nonce = await buildNonce({salt, caller});\n\n return {nonce, salt};\n};\n", "import {uint8ArrayToBase64} from '@junobuild/utils';\n\n// In the future: uint8Array.toBase64({ alphabet: \"base64url\" })\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/toBase64\nexport const toBase64URL = (uint8Array: Uint8Array): string =>\n uint8ArrayToBase64(uint8Array).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n", "import type {OpenIdGitHubProvider} from './providers/github/types/provider';\nimport type {OpenIdProvider} from './types/provider';\n\nexport const CONTEXT_KEY = 'juno:auth:openid';\n\n// Create client_id: https://developers.google.com/identity/openid-connect/openid-connect#authenticationuriparameters\nexport const GOOGLE_PROVIDER: Omit<OpenIdProvider, 'clientId' | 'redirectUrl'> = {\n authUrl: 'https://accounts.google.com/o/oauth2/v2/auth',\n authScopes: ['openid', 'profile', 'email'],\n configUrl: 'https://accounts.google.com/gsi/fedcm.json'\n};\n\nexport const GITHUB_PROVIDER: Omit<OpenIdGitHubProvider, 'clientId' | 'redirectUrl'> = {\n authUrl: 'https://github.com/login/oauth/authorize',\n authScopes: ['read:user', 'user:email'],\n initUrl: 'https://api.juno.build/v1/auth/init/github',\n finalizeUrl: 'https://api.juno.build/v1/auth/finalize/github'\n};\n", "import {Ed25519KeyIdentity} from '@icp-sdk/core/identity';\nimport {isNullish} from '@junobuild/utils';\nimport type {Nonce} from '../types/nonce';\nimport {generateNonce} from '../utils/nonce.utils';\nimport {CONTEXT_KEY} from './_constants';\nimport {ContextUndefinedError} from './errors';\nimport type {OpenIdAuthContext} from './types/context';\nimport {parseContext, stringifyContext} from './utils/session-storage.utils';\n\nexport const initContext = async ({\n generateState\n}: {\n generateState: (params: {nonce: Nonce}) => Promise<string>;\n}): Promise<{nonce: Nonce} & Pick<OpenIdAuthContext, 'state'>> => {\n const caller = Ed25519KeyIdentity.generate();\n const {nonce, salt} = await generateNonce({caller});\n\n const state = await generateState({nonce});\n\n const storedData = stringifyContext({\n caller,\n salt,\n state\n });\n\n sessionStorage.setItem(CONTEXT_KEY, storedData);\n\n return {\n nonce,\n state\n };\n};\n\nexport const loadContext = (): OpenIdAuthContext => {\n const storedContext = sessionStorage.getItem(CONTEXT_KEY);\n\n if (isNullish(storedContext)) {\n throw new ContextUndefinedError();\n }\n\n return parseContext(storedContext);\n};\n", "export class InvalidUrlError extends Error {}\nexport class ContextUndefinedError extends Error {}\n\nexport class FedCMIdentityCredentialUndefinedError extends Error {}\nexport class FedCMIdentityCredentialInvalidError extends Error {}\n\nexport class AuthenticationError extends Error {}\nexport class AuthenticationUrlHashError extends Error {}\nexport class AuthenticationInvalidStateError extends Error {}\nexport class AuthenticationUndefinedJwtError extends Error {}\n\nexport class GetDelegationError extends Error {}\nexport class GetDelegationRetryError extends Error {}\n\nexport class ApiGitHubInitError extends Error {\n constructor(options?: ErrorOptions) {\n super('GitHub OAuth initialization failed', options);\n }\n}\n\nexport class ApiGitHubFinalizeError extends Error {\n constructor(options?: ErrorOptions) {\n super('GitHub OAuth finalization failed', options);\n }\n}\n", "import {Ed25519KeyIdentity, type JsonnableEd25519KeyIdentity} from '@icp-sdk/core/identity';\nimport {base64ToUint8Array, uint8ArrayToBase64} from '@junobuild/utils';\nimport type {OpenIdAuthContext} from '../types/context';\n\nconst JSON_KEY_CALLER = '__caller__';\nconst JSON_KEY_SALT = '__salt__';\nconst JSON_KEY_STATE = '__state__';\n\ninterface StoredContext {\n [JSON_KEY_CALLER]: JsonnableEd25519KeyIdentity;\n [JSON_KEY_SALT]: string;\n [JSON_KEY_STATE]: string;\n}\n\nexport const stringifyContext = ({caller, state, salt}: OpenIdAuthContext): string => {\n const data: StoredContext = {\n [JSON_KEY_CALLER]: caller.toJSON(),\n [JSON_KEY_SALT]: uint8ArrayToBase64(salt),\n [JSON_KEY_STATE]: state\n };\n\n return JSON.stringify(data);\n};\n\nexport const parseContext = (jsonData: string): OpenIdAuthContext => {\n const {\n [JSON_KEY_CALLER]: jsonCaller,\n [JSON_KEY_SALT]: jsonSalt,\n [JSON_KEY_STATE]: state\n }: StoredContext = JSON.parse(jsonData);\n\n return {\n caller: Ed25519KeyIdentity.fromParsedJson(jsonCaller),\n salt: base64ToUint8Array(jsonSalt),\n state\n };\n};\n", "import type {Signature} from '@icp-sdk/core/agent';\nimport {Delegation, ECDSAKeyIdentity} from '@icp-sdk/core/identity';\nimport {fromNullable} from '@junobuild/utils';\nimport {authenticate as authenticateApi, getDelegation as getDelegationApi} from './api/auth.api';\nimport {AuthenticationError, GetDelegationError, GetDelegationRetryError} from './errors';\nimport type {AuthenticationData, GetDelegationArgs, SignedDelegation} from './types/actor';\nimport type {AuthenticatedSession, AuthParameters} from './types/authenticate';\nimport type {OpenIdAuthContext} from './types/context';\nimport type {Delegations} from './types/session';\nimport {generateIdentity} from './utils/session.utils';\n\ninterface AuthContext {\n context: Omit<OpenIdAuthContext, 'state'>;\n auth: AuthParameters;\n}\ntype AuthenticationArgs = {jwt: string} & AuthContext;\n\nexport const authenticateSession = async <T extends AuthParameters>({\n jwt,\n context,\n auth\n}: AuthenticationArgs): Promise<AuthenticatedSession<T>> => {\n const sessionKey = await ECDSAKeyIdentity.generate({extractable: false});\n\n const publicKey = new Uint8Array(sessionKey.getPublicKey().toDer());\n\n const {delegations, data} = await authenticate<T>({\n jwt,\n publicKey,\n context,\n auth\n });\n\n const identity = generateIdentity({\n sessionKey,\n delegations\n });\n\n return {identity, data};\n};\n\nconst authenticate = async <T extends AuthParameters>({\n jwt,\n publicKey,\n context: {caller, salt},\n auth\n}: {\n publicKey: Uint8Array;\n} & AuthenticationArgs): Promise<{delegations: Delegations; data: AuthenticationData<T>}> => {\n const result = await authenticateApi({\n args: {\n OpenId: {\n jwt,\n session_key: publicKey,\n salt\n }\n },\n actorParams: {\n auth,\n identity: caller\n }\n });\n\n if ('Err' in result) {\n throw new AuthenticationError('Authentication failed', {cause: result});\n }\n\n const {\n delegation: {user_key: userKey, expiration},\n ...rest\n } = result.Ok;\n\n const signedDelegation = await retryGetDelegation({\n jwt,\n context: {caller, salt},\n auth,\n publicKey,\n expiration\n });\n\n const {delegation, signature} = signedDelegation;\n const {pubkey, expiration: signedExpiration, targets} = delegation;\n\n const delegations: Delegations = [\n userKey,\n [\n {\n delegation: new Delegation(\n Uint8Array.from(pubkey),\n signedExpiration,\n fromNullable(targets)\n ),\n signature: Uint8Array.from(signature) as unknown as Signature\n }\n ]\n ];\n\n return {delegations, data: rest as AuthenticationData<T>};\n};\n\nconst retryGetDelegation = async ({\n jwt,\n publicKey,\n context: {salt, caller},\n auth,\n expiration,\n maxRetries = 5\n}: {\n publicKey: Uint8Array;\n expiration: bigint;\n maxRetries?: number;\n} & AuthenticationArgs): Promise<SignedDelegation> => {\n for (let i = 0; i < maxRetries; i++) {\n // Linear backoff\n await new Promise((resolve) => {\n setInterval(resolve, 1000 * i);\n });\n\n const args: GetDelegationArgs = {\n OpenId: {\n jwt,\n session_key: publicKey,\n salt,\n expiration\n }\n };\n\n const result = await getDelegationApi({\n args,\n actorParams: {\n auth,\n identity: caller\n }\n });\n\n if ('Err' in result) {\n const {Err} = result;\n\n if ('NoSuchDelegation' in Err) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if ('GetCachedJwks' in Err) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n throw new GetDelegationError('Getting delegation failed', {cause: result});\n }\n\n return result.Ok;\n }\n\n throw new GetDelegationRetryError();\n};\n", "import {\n type ConsoleActor,\n type SatelliteActor,\n getConsoleActor,\n getSatelliteActor\n} from '@junobuild/ic-client/actor';\nimport type {ActorParameters} from '../types/actor';\n\nexport const getAuthActor = ({\n auth,\n identity\n}: ActorParameters): Promise<ConsoleActor | SatelliteActor> =>\n 'satellite' in auth\n ? getSatelliteActor({...auth.satellite, identity})\n : getConsoleActor({...auth.console, identity});\n", "import type {\n ActorParameters,\n AuthenticationArgs,\n AuthenticationResult,\n GetDelegationArgs,\n GetDelegationResult\n} from '../types/actor';\nimport {getAuthActor} from './_actor.api';\n\nexport const authenticate = async ({\n actorParams,\n args\n}: {\n args: AuthenticationArgs;\n actorParams: ActorParameters;\n}): Promise<AuthenticationResult> => {\n const {authenticate} = await getAuthActor(actorParams);\n return await authenticate(args);\n};\n\nexport const getDelegation = async ({\n actorParams,\n args\n}: {\n args: GetDelegationArgs;\n actorParams: ActorParameters;\n}): Promise<GetDelegationResult> => {\n const {get_delegation} = await getAuthActor(actorParams);\n return await get_delegation(args);\n};\n", "import {DelegationChain, DelegationIdentity, type ECDSAKeyIdentity} from '@icp-sdk/core/identity';\nimport type {AuthenticatedIdentity} from '../types/authenticate';\nimport type {Delegations} from '../types/session';\n\nexport const generateIdentity = ({\n delegations,\n sessionKey\n}: {\n delegations: Delegations;\n sessionKey: ECDSAKeyIdentity;\n}): AuthenticatedIdentity => {\n const [userKey, signedDelegations] = delegations;\n\n const delegationChain = DelegationChain.fromDelegations(\n signedDelegations,\n Uint8Array.from(userKey)\n );\n\n const identity = DelegationIdentity.fromDelegation(sessionKey, delegationChain);\n\n return {identity, delegationChain, sessionKey};\n};\n", "import {isEmptyString} from '@junobuild/utils';\nimport {authenticateSession} from '../../_session';\nimport {AuthenticationUndefinedJwtError} from '../../errors';\nimport type {AuthenticatedSession, AuthParameters} from '../../types/authenticate';\nimport type {OpenIdAuthContext} from '../../types/context';\nimport {finalizeOAuth} from './_api';\nimport type {AuthenticationGitHubRedirect} from './types/authenticate';\n\nexport const authenticateGitHubWithRedirect = async <T extends AuthParameters>({\n auth,\n context,\n redirect: {finalizeUrl}\n}: {\n auth: AuthParameters;\n context: Omit<OpenIdAuthContext, 'state'>;\n redirect: AuthenticationGitHubRedirect;\n}): Promise<AuthenticatedSession<T>> => {\n const {\n location: {search}\n } = window;\n\n const urlParams = new URLSearchParams(search);\n const code = urlParams.get('code');\n const state = urlParams.get('state');\n\n const result = await finalizeOAuth({\n url: finalizeUrl,\n body: {code, state}\n });\n\n if ('error' in result) {\n throw result.error;\n }\n\n const {\n success: {token: idToken}\n } = result;\n\n // id_token === jwt\n if (isEmptyString(idToken)) {\n throw new AuthenticationUndefinedJwtError();\n }\n\n return await authenticateSession({\n jwt: idToken,\n auth,\n context\n });\n};\n", "import {ApiGitHubFinalizeError, ApiGitHubInitError} from '../../errors';\n\nexport const initOAuth = async ({\n url\n}: {\n url: string;\n}): Promise<{success: {state: string}} | {error: unknown}> => {\n try {\n const result = await fetch(url, {\n credentials: 'include'\n });\n\n if (!result.ok) {\n return {error: new Error(`Failed to fetch ${url} (${result.status})`)};\n }\n\n const data: {state: string} = await result.json();\n return {success: data};\n } catch (error: unknown) {\n return {error: new ApiGitHubInitError({cause: error})};\n }\n};\n\nexport const finalizeOAuth = async ({\n url,\n body\n}: {\n url: string;\n body: {code: string | null; state: string | null};\n}): Promise<{success: {token: string}} | {error: unknown}> => {\n try {\n const result = await fetch(url, {\n method: 'POST',\n credentials: 'include',\n headers: {'Content-Type': 'application/json'},\n body: JSON.stringify(body)\n });\n\n if (!result.ok) {\n return {error: new Error(`Failed to fetch ${url} (${result.status})`)};\n }\n\n const data: {token: string} = await result.json();\n return {success: data};\n } catch (error: unknown) {\n return {error: new ApiGitHubFinalizeError({cause: error})};\n }\n};\n", "import {isEmptyString} from '@junobuild/utils';\nimport {authenticateSession} from '../../_session';\nimport {\n AuthenticationInvalidStateError,\n AuthenticationUndefinedJwtError,\n AuthenticationUrlHashError\n} from '../../errors';\nimport type {AuthenticatedSession, AuthParameters} from '../../types/authenticate';\nimport type {OpenIdAuthContext} from '../../types/context';\n\nexport const authenticateGoogleWithRedirect = async <T extends AuthParameters>({\n auth,\n context\n}: {\n auth: AuthParameters;\n context: OpenIdAuthContext;\n}): Promise<AuthenticatedSession<T>> => {\n const {\n location: {hash}\n } = window;\n\n if (isEmptyString(hash) || !hash.startsWith('#')) {\n throw new AuthenticationUrlHashError('No hash found in the current location URL');\n }\n\n const params = new URLSearchParams(hash.slice(1));\n const state = params.get('state');\n const idToken = params.get('id_token');\n\n const {state: savedState} = context;\n\n if (isEmptyString(savedState) || state !== savedState) {\n throw new AuthenticationInvalidStateError('The provided state is invalid', {cause: state});\n }\n\n // id_token === jwt\n if (isEmptyString(idToken)) {\n throw new AuthenticationUndefinedJwtError();\n }\n\n return await authenticateSession({\n jwt: idToken,\n auth,\n context\n });\n};\n", "import {GITHUB_PROVIDER} from './_constants';\nimport {loadContext} from './_context';\nimport {authenticateSession} from './_session';\nimport {authenticateGitHubWithRedirect} from './providers/github/authenticate';\nimport {authenticateGoogleWithRedirect} from './providers/google/authenticate';\nimport type {\n AuthenticatedSession,\n AuthenticationParams,\n AuthParameters\n} from './types/authenticate';\n\nexport const authenticate = async <T extends AuthParameters>(\n params: AuthenticationParams<T>\n): Promise<AuthenticatedSession<T>> => {\n const context = loadContext();\n\n if ('github' in params) {\n const {\n github: {redirect, auth}\n } = params;\n\n const {finalizeUrl} = GITHUB_PROVIDER;\n\n return await authenticateGitHubWithRedirect<T>({\n redirect: redirect ?? {finalizeUrl},\n auth,\n context\n });\n }\n\n const {google} = params;\n\n if ('credentials' in google) {\n const {\n credentials: {jwt},\n auth\n } = google;\n\n return await authenticateSession({\n jwt,\n context,\n auth\n });\n }\n\n return await authenticateGoogleWithRedirect<T>({...google, context});\n};\n", "import {InvalidUrlError} from '../errors';\n\nexport const parseUrl = ({url}: {url: string}): URL => {\n try {\n // Use the URL constructor, for backwards compatibility with older Android/WebView.\n return new URL(url);\n } catch (_error: unknown) {\n throw new InvalidUrlError('Cannot parse authURL', {cause: url});\n }\n};\n", "import type {Nonce} from '../../../types/nonce';\nimport {parseUrl} from '../../utils/url.utils';\nimport {initOAuth} from './_api';\nimport type {OpenIdGitHubProvider} from './types/provider';\n\nexport const buildGenerateState = ({initUrl}: Pick<OpenIdGitHubProvider, 'initUrl'>) => {\n const generateState = async ({nonce}: {nonce: Nonce}): Promise<string> => {\n const requestUrl = parseUrl({url: initUrl});\n requestUrl.searchParams.set('nonce', nonce);\n\n const result = await initOAuth({url: requestUrl.toString()});\n\n if ('error' in result) {\n throw result.error;\n }\n\n const {\n success: {state}\n } = result;\n\n return state;\n };\n\n return generateState;\n};\n", "import {parseUrl} from '../../utils/url.utils';\nimport type {RequestGitHubJwtWithRedirect} from './types/openid';\n\n// https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps#1-request-a-users-github-identity\n\nexport const requestGitHubJwtWithRedirect = ({\n authUrl,\n clientId,\n authScopes,\n state,\n redirectUrl\n}: RequestGitHubJwtWithRedirect) => {\n const requestUrl = parseUrl({url: authUrl});\n\n requestUrl.searchParams.set('client_id', clientId);\n\n const {\n location: {origin: currentUrl}\n } = window;\n\n requestUrl.searchParams.set('redirect_uri', redirectUrl ?? currentUrl);\n\n // Note: GitHub Apps ignore this parameter and use permissions from app settings instead\n requestUrl.searchParams.set('scope', authScopes.join(' '));\n\n // Used for security reasons. When the provider redirects to the application,\n // the state will be compared by the proxy backend with the value it initiated.\n requestUrl.searchParams.set('state', state);\n\n window.location.href = requestUrl.toString();\n};\n", "import {toBase64URL} from '../../utils/url.utils';\n\nexport const generateRandomState = (): string =>\n toBase64URL(crypto.getRandomValues(new Uint8Array(12)));\n", "import type {Nonce} from '../../../types/nonce';\nimport {generateRandomState} from '../../utils/state.utils';\n\n// eslint-disable-next-line require-await\nexport const generateGoogleState = async (_params: {nonce: Nonce}): Promise<string> =>\n generateRandomState();\n", "import {isNullish, notEmptyString} from '@junobuild/utils';\nimport {\n FedCMIdentityCredentialInvalidError,\n FedCMIdentityCredentialUndefinedError\n} from '../../errors';\nimport {parseUrl} from '../../utils/url.utils';\nimport type {RequestGoogleJwtWithCredentials, RequestGoogleJwtWithRedirect} from './types/openid';\n\n/**\n * Initiates an OpenID Connect authorization request by redirecting the browser.\n *\n * References:\n * - OAuth 2.0 (Google): https://developers.google.com/identity/protocols/oauth2/javascript-implicit-flow\n * - OpenID Connect: https://developers.google.com/identity/openid-connect/openid-connect\n */\nexport const requestGoogleJwtWithRedirect = ({\n authUrl,\n clientId,\n nonce,\n loginHint,\n authScopes,\n state,\n redirectUrl\n}: RequestGoogleJwtWithRedirect) => {\n const requestUrl = parseUrl({url: authUrl});\n\n requestUrl.searchParams.set('client_id', clientId);\n\n const {\n location: {origin: currentUrl}\n } = window;\n\n requestUrl.searchParams.set('redirect_uri', redirectUrl ?? currentUrl);\n\n // We do not request \"token\" because we use the ID token (JWT).\n // \"code\" is required according to II's codebase as Apple ID throws an error otherwise.\n requestUrl.searchParams.set('response_type', 'code id_token');\n\n requestUrl.searchParams.set('scope', authScopes.join(' '));\n\n // Used for security reasons. When the provider redirects to the application,\n // the state will be compared with the session storage value.\n requestUrl.searchParams.set('state', state);\n\n // Used to validate the JSON Web Token (JWT) in the backend \u2014 i.e. we pass the nonce\n // to the provider and make the request to the backend with its salt.\n requestUrl.searchParams.set('nonce', nonce);\n\n if (notEmptyString(loginHint)) {\n requestUrl.searchParams.set('login_hint', loginHint);\n } else {\n requestUrl.searchParams.set('prompt', 'select_account');\n }\n\n window.location.href = requestUrl.toString();\n};\n\n/**\n * References:\n * - identity spec: https://www.w3.org/TR/fedcm/#browser-api-credential-request-options\n * - https://privacysandbox.google.com/cookies/fedcm/implement/identity-provider\n * - https://privacysandbox.google.com/cookies/fedcm/why\n */\nexport const requestGoogleJwtWithCredentials = async ({\n configUrl: configURL,\n clientId,\n nonce,\n loginHint,\n domainHint\n}: RequestGoogleJwtWithCredentials): Promise<{jwt: string}> => {\n const identityCredential = await navigator.credentials.get({\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n identity: {\n context: 'use',\n providers: [\n {\n configURL,\n clientId,\n nonce,\n loginHint,\n domainHint\n }\n ],\n mode: 'active'\n },\n // https://privacysandbox.google.com/cookies/fedcm/implement/relying-party#auto-reauthn\n mediation: 'required'\n });\n\n if (isNullish(identityCredential)) {\n throw new FedCMIdentityCredentialUndefinedError();\n }\n\n const {type} = identityCredential;\n\n if (\n type !== 'identity' ||\n !('token' in identityCredential) ||\n typeof identityCredential.token !== 'string'\n ) {\n // This should be unreachable in FedCM spec-compliant browsers.\n throw new FedCMIdentityCredentialInvalidError('Invalid credential received from FedCM API', {\n cause: identityCredential\n });\n }\n\n const {token: jwt} = identityCredential;\n return {jwt};\n};\n", "import {GITHUB_PROVIDER, GOOGLE_PROVIDER} from './_constants';\nimport {initContext} from './_context';\nimport {buildGenerateState} from './providers/github/_context';\nimport {requestGitHubJwtWithRedirect} from './providers/github/_openid';\nimport type {RequestGitHubJwtRedirectParams} from './providers/github/types/request';\nimport {generateGoogleState} from './providers/google/_context';\nimport {\n requestGoogleJwtWithCredentials,\n requestGoogleJwtWithRedirect\n} from './providers/google/_openid';\nimport type {\n RequestGoogleJwtCredentialsParams,\n RequestGoogleJwtParams,\n RequestGoogleJwtRedirectParams\n} from './providers/google/types/request';\nimport type {RequestJwtCredentialsResult} from './types/request';\n\nexport function requestJwt(args: {\n google: RequestGoogleJwtCredentialsParams;\n}): Promise<RequestJwtCredentialsResult>;\n\nexport function requestJwt(\n args: {google: RequestGoogleJwtRedirectParams} | {github: RequestGitHubJwtRedirectParams}\n): Promise<void>;\n\nexport async function requestJwt(\n args:\n | {\n google: RequestGoogleJwtParams;\n }\n | {github: RequestGitHubJwtRedirectParams}\n): Promise<RequestJwtCredentialsResult | void> {\n if ('github' in args) {\n const {github} = args;\n\n const {redirect} = github;\n const {initUrl: userInitUrl, ...restRedirect} = redirect;\n\n const {authUrl, authScopes, initUrl} = GITHUB_PROVIDER;\n\n const context = await initContext({\n generateState: buildGenerateState({initUrl: userInitUrl ?? initUrl})\n });\n\n requestGitHubJwtWithRedirect({\n ...restRedirect,\n ...context,\n authUrl,\n authScopes\n });\n return;\n }\n\n const context = await initContext({generateState: generateGoogleState});\n\n const {google} = args;\n\n if ('credentials' in google) {\n const {credentials} = google;\n const {configUrl} = GOOGLE_PROVIDER;\n\n return await requestGoogleJwtWithCredentials({\n ...credentials,\n ...context,\n configUrl\n });\n }\n\n const {redirect} = google;\n const {authUrl, authScopes} = GOOGLE_PROVIDER;\n\n requestGoogleJwtWithRedirect({\n ...redirect,\n ...context,\n authUrl,\n authScopes\n });\n}\n", "/**\n * Detects whether the browser supports FedCM (Federated Credential Management).\n *\n * @returns {boolean} `true` if FedCM is supported, otherwise `false`.\n *\n * References:\n * - MDN IdentityCredential: https://developer.mozilla.org/en-US/docs/Web/API/IdentityCredential\n */\nexport const isFedCMSupported = (): boolean => {\n const {userAgent} = navigator;\n\n // Samsung browser implements \"IdentityCredential\" but does not support \"configURL\"\n // https://developer.mozilla.org/en-US/docs/Web/API/IdentityCredential\n const isSamsungBrowser = /SamsungBrowser/i.test(userAgent);\n if (isSamsungBrowser) {\n return false;\n }\n\n return 'IdentityCredential' in window;\n};\n", "export const parseOptionalUrl = ({url}: {url: string}): URL | null => {\n try {\n // Use the URL constructor, for backwards compatibility with older Android/WebView.\n return new URL(url);\n } catch (_error: unknown) {\n console.warn(`Cannot parse URL ${url}. Skipping option.`);\n return null;\n }\n};\n", "import {authenticate} from '@junobuild/auth/delegation';\nimport {isEmptyString, isNullish, nonNullish, notEmptyString} from '@junobuild/utils';\nimport {EnvStore} from '../../core/stores/env.store';\nimport {envApiUrl} from '../../core/utils/window.env.utils';\nimport {fromDoc} from '../../datastore/utils/doc.utils';\nimport {AuthClientStore} from '../stores/auth-client.store';\nimport type {HandleRedirectCallbackOptions} from '../types/auth';\nimport {SignInInitError} from '../types/errors';\nimport type {UserData} from '../types/user';\nimport {parseOptionalUrl} from '../utils/url.utils';\nimport {loadAuthWithUser} from './load.services';\n\nexport const handleRedirectCallback = async (options: HandleRedirectCallbackOptions) => {\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 container = EnvStore.getInstance().get()?.container;\n\n const auth = {\n auth: {\n satellite: {\n satelliteId,\n container\n }\n }\n };\n\n const buildFinalizeUrl = (): string | null => {\n const finalizeUrl = 'github' in options ? options?.github?.options?.finalizeUrl : undefined;\n\n if (notEmptyString(finalizeUrl)) {\n return finalizeUrl;\n }\n\n const apiUrl = envApiUrl();\n\n if (isEmptyString(apiUrl)) {\n return null;\n }\n\n return parseOptionalUrl({url: `${apiUrl}/v1/auth/finalize/github`})?.toString() ?? null;\n };\n\n const finalizeUrl = buildFinalizeUrl();\n\n const {\n identity: {delegationChain, sessionKey, identity},\n data: {doc}\n } = await authenticate(\n 'github' in options\n ? {\n github: {\n redirect: nonNullish(finalizeUrl) ? {finalizeUrl} : null,\n ...auth\n }\n }\n : {\n google: {\n redirect: null,\n ...auth\n }\n }\n );\n\n // Set up the delegation and session key for the AuthClient\n await AuthClientStore.getInstance().setAuthClientStorage({\n delegationChain,\n sessionKey\n });\n\n // Create the AuthClient, load the identity and set the user in store\n const user = await fromDoc<UserData>({doc, key: identity.getPrincipal().toText()});\n await loadAuthWithUser({user});\n};\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", "export class UnsafeDevIdentityNotBrowserError extends Error {\n constructor() {\n super('A dev identity can only be used in browser environments');\n }\n}\n\nexport class UnsafeDevIdentityNotLocalhostError extends Error {\n constructor() {\n super('A dev identity must only be used on localhost (127.0.0.1 or localhost)');\n }\n}\n\nexport class UnsafeDevIdentityInvalidIdentifierError extends Error {\n constructor(length: number) {\n super(`Identifier must be 32 characters or less, got ${length}`);\n }\n}\n", "import {\n DelegationChain,\n DelegationIdentity,\n ECDSAKeyIdentity,\n Ed25519KeyIdentity\n} from '@icp-sdk/core/identity';\nimport {clear, createStore, entries, update} from 'idb-keyval';\nimport {DEFAULT_DEV_DELEGATION_IDENTITY_EXPIRATION_IN_MS} from './_constants';\nimport {\n UnsafeDevIdentityInvalidIdentifierError,\n UnsafeDevIdentityNotBrowserError,\n UnsafeDevIdentityNotLocalhostError\n} from './errors';\nimport type {\n DevIdentifier,\n DevIdentifierData,\n GenerateUnsafeIdentityParams,\n GenerateUnsafeIdentityResult,\n LoadDevIdentifiersParams\n} from './types/identity';\n\nconst identifiersIdbStore = createStore('juno-dev-identifiers', 'juno-dev-identifiers-store');\n\n/**\n * Load all development identifiers that have been used for authentication.\n *\n * Returns an array of tuples containing the identifier string and metadata (created/updated timestamps),\n * sorted by most recently used first.\n *\n * @param params - Load parameters\n * @param params.limit - Optional maximum number of identifiers to return\n * @returns Promise resolving to array of [identifier, metadata] tuples sorted by updatedAt descending\n *\n * @example\n * const recent = await loadDevIdentifiers({ limit: 5 });\n * // Returns only the 5 most recently used identifiers\n */\nexport const loadDevIdentifiers = async ({limit}: LoadDevIdentifiersParams = {}): Promise<\n [DevIdentifier, DevIdentifierData][]\n> => {\n const identifiers = await entries<DevIdentifier, DevIdentifierData>(identifiersIdbStore);\n\n return identifiers.sort(([_, {updatedAt: a}], [__, {updatedAt: b}]) => b - a).slice(0, limit);\n};\n\n/**\n * Clear all stored development identifiers from IndexedDB.\n * This removes the history of used identifiers but does not affect AuthClient's stored credentials.\n *\n * @returns Promise that resolves when identifiers are cleared\n */\nexport const clearDevIdentifiers = () => clear(identifiersIdbStore);\n\n/**\n * Generate an identity for local development with the Internet Computer.\n *\n * \u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\n * \u26A0\uFE0F UNSAFE - FOR LOCAL DEVELOPMENT ONLY \u26A0\uFE0F\n * \u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\n *\n * Returns the identity, session key, and delegation chain.\n * Consumers must handle storage (e.g. for AuthClient compatibility).\n *\n * @param params - Generation parameters\n * @param params.identifier - Unique identifier string for this dev identity (default: \"dev\")\n * @param params.maxTimeToLiveInMilliseconds - Delegation expiration time in ms (default: 7 days)\n *\n * @returns Promise resolving to object containing identity, sessionKey, and delegationChain\n *\n * @throws {UnsafeDevIdentityNotBrowserError} If called outside browser environment\n * @throws {UnsafeDevIdentityNotLocalhostError} If called outside localhost\n **/\nexport const generateUnsafeDevIdentity = async ({\n identifier = 'dev',\n maxTimeToLiveInMilliseconds\n}: GenerateUnsafeIdentityParams = {}): Promise<GenerateUnsafeIdentityResult> => {\n const isBrowser = (): boolean => typeof window !== `undefined`;\n\n if (!isBrowser()) {\n throw new UnsafeDevIdentityNotBrowserError();\n }\n\n const {\n location: {hostname}\n } = window;\n\n if (!['127.0.0.1', 'localhost'].includes(hostname)) {\n throw new UnsafeDevIdentityNotLocalhostError();\n }\n\n const generateSeed = (): Uint8Array => {\n if (identifier.length > 32) {\n throw new UnsafeDevIdentityInvalidIdentifierError(identifier.length);\n }\n\n const encoder = new TextEncoder();\n return encoder.encode(identifier.padEnd(32, '0'));\n };\n\n const generate = async (): Promise<GenerateUnsafeIdentityResult> => {\n const seedBytes = generateSeed();\n\n const rootIdentity = Ed25519KeyIdentity.generate(seedBytes);\n const sessionKey = await ECDSAKeyIdentity.generate({\n extractable: false\n });\n\n const sessionLengthInMilliseconds =\n maxTimeToLiveInMilliseconds ?? DEFAULT_DEV_DELEGATION_IDENTITY_EXPIRATION_IN_MS;\n\n const chain = await DelegationChain.create(\n rootIdentity,\n sessionKey.getPublicKey(),\n new Date(Date.now() + sessionLengthInMilliseconds)\n );\n\n const delegatedIdentity = DelegationIdentity.fromDelegation(sessionKey, chain);\n\n return {\n identity: delegatedIdentity,\n sessionKey,\n delegationChain: chain\n };\n };\n\n const saveIdentifierUsage = async () => {\n await update(\n identifier,\n (value) => {\n const now = Date.now();\n\n return {\n createdAt: value?.createdAt ?? now,\n updatedAt: now\n };\n },\n identifiersIdbStore\n );\n };\n\n const result = await generate();\n\n await saveIdentifierUsage();\n\n return result;\n};\n", "function promisifyRequest(request) {\n return new Promise((resolve, reject) => {\n // @ts-ignore - file size hacks\n request.oncomplete = request.onsuccess = () => resolve(request.result);\n // @ts-ignore - file size hacks\n request.onabort = request.onerror = () => reject(request.error);\n });\n}\nfunction createStore(dbName, storeName) {\n let dbp;\n const getDB = () => {\n if (dbp)\n return dbp;\n const request = indexedDB.open(dbName);\n request.onupgradeneeded = () => request.result.createObjectStore(storeName);\n dbp = promisifyRequest(request);\n dbp.then((db) => {\n // It seems like Safari sometimes likes to just close the connection.\n // It's supposed to fire this event when that happens. Let's hope it does!\n db.onclose = () => (dbp = undefined);\n }, () => { });\n return dbp;\n };\n return (txMode, callback) => getDB().then((db) => callback(db.transaction(storeName, txMode).objectStore(storeName)));\n}\nlet defaultGetStoreFunc;\nfunction defaultGetStore() {\n if (!defaultGetStoreFunc) {\n defaultGetStoreFunc = createStore('keyval-store', 'keyval');\n }\n return defaultGetStoreFunc;\n}\n/**\n * Get a value by its key.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction get(key, customStore = defaultGetStore()) {\n return customStore('readonly', (store) => promisifyRequest(store.get(key)));\n}\n/**\n * Set a value with a key.\n *\n * @param key\n * @param value\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction set(key, value, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.put(value, key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Set multiple values at once. This is faster than calling set() multiple times.\n * It's also atomic \u2013 if one of the pairs can't be added, none will be added.\n *\n * @param entries Array of entries, where each entry is an array of `[key, value]`.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction setMany(entries, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n entries.forEach((entry) => store.put(entry[1], entry[0]));\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Get multiple values by their keys\n *\n * @param keys\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction getMany(keys, customStore = defaultGetStore()) {\n return customStore('readonly', (store) => Promise.all(keys.map((key) => promisifyRequest(store.get(key)))));\n}\n/**\n * Update a value. This lets you see the old value and update it as an atomic operation.\n *\n * @param key\n * @param updater A callback that takes the old value and returns a new value.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction update(key, updater, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => \n // Need to create the promise manually.\n // If I try to chain promises, the transaction closes in browsers\n // that use a promise polyfill (IE10/11).\n new Promise((resolve, reject) => {\n store.get(key).onsuccess = function () {\n try {\n store.put(updater(this.result), key);\n resolve(promisifyRequest(store.transaction));\n }\n catch (err) {\n reject(err);\n }\n };\n }));\n}\n/**\n * Delete a particular key from the store.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction del(key, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.delete(key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Delete multiple keys at once.\n *\n * @param keys List of keys to delete.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction delMany(keys, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n keys.forEach((key) => store.delete(key));\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Clear all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction clear(customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.clear();\n return promisifyRequest(store.transaction);\n });\n}\nfunction eachCursor(store, callback) {\n store.openCursor().onsuccess = function () {\n if (!this.result)\n return;\n callback(this.result);\n this.result.continue();\n };\n return promisifyRequest(store.transaction);\n}\n/**\n * Get all keys in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction keys(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n if (store.getAllKeys) {\n return promisifyRequest(store.getAllKeys());\n }\n const items = [];\n return eachCursor(store, (cursor) => items.push(cursor.key)).then(() => items);\n });\n}\n/**\n * Get all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction values(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n if (store.getAll) {\n return promisifyRequest(store.getAll());\n }\n const items = [];\n return eachCursor(store, (cursor) => items.push(cursor.value)).then(() => items);\n });\n}\n/**\n * Get all entries in the store. Each entry is an array of `[key, value]`.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction entries(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n // (although, hopefully we'll get a simpler path some day)\n if (store.getAll && store.getAllKeys) {\n return Promise.all([\n promisifyRequest(store.getAllKeys()),\n promisifyRequest(store.getAll()),\n ]).then(([keys, values]) => keys.map((key, i) => [key, values[i]]));\n }\n const items = [];\n return customStore('readonly', (store) => eachCursor(store, (cursor) => items.push([cursor.key, cursor.value])).then(() => items));\n });\n}\n\nexport { clear, createStore, del, delMany, entries, get, getMany, keys, promisifyRequest, set, setMany, update, values };\n", "import type {DelegationChain, ECDSAKeyIdentity} from '@icp-sdk/core/identity';\nimport {generateUnsafeDevIdentity} from '@junobuild/ic-client/dev';\nimport type {DevIdentitySignInOptions} from '../types/dev-identity';\nimport type {ProviderWithoutData} from '../types/provider';\n\n/**\n * Development identity authentication provider for local testing.\n *\n * \u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\n * \u26A0\uFE0F UNSAFE - FOR LOCAL DEVELOPMENT ONLY \u26A0\uFE0F\n * \u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\n *\n * This provider generates deterministic identities for local development\n * without requiring external authentication services. Only works on localhost.\n *\n * @class DevIdentityProvider\n */\nexport class DevIdentityProvider {\n /**\n * Signs in a user with a development identity.\n *\n * @param {Object} params - The sign-in parameters.\n * @param {DevIdentitySignInOptions} [params.options] - Optional configuration for the dev identity (identifier, TTL).\n * @param {Function} params.initAuth - Callback to initialize or load the user after identity generation.\n * @param {Function} params.setStorage - Callback to store the session key and delegation chain for AuthClient.\n *\n * @returns {Promise<void>} Resolves when sign-in is complete.\n *\n * @throws {UnsafeDevIdentityNotBrowserError} If called outside browser environment.\n * @throws {UnsafeDevIdentityNotLocalhostError} If called outside localhost.\n * @throws {UnsafeDevIdentityInvalidIdentifierError} If identifier exceeds 32 characters.\n */\n async signIn({\n options,\n initAuth,\n setStorage\n }: {\n options?: DevIdentitySignInOptions;\n initAuth: (params: {provider: ProviderWithoutData}) => Promise<void>;\n setStorage: (params: {\n delegationChain: DelegationChain;\n sessionKey: ECDSAKeyIdentity;\n }) => Promise<void>;\n }): Promise<void> {\n // 1. Create a local identity and save the identifier usage in IDB\n const {sessionKey, delegationChain} = await generateUnsafeDevIdentity(options);\n\n // 2. We save the session and delegation for use with AuthClient\n await setStorage({sessionKey, delegationChain});\n\n // 3. Create a new AuthClient, load or create the user\n await initAuth({provider: undefined});\n }\n}\n", "import {requestJwt} from '@junobuild/auth/delegation';\nimport {isEmptyString, isNullish, notEmptyString} from '@junobuild/utils';\nimport {envApiUrl, envGitHubClientId} from '../../core/utils/window.env.utils';\nimport {SignInMissingClientIdError} from '../types/errors';\nimport type {GitHubSignInRedirectOptions} from '../types/github';\nimport {parseOptionalUrl} from '../utils/url.utils';\n\nexport class GitHubProvider {\n /**\n * Initiates a GitHub sign-in flow.\n *\n * @param {Object} params - Parameters for the sign-in request.\n * @param {GitHubSignInRedirectOptions} [params.options] - Optional configuration for the sign-in request.\n *\n * @returns {Promise<void>} Resolves once the sign-in flow has been initiated.\n */\n async signIn({options = {}}: {options?: GitHubSignInRedirectOptions}) {\n const clientId = options?.redirect?.clientId ?? envGitHubClientId();\n\n if (isNullish(clientId)) {\n throw new SignInMissingClientIdError();\n }\n\n const {redirect} = options;\n\n const initUrl = (): string | undefined => {\n const initUrl = options?.redirect?.initUrl;\n\n if (notEmptyString(initUrl)) {\n return initUrl;\n }\n\n const apiUrl = envApiUrl();\n\n if (isEmptyString(apiUrl)) {\n return undefined;\n }\n\n return parseOptionalUrl({url: `${apiUrl}/v1/auth/init/github`})?.toString();\n };\n\n await requestJwt({\n github: {\n redirect: {\n ...(redirect ?? {}),\n clientId,\n initUrl: initUrl()\n }\n }\n });\n }\n}\n", "import {requestJwt} from '@junobuild/auth/delegation';\nimport {isNullish} from '@junobuild/utils';\nimport {envGoogleClientId} from '../../core/utils/window.env.utils';\nimport {SignInMissingClientIdError} from '../types/errors';\nimport type {GoogleSignInRedirectOptions} from '../types/google';\n\nexport class GoogleProvider {\n /**\n * Initiates a Google sign-in flow.\n *\n * Depending on the environment or configuration, this may redirect the user\n * to Google's authentication screen or trigger a browser-native sign-in flow\n * (such as FedCM in the future).\n *\n * @param {Object} params - Parameters for the sign-in request.\n * @param {GoogleSignInRedirectOptions} [params.options] - Optional configuration for the sign-in request.\n *\n * @returns {Promise<void>} Resolves once the sign-in flow has been initiated.\n */\n async signIn({options = {}}: {options?: GoogleSignInRedirectOptions}) {\n const clientId = options?.redirect?.clientId ?? envGoogleClientId();\n\n if (isNullish(clientId)) {\n throw new SignInMissingClientIdError();\n }\n\n const {redirect} = options;\n\n await requestJwt({\n google: {\n redirect: {\n ...(redirect ?? {}),\n clientId\n }\n }\n });\n }\n}\n", "import {IdbStorage, KEY_STORAGE_DELEGATION, KEY_STORAGE_KEY} from '@icp-sdk/auth/client';\nimport {type SignIdentity, AnonymousIdentity} from '@icp-sdk/core/agent';\nimport {\n DelegationChain,\n DelegationIdentity,\n DER_COSE_OID,\n ECDSAKeyIdentity,\n unwrapDER\n} from '@icp-sdk/core/identity';\nimport {\n type RetrievePublicKeyFn,\n type WebAuthnNewCredential,\n type WebAuthnSignProgressFn,\n WebAuthnIdentity,\n WebAuthnSignProgressStep\n} from '@junobuild/ic-client/webauthn';\nimport {isNullish, uint8ArrayToBase64} from '@junobuild/utils';\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 {User} from '../types/user';\nimport {\n type WebAuthnSignInOptions,\n type WebAuthnSignUpOptions,\n WebAuthnSignInProgressStep,\n WebAuthnSignUpProgressStep\n} from '../types/webauthn';\n\ninterface SessionDelegationIdentity {\n delegationIdentity: DelegationIdentity;\n sessionKey: ECDSAKeyIdentity;\n}\n\nexport class WebAuthnProvider {\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, 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 {Identity} from '@icp-sdk/core/agent';\nimport type {WebAuthnIdentity, WebAuthnNewCredential} from '@junobuild/ic-client/webauthn';\nimport {nonNullish, uint8ArrayToArrayOfNumber} from '@junobuild/utils';\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: passkeyIdentity.getPublicKey().toRaw()\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 {executeWithWindowGuard} from '../helpers/window.helpers';\nimport {DevIdentityProvider} from '../providers/dev-identity.providers';\nimport {GitHubProvider} from '../providers/github.providers';\nimport {GoogleProvider} from '../providers/google.providers';\nimport {InternetIdentityProvider} from '../providers/internet-identity.providers';\nimport {WebAuthnProvider} from '../providers/webauthn.providers';\nimport {AuthClientStore} from '../stores/auth-client.store';\nimport {AuthStore} from '../stores/auth.store';\nimport type {SignInContext, SignInOptions} from '../types/auth';\nimport {SignInProviderNotSupportedError} from '../types/errors';\nimport type {ProviderWithoutData} from '../types/provider';\nimport {authenticateWithAuthClient} from './_auth-client.services';\nimport {initUser} from './_user.services';\nimport {loadAuth} from './load.services';\n\n/**\n * Initialize the authClient, load or create a new user.\n * Executed on sign-in.\n *\n * \u2139\uFE0F Exposed for testing purpose only.\n */\nexport const createAuth = async ({provider}: {provider: ProviderWithoutData}) => {\n const init = async () => {\n const user = await initUser({provider});\n AuthStore.getInstance().set(user);\n };\n\n await authenticateWithAuthClient({fn: init, syncTabsOnSuccess: true});\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 if ('google' in options) {\n const {\n google: {options: signInOptions}\n } = options;\n\n const fn = (): Promise<void> =>\n new GoogleProvider().signIn({\n options: signInOptions\n });\n\n await signInWithContext({\n fn,\n context: {windowGuard: false}\n });\n\n return;\n }\n\n if ('github' in options) {\n const {\n github: {options: signInOptions}\n } = options;\n\n const fn = (): Promise<void> =>\n new GitHubProvider().signIn({\n options: signInOptions\n });\n\n await signInWithContext({\n fn,\n context: {windowGuard: false}\n });\n\n return;\n }\n\n if ('webauthn' in options) {\n const {\n webauthn: {options: signInOptions, context}\n } = options;\n\n const fn = (): Promise<void> =>\n new WebAuthnProvider().signIn({\n options: signInOptions,\n loadAuth: (): Promise<void> => loadAuth({syncTabsOnSuccess: true})\n });\n\n await signInWithContext({fn, context});\n\n return;\n }\n\n if ('internet_identity' in options) {\n const {\n internet_identity: {options: iiOptions, context}\n } = options;\n\n const {domain, ...signInOptions} = iiOptions ?? {};\n\n const fn = (): Promise<void> =>\n new InternetIdentityProvider({domain}).signIn({\n options: signInOptions,\n authClient: AuthClientStore.getInstance().getAuthClient(),\n initAuth: createAuth\n });\n\n await signInWithContext({fn, context});\n\n return;\n }\n\n if ('dev' in options) {\n const {\n dev: {options: devOptions}\n } = options;\n\n const {setAuthClientStorage: setStorage} = AuthClientStore.getInstance();\n\n const fn = (): Promise<void> =>\n new DevIdentityProvider().signIn({\n options: devOptions,\n initAuth: createAuth,\n setStorage\n });\n\n await signInWithContext({\n fn,\n context: {windowGuard: false}\n });\n\n return;\n }\n\n throw new SignInProviderNotSupportedError(\n 'An unknown or unsupported provider was provided for sign-in.'\n );\n};\n\nconst signInWithContext = async ({\n fn,\n context\n}: {\n fn: () => Promise<void>;\n context?: SignInContext;\n}): Promise<void> => {\n const disableWindowGuard = context?.windowGuard === false;\n\n if (disableWindowGuard) {\n await fn();\n return;\n }\n\n await executeWithWindowGuard({fn});\n};\n", "import {executeWithWindowGuard} from '../helpers/window.helpers';\nimport {WebAuthnProvider} from '../providers/webauthn.providers';\nimport type {SignUpOptions} from '../types/auth';\nimport {SignUpProviderNotSupportedError} from '../types/errors';\nimport {loadAuthWithUser} from './load.services';\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 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", "import type {User} from '../types/user';\n\n/**\n * Checks whether a user signed in using WebAuthn.\n *\n * Acts as a type guard that narrows {@link User} to {@link User<'webauthn'>}.\n *\n * @param user - The user object to check.\n * @returns True if the user signed in via WebAuthn.\n */\nexport const isWebAuthnUser = (user: User): user is User<'webauthn'> =>\n user?.data?.provider === 'webauthn';\n\n/**\n * Checks whether a user signed in using Google (OpenID).\n *\n * Acts as a type guard that narrows {@link User} to {@link User<'google'>}.\n *\n * @param user - The user object to check.\n * @returns True if the user signed in via Google.\n */\nexport const isGoogleUser = (user: User): user is User<'google'> =>\n user?.data?.provider === 'google';\n\n/**\n * Checks whether a user signed in using GitHub (OpenID).\n *\n * Acts as a type guard that narrows {@link User} to {@link User<'github'>}.\n *\n * @param user - The user object to check.\n * @returns True if the user signed in via GitHub.\n */\nexport const isGitHubUser = (user: User): user is User<'github'> =>\n user?.data?.provider === 'github';\n", "import type {ActorMethod, ActorSubclass} from '@icp-sdk/core/agent';\nimport type {IDL} from '@icp-sdk/core/candid';\nimport {getSatelliteExtendedActor as getSatelliteExtendedActorApi} from '../../core/api/actor.api';\nimport {getAnyIdentity} from '../../core/services/any-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 type {ConsoleDid, SatelliteDid} from '@junobuild/ic-client/actor';\nimport {assertNonNullish, isBrowser, toNullable} 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", "import type {SatelliteDid} from '@junobuild/ic-client/actor';\nimport {\n uploadAsset as uploadAssetStorage,\n type AssetKey,\n type UploadAsset\n} from '@junobuild/storage';\nimport {fromNullable, toNullable} from '@junobuild/utils';\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 setAssetToken = async ({\n collection,\n fullPath,\n token,\n ...rest\n}: {\n collection: string;\n token: string | null;\n} & ActorUpdateParams &\n Pick<AssetKey, 'fullPath'>): Promise<void> => {\n const {set_asset_token} = await getSatelliteActor(rest);\n\n return set_asset_token(collection, fullPath, toNullable(token));\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", "export const sha256ToBase64String = (sha256: Iterable<number>): string =>\n btoa([...sha256].map((c) => String.fromCharCode(c)).join(''));\n", "import type {SatelliteDid} from '@junobuild/ic-client/actor';\nimport type {Asset, AssetEncoding, AssetKey, Storage} from '@junobuild/storage';\nimport {fromNullable, nonNullish} from '@junobuild/utils';\nimport {DEFAULT_READ_OPTIONS} from '../../core/constants/call-options.constants';\nimport {getAnyIdentity} from '../../core/services/any-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 setAssetToken as setAssetTokenApi,\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 ...(nonNullish(token) && {token}),\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 * Set an access token for an asset of the storage.\n *\n * @param {Object} params - The parameters for setting the access token.\n * @param {string} params.collection - The name of the collection.\n * @param {string} params.fullPath - The full path of the asset.\n * @param {string | null} params.token - The access token. Providing undined removes any existing protection and makes the asset accessible without access token.\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 access token has been set to the asset.\n */\nexport const setAssetToken = ({\n collection,\n fullPath,\n token,\n satellite\n}: {\n collection: string;\n token: string | null;\n satellite?: SatelliteOptions;\n} & Pick<AssetKey, 'fullPath'>): Promise<void> =>\n setAssetTokenApi({\n collection,\n fullPath,\n token,\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<AssetKey, '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 {isWebAuthnAvailable} from '@junobuild/ic-client/webauthn';\nimport type {Asset, AssetEncoding, AssetKey, EncodingType, Storage} from '@junobuild/storage';\nimport {assertNonNullish, nonNullish} from '@junobuild/utils';\nimport {initAuthTimeoutWorker} from './auth/services/auth-timout.services';\nimport {initAuthBroadcastListener} from './auth/services/broadcast.services';\nimport {loadAuth} from './auth/services/load.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 {getIdentityOnce, unsafeIdentity} from './auth/services/identity.services';\nexport {handleRedirectCallback} from './auth/services/redirect.services';\nexport {signIn} from './auth/services/sign-in.services';\nexport {signOut} from './auth/services/sign-out.services';\nexport {signUp} from './auth/services/sign-up.services';\nexport type * from './auth/types/auth';\nexport * from './auth/types/auth-client';\nexport type * from './auth/types/dev-identity';\nexport * from './auth/types/errors';\nexport type * from './auth/types/github';\nexport type * from './auth/types/google';\nexport type * from './auth/types/internet-identity';\nexport type * from './auth/types/progress';\nexport type * from './auth/types/provider';\nexport type * from './auth/types/user';\nexport * from './auth/types/webauthn';\nexport * from './auth/utils/user.utils';\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 syncTabs: userEnv?.syncTabs,\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 const syncTabsSubscribe = env.syncTabs === false ? undefined : initAuthBroadcastListener();\n\n return [\n ...(nonNullish(authSubscribe) ? [authSubscribe] : []),\n ...(nonNullish(syncTabsSubscribe) ? [syncTabsSubscribe] : [])\n ];\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';\n"],
|
|
5
|
-
"mappings": "AAAO,IACMA,GAAN,cAA2B,KAAM,CAAC,EAE5BC,GAI0B,CAAIC,EAAUC,IAA2B,CAC9E,GAAID,GAAU,KACZ,MAAM,IAAIF,GAAaG,CAAO,CAElC,ECTO,IAoCMC,GAA2BC,GAAoC,IAAI,WAAWA,CAAM,EAEpFC,GAA6BC,GAAqC,MAAM,KAAKA,CAAK,EAtCxF,IA8DMC,GAAmB,CAAC,CAAC,EAAAC,EAAG,EAAAC,CAAC,IACpCD,EAAE,SAAWC,EAAE,QAAUD,EAAE,MAAM,CAACE,EAAMC,IAAMD,IAASD,EAAEE,CAAC,CAAC,EC3DtD,IAAMC,GAAsBC,GAAmC,CAKpE,IAAMC,EAAmB,CAAC,EAC1B,QAASC,EAAI,EAAGA,EAAIF,EAAW,OAAQE,GAAK,MAC1CD,EAAO,KAAK,OAAO,aAAa,GAAGD,EAAW,SAASE,EAAGA,EAAI,KAAS,CAAC,CAAC,EAE3E,OAAO,KAAKD,EAAO,KAAK,EAAE,CAAC,CAC7B,EAQaE,GAAsBC,GACjC,WAAW,KAAK,KAAKA,CAAY,EAAIC,GAAMA,EAAE,WAAW,CAAC,CAAC,EGlBrD,IAAMC,EAAgBC,GAC3BA,GAAa,KASFC,EAAiBD,GAC5B,CAACD,EAAUC,CAAQ,EAQRE,GAAkBC,GAC7BF,EAAWE,CAAK,GAAKA,IAAU,GAQpBC,EAAiBD,GAC5B,CAACD,GAAeC,CAAK,ECzBVE,EAAiBF,GAAmCF,EAAWE,CAAK,EAAI,CAACA,CAAK,EAAI,CAAC,EASnFG,EAAmBH,GAAsCA,IAAQ,CAAC,ECpB/E,IAAMI,GAAW,mCAGXC,GAAsC,OAAO,OAAO,IAAI,EAC9D,QAASC,EAAI,EAAGA,EAAIF,GAAS,OAA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C,QAASU,GAAWG,EACtB,CAAC,CACH,EA6BaP,GAAc,CAAC,CAC1B,SAAU,CAAC,SAAAH,EAAU,MAAAP,CAAK,EAC1B,UAAWC,CACb,IAE+C,CAC7C,IAAMO,EAAY,CAAC,GAAGP,EAAkB,SAAUI,EAAeJ,GAAkB,QAAQ,CAAC,EAE5F,MAAO,GAAGsC,GAAa/B,CAAS,CAAC,GAAGD,CAAQ,GAAGI,EAAWX,CAAK,EAAI,UAAUA,CAAK,GAAK,EAAE,EAC3F,EC9VA,IAAMwC,GAAYC,GAA2C,CAC3D,IAAMC,EAAcD,GAAS,aAAeE,GAAe,EAE3DC,GAAiBF,EAAa,6DAA6D,EAE3F,IAAMG,EAAYJ,GAAS,WAAaK,GAAa,EAErD,MAAO,CACL,YAAAJ,EACA,mBAAoBD,GAAS,mBAC7B,QAASA,GAAS,QAClB,SAAUA,GAAS,SACnB,UAAAI,CACF,CACF,EAKaE,GAAYN,GACvBO,GAAcP,CAAO,EAQVO,GAAgB,MAAOP,GAAsD,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,OAExEK,EAAoBL,EAAI,WAAa,GAAQ,OAAYM,GAA0B,EAEzF,MAAO,CACL,GAAIC,EAAWJ,CAAa,EAAI,CAACA,CAAa,EAAI,CAAC,EACnD,GAAII,EAAWF,CAAiB,EAAI,CAACA,CAAiB,EAAI,CAAC,CAC7D,CACF,EAOaG,GAAqBC,GAChCC,EAAU,YAAY,EAAE,UAAUD,CAAQ,EAK/BN,GAAgBK",
|
|
6
|
-
"names": ["NullishError", "assertNonNullish", "value", "message", "arrayBufferToUint8Array", "buffer", "uint8ArrayToArrayOfNumber", "array", "uint8ArraysEqual", "a", "b", "byte", "i", "uint8ArrayToBase64", "uint8Array", "chunks", "i", "base64ToUint8Array", "base64String", "c", "isNullish", "argument", "nonNullish", "notEmptyString", "value", "isEmptyString", "toNullable", "fromNullable", "alphabet", "lookupTable", "i", "base32Encode", "input", "skip", "bits", "output", "encodeByte", "byte", "base32Decode", "o", "decodeChar", "char", "val", "c", "lookUpTable", "getCrc32", "buf", "crc", "t", "isBytes", "a", "abytes", "b", "lengths", "aexists", "instance", "checkFinished", "aoutput", "out", "min", "clean", "arrays", "createView", "arr", "rotr", "word", "shift", "hasHexBuiltin", "hexes", "_", "bytesToHex", "bytes", "hex", "asciis", "asciiToBase16", "ch", "hexToBytes", "hl", "al", "array", "ai", "hi", "n1", "n2", "utf8ToBytes", "str", "toBytes", "data", "Hash", "createHasher", "hashCons", "hashC", "msg", "tmp", "setBigUint64", "view", "byteOffset", "value", "isLE", "_32n", "_u32_max", "wh", "wl", "h", "l", "Chi", "Maj", "HashMD", "blockLen", "outputLen", "padOffset", "buffer", "len", "pos", "take", "dataView", "oview", "outLen", "state", "res", "to", "length", "finished", "destroyed", "SHA256_IV", "SHA224_IV", "SHA256_K", "SHA256_W", "SHA256", "A", "B", "C", "D", "E", "F", "G", "H", "offset", "W15", "W2", "s0", "s1", "sigma1", "T1", "T2", "SHA224", "sha224", "JSON_KEY_PRINCIPAL", "SELF_AUTHENTICATING_SUFFIX", "ANONYMOUS_SUFFIX", "MANAGEMENT_CANISTER_PRINCIPAL_TEXT_STR", "Principal", "_Principal", "publicKey", "sha", "other", "text", "maybePrincipal", "obj", "canisterIdNoDash", "principal", "_arr", "checksumArrayBuf", "checksum", "matches", "cmp", "JSON_KEY_BIGINT", "JSON_KEY_UINT8ARRAY", "jsonReplacer", "_key", "nonNullish", "jsonReviver", "mapValue", "key", "toArray", "blob", "fromArray", "isBrowser", "DER_COSE_OID", "wrapDER", "Cbor", "SignIdentity", "extractAAGUID", "authData", "bytes", "result", "bytesToAAGUID", "aaguid", "uint8ArrayToArrayOfNumber", "byte", "_authDataToCose", "dataView", "idLenBytes", "v", "i", "credentialIdLength", "_coseToDerEncodedBlob", "cose", "wrapDER", "DER_COSE_OID", "CosePublicKey", "_cose", "#encodedKey", "WebAuthnCredential", "#credentialId", "#publicKey", "credentialId", "uint8ArrayToBase64", "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", "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", "isNullish", "WebAuthnIdentityCreateCredentialOnTheDeviceError", "assertCredentialPublicKey", "type", "WebAuthnIdentityCredentialNotPublicKeyError", "WebAuthnIdentity", "_WebAuthnIdentity", "SignIdentity", "#onSignProgress", "#state", "args", "retrievePublicKey", "#createInitializedState", "WebAuthnNewCredential", "restArgs", "attestationObject", "rawId", "WebAuthnIdentityNoAttestationError", "authData", "Cbor", "arrayBufferToUint8Array", "cose", "_authDataToCose", "blob", "uint8ArraysEqual", "WebAuthnIdentityInvalidCredentialIdError", "WebAuthnExistingCredential", "response", "clientDataJSON", "authenticatorData", "signature", "WebAuthnIdentityNoAuthenticatorDataError", "encoded", "WebAuthnIdentityEncodeCborSignatureError", "isWebAuthnAvailable", "nonNullish", "Store", "data", "callback", "callbackId", "id", "AuthStore", "_AuthStore", "Store", "authUser", "callback", "unsubscribe", "emit", "message", "detail", "$event", "Actor", "HttpAgent", "DOCKER_CONTAINER_URL", "DOCKER_INTERNET_IDENTITY_ID", "createAgent", "identity", "container", "host", "d", "DOCKER_CONTAINER_URL", "shouldFetchRootKey", "HttpAgent", "AgentStore", "_AgentStore", "#agents", "ot", "identity", "rest", "key", "agent", "createAgent", "ActorStore", "_ActorStore", "#actors", "ot", "satelliteId", "identity", "actorKey", "rest", "key", "actor", "idlFactory", "canisterId", "agent", "AgentStore", "Actor", "AuthClient", "IdbStorage", "KEY_STORAGE_DELEGATION", "KEY_STORAGE_KEY", "AuthClientStore", "_AuthClientStore", "#instance", "#authClient", "ot", "AuthClient", "storage", "IdbStorage", "KEY_STORAGE_KEY", "KEY_STORAGE_DELEGATION", "delegationChain", "sessionKey", "signOut", "options", "resetAuth", "AuthClientStore", "AuthStore", "ActorStore", "AgentStore", "initAuthTimeoutWorker", "auth", "workerUrl", "worker", "timeoutSignOut", "emit", "signOut", "data", "msg", "value", "AuthStore", "user", "ot", "AuthBroadcastChannel", "_AuthBroadcastChannel", "#instance", "#bc", "#emitterId", "ot", "handler", "origin", "eventOrigin", "data", "d", "it", "EnvStore", "_EnvStore", "Store", "env", "callback", "unsubscribe", "authenticateWithAuthClient", "fn", "syncTabsOnSuccess", "authenticated", "authenticate", "EnvStore", "syncTabs", "authenticateWithNewAuthClient", "createAuthClient", "AuthClientStore", "isAuthenticated", "safeCreateAuthClient", "AuthBroadcastChannel", "err", "isSatelliteError", "error", "type", "JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE", "DEFAULT_READ_OPTIONS", "AnonymousIdentity", "getIdentity", "AuthClientStore", "unsafeIdentity", "getAuthClient", "createAuthClient", "getIdentityOnce", "user", "AuthStore", "ot", "authClient", "getAnyIdentity", "identity", "d", "getIdentity", "AnonymousIdentity", "Actor", "HttpAgent", "idlFactory", "IDL", "Memory", "InitStorageArgs", "InitSatelliteArgs", "OpenIdPrepareDelegationArgs", "AuthenticationArgs", "Doc", "PreparedDelegation", "Authentication", "JwtFindProviderError", "JwtVerifyError", "GetOrRefreshJwksError", "PrepareDelegationError", "AuthenticationError", "AuthenticateResultResponse", "OpenIdPrepareAutomationArgs", "AuthenticateAutomationArgs", "AutomationScope", "AutomationController", "PrepareAutomationError", "AuthenticationAutomationError", "AuthenticateAutomationResultResponse", "AssetKey", "CertifyAssetsCursor", "CertifyAssetsStrategy", "CertifyAssetsArgs", "CertifyAssetsResult", "CommitBatch", "CommitProposal", "ListOrderField", "ListOrder", "TimestampMatcher", "ListMatcher", "ListPaginate", "ListParams", "DeleteControllersArgs", "AccessKeyKind", "AccessKeyScope", "AccessKey", "DelDoc", "CollectionType", "DelRule", "DeleteProposalAssets", "DepositCyclesArgs", "AssetEncodingNoContent", "AssetNoContent", "OpenIdDelegationProvider", "OpenIdAuthProviderDelegationConfig", "OpenIdAuthProviderConfig", "AuthenticationConfigOpenId", "AuthenticationConfigInternetIdentity", "AuthenticationRules", "AuthenticationConfig", "OpenIdAutomationProvider", "OpenIdAutomationProviderControllerConfig", "RepositoryKey", "OpenIdAutomationRepositoryConfig", "OpenIdAutomationProviderConfig", "AutomationConfigOpenId", "AutomationConfig", "ConfigMaxMemorySize", "DbConfig", "StorageConfigIFrame", "StorageConfigRawAccess", "StorageConfigRedirect", "StorageConfig", "Config", "OpenIdGetDelegationArgs", "GetDelegationArgs", "Delegation", "SignedDelegation", "GetDelegationError", "GetDelegationResultResponse", "ProposalStatus", "AssetsUpgradeOptions", "SegmentsDeploymentOptions", "ProposalType", "Proposal", "Permission", "RateConfig", "Rule", "HttpRequest", "StreamingCallbackToken", "StreamingStrategy", "HttpResponse", "StreamingCallbackHttpResponse", "InitAssetKey", "InitUploadResult", "ListResults", "CustomDomain", "ListResults_1", "ListProposalsOrder", "ListProposalsPaginate", "ListProposalsParams", "ProposalKey", "ListProposalResults", "ListRulesMatcher", "ListRulesParams", "ListRulesResults", "MemorySize", "SetAuthenticationConfig", "SetAutomationConfig", "SetAccessKey", "SetControllersArgs", "SetDbConfig", "SetDoc", "SetRule", "SetStorageConfig", "SetStorageConfigOptions", "SetStorageConfigWithOptions", "UploadChunk", "UploadChunkResult", "Tokens", "AssertMissionControlCenterArgs", "OpenIdData", "OpenId", "Provider", "Account", "Result", "CreateMissionControlArgs", "CreateOrbiterArgs", "InitStorageMemory", "CreateSatelliteArgs", "GetCreateCanisterFeeArgs", "Result_1", "SegmentKind", "CyclesTokens", "FactoryFee", "PaymentStatus", "IcpPayment", "IcrcPaymentKey", "Account_1", "IcrcPayment", "StorableSegmentKind", "ListSegmentsArgs", "SegmentKey", "Segment", "FeesArgs", "SetSegmentsArgs", "SetSegmentMetadataArgs", "UnsetSegmentsArgs", "createAgent", "identity", "host", "localActor", "HttpAgent", "useOrInitAgent", "agent", "rest", "initAgent", "container", "nonNullish", "getSatelliteActor", "satelliteId", "certified", "rest", "getActor", "idlFactory", "getConsoleActor", "consoleId", "certified", "rest", "getActor", "idlFactory", "canisterId", "isNullish", "createActor", "config", "agent", "useOrInitAgent", "Actor", "satelliteUrl", "customSatelliteId", "customContainer", "satelliteId", "customOrEnvSatelliteId", "container", "customOrEnvContainer", "d", "containerHost", "protocol", "DOCKER_CONTAINER_URL", "EnvStore", "getSatelliteActor", "satellite", "certified", "getActor", "Te", "_e", "getSatelliteExtendedActor", "idlFactory", "rest", "customSatelliteId", "customContainer", "satelliteId", "customOrEnvSatelliteId", "U", "container", "customOrEnvContainer", "ActorStore", "Principal", "SignInError", "SignInInitError", "SignInUserInterruptError", "SignInProviderNotSupportedError", "SignInMissingClientIdError", "WebAuthnSignInRetrievePublicKeyError", "SignUpProviderNotSupportedError", "InitError", "ListError", "toListMatcherTimestamp", "matcher", "ot", "Mt", "ListError", "toListParams", "paginate", "order", "owner", "Principal", "mapData", "data", "he", "err", "toSetDoc", "doc", "data", "version", "description", "Mt", "de", "toDelDoc", "fromDoc", "key", "owner", "docDescription", "rest", "J", "he", "getDoc", "collection", "key", "rest", "get_doc", "getSatelliteActor", "doc", "J", "ot", "fromDoc", "getManyDocs", "docs", "get_many_docs", "payload", "resultsDocs", "results", "resultDoc", "d", "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", "initUser", "provider", "user", "userId", "loadUser", "d", "createUser", "error", "t", "s_", "userOnCreateError", "getUser", "identity", "getIdentity", "ot", "InitError", "getDoc", "rest", "setDoc", "loadAuth", "syncTabsOnSuccess", "authenticateWithAuthClient", "user", "loadUser", "AuthStore", "reloadAuth", "authenticateWithNewAuthClient", "authenticated", "fn", "loadAuthWithUser", "initAuthBroadcastListener", "bc", "AuthBroadcastChannel", "onLogin", "reloadAuth", "emit", "err", "envSatelliteId", "viteEnvSatelliteId", "envContainer", "viteEnvContainer", "envGoogleClientId", "viteEnvGoogleClientId", "envGitHubClientId", "viteEnvGitHubClientId", "envApiUrl", "viteEnvApiUrl", "DELEGATION_IDENTITY_EXPIRATION", "ALLOW_PIN_AUTHENTICATION", "II_DESIGN_V1_POPUP", "II_DESIGN_V2_POPUP", "INTERNET_COMPUTER_ORG", "IC0_APP", "ID_AI", "popupCenter", "width", "height", "le", "ot", "innerWidth", "innerHeight", "y", "x", "ERROR_USER_INTERRUPT", "execute", "fn", "step", "onProgress", "result", "err", "AuthClientSignInProgressStep", "AuthClientProvider", "options", "authClient", "initAuth", "execute", "#loginWithAuthClient", "resolve", "reject", "ot", "SignInInitError", "error", "ERROR_USER_INTERRUPT", "SignInUserInterruptError", "SignInError", "DELEGATION_IDENTITY_EXPIRATION", "ALLOW_PIN_AUTHENTICATION", "InternetIdentityProvider", "AuthClientProvider", "#domain", "domain", "windowed", "identityProvider", "container", "EnvStore", "ot", "identityV1Domain", "INTERNET_COMPUTER_ORG", "IC0_APP", "ID_AI", "jt", "env", "internetIdentityId", "d", "DOCKER_INTERNET_IDENTITY_ID", "containerHost", "protocol", "DOCKER_CONTAINER_URL", "popupCenter", "hostname", "II_DESIGN_V2_POPUP", "II_DESIGN_V1_POPUP", "toBase64URL", "uint8Array", "uint8ArrayToBase64", "generateSalt", "buildNonce", "salt", "caller", "principal", "bytes", "hash", "arrayBufferToUint8Array", "generateNonce", "Ed25519KeyIdentity", "Ed25519KeyIdentity", "Delegation", "ECDSAKeyIdentity", "DelegationChain", "DelegationIdentity", "CONTEXT_KEY", "GOOGLE_PROVIDER", "GITHUB_PROVIDER", "InvalidUrlError", "ContextUndefinedError", "FedCMIdentityCredentialUndefinedError", "FedCMIdentityCredentialInvalidError", "AuthenticationError", "AuthenticationUrlHashError", "AuthenticationInvalidStateError", "AuthenticationUndefinedJwtError", "GetDelegationError", "GetDelegationRetryError", "ApiGitHubInitError", "options", "ApiGitHubFinalizeError", "JSON_KEY_CALLER", "JSON_KEY_SALT", "JSON_KEY_STATE", "stringifyContext", "caller", "state", "salt", "data", "uint8ArrayToBase64", "parseContext", "jsonData", "jsonCaller", "jsonSalt", "Ed25519KeyIdentity", "base64ToUint8Array", "initContext", "generateState", "nonce", "generateNonce", "storedData", "loadContext", "storedContext", "isNullish", "getAuthActor", "auth", "identity", "getSatelliteActor", "getConsoleActor", "authenticate", "actorParams", "args", "getDelegation", "get_delegation", "generateIdentity", "delegations", "sessionKey", "userKey", "signedDelegations", "delegationChain", "DelegationChain", "DelegationIdentity", "authenticateSession", "jwt", "context", "ECDSAKeyIdentity", "publicKey", "result", "expiration", "rest", "signedDelegation", "retryGetDelegation", "delegation", "signature", "pubkey", "signedExpiration", "targets", "Delegation", "fromNullable", "maxRetries", "i", "resolve", "Err", "initOAuth", "url", "error", "finalizeOAuth", "body", "authenticateGitHubWithRedirect", "finalizeUrl", "search", "urlParams", "code", "idToken", "isEmptyString", "authenticateGoogleWithRedirect", "hash", "params", "savedState", "redirect", "google", "parseUrl", "buildGenerateState", "initUrl", "requestUrl", "requestGitHubJwtWithRedirect", "authUrl", "clientId", "authScopes", "redirectUrl", "currentUrl", "generateRandomState", "toBase64URL", "generateGoogleState", "_params", "requestGoogleJwtWithRedirect", "loginHint", "notEmptyString", "requestGoogleJwtWithCredentials", "configURL", "domainHint", "identityCredential", "type", "requestJwt", "github", "userInitUrl", "restRedirect", "credentials", "configUrl", "parseOptionalUrl", "url", "handleRedirectCallback", "options", "satelliteId", "EnvStore", "ot", "SignInInitError", "container", "auth", "finalizeUrl", "it", "apiUrl", "envApiUrl", "jt", "parseOptionalUrl", "delegationChain", "sessionKey", "identity", "doc", "se", "d", "AuthClientStore", "user", "fromDoc", "loadAuthWithUser", "onBeforeUnload", "$event", "addBeforeUnload", "removeBeforeUnload", "executeWithWindowGuard", "fn", "DelegationChain", "DelegationIdentity", "ECDSAKeyIdentity", "Ed25519KeyIdentity", "promisifyRequest", "request", "resolve", "reject", "createStore", "dbName", "storeName", "dbp", "getDB", "db", "txMode", "callback", "defaultGetStoreFunc", "defaultGetStore", "update", "key", "updater", "customStore", "defaultGetStore", "store", "resolve", "reject", "promisifyRequest", "err", "UnsafeDevIdentityNotBrowserError", "UnsafeDevIdentityNotLocalhostError", "UnsafeDevIdentityInvalidIdentifierError", "length", "identifiersIdbStore", "createStore", "generateUnsafeDevIdentity", "identifier", "maxTimeToLiveInMilliseconds", "UnsafeDevIdentityNotBrowserError", "hostname", "UnsafeDevIdentityNotLocalhostError", "generateSeed", "UnsafeDevIdentityInvalidIdentifierError", "generate", "seedBytes", "rootIdentity", "Ed25519KeyIdentity", "sessionKey", "ECDSAKeyIdentity", "sessionLengthInMilliseconds", "chain", "DelegationChain", "DelegationIdentity", "saveIdentifierUsage", "update", "value", "now", "identifiersIdbStore", "result", "DevIdentityProvider", "options", "initAuth", "setStorage", "sessionKey", "delegationChain", "K", "GitHubProvider", "options", "clientId", "envGitHubClientId", "ot", "SignInMissingClientIdError", "redirect", "Ie", "initUrl", "it", "apiUrl", "envApiUrl", "jt", "parseOptionalUrl", "GoogleProvider", "options", "clientId", "envGoogleClientId", "ot", "SignInMissingClientIdError", "redirect", "Ie", "IdbStorage", "KEY_STORAGE_DELEGATION", "KEY_STORAGE_KEY", "AnonymousIdentity", "DelegationChain", "DelegationIdentity", "DER_COSE_OID", "ECDSAKeyIdentity", "unwrapDER", "createWebAuthnUser", "delegationIdentity", "passkeyIdentity", "satelliteId", "aaguid", "user", "_", "setManyDocs", "d", "Tt", "WebAuthnSignInProgressStep", "WebAuthnSignUpProgressStep", "WebAuthnProvider", "onProgress", "maxTimeToLiveInMilliseconds", "passkeyOptions", "loadAuthWithUser", "satelliteId", "EnvStore", "ot", "SignInInitError", "onSignProgress", "step", "state", "B", "passkeyIdentity", "execute", "F", "delegationIdentity", "sessionKey", "#createSessionDelegation", "user", "createWebAuthnUser", "#saveSessionIdentityForAuthClient", "loadAuth", "retrievePublicKey", "credentialId", "doc", "getDoc", "Lt", "AnonymousIdentity", "WebAuthnSignInRetrievePublicKeyError", "data", "publicKey", "unwrapDER", "DER_COSE_OID", "identity", "ECDSAKeyIdentity", "sessionLengthInMilliseconds", "chain", "DelegationChain", "DelegationIdentity", "storage", "IdbStorage", "KEY_STORAGE_KEY", "KEY_STORAGE_DELEGATION", "createAuth", "provider", "authenticateWithAuthClient", "user", "initUser", "AuthStore", "signIn", "options", "signInOptions", "signInWithContext", "GoogleProvider", "GitHubProvider", "context", "WebAuthnProvider", "loadAuth", "iiOptions", "domain", "InternetIdentityProvider", "AuthClientStore", "devOptions", "setStorage", "DevIdentityProvider", "SignInProviderNotSupportedError", "fn", "executeWithWindowGuard", "signUp", "options", "fn", "signUpWithProvider", "executeWithWindowGuard", "signUpOptions", "WebAuthnProvider", "loadAuthWithUser", "SignUpProviderNotSupportedError", "isWebAuthnUser", "user", "isGoogleUser", "isGitHubUser", "getSatelliteExtendedActor", "idlFactory", "satellite", "identity", "getAnyIdentity", "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", "T", "listAssets", "collection", "filter", "list_assets", "assets", "items_length", "items_page", "matches_length", "matches_pages", "toListParams", "_", "J", "countAssets", "count_assets", "deleteAsset", "fullPath", "deleteManyAssets", "satellite", "del_many_assets", "payload", "deleteFilteredAssets", "del_filtered_assets", "setAssetToken", "token", "set_asset_token", "Mt", "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", "d", "listAssets", "filter", "options", "items", "rest", "DEFAULT_READ_OPTIONS", "assets", "t", "name", "owner", "encodings", "created_at", "updated_at", "J", "acc", "type", "modified", "sha256", "total_length", "sha256ToBase64String", "countAssets", "deleteAsset", "setAssetToken", "deleteManyAssets", "deleteFilteredAssets", "getAsset", "getManyAssets", "satelliteUrl", "parseEnv", "userEnv", "satelliteId", "envSatelliteId", "U", "container", "envContainer", "initJuno", "initSatellite", "env", "EnvStore", "loadAuth", "authSubscribe", "initAuthTimeoutWorker", "syncTabsSubscribe", "initAuthBroadcastListener", "d", "onAuthStateChange", "callback", "AuthStore"]
|
|
3
|
+
"sources": ["../../../utils/src/utils/asserts.utils.ts", "../../../utils/src/utils/arrays.utils.ts", "../../../utils/src/utils/base64.utils.ts", "../../../utils/src/utils/date.utils.ts", "../../../utils/src/utils/debounce.utils.ts", "../../../utils/src/utils/nullish.utils.ts", "../../../utils/src/utils/did.utils.ts", "../../../utils/src/utils/json.utils.ts", "../../../utils/src/utils/doc.utils.ts", "../../../utils/src/utils/env.utils.ts", "../../../utils/src/utils/string.utils.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/core/stores/_store.ts", "../../src/auth/stores/auth.store.ts", "../../src/auth/utils/events.utils.ts", "../../src/core/stores/actor.store.ts", "../../src/core/stores/_agent.factory.ts", "../../src/core/constants/container.constants.ts", "../../src/core/stores/agent.store.ts", "../../src/auth/stores/auth-client.store.ts", "../../src/auth/services/sign-out.services.ts", "../../src/auth/services/auth-timout.services.ts", "../../src/auth/providers/_auth-broadcast.providers.ts", "../../src/core/stores/env.store.ts", "../../src/auth/services/_auth-client.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/constants/call-options.constants.ts", "../../src/core/services/any-identity.services.ts", "../../src/auth/services/identity.services.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/api/actor.api.ts", "../../src/core/utils/list.utils.ts", "../../src/auth/types/errors.ts", "../../src/datastore/utils/data.utils.ts", "../../src/datastore/utils/doc.utils.ts", "../../src/datastore/api/doc.api.ts", "../../src/datastore/services/doc.services.ts", "../../src/auth/services/_user.services.ts", "../../src/auth/services/load.services.ts", "../../src/auth/services/broadcast.services.ts", "../../src/core/utils/window.env.utils.ts", "../../src/auth/constants/auth.constants.ts", "../../src/auth/utils/window.utils.ts", "../../src/auth/providers/_auth-client.providers.ts", "../../src/auth/helpers/progress.helpers.ts", "../../src/auth/types/auth-client.ts", "../../src/auth/providers/internet-identity.providers.ts", "../../../auth/src/utils/nonce.utils.ts", "../../../auth/src/utils/url.utils.ts", "../../../auth/src/delegation/_constants.ts", "../../../auth/src/delegation/_context.ts", "../../../auth/src/delegation/errors.ts", "../../../auth/src/delegation/utils/session-storage.utils.ts", "../../../auth/src/delegation/_session.ts", "../../../auth/src/delegation/api/_actor.api.ts", "../../../auth/src/delegation/api/auth.api.ts", "../../../auth/src/delegation/utils/session.utils.ts", "../../../auth/src/delegation/providers/github/authenticate.ts", "../../../auth/src/delegation/providers/github/_api.ts", "../../../auth/src/delegation/providers/google/authenticate.ts", "../../../auth/src/delegation/authenticate.ts", "../../../auth/src/delegation/utils/url.utils.ts", "../../../auth/src/delegation/providers/github/_context.ts", "../../../auth/src/delegation/providers/github/_openid.ts", "../../../auth/src/delegation/utils/state.utils.ts", "../../../auth/src/delegation/providers/google/_context.ts", "../../../auth/src/delegation/providers/google/_openid.ts", "../../../auth/src/delegation/request.ts", "../../../auth/src/delegation/utils/openid.utils.ts", "../../src/auth/utils/url.utils.ts", "../../src/auth/services/redirect.services.ts", "../../src/auth/helpers/window.helpers.ts", "../../../ic-client/src/dev/errors.ts", "../../../ic-client/src/dev/identity.ts", "../../../../node_modules/idb-keyval/dist/index.js", "../../src/auth/providers/dev-identity.providers.ts", "../../src/auth/providers/github.providers.ts", "../../src/auth/providers/google.providers.ts", "../../src/auth/providers/webauthn.providers.ts", "../../src/auth/services/user-webauthn.services.ts", "../../src/auth/types/webauthn.ts", "../../src/auth/services/sign-in.services.ts", "../../src/auth/services/sign-up.services.ts", "../../src/auth/utils/user.utils.ts", "../../src/functions/services/functions.services.ts", "../../../storage/src/services/upload.services.ts", "../../src/storage/api/storage.api.ts", "../../src/storage/utils/crypto.utils.ts", "../../src/storage/services/storage.services.ts", "../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["export class InvalidPercentageError extends Error {}\nexport class NullishError extends Error {}\n\nexport const assertNonNullish: <T>(\n value: T,\n message?: string\n // eslint-disable-next-line local-rules/prefer-object-params\n) => asserts value is NonNullable<T> = <T>(value: T, message?: string): void => {\n if (value === null || value === undefined) {\n throw new NullishError(message);\n }\n};\n\n// eslint-disable-next-line local-rules/prefer-object-params\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(`${percentage} is not a valid percentage number.`);\n }\n};\n\n/**\n * Utility to enforce exhaustiveness checks in TypeScript.\n *\n * This function should only be called in branches of a `switch` or conditional\n * that should be unreachable if the union type has been fully handled.\n *\n * By typing the parameter as `never`, the compiler will emit an error if\n * a new variant is added to the union but not covered in the logic.\n *\n * @param _ - A value that should be of type `never`. If this is not the case,\n * the TypeScript compiler will flag a type error.\n * @param message - Optional custom error message to include in the thrown error.\n * @throws {Error} Always throws when invoked at runtime.\n *\n */\n// eslint-disable-next-line local-rules/prefer-object-params\nexport const assertNever = (_: never, message?: string): never => {\n throw new Error(message);\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 }\n const high = BigInt(view.getUint32(0));\n const low = BigInt(view.getUint32(4));\n\n return (high << BigInt(32)) + low;\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 => new Uint8Array(buffer);\n\nexport const uint8ArrayToArrayOfNumber = (array: Uint8Array): Array<number> => 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\n/**\n * Compare two Uint8Arrays for byte-level equality.\n *\n * @param {Object} params\n * @param {Uint8Array} params.a - First Uint8Array to compare.\n * @param {Uint8Array} params.b - Second Uint8Array to compare.\n * @returns {boolean} True if both arrays have the same length and identical contents.\n */\nexport const uint8ArraysEqual = ({a, b}: {a: Uint8Array; b: Uint8Array}) =>\n a.length === b.length && a.every((byte, i) => byte === b[i]);\n\nexport const uint8ArrayToHexString = (bytes: Uint8Array | number[]) => {\n if (!(bytes instanceof Uint8Array)) {\n bytes = Uint8Array.from(bytes);\n }\n return bytes.reduce((str, byte) => str + byte.toString(16).padStart(2, '0'), '');\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", "/**\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 // Spreading large Uint8Arrays or using Array.from loses precision when used together with String.fromCharCode.\n // Therefore, we use a chunked loop, which better than a reducer or iterating on every value.\n // Spreading a small chunk - such as 32kb - works as expected.\n const chunkSize = 0x8000; // 32 kb\n const chunks: string[] = [];\n for (let i = 0; i < uint8Array.length; i += chunkSize) {\n chunks.push(String.fromCharCode(...uint8Array.subarray(i, i + chunkSize)));\n }\n return btoa(chunks.join(''));\n};\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", "const 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/no-unsafe-function-type, local-rules/prefer-object-params\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(next, timeout !== undefined && timeout > 0 ? timeout : 300);\n };\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>(argument: T | undefined | null): argument is undefined | null =>\n 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>(argument: T | undefined | null): argument is NonNullable<T> =>\n !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 = (value: string | undefined | null): value is string =>\n 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 = (value: string | undefined | null): value is undefined | null | '' =>\n !notEmptyString(value);\n", "import type {Nullable, NullishNullable} from '../types/did.utils';\nimport {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 {Nullable<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): Nullable<T> => (nonNullish(value) ? [value] : []);\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 {Nullable<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: Nullable<T>): T | undefined => value?.[0];\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 {Nullable<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: Nullable<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 {NullishNullable<T>} 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>(value: NullishNullable<T>): T | undefined =>\n fromNullable(value ?? []);\n", "import {Principal} from '@icp-sdk/core/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 */\n// eslint-disable-next-line local-rules/prefer-object-params\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) && Principal.isPrincipal(value)) {\n // isPrincipal asserts if a value is a Principal, but does not assert if the object\n // contains functions such as toText(). That's why we construct a new object.\n return {[JSON_KEY_PRINCIPAL]: Principal.from(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 */\n// eslint-disable-next-line local-rules/prefer-object-params\nexport const jsonReviver = (_key: string, value: unknown): unknown => {\n const mapValue = <T>(key: string): T => (value as Record<string, T>)[key];\n\n if (nonNullish(value) && typeof value === 'object' && JSON_KEY_BIGINT in value) {\n return BigInt(mapValue(JSON_KEY_BIGINT));\n }\n\n if (nonNullish(value) && typeof value === 'object' && JSON_KEY_PRINCIPAL in value) {\n return Principal.fromText(mapValue(JSON_KEY_PRINCIPAL));\n }\n\n if (nonNullish(value) && typeof value === 'object' && JSON_KEY_UINT8ARRAY in value) {\n return Uint8Array.from(mapValue(JSON_KEY_UINT8ARRAY));\n }\n\n return value;\n};\n", "import {jsonReplacer, jsonReviver} from './json.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 = 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 = new Blob(\n [data instanceof Uint8Array ? (data as Uint8Array<ArrayBuffer>) : new Uint8Array(data)],\n {\n type: 'application/json; charset=utf-8'\n }\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", "// Source: https://stackoverflow.com/a/77489094/5404186\nexport const convertCamelToSnake = (str: string): string =>\n str.replace(/([a-zA-Z])(?=[A-Z])/g, '$1_').toLowerCase();\n\nexport const capitalize = (str: string): string => str.charAt(0).toUpperCase() + str.slice(1);\n", "import {uint8ArrayToArrayOfNumber} from '@junobuild/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 '@icp-sdk/core/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, DER_COSE_OID) as DerEncodedPublicKey;\n}\n", "import type {DerEncodedPublicKey} from '@icp-sdk/core/agent';\nimport type {PublicKeyWithToRaw} from '../types/identity';\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 * extended with mandatory toRaw() and encodedKey made private.\n * It is therefore not covered by that many 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 PublicKeyWithToRaw {\n readonly #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 public toRaw(): Uint8Array {\n return new Uint8Array(this.#encodedKey); // Strip __derEncodedPublicKey__\n }\n}\n", "import {uint8ArrayToBase64} from '@junobuild/utils';\nimport {extractAAGUID} from './aaguid';\nimport {type CoseEncodedKey, CosePublicKey} from './agent-js/cose-key';\nimport type {PublicKeyWithToRaw} from './types/identity';\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(): PublicKeyWithToRaw {\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 Signature, SignIdentity} from '@icp-sdk/core/agent';\nimport {arrayBufferToUint8Array, isNullish, uint8ArraysEqual} from '@junobuild/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 PublicKeyWithToRaw,\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}>(\n arrayBufferToUint8Array(attestationObject)\n );\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(): PublicKeyWithToRaw {\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: Uint8Array): Promise<Signature> {\n // 1. Request user credential (navigator.credentials.get)\n const requestCredential = async (): Promise<PublicKeyCredential> => {\n const credential = await retrieveCredentials({\n challenge: 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 {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 try {\n const {hostname} = new URL(href);\n return hostname;\n } catch {\n throw new WebAuthnIdentityHostnameError();\n }\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 '@junobuild/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", "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';\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 {Actor, type ActorMethod, type ActorSubclass} from '@icp-sdk/core/agent';\nimport type {IDL} from '@icp-sdk/core/candid';\nimport {isNullish} from '@junobuild/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 {HttpAgent} from '@icp-sdk/core/agent';\nimport {nonNullish} from '@junobuild/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", "import type {Agent, HttpAgent} from '@icp-sdk/core/agent';\nimport {isNullish} from '@junobuild/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 {\n AuthClient,\n IdbStorage,\n KEY_STORAGE_DELEGATION,\n KEY_STORAGE_KEY\n} from '@icp-sdk/auth/client';\nimport type {DelegationChain, ECDSAKeyIdentity} from '@icp-sdk/core/identity';\nimport {isNullish} from '@junobuild/utils';\n\nexport class AuthClientStore {\n static #instance: AuthClientStore | undefined;\n\n #authClient: AuthClient | undefined | null;\n\n private constructor() {}\n\n static getInstance(): AuthClientStore {\n if (isNullish(this.#instance)) {\n this.#instance = new AuthClientStore();\n }\n\n return this.#instance;\n }\n\n createAuthClient = async (): Promise<AuthClient> => {\n this.#authClient = await AuthClient.create({\n idleOptions: {\n disableIdle: true,\n disableDefaultIdleCallback: true\n }\n });\n\n return this.#authClient;\n };\n\n /**\n * Since icp-js-core persists identity keys in IndexedDB by default,\n * they could be tampered with and affect the next login.\n * To ensure each session starts clean and safe, we clear the stored keys\n * before creating a new AuthClient.\n *\n * We also remove the delegation because `AuthClient.create` does not\n * overwrite or discard an existing delegation \u2014 it reads it from storage\n * and pairs it with whatever key is present. Once the key is cleared and\n * a fresh one generated, the old delegation would reference a different\n * public key, producing an ECDSA P256 signature / delegation mismatch.\n */\n safeCreateAuthClient = async (): Promise<AuthClient> => {\n const storage = new IdbStorage();\n await Promise.all([storage.remove(KEY_STORAGE_KEY), storage.remove(KEY_STORAGE_DELEGATION)]);\n\n return await this.createAuthClient();\n };\n\n getAuthClient = (): AuthClient | undefined | null => this.#authClient;\n\n logout = async (): Promise<void> => {\n await this.#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 this.#authClient = null;\n };\n\n setAuthClientStorage = async ({\n delegationChain,\n sessionKey\n }: {\n delegationChain: DelegationChain;\n sessionKey: ECDSAKeyIdentity;\n }) => {\n const storage = new IdbStorage();\n\n await Promise.all([\n storage.set(KEY_STORAGE_KEY, sessionKey.getKeyPair()),\n storage.set(KEY_STORAGE_DELEGATION, JSON.stringify(delegationChain.toJSON()))\n ]);\n };\n}\n", "import {ActorStore} from '../../core/stores/actor.store';\nimport {AgentStore} from '../../core/stores/agent.store';\nimport {AuthClientStore} from '../stores/auth-client.store';\nimport {AuthStore} from '../stores/auth.store';\nimport type {SignOutOptions} from '../types/auth';\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 await AuthClientStore.getInstance().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 AuthClientStore.getInstance().logout();\n\n AuthStore.getInstance().reset();\n\n ActorStore.getInstance().reset();\n AgentStore.getInstance().reset();\n};\n", "import {isNullish} from '@junobuild/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 './sign-out.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 }\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", "import {isNullish, nonNullish, notEmptyString} from '@junobuild/utils';\nimport type {BroadcastData} from '../types/auth-broadcast';\n\n// If the user has more than one tab open in the same browser,\n// there could be a mismatch of the cached delegation chain vs the identity key of the `authClient` object.\n// This causes the `authClient` to be unable to correctly sign calls, raising Trust Errors.\n// To mitigate this, we use a `BroadcastChannel` to notify other tabs when a login has occurred, so that they can sync their `authClient` object.\nexport class AuthBroadcastChannel {\n static #instance: AuthBroadcastChannel | null;\n\n readonly #bc: BroadcastChannel;\n readonly #emitterId: string;\n\n static readonly CHANNEL_NAME: BroadcastChannel['name'] = 'juno_core_auth_channel';\n static readonly MESSAGE_LOGIN_SUCCESS = 'authClientLoginSuccess';\n\n private constructor() {\n this.#bc = new BroadcastChannel(AuthBroadcastChannel.CHANNEL_NAME);\n this.#emitterId = window.crypto.randomUUID();\n }\n\n static getInstance(): AuthBroadcastChannel {\n if (isNullish(this.#instance)) {\n this.#instance = new AuthBroadcastChannel();\n }\n\n return this.#instance;\n }\n\n onLoginSuccess = (handler: () => Promise<void>) => {\n const {\n location: {origin}\n } = window;\n\n this.#bc.onmessage = async ({origin: eventOrigin, data}) => {\n if (\n eventOrigin === origin &&\n nonNullish(data) &&\n (data as BroadcastData).msg === 'authClientLoginSuccess' &&\n notEmptyString((data as BroadcastData).emitterId) &&\n data.emitterId !== this.#emitterId\n ) {\n await handler();\n }\n };\n };\n\n destroy = () => {\n this.#bc.close();\n AuthBroadcastChannel.#instance = null;\n };\n\n postLoginSuccess = () => {\n const data: BroadcastData = {\n emitterId: this.#emitterId,\n msg: AuthBroadcastChannel.MESSAGE_LOGIN_SUCCESS\n };\n\n this.#bc.postMessage(data);\n };\n\n get __test__only__emitter_id__(): string {\n return this.#emitterId;\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", "import {EnvStore} from '../../core/stores/env.store';\nimport {AuthBroadcastChannel} from '../providers/_auth-broadcast.providers';\nimport {AuthClientStore} from '../stores/auth-client.store';\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 safeCreateAuthClient}\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 * @param {boolean} params.syncTabsOnSuccess - Broadcast the successful authentication to other tabs.\n *\n * @returns {Promise<void>} Resolves when authentication is handled and the provided function is executed (if applicable).\n */\nexport const authenticateWithAuthClient = async ({\n fn,\n syncTabsOnSuccess\n}: {\n fn: () => Promise<void>;\n syncTabsOnSuccess: boolean;\n}) => {\n const {authenticated} = await authenticate({fn});\n\n if (!authenticated) {\n return;\n }\n\n if (!syncTabsOnSuccess) {\n return;\n }\n\n // Even though the parameter is called syncTabsOnSuccess we perform the check\n // on the environment variable here. This way we do not have to duplicate the code.\n const env = EnvStore.getInstance().get();\n\n if (env?.syncTabs === false) {\n return;\n }\n\n syncTabs();\n};\n\n/**\n * Creates a new `AuthClient` instance and checks authentication state,\n * then forwards the result to the provided callback function.\n *\n * Unlike {@link authenticateWithAuthClient}, this function does **not**\n * reuse or reset the existing `AuthClient`, and does **not** perform broadcast logic.\n * It simply ensures a fresh client is always created and reports whether it is authenticated.\n *\n * @param {Object} params\n * @param {(params: {authenticated: boolean}) => Promise<void>} params.fn\n * The function to execute with the result of the authentication status.\n *\n * @returns {Promise<void>} Resolves once the callback has been invoked.\n */\nexport const authenticateWithNewAuthClient = async ({\n fn\n}: {\n fn: (params: {authenticated: boolean}) => Promise<void>;\n}) => {\n const {createAuthClient} = AuthClientStore.getInstance();\n\n const authClient = await createAuthClient();\n\n const isAuthenticated = await authClient.isAuthenticated();\n\n await fn({authenticated: isAuthenticated});\n};\n\nconst authenticate = async ({fn}: {fn: () => Promise<void>}): Promise<{authenticated: boolean}> => {\n const {createAuthClient, safeCreateAuthClient} = AuthClientStore.getInstance();\n\n const authClient = await createAuthClient();\n\n const isAuthenticated = await authClient.isAuthenticated();\n\n if (!isAuthenticated) {\n await safeCreateAuthClient();\n return {authenticated: false};\n }\n\n await fn();\n\n return {authenticated: true};\n};\n\nconst syncTabs = () => {\n try {\n // If the user has more than one tab open in the same browser,\n // there could be a mismatch of the cached delegation chain vs the identity key of the `authClient` object.\n // This causes the `authClient` to be unable to correctly sign calls, raising Trust Errors.\n // To mitigate this, we use a BroadcastChannel to notify other tabs when a login has occurred, so that they can sync their `authClient` object.\n const bc = AuthBroadcastChannel.getInstance();\n bc.postLoginSuccess();\n } catch (err: unknown) {\n // We don't really care if the broadcast channel fails to open or if it fails to post messages.\n // This is a non-critical feature that improves the UX when the app is open in multiple tabs.\n // We just print a warning in the console for debugging purposes.\n console.warn('Auth BroadcastChannel posting failed', err);\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_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_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';\nexport const JUNO_AUTH_ERROR_NOT_CONFIGURED = 'juno.auth.error.not_configured';\nexport const JUNO_AUTH_ERROR_AUTOMATION_NOT_CONFIGURED =\n 'juno.auth.error.automation_not_configured';\nexport const JUNO_AUTH_ERROR_OPENID_DISABLED = 'juno.auth.error.openid_disabled';\n\nexport const JUNO_AUTOMATION_TOKEN_ERROR_MISSING_JTI = 'juno.automation.token.error.missing_jti';\nexport const JUNO_AUTOMATION_TOKEN_ERROR_TOKEN_REUSED = 'juno.automation.token.error.token_reused';\nexport const JUNO_AUTOMATION_WORKFLOW_ERROR_MISSING_REPOSITORY =\n 'juno.automation.workflow.error.missing_repository';\nexport const JUNO_AUTOMATION_WORKFLOW_ERROR_MISSING_RUN_ID =\n 'juno.automation.workflow.error.missing_run_id';\nexport const JUNO_DATASTORE_ERROR_AUTOMATION_CALLER = 'juno.datastore.error.automation.caller';\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_REGISTER_PROVIDER_INVALID_DATA =\n 'juno.datastore.error.user.register.provider_invalid_data';\n\nexport const JUNO_AUTH_ERROR_PROFILE_EMAIL_INVALID_LENGTH =\n 'juno.auth.error.profile.data.email_invalid_length';\nexport const JUNO_AUTH_ERROR_PROFILE_NAME_INVALID_LENGTH =\n 'juno.auth.error.profile.data.name_invalid_length';\nexport const JUNO_AUTH_ERROR_PROFILE_GIVEN_NAME_INVALID_LENGTH =\n 'juno.auth.error.profile.data.given_name_invalid_length';\nexport const JUNO_AUTH_ERROR_PROFILE_FAMILY_NAME_INVALID_LENGTH =\n 'juno.auth.error.profile.data.family_name_invalid_length';\nexport const JUNO_AUTH_ERROR_PROFILE_PREFERRED_USERNAME_INVALID_LENGTH =\n 'juno.auth.error.profile.data.preferred_username_invalid_length';\nexport const JUNO_AUTH_ERROR_PROFILE_LOCALE_INVALID_LENGTH =\n 'juno.auth.error.profile.data.locale_invalid_length';\nexport const JUNO_AUTH_ERROR_PROFILE_PICTURE_INVALID_URL =\n 'juno.auth.error.profile.data.picture_invalid_url';\nexport const JUNO_AUTH_ERROR_PROFILE_PICTURE_INVALID_SCHEME =\n 'juno.auth.error.profile.data.picture_invalid_scheme';\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';\nexport const JUNO_ERROR_CONTROLLERS_ADMIN_NO_EXPIRY = 'juno.error.controllers.admin_no_expire';\nexport const JUNO_ERROR_CONTROLLERS_EXPIRY_IN_PAST = 'juno.error.controllers.expiry_in_past';\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_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 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 '@icp-sdk/core/agent';\nimport {nonNullish} from '@junobuild/utils';\nimport {getIdentity as getAuthIdentity} from '../../auth/services/identity.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 type {Identity} from '@icp-sdk/core/agent';\nimport {isNullish} from '@junobuild/utils';\nimport {AuthClientStore} from '../stores/auth-client.store';\nimport {AuthStore} from '../stores/auth.store';\n\nexport const getIdentity = (): Identity | undefined =>\n AuthClientStore.getInstance().getAuthClient()?.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 const {getAuthClient, createAuthClient} = AuthClientStore.getInstance();\n\n return (getAuthClient() ?? (await createAuthClient())).getIdentity();\n};\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 authClient = AuthClientStore.getInstance().getAuthClient();\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 ActorConfig, type ActorMethod, type ActorSubclass} from '@icp-sdk/core/agent';\nimport type {IDL} from '@icp-sdk/core/candid';\nimport type {Principal} from '@icp-sdk/core/principal';\nimport {isNullish} from '@junobuild/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", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.1.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nexport const idlFactory = ({IDL}) => {\n const InitMissionControlArgs = 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 InitStorageMemory = IDL.Variant({\n Heap: IDL.Null,\n Stable: IDL.Null\n });\n const InitStorageArgs = IDL.Record({\n system_memory: IDL.Opt(InitStorageMemory)\n });\n const CreateSatelliteConfig = IDL.Record({\n subnet_id: IDL.Opt(IDL.Principal),\n storage: IDL.Opt(InitStorageArgs),\n name: IDL.Opt(IDL.Text)\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 AccessKeyKind = IDL.Variant({\n Emulator: IDL.Null,\n Automation: IDL.Null\n });\n const AccessKeyScope = IDL.Variant({\n Write: IDL.Null,\n Admin: IDL.Null,\n Submit: IDL.Null\n });\n const AccessKey = IDL.Record({\n updated_at: IDL.Nat64,\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n created_at: IDL.Nat64,\n scope: AccessKeyScope,\n expires_at: IDL.Opt(IDL.Nat64)\n });\n const SetAccessKey = IDL.Record({\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n scope: AccessKeyScope,\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\n return IDL.Service({\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([CreateSatelliteConfig], [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, AccessKey))],\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 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), SetAccessKey], [], []),\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), SetAccessKey],\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), SetAccessKey],\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\nexport const init = ({IDL}) => {\n const InitMissionControlArgs = IDL.Record({user: IDL.Principal});\n\n return [InitMissionControlArgs];\n};\n", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.1.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nexport const idlFactory = ({IDL}) => {\n const InitOrbiterArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal)\n });\n const DeleteControllersArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal)\n });\n const AccessKeyKind = IDL.Variant({\n Emulator: IDL.Null,\n Automation: IDL.Null\n });\n const AccessKeyScope = IDL.Variant({\n Write: IDL.Null,\n Admin: IDL.Null,\n Submit: IDL.Null\n });\n const AccessKey = IDL.Record({\n updated_at: IDL.Nat64,\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n created_at: IDL.Nat64,\n scope: AccessKeyScope,\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 SetAccessKey = IDL.Record({\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n scope: AccessKeyScope,\n expires_at: IDL.Opt(IDL.Nat64)\n });\n const SetControllersArgs = IDL.Record({\n controller: SetAccessKey,\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\n return IDL.Service({\n del_controllers: IDL.Func(\n [DeleteControllersArgs],\n [IDL.Vec(IDL.Tuple(IDL.Principal, AccessKey))],\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, AccessKey))], ['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, AccessKey))],\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\nexport const init = ({IDL}) => {\n const InitOrbiterArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal)\n });\n\n return [InitOrbiterArgs];\n};\n", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.1.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nexport const idlFactory = ({IDL}) => {\n const InitOrbiterArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal)\n });\n const DeleteControllersArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal)\n });\n const AccessKeyKind = IDL.Variant({\n Emulator: IDL.Null,\n Automation: IDL.Null\n });\n const AccessKeyScope = IDL.Variant({\n Write: IDL.Null,\n Admin: IDL.Null,\n Submit: IDL.Null\n });\n const AccessKey = IDL.Record({\n updated_at: IDL.Nat64,\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n created_at: IDL.Nat64,\n scope: AccessKeyScope,\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 SetAccessKey = IDL.Record({\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n scope: AccessKeyScope,\n expires_at: IDL.Opt(IDL.Nat64)\n });\n const SetControllersArgs = IDL.Record({\n controller: SetAccessKey,\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\n return IDL.Service({\n del_controllers: IDL.Func(\n [DeleteControllersArgs],\n [IDL.Vec(IDL.Tuple(IDL.Principal, AccessKey))],\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, AccessKey))], []),\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, AccessKey))],\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\nexport const init = ({IDL}) => {\n const InitOrbiterArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal)\n });\n\n return [InitOrbiterArgs];\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", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.1.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nexport const idlFactory = ({IDL}) => {\n const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});\n const InitStorageArgs = IDL.Record({system_memory: IDL.Opt(Memory)});\n const InitSatelliteArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal),\n storage: IDL.Opt(InitStorageArgs)\n });\n const OpenIdPrepareDelegationArgs = IDL.Record({\n jwt: IDL.Text,\n session_key: IDL.Vec(IDL.Nat8),\n salt: IDL.Vec(IDL.Nat8)\n });\n const AuthenticationArgs = IDL.Variant({\n OpenId: OpenIdPrepareDelegationArgs\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 PreparedDelegation = IDL.Record({\n user_key: IDL.Vec(IDL.Nat8),\n expiration: IDL.Nat64\n });\n const Authentication = IDL.Record({\n doc: Doc,\n delegation: PreparedDelegation\n });\n const JwtFindProviderError = IDL.Variant({\n BadClaim: IDL.Text,\n BadSig: IDL.Text,\n NoMatchingProvider: IDL.Null\n });\n const JwtVerifyError = IDL.Variant({\n WrongKeyType: IDL.Null,\n MissingKid: IDL.Null,\n BadClaim: IDL.Text,\n BadSig: IDL.Text,\n NoKeyForKid: IDL.Null\n });\n const GetOrRefreshJwksError = IDL.Variant({\n InvalidConfig: IDL.Text,\n MissingKid: IDL.Null,\n BadClaim: IDL.Text,\n KeyNotFoundCooldown: IDL.Null,\n CertificateNotFound: IDL.Null,\n BadSig: IDL.Text,\n MissingLastAttempt: IDL.Text,\n KeyNotFound: IDL.Null,\n FetchFailed: IDL.Text\n });\n const PrepareDelegationError = IDL.Variant({\n JwtFindProvider: JwtFindProviderError,\n GetCachedJwks: IDL.Null,\n JwtVerify: JwtVerifyError,\n GetOrFetchJwks: GetOrRefreshJwksError,\n DeriveSeedFailed: IDL.Text,\n InvalidObservatoryId: IDL.Text\n });\n const AuthenticationError = IDL.Variant({\n PrepareDelegation: PrepareDelegationError,\n RegisterUser: IDL.Text\n });\n const AuthenticateResultResponse = IDL.Variant({\n Ok: Authentication,\n Err: AuthenticationError\n });\n const OpenIdPrepareAutomationArgs = IDL.Record({\n jwt: IDL.Text,\n salt: IDL.Vec(IDL.Nat8)\n });\n const AuthenticateAutomationArgs = IDL.Variant({\n OpenId: OpenIdPrepareAutomationArgs\n });\n const AutomationScope = IDL.Variant({\n Write: IDL.Null,\n Submit: IDL.Null\n });\n const AutomationController = IDL.Record({\n scope: AutomationScope,\n expires_at: IDL.Nat64\n });\n const PrepareAutomationError = IDL.Variant({\n JwtFindProvider: JwtFindProviderError,\n InvalidController: IDL.Text,\n GetCachedJwks: IDL.Null,\n JwtVerify: JwtVerifyError,\n GetOrFetchJwks: GetOrRefreshJwksError,\n ControllerAlreadyExists: IDL.Null,\n InvalidObservatoryId: IDL.Text,\n TooManyControllers: IDL.Text\n });\n const AuthenticationAutomationError = IDL.Variant({\n PrepareAutomation: PrepareAutomationError,\n RegisterController: IDL.Text,\n SaveWorkflowMetadata: IDL.Text,\n SaveUniqueJtiToken: IDL.Text\n });\n const AuthenticateAutomationResultResponse = IDL.Variant({\n Ok: IDL.Tuple(IDL.Principal, AutomationController),\n Err: AuthenticationAutomationError\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 CertifyAssetsCursor = IDL.Variant({\n Heap: IDL.Record({offset: IDL.Nat64}),\n Stable: IDL.Record({key: IDL.Opt(AssetKey)})\n });\n const CertifyAssetsStrategy = IDL.Variant({\n Append: IDL.Null,\n Clear: IDL.Null,\n AppendWithRouting: IDL.Null\n });\n const CertifyAssetsArgs = IDL.Record({\n cursor: CertifyAssetsCursor,\n strategy: CertifyAssetsStrategy,\n chunk_size: IDL.Opt(IDL.Nat32)\n });\n const CertifyAssetsResult = IDL.Record({\n next_cursor: IDL.Opt(CertifyAssetsCursor)\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 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 AccessKeyKind = IDL.Variant({\n Emulator: IDL.Null,\n Automation: IDL.Null\n });\n const AccessKeyScope = IDL.Variant({\n Write: IDL.Null,\n Admin: IDL.Null,\n Submit: IDL.Null\n });\n const AccessKey = IDL.Record({\n updated_at: IDL.Nat64,\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n created_at: IDL.Nat64,\n scope: AccessKeyScope,\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 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 OpenIdDelegationProvider = IDL.Variant({\n GitHub: IDL.Null,\n Google: IDL.Null\n });\n const OpenIdAuthProviderDelegationConfig = IDL.Record({\n targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n max_time_to_live: IDL.Opt(IDL.Nat64)\n });\n const OpenIdAuthProviderConfig = IDL.Record({\n delegation: IDL.Opt(OpenIdAuthProviderDelegationConfig),\n client_id: IDL.Text\n });\n const AuthenticationConfigOpenId = IDL.Record({\n observatory_id: IDL.Opt(IDL.Principal),\n providers: IDL.Vec(IDL.Tuple(OpenIdDelegationProvider, OpenIdAuthProviderConfig))\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 openid: IDL.Opt(AuthenticationConfigOpenId),\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 OpenIdAutomationProvider = IDL.Variant({GitHub: IDL.Null});\n const OpenIdAutomationProviderControllerConfig = IDL.Record({\n scope: IDL.Opt(AutomationScope),\n max_time_to_live: IDL.Opt(IDL.Nat64)\n });\n const RepositoryKey = IDL.Record({owner: IDL.Text, name: IDL.Text});\n const OpenIdAutomationRepositoryConfig = IDL.Record({\n refs: IDL.Opt(IDL.Vec(IDL.Text))\n });\n const OpenIdAutomationProviderConfig = IDL.Record({\n controller: IDL.Opt(OpenIdAutomationProviderControllerConfig),\n repositories: IDL.Vec(IDL.Tuple(RepositoryKey, OpenIdAutomationRepositoryConfig))\n });\n const AutomationConfigOpenId = IDL.Record({\n observatory_id: IDL.Opt(IDL.Principal),\n providers: IDL.Vec(IDL.Tuple(OpenIdAutomationProvider, OpenIdAutomationProviderConfig))\n });\n const AutomationConfig = IDL.Record({\n updated_at: IDL.Opt(IDL.Nat64),\n openid: IDL.Opt(AutomationConfigOpenId),\n created_at: IDL.Opt(IDL.Nat64),\n version: IDL.Opt(IDL.Nat64)\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 automation: IDL.Opt(AutomationConfig)\n });\n const OpenIdGetDelegationArgs = IDL.Record({\n jwt: IDL.Text,\n session_key: IDL.Vec(IDL.Nat8),\n salt: IDL.Vec(IDL.Nat8),\n expiration: IDL.Nat64\n });\n const GetDelegationArgs = IDL.Variant({OpenId: OpenIdGetDelegationArgs});\n const Delegation = IDL.Record({\n pubkey: IDL.Vec(IDL.Nat8),\n targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n expiration: IDL.Nat64\n });\n const SignedDelegation = IDL.Record({\n signature: IDL.Vec(IDL.Nat8),\n delegation: Delegation\n });\n const GetDelegationError = IDL.Variant({\n JwtFindProvider: JwtFindProviderError,\n GetCachedJwks: IDL.Null,\n NoSuchDelegation: IDL.Null,\n JwtVerify: JwtVerifyError,\n GetOrFetchJwks: GetOrRefreshJwksError,\n DeriveSeedFailed: IDL.Text,\n InvalidObservatoryId: IDL.Text\n });\n const GetDelegationResultResponse = IDL.Variant({\n Ok: SignedDelegation,\n Err: GetDelegationError\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 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 openid: IDL.Opt(AuthenticationConfigOpenId),\n version: IDL.Opt(IDL.Nat64),\n internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n rules: IDL.Opt(AuthenticationRules)\n });\n const SetAutomationConfig = IDL.Record({\n openid: IDL.Opt(AutomationConfigOpenId),\n version: IDL.Opt(IDL.Nat64)\n });\n const SetAccessKey = IDL.Record({\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n scope: AccessKeyScope,\n expires_at: IDL.Opt(IDL.Nat64)\n });\n const SetControllersArgs = IDL.Record({\n controller: SetAccessKey,\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 SetStorageConfigOptions = IDL.Record({\n skip_certification: IDL.Opt(IDL.Bool)\n });\n const SetStorageConfigWithOptions = IDL.Record({\n config: SetStorageConfig,\n options: SetStorageConfigOptions\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\n return IDL.Service({\n authenticate: IDL.Func([AuthenticationArgs], [AuthenticateResultResponse], []),\n authenticate_automation: IDL.Func(\n [AuthenticateAutomationArgs],\n [AuthenticateAutomationResultResponse],\n []\n ),\n certify_assets_chunk: IDL.Func([CertifyAssetsArgs], [CertifyAssetsResult], []),\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_controller_self: IDL.Func([], [], []),\n del_controllers: IDL.Func(\n [DeleteControllersArgs],\n [IDL.Vec(IDL.Tuple(IDL.Principal, AccessKey))],\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_automation_config: IDL.Func([], [IDL.Opt(AutomationConfig)], ['query']),\n get_config: IDL.Func([], [Config], []),\n get_db_config: IDL.Func([], [IDL.Opt(DbConfig)], ['query']),\n get_delegation: IDL.Func([GetDelegationArgs], [GetDelegationResultResponse], ['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, AccessKey))], ['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_asset_token: IDL.Func([IDL.Text, IDL.Text, IDL.Opt(IDL.Text)], [], []),\n set_auth_config: IDL.Func([SetAuthenticationConfig], [AuthenticationConfig], []),\n set_automation_config: IDL.Func([SetAutomationConfig], [AutomationConfig], []),\n set_controllers: IDL.Func(\n [SetControllersArgs],\n [IDL.Vec(IDL.Tuple(IDL.Principal, AccessKey))],\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 set_storage_config_with_options: IDL.Func([SetStorageConfigWithOptions], [StorageConfig], []),\n submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),\n switch_storage_system_memory: IDL.Func([], [], []),\n upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),\n upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])\n });\n};\n\nexport const init = ({IDL}) => {\n const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});\n const InitStorageArgs = IDL.Record({system_memory: IDL.Opt(Memory)});\n const InitSatelliteArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal),\n storage: IDL.Opt(InitStorageArgs)\n });\n\n return [InitSatelliteArgs];\n};\n", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.1.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nexport const idlFactory = ({IDL}) => {\n const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});\n const InitStorageArgs = IDL.Record({system_memory: IDL.Opt(Memory)});\n const InitSatelliteArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal),\n storage: IDL.Opt(InitStorageArgs)\n });\n const OpenIdPrepareDelegationArgs = IDL.Record({\n jwt: IDL.Text,\n session_key: IDL.Vec(IDL.Nat8),\n salt: IDL.Vec(IDL.Nat8)\n });\n const AuthenticationArgs = IDL.Variant({\n OpenId: OpenIdPrepareDelegationArgs\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 PreparedDelegation = IDL.Record({\n user_key: IDL.Vec(IDL.Nat8),\n expiration: IDL.Nat64\n });\n const Authentication = IDL.Record({\n doc: Doc,\n delegation: PreparedDelegation\n });\n const JwtFindProviderError = IDL.Variant({\n BadClaim: IDL.Text,\n BadSig: IDL.Text,\n NoMatchingProvider: IDL.Null\n });\n const JwtVerifyError = IDL.Variant({\n WrongKeyType: IDL.Null,\n MissingKid: IDL.Null,\n BadClaim: IDL.Text,\n BadSig: IDL.Text,\n NoKeyForKid: IDL.Null\n });\n const GetOrRefreshJwksError = IDL.Variant({\n InvalidConfig: IDL.Text,\n MissingKid: IDL.Null,\n BadClaim: IDL.Text,\n KeyNotFoundCooldown: IDL.Null,\n CertificateNotFound: IDL.Null,\n BadSig: IDL.Text,\n MissingLastAttempt: IDL.Text,\n KeyNotFound: IDL.Null,\n FetchFailed: IDL.Text\n });\n const PrepareDelegationError = IDL.Variant({\n JwtFindProvider: JwtFindProviderError,\n GetCachedJwks: IDL.Null,\n JwtVerify: JwtVerifyError,\n GetOrFetchJwks: GetOrRefreshJwksError,\n DeriveSeedFailed: IDL.Text,\n InvalidObservatoryId: IDL.Text\n });\n const AuthenticationError = IDL.Variant({\n PrepareDelegation: PrepareDelegationError,\n RegisterUser: IDL.Text\n });\n const AuthenticateResultResponse = IDL.Variant({\n Ok: Authentication,\n Err: AuthenticationError\n });\n const OpenIdPrepareAutomationArgs = IDL.Record({\n jwt: IDL.Text,\n salt: IDL.Vec(IDL.Nat8)\n });\n const AuthenticateAutomationArgs = IDL.Variant({\n OpenId: OpenIdPrepareAutomationArgs\n });\n const AutomationScope = IDL.Variant({\n Write: IDL.Null,\n Submit: IDL.Null\n });\n const AutomationController = IDL.Record({\n scope: AutomationScope,\n expires_at: IDL.Nat64\n });\n const PrepareAutomationError = IDL.Variant({\n JwtFindProvider: JwtFindProviderError,\n InvalidController: IDL.Text,\n GetCachedJwks: IDL.Null,\n JwtVerify: JwtVerifyError,\n GetOrFetchJwks: GetOrRefreshJwksError,\n ControllerAlreadyExists: IDL.Null,\n InvalidObservatoryId: IDL.Text,\n TooManyControllers: IDL.Text\n });\n const AuthenticationAutomationError = IDL.Variant({\n PrepareAutomation: PrepareAutomationError,\n RegisterController: IDL.Text,\n SaveWorkflowMetadata: IDL.Text,\n SaveUniqueJtiToken: IDL.Text\n });\n const AuthenticateAutomationResultResponse = IDL.Variant({\n Ok: IDL.Tuple(IDL.Principal, AutomationController),\n Err: AuthenticationAutomationError\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 CertifyAssetsCursor = IDL.Variant({\n Heap: IDL.Record({offset: IDL.Nat64}),\n Stable: IDL.Record({key: IDL.Opt(AssetKey)})\n });\n const CertifyAssetsStrategy = IDL.Variant({\n Append: IDL.Null,\n Clear: IDL.Null,\n AppendWithRouting: IDL.Null\n });\n const CertifyAssetsArgs = IDL.Record({\n cursor: CertifyAssetsCursor,\n strategy: CertifyAssetsStrategy,\n chunk_size: IDL.Opt(IDL.Nat32)\n });\n const CertifyAssetsResult = IDL.Record({\n next_cursor: IDL.Opt(CertifyAssetsCursor)\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 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 AccessKeyKind = IDL.Variant({\n Emulator: IDL.Null,\n Automation: IDL.Null\n });\n const AccessKeyScope = IDL.Variant({\n Write: IDL.Null,\n Admin: IDL.Null,\n Submit: IDL.Null\n });\n const AccessKey = IDL.Record({\n updated_at: IDL.Nat64,\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n created_at: IDL.Nat64,\n scope: AccessKeyScope,\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 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 OpenIdDelegationProvider = IDL.Variant({\n GitHub: IDL.Null,\n Google: IDL.Null\n });\n const OpenIdAuthProviderDelegationConfig = IDL.Record({\n targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n max_time_to_live: IDL.Opt(IDL.Nat64)\n });\n const OpenIdAuthProviderConfig = IDL.Record({\n delegation: IDL.Opt(OpenIdAuthProviderDelegationConfig),\n client_id: IDL.Text\n });\n const AuthenticationConfigOpenId = IDL.Record({\n observatory_id: IDL.Opt(IDL.Principal),\n providers: IDL.Vec(IDL.Tuple(OpenIdDelegationProvider, OpenIdAuthProviderConfig))\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 openid: IDL.Opt(AuthenticationConfigOpenId),\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 OpenIdAutomationProvider = IDL.Variant({GitHub: IDL.Null});\n const OpenIdAutomationProviderControllerConfig = IDL.Record({\n scope: IDL.Opt(AutomationScope),\n max_time_to_live: IDL.Opt(IDL.Nat64)\n });\n const RepositoryKey = IDL.Record({owner: IDL.Text, name: IDL.Text});\n const OpenIdAutomationRepositoryConfig = IDL.Record({\n refs: IDL.Opt(IDL.Vec(IDL.Text))\n });\n const OpenIdAutomationProviderConfig = IDL.Record({\n controller: IDL.Opt(OpenIdAutomationProviderControllerConfig),\n repositories: IDL.Vec(IDL.Tuple(RepositoryKey, OpenIdAutomationRepositoryConfig))\n });\n const AutomationConfigOpenId = IDL.Record({\n observatory_id: IDL.Opt(IDL.Principal),\n providers: IDL.Vec(IDL.Tuple(OpenIdAutomationProvider, OpenIdAutomationProviderConfig))\n });\n const AutomationConfig = IDL.Record({\n updated_at: IDL.Opt(IDL.Nat64),\n openid: IDL.Opt(AutomationConfigOpenId),\n created_at: IDL.Opt(IDL.Nat64),\n version: IDL.Opt(IDL.Nat64)\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 automation: IDL.Opt(AutomationConfig)\n });\n const OpenIdGetDelegationArgs = IDL.Record({\n jwt: IDL.Text,\n session_key: IDL.Vec(IDL.Nat8),\n salt: IDL.Vec(IDL.Nat8),\n expiration: IDL.Nat64\n });\n const GetDelegationArgs = IDL.Variant({OpenId: OpenIdGetDelegationArgs});\n const Delegation = IDL.Record({\n pubkey: IDL.Vec(IDL.Nat8),\n targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n expiration: IDL.Nat64\n });\n const SignedDelegation = IDL.Record({\n signature: IDL.Vec(IDL.Nat8),\n delegation: Delegation\n });\n const GetDelegationError = IDL.Variant({\n JwtFindProvider: JwtFindProviderError,\n GetCachedJwks: IDL.Null,\n NoSuchDelegation: IDL.Null,\n JwtVerify: JwtVerifyError,\n GetOrFetchJwks: GetOrRefreshJwksError,\n DeriveSeedFailed: IDL.Text,\n InvalidObservatoryId: IDL.Text\n });\n const GetDelegationResultResponse = IDL.Variant({\n Ok: SignedDelegation,\n Err: GetDelegationError\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 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 openid: IDL.Opt(AuthenticationConfigOpenId),\n version: IDL.Opt(IDL.Nat64),\n internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n rules: IDL.Opt(AuthenticationRules)\n });\n const SetAutomationConfig = IDL.Record({\n openid: IDL.Opt(AutomationConfigOpenId),\n version: IDL.Opt(IDL.Nat64)\n });\n const SetAccessKey = IDL.Record({\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n scope: AccessKeyScope,\n expires_at: IDL.Opt(IDL.Nat64)\n });\n const SetControllersArgs = IDL.Record({\n controller: SetAccessKey,\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 SetStorageConfigOptions = IDL.Record({\n skip_certification: IDL.Opt(IDL.Bool)\n });\n const SetStorageConfigWithOptions = IDL.Record({\n config: SetStorageConfig,\n options: SetStorageConfigOptions\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\n return IDL.Service({\n authenticate: IDL.Func([AuthenticationArgs], [AuthenticateResultResponse], []),\n authenticate_automation: IDL.Func(\n [AuthenticateAutomationArgs],\n [AuthenticateAutomationResultResponse],\n []\n ),\n certify_assets_chunk: IDL.Func([CertifyAssetsArgs], [CertifyAssetsResult], []),\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_controller_self: IDL.Func([], [], []),\n del_controllers: IDL.Func(\n [DeleteControllersArgs],\n [IDL.Vec(IDL.Tuple(IDL.Principal, AccessKey))],\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_automation_config: IDL.Func([], [IDL.Opt(AutomationConfig)], []),\n get_config: IDL.Func([], [Config], []),\n get_db_config: IDL.Func([], [IDL.Opt(DbConfig)], []),\n get_delegation: IDL.Func([GetDelegationArgs], [GetDelegationResultResponse], []),\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, AccessKey))], []),\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_asset_token: IDL.Func([IDL.Text, IDL.Text, IDL.Opt(IDL.Text)], [], []),\n set_auth_config: IDL.Func([SetAuthenticationConfig], [AuthenticationConfig], []),\n set_automation_config: IDL.Func([SetAutomationConfig], [AutomationConfig], []),\n set_controllers: IDL.Func(\n [SetControllersArgs],\n [IDL.Vec(IDL.Tuple(IDL.Principal, AccessKey))],\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 set_storage_config_with_options: IDL.Func([SetStorageConfigWithOptions], [StorageConfig], []),\n submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),\n switch_storage_system_memory: IDL.Func([], [], []),\n upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),\n upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])\n });\n};\n\nexport const init = ({IDL}) => {\n const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});\n const InitStorageArgs = IDL.Record({system_memory: IDL.Opt(Memory)});\n const InitSatelliteArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal),\n storage: IDL.Opt(InitStorageArgs)\n });\n\n return [InitSatelliteArgs];\n};\n", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.1.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\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 OpenIdPrepareDelegationArgs = IDL.Record({\n jwt: IDL.Text,\n session_key: IDL.Vec(IDL.Nat8),\n salt: IDL.Vec(IDL.Nat8)\n });\n const AuthenticationArgs = IDL.Variant({\n OpenId: OpenIdPrepareDelegationArgs\n });\n const PreparedDelegation = IDL.Record({\n user_key: IDL.Vec(IDL.Nat8),\n expiration: IDL.Nat64\n });\n const OpenIdDelegationProvider = IDL.Variant({\n GitHub: IDL.Null,\n Google: IDL.Null\n });\n const OpenIdData = IDL.Record({\n name: IDL.Opt(IDL.Text),\n locale: IDL.Opt(IDL.Text),\n family_name: IDL.Opt(IDL.Text),\n email: IDL.Opt(IDL.Text),\n picture: IDL.Opt(IDL.Text),\n given_name: IDL.Opt(IDL.Text),\n preferred_username: IDL.Opt(IDL.Text)\n });\n const OpenId = IDL.Record({\n provider: OpenIdDelegationProvider,\n data: OpenIdData\n });\n const Provider = IDL.Variant({\n InternetIdentity: IDL.Null,\n OpenId: OpenId\n });\n const Account = IDL.Record({\n updated_at: IDL.Nat64,\n credits: Tokens,\n mission_control_id: IDL.Opt(IDL.Principal),\n provider: IDL.Opt(Provider),\n owner: IDL.Principal,\n created_at: IDL.Nat64\n });\n const Authentication = IDL.Record({\n delegation: PreparedDelegation,\n account: Account\n });\n const JwtFindProviderError = IDL.Variant({\n BadClaim: IDL.Text,\n BadSig: IDL.Text,\n NoMatchingProvider: IDL.Null\n });\n const JwtVerifyError = IDL.Variant({\n WrongKeyType: IDL.Null,\n MissingKid: IDL.Null,\n BadClaim: IDL.Text,\n BadSig: IDL.Text,\n NoKeyForKid: IDL.Null\n });\n const GetOrRefreshJwksError = IDL.Variant({\n InvalidConfig: IDL.Text,\n MissingKid: IDL.Null,\n BadClaim: IDL.Text,\n KeyNotFoundCooldown: IDL.Null,\n CertificateNotFound: IDL.Null,\n BadSig: IDL.Text,\n MissingLastAttempt: IDL.Text,\n KeyNotFound: IDL.Null,\n FetchFailed: IDL.Text\n });\n const PrepareDelegationError = IDL.Variant({\n JwtFindProvider: JwtFindProviderError,\n GetCachedJwks: IDL.Null,\n JwtVerify: JwtVerifyError,\n GetOrFetchJwks: GetOrRefreshJwksError,\n DeriveSeedFailed: IDL.Text,\n InvalidObservatoryId: IDL.Text\n });\n const AuthenticationError = IDL.Variant({\n PrepareDelegation: PrepareDelegationError,\n RegisterUser: IDL.Text\n });\n const Result = IDL.Variant({\n Ok: Authentication,\n Err: AuthenticationError\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 CreateMissionControlArgs = IDL.Record({\n subnet_id: IDL.Opt(IDL.Principal)\n });\n const CreateOrbiterArgs = IDL.Record({\n block_index: IDL.Opt(IDL.Nat64),\n subnet_id: IDL.Opt(IDL.Principal),\n name: IDL.Opt(IDL.Text),\n user: IDL.Principal\n });\n const InitStorageMemory = IDL.Variant({\n Heap: IDL.Null,\n Stable: IDL.Null\n });\n const InitStorageArgs = IDL.Record({\n system_memory: IDL.Opt(InitStorageMemory)\n });\n const CreateSatelliteArgs = IDL.Record({\n block_index: IDL.Opt(IDL.Nat64),\n subnet_id: IDL.Opt(IDL.Principal),\n storage: IDL.Opt(InitStorageArgs),\n name: IDL.Opt(IDL.Text),\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 OpenIdAuthProviderDelegationConfig = IDL.Record({\n targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n max_time_to_live: IDL.Opt(IDL.Nat64)\n });\n const OpenIdAuthProviderConfig = IDL.Record({\n delegation: IDL.Opt(OpenIdAuthProviderDelegationConfig),\n client_id: IDL.Text\n });\n const AuthenticationConfigOpenId = IDL.Record({\n observatory_id: IDL.Opt(IDL.Principal),\n providers: IDL.Vec(IDL.Tuple(OpenIdDelegationProvider, OpenIdAuthProviderConfig))\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 openid: IDL.Opt(AuthenticationConfigOpenId),\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 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({\n authentication: IDL.Opt(AuthenticationConfig),\n storage: StorageConfig\n });\n const GetCreateCanisterFeeArgs = IDL.Record({user: IDL.Principal});\n const OpenIdGetDelegationArgs = IDL.Record({\n jwt: IDL.Text,\n session_key: IDL.Vec(IDL.Nat8),\n salt: IDL.Vec(IDL.Nat8),\n expiration: IDL.Nat64\n });\n const GetDelegationArgs = IDL.Variant({OpenId: OpenIdGetDelegationArgs});\n const Delegation = IDL.Record({\n pubkey: IDL.Vec(IDL.Nat8),\n targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n expiration: IDL.Nat64\n });\n const SignedDelegation = IDL.Record({\n signature: IDL.Vec(IDL.Nat8),\n delegation: Delegation\n });\n const GetDelegationError = IDL.Variant({\n JwtFindProvider: JwtFindProviderError,\n GetCachedJwks: IDL.Null,\n NoSuchDelegation: IDL.Null,\n JwtVerify: JwtVerifyError,\n GetOrFetchJwks: GetOrRefreshJwksError,\n DeriveSeedFailed: IDL.Text,\n InvalidObservatoryId: IDL.Text\n });\n const Result_1 = IDL.Variant({\n Ok: SignedDelegation,\n Err: GetDelegationError\n });\n const SegmentKind = IDL.Variant({\n Orbiter: IDL.Null,\n MissionControl: IDL.Null,\n Satellite: IDL.Null\n });\n const CyclesTokens = IDL.Record({e12s: IDL.Nat64});\n const FactoryFee = IDL.Record({\n updated_at: IDL.Nat64,\n fee_cycles: CyclesTokens,\n fee_icp: IDL.Opt(Tokens)\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 RateConfig = IDL.Record({\n max_tokens: IDL.Nat64,\n time_per_token_ns: 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 AccessKeyKind = IDL.Variant({\n Emulator: IDL.Null,\n Automation: IDL.Null\n });\n const AccessKeyScope = IDL.Variant({\n Write: IDL.Null,\n Admin: IDL.Null,\n Submit: IDL.Null\n });\n const AccessKey = IDL.Record({\n updated_at: IDL.Nat64,\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n created_at: IDL.Nat64,\n scope: AccessKeyScope,\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 IcpPayment = 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 IcrcPaymentKey = IDL.Record({\n block_index: IDL.Nat64,\n ledger_id: IDL.Principal\n });\n const Account_1 = IDL.Record({\n owner: IDL.Principal,\n subaccount: IDL.Opt(IDL.Vec(IDL.Nat8))\n });\n const IcrcPayment = IDL.Record({\n status: PaymentStatus,\n updated_at: IDL.Nat64,\n created_at: IDL.Nat64,\n block_index_refunded: IDL.Opt(IDL.Nat64),\n purchaser: Account_1\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 StorableSegmentKind = IDL.Variant({\n Orbiter: IDL.Null,\n Satellite: IDL.Null\n });\n const ListSegmentsArgs = IDL.Record({\n segment_id: IDL.Opt(IDL.Principal),\n segment_kind: IDL.Opt(StorableSegmentKind)\n });\n const SegmentKey = IDL.Record({\n user: IDL.Principal,\n segment_id: IDL.Principal,\n segment_kind: StorableSegmentKind\n });\n const Segment = IDL.Record({\n updated_at: IDL.Nat64,\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n segment_id: IDL.Principal,\n created_at: IDL.Nat64\n });\n const SetAuthenticationConfig = IDL.Record({\n openid: IDL.Opt(AuthenticationConfigOpenId),\n version: IDL.Opt(IDL.Nat64),\n internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n rules: IDL.Opt(AuthenticationRules)\n });\n const SetAccessKey = IDL.Record({\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n scope: AccessKeyScope,\n expires_at: IDL.Opt(IDL.Nat64)\n });\n const SetControllersArgs = IDL.Record({\n controller: SetAccessKey,\n controllers: IDL.Vec(IDL.Principal)\n });\n const FeesArgs = IDL.Record({\n fee_cycles: CyclesTokens,\n fee_icp: IDL.Opt(Tokens)\n });\n const SetSegmentsArgs = IDL.Record({\n metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))),\n segment_id: IDL.Principal,\n segment_kind: StorableSegmentKind\n });\n const SetSegmentMetadataArgs = IDL.Record({\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n segment_id: IDL.Principal,\n segment_kind: StorableSegmentKind\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 UnsetSegmentsArgs = IDL.Record({\n segment_id: IDL.Principal,\n segment_kind: StorableSegmentKind\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\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 authenticate: IDL.Func([AuthenticationArgs], [Result], []),\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_mission_control: IDL.Func([CreateMissionControlArgs], [IDL.Principal], []),\n create_orbiter: IDL.Func([CreateOrbiterArgs], [IDL.Principal], []),\n create_satellite: IDL.Func([CreateSatelliteArgs], [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_account: IDL.Func([], [IDL.Opt(Account)], ['query']),\n get_auth_config: IDL.Func([], [IDL.Opt(AuthenticationConfig)], ['query']),\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_delegation: IDL.Func([GetDelegationArgs], [Result_1], ['query']),\n get_fee: IDL.Func([SegmentKind], [FactoryFee], ['query']),\n get_or_init_account: IDL.Func([], [Account], []),\n get_proposal: IDL.Func([IDL.Nat], [IDL.Opt(Proposal)], ['query']),\n get_rate_config: IDL.Func([SegmentKind], [RateConfig], ['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_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_accounts: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Account))], ['query']),\n list_assets: IDL.Func([IDL.Text, ListParams], [ListResults], ['query']),\n list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, AccessKey))], ['query']),\n list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], ['query']),\n list_icp_payments: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Nat64, IcpPayment))], ['query']),\n list_icrc_payments: IDL.Func([], [IDL.Vec(IDL.Tuple(IcrcPaymentKey, IcrcPayment))], ['query']),\n list_proposals: IDL.Func([ListProposalsParams], [ListProposalResults], ['query']),\n list_segments: IDL.Func(\n [ListSegmentsArgs],\n [IDL.Vec(IDL.Tuple(SegmentKey, Segment))],\n ['query']\n ),\n reject_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n set_auth_config: IDL.Func([SetAuthenticationConfig], [AuthenticationConfig], []),\n set_controllers: IDL.Func([SetControllersArgs], [], []),\n set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),\n set_fee: IDL.Func([SegmentKind, FeesArgs], [], []),\n set_many_segments: IDL.Func([IDL.Vec(SetSegmentsArgs)], [IDL.Vec(Segment)], []),\n set_rate_config: IDL.Func([SegmentKind, RateConfig], [], []),\n set_segment: IDL.Func([SetSegmentsArgs], [Segment], []),\n set_segment_metadata: IDL.Func([SetSegmentMetadataArgs], [Segment], []),\n set_storage_config: IDL.Func([SetStorageConfig], [StorageConfig], []),\n submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),\n unset_many_segments: IDL.Func([IDL.Vec(UnsetSegmentsArgs)], [], []),\n unset_segment: IDL.Func([UnsetSegmentsArgs], [], []),\n upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])\n });\n};\n\nexport const init = ({IDL}) => {\n return [];\n};\n", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.1.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\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 OpenIdPrepareDelegationArgs = IDL.Record({\n jwt: IDL.Text,\n session_key: IDL.Vec(IDL.Nat8),\n salt: IDL.Vec(IDL.Nat8)\n });\n const AuthenticationArgs = IDL.Variant({\n OpenId: OpenIdPrepareDelegationArgs\n });\n const PreparedDelegation = IDL.Record({\n user_key: IDL.Vec(IDL.Nat8),\n expiration: IDL.Nat64\n });\n const OpenIdDelegationProvider = IDL.Variant({\n GitHub: IDL.Null,\n Google: IDL.Null\n });\n const OpenIdData = IDL.Record({\n name: IDL.Opt(IDL.Text),\n locale: IDL.Opt(IDL.Text),\n family_name: IDL.Opt(IDL.Text),\n email: IDL.Opt(IDL.Text),\n picture: IDL.Opt(IDL.Text),\n given_name: IDL.Opt(IDL.Text),\n preferred_username: IDL.Opt(IDL.Text)\n });\n const OpenId = IDL.Record({\n provider: OpenIdDelegationProvider,\n data: OpenIdData\n });\n const Provider = IDL.Variant({\n InternetIdentity: IDL.Null,\n OpenId: OpenId\n });\n const Account = IDL.Record({\n updated_at: IDL.Nat64,\n credits: Tokens,\n mission_control_id: IDL.Opt(IDL.Principal),\n provider: IDL.Opt(Provider),\n owner: IDL.Principal,\n created_at: IDL.Nat64\n });\n const Authentication = IDL.Record({\n delegation: PreparedDelegation,\n account: Account\n });\n const JwtFindProviderError = IDL.Variant({\n BadClaim: IDL.Text,\n BadSig: IDL.Text,\n NoMatchingProvider: IDL.Null\n });\n const JwtVerifyError = IDL.Variant({\n WrongKeyType: IDL.Null,\n MissingKid: IDL.Null,\n BadClaim: IDL.Text,\n BadSig: IDL.Text,\n NoKeyForKid: IDL.Null\n });\n const GetOrRefreshJwksError = IDL.Variant({\n InvalidConfig: IDL.Text,\n MissingKid: IDL.Null,\n BadClaim: IDL.Text,\n KeyNotFoundCooldown: IDL.Null,\n CertificateNotFound: IDL.Null,\n BadSig: IDL.Text,\n MissingLastAttempt: IDL.Text,\n KeyNotFound: IDL.Null,\n FetchFailed: IDL.Text\n });\n const PrepareDelegationError = IDL.Variant({\n JwtFindProvider: JwtFindProviderError,\n GetCachedJwks: IDL.Null,\n JwtVerify: JwtVerifyError,\n GetOrFetchJwks: GetOrRefreshJwksError,\n DeriveSeedFailed: IDL.Text,\n InvalidObservatoryId: IDL.Text\n });\n const AuthenticationError = IDL.Variant({\n PrepareDelegation: PrepareDelegationError,\n RegisterUser: IDL.Text\n });\n const Result = IDL.Variant({\n Ok: Authentication,\n Err: AuthenticationError\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 CreateMissionControlArgs = IDL.Record({\n subnet_id: IDL.Opt(IDL.Principal)\n });\n const CreateOrbiterArgs = IDL.Record({\n block_index: IDL.Opt(IDL.Nat64),\n subnet_id: IDL.Opt(IDL.Principal),\n name: IDL.Opt(IDL.Text),\n user: IDL.Principal\n });\n const InitStorageMemory = IDL.Variant({\n Heap: IDL.Null,\n Stable: IDL.Null\n });\n const InitStorageArgs = IDL.Record({\n system_memory: IDL.Opt(InitStorageMemory)\n });\n const CreateSatelliteArgs = IDL.Record({\n block_index: IDL.Opt(IDL.Nat64),\n subnet_id: IDL.Opt(IDL.Principal),\n storage: IDL.Opt(InitStorageArgs),\n name: IDL.Opt(IDL.Text),\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 OpenIdAuthProviderDelegationConfig = IDL.Record({\n targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n max_time_to_live: IDL.Opt(IDL.Nat64)\n });\n const OpenIdAuthProviderConfig = IDL.Record({\n delegation: IDL.Opt(OpenIdAuthProviderDelegationConfig),\n client_id: IDL.Text\n });\n const AuthenticationConfigOpenId = IDL.Record({\n observatory_id: IDL.Opt(IDL.Principal),\n providers: IDL.Vec(IDL.Tuple(OpenIdDelegationProvider, OpenIdAuthProviderConfig))\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 openid: IDL.Opt(AuthenticationConfigOpenId),\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 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({\n authentication: IDL.Opt(AuthenticationConfig),\n storage: StorageConfig\n });\n const GetCreateCanisterFeeArgs = IDL.Record({user: IDL.Principal});\n const OpenIdGetDelegationArgs = IDL.Record({\n jwt: IDL.Text,\n session_key: IDL.Vec(IDL.Nat8),\n salt: IDL.Vec(IDL.Nat8),\n expiration: IDL.Nat64\n });\n const GetDelegationArgs = IDL.Variant({OpenId: OpenIdGetDelegationArgs});\n const Delegation = IDL.Record({\n pubkey: IDL.Vec(IDL.Nat8),\n targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n expiration: IDL.Nat64\n });\n const SignedDelegation = IDL.Record({\n signature: IDL.Vec(IDL.Nat8),\n delegation: Delegation\n });\n const GetDelegationError = IDL.Variant({\n JwtFindProvider: JwtFindProviderError,\n GetCachedJwks: IDL.Null,\n NoSuchDelegation: IDL.Null,\n JwtVerify: JwtVerifyError,\n GetOrFetchJwks: GetOrRefreshJwksError,\n DeriveSeedFailed: IDL.Text,\n InvalidObservatoryId: IDL.Text\n });\n const Result_1 = IDL.Variant({\n Ok: SignedDelegation,\n Err: GetDelegationError\n });\n const SegmentKind = IDL.Variant({\n Orbiter: IDL.Null,\n MissionControl: IDL.Null,\n Satellite: IDL.Null\n });\n const CyclesTokens = IDL.Record({e12s: IDL.Nat64});\n const FactoryFee = IDL.Record({\n updated_at: IDL.Nat64,\n fee_cycles: CyclesTokens,\n fee_icp: IDL.Opt(Tokens)\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 RateConfig = IDL.Record({\n max_tokens: IDL.Nat64,\n time_per_token_ns: 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 AccessKeyKind = IDL.Variant({\n Emulator: IDL.Null,\n Automation: IDL.Null\n });\n const AccessKeyScope = IDL.Variant({\n Write: IDL.Null,\n Admin: IDL.Null,\n Submit: IDL.Null\n });\n const AccessKey = IDL.Record({\n updated_at: IDL.Nat64,\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n created_at: IDL.Nat64,\n scope: AccessKeyScope,\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 IcpPayment = 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 IcrcPaymentKey = IDL.Record({\n block_index: IDL.Nat64,\n ledger_id: IDL.Principal\n });\n const Account_1 = IDL.Record({\n owner: IDL.Principal,\n subaccount: IDL.Opt(IDL.Vec(IDL.Nat8))\n });\n const IcrcPayment = IDL.Record({\n status: PaymentStatus,\n updated_at: IDL.Nat64,\n created_at: IDL.Nat64,\n block_index_refunded: IDL.Opt(IDL.Nat64),\n purchaser: Account_1\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 StorableSegmentKind = IDL.Variant({\n Orbiter: IDL.Null,\n Satellite: IDL.Null\n });\n const ListSegmentsArgs = IDL.Record({\n segment_id: IDL.Opt(IDL.Principal),\n segment_kind: IDL.Opt(StorableSegmentKind)\n });\n const SegmentKey = IDL.Record({\n user: IDL.Principal,\n segment_id: IDL.Principal,\n segment_kind: StorableSegmentKind\n });\n const Segment = IDL.Record({\n updated_at: IDL.Nat64,\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n segment_id: IDL.Principal,\n created_at: IDL.Nat64\n });\n const SetAuthenticationConfig = IDL.Record({\n openid: IDL.Opt(AuthenticationConfigOpenId),\n version: IDL.Opt(IDL.Nat64),\n internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n rules: IDL.Opt(AuthenticationRules)\n });\n const SetAccessKey = IDL.Record({\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n scope: AccessKeyScope,\n expires_at: IDL.Opt(IDL.Nat64)\n });\n const SetControllersArgs = IDL.Record({\n controller: SetAccessKey,\n controllers: IDL.Vec(IDL.Principal)\n });\n const FeesArgs = IDL.Record({\n fee_cycles: CyclesTokens,\n fee_icp: IDL.Opt(Tokens)\n });\n const SetSegmentsArgs = IDL.Record({\n metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))),\n segment_id: IDL.Principal,\n segment_kind: StorableSegmentKind\n });\n const SetSegmentMetadataArgs = IDL.Record({\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n segment_id: IDL.Principal,\n segment_kind: StorableSegmentKind\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 UnsetSegmentsArgs = IDL.Record({\n segment_id: IDL.Principal,\n segment_kind: StorableSegmentKind\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\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 authenticate: IDL.Func([AuthenticationArgs], [Result], []),\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_mission_control: IDL.Func([CreateMissionControlArgs], [IDL.Principal], []),\n create_orbiter: IDL.Func([CreateOrbiterArgs], [IDL.Principal], []),\n create_satellite: IDL.Func([CreateSatelliteArgs], [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_account: IDL.Func([], [IDL.Opt(Account)], []),\n get_auth_config: IDL.Func([], [IDL.Opt(AuthenticationConfig)], []),\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_delegation: IDL.Func([GetDelegationArgs], [Result_1], []),\n get_fee: IDL.Func([SegmentKind], [FactoryFee], []),\n get_or_init_account: IDL.Func([], [Account], []),\n get_proposal: IDL.Func([IDL.Nat], [IDL.Opt(Proposal)], []),\n get_rate_config: IDL.Func([SegmentKind], [RateConfig], []),\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_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_accounts: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Account))], []),\n list_assets: IDL.Func([IDL.Text, ListParams], [ListResults], []),\n list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, AccessKey))], []),\n list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], []),\n list_icp_payments: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Nat64, IcpPayment))], []),\n list_icrc_payments: IDL.Func([], [IDL.Vec(IDL.Tuple(IcrcPaymentKey, IcrcPayment))], []),\n list_proposals: IDL.Func([ListProposalsParams], [ListProposalResults], []),\n list_segments: IDL.Func([ListSegmentsArgs], [IDL.Vec(IDL.Tuple(SegmentKey, Segment))], []),\n reject_proposal: IDL.Func([CommitProposal], [IDL.Null], []),\n set_auth_config: IDL.Func([SetAuthenticationConfig], [AuthenticationConfig], []),\n set_controllers: IDL.Func([SetControllersArgs], [], []),\n set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),\n set_fee: IDL.Func([SegmentKind, FeesArgs], [], []),\n set_many_segments: IDL.Func([IDL.Vec(SetSegmentsArgs)], [IDL.Vec(Segment)], []),\n set_rate_config: IDL.Func([SegmentKind, RateConfig], [], []),\n set_segment: IDL.Func([SetSegmentsArgs], [Segment], []),\n set_segment_metadata: IDL.Func([SetSegmentMetadataArgs], [Segment], []),\n set_storage_config: IDL.Func([SetStorageConfig], [StorageConfig], []),\n submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),\n unset_many_segments: IDL.Func([IDL.Vec(UnsetSegmentsArgs)], [], []),\n unset_segment: IDL.Func([UnsetSegmentsArgs], [], []),\n upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])\n });\n};\n\nexport const init = ({IDL}) => {\n return [];\n};\n", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.1.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nexport const idlFactory = ({IDL}) => {\n const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});\n const InitStorageArgs = IDL.Record({system_memory: IDL.Opt(Memory)});\n const InitSatelliteArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal),\n storage: IDL.Opt(InitStorageArgs)\n });\n const OpenIdPrepareDelegationArgs = IDL.Record({\n jwt: IDL.Text,\n session_key: IDL.Vec(IDL.Nat8),\n salt: IDL.Vec(IDL.Nat8)\n });\n const AuthenticationArgs = IDL.Variant({\n OpenId: OpenIdPrepareDelegationArgs\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 PreparedDelegation = IDL.Record({\n user_key: IDL.Vec(IDL.Nat8),\n expiration: IDL.Nat64\n });\n const Authentication = IDL.Record({\n doc: Doc,\n delegation: PreparedDelegation\n });\n const JwtFindProviderError = IDL.Variant({\n BadClaim: IDL.Text,\n BadSig: IDL.Text,\n NoMatchingProvider: IDL.Null\n });\n const JwtVerifyError = IDL.Variant({\n WrongKeyType: IDL.Null,\n MissingKid: IDL.Null,\n BadClaim: IDL.Text,\n BadSig: IDL.Text,\n NoKeyForKid: IDL.Null\n });\n const GetOrRefreshJwksError = IDL.Variant({\n InvalidConfig: IDL.Text,\n MissingKid: IDL.Null,\n BadClaim: IDL.Text,\n KeyNotFoundCooldown: IDL.Null,\n CertificateNotFound: IDL.Null,\n BadSig: IDL.Text,\n MissingLastAttempt: IDL.Text,\n KeyNotFound: IDL.Null,\n FetchFailed: IDL.Text\n });\n const PrepareDelegationError = IDL.Variant({\n JwtFindProvider: JwtFindProviderError,\n GetCachedJwks: IDL.Null,\n JwtVerify: JwtVerifyError,\n GetOrFetchJwks: GetOrRefreshJwksError,\n DeriveSeedFailed: IDL.Text,\n InvalidObservatoryId: IDL.Text\n });\n const AuthenticationError = IDL.Variant({\n PrepareDelegation: PrepareDelegationError,\n RegisterUser: IDL.Text\n });\n const AuthenticateResultResponse = IDL.Variant({\n Ok: Authentication,\n Err: AuthenticationError\n });\n const OpenIdPrepareAutomationArgs = IDL.Record({\n jwt: IDL.Text,\n salt: IDL.Vec(IDL.Nat8)\n });\n const AuthenticateAutomationArgs = IDL.Variant({\n OpenId: OpenIdPrepareAutomationArgs\n });\n const AutomationScope = IDL.Variant({\n Write: IDL.Null,\n Submit: IDL.Null\n });\n const AutomationController = IDL.Record({\n scope: AutomationScope,\n expires_at: IDL.Nat64\n });\n const PrepareAutomationError = IDL.Variant({\n JwtFindProvider: JwtFindProviderError,\n InvalidController: IDL.Text,\n GetCachedJwks: IDL.Null,\n JwtVerify: JwtVerifyError,\n GetOrFetchJwks: GetOrRefreshJwksError,\n ControllerAlreadyExists: IDL.Null,\n InvalidObservatoryId: IDL.Text,\n TooManyControllers: IDL.Text\n });\n const AuthenticationAutomationError = IDL.Variant({\n PrepareAutomation: PrepareAutomationError,\n RegisterController: IDL.Text,\n SaveWorkflowMetadata: IDL.Text,\n SaveUniqueJtiToken: IDL.Text\n });\n const AuthenticateAutomationResultResponse = IDL.Variant({\n Ok: IDL.Tuple(IDL.Principal, AutomationController),\n Err: AuthenticationAutomationError\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 CertifyAssetsCursor = IDL.Variant({\n Heap: IDL.Record({offset: IDL.Nat64}),\n Stable: IDL.Record({key: IDL.Opt(AssetKey)})\n });\n const CertifyAssetsStrategy = IDL.Variant({\n Append: IDL.Null,\n Clear: IDL.Null,\n AppendWithRouting: IDL.Null\n });\n const CertifyAssetsArgs = IDL.Record({\n cursor: CertifyAssetsCursor,\n strategy: CertifyAssetsStrategy,\n chunk_size: IDL.Opt(IDL.Nat32)\n });\n const CertifyAssetsResult = IDL.Record({\n next_cursor: IDL.Opt(CertifyAssetsCursor)\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 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 AccessKeyKind = IDL.Variant({\n Emulator: IDL.Null,\n Automation: IDL.Null\n });\n const AccessKeyScope = IDL.Variant({\n Write: IDL.Null,\n Admin: IDL.Null,\n Submit: IDL.Null\n });\n const AccessKey = IDL.Record({\n updated_at: IDL.Nat64,\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n created_at: IDL.Nat64,\n scope: AccessKeyScope,\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 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 OpenIdDelegationProvider = IDL.Variant({\n GitHub: IDL.Null,\n Google: IDL.Null\n });\n const OpenIdAuthProviderDelegationConfig = IDL.Record({\n targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n max_time_to_live: IDL.Opt(IDL.Nat64)\n });\n const OpenIdAuthProviderConfig = IDL.Record({\n delegation: IDL.Opt(OpenIdAuthProviderDelegationConfig),\n client_id: IDL.Text\n });\n const AuthenticationConfigOpenId = IDL.Record({\n observatory_id: IDL.Opt(IDL.Principal),\n providers: IDL.Vec(IDL.Tuple(OpenIdDelegationProvider, OpenIdAuthProviderConfig))\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 openid: IDL.Opt(AuthenticationConfigOpenId),\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 OpenIdAutomationProvider = IDL.Variant({GitHub: IDL.Null});\n const OpenIdAutomationProviderControllerConfig = IDL.Record({\n scope: IDL.Opt(AutomationScope),\n max_time_to_live: IDL.Opt(IDL.Nat64)\n });\n const RepositoryKey = IDL.Record({owner: IDL.Text, name: IDL.Text});\n const OpenIdAutomationRepositoryConfig = IDL.Record({\n refs: IDL.Opt(IDL.Vec(IDL.Text))\n });\n const OpenIdAutomationProviderConfig = IDL.Record({\n controller: IDL.Opt(OpenIdAutomationProviderControllerConfig),\n repositories: IDL.Vec(IDL.Tuple(RepositoryKey, OpenIdAutomationRepositoryConfig))\n });\n const AutomationConfigOpenId = IDL.Record({\n observatory_id: IDL.Opt(IDL.Principal),\n providers: IDL.Vec(IDL.Tuple(OpenIdAutomationProvider, OpenIdAutomationProviderConfig))\n });\n const AutomationConfig = IDL.Record({\n updated_at: IDL.Opt(IDL.Nat64),\n openid: IDL.Opt(AutomationConfigOpenId),\n created_at: IDL.Opt(IDL.Nat64),\n version: IDL.Opt(IDL.Nat64)\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 automation: IDL.Opt(AutomationConfig)\n });\n const OpenIdGetDelegationArgs = IDL.Record({\n jwt: IDL.Text,\n session_key: IDL.Vec(IDL.Nat8),\n salt: IDL.Vec(IDL.Nat8),\n expiration: IDL.Nat64\n });\n const GetDelegationArgs = IDL.Variant({OpenId: OpenIdGetDelegationArgs});\n const Delegation = IDL.Record({\n pubkey: IDL.Vec(IDL.Nat8),\n targets: IDL.Opt(IDL.Vec(IDL.Principal)),\n expiration: IDL.Nat64\n });\n const SignedDelegation = IDL.Record({\n signature: IDL.Vec(IDL.Nat8),\n delegation: Delegation\n });\n const GetDelegationError = IDL.Variant({\n JwtFindProvider: JwtFindProviderError,\n GetCachedJwks: IDL.Null,\n NoSuchDelegation: IDL.Null,\n JwtVerify: JwtVerifyError,\n GetOrFetchJwks: GetOrRefreshJwksError,\n DeriveSeedFailed: IDL.Text,\n InvalidObservatoryId: IDL.Text\n });\n const GetDelegationResultResponse = IDL.Variant({\n Ok: SignedDelegation,\n Err: GetDelegationError\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 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 openid: IDL.Opt(AuthenticationConfigOpenId),\n version: IDL.Opt(IDL.Nat64),\n internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),\n rules: IDL.Opt(AuthenticationRules)\n });\n const SetAutomationConfig = IDL.Record({\n openid: IDL.Opt(AutomationConfigOpenId),\n version: IDL.Opt(IDL.Nat64)\n });\n const SetAccessKey = IDL.Record({\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n kind: IDL.Opt(AccessKeyKind),\n scope: AccessKeyScope,\n expires_at: IDL.Opt(IDL.Nat64)\n });\n const SetControllersArgs = IDL.Record({\n controller: SetAccessKey,\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 SetStorageConfigOptions = IDL.Record({\n skip_certification: IDL.Opt(IDL.Bool)\n });\n const SetStorageConfigWithOptions = IDL.Record({\n config: SetStorageConfig,\n options: SetStorageConfigOptions\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\n return IDL.Service({\n authenticate: IDL.Func([AuthenticationArgs], [AuthenticateResultResponse], []),\n authenticate_automation: IDL.Func(\n [AuthenticateAutomationArgs],\n [AuthenticateAutomationResultResponse],\n []\n ),\n certify_assets_chunk: IDL.Func([CertifyAssetsArgs], [CertifyAssetsResult], []),\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_controller_self: IDL.Func([], [], []),\n del_controllers: IDL.Func(\n [DeleteControllersArgs],\n [IDL.Vec(IDL.Tuple(IDL.Principal, AccessKey))],\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_automation_config: IDL.Func([], [IDL.Opt(AutomationConfig)], ['query']),\n get_config: IDL.Func([], [Config], []),\n get_db_config: IDL.Func([], [IDL.Opt(DbConfig)], ['query']),\n get_delegation: IDL.Func([GetDelegationArgs], [GetDelegationResultResponse], ['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, AccessKey))], ['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_asset_token: IDL.Func([IDL.Text, IDL.Text, IDL.Opt(IDL.Text)], [], []),\n set_auth_config: IDL.Func([SetAuthenticationConfig], [AuthenticationConfig], []),\n set_automation_config: IDL.Func([SetAutomationConfig], [AutomationConfig], []),\n set_controllers: IDL.Func(\n [SetControllersArgs],\n [IDL.Vec(IDL.Tuple(IDL.Principal, AccessKey))],\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 set_storage_config_with_options: IDL.Func([SetStorageConfigWithOptions], [StorageConfig], []),\n submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),\n switch_storage_system_memory: IDL.Func([], [], []),\n upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),\n upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])\n });\n};\n\nexport const init = ({IDL}) => {\n const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});\n const InitStorageArgs = IDL.Record({system_memory: IDL.Opt(Memory)});\n const InitSatelliteArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal),\n storage: IDL.Opt(InitStorageArgs)\n });\n\n return [InitSatelliteArgs];\n};\n", "import type {HttpAgent} from '@icp-sdk/core/agent';\nimport {nonNullish} from '@junobuild/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 '@icp-sdk/core/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 '@junobuild/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 {ActorMethod, ActorSubclass} from '@icp-sdk/core/agent';\nimport type {IDL} from '@icp-sdk/core/candid';\nimport {\n idlCertifiedFactorySatellite,\n idlFactorySatellite,\n type SatelliteActor\n} from '@junobuild/ic-client/actor';\nimport {assertNonNullish} from '@junobuild/utils';\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 {Principal} from '@icp-sdk/core/principal';\nimport type {SatelliteDid} from '@junobuild/ic-client/actor';\nimport {isNullish, toNullable} from '@junobuild/utils';\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", "export class SignInError extends Error {}\nexport class SignInInitError extends Error {}\nexport class SignInUserInterruptError extends Error {}\nexport class SignInProviderNotSupportedError extends Error {}\nexport class SignInMissingClientIdError 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 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 type {SatelliteDid} from '@junobuild/ic-client/actor';\nimport {fromArray, fromNullable, toArray, toNullable} 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 type {SatelliteDid} from '@junobuild/ic-client/actor';\nimport {fromNullable, isNullish, nonNullish} from '@junobuild/utils';\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 {DEFAULT_READ_OPTIONS} from '../../core/constants/call-options.constants';\nimport {getAnyIdentity} from '../../core/services/any-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 {isSatelliteError, JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE} from '@junobuild/errors';\nimport {isNullish, nonNullish} from '@junobuild/utils';\nimport {getDoc, setDoc} from '../../datastore/services/doc.services';\nimport {InitError} from '../types/errors';\nimport type {ProviderWithoutData} from '../types/provider';\nimport type {User, UserData, UserDataWithoutProviderData} from '../types/user';\nimport {getIdentity} from './identity.services';\n\ntype UserId = string;\n\nexport const initUser = async ({provider}: {provider: ProviderWithoutData}): 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} & UserDataWithoutProviderData): Promise<User> =>\n setDoc<UserData>({\n collection: `#user`,\n doc: {\n key: userId,\n data: rest\n }\n });\n", "import {AuthStore} from '../stores/auth.store';\nimport type {User} from '../types/user';\nimport {authenticateWithAuthClient, authenticateWithNewAuthClient} from './_auth-client.services';\nimport {loadUser} from './_user.services';\n\n/**\n * Initialize the authClient and load the existing user.\n * Executed when the library is initialized through initSatellite.\n *\n * @param {Object} params\n * @param {boolean} params.syncTabsOnSuccess - Broadcast the successful authentication to other tabs.\n */\nexport const loadAuth = async (\n {syncTabsOnSuccess}: {syncTabsOnSuccess: boolean} = {syncTabsOnSuccess: false}\n) => {\n const init = async () => {\n const {user} = await loadUser();\n AuthStore.getInstance().set(user ?? null);\n };\n\n await authenticateWithAuthClient({fn: init, syncTabsOnSuccess});\n};\n\n/**\n * Reloads the authentication state. Used when login success are being broadcasted.\n *\n * - Always creates a new `AuthClient` using {@link authenticateWithNewAuthClient}.\n * - If not authenticated, clears the current user from the {@link AuthStore}.\n * - If authenticated, reloads the user from storage and updates {@link AuthStore}.\n *\n * @returns {Promise<void>} Resolves when authentication and user state reloading is complete.\n */\nexport const reloadAuth = async () => {\n const init = async ({authenticated}: {authenticated: boolean}) => {\n const resetUser = (): Promise<{user: null}> => Promise.resolve({user: null});\n const fn = authenticated ? loadUser : resetUser;\n const {user} = await fn();\n\n AuthStore.getInstance().set(user ?? null);\n };\n\n await authenticateWithNewAuthClient({fn: init});\n};\n\n/**\n * Initialize the authClient, load the user passed as parameter.\n * Executed on sign-up.\n */\nexport const 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 authenticateWithAuthClient({fn: init, syncTabsOnSuccess: true});\n};\n", "import type {Unsubscribe} from '../../core/types/subscription';\nimport {AuthBroadcastChannel} from '../providers/_auth-broadcast.providers';\nimport {emit} from '../utils/events.utils';\nimport {reloadAuth} from './load.services';\n\nexport const initAuthBroadcastListener = (): Unsubscribe | undefined => {\n try {\n const bc = AuthBroadcastChannel.getInstance();\n\n const onLogin = async () => {\n await reloadAuth();\n emit({message: 'junoSignInReload'});\n };\n\n bc.onLoginSuccess(onLogin);\n\n return () => {\n bc?.destroy();\n };\n } catch (err: unknown) {\n // We don't really care if the broadcast channel fails to open or if it fails to set the message handler.\n // This is a non-critical feature that improves the UX when Juno is open in multiple tabs.\n // We just print a warning in the console for debugging purposes.\n console.warn('Auth BroadcastChannel initialization failed', err);\n return undefined;\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' && typeof process.env !== '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' && typeof process.env !== 'undefined'\n ? (process.env.NEXT_PUBLIC_CONTAINER ?? viteEnvContainer())\n : viteEnvContainer();\n};\n\nexport const envGoogleClientId = (): string | undefined => {\n const viteEnvGoogleClientId = (): 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_GOOGLE_CLIENT_ID ??\n (import.meta as unknown as ImportMeta).env?.PUBLIC_GOOGLE_CLIENT_ID)\n : undefined;\n\n return typeof process !== 'undefined' && typeof process.env !== 'undefined'\n ? (process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID ?? viteEnvGoogleClientId())\n : viteEnvGoogleClientId();\n};\n\nexport const envGitHubClientId = (): string | undefined => {\n const viteEnvGitHubClientId = (): 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_GITHUB_CLIENT_ID ??\n (import.meta as unknown as ImportMeta).env?.PUBLIC_GITHUB_CLIENT_ID)\n : undefined;\n\n return typeof process !== 'undefined' && typeof process.env !== 'undefined'\n ? (process.env.NEXT_PUBLIC_GITHUB_CLIENT_ID ?? viteEnvGitHubClientId())\n : viteEnvGitHubClientId();\n};\n\nexport const envApiUrl = (): string | undefined => {\n const viteEnvApiUrl = (): 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_JUNO_API_URL ??\n (import.meta as unknown as ImportMeta).env?.PUBLIC_JUNO_API_URL)\n : undefined;\n\n return typeof process !== 'undefined' && typeof process.env !== 'undefined'\n ? (process.env.NEXT_PUBLIC_JUNO_API_URL ?? viteEnvApiUrl())\n : viteEnvApiUrl();\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\ninterface PopupSize {\n width: number;\n height: number;\n}\n\nexport const II_DESIGN_V1_POPUP: PopupSize = {width: 576, height: 576};\nexport const II_DESIGN_V2_POPUP: PopupSize = {width: 424, height: 576};\n\nexport const INTERNET_COMPUTER_ORG = 'internetcomputer.org';\nexport const IC0_APP = 'ic0.app';\nexport const ID_AI = 'id.ai';\n\n// Worker\nexport const AUTH_TIMER_INTERVAL = 1000;\n", "import {isBrowser, isNullish} 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 {type AuthClient, ERROR_USER_INTERRUPT} from '@icp-sdk/auth/client';\nimport {isNullish} from '@junobuild/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 {ProviderWithoutData} from '../types/provider';\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 `@icp-sdk/auth/client`.\n *\n * @abstract\n * @class AuthClientProvider\n */\nexport abstract class AuthClientProvider {\n /**\n * The unique identifier of the provider.\n *\n * @abstract\n * @type {Provider}\n */\n abstract get id(): ProviderWithoutData;\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: ProviderWithoutData}) => 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", "import {isEmptyString, isNullish, nonNullish} from '@junobuild/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 {\n IC0_APP,\n ID_AI,\n II_DESIGN_V1_POPUP,\n II_DESIGN_V2_POPUP,\n INTERNET_COMPUTER_ORG\n} from '../constants/auth.constants';\nimport type {AuthClientSignInOptions} from '../types/auth-client';\nimport type {InternetIdentityConfig, InternetIdentityDomain} from '../types/internet-identity';\nimport type {ProviderWithoutData} 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 */\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(): ProviderWithoutData {\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 const identityV1Domain = [INTERNET_COMPUTER_ORG, IC0_APP].includes(this.#domain ?? ID_AI);\n\n if (isEmptyString(this.#domain)) {\n return `https://${ID_AI}`;\n }\n\n if (identityV1Domain) {\n return `https://identity.${this.#domain ?? INTERNET_COMPUTER_ORG}`;\n }\n\n return `https://${this.#domain}`;\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 const identityProvider = identityProviderUrl();\n\n const iiDesignV2 = (): boolean => {\n try {\n const {hostname} = new URL(identityProvider);\n return hostname.includes(ID_AI);\n } catch {\n return false;\n }\n };\n\n return {\n ...(windowed !== false && {\n windowOpenerFeatures: popupCenter(iiDesignV2() ? II_DESIGN_V2_POPUP : II_DESIGN_V1_POPUP)\n }),\n identityProvider\n };\n }\n}\n", "import type {Ed25519KeyIdentity} from '@icp-sdk/core/identity';\nimport {arrayBufferToUint8Array} from '@junobuild/utils';\nimport type {Nonce, Salt} from '../types/nonce';\nimport {toBase64URL} from './url.utils';\n\nconst generateSalt = (): Salt => crypto.getRandomValues(new Uint8Array(32));\n\nconst buildNonce = async ({salt, caller}: {salt: Salt; caller: Ed25519KeyIdentity}) => {\n const principal = caller.getPrincipal().toUint8Array();\n\n const bytes = new Uint8Array(salt.length + principal.byteLength);\n bytes.set(salt);\n bytes.set(principal, salt.length);\n\n const hash = await crypto.subtle.digest('SHA-256', bytes);\n\n return toBase64URL(arrayBufferToUint8Array(hash));\n};\n\nexport const generateNonce = async ({\n caller\n}: {\n caller: Ed25519KeyIdentity;\n}): Promise<{nonce: Nonce; salt: Salt}> => {\n const salt = generateSalt();\n const nonce = await buildNonce({salt, caller});\n\n return {nonce, salt};\n};\n", "import {uint8ArrayToBase64} from '@junobuild/utils';\n\n// In the future: uint8Array.toBase64({ alphabet: \"base64url\" })\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/toBase64\nexport const toBase64URL = (uint8Array: Uint8Array): string =>\n uint8ArrayToBase64(uint8Array).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n", "import type {OpenIdGitHubProvider} from './providers/github/types/provider';\nimport type {OpenIdProvider} from './types/provider';\n\nexport const CONTEXT_KEY = 'juno:auth:openid';\n\n// Create client_id: https://developers.google.com/identity/openid-connect/openid-connect#authenticationuriparameters\nexport const GOOGLE_PROVIDER: Omit<OpenIdProvider, 'clientId' | 'redirectUrl'> = {\n authUrl: 'https://accounts.google.com/o/oauth2/v2/auth',\n authScopes: ['openid', 'profile', 'email'],\n configUrl: 'https://accounts.google.com/gsi/fedcm.json'\n};\n\nexport const GITHUB_PROVIDER: Omit<OpenIdGitHubProvider, 'clientId' | 'redirectUrl'> = {\n authUrl: 'https://github.com/login/oauth/authorize',\n authScopes: ['read:user', 'user:email'],\n initUrl: 'https://api.juno.build/v1/auth/init/github',\n finalizeUrl: 'https://api.juno.build/v1/auth/finalize/github'\n};\n", "import {Ed25519KeyIdentity} from '@icp-sdk/core/identity';\nimport {isNullish} from '@junobuild/utils';\nimport type {Nonce} from '../types/nonce';\nimport {generateNonce} from '../utils/nonce.utils';\nimport {CONTEXT_KEY} from './_constants';\nimport {ContextUndefinedError} from './errors';\nimport type {OpenIdAuthContext} from './types/context';\nimport {parseContext, stringifyContext} from './utils/session-storage.utils';\n\nexport const initContext = async ({\n generateState\n}: {\n generateState: (params: {nonce: Nonce}) => Promise<string>;\n}): Promise<{nonce: Nonce} & Pick<OpenIdAuthContext, 'state'>> => {\n const caller = Ed25519KeyIdentity.generate();\n const {nonce, salt} = await generateNonce({caller});\n\n const state = await generateState({nonce});\n\n const storedData = stringifyContext({\n caller,\n salt,\n state\n });\n\n sessionStorage.setItem(CONTEXT_KEY, storedData);\n\n return {\n nonce,\n state\n };\n};\n\nexport const loadContext = (): OpenIdAuthContext => {\n const storedContext = sessionStorage.getItem(CONTEXT_KEY);\n\n if (isNullish(storedContext)) {\n throw new ContextUndefinedError();\n }\n\n return parseContext(storedContext);\n};\n", "export class InvalidUrlError extends Error {}\nexport class ContextUndefinedError extends Error {}\n\nexport class FedCMIdentityCredentialUndefinedError extends Error {}\nexport class FedCMIdentityCredentialInvalidError extends Error {}\n\nexport class AuthenticationError extends Error {}\nexport class AuthenticationUrlHashError extends Error {}\nexport class AuthenticationInvalidStateError extends Error {}\nexport class AuthenticationUndefinedJwtError extends Error {}\n\nexport class GetDelegationError extends Error {}\nexport class GetDelegationRetryError extends Error {}\n\nexport class ApiGitHubInitError extends Error {\n constructor(options?: ErrorOptions) {\n super('GitHub OAuth initialization failed', options);\n }\n}\n\nexport class ApiGitHubFinalizeError extends Error {\n constructor(options?: ErrorOptions) {\n super('GitHub OAuth finalization failed', options);\n }\n}\n", "import {Ed25519KeyIdentity, type JsonnableEd25519KeyIdentity} from '@icp-sdk/core/identity';\nimport {base64ToUint8Array, uint8ArrayToBase64} from '@junobuild/utils';\nimport type {OpenIdAuthContext} from '../types/context';\n\nconst JSON_KEY_CALLER = '__caller__';\nconst JSON_KEY_SALT = '__salt__';\nconst JSON_KEY_STATE = '__state__';\n\ninterface StoredContext {\n [JSON_KEY_CALLER]: JsonnableEd25519KeyIdentity;\n [JSON_KEY_SALT]: string;\n [JSON_KEY_STATE]: string;\n}\n\nexport const stringifyContext = ({caller, state, salt}: OpenIdAuthContext): string => {\n const data: StoredContext = {\n [JSON_KEY_CALLER]: caller.toJSON(),\n [JSON_KEY_SALT]: uint8ArrayToBase64(salt),\n [JSON_KEY_STATE]: state\n };\n\n return JSON.stringify(data);\n};\n\nexport const parseContext = (jsonData: string): OpenIdAuthContext => {\n const {\n [JSON_KEY_CALLER]: jsonCaller,\n [JSON_KEY_SALT]: jsonSalt,\n [JSON_KEY_STATE]: state\n }: StoredContext = JSON.parse(jsonData);\n\n return {\n caller: Ed25519KeyIdentity.fromParsedJson(jsonCaller),\n salt: base64ToUint8Array(jsonSalt),\n state\n };\n};\n", "import type {Signature} from '@icp-sdk/core/agent';\nimport {Delegation, ECDSAKeyIdentity} from '@icp-sdk/core/identity';\nimport {fromNullable} from '@junobuild/utils';\nimport {authenticate as authenticateApi, getDelegation as getDelegationApi} from './api/auth.api';\nimport {AuthenticationError, GetDelegationError, GetDelegationRetryError} from './errors';\nimport type {AuthenticationData, GetDelegationArgs, SignedDelegation} from './types/actor';\nimport type {AuthenticatedSession, AuthParameters} from './types/authenticate';\nimport type {OpenIdAuthContext} from './types/context';\nimport type {Delegations} from './types/session';\nimport {generateIdentity} from './utils/session.utils';\n\ninterface AuthContext {\n context: Omit<OpenIdAuthContext, 'state'>;\n auth: AuthParameters;\n}\ntype AuthenticationArgs = {jwt: string} & AuthContext;\n\nexport const authenticateSession = async <T extends AuthParameters>({\n jwt,\n context,\n auth\n}: AuthenticationArgs): Promise<AuthenticatedSession<T>> => {\n const sessionKey = await ECDSAKeyIdentity.generate({extractable: false});\n\n const publicKey = new Uint8Array(sessionKey.getPublicKey().toDer());\n\n const {delegations, data} = await authenticate<T>({\n jwt,\n publicKey,\n context,\n auth\n });\n\n const identity = generateIdentity({\n sessionKey,\n delegations\n });\n\n return {identity, data};\n};\n\nconst authenticate = async <T extends AuthParameters>({\n jwt,\n publicKey,\n context: {caller, salt},\n auth\n}: {\n publicKey: Uint8Array;\n} & AuthenticationArgs): Promise<{delegations: Delegations; data: AuthenticationData<T>}> => {\n const result = await authenticateApi({\n args: {\n OpenId: {\n jwt,\n session_key: publicKey,\n salt\n }\n },\n actorParams: {\n auth,\n identity: caller\n }\n });\n\n if ('Err' in result) {\n throw new AuthenticationError('Authentication failed', {cause: result});\n }\n\n const {\n delegation: {user_key: userKey, expiration},\n ...rest\n } = result.Ok;\n\n const signedDelegation = await retryGetDelegation({\n jwt,\n context: {caller, salt},\n auth,\n publicKey,\n expiration\n });\n\n const {delegation, signature} = signedDelegation;\n const {pubkey, expiration: signedExpiration, targets} = delegation;\n\n const delegations: Delegations = [\n userKey,\n [\n {\n delegation: new Delegation(\n Uint8Array.from(pubkey),\n signedExpiration,\n fromNullable(targets)\n ),\n signature: Uint8Array.from(signature) as unknown as Signature\n }\n ]\n ];\n\n return {delegations, data: rest as AuthenticationData<T>};\n};\n\nconst retryGetDelegation = async ({\n jwt,\n publicKey,\n context: {salt, caller},\n auth,\n expiration,\n maxRetries = 5\n}: {\n publicKey: Uint8Array;\n expiration: bigint;\n maxRetries?: number;\n} & AuthenticationArgs): Promise<SignedDelegation> => {\n for (let i = 0; i < maxRetries; i++) {\n // Linear backoff\n await new Promise((resolve) => {\n setInterval(resolve, 1000 * i);\n });\n\n const args: GetDelegationArgs = {\n OpenId: {\n jwt,\n session_key: publicKey,\n salt,\n expiration\n }\n };\n\n const result = await getDelegationApi({\n args,\n actorParams: {\n auth,\n identity: caller\n }\n });\n\n if ('Err' in result) {\n const {Err} = result;\n\n if ('NoSuchDelegation' in Err) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if ('GetCachedJwks' in Err) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n throw new GetDelegationError('Getting delegation failed', {cause: result});\n }\n\n return result.Ok;\n }\n\n throw new GetDelegationRetryError();\n};\n", "import {\n type ConsoleActor,\n type SatelliteActor,\n getConsoleActor,\n getSatelliteActor\n} from '@junobuild/ic-client/actor';\nimport type {ActorParameters} from '../types/actor';\n\nexport const getAuthActor = ({\n auth,\n identity\n}: ActorParameters): Promise<ConsoleActor | SatelliteActor> =>\n 'satellite' in auth\n ? getSatelliteActor({...auth.satellite, identity})\n : getConsoleActor({...auth.console, identity});\n", "import type {\n ActorParameters,\n AuthenticationArgs,\n AuthenticationResult,\n GetDelegationArgs,\n GetDelegationResult\n} from '../types/actor';\nimport {getAuthActor} from './_actor.api';\n\nexport const authenticate = async ({\n actorParams,\n args\n}: {\n args: AuthenticationArgs;\n actorParams: ActorParameters;\n}): Promise<AuthenticationResult> => {\n const {authenticate} = await getAuthActor(actorParams);\n return await authenticate(args);\n};\n\nexport const getDelegation = async ({\n actorParams,\n args\n}: {\n args: GetDelegationArgs;\n actorParams: ActorParameters;\n}): Promise<GetDelegationResult> => {\n const {get_delegation} = await getAuthActor(actorParams);\n return await get_delegation(args);\n};\n", "import {DelegationChain, DelegationIdentity, type ECDSAKeyIdentity} from '@icp-sdk/core/identity';\nimport type {AuthenticatedIdentity} from '../types/authenticate';\nimport type {Delegations} from '../types/session';\n\nexport const generateIdentity = ({\n delegations,\n sessionKey\n}: {\n delegations: Delegations;\n sessionKey: ECDSAKeyIdentity;\n}): AuthenticatedIdentity => {\n const [userKey, signedDelegations] = delegations;\n\n const delegationChain = DelegationChain.fromDelegations(\n signedDelegations,\n Uint8Array.from(userKey)\n );\n\n const identity = DelegationIdentity.fromDelegation(sessionKey, delegationChain);\n\n return {identity, delegationChain, sessionKey};\n};\n", "import {isEmptyString} from '@junobuild/utils';\nimport {authenticateSession} from '../../_session';\nimport {AuthenticationUndefinedJwtError} from '../../errors';\nimport type {AuthenticatedSession, AuthParameters} from '../../types/authenticate';\nimport type {OpenIdAuthContext} from '../../types/context';\nimport {finalizeOAuth} from './_api';\nimport type {AuthenticationGitHubRedirect} from './types/authenticate';\n\nexport const authenticateGitHubWithRedirect = async <T extends AuthParameters>({\n auth,\n context,\n redirect: {finalizeUrl}\n}: {\n auth: AuthParameters;\n context: Omit<OpenIdAuthContext, 'state'>;\n redirect: AuthenticationGitHubRedirect;\n}): Promise<AuthenticatedSession<T>> => {\n const {\n location: {search}\n } = window;\n\n const urlParams = new URLSearchParams(search);\n const code = urlParams.get('code');\n const state = urlParams.get('state');\n\n const result = await finalizeOAuth({\n url: finalizeUrl,\n body: {code, state}\n });\n\n if ('error' in result) {\n throw result.error;\n }\n\n const {\n success: {token: idToken}\n } = result;\n\n // id_token === jwt\n if (isEmptyString(idToken)) {\n throw new AuthenticationUndefinedJwtError();\n }\n\n return await authenticateSession({\n jwt: idToken,\n auth,\n context\n });\n};\n", "import {ApiGitHubFinalizeError, ApiGitHubInitError} from '../../errors';\n\nexport const initOAuth = async ({\n url\n}: {\n url: string;\n}): Promise<{success: {state: string}} | {error: unknown}> => {\n try {\n const result = await fetch(url, {\n credentials: 'include'\n });\n\n if (!result.ok) {\n return {error: new Error(`Failed to fetch ${url} (${result.status})`)};\n }\n\n const data: {state: string} = await result.json();\n return {success: data};\n } catch (error: unknown) {\n return {error: new ApiGitHubInitError({cause: error})};\n }\n};\n\nexport const finalizeOAuth = async ({\n url,\n body\n}: {\n url: string;\n body: {code: string | null; state: string | null};\n}): Promise<{success: {token: string}} | {error: unknown}> => {\n try {\n const result = await fetch(url, {\n method: 'POST',\n credentials: 'include',\n headers: {'Content-Type': 'application/json'},\n body: JSON.stringify(body)\n });\n\n if (!result.ok) {\n return {error: new Error(`Failed to fetch ${url} (${result.status})`)};\n }\n\n const data: {token: string} = await result.json();\n return {success: data};\n } catch (error: unknown) {\n return {error: new ApiGitHubFinalizeError({cause: error})};\n }\n};\n", "import {isEmptyString} from '@junobuild/utils';\nimport {authenticateSession} from '../../_session';\nimport {\n AuthenticationInvalidStateError,\n AuthenticationUndefinedJwtError,\n AuthenticationUrlHashError\n} from '../../errors';\nimport type {AuthenticatedSession, AuthParameters} from '../../types/authenticate';\nimport type {OpenIdAuthContext} from '../../types/context';\n\nexport const authenticateGoogleWithRedirect = async <T extends AuthParameters>({\n auth,\n context\n}: {\n auth: AuthParameters;\n context: OpenIdAuthContext;\n}): Promise<AuthenticatedSession<T>> => {\n const {\n location: {hash}\n } = window;\n\n if (isEmptyString(hash) || !hash.startsWith('#')) {\n throw new AuthenticationUrlHashError('No hash found in the current location URL');\n }\n\n const params = new URLSearchParams(hash.slice(1));\n const state = params.get('state');\n const idToken = params.get('id_token');\n\n const {state: savedState} = context;\n\n if (isEmptyString(savedState) || state !== savedState) {\n throw new AuthenticationInvalidStateError('The provided state is invalid', {cause: state});\n }\n\n // id_token === jwt\n if (isEmptyString(idToken)) {\n throw new AuthenticationUndefinedJwtError();\n }\n\n return await authenticateSession({\n jwt: idToken,\n auth,\n context\n });\n};\n", "import {GITHUB_PROVIDER} from './_constants';\nimport {loadContext} from './_context';\nimport {authenticateSession} from './_session';\nimport {authenticateGitHubWithRedirect} from './providers/github/authenticate';\nimport {authenticateGoogleWithRedirect} from './providers/google/authenticate';\nimport type {\n AuthenticatedSession,\n AuthenticationParams,\n AuthParameters\n} from './types/authenticate';\n\nexport const authenticate = async <T extends AuthParameters>(\n params: AuthenticationParams<T>\n): Promise<AuthenticatedSession<T>> => {\n const context = loadContext();\n\n if ('github' in params) {\n const {\n github: {redirect, auth}\n } = params;\n\n const {finalizeUrl} = GITHUB_PROVIDER;\n\n return await authenticateGitHubWithRedirect<T>({\n redirect: redirect ?? {finalizeUrl},\n auth,\n context\n });\n }\n\n const {google} = params;\n\n if ('credentials' in google) {\n const {\n credentials: {jwt},\n auth\n } = google;\n\n return await authenticateSession({\n jwt,\n context,\n auth\n });\n }\n\n return await authenticateGoogleWithRedirect<T>({...google, context});\n};\n", "import {InvalidUrlError} from '../errors';\n\nexport const parseUrl = ({url}: {url: string}): URL => {\n try {\n // Use the URL constructor, for backwards compatibility with older Android/WebView.\n return new URL(url);\n } catch (_error: unknown) {\n throw new InvalidUrlError('Cannot parse authURL', {cause: url});\n }\n};\n", "import type {Nonce} from '../../../types/nonce';\nimport {parseUrl} from '../../utils/url.utils';\nimport {initOAuth} from './_api';\nimport type {OpenIdGitHubProvider} from './types/provider';\n\nexport const buildGenerateState = ({initUrl}: Pick<OpenIdGitHubProvider, 'initUrl'>) => {\n const generateState = async ({nonce}: {nonce: Nonce}): Promise<string> => {\n const requestUrl = parseUrl({url: initUrl});\n requestUrl.searchParams.set('nonce', nonce);\n\n const result = await initOAuth({url: requestUrl.toString()});\n\n if ('error' in result) {\n throw result.error;\n }\n\n const {\n success: {state}\n } = result;\n\n return state;\n };\n\n return generateState;\n};\n", "import {parseUrl} from '../../utils/url.utils';\nimport type {RequestGitHubJwtWithRedirect} from './types/openid';\n\n// https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps#1-request-a-users-github-identity\n\nexport const requestGitHubJwtWithRedirect = ({\n authUrl,\n clientId,\n authScopes,\n state,\n redirectUrl\n}: RequestGitHubJwtWithRedirect) => {\n const requestUrl = parseUrl({url: authUrl});\n\n requestUrl.searchParams.set('client_id', clientId);\n\n const {\n location: {origin: currentUrl}\n } = window;\n\n requestUrl.searchParams.set('redirect_uri', redirectUrl ?? currentUrl);\n\n // Note: GitHub Apps ignore this parameter and use permissions from app settings instead\n requestUrl.searchParams.set('scope', authScopes.join(' '));\n\n // Used for security reasons. When the provider redirects to the application,\n // the state will be compared by the proxy backend with the value it initiated.\n requestUrl.searchParams.set('state', state);\n\n window.location.href = requestUrl.toString();\n};\n", "import {toBase64URL} from '../../utils/url.utils';\n\nexport const generateRandomState = (): string =>\n toBase64URL(crypto.getRandomValues(new Uint8Array(12)));\n", "import type {Nonce} from '../../../types/nonce';\nimport {generateRandomState} from '../../utils/state.utils';\n\n// eslint-disable-next-line require-await\nexport const generateGoogleState = async (_params: {nonce: Nonce}): Promise<string> =>\n generateRandomState();\n", "import {isNullish, notEmptyString} from '@junobuild/utils';\nimport {\n FedCMIdentityCredentialInvalidError,\n FedCMIdentityCredentialUndefinedError\n} from '../../errors';\nimport {parseUrl} from '../../utils/url.utils';\nimport type {RequestGoogleJwtWithCredentials, RequestGoogleJwtWithRedirect} from './types/openid';\n\n/**\n * Initiates an OpenID Connect authorization request by redirecting the browser.\n *\n * References:\n * - OAuth 2.0 (Google): https://developers.google.com/identity/protocols/oauth2/javascript-implicit-flow\n * - OpenID Connect: https://developers.google.com/identity/openid-connect/openid-connect\n */\nexport const requestGoogleJwtWithRedirect = ({\n authUrl,\n clientId,\n nonce,\n loginHint,\n authScopes,\n state,\n redirectUrl\n}: RequestGoogleJwtWithRedirect) => {\n const requestUrl = parseUrl({url: authUrl});\n\n requestUrl.searchParams.set('client_id', clientId);\n\n const {\n location: {origin: currentUrl}\n } = window;\n\n requestUrl.searchParams.set('redirect_uri', redirectUrl ?? currentUrl);\n\n // We do not request \"token\" because we use the ID token (JWT).\n // \"code\" is required according to II's codebase as Apple ID throws an error otherwise.\n requestUrl.searchParams.set('response_type', 'code id_token');\n\n requestUrl.searchParams.set('scope', authScopes.join(' '));\n\n // Used for security reasons. When the provider redirects to the application,\n // the state will be compared with the session storage value.\n requestUrl.searchParams.set('state', state);\n\n // Used to validate the JSON Web Token (JWT) in the backend \u2014 i.e. we pass the nonce\n // to the provider and make the request to the backend with its salt.\n requestUrl.searchParams.set('nonce', nonce);\n\n if (notEmptyString(loginHint)) {\n requestUrl.searchParams.set('login_hint', loginHint);\n } else {\n requestUrl.searchParams.set('prompt', 'select_account');\n }\n\n window.location.href = requestUrl.toString();\n};\n\n/**\n * References:\n * - identity spec: https://www.w3.org/TR/fedcm/#browser-api-credential-request-options\n * - https://privacysandbox.google.com/cookies/fedcm/implement/identity-provider\n * - https://privacysandbox.google.com/cookies/fedcm/why\n */\nexport const requestGoogleJwtWithCredentials = async ({\n configUrl: configURL,\n clientId,\n nonce,\n loginHint,\n domainHint\n}: RequestGoogleJwtWithCredentials): Promise<{jwt: string}> => {\n const identityCredential = await navigator.credentials.get({\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n identity: {\n context: 'use',\n providers: [\n {\n configURL,\n clientId,\n nonce,\n loginHint,\n domainHint\n }\n ],\n mode: 'active'\n },\n // https://privacysandbox.google.com/cookies/fedcm/implement/relying-party#auto-reauthn\n mediation: 'required'\n });\n\n if (isNullish(identityCredential)) {\n throw new FedCMIdentityCredentialUndefinedError();\n }\n\n const {type} = identityCredential;\n\n if (\n type !== 'identity' ||\n !('token' in identityCredential) ||\n typeof identityCredential.token !== 'string'\n ) {\n // This should be unreachable in FedCM spec-compliant browsers.\n throw new FedCMIdentityCredentialInvalidError('Invalid credential received from FedCM API', {\n cause: identityCredential\n });\n }\n\n const {token: jwt} = identityCredential;\n return {jwt};\n};\n", "import {GITHUB_PROVIDER, GOOGLE_PROVIDER} from './_constants';\nimport {initContext} from './_context';\nimport {buildGenerateState} from './providers/github/_context';\nimport {requestGitHubJwtWithRedirect} from './providers/github/_openid';\nimport type {RequestGitHubJwtRedirectParams} from './providers/github/types/request';\nimport {generateGoogleState} from './providers/google/_context';\nimport {\n requestGoogleJwtWithCredentials,\n requestGoogleJwtWithRedirect\n} from './providers/google/_openid';\nimport type {\n RequestGoogleJwtCredentialsParams,\n RequestGoogleJwtParams,\n RequestGoogleJwtRedirectParams\n} from './providers/google/types/request';\nimport type {RequestJwtCredentialsResult} from './types/request';\n\nexport function requestJwt(args: {\n google: RequestGoogleJwtCredentialsParams;\n}): Promise<RequestJwtCredentialsResult>;\n\nexport function requestJwt(\n args: {google: RequestGoogleJwtRedirectParams} | {github: RequestGitHubJwtRedirectParams}\n): Promise<void>;\n\nexport async function requestJwt(\n args:\n | {\n google: RequestGoogleJwtParams;\n }\n | {github: RequestGitHubJwtRedirectParams}\n): Promise<RequestJwtCredentialsResult | void> {\n if ('github' in args) {\n const {github} = args;\n\n const {redirect} = github;\n const {initUrl: userInitUrl, ...restRedirect} = redirect;\n\n const {authUrl, authScopes, initUrl} = GITHUB_PROVIDER;\n\n const context = await initContext({\n generateState: buildGenerateState({initUrl: userInitUrl ?? initUrl})\n });\n\n requestGitHubJwtWithRedirect({\n ...restRedirect,\n ...context,\n authUrl,\n authScopes\n });\n return;\n }\n\n const context = await initContext({generateState: generateGoogleState});\n\n const {google} = args;\n\n if ('credentials' in google) {\n const {credentials} = google;\n const {configUrl} = GOOGLE_PROVIDER;\n\n return await requestGoogleJwtWithCredentials({\n ...credentials,\n ...context,\n configUrl\n });\n }\n\n const {redirect} = google;\n const {authUrl, authScopes} = GOOGLE_PROVIDER;\n\n requestGoogleJwtWithRedirect({\n ...redirect,\n ...context,\n authUrl,\n authScopes\n });\n}\n", "/**\n * Detects whether the browser supports FedCM (Federated Credential Management).\n *\n * @returns {boolean} `true` if FedCM is supported, otherwise `false`.\n *\n * References:\n * - MDN IdentityCredential: https://developer.mozilla.org/en-US/docs/Web/API/IdentityCredential\n */\nexport const isFedCMSupported = (): boolean => {\n const {userAgent} = navigator;\n\n // Samsung browser implements \"IdentityCredential\" but does not support \"configURL\"\n // https://developer.mozilla.org/en-US/docs/Web/API/IdentityCredential\n const isSamsungBrowser = /SamsungBrowser/i.test(userAgent);\n if (isSamsungBrowser) {\n return false;\n }\n\n return 'IdentityCredential' in window;\n};\n", "export const parseOptionalUrl = ({url}: {url: string}): URL | null => {\n try {\n // Use the URL constructor, for backwards compatibility with older Android/WebView.\n return new URL(url);\n } catch (_error: unknown) {\n console.warn(`Cannot parse URL ${url}. Skipping option.`);\n return null;\n }\n};\n", "import {authenticate} from '@junobuild/auth/delegation';\nimport {isEmptyString, isNullish, nonNullish, notEmptyString} from '@junobuild/utils';\nimport {EnvStore} from '../../core/stores/env.store';\nimport {envApiUrl} from '../../core/utils/window.env.utils';\nimport {fromDoc} from '../../datastore/utils/doc.utils';\nimport {AuthClientStore} from '../stores/auth-client.store';\nimport type {HandleRedirectCallbackOptions} from '../types/auth';\nimport {SignInInitError} from '../types/errors';\nimport type {UserData} from '../types/user';\nimport {parseOptionalUrl} from '../utils/url.utils';\nimport {loadAuthWithUser} from './load.services';\n\nexport const handleRedirectCallback = async (options: HandleRedirectCallbackOptions) => {\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 container = EnvStore.getInstance().get()?.container;\n\n const auth = {\n auth: {\n satellite: {\n satelliteId,\n container\n }\n }\n };\n\n const buildFinalizeUrl = (): string | null => {\n const finalizeUrl = 'github' in options ? options?.github?.options?.finalizeUrl : undefined;\n\n if (notEmptyString(finalizeUrl)) {\n return finalizeUrl;\n }\n\n const apiUrl = envApiUrl();\n\n if (isEmptyString(apiUrl)) {\n return null;\n }\n\n return parseOptionalUrl({url: `${apiUrl}/v1/auth/finalize/github`})?.toString() ?? null;\n };\n\n const finalizeUrl = buildFinalizeUrl();\n\n const {\n identity: {delegationChain, sessionKey, identity},\n data: {doc}\n } = await authenticate(\n 'github' in options\n ? {\n github: {\n redirect: nonNullish(finalizeUrl) ? {finalizeUrl} : null,\n ...auth\n }\n }\n : {\n google: {\n redirect: null,\n ...auth\n }\n }\n );\n\n // Set up the delegation and session key for the AuthClient\n await AuthClientStore.getInstance().setAuthClientStorage({\n delegationChain,\n sessionKey\n });\n\n // Create the AuthClient, load the identity and set the user in store\n const user = await fromDoc<UserData>({doc, key: identity.getPrincipal().toText()});\n await loadAuthWithUser({user});\n};\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", "export class UnsafeDevIdentityNotBrowserError extends Error {\n constructor() {\n super('A dev identity can only be used in browser environments');\n }\n}\n\nexport class UnsafeDevIdentityNotLocalhostError extends Error {\n constructor() {\n super('A dev identity must only be used on localhost (127.0.0.1 or localhost)');\n }\n}\n\nexport class UnsafeDevIdentityInvalidIdentifierError extends Error {\n constructor(length: number) {\n super(`Identifier must be 32 characters or less, got ${length}`);\n }\n}\n", "import {\n DelegationChain,\n DelegationIdentity,\n ECDSAKeyIdentity,\n Ed25519KeyIdentity\n} from '@icp-sdk/core/identity';\nimport {clear, createStore, entries, update} from 'idb-keyval';\nimport {DEFAULT_DEV_DELEGATION_IDENTITY_EXPIRATION_IN_MS} from './_constants';\nimport {\n UnsafeDevIdentityInvalidIdentifierError,\n UnsafeDevIdentityNotBrowserError,\n UnsafeDevIdentityNotLocalhostError\n} from './errors';\nimport type {\n DevIdentifier,\n DevIdentifierData,\n GenerateUnsafeIdentityParams,\n GenerateUnsafeIdentityResult,\n LoadDevIdentifiersParams\n} from './types/identity';\n\nconst identifiersIdbStore = createStore('juno-dev-identifiers', 'juno-dev-identifiers-store');\n\n/**\n * Load all development identifiers that have been used for authentication.\n *\n * Returns an array of tuples containing the identifier string and metadata (created/updated timestamps),\n * sorted by most recently used first.\n *\n * @param params - Load parameters\n * @param params.limit - Optional maximum number of identifiers to return\n * @returns Promise resolving to array of [identifier, metadata] tuples sorted by updatedAt descending\n *\n * @example\n * const recent = await loadDevIdentifiers({ limit: 5 });\n * // Returns only the 5 most recently used identifiers\n */\nexport const loadDevIdentifiers = async ({limit}: LoadDevIdentifiersParams = {}): Promise<\n [DevIdentifier, DevIdentifierData][]\n> => {\n const identifiers = await entries<DevIdentifier, DevIdentifierData>(identifiersIdbStore);\n\n return identifiers.sort(([_, {updatedAt: a}], [__, {updatedAt: b}]) => b - a).slice(0, limit);\n};\n\n/**\n * Clear all stored development identifiers from IndexedDB.\n * This removes the history of used identifiers but does not affect AuthClient's stored credentials.\n *\n * @returns Promise that resolves when identifiers are cleared\n */\nexport const clearDevIdentifiers = () => clear(identifiersIdbStore);\n\n/**\n * Generate an identity for local development with the Internet Computer.\n *\n * \u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\n * \u26A0\uFE0F UNSAFE - FOR LOCAL DEVELOPMENT ONLY \u26A0\uFE0F\n * \u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\n *\n * Returns the identity, session key, and delegation chain.\n * Consumers must handle storage (e.g. for AuthClient compatibility).\n *\n * @param params - Generation parameters\n * @param params.identifier - Unique identifier string for this dev identity (default: \"dev\")\n * @param params.maxTimeToLiveInMilliseconds - Delegation expiration time in ms (default: 7 days)\n *\n * @returns Promise resolving to object containing identity, sessionKey, and delegationChain\n *\n * @throws {UnsafeDevIdentityNotBrowserError} If called outside browser environment\n * @throws {UnsafeDevIdentityNotLocalhostError} If called outside localhost\n **/\nexport const generateUnsafeDevIdentity = async ({\n identifier = 'dev',\n maxTimeToLiveInMilliseconds\n}: GenerateUnsafeIdentityParams = {}): Promise<GenerateUnsafeIdentityResult> => {\n const isBrowser = (): boolean => typeof window !== `undefined`;\n\n if (!isBrowser()) {\n throw new UnsafeDevIdentityNotBrowserError();\n }\n\n const {\n location: {hostname}\n } = window;\n\n if (!['127.0.0.1', 'localhost'].includes(hostname)) {\n throw new UnsafeDevIdentityNotLocalhostError();\n }\n\n const generateSeed = (): Uint8Array => {\n if (identifier.length > 32) {\n throw new UnsafeDevIdentityInvalidIdentifierError(identifier.length);\n }\n\n const encoder = new TextEncoder();\n return encoder.encode(identifier.padEnd(32, '0'));\n };\n\n const generate = async (): Promise<GenerateUnsafeIdentityResult> => {\n const seedBytes = generateSeed();\n\n const rootIdentity = Ed25519KeyIdentity.generate(seedBytes);\n const sessionKey = await ECDSAKeyIdentity.generate({\n extractable: false\n });\n\n const sessionLengthInMilliseconds =\n maxTimeToLiveInMilliseconds ?? DEFAULT_DEV_DELEGATION_IDENTITY_EXPIRATION_IN_MS;\n\n const chain = await DelegationChain.create(\n rootIdentity,\n sessionKey.getPublicKey(),\n new Date(Date.now() + sessionLengthInMilliseconds)\n );\n\n const delegatedIdentity = DelegationIdentity.fromDelegation(sessionKey, chain);\n\n return {\n identity: delegatedIdentity,\n sessionKey,\n delegationChain: chain\n };\n };\n\n const saveIdentifierUsage = async () => {\n await update(\n identifier,\n (value) => {\n const now = Date.now();\n\n return {\n createdAt: value?.createdAt ?? now,\n updatedAt: now\n };\n },\n identifiersIdbStore\n );\n };\n\n const result = await generate();\n\n await saveIdentifierUsage();\n\n return result;\n};\n", "function promisifyRequest(request) {\n return new Promise((resolve, reject) => {\n // @ts-ignore - file size hacks\n request.oncomplete = request.onsuccess = () => resolve(request.result);\n // @ts-ignore - file size hacks\n request.onabort = request.onerror = () => reject(request.error);\n });\n}\nfunction createStore(dbName, storeName) {\n let dbp;\n const getDB = () => {\n if (dbp)\n return dbp;\n const request = indexedDB.open(dbName);\n request.onupgradeneeded = () => request.result.createObjectStore(storeName);\n dbp = promisifyRequest(request);\n dbp.then((db) => {\n // It seems like Safari sometimes likes to just close the connection.\n // It's supposed to fire this event when that happens. Let's hope it does!\n db.onclose = () => (dbp = undefined);\n }, () => { });\n return dbp;\n };\n return (txMode, callback) => getDB().then((db) => callback(db.transaction(storeName, txMode).objectStore(storeName)));\n}\nlet defaultGetStoreFunc;\nfunction defaultGetStore() {\n if (!defaultGetStoreFunc) {\n defaultGetStoreFunc = createStore('keyval-store', 'keyval');\n }\n return defaultGetStoreFunc;\n}\n/**\n * Get a value by its key.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction get(key, customStore = defaultGetStore()) {\n return customStore('readonly', (store) => promisifyRequest(store.get(key)));\n}\n/**\n * Set a value with a key.\n *\n * @param key\n * @param value\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction set(key, value, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.put(value, key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Set multiple values at once. This is faster than calling set() multiple times.\n * It's also atomic \u2013 if one of the pairs can't be added, none will be added.\n *\n * @param entries Array of entries, where each entry is an array of `[key, value]`.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction setMany(entries, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n entries.forEach((entry) => store.put(entry[1], entry[0]));\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Get multiple values by their keys\n *\n * @param keys\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction getMany(keys, customStore = defaultGetStore()) {\n return customStore('readonly', (store) => Promise.all(keys.map((key) => promisifyRequest(store.get(key)))));\n}\n/**\n * Update a value. This lets you see the old value and update it as an atomic operation.\n *\n * @param key\n * @param updater A callback that takes the old value and returns a new value.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction update(key, updater, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => \n // Need to create the promise manually.\n // If I try to chain promises, the transaction closes in browsers\n // that use a promise polyfill (IE10/11).\n new Promise((resolve, reject) => {\n store.get(key).onsuccess = function () {\n try {\n store.put(updater(this.result), key);\n resolve(promisifyRequest(store.transaction));\n }\n catch (err) {\n reject(err);\n }\n };\n }));\n}\n/**\n * Delete a particular key from the store.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction del(key, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.delete(key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Delete multiple keys at once.\n *\n * @param keys List of keys to delete.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction delMany(keys, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n keys.forEach((key) => store.delete(key));\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Clear all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction clear(customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.clear();\n return promisifyRequest(store.transaction);\n });\n}\nfunction eachCursor(store, callback) {\n store.openCursor().onsuccess = function () {\n if (!this.result)\n return;\n callback(this.result);\n this.result.continue();\n };\n return promisifyRequest(store.transaction);\n}\n/**\n * Get all keys in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction keys(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n if (store.getAllKeys) {\n return promisifyRequest(store.getAllKeys());\n }\n const items = [];\n return eachCursor(store, (cursor) => items.push(cursor.key)).then(() => items);\n });\n}\n/**\n * Get all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction values(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n if (store.getAll) {\n return promisifyRequest(store.getAll());\n }\n const items = [];\n return eachCursor(store, (cursor) => items.push(cursor.value)).then(() => items);\n });\n}\n/**\n * Get all entries in the store. Each entry is an array of `[key, value]`.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction entries(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n // (although, hopefully we'll get a simpler path some day)\n if (store.getAll && store.getAllKeys) {\n return Promise.all([\n promisifyRequest(store.getAllKeys()),\n promisifyRequest(store.getAll()),\n ]).then(([keys, values]) => keys.map((key, i) => [key, values[i]]));\n }\n const items = [];\n return customStore('readonly', (store) => eachCursor(store, (cursor) => items.push([cursor.key, cursor.value])).then(() => items));\n });\n}\n\nexport { clear, createStore, del, delMany, entries, get, getMany, keys, promisifyRequest, set, setMany, update, values };\n", "import type {DelegationChain, ECDSAKeyIdentity} from '@icp-sdk/core/identity';\nimport {generateUnsafeDevIdentity} from '@junobuild/ic-client/dev';\nimport type {DevIdentitySignInOptions} from '../types/dev-identity';\nimport type {ProviderWithoutData} from '../types/provider';\n\n/**\n * Development identity authentication provider for local testing.\n *\n * \u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\n * \u26A0\uFE0F UNSAFE - FOR LOCAL DEVELOPMENT ONLY \u26A0\uFE0F\n * \u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\u26A0\uFE0F\n *\n * This provider generates deterministic identities for local development\n * without requiring external authentication services. Only works on localhost.\n *\n * @class DevIdentityProvider\n */\nexport class DevIdentityProvider {\n /**\n * Signs in a user with a development identity.\n *\n * @param {Object} params - The sign-in parameters.\n * @param {DevIdentitySignInOptions} [params.options] - Optional configuration for the dev identity (identifier, TTL).\n * @param {Function} params.initAuth - Callback to initialize or load the user after identity generation.\n * @param {Function} params.setStorage - Callback to store the session key and delegation chain for AuthClient.\n *\n * @returns {Promise<void>} Resolves when sign-in is complete.\n *\n * @throws {UnsafeDevIdentityNotBrowserError} If called outside browser environment.\n * @throws {UnsafeDevIdentityNotLocalhostError} If called outside localhost.\n * @throws {UnsafeDevIdentityInvalidIdentifierError} If identifier exceeds 32 characters.\n */\n async signIn({\n options,\n initAuth,\n setStorage\n }: {\n options?: DevIdentitySignInOptions;\n initAuth: (params: {provider: ProviderWithoutData}) => Promise<void>;\n setStorage: (params: {\n delegationChain: DelegationChain;\n sessionKey: ECDSAKeyIdentity;\n }) => Promise<void>;\n }): Promise<void> {\n // 1. Create a local identity and save the identifier usage in IDB\n const {sessionKey, delegationChain} = await generateUnsafeDevIdentity(options);\n\n // 2. We save the session and delegation for use with AuthClient\n await setStorage({sessionKey, delegationChain});\n\n // 3. Create a new AuthClient, load or create the user\n await initAuth({provider: undefined});\n }\n}\n", "import {requestJwt} from '@junobuild/auth/delegation';\nimport {isEmptyString, isNullish, notEmptyString} from '@junobuild/utils';\nimport {envApiUrl, envGitHubClientId} from '../../core/utils/window.env.utils';\nimport {SignInMissingClientIdError} from '../types/errors';\nimport type {GitHubSignInRedirectOptions} from '../types/github';\nimport {parseOptionalUrl} from '../utils/url.utils';\n\nexport class GitHubProvider {\n /**\n * Initiates a GitHub sign-in flow.\n *\n * @param {Object} params - Parameters for the sign-in request.\n * @param {GitHubSignInRedirectOptions} [params.options] - Optional configuration for the sign-in request.\n *\n * @returns {Promise<void>} Resolves once the sign-in flow has been initiated.\n */\n async signIn({options = {}}: {options?: GitHubSignInRedirectOptions}) {\n const clientId = options?.redirect?.clientId ?? envGitHubClientId();\n\n if (isNullish(clientId)) {\n throw new SignInMissingClientIdError();\n }\n\n const {redirect} = options;\n\n const initUrl = (): string | undefined => {\n const initUrl = options?.redirect?.initUrl;\n\n if (notEmptyString(initUrl)) {\n return initUrl;\n }\n\n const apiUrl = envApiUrl();\n\n if (isEmptyString(apiUrl)) {\n return undefined;\n }\n\n return parseOptionalUrl({url: `${apiUrl}/v1/auth/init/github`})?.toString();\n };\n\n await requestJwt({\n github: {\n redirect: {\n ...(redirect ?? {}),\n clientId,\n initUrl: initUrl()\n }\n }\n });\n }\n}\n", "import {requestJwt} from '@junobuild/auth/delegation';\nimport {isNullish} from '@junobuild/utils';\nimport {envGoogleClientId} from '../../core/utils/window.env.utils';\nimport {SignInMissingClientIdError} from '../types/errors';\nimport type {GoogleSignInRedirectOptions} from '../types/google';\n\nexport class GoogleProvider {\n /**\n * Initiates a Google sign-in flow.\n *\n * Depending on the environment or configuration, this may redirect the user\n * to Google's authentication screen or trigger a browser-native sign-in flow\n * (such as FedCM in the future).\n *\n * @param {Object} params - Parameters for the sign-in request.\n * @param {GoogleSignInRedirectOptions} [params.options] - Optional configuration for the sign-in request.\n *\n * @returns {Promise<void>} Resolves once the sign-in flow has been initiated.\n */\n async signIn({options = {}}: {options?: GoogleSignInRedirectOptions}) {\n const clientId = options?.redirect?.clientId ?? envGoogleClientId();\n\n if (isNullish(clientId)) {\n throw new SignInMissingClientIdError();\n }\n\n const {redirect} = options;\n\n await requestJwt({\n google: {\n redirect: {\n ...(redirect ?? {}),\n clientId\n }\n }\n });\n }\n}\n", "import {IdbStorage, KEY_STORAGE_DELEGATION, KEY_STORAGE_KEY} from '@icp-sdk/auth/client';\nimport {type SignIdentity, AnonymousIdentity} from '@icp-sdk/core/agent';\nimport {\n DelegationChain,\n DelegationIdentity,\n DER_COSE_OID,\n ECDSAKeyIdentity,\n unwrapDER\n} from '@icp-sdk/core/identity';\nimport {\n type RetrievePublicKeyFn,\n type WebAuthnNewCredential,\n type WebAuthnSignProgressFn,\n WebAuthnIdentity,\n WebAuthnSignProgressStep\n} from '@junobuild/ic-client/webauthn';\nimport {isNullish, uint8ArrayToBase64} from '@junobuild/utils';\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 {User} from '../types/user';\nimport {\n type WebAuthnSignInOptions,\n type WebAuthnSignUpOptions,\n WebAuthnSignInProgressStep,\n WebAuthnSignUpProgressStep\n} from '../types/webauthn';\n\ninterface SessionDelegationIdentity {\n delegationIdentity: DelegationIdentity;\n sessionKey: ECDSAKeyIdentity;\n}\n\nexport class WebAuthnProvider {\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, 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 {Identity} from '@icp-sdk/core/agent';\nimport type {WebAuthnIdentity, WebAuthnNewCredential} from '@junobuild/ic-client/webauthn';\nimport {nonNullish, uint8ArrayToArrayOfNumber} from '@junobuild/utils';\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: passkeyIdentity.getPublicKey().toRaw()\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 {executeWithWindowGuard} from '../helpers/window.helpers';\nimport {DevIdentityProvider} from '../providers/dev-identity.providers';\nimport {GitHubProvider} from '../providers/github.providers';\nimport {GoogleProvider} from '../providers/google.providers';\nimport {InternetIdentityProvider} from '../providers/internet-identity.providers';\nimport {WebAuthnProvider} from '../providers/webauthn.providers';\nimport {AuthClientStore} from '../stores/auth-client.store';\nimport {AuthStore} from '../stores/auth.store';\nimport type {SignInContext, SignInOptions} from '../types/auth';\nimport {SignInProviderNotSupportedError} from '../types/errors';\nimport type {ProviderWithoutData} from '../types/provider';\nimport {authenticateWithAuthClient} from './_auth-client.services';\nimport {initUser} from './_user.services';\nimport {loadAuth} from './load.services';\n\n/**\n * Initialize the authClient, load or create a new user.\n * Executed on sign-in.\n *\n * \u2139\uFE0F Exposed for testing purpose only.\n */\nexport const createAuth = async ({provider}: {provider: ProviderWithoutData}) => {\n const init = async () => {\n const user = await initUser({provider});\n AuthStore.getInstance().set(user);\n };\n\n await authenticateWithAuthClient({fn: init, syncTabsOnSuccess: true});\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 if ('google' in options) {\n const {\n google: {options: signInOptions}\n } = options;\n\n const fn = (): Promise<void> =>\n new GoogleProvider().signIn({\n options: signInOptions\n });\n\n await signInWithContext({\n fn,\n context: {windowGuard: false}\n });\n\n return;\n }\n\n if ('github' in options) {\n const {\n github: {options: signInOptions}\n } = options;\n\n const fn = (): Promise<void> =>\n new GitHubProvider().signIn({\n options: signInOptions\n });\n\n await signInWithContext({\n fn,\n context: {windowGuard: false}\n });\n\n return;\n }\n\n if ('webauthn' in options) {\n const {\n webauthn: {options: signInOptions, context}\n } = options;\n\n const fn = (): Promise<void> =>\n new WebAuthnProvider().signIn({\n options: signInOptions,\n loadAuth: (): Promise<void> => loadAuth({syncTabsOnSuccess: true})\n });\n\n await signInWithContext({fn, context});\n\n return;\n }\n\n if ('internet_identity' in options) {\n const {\n internet_identity: {options: iiOptions, context}\n } = options;\n\n const {domain, ...signInOptions} = iiOptions ?? {};\n\n const fn = (): Promise<void> =>\n new InternetIdentityProvider({domain}).signIn({\n options: signInOptions,\n authClient: AuthClientStore.getInstance().getAuthClient(),\n initAuth: createAuth\n });\n\n await signInWithContext({fn, context});\n\n return;\n }\n\n if ('dev' in options) {\n const {\n dev: {options: devOptions}\n } = options;\n\n const {setAuthClientStorage: setStorage} = AuthClientStore.getInstance();\n\n const fn = (): Promise<void> =>\n new DevIdentityProvider().signIn({\n options: devOptions,\n initAuth: createAuth,\n setStorage\n });\n\n await signInWithContext({\n fn,\n context: {windowGuard: false}\n });\n\n return;\n }\n\n throw new SignInProviderNotSupportedError(\n 'An unknown or unsupported provider was provided for sign-in.'\n );\n};\n\nconst signInWithContext = async ({\n fn,\n context\n}: {\n fn: () => Promise<void>;\n context?: SignInContext;\n}): Promise<void> => {\n const disableWindowGuard = context?.windowGuard === false;\n\n if (disableWindowGuard) {\n await fn();\n return;\n }\n\n await executeWithWindowGuard({fn});\n};\n", "import {executeWithWindowGuard} from '../helpers/window.helpers';\nimport {WebAuthnProvider} from '../providers/webauthn.providers';\nimport type {SignUpOptions} from '../types/auth';\nimport {SignUpProviderNotSupportedError} from '../types/errors';\nimport {loadAuthWithUser} from './load.services';\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 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", "import type {User} from '../types/user';\n\n/**\n * Checks whether a user signed in using WebAuthn.\n *\n * Acts as a type guard that narrows {@link User} to {@link User<'webauthn'>}.\n *\n * @param user - The user object to check.\n * @returns True if the user signed in via WebAuthn.\n */\nexport const isWebAuthnUser = (user: User): user is User<'webauthn'> =>\n user?.data?.provider === 'webauthn';\n\n/**\n * Checks whether a user signed in using Google (OpenID).\n *\n * Acts as a type guard that narrows {@link User} to {@link User<'google'>}.\n *\n * @param user - The user object to check.\n * @returns True if the user signed in via Google.\n */\nexport const isGoogleUser = (user: User): user is User<'google'> =>\n user?.data?.provider === 'google';\n\n/**\n * Checks whether a user signed in using GitHub (OpenID).\n *\n * Acts as a type guard that narrows {@link User} to {@link User<'github'>}.\n *\n * @param user - The user object to check.\n * @returns True if the user signed in via GitHub.\n */\nexport const isGitHubUser = (user: User): user is User<'github'> =>\n user?.data?.provider === 'github';\n", "import type {ActorMethod, ActorSubclass} from '@icp-sdk/core/agent';\nimport type {IDL} from '@icp-sdk/core/candid';\nimport {getSatelliteExtendedActor as getSatelliteExtendedActorApi} from '../../core/api/actor.api';\nimport {getAnyIdentity} from '../../core/services/any-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 type {ConsoleDid, SatelliteDid} from '@junobuild/ic-client/actor';\nimport {assertNonNullish, isBrowser, toNullable} 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", "import type {SatelliteDid} from '@junobuild/ic-client/actor';\nimport {\n uploadAsset as uploadAssetStorage,\n type AssetKey,\n type UploadAsset\n} from '@junobuild/storage';\nimport {fromNullable, toNullable} from '@junobuild/utils';\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 setAssetToken = async ({\n collection,\n fullPath,\n token,\n ...rest\n}: {\n collection: string;\n token: string | null;\n} & ActorUpdateParams &\n Pick<AssetKey, 'fullPath'>): Promise<void> => {\n const {set_asset_token} = await getSatelliteActor(rest);\n\n return set_asset_token(collection, fullPath, toNullable(token));\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", "export const sha256ToBase64String = (sha256: Iterable<number>): string =>\n btoa([...sha256].map((c) => String.fromCharCode(c)).join(''));\n", "import type {SatelliteDid} from '@junobuild/ic-client/actor';\nimport type {Asset, AssetEncoding, AssetKey, Storage} from '@junobuild/storage';\nimport {fromNullable, nonNullish} from '@junobuild/utils';\nimport {DEFAULT_READ_OPTIONS} from '../../core/constants/call-options.constants';\nimport {getAnyIdentity} from '../../core/services/any-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 setAssetToken as setAssetTokenApi,\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 ...(nonNullish(token) && {token}),\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 * Set an access token for an asset of the storage.\n *\n * @param {Object} params - The parameters for setting the access token.\n * @param {string} params.collection - The name of the collection.\n * @param {string} params.fullPath - The full path of the asset.\n * @param {string | null} params.token - The access token. Providing undined removes any existing protection and makes the asset accessible without access token.\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 access token has been set to the asset.\n */\nexport const setAssetToken = ({\n collection,\n fullPath,\n token,\n satellite\n}: {\n collection: string;\n token: string | null;\n satellite?: SatelliteOptions;\n} & Pick<AssetKey, 'fullPath'>): Promise<void> =>\n setAssetTokenApi({\n collection,\n fullPath,\n token,\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<AssetKey, '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 {isWebAuthnAvailable} from '@junobuild/ic-client/webauthn';\nimport type {Asset, AssetEncoding, AssetKey, EncodingType, Storage} from '@junobuild/storage';\nimport {assertNonNullish, nonNullish} from '@junobuild/utils';\nimport {initAuthTimeoutWorker} from './auth/services/auth-timout.services';\nimport {initAuthBroadcastListener} from './auth/services/broadcast.services';\nimport {loadAuth} from './auth/services/load.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 {getIdentityOnce, unsafeIdentity} from './auth/services/identity.services';\nexport {handleRedirectCallback} from './auth/services/redirect.services';\nexport {signIn} from './auth/services/sign-in.services';\nexport {signOut} from './auth/services/sign-out.services';\nexport {signUp} from './auth/services/sign-up.services';\nexport type * from './auth/types/auth';\nexport * from './auth/types/auth-client';\nexport type * from './auth/types/dev-identity';\nexport * from './auth/types/errors';\nexport type * from './auth/types/github';\nexport type * from './auth/types/google';\nexport type * from './auth/types/internet-identity';\nexport type * from './auth/types/progress';\nexport type * from './auth/types/provider';\nexport type * from './auth/types/user';\nexport * from './auth/types/webauthn';\nexport * from './auth/utils/user.utils';\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 syncTabs: userEnv?.syncTabs,\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 const syncTabsSubscribe = env.syncTabs === false ? undefined : initAuthBroadcastListener();\n\n return [\n ...(nonNullish(authSubscribe) ? [authSubscribe] : []),\n ...(nonNullish(syncTabsSubscribe) ? [syncTabsSubscribe] : [])\n ];\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';\n"],
|
|
5
|
+
"mappings": "AOAA,OAAQ,aAAAA,OAAgB,0BPAjB,IACMC,GAAN,cAA2B,KAAM,CAAC,EAE5BC,GAI0B,CAAIC,EAAUC,IAA2B,CAC9E,GAAID,GAAU,KACZ,MAAM,IAAIF,GAAaG,CAAO,CAElC,ECTO,IAoCMC,GAA2BC,GAAoC,IAAI,WAAWA,CAAM,EAEpFC,GAA6BC,GAAqC,MAAM,KAAKA,CAAK,EAtCxF,IA8DMC,GAAmB,CAAC,CAAC,EAAAC,EAAG,EAAAC,CAAC,IACpCD,EAAE,SAAWC,EAAE,QAAUD,EAAE,MAAM,CAACE,EAAMC,IAAMD,IAASD,EAAEE,CAAC,CAAC,EC3DtD,IAAMC,GAAsBC,GAAmC,CAKpE,IAAMC,EAAmB,CAAC,EAC1B,QAASC,EAAI,EAAGA,EAAIF,EAAW,OAAQE,GAAK,MAC1CD,EAAO,KAAK,OAAO,aAAa,GAAGD,EAAW,SAASE,EAAGA,EAAI,KAAS,CAAC,CAAC,EAE3E,OAAO,KAAKD,EAAO,KAAK,EAAE,CAAC,CAC7B,EAQaE,GAAsBC,GACjC,WAAW,KAAK,KAAKA,CAAY,EAAIC,GAAMA,EAAE,WAAW,CAAC,CAAC,EGlBrD,IAAMC,EAAgBC,GAC3BA,GAAa,KASFC,EAAiBD,GAC5B,CAACD,EAAUC,CAAQ,EAQRE,GAAkBC,GAC7BF,EAAWE,CAAK,GAAKA,IAAU,GAQpBC,EAAiBD,GAC5B,CAACD,GAAeC,CAAK,ECzBVE,EAAiBF,GAAmCF,EAAWE,CAAK,EAAI,CAACA,CAAK,EAAI,CAAC,EASnFG,EAAmBH,GAAsCA,IAAQ,CAAC,ECjB/E,IAAMI,GAAkB,aAClBC,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AAsD,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,OAExEK,EAAoBL,EAAI,WAAa,GAAQ,OAAYM,GAA0B,EAEzF,MAAO,CACL,GAAIC,EAAWJ,CAAa,EAAI,CAACA,CAAa,EAAI,CAAC,EACnD,GAAII,EAAWF,CAAiB,EAAI,CAACA,CAAiB,EAAI,CAAC,CAC7D,CACF,EAOaG,GAAqBC,GAChCC,EAAU,YAAY,EAAE,UAAUD,CAAQ,EAK/BN,GAAgBK",
|
|
6
|
+
"names": ["Principal", "NullishError", "assertNonNullish", "value", "message", "arrayBufferToUint8Array", "buffer", "uint8ArrayToArrayOfNumber", "array", "uint8ArraysEqual", "a", "b", "byte", "i", "uint8ArrayToBase64", "uint8Array", "chunks", "i", "base64ToUint8Array", "base64String", "c", "isNullish", "argument", "nonNullish", "notEmptyString", "value", "isEmptyString", "toNullable", "fromNullable", "JSON_KEY_BIGINT", "JSON_KEY_PRINCIPAL", "JSON_KEY_UINT8ARRAY", "jsonReplacer", "_key", "value", "nonNullish", "Principal", "jsonReviver", "mapValue", "key", "toArray", "data", "blob", "fromArray", "isBrowser", "DER_COSE_OID", "wrapDER", "Cbor", "SignIdentity", "extractAAGUID", "authData", "bytes", "result", "bytesToAAGUID", "aaguid", "uint8ArrayToArrayOfNumber", "byte", "_authDataToCose", "dataView", "idLenBytes", "v", "i", "credentialIdLength", "_coseToDerEncodedBlob", "cose", "wrapDER", "DER_COSE_OID", "CosePublicKey", "_cose", "#encodedKey", "WebAuthnCredential", "#credentialId", "#publicKey", "credentialId", "uint8ArrayToBase64", "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", "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", "isNullish", "WebAuthnIdentityCreateCredentialOnTheDeviceError", "assertCredentialPublicKey", "type", "WebAuthnIdentityCredentialNotPublicKeyError", "WebAuthnIdentity", "_WebAuthnIdentity", "SignIdentity", "#onSignProgress", "#state", "args", "retrievePublicKey", "#createInitializedState", "WebAuthnNewCredential", "restArgs", "attestationObject", "rawId", "WebAuthnIdentityNoAttestationError", "authData", "Cbor", "arrayBufferToUint8Array", "cose", "_authDataToCose", "blob", "uint8ArraysEqual", "WebAuthnIdentityInvalidCredentialIdError", "WebAuthnExistingCredential", "response", "clientDataJSON", "authenticatorData", "signature", "WebAuthnIdentityNoAuthenticatorDataError", "encoded", "WebAuthnIdentityEncodeCborSignatureError", "isWebAuthnAvailable", "nonNullish", "Store", "data", "callback", "callbackId", "id", "AuthStore", "_AuthStore", "Store", "authUser", "callback", "unsubscribe", "emit", "message", "detail", "$event", "Actor", "HttpAgent", "DOCKER_CONTAINER_URL", "DOCKER_INTERNET_IDENTITY_ID", "createAgent", "identity", "container", "host", "o", "DOCKER_CONTAINER_URL", "shouldFetchRootKey", "HttpAgent", "AgentStore", "_AgentStore", "#agents", "x", "identity", "rest", "key", "agent", "createAgent", "ActorStore", "_ActorStore", "#actors", "x", "satelliteId", "identity", "actorKey", "rest", "key", "actor", "idlFactory", "canisterId", "agent", "AgentStore", "Actor", "AuthClient", "IdbStorage", "KEY_STORAGE_DELEGATION", "KEY_STORAGE_KEY", "AuthClientStore", "_AuthClientStore", "#instance", "#authClient", "x", "AuthClient", "storage", "IdbStorage", "KEY_STORAGE_KEY", "KEY_STORAGE_DELEGATION", "delegationChain", "sessionKey", "signOut", "options", "resetAuth", "AuthClientStore", "AuthStore", "ActorStore", "AgentStore", "initAuthTimeoutWorker", "auth", "workerUrl", "worker", "timeoutSignOut", "emit", "signOut", "data", "msg", "value", "AuthStore", "user", "x", "AuthBroadcastChannel", "_AuthBroadcastChannel", "#instance", "#bc", "#emitterId", "x", "handler", "origin", "eventOrigin", "data", "o", "b", "EnvStore", "_EnvStore", "Store", "env", "callback", "unsubscribe", "authenticateWithAuthClient", "fn", "syncTabsOnSuccess", "authenticated", "authenticate", "EnvStore", "syncTabs", "authenticateWithNewAuthClient", "createAuthClient", "AuthClientStore", "isAuthenticated", "safeCreateAuthClient", "AuthBroadcastChannel", "err", "isSatelliteError", "error", "type", "JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE", "DEFAULT_READ_OPTIONS", "AnonymousIdentity", "getIdentity", "AuthClientStore", "unsafeIdentity", "getAuthClient", "createAuthClient", "getIdentityOnce", "user", "AuthStore", "x", "authClient", "getAnyIdentity", "identity", "o", "getIdentity", "AnonymousIdentity", "Actor", "HttpAgent", "idlFactory", "IDL", "Memory", "InitStorageArgs", "InitSatelliteArgs", "OpenIdPrepareDelegationArgs", "AuthenticationArgs", "Doc", "PreparedDelegation", "Authentication", "JwtFindProviderError", "JwtVerifyError", "GetOrRefreshJwksError", "PrepareDelegationError", "AuthenticationError", "AuthenticateResultResponse", "OpenIdPrepareAutomationArgs", "AuthenticateAutomationArgs", "AutomationScope", "AutomationController", "PrepareAutomationError", "AuthenticationAutomationError", "AuthenticateAutomationResultResponse", "AssetKey", "CertifyAssetsCursor", "CertifyAssetsStrategy", "CertifyAssetsArgs", "CertifyAssetsResult", "CommitBatch", "CommitProposal", "ListOrderField", "ListOrder", "TimestampMatcher", "ListMatcher", "ListPaginate", "ListParams", "DeleteControllersArgs", "AccessKeyKind", "AccessKeyScope", "AccessKey", "DelDoc", "CollectionType", "DelRule", "DeleteProposalAssets", "DepositCyclesArgs", "AssetEncodingNoContent", "AssetNoContent", "OpenIdDelegationProvider", "OpenIdAuthProviderDelegationConfig", "OpenIdAuthProviderConfig", "AuthenticationConfigOpenId", "AuthenticationConfigInternetIdentity", "AuthenticationRules", "AuthenticationConfig", "OpenIdAutomationProvider", "OpenIdAutomationProviderControllerConfig", "RepositoryKey", "OpenIdAutomationRepositoryConfig", "OpenIdAutomationProviderConfig", "AutomationConfigOpenId", "AutomationConfig", "ConfigMaxMemorySize", "DbConfig", "StorageConfigIFrame", "StorageConfigRawAccess", "StorageConfigRedirect", "StorageConfig", "Config", "OpenIdGetDelegationArgs", "GetDelegationArgs", "Delegation", "SignedDelegation", "GetDelegationError", "GetDelegationResultResponse", "ProposalStatus", "AssetsUpgradeOptions", "SegmentsDeploymentOptions", "ProposalType", "Proposal", "Permission", "RateConfig", "Rule", "HttpRequest", "StreamingCallbackToken", "StreamingStrategy", "HttpResponse", "StreamingCallbackHttpResponse", "InitAssetKey", "InitUploadResult", "ListResults", "CustomDomain", "ListResults_1", "ListProposalsOrder", "ListProposalsPaginate", "ListProposalsParams", "ProposalKey", "ListProposalResults", "ListRulesMatcher", "ListRulesParams", "ListRulesResults", "MemorySize", "SetAuthenticationConfig", "SetAutomationConfig", "SetAccessKey", "SetControllersArgs", "SetDbConfig", "SetDoc", "SetRule", "SetStorageConfig", "SetStorageConfigOptions", "SetStorageConfigWithOptions", "UploadChunk", "UploadChunkResult", "Tokens", "AssertMissionControlCenterArgs", "OpenIdData", "OpenId", "Provider", "Account", "Result", "CreateMissionControlArgs", "CreateOrbiterArgs", "InitStorageMemory", "CreateSatelliteArgs", "GetCreateCanisterFeeArgs", "Result_1", "SegmentKind", "CyclesTokens", "FactoryFee", "PaymentStatus", "IcpPayment", "IcrcPaymentKey", "Account_1", "IcrcPayment", "StorableSegmentKind", "ListSegmentsArgs", "SegmentKey", "Segment", "FeesArgs", "SetSegmentsArgs", "SetSegmentMetadataArgs", "UnsetSegmentsArgs", "createAgent", "identity", "host", "localActor", "HttpAgent", "useOrInitAgent", "agent", "rest", "initAgent", "container", "nonNullish", "getSatelliteActor", "satelliteId", "certified", "rest", "getActor", "idlFactory", "getConsoleActor", "consoleId", "certified", "rest", "getActor", "idlFactory", "canisterId", "isNullish", "createActor", "config", "agent", "useOrInitAgent", "Actor", "satelliteUrl", "customSatelliteId", "customContainer", "satelliteId", "customOrEnvSatelliteId", "container", "customOrEnvContainer", "o", "containerHost", "protocol", "DOCKER_CONTAINER_URL", "EnvStore", "getSatelliteActor", "satellite", "certified", "getActor", "Te", "_e", "getSatelliteExtendedActor", "idlFactory", "rest", "customSatelliteId", "customContainer", "satelliteId", "customOrEnvSatelliteId", "i", "container", "customOrEnvContainer", "ActorStore", "Principal", "SignInError", "SignInInitError", "SignInUserInterruptError", "SignInProviderNotSupportedError", "SignInMissingClientIdError", "WebAuthnSignInRetrievePublicKeyError", "SignUpProviderNotSupportedError", "InitError", "ListError", "toListMatcherTimestamp", "matcher", "x", "H", "ListError", "toListParams", "paginate", "order", "owner", "Principal", "mapData", "data", "er", "err", "toSetDoc", "doc", "data", "version", "description", "H", "tr", "toDelDoc", "fromDoc", "key", "owner", "docDescription", "rest", "m", "er", "getDoc", "collection", "key", "rest", "get_doc", "getSatelliteActor", "doc", "m", "x", "fromDoc", "getManyDocs", "docs", "get_many_docs", "payload", "resultsDocs", "results", "resultDoc", "o", "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", "initUser", "provider", "user", "userId", "loadUser", "o", "createUser", "error", "t", "s_", "userOnCreateError", "getUser", "identity", "getIdentity", "x", "InitError", "getDoc", "rest", "setDoc", "loadAuth", "syncTabsOnSuccess", "authenticateWithAuthClient", "user", "loadUser", "AuthStore", "reloadAuth", "authenticateWithNewAuthClient", "authenticated", "fn", "loadAuthWithUser", "initAuthBroadcastListener", "bc", "AuthBroadcastChannel", "onLogin", "reloadAuth", "emit", "err", "envSatelliteId", "viteEnvSatelliteId", "envContainer", "viteEnvContainer", "envGoogleClientId", "viteEnvGoogleClientId", "envGitHubClientId", "viteEnvGitHubClientId", "envApiUrl", "viteEnvApiUrl", "DELEGATION_IDENTITY_EXPIRATION", "ALLOW_PIN_AUTHENTICATION", "II_DESIGN_V1_POPUP", "II_DESIGN_V2_POPUP", "INTERNET_COMPUTER_ORG", "IC0_APP", "ID_AI", "popupCenter", "width", "height", "ir", "x", "innerWidth", "innerHeight", "y", "ERROR_USER_INTERRUPT", "execute", "fn", "step", "onProgress", "result", "err", "AuthClientSignInProgressStep", "AuthClientProvider", "options", "authClient", "initAuth", "execute", "#loginWithAuthClient", "resolve", "reject", "x", "SignInInitError", "error", "ERROR_USER_INTERRUPT", "SignInUserInterruptError", "SignInError", "DELEGATION_IDENTITY_EXPIRATION", "ALLOW_PIN_AUTHENTICATION", "InternetIdentityProvider", "AuthClientProvider", "#domain", "domain", "windowed", "identityProvider", "container", "EnvStore", "x", "identityV1Domain", "INTERNET_COMPUTER_ORG", "IC0_APP", "ID_AI", "Z", "env", "internetIdentityId", "o", "DOCKER_INTERNET_IDENTITY_ID", "containerHost", "protocol", "DOCKER_CONTAINER_URL", "popupCenter", "hostname", "II_DESIGN_V2_POPUP", "II_DESIGN_V1_POPUP", "toBase64URL", "uint8Array", "uint8ArrayToBase64", "generateSalt", "buildNonce", "salt", "caller", "principal", "bytes", "hash", "arrayBufferToUint8Array", "generateNonce", "Ed25519KeyIdentity", "Ed25519KeyIdentity", "Delegation", "ECDSAKeyIdentity", "DelegationChain", "DelegationIdentity", "CONTEXT_KEY", "GOOGLE_PROVIDER", "GITHUB_PROVIDER", "InvalidUrlError", "ContextUndefinedError", "FedCMIdentityCredentialUndefinedError", "FedCMIdentityCredentialInvalidError", "AuthenticationError", "AuthenticationUrlHashError", "AuthenticationInvalidStateError", "AuthenticationUndefinedJwtError", "GetDelegationError", "GetDelegationRetryError", "ApiGitHubInitError", "options", "ApiGitHubFinalizeError", "JSON_KEY_CALLER", "JSON_KEY_SALT", "JSON_KEY_STATE", "stringifyContext", "caller", "state", "salt", "data", "uint8ArrayToBase64", "parseContext", "jsonData", "jsonCaller", "jsonSalt", "Ed25519KeyIdentity", "base64ToUint8Array", "initContext", "generateState", "nonce", "generateNonce", "storedData", "loadContext", "storedContext", "isNullish", "getAuthActor", "auth", "identity", "getSatelliteActor", "getConsoleActor", "authenticate", "actorParams", "args", "getDelegation", "get_delegation", "generateIdentity", "delegations", "sessionKey", "userKey", "signedDelegations", "delegationChain", "DelegationChain", "DelegationIdentity", "authenticateSession", "jwt", "context", "ECDSAKeyIdentity", "publicKey", "result", "expiration", "rest", "signedDelegation", "retryGetDelegation", "delegation", "signature", "pubkey", "signedExpiration", "targets", "Delegation", "fromNullable", "maxRetries", "i", "resolve", "Err", "initOAuth", "url", "error", "finalizeOAuth", "body", "authenticateGitHubWithRedirect", "finalizeUrl", "search", "urlParams", "code", "idToken", "isEmptyString", "authenticateGoogleWithRedirect", "hash", "params", "savedState", "redirect", "google", "parseUrl", "buildGenerateState", "initUrl", "requestUrl", "requestGitHubJwtWithRedirect", "authUrl", "clientId", "authScopes", "redirectUrl", "currentUrl", "generateRandomState", "toBase64URL", "generateGoogleState", "_params", "requestGoogleJwtWithRedirect", "loginHint", "notEmptyString", "requestGoogleJwtWithCredentials", "configURL", "domainHint", "identityCredential", "type", "requestJwt", "github", "userInitUrl", "restRedirect", "credentials", "configUrl", "parseOptionalUrl", "url", "handleRedirectCallback", "options", "satelliteId", "EnvStore", "x", "SignInInitError", "container", "auth", "finalizeUrl", "b", "apiUrl", "envApiUrl", "Z", "parseOptionalUrl", "delegationChain", "sessionKey", "identity", "doc", "se", "o", "AuthClientStore", "user", "fromDoc", "loadAuthWithUser", "onBeforeUnload", "$event", "addBeforeUnload", "removeBeforeUnload", "executeWithWindowGuard", "fn", "DelegationChain", "DelegationIdentity", "ECDSAKeyIdentity", "Ed25519KeyIdentity", "promisifyRequest", "request", "resolve", "reject", "createStore", "dbName", "storeName", "dbp", "getDB", "db", "txMode", "callback", "defaultGetStoreFunc", "defaultGetStore", "update", "key", "updater", "customStore", "defaultGetStore", "store", "resolve", "reject", "promisifyRequest", "err", "UnsafeDevIdentityNotBrowserError", "UnsafeDevIdentityNotLocalhostError", "UnsafeDevIdentityInvalidIdentifierError", "length", "identifiersIdbStore", "createStore", "generateUnsafeDevIdentity", "identifier", "maxTimeToLiveInMilliseconds", "UnsafeDevIdentityNotBrowserError", "hostname", "UnsafeDevIdentityNotLocalhostError", "generateSeed", "UnsafeDevIdentityInvalidIdentifierError", "generate", "seedBytes", "rootIdentity", "Ed25519KeyIdentity", "sessionKey", "ECDSAKeyIdentity", "sessionLengthInMilliseconds", "chain", "DelegationChain", "DelegationIdentity", "saveIdentifierUsage", "update", "value", "now", "identifiersIdbStore", "result", "DevIdentityProvider", "options", "initAuth", "setStorage", "sessionKey", "delegationChain", "K", "GitHubProvider", "options", "clientId", "envGitHubClientId", "x", "SignInMissingClientIdError", "redirect", "Ie", "initUrl", "b", "apiUrl", "envApiUrl", "Z", "parseOptionalUrl", "GoogleProvider", "options", "clientId", "envGoogleClientId", "x", "SignInMissingClientIdError", "redirect", "Ie", "IdbStorage", "KEY_STORAGE_DELEGATION", "KEY_STORAGE_KEY", "AnonymousIdentity", "DelegationChain", "DelegationIdentity", "DER_COSE_OID", "ECDSAKeyIdentity", "unwrapDER", "createWebAuthnUser", "delegationIdentity", "passkeyIdentity", "satelliteId", "aaguid", "user", "_", "setManyDocs", "o", "S", "WebAuthnSignInProgressStep", "WebAuthnSignUpProgressStep", "WebAuthnProvider", "onProgress", "maxTimeToLiveInMilliseconds", "passkeyOptions", "loadAuthWithUser", "satelliteId", "EnvStore", "x", "SignInInitError", "onSignProgress", "step", "state", "B", "passkeyIdentity", "execute", "F", "delegationIdentity", "sessionKey", "#createSessionDelegation", "user", "createWebAuthnUser", "#saveSessionIdentityForAuthClient", "loadAuth", "retrievePublicKey", "credentialId", "doc", "getDoc", "P", "AnonymousIdentity", "WebAuthnSignInRetrievePublicKeyError", "data", "publicKey", "unwrapDER", "DER_COSE_OID", "identity", "ECDSAKeyIdentity", "sessionLengthInMilliseconds", "chain", "DelegationChain", "DelegationIdentity", "storage", "IdbStorage", "KEY_STORAGE_KEY", "KEY_STORAGE_DELEGATION", "createAuth", "provider", "authenticateWithAuthClient", "user", "initUser", "AuthStore", "signIn", "options", "signInOptions", "signInWithContext", "GoogleProvider", "GitHubProvider", "context", "WebAuthnProvider", "loadAuth", "iiOptions", "domain", "InternetIdentityProvider", "AuthClientStore", "devOptions", "setStorage", "DevIdentityProvider", "SignInProviderNotSupportedError", "fn", "executeWithWindowGuard", "signUp", "options", "fn", "signUpWithProvider", "executeWithWindowGuard", "signUpOptions", "WebAuthnProvider", "loadAuthWithUser", "SignUpProviderNotSupportedError", "isWebAuthnUser", "user", "isGoogleUser", "isGitHubUser", "getSatelliteExtendedActor", "idlFactory", "satellite", "identity", "getAnyIdentity", "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", "T", "listAssets", "collection", "filter", "list_assets", "assets", "items_length", "items_page", "matches_length", "matches_pages", "toListParams", "_", "m", "countAssets", "count_assets", "deleteAsset", "fullPath", "deleteManyAssets", "satellite", "del_many_assets", "payload", "deleteFilteredAssets", "del_filtered_assets", "setAssetToken", "token", "set_asset_token", "H", "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", "o", "listAssets", "filter", "options", "items", "rest", "DEFAULT_READ_OPTIONS", "assets", "t", "name", "owner", "encodings", "created_at", "updated_at", "m", "acc", "type", "modified", "sha256", "total_length", "sha256ToBase64String", "countAssets", "deleteAsset", "setAssetToken", "deleteManyAssets", "deleteFilteredAssets", "getAsset", "getManyAssets", "satelliteUrl", "parseEnv", "userEnv", "satelliteId", "envSatelliteId", "i", "container", "envContainer", "initJuno", "initSatellite", "env", "EnvStore", "loadAuth", "authSubscribe", "initAuthTimeoutWorker", "syncTabsSubscribe", "initAuthBroadcastListener", "o", "onAuthStateChange", "callback", "AuthStore"]
|
|
7
7
|
}
|