diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f42b89b687..840e71fb4f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,6 @@ # The check-basic-integration-tests-success job is designed to ensure that all jobs spun up from the matrix in the basic-integration-tests have succeeded # All Examples TODO restore when https://github.com/demergent-labs/azle/issues/1192 is resolved -# "examples/async_await", # "examples/audio_recorder", # "examples/bitcoin", # "examples/blob_array", @@ -63,32 +62,13 @@ # "examples/optional_types", # "examples/outgoing_http_requests", # "examples/pre_and_post_upgrade", -# "examples/primitive_types", -# "examples/principal", -# "examples/query", -# "examples/randomness", # "examples/rejections", # "examples/robust_imports", # "examples/run_time_errors", # "examples/rust_type_conversions", # "examples/service", -# "examples/simple_erc20", -# "examples/simple_user_accounts", -# "examples/stable_memory", # "examples/stable_structures", -# "examples/timers", # "examples/tuple_types", -# "examples/update" - -# These are the ones that don't work -# "examples/func_types", -# "examples/generics", -# "examples/tuple_types", -# "examples/complex_types", -# "examples/motoko_examples/superheroes", -# "examples/motoko_examples/threshold_ecdsa", -# "examples/run_time_errors", -# "examples/robust_imports", name: Azle Tests on: @@ -134,59 +114,14 @@ jobs: run: | EXAMPLE_DIRECTORIES=$(cat << END [ - "examples/audio_recorder", "examples/async_await", - "examples/bitcoin", - "examples/blob_array", - "examples/bytes", - "examples/call_raw", - "examples/candid_encoding", - "examples/counter", - "examples/complex_init", - "examples/composite_queries", - "examples/cross_canister_calls", - "examples/cycles", - "examples/date", - "examples/ethereum_json_rpc", - "examples/guard_functions", - "examples/heartbeat", - "examples/ic_api", - "examples/imports", - "examples/init", - "examples/inspect_message", - "examples/key_value_store", - "examples/ledger_canister", - "examples/list_of_lists", - "examples/management_canister", - "examples/manual_reply", - "examples/motoko_examples/calc", - "examples/motoko_examples/counter", - "examples/motoko_examples/echo", - "examples/motoko_examples/factorial", - "examples/motoko_examples/hello", - "examples/motoko_examples/hello-world", - "examples/motoko_examples/http_counter", - "examples/motoko_examples/minimal-counter-dapp", - "examples/motoko_examples/persistent-storage", - "examples/motoko_examples/phone-book", - "examples/motoko_examples/quicksort", - "examples/motoko_examples/simple-to-do", - "examples/motoko_examples/whoami", - "examples/notify_raw", - "examples/null_example", - "examples/optional_types", - "examples/pre_and_post_upgrade", - "examples/outgoing_http_requests", "examples/primitive_types", "examples/principal", "examples/query", "examples/randomness", - "examples/rejections", - "examples/service", "examples/simple_erc20", "examples/simple_user_accounts", "examples/stable_memory", - "examples/stable_structures", "examples/timers", "examples/update" ] diff --git a/canisters/management/index.ts b/canisters/management/index.ts index c3ece0e5f4..b4d9f84b4c 100644 --- a/canisters/management/index.ts +++ b/canisters/management/index.ts @@ -1,169 +1,8 @@ -import { - blob, - Principal, - Record, - Service, - update, - Opt, - Vec, - Variant, - candid, - principal, - text, - Null, - Void -} from '../../src/lib_new'; -import { HttpRequestArgs, HttpResponse } from './http_request'; -import { - CanisterStatusArgs, - CanisterStatusResult, - CreateCanisterArgs, - CreateCanisterResult, - DeleteCanisterArgs, - DepositCyclesArgs, - InstallCodeArgs, - ProvisionalCreateCanisterWithCyclesArgs, - ProvisionalCreateCanisterWithCyclesResult, - ProvisionalTopUpCanisterArgs, - StartCanisterArgs, - StopCanisterArgs, - UninstallCodeArgs, - UpdateSettingsArgs -} from './canister_management'; -import { - GetBalanceArgs, - GetCurrentFeePercentilesArgs, - GetUtxosArgs, - GetUtxosResult, - MillisatoshiPerByte, - Satoshi, - SendTransactionArgs -} from './bitcoin'; +import { blob, Principal, Service, update } from '../../src/lib_functional'; -export * from './http_request'; -export * from './canister_management'; -export * from './bitcoin'; - -export class EcdsaCurve extends Variant { - @candid(Null) - secp256k1: Null; -} - -export class KeyId extends Record { - @candid(EcdsaCurve) - curve: EcdsaCurve; - - @candid(text) - name: text; -} - -export class EcdsaPublicKeyArgs extends Record { - @candid(Opt(principal)) - canister_id: Opt; - - @candid(Vec(blob)) - derivation_path: Vec; - - @candid(KeyId) - key_id: KeyId; -} - -export class EcdsaPublicKeyResult extends Record { - @candid(blob) - public_key: blob; - - @candid(blob) - chain_code: blob; -} - -export class SignWithEcdsaArgs extends Record { - @candid(blob) - message_hash: blob; - - @candid(Vec(blob)) - derivation_path: Vec; - - @candid(KeyId) - key_id: KeyId; -} - -export class SignWithEcdsaResult extends Record { - signature: blob; -} - -class ManagementCanister extends Service { - @update([EcdsaPublicKeyArgs], EcdsaPublicKeyResult) - ecdsa_public_key: ( - args: EcdsaPublicKeyArgs - ) => Promise; - - @update([HttpRequestArgs], HttpResponse) - http_request: (args: HttpRequestArgs) => Promise; - - @update([], blob) - raw_rand: () => Promise; - - @update([SignWithEcdsaArgs], SignWithEcdsaResult) - sign_with_ecdsa: (args: SignWithEcdsaArgs) => Promise; - - @update([CreateCanisterArgs], CreateCanisterResult) - create_canister: ( - args: CreateCanisterArgs - ) => Promise; - - @update([UpdateSettingsArgs], Void) - update_settings: (args: UpdateSettingsArgs) => Void; - - @update([InstallCodeArgs], Void) - install_code: (args: InstallCodeArgs) => Void; - - @update([UninstallCodeArgs], Void) - uninstall_code: (args: UninstallCodeArgs) => Void; - - @update([StartCanisterArgs], Void) - start_canister: (args: StartCanisterArgs) => Void; - - @update([StopCanisterArgs], Void) - stop_canister: (args: StopCanisterArgs) => Void; - - @update([CanisterStatusArgs], CanisterStatusResult) - canister_status: (args: CanisterStatusArgs) => CanisterStatusResult; - - @update([DeleteCanisterArgs], Void) - delete_canister: (args: DeleteCanisterArgs) => Void; - - @update([DepositCyclesArgs], Void) - deposit_cycles: (args: DepositCyclesArgs) => Void; - - @update( - [ProvisionalCreateCanisterWithCyclesArgs], - ProvisionalCreateCanisterWithCyclesArgs - ) - provisional_create_canister_with_cycles: ( - args: ProvisionalCreateCanisterWithCyclesArgs - ) => ProvisionalCreateCanisterWithCyclesResult; - - @update([ProvisionalTopUpCanisterArgs], Void) - provisional_top_up_canister: (args: ProvisionalTopUpCanisterArgs) => Void; - - @update([GetBalanceArgs], Satoshi) - bitcoin_get_balance: (args: GetBalanceArgs) => Satoshi; - - @update([GetCurrentFeePercentilesArgs], Vec(MillisatoshiPerByte)) - bitcoin_get_current_fee_percentiles: ( - args: GetCurrentFeePercentilesArgs - ) => Vec; - - @update([GetUtxosArgs], GetUtxosResult) - bitcoin_get_utxos: (args: GetUtxosArgs) => GetUtxosResult; - - @update([SendTransactionArgs], Void) - bitcoin_send_transaction: (args: SendTransactionArgs) => Void; -} - -/** - * A virtual canister with canister and user management functionality - */ -export const managementCanister = new ManagementCanister( +export const managementCanister = Service( + { + raw_rand: update([], blob) + }, Principal.fromText('aaaaa-aa') ); diff --git a/canisters/management/index_classes.ts b/canisters/management/index_classes.ts new file mode 100644 index 0000000000..c3ece0e5f4 --- /dev/null +++ b/canisters/management/index_classes.ts @@ -0,0 +1,169 @@ +import { + blob, + Principal, + Record, + Service, + update, + Opt, + Vec, + Variant, + candid, + principal, + text, + Null, + Void +} from '../../src/lib_new'; +import { HttpRequestArgs, HttpResponse } from './http_request'; +import { + CanisterStatusArgs, + CanisterStatusResult, + CreateCanisterArgs, + CreateCanisterResult, + DeleteCanisterArgs, + DepositCyclesArgs, + InstallCodeArgs, + ProvisionalCreateCanisterWithCyclesArgs, + ProvisionalCreateCanisterWithCyclesResult, + ProvisionalTopUpCanisterArgs, + StartCanisterArgs, + StopCanisterArgs, + UninstallCodeArgs, + UpdateSettingsArgs +} from './canister_management'; +import { + GetBalanceArgs, + GetCurrentFeePercentilesArgs, + GetUtxosArgs, + GetUtxosResult, + MillisatoshiPerByte, + Satoshi, + SendTransactionArgs +} from './bitcoin'; + +export * from './http_request'; +export * from './canister_management'; +export * from './bitcoin'; + +export class EcdsaCurve extends Variant { + @candid(Null) + secp256k1: Null; +} + +export class KeyId extends Record { + @candid(EcdsaCurve) + curve: EcdsaCurve; + + @candid(text) + name: text; +} + +export class EcdsaPublicKeyArgs extends Record { + @candid(Opt(principal)) + canister_id: Opt; + + @candid(Vec(blob)) + derivation_path: Vec; + + @candid(KeyId) + key_id: KeyId; +} + +export class EcdsaPublicKeyResult extends Record { + @candid(blob) + public_key: blob; + + @candid(blob) + chain_code: blob; +} + +export class SignWithEcdsaArgs extends Record { + @candid(blob) + message_hash: blob; + + @candid(Vec(blob)) + derivation_path: Vec; + + @candid(KeyId) + key_id: KeyId; +} + +export class SignWithEcdsaResult extends Record { + signature: blob; +} + +class ManagementCanister extends Service { + @update([EcdsaPublicKeyArgs], EcdsaPublicKeyResult) + ecdsa_public_key: ( + args: EcdsaPublicKeyArgs + ) => Promise; + + @update([HttpRequestArgs], HttpResponse) + http_request: (args: HttpRequestArgs) => Promise; + + @update([], blob) + raw_rand: () => Promise; + + @update([SignWithEcdsaArgs], SignWithEcdsaResult) + sign_with_ecdsa: (args: SignWithEcdsaArgs) => Promise; + + @update([CreateCanisterArgs], CreateCanisterResult) + create_canister: ( + args: CreateCanisterArgs + ) => Promise; + + @update([UpdateSettingsArgs], Void) + update_settings: (args: UpdateSettingsArgs) => Void; + + @update([InstallCodeArgs], Void) + install_code: (args: InstallCodeArgs) => Void; + + @update([UninstallCodeArgs], Void) + uninstall_code: (args: UninstallCodeArgs) => Void; + + @update([StartCanisterArgs], Void) + start_canister: (args: StartCanisterArgs) => Void; + + @update([StopCanisterArgs], Void) + stop_canister: (args: StopCanisterArgs) => Void; + + @update([CanisterStatusArgs], CanisterStatusResult) + canister_status: (args: CanisterStatusArgs) => CanisterStatusResult; + + @update([DeleteCanisterArgs], Void) + delete_canister: (args: DeleteCanisterArgs) => Void; + + @update([DepositCyclesArgs], Void) + deposit_cycles: (args: DepositCyclesArgs) => Void; + + @update( + [ProvisionalCreateCanisterWithCyclesArgs], + ProvisionalCreateCanisterWithCyclesArgs + ) + provisional_create_canister_with_cycles: ( + args: ProvisionalCreateCanisterWithCyclesArgs + ) => ProvisionalCreateCanisterWithCyclesResult; + + @update([ProvisionalTopUpCanisterArgs], Void) + provisional_top_up_canister: (args: ProvisionalTopUpCanisterArgs) => Void; + + @update([GetBalanceArgs], Satoshi) + bitcoin_get_balance: (args: GetBalanceArgs) => Satoshi; + + @update([GetCurrentFeePercentilesArgs], Vec(MillisatoshiPerByte)) + bitcoin_get_current_fee_percentiles: ( + args: GetCurrentFeePercentilesArgs + ) => Vec; + + @update([GetUtxosArgs], GetUtxosResult) + bitcoin_get_utxos: (args: GetUtxosArgs) => GetUtxosResult; + + @update([SendTransactionArgs], Void) + bitcoin_send_transaction: (args: SendTransactionArgs) => Void; +} + +/** + * A virtual canister with canister and user management functionality + */ +export const managementCanister = new ManagementCanister( + Principal.fromText('aaaaa-aa') +); diff --git a/examples/async_await/src/async_await.ts b/examples/async_await/src/async_await.ts index 44066443ef..52c5b25604 100644 --- a/examples/async_await/src/async_await.ts +++ b/examples/async_await/src/async_await.ts @@ -1,19 +1,14 @@ import { blob, ic, Service, update, Void } from 'azle'; import { managementCanister } from 'azle/canisters/management'; -export default class extends Service { - @update([], blob) - async getRandomnessDirectly(): Promise { +export default Service({ + getRandomnessDirectly: update([], blob, async () => { return await ic.call(managementCanister.raw_rand); - } - - @update([], blob) - async getRandomnessIndirectly(): Promise { + }), + getRandomnessIndirectly: update([], blob, async () => { return await getRandomness(); - } - - @update([], blob) - async getRandomnessSuperIndirectly(): Promise { + }), + getRandomnessSuperIndirectly: update([], blob, async () => { const randomness0 = await getRandomnessLevel0(); const randomness1 = await getRandomnessLevel1(); const randomness2 = await getRandomnessLevel2(); @@ -23,13 +18,11 @@ export default class extends Service { ...randomness1, ...randomness2 ]); - } - - @update([], Void) - async returnPromiseVoid(): Promise { + }), + returnPromiseVoid: update([], Void, async () => { await ic.call(managementCanister.raw_rand); - } -} + }) +}); async function getRandomnessLevel0(): Promise { return await getRandomnessLevel1(); diff --git a/examples/guard_functions/src/guards.ts b/examples/guard_functions/src/guards.ts index 773747dd91..5e2dce764c 100644 --- a/examples/guard_functions/src/guards.ts +++ b/examples/guard_functions/src/guards.ts @@ -42,11 +42,6 @@ export function throwCustomError() { ); } -export function preventUpgrades() { - console.log('preventUpgrades called'); - return 'Upgrades to this canister are disabled'; -} - export function returnNonStringErrValue() { console.log('nonStringErrValue called'); throw { badProp: 'Something other than a string' }; diff --git a/examples/primitive_types/src/index.ts b/examples/primitive_types/src/index.ts index 8aecd4d1f0..d2ed955a3e 100644 --- a/examples/primitive_types/src/index.ts +++ b/examples/primitive_types/src/index.ts @@ -22,226 +22,147 @@ import { text } from 'azle'; -export default class extends Service { - @query([], text) - getString(): string { +export default Service({ + getString: query([], text, () => { return 'string'; - } - - @query([text], text) - printString(string: string): string { + }), + printString: query([text], text, (string) => { console.log(typeof string); return string; - } - - @query([], text) - getText(): text { + }), + getText: query([], text, () => { return 'text'; - } - - @query([text], text) - printText(text: text): text { + }), + printText: query([text], text, (text) => { console.log(typeof text); return text; - } - - @query([], float64) - getNumber(): number { + }), + getNumber: query([], float64, () => { return Number.MAX_SAFE_INTEGER; - } - - @query([float64], float64) - printNumber(number: number): number { + }), + printNumber: query([float64], float64, (number) => { console.log(typeof number); return number; - } - - @query([], int) - getInt(): int { + }), + getInt: query([], int, () => { return 170_141_183_460_469_231_731_687_303_715_884_105_727n; - } - - @query([int], int) - printInt(int: int): int { + }), + printInt: query([int], int, (int) => { console.log(typeof int); return int; - } - - @query([], int64) - getInt64(): int64 { + }), + getInt64: query([], int64, () => { return 9_223_372_036_854_775_807n; - } - - @query([int64], int64) - printInt64(int64: int64): int64 { + }), + printInt64: query([int64], int64, (int64) => { console.log(typeof int64); return int64; - } - - @query([], int32) - getInt32(): int32 { + }), + getInt32: query([], int32, () => { return 2_147_483_647; - } - - @query([int32], int32) - printInt32(int32: int32): int32 { + }), + printInt32: query([int32], int32, (int32) => { console.log(typeof int32); return int32; - } - - @query([], int16) - getInt16(): int16 { + }), + getInt16: query([], int16, () => { return 32_767; - } - - @query([int16], int16) - printInt16(int16: int16): int16 { + }), + printInt16: query([int16], int16, (int16) => { console.log(typeof int16); return int16; - } - - @query([], int8) - getInt8(): int8 { + }), + getInt8: query([], int8, () => { return 127; - } - - @query([int8], int8) - printInt8(int8: int8): int8 { + }), + printInt8: query([int8], int8, (int8) => { console.log(typeof int8); return int8; - } - - @query([], nat) - getNat(): nat { + }), + getNat: query([], nat, () => { return 340_282_366_920_938_463_463_374_607_431_768_211_455n; - } - - @query([nat], nat) - printNat(nat: nat): nat { + }), + printNat: query([nat], nat, (nat) => { console.log(typeof nat); return nat; - } - - @query([], nat64) - getNat64(): nat64 { + }), + getNat64: query([], nat64, () => { return 18_446_744_073_709_551_615n; - } - - @query([nat64], nat64) - printNat64(nat64: nat64): nat64 { + }), + printNat64: query([nat64], nat64, (nat64) => { console.log(typeof nat64); return nat64; - } - - @query([], nat32) - getNat32(): nat32 { + }), + getNat32: query([], nat32, () => { return 4_294_967_295; - } - - @query([nat32], nat32) - printNat32(nat32: nat32): nat32 { + }), + printNat32: query([nat32], nat32, (nat32) => { console.log(typeof nat32); return nat32; - } - - @query([], nat16) - getNat16(): nat16 { + }), + getNat16: query([], nat16, () => { return 65_535; - } - - @query([nat16], nat16) - printNat16(nat16: nat16): nat16 { + }), + printNat16: query([nat16], nat16, (nat16) => { console.log(typeof nat16); return nat16; - } - - @query([], nat8) - getNat8(): nat8 { + }), + getNat8: query([], nat8, () => { return 255; - } - - @query([nat8], nat8) - printNat8(nat8: nat8): nat8 { + }), + printNat8: query([nat8], nat8, (nat8) => { console.log(typeof nat8); return nat8; - } - - @query([], float64) - getFloat64(): float64 { + }), + getFloat64: query([], float64, () => { return Math.E; - } - - @query([float64], float64) - printFloat64(float64: float64): float64 { + }), + printFloat64: query([float64], float64, (float64) => { console.log(typeof float64); return float64; - } - - @query([], float32) - getFloat32(): float32 { + }), + getFloat32: query([], float32, () => { return Math.PI; - } - - @query([float32], float32) - printFloat32(float32: float32): float32 { + }), + printFloat32: query([float32], float32, (float32) => { console.log(typeof float32); return float32; - } - - @query([], bool) - getBool(): bool { + }), + getBool: query([], bool, () => { return true; - } - - @query([bool], bool) - printBool(bool: bool): bool { + }), + printBool: query([bool], bool, (bool) => { console.log(typeof bool); return bool; - } - - @query([], principal) - getPrincipal(): Principal { + }), + getPrincipal: query([], principal, () => { return Principal.fromText('rrkah-fqaaa-aaaaa-aaaaq-cai'); - } - - @query([principal], principal) - printPrincipal(principal: Principal): Principal { + }), + printPrincipal: query([principal], principal, (principal) => { console.log(typeof principal); return principal; - } - - @query([], Null) - getNull(): Null { + }), + getNull: query([], Null, () => { return null; - } - - @query([Null], Null) - printNull(Null: Null): Null { + }), + printNull: query([Null], Null, (Null) => { console.log(typeof Null); return Null; - } - - @query([], reserved) - getReserved(): reserved { + }), + getReserved: query([], reserved, () => { return 'anything'; - } - - @query([reserved], reserved) - printReserved(reserved: reserved): reserved { + }), + printReserved: query([reserved], reserved, (reserved) => { console.log(typeof reserved); return reserved; - } - - @query([], empty) - getEmpty(): empty { + }), + getEmpty: query([], empty, () => { throw 'Anything you want'; - } - + }), // Note: It is impossible to call this function because it requires an argument // but there is no way to pass an "empty" value as an argument. - @query([empty], empty) - printEmpty(empty: empty): empty { + printEmpty: query([empty], empty, (empty) => { console.log(typeof empty); throw 'Anything you want'; - } -} + }) +}); diff --git a/examples/principal/src/index.ts b/examples/principal/src/index.ts index 8ffac6b1f7..66028d8a4c 100644 --- a/examples/principal/src/index.ts +++ b/examples/principal/src/index.ts @@ -1,93 +1,63 @@ import { blob, - candid, Null, Principal, + principal, query, Record, - Variant, Service, - principal, - text + text, + Variant } from 'azle'; -class User extends Record { - @candid(principal) - id: Principal; - - @candid(text) - username: text; -} - -class Status extends Variant { - @candid(principal) - WaitingOn?: Principal; +const User = Record({ + id: principal, + username: text +}); - @candid(Null) - Online?: Null; +const Status = Variant({ + WaitingOn: principal, + Online: Null, + Offline: Null +}); - @candid(Null) - Offline?: Null; -} - -export default class extends Service { - @query([], principal) - principalReturnType(): Principal { +export default Service({ + principalReturnType: query([], principal, () => { return Principal.fromText('aaaaa-aa'); - } - - @query([principal], principal) - principalParam(principal: Principal): Principal { + }), + principalParam: query([principal], principal, (principal) => { return principal; - } - - @query([], User) - principalInRecord(): User { + }), + principalInRecord: query([], User, () => { return { id: Principal.fromText('aaaaa-aa'), username: 'lastmjs' }; - } - - @query([], Status) - principalInVariant(): Status { + }), + principalInVariant: query([], Status, () => { return { WaitingOn: Principal.fromText('aaaaa-aa') }; - } - - @query([text], principal) - principalFromHex(principalHex: text): Principal { + }), + principalFromHex: query([text], principal, (principalHex) => { return Principal.fromHex(principalHex); - } - - @query([text], principal) - principalFromText(principalText: text): Principal { + }), + principalFromText: query([text], principal, (principalText) => { return Principal.fromText(principalText); - } - - @query([blob], principal) - principalFromBlob(principalBytes: blob): Principal { + }), + principalFromBlob: query([blob], principal, (principalBytes) => { return Principal.fromUint8Array(Uint8Array.from(principalBytes)); - } - - @query([principal], text) - principalToHex(principal: Principal): text { + }), + principalToHex: query([principal], text, (principal) => { return principal.toHex(); - } - - @query([principal], text) - principalToText(principal: Principal): text { + }), + principalToText: query([principal], text, (principal) => { return principal.toText(); - } - - @query([principal], blob) - principalToBlob(principal: Principal): blob { + }), + principalToBlob: query([principal], blob, (principal) => { return principal.toUint8Array(); - } - - @query([blob], principal) - principalSelfAuthenticating(publicKey: blob): Principal { + }), + principalSelfAuthenticating: query([blob], principal, (publicKey) => { return Principal.selfAuthenticating(publicKey); - } -} + }) +}); diff --git a/examples/query/src/index.ts b/examples/query/src/index.ts index ea93f039fe..339988b81e 100644 --- a/examples/query/src/index.ts +++ b/examples/query/src/index.ts @@ -1,8 +1,7 @@ import { query, Service, text } from 'azle'; -export default class extends Service { - @query([], text) - simpleQuery(): text { +export default Service({ + simpleQuery: query([], text, () => { return 'This is a query function'; - } -} + }) +}); diff --git a/examples/randomness/src/index.ts b/examples/randomness/src/index.ts index 13aae7d120..dc8e94e417 100644 --- a/examples/randomness/src/index.ts +++ b/examples/randomness/src/index.ts @@ -1,8 +1,7 @@ import { float64, Service, update } from 'azle'; -export default class extends Service { - @update([], float64) - randomNumber(): float64 { +export default Service({ + randomNumber: update([], float64, () => { return Math.random(); - } -} + }) +}); diff --git a/examples/simple_erc20/src/index.ts b/examples/simple_erc20/src/index.ts index 94159b9a58..ca2c2949c0 100644 --- a/examples/simple_erc20/src/index.ts +++ b/examples/simple_erc20/src/index.ts @@ -21,62 +21,54 @@ let state: State = { totalSupply: 0n }; -export default class extends Service { - @update([text, text, text, nat64], bool) - initializeSupply( - name: text, - originalAddress: text, - ticker: text, - totalSupply: nat64 - ): bool { - state = { - ...state, - accounts: { - [originalAddress]: { - address: originalAddress, - balance: totalSupply - } - }, - name, - ticker, - totalSupply - }; - - return true; - } - - @update([text, text, nat64], bool) - transfer(fromAddress: text, toAddress: text, amount: nat64): bool { - if (state.accounts[toAddress] === undefined) { - state.accounts[toAddress] = { - address: toAddress, - balance: 0n +export default Service({ + initializeSupply: update( + [text, text, text, nat64], + bool, + (name, originalAddress, ticker, totalSupply) => { + state = { + ...state, + accounts: { + [originalAddress]: { + address: originalAddress, + balance: totalSupply + } + }, + name, + ticker, + totalSupply }; - } - state.accounts[fromAddress].balance -= amount; - state.accounts[toAddress].balance += amount; + return true; + } + ), + transfer: update( + [text, text, nat64], + bool, + (fromAddress, toAddress, amount) => { + if (state.accounts[toAddress] === undefined) { + state.accounts[toAddress] = { + address: toAddress, + balance: 0n + }; + } - return true; - } + state.accounts[fromAddress].balance -= amount; + state.accounts[toAddress].balance += amount; - @query([text], nat64) - balance(address: text): nat64 { + return true; + } + ), + balance: query([text], nat64, (address) => { return state.accounts[address]?.balance ?? 0n; - } - - @query([], text) - ticker(): text { + }), + ticker: query([], text, () => { return state.ticker; - } - - @query([], text) - name(): text { + }), + name: query([], text, () => { return state.name; - } - - @query([], nat64) - totalSupply(): nat64 { + }), + totalSupply: query([], nat64, () => { return state.totalSupply; - } -} + }) +}); diff --git a/examples/simple_user_accounts/src/index.ts b/examples/simple_user_accounts/src/index.ts index edff5b15fb..9b532416aa 100644 --- a/examples/simple_user_accounts/src/index.ts +++ b/examples/simple_user_accounts/src/index.ts @@ -1,5 +1,4 @@ import { - candid, None, Opt, query, @@ -13,46 +12,36 @@ import { type Db = { users: { - [id: string]: User; + [id: string]: typeof User; }; }; -class User extends Record { - @candid(text) - id: text; - - @candid(text) - username: text; -} - -export default class extends Service { - db: Db = { - users: {} - }; +let db: Db = { + users: {} +}; - @query([text], Opt(User)) - getUserById(id: text): Opt { - const userOrUndefined = this.db.users[id]; +const User = Record({ + id: text, + username: text +}); +export default Service({ + getUserById: query([text], Opt(User), (id) => { + const userOrUndefined = db.users[id]; return userOrUndefined ? Some(userOrUndefined) : None; - } - - @query([], Vec(User)) - getAllUsers(): Vec { - return Object.values(this.db.users); - } - - @update([text], User) - createUser(username: text): User { - const id = Object.keys(this.db.users).length.toString(); - - const user = { + }), + getAllUsers: query([], Vec(User), () => { + return Object.values(db.users); + }), + createUser: update([text], User, (username) => { + const id = Object.keys(db.users).length.toString(); + const user: typeof User = { id, username }; - this.db.users[id] = user; + db.users[id] = user; return user; - } -} + }) +}); diff --git a/examples/stable_memory/src/index.ts b/examples/stable_memory/src/index.ts index 1f781d5dc5..aef3b7e2bf 100644 --- a/examples/stable_memory/src/index.ts +++ b/examples/stable_memory/src/index.ts @@ -1,48 +1,31 @@ -import { blob, ic, nat32, nat64, query, update, Void } from 'azle'; +import { blob, ic, nat32, nat64, query, Service, update, Void } from 'azle'; -export default class { - @query([], nat32) - stableSize(): nat32 { +export default Service({ + stableSize: query([], nat32, () => { return ic.stableSize(); - } - - @query([], nat64) - stable64Size(): nat64 { + }), + stable64Size: query([], nat64, () => { return ic.stable64Size(); - } - - @update([nat32], nat32) - stableGrow(newPages: nat32): nat32 { + }), + stableGrow: update([nat32], nat32, (newPages) => { return ic.stableGrow(newPages); - } - - @update([nat64], nat64) - stable64Grow(newPages: nat64): nat64 { + }), + stable64Grow: update([nat64], nat64, (newPages) => { return ic.stable64Grow(newPages); - } - - @update([nat32, blob], Void) - stableWrite(offset: nat32, buf: blob): Void { + }), + stableWrite: update([nat32, blob], Void, (offset, buf) => { ic.stableWrite(offset, buf); - } - - @update([nat64, blob], Void) - stable64Write(offset: nat64, buf: blob): Void { + }), + stable64Write: update([nat64, blob], Void, (offset, buf) => { ic.stable64Write(offset, buf); - } - - @query([nat32, nat32], blob) - stableRead(offset: nat32, length: nat32): blob { + }), + stableRead: query([nat32, nat32], blob, (offset, length) => { return ic.stableRead(offset, length); - } - - @query([nat64, nat64], blob) - stable64Read(offset: nat64, length: nat64): blob { + }), + stable64Read: query([nat64, nat64], blob, (offset, length) => { return ic.stable64Read(offset, length); - } - - @query([], blob) - stableBytes(): blob { + }), + stableBytes: query([], blob, () => { return ic.stableBytes(); - } -} + }) +}); diff --git a/examples/timers/src/timers.ts b/examples/timers/src/timers.ts index 00415f8002..9646fada1e 100644 --- a/examples/timers/src/timers.ts +++ b/examples/timers/src/timers.ts @@ -1,11 +1,9 @@ import { blob, bool, - candid, Duration, ic, int8, - nat64, query, Record, Service, @@ -16,91 +14,66 @@ import { } from 'azle'; import { managementCanister } from 'azle/canisters/management'; -class StatusReport extends Record { - @candid(bool) - single: bool; - - @candid(int8) - inline: int8; - - @candid(text) - capture: text; - - @candid(int8) - repeat: int8; - - @candid(blob) - singleCrossCanister: blob; - - @candid(blob) - repeatCrossCanister: blob; -} - -class TimerIds extends Record { - @candid(nat64) - single: TimerId; - - @candid(nat64) - inline: TimerId; - - @candid(nat64) - capture: TimerId; - - @candid(nat64) - repeat: TimerId; - - @candid(nat64) - singleCrossCanister: TimerId; - - @candid(nat64) - repeatCrossCanister: TimerId; -} - -export default class extends Service { - status: StatusReport = { - single: false, - inline: 0, - capture: '', - repeat: 0, - singleCrossCanister: Uint8Array.from([]), - repeatCrossCanister: Uint8Array.from([]) - }; - - @update([nat64], Void) - clearTimer(timerId: TimerId): Void { +const StatusReport = Record({ + single: bool, + inline: int8, + capture: text, + repeat: int8, + singleCrossCanister: blob, + repeatCrossCanister: blob +}); + +const TimerIds = Record({ + single: TimerId, + inline: TimerId, + capture: TimerId, + repeat: TimerId, + singleCrossCanister: TimerId, + repeatCrossCanister: TimerId +}); + +let statusReport: typeof StatusReport = { + single: false, + inline: 0, + capture: '', + repeat: 0, + singleCrossCanister: Uint8Array.from([]), + repeatCrossCanister: Uint8Array.from([]) +}; + +export default Service({ + clearTimer: update([TimerId], Void, (timerId) => { ic.clearTimer(timerId); console.log(`timer ${timerId} cancelled`); - } - - @update([nat64, nat64], TimerIds) - setTimers(delay: Duration, interval: Duration): TimerIds { + }), + setTimers: update([Duration, Duration], TimerIds, (delay, interval) => { const capturedValue = '🚩'; - const singleId = ic.setTimer(delay, this.oneTimeTimerCallback); + const singleId = ic.setTimer(delay, oneTimeTimerCallback); const inlineId = ic.setTimer(delay, () => { - this.status.inline = 1; + statusReport.inline = 1; console.log('Inline timer called'); }); const captureId = ic.setTimer(delay, () => { - this.status.capture = capturedValue; + statusReport.capture = capturedValue; console.log(`Timer captured value ${capturedValue}`); }); const repeatId = ic.setTimerInterval(interval, () => { - this.status.repeat++; - console.log(`Repeating timer. Call ${this.status.repeat}`); + statusReport.repeat++; + console.log(`Repeating timer. Call ${statusReport.repeat}`); }); const singleCrossCanisterId = ic.setTimer( delay, - this.singleCrossCanisterTimerCallback + singleCrossCanisterTimerCallback ); const repeatCrossCanisterId = ic.setTimerInterval( interval, - this.repeatCrossCanisterTimerCallback + repeatCrossCanisterTimerCallback ); return { @@ -111,32 +84,30 @@ export default class extends Service { singleCrossCanister: singleCrossCanisterId, repeatCrossCanister: repeatCrossCanisterId }; - } - - @query([], StatusReport) - statusReport(): StatusReport { - return this.status; - } - - oneTimeTimerCallback(): Void { - this.status.single = true; - console.log('oneTimeTimerCallback called'); - } + }), + statusReport: query([], StatusReport, () => { + return statusReport; + }) +}); + +function oneTimeTimerCallback() { + statusReport.single = true; + console.log('oneTimeTimerCallback called'); +} - async singleCrossCanisterTimerCallback(): Promise { - console.log('singleCrossCanisterTimerCallback'); +async function singleCrossCanisterTimerCallback() { + console.log('singleCrossCanisterTimerCallback'); - this.status.singleCrossCanister = await ic.call( - managementCanister.raw_rand - ); - } + statusReport.singleCrossCanister = await ic.call( + managementCanister.raw_rand + ); +} - async repeatCrossCanisterTimerCallback(): Promise { - console.log('repeatCrossCanisterTimerCallback'); +async function repeatCrossCanisterTimerCallback() { + console.log('repeatCrossCanisterTimerCallback'); - this.status.repeatCrossCanister = Uint8Array.from([ - ...this.status.repeatCrossCanister, - ...(await ic.call(managementCanister.raw_rand)) - ]); - } + statusReport.repeatCrossCanister = Uint8Array.from([ + ...statusReport.repeatCrossCanister, + ...(await ic.call(managementCanister.raw_rand)) + ]); } diff --git a/examples/timers/test/tests.ts b/examples/timers/test/tests.ts index 641eddf6b5..50245832f2 100644 --- a/examples/timers/test/tests.ts +++ b/examples/timers/test/tests.ts @@ -1,8 +1,8 @@ import { ActorSubclass } from '@dfinity/agent'; import { Test } from 'azle/test'; -import { _SERVICE, TimerIds } from './dfx_generated/timers/timers.did'; +import { _SERVICE, rec_0 } from './dfx_generated/timers/timers.did'; -let timerIds: TimerIds = { +let timerIds: rec_0 = { single: 0n, inline: 0n, capture: 0n, @@ -83,11 +83,11 @@ export function getTests(timersCanister: ActorSubclass<_SERVICE>): Test[] { name: 'cancel the repeated timers', test: async () => { if (timerIds.repeat === undefined) { - return { err: 'repeatedTimerId was never stored' }; + return { Err: 'repeatedTimerId was never stored' }; } if (timerIds.repeatCrossCanister === undefined) { - return { err: 'repeatCrossCanisterId was never stored' }; + return { Err: 'repeatCrossCanisterId was never stored' }; } await Promise.all([ diff --git a/examples/update/src/index.ts b/examples/update/src/index.ts index cbe6cf29aa..e53ee6478e 100644 --- a/examples/update/src/index.ts +++ b/examples/update/src/index.ts @@ -1,15 +1,12 @@ -import { query, text, update, Void } from 'azle'; +import { query, Service, text, update, Void } from 'azle'; let currentMessage: string = ''; -export default class { - @query([], text) - getCurrentMessage(): text { +export default Service({ + getCurrentMessage: query([], text, () => { return currentMessage; - } - - @update([text], Void) - simpleUpdate(message: text): Void { + }), + simpleUpdate: update([text], Void, (message) => { currentMessage = message; - } -} + }) +}); diff --git a/package-lock.json b/package-lock.json index e6702c00dd..0ab2964d1f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,15 +11,15 @@ "dependencies": { "@dfinity/candid": "github:demergent-labs/candid", "@dfinity/principal": "^0.19.0", - "@swc/core": "1.3.81", + "@swc/core": "^1.3.86", "azle-syn": "0.0.0", "buffer": "^6.0.3", - "esbuild": "0.14.25", + "esbuild": "^0.19.3", "fs-extra": "10.0.1", "js-sha256": "0.9.0", "text-encoding": "0.7.0", "ts-node": "10.3.1", - "typescript": "4.4.4", + "typescript": "^5.2.2", "uuid": "^9.0.0" }, "bin": { @@ -32,7 +32,7 @@ "eslint-config-prettier": "8.5.0", "husky": "7.0.4", "lint-staged": "12.3.7", - "prettier": "2.6.1" + "prettier": "^3.0.3" } }, "node_modules/@cspotcode/source-map-consumer": { @@ -70,6 +70,336 @@ "@noble/hashes": "^1.3.1" } }, + "node_modules/@esbuild/android-arm": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.3.tgz", + "integrity": "sha512-Lemgw4io4VZl9GHJmjiBGzQ7ONXRfRPHcUEerndjwiSkbxzrpq0Uggku5MxxrXdwJ+pTj1qyw4jwTu7hkPsgIA==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.3.tgz", + "integrity": "sha512-w+Akc0vv5leog550kjJV9Ru+MXMR2VuMrui3C61mnysim0gkFCPOUTAfzTP0qX+HpN9Syu3YA3p1hf3EPqObRw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.3.tgz", + "integrity": "sha512-FKQJKkK5MXcBHoNZMDNUAg1+WcZlV/cuXrWCoGF/TvdRiYS4znA0m5Il5idUwfxrE20bG/vU1Cr5e1AD6IEIjQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.3.tgz", + "integrity": "sha512-kw7e3FXU+VsJSSSl2nMKvACYlwtvZB8RUIeVShIEY6PVnuZ3c9+L9lWB2nWeeKWNNYDdtL19foCQ0ZyUL7nqGw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.3.tgz", + "integrity": "sha512-tPfZiwF9rO0jW6Jh9ipi58N5ZLoSjdxXeSrAYypy4psA2Yl1dAMhM71KxVfmjZhJmxRjSnb29YlRXXhh3GqzYw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.3.tgz", + "integrity": "sha512-ERDyjOgYeKe0Vrlr1iLrqTByB026YLPzTytDTz1DRCYM+JI92Dw2dbpRHYmdqn6VBnQ9Bor6J8ZlNwdZdxjlSg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.3.tgz", + "integrity": "sha512-nXesBZ2Ad1qL+Rm3crN7NmEVJ5uvfLFPLJev3x1j3feCQXfAhoYrojC681RhpdOph8NsvKBBwpYZHR7W0ifTTA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.3.tgz", + "integrity": "sha512-zr48Cg/8zkzZCzDHNxXO/89bf9e+r4HtzNUPoz4GmgAkF1gFAFmfgOdCbR8zMbzFDGb1FqBBhdXUpcTQRYS1cQ==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.3.tgz", + "integrity": "sha512-qXvYKmXj8GcJgWq3aGvxL/JG1ZM3UR272SdPU4QSTzD0eymrM7leiZH77pvY3UetCy0k1xuXZ+VPvoJNdtrsWQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.3.tgz", + "integrity": "sha512-7XlCKCA0nWcbvYpusARWkFjRQNWNGlt45S+Q18UeS///K6Aw8bB2FKYe9mhVWy/XLShvCweOLZPrnMswIaDXQA==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.3.tgz", + "integrity": "sha512-qGTgjweER5xqweiWtUIDl9OKz338EQqCwbS9c2Bh5jgEH19xQ1yhgGPNesugmDFq+UUSDtWgZ264st26b3de8A==", + "cpu": [ + "loong64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.3.tgz", + "integrity": "sha512-gy1bFskwEyxVMFRNYSvBauDIWNggD6pyxUksc0MV9UOBD138dKTzr8XnM2R4mBsHwVzeuIH8X5JhmNs2Pzrx+A==", + "cpu": [ + "mips64el" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.3.tgz", + "integrity": "sha512-UrYLFu62x1MmmIe85rpR3qou92wB9lEXluwMB/STDzPF9k8mi/9UvNsG07Tt9AqwPQXluMQ6bZbTzYt01+Ue5g==", + "cpu": [ + "ppc64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.3.tgz", + "integrity": "sha512-9E73TfyMCbE+1AwFOg3glnzZ5fBAFK4aawssvuMgCRqCYzE0ylVxxzjEfut8xjmKkR320BEoMui4o/t9KA96gA==", + "cpu": [ + "riscv64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.3.tgz", + "integrity": "sha512-LlmsbuBdm1/D66TJ3HW6URY8wO6IlYHf+ChOUz8SUAjVTuaisfuwCOAgcxo3Zsu3BZGxmI7yt//yGOxV+lHcEA==", + "cpu": [ + "s390x" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.3.tgz", + "integrity": "sha512-ogV0+GwEmvwg/8ZbsyfkYGaLACBQWDvO0Kkh8LKBGKj9Ru8VM39zssrnu9Sxn1wbapA2qNS6BiLdwJZGouyCwQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.3.tgz", + "integrity": "sha512-o1jLNe4uzQv2DKXMlmEzf66Wd8MoIhLNO2nlQBHLtWyh2MitDG7sMpfCO3NTcoTMuqHjfufgUQDFRI5C+xsXQw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.3.tgz", + "integrity": "sha512-AZJCnr5CZgZOdhouLcfRdnk9Zv6HbaBxjcyhq0StNcvAdVZJSKIdOiPB9az2zc06ywl0ePYJz60CjdKsQacp5Q==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.3.tgz", + "integrity": "sha512-Acsujgeqg9InR4glTRvLKGZ+1HMtDm94ehTIHKhJjFpgVzZG9/pIcWW/HA/DoMfEyXmANLDuDZ2sNrWcjq1lxw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.3.tgz", + "integrity": "sha512-FSrAfjVVy7TifFgYgliiJOyYynhQmqgPj15pzLyJk8BUsnlWNwP/IAy6GAiB1LqtoivowRgidZsfpoYLZH586A==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.3.tgz", + "integrity": "sha512-xTScXYi12xLOWZ/sc5RBmMN99BcXp/eEf7scUC0oeiRoiT5Vvo9AycuqCp+xdpDyAU+LkrCqEpUS9fCSZF8J3Q==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.3.tgz", + "integrity": "sha512-FbUN+0ZRXsypPyWE2IwIkVjDkDnJoMJARWOcFZn4KPPli+QnKqF0z1anvfaYe3ev5HFCpRDLLBDHyOALLppWHw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@eslint/eslintrc": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.1.tgz", @@ -122,9 +452,9 @@ } }, "node_modules/@swc/core": { - "version": "1.3.81", - "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.3.81.tgz", - "integrity": "sha512-jaKz72JIuPJQXSwSEzF6g3OBIx0IPBfgJHI9hA2jiKnfxJ1EWDd2S33NpU/HfgUCZ822aPmYuHvUhoDj3uauyg==", + "version": "1.3.86", + "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.3.86.tgz", + "integrity": "sha512-bEXUtm37bcmJ3q+geG7Zy4rJNUzpxalXQUrrqX1ZoGj3HRtzdeVZ0L/um3fG2j16qe61t8TX/OIZ2G6j6dkG/w==", "hasInstallScript": true, "dependencies": { "@swc/types": "^0.1.4" @@ -137,16 +467,16 @@ "url": "https://opencollective.com/swc" }, "optionalDependencies": { - "@swc/core-darwin-arm64": "1.3.81", - "@swc/core-darwin-x64": "1.3.81", - "@swc/core-linux-arm-gnueabihf": "1.3.81", - "@swc/core-linux-arm64-gnu": "1.3.81", - "@swc/core-linux-arm64-musl": "1.3.81", - "@swc/core-linux-x64-gnu": "1.3.81", - "@swc/core-linux-x64-musl": "1.3.81", - "@swc/core-win32-arm64-msvc": "1.3.81", - "@swc/core-win32-ia32-msvc": "1.3.81", - "@swc/core-win32-x64-msvc": "1.3.81" + "@swc/core-darwin-arm64": "1.3.86", + "@swc/core-darwin-x64": "1.3.86", + "@swc/core-linux-arm-gnueabihf": "1.3.86", + "@swc/core-linux-arm64-gnu": "1.3.86", + "@swc/core-linux-arm64-musl": "1.3.86", + "@swc/core-linux-x64-gnu": "1.3.86", + "@swc/core-linux-x64-musl": "1.3.86", + "@swc/core-win32-arm64-msvc": "1.3.86", + "@swc/core-win32-ia32-msvc": "1.3.86", + "@swc/core-win32-x64-msvc": "1.3.86" }, "peerDependencies": { "@swc/helpers": "^0.5.0" @@ -158,9 +488,9 @@ } }, "node_modules/@swc/core-darwin-arm64": { - "version": "1.3.81", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.81.tgz", - "integrity": "sha512-uc8/hpS5KXrMo6IvdDC/tpmns6rYVYOmf+t2Zh4dNf6fsfQ4kQVyJErD0MtJ5pykZWd/kCPD5NF/FyRQ5xfSfw==", + "version": "1.3.86", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.86.tgz", + "integrity": "sha512-hMvSDms0sJJHNtRa3Vhmr9StWN1vmikbf5VE0IZUYGnF1/JZTkXU1h6CdNUY4Hr6i7uCZjH6BEhxFHX1JtKV4w==", "cpu": [ "arm64" ], @@ -173,9 +503,9 @@ } }, "node_modules/@swc/core-darwin-x64": { - "version": "1.3.81", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.3.81.tgz", - "integrity": "sha512-GSS4b18cUKyZXY8vgZBOS7ERFXYmHX7O8c2ZbV9YLCz7AAQ71EtlBrO8N7/Gzq2Etea3CVFxPqnKB1wzVWVpUA==", + "version": "1.3.86", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.3.86.tgz", + "integrity": "sha512-Jro6HVH4uSOBM7tTDaQNKLNc8BJV7n+SO+Ft2HAZINyeKJS/8MfEYneG7Vmqg18gv00c6dz9AOCcyz+BR7BFkQ==", "cpu": [ "x64" ], @@ -188,9 +518,9 @@ } }, "node_modules/@swc/core-linux-arm-gnueabihf": { - "version": "1.3.81", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.81.tgz", - "integrity": "sha512-rwVheKf4RogHSap+QDnnCvqCE1k2x63Lhg6XOr0A2/12vDvHXLzVfqgn2ox69CmD0GfqVQ3g56qAfi693njvUg==", + "version": "1.3.86", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.86.tgz", + "integrity": "sha512-wYB9m0pzXJVSzedXSl4JwS3gKtvcPinpe9MbkddezpqL7OjyDP6pHHW9qIucsfgCrtMtbPC2nqulXLPtAAyIjw==", "cpu": [ "arm" ], @@ -203,9 +533,9 @@ } }, "node_modules/@swc/core-linux-arm64-gnu": { - "version": "1.3.81", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.81.tgz", - "integrity": "sha512-M+cNSSu8z573sDLbm2llRlp32EeoIymZ1PVQNYFWowDvgAbgpU7Cxqzr4Qb8D/p6bglWDLb32fD1KuPTnrvYkA==", + "version": "1.3.86", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.86.tgz", + "integrity": "sha512-fR44IyK5cdCaO8cC++IEH0Jn03tWnunJnjzA99LxlE5TRInSIOvFm+g5OSUQZDAvEXmQ38sd31LO2HOoDS1Edw==", "cpu": [ "arm64" ], @@ -218,9 +548,9 @@ } }, "node_modules/@swc/core-linux-arm64-musl": { - "version": "1.3.81", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.81.tgz", - "integrity": "sha512-6Ncm6c9qOZAK4wwQHXUS3Zo6B5kUmgfN7kv/qZPMbbOK5TRK5TKcM4HmBzSXVVDq0/12vev8x65ICmwPuB5IpA==", + "version": "1.3.86", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.86.tgz", + "integrity": "sha512-EUPfdbK4dUk/nkX3Vmv/47XH+DqHOa9JI0CTthvJ8/ZXei1MKDUsUc+tI1zMQX2uCuSkSWsEIEpCmA0tMwFhtw==", "cpu": [ "arm64" ], @@ -233,9 +563,9 @@ } }, "node_modules/@swc/core-linux-x64-gnu": { - "version": "1.3.81", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.81.tgz", - "integrity": "sha512-MYPQTW2yh7A+Od0LcNu79SG6BzCW/ktoq8qRGEwxnohRPlW9Fb0zuGbi4+l023O96W2K4V7tIWmmlKvcZAvP9w==", + "version": "1.3.86", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.86.tgz", + "integrity": "sha512-snVZZWv8XgNVaKrTxtO3rUN+BbbB6I8Fqwe8zM/DWGJ096J13r89doQ48x5ZyO+bW4D48eZIWP5pdfSW7oBE3w==", "cpu": [ "x64" ], @@ -248,9 +578,9 @@ } }, "node_modules/@swc/core-linux-x64-musl": { - "version": "1.3.81", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.81.tgz", - "integrity": "sha512-EYYl/RrkEAMS2fk445V4xJMUXcrbjIJ9B3ACK/tsz1+UcML8Kpg6TvCzlwIdxY8f2oO+FhNC0CALNN31Asgfzg==", + "version": "1.3.86", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.86.tgz", + "integrity": "sha512-PnnksUJymEJkdnbV2orOSOSB441UqsxYbJge9zbr5UTRXUfWO3eFRV0iTBegjTlOQGbW6yN+YRSDkenTbmCI6g==", "cpu": [ "x64" ], @@ -263,9 +593,9 @@ } }, "node_modules/@swc/core-win32-arm64-msvc": { - "version": "1.3.81", - "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.81.tgz", - "integrity": "sha512-n4tqeuFQXnn2fXVrcy3DVUtDrdFImQYYyY9kJPy4y1MXjeJ1l6/6wx9y+Yowpcnmvpk4JvpKMe4x8r/4rOJjsg==", + "version": "1.3.86", + "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.86.tgz", + "integrity": "sha512-XlGEGyHwLndm08VvgeAPGj40L+Hx575MQC+2fsyB1uSNUN+uf7fvke+wc7k50a92CaQe/8foLyIR5faayozEJA==", "cpu": [ "arm64" ], @@ -278,9 +608,9 @@ } }, "node_modules/@swc/core-win32-ia32-msvc": { - "version": "1.3.81", - "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.81.tgz", - "integrity": "sha512-XjRxp980/bs11z5jZbWP8VazoCp5sESo8+LxxUUsyENcbfAhFtjaGZTuFY4CSV1gohGAaMLnSlg5bUc+4TLz8A==", + "version": "1.3.86", + "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.86.tgz", + "integrity": "sha512-U1BhZa1x9yn+wZGTQmt1cYR79a0FzW/wL6Jas1Pn0bykKLxdRU4mCeZt2P+T3buLm8jr8LpPWiCrbvr658PzwA==", "cpu": [ "ia32" ], @@ -293,9 +623,9 @@ } }, "node_modules/@swc/core-win32-x64-msvc": { - "version": "1.3.81", - "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.81.tgz", - "integrity": "sha512-P/+TBWnYna0QIKWtq02MB/ICdsO5rsI5jwOyhzzID9rl7DRlMmXVqBcVmlnJFEJoEkFYJIlORByMNmSv1YkOqw==", + "version": "1.3.86", + "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.86.tgz", + "integrity": "sha512-wRoQUajqpE3wITHhZVj/6BPu/QwHriFHLHuJA+9y6PeGtUtTmntL42aBKXIFhfL767dYFtohyNg1uZ9eqbGyGQ==", "cpu": [ "x64" ], @@ -626,457 +956,159 @@ "string-width": "^5.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/colorette": { - "version": "2.0.16", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.16.tgz", - "integrity": "sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g==", - "dev": true - }, - "node_modules/commander": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", - "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", - "dev": true, - "engines": { - "node": ">= 12" - } - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "node_modules/create-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==" - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true - }, - "node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true - }, - "node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true - }, - "node_modules/esbuild": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.25.tgz", - "integrity": "sha512-4JHEIOMNFvK09ziiL+iVmldIhLbn49V4NAVo888tcGFKedEZY/Y8YapfStJ6zSE23tzYPKxqKwQBnQoIO0BI/Q==", - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "esbuild-android-64": "0.14.25", - "esbuild-android-arm64": "0.14.25", - "esbuild-darwin-64": "0.14.25", - "esbuild-darwin-arm64": "0.14.25", - "esbuild-freebsd-64": "0.14.25", - "esbuild-freebsd-arm64": "0.14.25", - "esbuild-linux-32": "0.14.25", - "esbuild-linux-64": "0.14.25", - "esbuild-linux-arm": "0.14.25", - "esbuild-linux-arm64": "0.14.25", - "esbuild-linux-mips64le": "0.14.25", - "esbuild-linux-ppc64le": "0.14.25", - "esbuild-linux-riscv64": "0.14.25", - "esbuild-linux-s390x": "0.14.25", - "esbuild-netbsd-64": "0.14.25", - "esbuild-openbsd-64": "0.14.25", - "esbuild-sunos-64": "0.14.25", - "esbuild-windows-32": "0.14.25", - "esbuild-windows-64": "0.14.25", - "esbuild-windows-arm64": "0.14.25" - } - }, - "node_modules/esbuild-android-64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.25.tgz", - "integrity": "sha512-L5vCUk7TzFbBnoESNoXjU3x9+/+7TDIE/1mTfy/erAfvZAqC+S3sp/Qa9wkypFMcFvN9FzvESkTlpeQDolREtQ==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-android-arm64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.25.tgz", - "integrity": "sha512-4jv5xPjM/qNm27T5j3ZEck0PvjgQtoMHnz4FzwF5zNP56PvY2CT0WStcAIl6jNlsuDdN63rk2HRBIsO6xFbcFw==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-darwin-64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.25.tgz", - "integrity": "sha512-TGp8tuudIxOyWd1+8aYPxQmC1ZQyvij/AfNBa35RubixD0zJ1vkKHVAzo0Zao1zcG6pNqiSyzfPto8vmg0s7oA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-darwin-arm64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.25.tgz", - "integrity": "sha512-oTcDgdm0MDVEmw2DWu8BV68pYuImpFgvWREPErBZmNA4MYKGuBRaCiJqq6jZmBR1x+3y1DWCjez+5uLtuAm6mw==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-freebsd-64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.25.tgz", - "integrity": "sha512-ueAqbnMZ8arnuLH8tHwTCQYeptnHOUV7vA6px6j4zjjQwDx7TdP7kACPf3TLZLdJQ3CAD1XCvQ2sPhX+8tacvQ==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-freebsd-arm64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.25.tgz", - "integrity": "sha512-+ZVWud2HKh+Ob6k/qiJWjBtUg4KmJGGmbvEXXW1SNKS7hW7HU+Zq2ZCcE1akFxOPkVB+EhOty/sSek30tkCYug==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-32": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.25.tgz", - "integrity": "sha512-3OP/lwV3kCzEz45tobH9nj+uE4ubhGsfx+tn0L26WAGtUbmmcRpqy7XRG/qK7h1mClZ+eguIANcQntYMdYklfw==", - "cpu": [ - "ia32" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.25.tgz", - "integrity": "sha512-+aKHdHZmX9qwVlQmu5xYXh7GsBFf4TWrePgeJTalhXHOG7NNuUwoHmketGiZEoNsWyyqwH9rE5BC+iwcLY30Ug==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-arm": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.25.tgz", - "integrity": "sha512-aTLcE2VBoLydL943REcAcgnDi3bHtmULSXWLbjtBdtykRatJVSxKMjK9YlBXUZC4/YcNQfH7AxwVeQr9fNxPhw==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-arm64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.25.tgz", - "integrity": "sha512-UxfenPx/wSZx55gScCImPtXekvZQLI2GW3qe5dtlmU7luiqhp5GWPzGeQEbD3yN3xg/pHc671m5bma5Ns7lBHw==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-mips64le": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.25.tgz", - "integrity": "sha512-wLWYyqVfYx9Ur6eU5RT92yJVsaBGi5RdkoWqRHOqcJ38Kn60QMlcghsKeWfe9jcYut8LangYZ98xO1LxIoSXrQ==", - "cpu": [ - "mips64el" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-ppc64le": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.25.tgz", - "integrity": "sha512-0dR6Csl6Zas3g4p9ULckEl8Mo8IInJh33VCJ3eaV1hj9+MHGdmDOakYMN8MZP9/5nl+NU/0ygpd14cWgy8uqRw==", - "cpu": [ - "ppc64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/esbuild-linux-riscv64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.25.tgz", - "integrity": "sha512-J4d20HDmTrgvhR0bdkDhvvJGaikH3LzXQnNaseo8rcw9Yqby9A90gKUmWpfwqLVNRILvNnAmKLfBjCKU9ajg8w==", - "cpu": [ - "riscv64" - ], - "optional": true, - "os": [ - "linux" - ], + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, "engines": { - "node": ">=12" + "node": ">=7.0.0" } }, - "node_modules/esbuild-linux-s390x": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.25.tgz", - "integrity": "sha512-YI2d5V6nTE73ZnhEKQD7MtsPs1EtUZJ3obS21oxQxGbbRw1G+PtJKjNyur+3t6nzHP9oTg6GHQ3S3hOLLmbDIQ==", - "cpu": [ - "s390x" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, - "node_modules/esbuild-netbsd-64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.25.tgz", - "integrity": "sha512-TKIVgNWLUOkr+Exrye70XTEE1lJjdQXdM4tAXRzfHE9iBA7LXWcNtVIuSnphTqpanPzTDFarF0yqq4kpbC6miA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "netbsd" - ], + "node_modules/colorette": { + "version": "2.0.16", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.16.tgz", + "integrity": "sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g==", + "dev": true + }, + "node_modules/commander": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", + "dev": true, "engines": { - "node": ">=12" + "node": ">= 12" } }, - "node_modules/esbuild-openbsd-64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.25.tgz", - "integrity": "sha512-QgFJ37A15D7NIXBTYEqz29+uw3nNBOIyog+3kFidANn6kjw0GHZ0lEYQn+cwjyzu94WobR+fes7cTl/ZYlHb1A==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "openbsd" - ], + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==" + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, "engines": { - "node": ">=12" + "node": ">= 8" } }, - "node_modules/esbuild-sunos-64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.25.tgz", - "integrity": "sha512-rmWfjUItYIVlqr5EnTH1+GCxXiBOC42WBZ3w++qh7n2cS9Xo0lO5pGSG2N+huOU2fX5L+6YUuJ78/vOYvefeFw==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "sunos" - ], + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, "engines": { - "node": ">=12" + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/esbuild-windows-32": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.25.tgz", - "integrity": "sha512-HGAxVUofl3iUIz9W10Y9XKtD0bNsK9fBXv1D55N/ljNvkrAYcGB8YCm0v7DjlwtyS6ws3dkdQyXadbxkbzaKOA==", - "cpu": [ - "ia32" - ], - "optional": true, - "os": [ - "win32" - ], + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "engines": { - "node": ">=12" + "node": ">=0.3.1" } }, - "node_modules/esbuild-windows-64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.25.tgz", - "integrity": "sha512-TirEohRkfWU9hXLgoDxzhMQD1g8I2mOqvdQF2RS9E/wbkORTAqJHyh7wqGRCQAwNzdNXdg3JAyhQ9/177AadWA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "win32" - ], + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, "engines": { - "node": ">=12" + "node": ">=6.0.0" } }, - "node_modules/esbuild-windows-arm64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.25.tgz", - "integrity": "sha512-4ype9ERiI45rSh+R8qUoBtaj6kJvUOI7oVLhKqPEpcF4Pa5PpT3hm/mXAyotJHREkHpM87PAJcA442mLnbtlNA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "win32" - ], + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/esbuild": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.3.tgz", + "integrity": "sha512-UlJ1qUUA2jL2nNib1JTSkifQTcYTroFqRjwCFW4QYEKEsixXD5Tik9xML7zh2gTxkYTBKGHNH9y7txMwVyPbjw==", + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, "engines": { "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.19.3", + "@esbuild/android-arm64": "0.19.3", + "@esbuild/android-x64": "0.19.3", + "@esbuild/darwin-arm64": "0.19.3", + "@esbuild/darwin-x64": "0.19.3", + "@esbuild/freebsd-arm64": "0.19.3", + "@esbuild/freebsd-x64": "0.19.3", + "@esbuild/linux-arm": "0.19.3", + "@esbuild/linux-arm64": "0.19.3", + "@esbuild/linux-ia32": "0.19.3", + "@esbuild/linux-loong64": "0.19.3", + "@esbuild/linux-mips64el": "0.19.3", + "@esbuild/linux-ppc64": "0.19.3", + "@esbuild/linux-riscv64": "0.19.3", + "@esbuild/linux-s390x": "0.19.3", + "@esbuild/linux-x64": "0.19.3", + "@esbuild/netbsd-x64": "0.19.3", + "@esbuild/openbsd-x64": "0.19.3", + "@esbuild/sunos-x64": "0.19.3", + "@esbuild/win32-arm64": "0.19.3", + "@esbuild/win32-ia32": "0.19.3", + "@esbuild/win32-x64": "0.19.3" } }, "node_modules/escape-string-regexp": { @@ -2179,15 +2211,15 @@ } }, "node_modules/prettier": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.1.tgz", - "integrity": "sha512-8UVbTBYGwN37Bs9LERmxCPjdvPxlEowx2urIL6urHzdb3SDq4B/Z6xLFCblrSnE4iKWcS6ziJ3aOYrc1kz/E2A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", + "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", "dev": true, "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" @@ -2484,15 +2516,15 @@ } }, "node_modules/typescript": { - "version": "4.4.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", - "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/universalify": { @@ -2683,6 +2715,138 @@ "@noble/hashes": "^1.3.1" } }, + "@esbuild/android-arm": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.3.tgz", + "integrity": "sha512-Lemgw4io4VZl9GHJmjiBGzQ7ONXRfRPHcUEerndjwiSkbxzrpq0Uggku5MxxrXdwJ+pTj1qyw4jwTu7hkPsgIA==", + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.3.tgz", + "integrity": "sha512-w+Akc0vv5leog550kjJV9Ru+MXMR2VuMrui3C61mnysim0gkFCPOUTAfzTP0qX+HpN9Syu3YA3p1hf3EPqObRw==", + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.3.tgz", + "integrity": "sha512-FKQJKkK5MXcBHoNZMDNUAg1+WcZlV/cuXrWCoGF/TvdRiYS4znA0m5Il5idUwfxrE20bG/vU1Cr5e1AD6IEIjQ==", + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.3.tgz", + "integrity": "sha512-kw7e3FXU+VsJSSSl2nMKvACYlwtvZB8RUIeVShIEY6PVnuZ3c9+L9lWB2nWeeKWNNYDdtL19foCQ0ZyUL7nqGw==", + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.3.tgz", + "integrity": "sha512-tPfZiwF9rO0jW6Jh9ipi58N5ZLoSjdxXeSrAYypy4psA2Yl1dAMhM71KxVfmjZhJmxRjSnb29YlRXXhh3GqzYw==", + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.3.tgz", + "integrity": "sha512-ERDyjOgYeKe0Vrlr1iLrqTByB026YLPzTytDTz1DRCYM+JI92Dw2dbpRHYmdqn6VBnQ9Bor6J8ZlNwdZdxjlSg==", + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.3.tgz", + "integrity": "sha512-nXesBZ2Ad1qL+Rm3crN7NmEVJ5uvfLFPLJev3x1j3feCQXfAhoYrojC681RhpdOph8NsvKBBwpYZHR7W0ifTTA==", + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.3.tgz", + "integrity": "sha512-zr48Cg/8zkzZCzDHNxXO/89bf9e+r4HtzNUPoz4GmgAkF1gFAFmfgOdCbR8zMbzFDGb1FqBBhdXUpcTQRYS1cQ==", + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.3.tgz", + "integrity": "sha512-qXvYKmXj8GcJgWq3aGvxL/JG1ZM3UR272SdPU4QSTzD0eymrM7leiZH77pvY3UetCy0k1xuXZ+VPvoJNdtrsWQ==", + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.3.tgz", + "integrity": "sha512-7XlCKCA0nWcbvYpusARWkFjRQNWNGlt45S+Q18UeS///K6Aw8bB2FKYe9mhVWy/XLShvCweOLZPrnMswIaDXQA==", + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.3.tgz", + "integrity": "sha512-qGTgjweER5xqweiWtUIDl9OKz338EQqCwbS9c2Bh5jgEH19xQ1yhgGPNesugmDFq+UUSDtWgZ264st26b3de8A==", + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.3.tgz", + "integrity": "sha512-gy1bFskwEyxVMFRNYSvBauDIWNggD6pyxUksc0MV9UOBD138dKTzr8XnM2R4mBsHwVzeuIH8X5JhmNs2Pzrx+A==", + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.3.tgz", + "integrity": "sha512-UrYLFu62x1MmmIe85rpR3qou92wB9lEXluwMB/STDzPF9k8mi/9UvNsG07Tt9AqwPQXluMQ6bZbTzYt01+Ue5g==", + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.3.tgz", + "integrity": "sha512-9E73TfyMCbE+1AwFOg3glnzZ5fBAFK4aawssvuMgCRqCYzE0ylVxxzjEfut8xjmKkR320BEoMui4o/t9KA96gA==", + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.3.tgz", + "integrity": "sha512-LlmsbuBdm1/D66TJ3HW6URY8wO6IlYHf+ChOUz8SUAjVTuaisfuwCOAgcxo3Zsu3BZGxmI7yt//yGOxV+lHcEA==", + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.3.tgz", + "integrity": "sha512-ogV0+GwEmvwg/8ZbsyfkYGaLACBQWDvO0Kkh8LKBGKj9Ru8VM39zssrnu9Sxn1wbapA2qNS6BiLdwJZGouyCwQ==", + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.3.tgz", + "integrity": "sha512-o1jLNe4uzQv2DKXMlmEzf66Wd8MoIhLNO2nlQBHLtWyh2MitDG7sMpfCO3NTcoTMuqHjfufgUQDFRI5C+xsXQw==", + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.3.tgz", + "integrity": "sha512-AZJCnr5CZgZOdhouLcfRdnk9Zv6HbaBxjcyhq0StNcvAdVZJSKIdOiPB9az2zc06ywl0ePYJz60CjdKsQacp5Q==", + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.3.tgz", + "integrity": "sha512-Acsujgeqg9InR4glTRvLKGZ+1HMtDm94ehTIHKhJjFpgVzZG9/pIcWW/HA/DoMfEyXmANLDuDZ2sNrWcjq1lxw==", + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.3.tgz", + "integrity": "sha512-FSrAfjVVy7TifFgYgliiJOyYynhQmqgPj15pzLyJk8BUsnlWNwP/IAy6GAiB1LqtoivowRgidZsfpoYLZH586A==", + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.3.tgz", + "integrity": "sha512-xTScXYi12xLOWZ/sc5RBmMN99BcXp/eEf7scUC0oeiRoiT5Vvo9AycuqCp+xdpDyAU+LkrCqEpUS9fCSZF8J3Q==", + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.3.tgz", + "integrity": "sha512-FbUN+0ZRXsypPyWE2IwIkVjDkDnJoMJARWOcFZn4KPPli+QnKqF0z1anvfaYe3ev5HFCpRDLLBDHyOALLppWHw==", + "optional": true + }, "@eslint/eslintrc": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.1.tgz", @@ -2723,81 +2887,81 @@ "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==" }, "@swc/core": { - "version": "1.3.81", - "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.3.81.tgz", - "integrity": "sha512-jaKz72JIuPJQXSwSEzF6g3OBIx0IPBfgJHI9hA2jiKnfxJ1EWDd2S33NpU/HfgUCZ822aPmYuHvUhoDj3uauyg==", + "version": "1.3.86", + "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.3.86.tgz", + "integrity": "sha512-bEXUtm37bcmJ3q+geG7Zy4rJNUzpxalXQUrrqX1ZoGj3HRtzdeVZ0L/um3fG2j16qe61t8TX/OIZ2G6j6dkG/w==", "requires": { - "@swc/core-darwin-arm64": "1.3.81", - "@swc/core-darwin-x64": "1.3.81", - "@swc/core-linux-arm-gnueabihf": "1.3.81", - "@swc/core-linux-arm64-gnu": "1.3.81", - "@swc/core-linux-arm64-musl": "1.3.81", - "@swc/core-linux-x64-gnu": "1.3.81", - "@swc/core-linux-x64-musl": "1.3.81", - "@swc/core-win32-arm64-msvc": "1.3.81", - "@swc/core-win32-ia32-msvc": "1.3.81", - "@swc/core-win32-x64-msvc": "1.3.81", + "@swc/core-darwin-arm64": "1.3.86", + "@swc/core-darwin-x64": "1.3.86", + "@swc/core-linux-arm-gnueabihf": "1.3.86", + "@swc/core-linux-arm64-gnu": "1.3.86", + "@swc/core-linux-arm64-musl": "1.3.86", + "@swc/core-linux-x64-gnu": "1.3.86", + "@swc/core-linux-x64-musl": "1.3.86", + "@swc/core-win32-arm64-msvc": "1.3.86", + "@swc/core-win32-ia32-msvc": "1.3.86", + "@swc/core-win32-x64-msvc": "1.3.86", "@swc/types": "^0.1.4" } }, "@swc/core-darwin-arm64": { - "version": "1.3.81", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.81.tgz", - "integrity": "sha512-uc8/hpS5KXrMo6IvdDC/tpmns6rYVYOmf+t2Zh4dNf6fsfQ4kQVyJErD0MtJ5pykZWd/kCPD5NF/FyRQ5xfSfw==", + "version": "1.3.86", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.86.tgz", + "integrity": "sha512-hMvSDms0sJJHNtRa3Vhmr9StWN1vmikbf5VE0IZUYGnF1/JZTkXU1h6CdNUY4Hr6i7uCZjH6BEhxFHX1JtKV4w==", "optional": true }, "@swc/core-darwin-x64": { - "version": "1.3.81", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.3.81.tgz", - "integrity": "sha512-GSS4b18cUKyZXY8vgZBOS7ERFXYmHX7O8c2ZbV9YLCz7AAQ71EtlBrO8N7/Gzq2Etea3CVFxPqnKB1wzVWVpUA==", + "version": "1.3.86", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.3.86.tgz", + "integrity": "sha512-Jro6HVH4uSOBM7tTDaQNKLNc8BJV7n+SO+Ft2HAZINyeKJS/8MfEYneG7Vmqg18gv00c6dz9AOCcyz+BR7BFkQ==", "optional": true }, "@swc/core-linux-arm-gnueabihf": { - "version": "1.3.81", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.81.tgz", - "integrity": "sha512-rwVheKf4RogHSap+QDnnCvqCE1k2x63Lhg6XOr0A2/12vDvHXLzVfqgn2ox69CmD0GfqVQ3g56qAfi693njvUg==", + "version": "1.3.86", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.86.tgz", + "integrity": "sha512-wYB9m0pzXJVSzedXSl4JwS3gKtvcPinpe9MbkddezpqL7OjyDP6pHHW9qIucsfgCrtMtbPC2nqulXLPtAAyIjw==", "optional": true }, "@swc/core-linux-arm64-gnu": { - "version": "1.3.81", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.81.tgz", - "integrity": "sha512-M+cNSSu8z573sDLbm2llRlp32EeoIymZ1PVQNYFWowDvgAbgpU7Cxqzr4Qb8D/p6bglWDLb32fD1KuPTnrvYkA==", + "version": "1.3.86", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.86.tgz", + "integrity": "sha512-fR44IyK5cdCaO8cC++IEH0Jn03tWnunJnjzA99LxlE5TRInSIOvFm+g5OSUQZDAvEXmQ38sd31LO2HOoDS1Edw==", "optional": true }, "@swc/core-linux-arm64-musl": { - "version": "1.3.81", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.81.tgz", - "integrity": "sha512-6Ncm6c9qOZAK4wwQHXUS3Zo6B5kUmgfN7kv/qZPMbbOK5TRK5TKcM4HmBzSXVVDq0/12vev8x65ICmwPuB5IpA==", + "version": "1.3.86", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.86.tgz", + "integrity": "sha512-EUPfdbK4dUk/nkX3Vmv/47XH+DqHOa9JI0CTthvJ8/ZXei1MKDUsUc+tI1zMQX2uCuSkSWsEIEpCmA0tMwFhtw==", "optional": true }, "@swc/core-linux-x64-gnu": { - "version": "1.3.81", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.81.tgz", - "integrity": "sha512-MYPQTW2yh7A+Od0LcNu79SG6BzCW/ktoq8qRGEwxnohRPlW9Fb0zuGbi4+l023O96W2K4V7tIWmmlKvcZAvP9w==", + "version": "1.3.86", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.86.tgz", + "integrity": "sha512-snVZZWv8XgNVaKrTxtO3rUN+BbbB6I8Fqwe8zM/DWGJ096J13r89doQ48x5ZyO+bW4D48eZIWP5pdfSW7oBE3w==", "optional": true }, "@swc/core-linux-x64-musl": { - "version": "1.3.81", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.81.tgz", - "integrity": "sha512-EYYl/RrkEAMS2fk445V4xJMUXcrbjIJ9B3ACK/tsz1+UcML8Kpg6TvCzlwIdxY8f2oO+FhNC0CALNN31Asgfzg==", + "version": "1.3.86", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.86.tgz", + "integrity": "sha512-PnnksUJymEJkdnbV2orOSOSB441UqsxYbJge9zbr5UTRXUfWO3eFRV0iTBegjTlOQGbW6yN+YRSDkenTbmCI6g==", "optional": true }, "@swc/core-win32-arm64-msvc": { - "version": "1.3.81", - "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.81.tgz", - "integrity": "sha512-n4tqeuFQXnn2fXVrcy3DVUtDrdFImQYYyY9kJPy4y1MXjeJ1l6/6wx9y+Yowpcnmvpk4JvpKMe4x8r/4rOJjsg==", + "version": "1.3.86", + "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.86.tgz", + "integrity": "sha512-XlGEGyHwLndm08VvgeAPGj40L+Hx575MQC+2fsyB1uSNUN+uf7fvke+wc7k50a92CaQe/8foLyIR5faayozEJA==", "optional": true }, "@swc/core-win32-ia32-msvc": { - "version": "1.3.81", - "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.81.tgz", - "integrity": "sha512-XjRxp980/bs11z5jZbWP8VazoCp5sESo8+LxxUUsyENcbfAhFtjaGZTuFY4CSV1gohGAaMLnSlg5bUc+4TLz8A==", + "version": "1.3.86", + "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.86.tgz", + "integrity": "sha512-U1BhZa1x9yn+wZGTQmt1cYR79a0FzW/wL6Jas1Pn0bykKLxdRU4mCeZt2P+T3buLm8jr8LpPWiCrbvr658PzwA==", "optional": true }, "@swc/core-win32-x64-msvc": { - "version": "1.3.81", - "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.81.tgz", - "integrity": "sha512-P/+TBWnYna0QIKWtq02MB/ICdsO5rsI5jwOyhzzID9rl7DRlMmXVqBcVmlnJFEJoEkFYJIlORByMNmSv1YkOqw==", + "version": "1.3.86", + "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.86.tgz", + "integrity": "sha512-wRoQUajqpE3wITHhZVj/6BPu/QwHriFHLHuJA+9y6PeGtUtTmntL42aBKXIFhfL767dYFtohyNg1uZ9eqbGyGQ==", "optional": true }, "@swc/types": { @@ -3118,151 +3282,33 @@ "dev": true }, "esbuild": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.25.tgz", - "integrity": "sha512-4JHEIOMNFvK09ziiL+iVmldIhLbn49V4NAVo888tcGFKedEZY/Y8YapfStJ6zSE23tzYPKxqKwQBnQoIO0BI/Q==", + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.3.tgz", + "integrity": "sha512-UlJ1qUUA2jL2nNib1JTSkifQTcYTroFqRjwCFW4QYEKEsixXD5Tik9xML7zh2gTxkYTBKGHNH9y7txMwVyPbjw==", "requires": { - "esbuild-android-64": "0.14.25", - "esbuild-android-arm64": "0.14.25", - "esbuild-darwin-64": "0.14.25", - "esbuild-darwin-arm64": "0.14.25", - "esbuild-freebsd-64": "0.14.25", - "esbuild-freebsd-arm64": "0.14.25", - "esbuild-linux-32": "0.14.25", - "esbuild-linux-64": "0.14.25", - "esbuild-linux-arm": "0.14.25", - "esbuild-linux-arm64": "0.14.25", - "esbuild-linux-mips64le": "0.14.25", - "esbuild-linux-ppc64le": "0.14.25", - "esbuild-linux-riscv64": "0.14.25", - "esbuild-linux-s390x": "0.14.25", - "esbuild-netbsd-64": "0.14.25", - "esbuild-openbsd-64": "0.14.25", - "esbuild-sunos-64": "0.14.25", - "esbuild-windows-32": "0.14.25", - "esbuild-windows-64": "0.14.25", - "esbuild-windows-arm64": "0.14.25" - } - }, - "esbuild-android-64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.25.tgz", - "integrity": "sha512-L5vCUk7TzFbBnoESNoXjU3x9+/+7TDIE/1mTfy/erAfvZAqC+S3sp/Qa9wkypFMcFvN9FzvESkTlpeQDolREtQ==", - "optional": true - }, - "esbuild-android-arm64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.25.tgz", - "integrity": "sha512-4jv5xPjM/qNm27T5j3ZEck0PvjgQtoMHnz4FzwF5zNP56PvY2CT0WStcAIl6jNlsuDdN63rk2HRBIsO6xFbcFw==", - "optional": true - }, - "esbuild-darwin-64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.25.tgz", - "integrity": "sha512-TGp8tuudIxOyWd1+8aYPxQmC1ZQyvij/AfNBa35RubixD0zJ1vkKHVAzo0Zao1zcG6pNqiSyzfPto8vmg0s7oA==", - "optional": true - }, - "esbuild-darwin-arm64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.25.tgz", - "integrity": "sha512-oTcDgdm0MDVEmw2DWu8BV68pYuImpFgvWREPErBZmNA4MYKGuBRaCiJqq6jZmBR1x+3y1DWCjez+5uLtuAm6mw==", - "optional": true - }, - "esbuild-freebsd-64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.25.tgz", - "integrity": "sha512-ueAqbnMZ8arnuLH8tHwTCQYeptnHOUV7vA6px6j4zjjQwDx7TdP7kACPf3TLZLdJQ3CAD1XCvQ2sPhX+8tacvQ==", - "optional": true - }, - "esbuild-freebsd-arm64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.25.tgz", - "integrity": "sha512-+ZVWud2HKh+Ob6k/qiJWjBtUg4KmJGGmbvEXXW1SNKS7hW7HU+Zq2ZCcE1akFxOPkVB+EhOty/sSek30tkCYug==", - "optional": true - }, - "esbuild-linux-32": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.25.tgz", - "integrity": "sha512-3OP/lwV3kCzEz45tobH9nj+uE4ubhGsfx+tn0L26WAGtUbmmcRpqy7XRG/qK7h1mClZ+eguIANcQntYMdYklfw==", - "optional": true - }, - "esbuild-linux-64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.25.tgz", - "integrity": "sha512-+aKHdHZmX9qwVlQmu5xYXh7GsBFf4TWrePgeJTalhXHOG7NNuUwoHmketGiZEoNsWyyqwH9rE5BC+iwcLY30Ug==", - "optional": true - }, - "esbuild-linux-arm": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.25.tgz", - "integrity": "sha512-aTLcE2VBoLydL943REcAcgnDi3bHtmULSXWLbjtBdtykRatJVSxKMjK9YlBXUZC4/YcNQfH7AxwVeQr9fNxPhw==", - "optional": true - }, - "esbuild-linux-arm64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.25.tgz", - "integrity": "sha512-UxfenPx/wSZx55gScCImPtXekvZQLI2GW3qe5dtlmU7luiqhp5GWPzGeQEbD3yN3xg/pHc671m5bma5Ns7lBHw==", - "optional": true - }, - "esbuild-linux-mips64le": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.25.tgz", - "integrity": "sha512-wLWYyqVfYx9Ur6eU5RT92yJVsaBGi5RdkoWqRHOqcJ38Kn60QMlcghsKeWfe9jcYut8LangYZ98xO1LxIoSXrQ==", - "optional": true - }, - "esbuild-linux-ppc64le": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.25.tgz", - "integrity": "sha512-0dR6Csl6Zas3g4p9ULckEl8Mo8IInJh33VCJ3eaV1hj9+MHGdmDOakYMN8MZP9/5nl+NU/0ygpd14cWgy8uqRw==", - "optional": true - }, - "esbuild-linux-riscv64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.25.tgz", - "integrity": "sha512-J4d20HDmTrgvhR0bdkDhvvJGaikH3LzXQnNaseo8rcw9Yqby9A90gKUmWpfwqLVNRILvNnAmKLfBjCKU9ajg8w==", - "optional": true - }, - "esbuild-linux-s390x": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.25.tgz", - "integrity": "sha512-YI2d5V6nTE73ZnhEKQD7MtsPs1EtUZJ3obS21oxQxGbbRw1G+PtJKjNyur+3t6nzHP9oTg6GHQ3S3hOLLmbDIQ==", - "optional": true - }, - "esbuild-netbsd-64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.25.tgz", - "integrity": "sha512-TKIVgNWLUOkr+Exrye70XTEE1lJjdQXdM4tAXRzfHE9iBA7LXWcNtVIuSnphTqpanPzTDFarF0yqq4kpbC6miA==", - "optional": true - }, - "esbuild-openbsd-64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.25.tgz", - "integrity": "sha512-QgFJ37A15D7NIXBTYEqz29+uw3nNBOIyog+3kFidANn6kjw0GHZ0lEYQn+cwjyzu94WobR+fes7cTl/ZYlHb1A==", - "optional": true - }, - "esbuild-sunos-64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.25.tgz", - "integrity": "sha512-rmWfjUItYIVlqr5EnTH1+GCxXiBOC42WBZ3w++qh7n2cS9Xo0lO5pGSG2N+huOU2fX5L+6YUuJ78/vOYvefeFw==", - "optional": true - }, - "esbuild-windows-32": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.25.tgz", - "integrity": "sha512-HGAxVUofl3iUIz9W10Y9XKtD0bNsK9fBXv1D55N/ljNvkrAYcGB8YCm0v7DjlwtyS6ws3dkdQyXadbxkbzaKOA==", - "optional": true - }, - "esbuild-windows-64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.25.tgz", - "integrity": "sha512-TirEohRkfWU9hXLgoDxzhMQD1g8I2mOqvdQF2RS9E/wbkORTAqJHyh7wqGRCQAwNzdNXdg3JAyhQ9/177AadWA==", - "optional": true - }, - "esbuild-windows-arm64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.25.tgz", - "integrity": "sha512-4ype9ERiI45rSh+R8qUoBtaj6kJvUOI7oVLhKqPEpcF4Pa5PpT3hm/mXAyotJHREkHpM87PAJcA442mLnbtlNA==", - "optional": true + "@esbuild/android-arm": "0.19.3", + "@esbuild/android-arm64": "0.19.3", + "@esbuild/android-x64": "0.19.3", + "@esbuild/darwin-arm64": "0.19.3", + "@esbuild/darwin-x64": "0.19.3", + "@esbuild/freebsd-arm64": "0.19.3", + "@esbuild/freebsd-x64": "0.19.3", + "@esbuild/linux-arm": "0.19.3", + "@esbuild/linux-arm64": "0.19.3", + "@esbuild/linux-ia32": "0.19.3", + "@esbuild/linux-loong64": "0.19.3", + "@esbuild/linux-mips64el": "0.19.3", + "@esbuild/linux-ppc64": "0.19.3", + "@esbuild/linux-riscv64": "0.19.3", + "@esbuild/linux-s390x": "0.19.3", + "@esbuild/linux-x64": "0.19.3", + "@esbuild/netbsd-x64": "0.19.3", + "@esbuild/openbsd-x64": "0.19.3", + "@esbuild/sunos-x64": "0.19.3", + "@esbuild/win32-arm64": "0.19.3", + "@esbuild/win32-ia32": "0.19.3", + "@esbuild/win32-x64": "0.19.3" + } }, "escape-string-regexp": { "version": "4.0.0", @@ -4057,9 +4103,9 @@ "dev": true }, "prettier": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.1.tgz", - "integrity": "sha512-8UVbTBYGwN37Bs9LERmxCPjdvPxlEowx2urIL6urHzdb3SDq4B/Z6xLFCblrSnE4iKWcS6ziJ3aOYrc1kz/E2A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", + "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", "dev": true }, "punycode": { @@ -4256,9 +4302,9 @@ "dev": true }, "typescript": { - "version": "4.4.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", - "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==" + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==" }, "universalify": { "version": "2.0.0", diff --git a/package.json b/package.json index 0b62e85f2f..60cbe550ad 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "bin": { "azle": "./bin.js" }, - "main": "./src/lib_new/index.ts", + "main": "./src/lib_functional/index.ts", "repository": { "type": "git", "url": "git+https://github.com/demergent-labs/azle.git" @@ -27,15 +27,15 @@ "dependencies": { "@dfinity/candid": "github:demergent-labs/candid", "@dfinity/principal": "^0.19.0", - "@swc/core": "1.3.81", + "@swc/core": "^1.3.86", "azle-syn": "0.0.0", "buffer": "^6.0.3", - "esbuild": "0.14.25", + "esbuild": "^0.19.3", "fs-extra": "10.0.1", "js-sha256": "0.9.0", "text-encoding": "0.7.0", "ts-node": "10.3.1", - "typescript": "4.4.4", + "typescript": "^5.2.2", "uuid": "^9.0.0" }, "devDependencies": { @@ -45,7 +45,7 @@ "eslint-config-prettier": "8.5.0", "husky": "7.0.4", "lint-staged": "12.3.7", - "prettier": "2.6.1" + "prettier": "^3.0.3" }, "lint-staged": { "**/*": "prettier --write --ignore-unknown" diff --git a/src/compiler/generate_candid_and_canister_methods.ts b/src/compiler/generate_candid_and_canister_methods.ts index 3cfdb141d1..9be7eb072a 100644 --- a/src/compiler/generate_candid_and_canister_methods.ts +++ b/src/compiler/generate_candid_and_canister_methods.ts @@ -8,6 +8,17 @@ export function generateCandidAndCanisterMethods(mainJs: string): { const sandbox = { globalThis: {}, + crypto: { + getRandomValues: () => { + let array = new Uint8Array(32); + + for (let i = 0; i < array.length; i++) { + array[i] = Math.floor(Math.random() * 256); + } + + return array; + } + }, exports: {}, console, TextDecoder, @@ -19,7 +30,7 @@ export function generateCandidAndCanisterMethods(mainJs: string): { script.runInContext(context); return { - candid: (sandbox.globalThis as any)._azleCandidService, - canisterMethods: (sandbox.globalThis as any)._azleCanisterMethods + candid: (sandbox.exports as any).canisterMethods.candid, + canisterMethods: (sandbox.exports as any).canisterMethods }; } diff --git a/src/compiler/typescript_to_rust/azle_generate_rearchitecture/src/main.rs b/src/compiler/typescript_to_rust/azle_generate_rearchitecture/src/main.rs index 76afa1872f..44e0e24370 100644 --- a/src/compiler/typescript_to_rust/azle_generate_rearchitecture/src/main.rs +++ b/src/compiler/typescript_to_rust/azle_generate_rearchitecture/src/main.rs @@ -278,8 +278,9 @@ fn main() -> Result<(), String> { let global = context.global_object().unwrap(); let exports = global.get_property("exports").unwrap(); - let class = exports.get_property("canisterClass").unwrap(); - let method = class.get_property(function_name).unwrap(); + let canister_methods = exports.get_property("canisterMethods").unwrap(); + let callbacks = canister_methods.get_property("callbacks").unwrap(); + let method = callbacks.get_property(function_name).unwrap(); let candid_args = if pass_arg_data { ic_cdk::api::call::arg_data_raw() } else { vec![] }; diff --git a/src/compiler/typescript_to_rust/typescript_to_javascript/cargo_toml_files.ts b/src/compiler/typescript_to_rust/typescript_to_javascript/cargo_toml_files.ts index 71e1d9de3a..e658589fb8 100644 --- a/src/compiler/typescript_to_rust/typescript_to_javascript/cargo_toml_files.ts +++ b/src/compiler/typescript_to_rust/typescript_to_javascript/cargo_toml_files.ts @@ -60,7 +60,7 @@ export function generateLibCargoToml( ic-cdk = "0.10.0" ic-cdk-macros = "0.7.0" ic-cdk-timers = "0.4.0" - ic-stable-structures = "0.6.0-beta.0" + ic-stable-structures = "0.6.0-beta.1" candid = { version = "0.9.1", features = ["parser"] } boa_engine = { git = "https://github.com/boa-dev/boa", rev = "93e3b2f629a98049ce24c8b4e82d63fd01a85604" } # boa_engine = { git = "https://github.com/demergent-labs/boa", rev = "2613202fdc2757691ba1a20e568e5b8740e0c233" } diff --git a/src/compiler/typescript_to_rust/typescript_to_javascript/index.ts b/src/compiler/typescript_to_rust/typescript_to_javascript/index.ts index 51c2dc2b3e..d4baa73638 100644 --- a/src/compiler/typescript_to_rust/typescript_to_javascript/index.ts +++ b/src/compiler/typescript_to_rust/typescript_to_javascript/index.ts @@ -33,34 +33,19 @@ export function compileTypeScriptToJavaScript( import { ic } from 'azle'; export { Principal } from '@dfinity/principal'; export * from './${tsPath}'; - import CanisterClass from './${tsPath}'; - `; - - const canisterClassInstantiation = ` - export const canisterClass = new CanisterClass(ic.id()); - `; - - const candidGeneration = ` -globalThis._azleCandidService = \`\${CanisterClass._azleCandidTypes.length > 0 ? CanisterClass._azleCandidTypes.join(';\\n') + ';\\n' : ''}service: (\${CanisterClass._azleCandidInitParams.join( - ', ' -)}) -> { - \${CanisterClass._azleCandidMethods.join('\\n ')} -}\n\` + import CanisterMethods from './${tsPath}'; -globalThis._azleCanisterMethods = CanisterClass._azleCanisterMethods; + export const canisterMethods = CanisterMethods; `; const canisterJavaScript = bundleAndTranspileJs(` ${globalThisProcess} ${imports} - ${canisterClassInstantiation} -${candidGeneration} `); const candidJavaScript = bundleAndTranspileJs(` ${globalThisProcess} ${imports} -${candidGeneration} `); return { diff --git a/src/compiler/utils/types.ts b/src/compiler/utils/types.ts index 66a8416590..b3a3e1a418 100644 --- a/src/compiler/utils/types.ts +++ b/src/compiler/utils/types.ts @@ -46,6 +46,7 @@ export type CompilerInfo = { }; export type CanisterMethods = { + candid: string; queries: CanisterMethod[]; updates: CanisterMethod[]; init?: CanisterMethod; @@ -53,6 +54,9 @@ export type CanisterMethods = { post_upgrade?: CanisterMethod; heartbeat?: CanisterMethod; inspect_message?: CanisterMethod; + callbacks: { + [key: string]: (...args: any) => any; + }; }; export type CanisterMethod = { diff --git a/src/lib_functional/candid/index.ts b/src/lib_functional/candid/index.ts new file mode 100644 index 0000000000..e990146b82 --- /dev/null +++ b/src/lib_functional/candid/index.ts @@ -0,0 +1,88 @@ +export * from './reference'; +import { IDL } from '@dfinity/candid'; +import { + AzleBlob, + blob, + AzleVec, + AzleOpt, + AzleInt, + AzleInt64, + AzleInt32, + AzleInt16, + AzleInt8, + AzleNat, + AzleNat64, + AzleNat32, + AzleNat16, + AzleNat8, + AzleFloat64, + AzleFloat32, + nat, + nat64, + nat32, + nat16, + nat8, + int, + int64, + int32, + int16, + int8, + float64, + float32, + Principal, + AzleNull, + Null, + AzleReserved, + reserved, + AzleEmpty, + empty, + AzleBool, + bool, + AzlePrincipal +} from '../../lib_new'; + +export type TypeMapping = T extends IDL.TextClass + ? string + : T extends AzleBool + ? bool + : T extends AzleInt + ? int + : T extends AzleInt64 + ? int64 + : T extends AzleInt32 + ? int32 + : T extends AzleInt16 + ? int16 + : T extends AzleInt8 + ? int8 + : T extends AzleNat + ? nat + : T extends AzleNat64 + ? nat64 + : T extends AzleNat32 + ? nat32 + : T extends AzleNat16 + ? nat16 + : T extends AzleNat8 + ? nat8 + : T extends AzleFloat64 + ? float64 + : T extends AzleFloat32 + ? float32 + : T extends never[] + ? void + : T extends AzleVec + ? TypeMapping[] + : T extends AzleOpt + ? [TypeMapping] | [] + : T extends AzleBlob + ? blob + : T extends AzlePrincipal + ? Principal + : T extends AzleNull + ? Null + : T extends AzleReserved + ? reserved + : T extends AzleEmpty + ? empty + : T; diff --git a/src/lib_functional/candid/primitive.ts b/src/lib_functional/candid/primitive.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/lib_functional/candid/reference/index.ts b/src/lib_functional/candid/reference/index.ts new file mode 100644 index 0000000000..ef127d4251 --- /dev/null +++ b/src/lib_functional/candid/reference/index.ts @@ -0,0 +1,3 @@ +export * from './record'; +export * from './service'; +export * from './variant'; diff --git a/src/lib_functional/candid/reference/record.ts b/src/lib_functional/candid/reference/record.ts new file mode 100644 index 0000000000..e6732dd705 --- /dev/null +++ b/src/lib_functional/candid/reference/record.ts @@ -0,0 +1,28 @@ +import { TypeMapping } from '..'; +import { IDL } from '@dfinity/candid'; +import { processMap } from '../../../lib_new/utils'; +import { v4 } from 'uuid'; + +export function Record(obj: T): { + [K in keyof T]: TypeMapping; +} { + const name = v4(); + + return { + getIDL(parents: any) { + const idl = IDL.Rec(); + idl.fill( + IDL.Record( + processMap(obj as any, [ + ...parents, + { + idl: idl, + name + } + ]) + ) + ); + return idl; + } + } as any; +} diff --git a/src/lib_functional/candid/reference/service.ts b/src/lib_functional/candid/reference/service.ts new file mode 100644 index 0000000000..a5a1a72e67 --- /dev/null +++ b/src/lib_functional/candid/reference/service.ts @@ -0,0 +1,105 @@ +import { Principal, TypeMapping } from '../../'; +import { serviceCall } from '../../../lib_new'; +import { CanisterMethodInfo } from '../../canister_methods'; + +type ServiceOptions = { + [key: string]: CanisterMethodInfo; +}; + +type ServiceReturn = { + [EndpointName in keyof T]: T[EndpointName] extends CanisterMethodInfo< + infer Params, + infer Return + > + ? ( + ...args: { [K in keyof Params]: TypeMapping } + ) => Promise> + : never; +}; + +export function Service( + serviceOptions: T, + principal?: Principal +): ServiceReturn { + const callbacks = Object.entries(serviceOptions).reduce((acc, entry) => { + const key = entry[0]; + const value = entry[1]; + + if (value.callback === undefined) { + return { + ...acc, + [key]: (...args: any[]) => { + return serviceCall( + principal as any, + key, + value.paramsIdls, + value.returnIdl + )(...args); + } + }; + } else { + return { + ...acc, + [key]: value.callback + }; + } + }, {}); + + const candidTypes = Object.values(serviceOptions).reduce( + (acc: string[], canisterMethodInfo) => { + return [...acc, ...canisterMethodInfo.candidTypes]; + }, + [] + ); + + const queries = Object.entries(serviceOptions) + .filter((entry) => { + const key = entry[0]; + const value = entry[1]; + + return value.type === 'query'; + }) + .map((entry) => { + const key = entry[0]; + const value = entry[1]; + + return { + name: key + }; + }); + + const updates = Object.entries(serviceOptions) + .filter((entry) => { + const key = entry[0]; + const value = entry[1]; + + return value.type === 'update'; + }) + .map((entry) => { + const key = entry[0]; + const value = entry[1]; + + return { + name: key + }; + }); + + // TODO loop through each key and simply grab the candid off + // TODO grab the init/post_upgrade candid as well + return { + candid: `${ + candidTypes.length === 0 ? '' : candidTypes.join('\n') + '\n' + }service: () -> { + ${Object.entries(serviceOptions) + .map((entry) => { + return `${entry[0]}: ${entry[1].candid}`; + }) + .join('\n ')} +} +`, + queries, + updates, + callbacks, + ...callbacks // TODO then we can't use any names that could collide in this object + } as any; +} diff --git a/src/lib_functional/candid/reference/variant.ts b/src/lib_functional/candid/reference/variant.ts new file mode 100644 index 0000000000..ab272d5bfb --- /dev/null +++ b/src/lib_functional/candid/reference/variant.ts @@ -0,0 +1,37 @@ +import { TypeMapping } from '..'; +import { IDL } from '@dfinity/candid'; +import { processMap } from '../../../lib_new/utils'; +import { v4 } from 'uuid'; + +export function Variant(obj: T): RequireExactlyOne<{ + [K in keyof T]: TypeMapping; +}> { + const name = v4(); + + return { + getIDL(parents: any) { + const idl = IDL.Rec(); + idl.fill( + IDL.Variant( + processMap(obj as any, [ + ...parents, + { + idl: idl, + name + } + ]) + ) + ); + return idl; + } + } as any; +} + +type RequireExactlyOne< + ObjectType, + KeysType extends keyof ObjectType = keyof ObjectType +> = { + [Key in KeysType]: Required> & + Partial, never>>; +}[KeysType] & + Omit; diff --git a/src/lib_functional/canister_methods/index.ts b/src/lib_functional/canister_methods/index.ts new file mode 100644 index 0000000000..1b62b957a9 --- /dev/null +++ b/src/lib_functional/canister_methods/index.ts @@ -0,0 +1,64 @@ +import { IDL } from '../../lib_new/index'; +import { ic } from '../../lib_new/ic'; +import { TypeMapping } from '..'; + +export * from './query'; +export * from './update'; + +export type CanisterMethodInfo, K> = { + type: 'query' | 'update'; + callback?: (...args: any) => any; + candid: string; + candidTypes: string[]; + paramsIdls: any[]; + returnIdl: any; +}; + +export type Callback, Return> = ( + ...args: { [K in keyof Params]: TypeMapping } +) => TypeMapping | Promise>; + +export function executeMethod( + paramCandid: any, + returnCandid: any, + args: any[], + callback: any +) { + const decoded = IDL.decode(paramCandid[0] as any, args[0]); + + const result = callback(...decoded); + + if ( + result !== undefined && + result !== null && + typeof result.then === 'function' + ) { + result + .then((result: any) => { + // TODO this won't be accurate because we have most likely had + // TODO cross-canister calls + console.log(`final instructions: ${ic.instructionCounter()}`); + + // if (!manual) { + const encodeReadyResult = result === undefined ? [] : [result]; + const encoded = IDL.encode( + returnCandid[0] as any, + encodeReadyResult + ); + ic.replyRaw(new Uint8Array(encoded)); + // } + }) + .catch((error: any) => { + ic.trap(error.toString()); + }); + } else { + const encodeReadyResult = result === undefined ? [] : [result]; + + // if (!manual) { + const encoded = IDL.encode(returnCandid[0] as any, encodeReadyResult); + ic.replyRaw(new Uint8Array(encoded)); + // } + + console.log(`final instructions: ${ic.instructionCounter()}`); + } +} diff --git a/src/lib_functional/canister_methods/query.ts b/src/lib_functional/canister_methods/query.ts new file mode 100644 index 0000000000..aa2bc11b52 --- /dev/null +++ b/src/lib_functional/canister_methods/query.ts @@ -0,0 +1,41 @@ +import { + handleRecursiveParams, + handleRecursiveReturn, + newTypesToStingArr +} from '../../lib_new/method_decorators'; +import { Callback, CanisterMethodInfo, executeMethod } from '.'; +import { TypeMapping } from '../candid'; + +export function query< + const Params extends ReadonlyArray, + Return, + GenericCallback extends Callback +>( + paramsIdls: Params, + returnIdl: Return, + callback?: Awaited> extends TypeMapping + ? GenericCallback + : never +): CanisterMethodInfo { + const paramCandid = handleRecursiveParams(paramsIdls as any); + const returnCandid = handleRecursiveReturn( + returnIdl as any, + paramCandid[2] + ); + + const finalCallback = + callback === undefined + ? undefined + : (...args: any[]) => { + executeMethod(paramCandid, returnCandid, args, callback); + }; + + return { + type: 'query', + callback: finalCallback, + candid: `(${paramCandid[1].join(', ')}) -> (${returnCandid[1]}) query;`, + candidTypes: newTypesToStingArr(returnCandid[2]), + paramsIdls: paramsIdls as any, + returnIdl + }; +} diff --git a/src/lib_functional/canister_methods/update.ts b/src/lib_functional/canister_methods/update.ts new file mode 100644 index 0000000000..9e109ec5c9 --- /dev/null +++ b/src/lib_functional/canister_methods/update.ts @@ -0,0 +1,41 @@ +import { + handleRecursiveParams, + handleRecursiveReturn, + newTypesToStingArr +} from '../../lib_new/method_decorators'; +import { Callback, CanisterMethodInfo, executeMethod } from '.'; +import { TypeMapping } from '../candid'; + +export function update< + const Params extends ReadonlyArray, + Return, + GenericCallback extends Callback +>( + paramsIdls: Params, + returnIdl: Return, + callback?: Awaited> extends TypeMapping + ? GenericCallback + : never +): CanisterMethodInfo { + const paramCandid = handleRecursiveParams(paramsIdls as any); + const returnCandid = handleRecursiveReturn( + returnIdl as any, + paramCandid[2] + ); + + const finalCallback = + callback === undefined + ? undefined + : (...args: any[]) => { + executeMethod(paramCandid, returnCandid, args, callback); + }; + + return { + type: 'update', + callback: finalCallback, + candid: `(${paramCandid[1].join(', ')}) -> (${returnCandid[1]});`, + candidTypes: newTypesToStingArr(returnCandid[2]), + paramsIdls: paramsIdls as any, + returnIdl + }; +} diff --git a/src/lib_functional/index.ts b/src/lib_functional/index.ts new file mode 100644 index 0000000000..7cd2820650 --- /dev/null +++ b/src/lib_functional/index.ts @@ -0,0 +1,4 @@ +export * from './canister_methods'; +export * from './candid'; +export * from '../lib_new/primitives'; +export * from '../lib_new/ic'; diff --git a/src/lib_new/ic.ts b/src/lib_new/ic.ts index 1268728043..86966bc456 100644 --- a/src/lib_new/ic.ts +++ b/src/lib_new/ic.ts @@ -1,7 +1,7 @@ -import { Nat64 } from '@dfinity/candid/lib/esm/idl'; // Note: Importing IDL from './index' instead causes the build to fail +import '@dfinity/candid/lib/esm/idl'; // This must remain or the build fails import { Principal } from '@dfinity/principal'; import { IDL } from './index'; -import { blob, nat, nat32, nat64, Void, Opt } from './primitives'; +import { blob, nat, nat32, nat64, AzleNat64, Void, Opt } from './primitives'; import { RejectionCode } from './system_types'; import { v4 } from 'uuid'; import { CandidClass, toIDLType } from './utils'; @@ -16,14 +16,14 @@ declare var globalThis: any; * Represents a duration of time in seconds. */ export type Duration = nat64; // TODO: Consider modeling this after the corresponding struct in Rust -export const Duration = Nat64; // Note: using IDL.Nat64 from './index' causes the build to fail +export const Duration: AzleNat64 = AzleNat64 as any; /** * Type returned by the {@link ic.setTimer} and {@link ic.setTimerInterval} * functions. Pass to {@link ic.clearTimer} to remove the timer. */ export type TimerId = nat64; // TODO: Consider modeling this after the corresponding struct in Rust -export const TimerId = Nat64; // Note: using IDL.Nat64 from './index' causes the build to fail +export const TimerId: AzleNat64 = AzleNat64 as any; type Ic = { /** @@ -50,7 +50,7 @@ type Ic = { args?: ArgsType; cycles?: bigint; } - ): ReturnTypeOfPromise; + ): ReturnTypeOf; call128 any>( method: T, @@ -58,7 +58,7 @@ type Ic = { args?: ArgsType; cycles?: bigint; } - ): ReturnTypeOfPromise; + ): ReturnTypeOf; /** * Performs an asynchronous call to another canister using the [System API]( diff --git a/src/lib_new/method_decorators.ts b/src/lib_new/method_decorators.ts index 4627ce65aa..a2a9e06912 100644 --- a/src/lib_new/method_decorators.ts +++ b/src/lib_new/method_decorators.ts @@ -174,13 +174,13 @@ export function update( }; } -function newTypesToStingArr(newTypes: CandidTypesDefs): string[] { +export function newTypesToStingArr(newTypes: CandidTypesDefs): string[] { return Object.entries(newTypes).map( - ([name, candid]) => `type ${name} = ${candid}` + ([name, candid]) => `type ${name} = ${candid};` ); } -function handleRecursiveParams( +export function handleRecursiveParams( idls: CandidClass[] ): [IDL.Type[], CandidDef[], CandidTypesDefs] { const paramIdls = toParamIDLTypes(idls); @@ -188,7 +188,7 @@ function handleRecursiveParams( return [paramIdls, ...extractCandid(paramInfo, {})]; } -function handleRecursiveReturn( +export function handleRecursiveReturn( returnIdl: ReturnCandidClass, paramCandidTypeDefs: CandidTypesDefs ): [IDL.Type[], CandidDef[], CandidTypesDefs] { diff --git a/src/lib_new/primitives.ts b/src/lib_new/primitives.ts index fe3b4c6492..62f7565957 100644 --- a/src/lib_new/primitives.ts +++ b/src/lib_new/primitives.ts @@ -1,43 +1,169 @@ import { IDL } from './index'; import { CandidClass, Parent, toIDLType } from './utils'; -export const bool = IDL.Bool; +export class AzleNat { + _kind: 'AzleNat' = 'AzleNat'; + static getIDL() { + return IDL.Nat; + } +} + +export class AzleNat64 { + _kind: 'AzleNat64' = 'AzleNat64'; + static getIDL() { + return IDL.Nat64; + } +} + +export class AzleNat32 { + _kind: 'AzleNat32' = 'AzleNat32'; + static getIDL() { + return IDL.Nat32; + } +} + +export class AzleNat16 { + _kind: 'AzleNat16' = 'AzleNat16'; + static getIDL() { + return IDL.Nat16; + } +} + +export class AzleNat8 { + _kind: 'AzleNat8' = 'AzleNat8'; + static getIDL() { + return IDL.Nat8; + } +} + +export class AzleInt { + _kind: 'AzleInt' = 'AzleInt'; + static getIDL() { + return IDL.Int; + } +} + +export class AzleInt64 { + _kind: 'AzleInt64' = 'AzleInt64'; + static getIDL() { + return IDL.Int64; + } +} + +export class AzleInt32 { + _kind: 'AzleInt32' = 'AzleInt32'; + static getIDL() { + return IDL.Int32; + } +} + +export class AzleInt16 { + _kind: 'AzleInt16' = 'AzleInt16'; + static getIDL() { + return IDL.Int16; + } +} + +export class AzleInt8 { + _kind: 'AzleInt8' = 'AzleInt8'; + static getIDL() { + return IDL.Int8; + } +} + +export class AzleFloat64 { + _kind: 'AzleFloat64' = 'AzleFloat64'; + static getIDL() { + return IDL.Float64; + } +} + +export class AzleFloat32 { + _kind: 'AzleFloat32' = 'AzleFloat32'; + static getIDL() { + return IDL.Float32; + } +} + +export class AzleBlob { + _kind: 'AzleBlob' = 'AzleBlob'; + static getIDL() { + return IDL.Vec(IDL.Nat8); + } +} + +export class AzleNull { + _kind: 'AzleNull' = 'AzleNull'; + static getIDL() { + return IDL.Null; + } +} + +export class AzleReserved { + _kind: 'AzleReserved' = 'AzleReserved'; + static getIDL() { + return IDL.Reserved; + } +} + +export class AzleEmpty { + _kind: 'AzleEmpty' = 'AzleEmpty'; + static getIDL() { + return IDL.Empty; + } +} + +export class AzleBool { + _kind: 'AzleBool' = 'AzleBool'; + static getIDL() { + return IDL.Bool; + } +} + +export class AzlePrincipal { + _kind: 'AzlePrincipal' = 'AzlePrincipal'; + static getIDL() { + return IDL.Principal; + } +} + +export const bool: AzleBool = AzleBool as any; export type bool = boolean; -export const blob = IDL.Vec(IDL.Nat8); +export const blob: AzleBlob = AzleBlob as any; export type blob = Uint8Array; -export const empty = IDL.Empty; +export const empty: AzleEmpty = AzleEmpty as any; export type empty = never; -export const int = IDL.Int; +export const int: AzleInt = AzleInt as any; export type int = bigint; -export const int8 = IDL.Int8; +export const int8: AzleInt8 = AzleInt8 as any; export type int8 = number; -export const int16 = IDL.Int16; +export const int16: AzleInt16 = AzleInt16 as any; export type int16 = number; -export const int32 = IDL.Int32; +export const int32: AzleInt32 = AzleInt32 as any; export type int32 = number; -export const int64 = IDL.Int64; +export const int64: AzleInt64 = AzleInt64 as any; export type int64 = bigint; -export const nat = IDL.Nat; +export const nat: AzleNat = AzleNat as any; export type nat = bigint; -export const nat8 = IDL.Nat8; +export const nat8: AzleNat8 = AzleNat8 as any; export type nat8 = number; -export const nat16 = IDL.Nat16; +export const nat16: AzleNat16 = AzleNat16 as any; export type nat16 = number; -export const nat32 = IDL.Nat32; +export const nat32: AzleNat32 = AzleNat32 as any; export type nat32 = number; -export const nat64 = IDL.Nat64; +export const nat64: AzleNat64 = AzleNat64 as any; export type nat64 = bigint; -export const Null = IDL.Null; +export const Null: AzleNull = AzleNull as any; export type Null = null; -export const reserved = IDL.Reserved; +export const reserved: AzleReserved = AzleReserved as any; export type reserved = any; export const text = IDL.Text; export type text = string; -export const float32 = IDL.Float32; +export const float32: AzleFloat32 = AzleFloat32 as any; export type float32 = number; -export const float64 = IDL.Float64; +export const float64: AzleFloat64 = AzleFloat64 as any; export type float64 = number; -export const principal = IDL.Principal; +export const principal: AzlePrincipal = AzlePrincipal as any; export { Principal } from '@dfinity/principal'; export type Vec = T[]; export type Tuple = T; @@ -63,17 +189,13 @@ export function Some(value: T): [T] { export const None: [] = []; // TODO what happens if we pass something to Opt() that can't be converted to CandidClass? -export function Opt(t: CandidClass): AzleOpt { - // return IDL.Opt(toIDLType(t)); +export function Opt(t: T): AzleOpt { + // return IDL.Opt(toCandidClass(t)); return new AzleOpt(t); } -export interface GetIDL { - getIDL(parents: Parent[]): IDL.Type; -} - -export class AzleOpt implements GetIDL { - constructor(t: CandidClass) { +export class AzleOpt { + constructor(t: any) { this._azleType = t; } _azleType: CandidClass; @@ -82,8 +204,8 @@ export class AzleOpt implements GetIDL { } } -export class AzleVec implements GetIDL { - constructor(t: CandidClass) { +export class AzleVec { + constructor(t: any) { this._azleType = t; } _azleType: CandidClass; @@ -92,7 +214,7 @@ export class AzleVec implements GetIDL { } } -export class AzleTuple implements GetIDL { +export class AzleTuple { constructor(t: CandidClass[]) { this._azleTypes = t; } @@ -105,8 +227,8 @@ export class AzleTuple implements GetIDL { } } -export function Vec(t: CandidClass): AzleVec { - // return IDL.Vec(toIDLType(t)); +export function Vec(t: T): AzleVec { + // return IDL.Vec(toCandidClass(t)); return new AzleVec(t); } diff --git a/src/lib_new/service.ts b/src/lib_new/service.ts index 8a8784eb86..1e480a6b5d 100644 --- a/src/lib_new/service.ts +++ b/src/lib_new/service.ts @@ -90,6 +90,7 @@ export function serviceDecorator( } export function serviceCall( + canisterId: Principal, methodName: string, paramsIdls: any[], returnIdl: CandidClass @@ -114,7 +115,7 @@ export function serviceCall( if (notify) { try { return callFunction( - this.canisterId, + canisterId, methodName, encodedArgs, cycles @@ -124,7 +125,7 @@ export function serviceCall( } } else { const encodedResult = await callFunction( - this.canisterId, + canisterId, methodName, encodedArgs, cycles