diff --git a/benchmarks/src/lib/constants/benchmark-tests.ts b/benchmarks/src/lib/constants/benchmark-tests.ts index 3bc44463..8d042a61 100644 --- a/benchmarks/src/lib/constants/benchmark-tests.ts +++ b/benchmarks/src/lib/constants/benchmark-tests.ts @@ -390,7 +390,7 @@ export const BENCHMARK_TESTS: Benchmark.Test[] = [ } }, { - name: `${Method.Random} (Duplicates)`, + name: `${Method.Random} (Unique)`, beforeAll: async ({ provider, entries }) => { await provider[Method.SetMany]({ @@ -402,7 +402,7 @@ export const BENCHMARK_TESTS: Benchmark.Test[] = [ }, run: async ({ provider }) => { - await provider[Method.Random]({ method: Method.Random, errors: [], count: 5, duplicates: true }); + await provider[Method.Random]({ method: Method.Random, errors: [], count: 5, unique: true }); } }, { @@ -418,11 +418,11 @@ export const BENCHMARK_TESTS: Benchmark.Test[] = [ }, run: async ({ provider }) => { - await provider[Method.Random]({ method: Method.Random, errors: [], count: 5, duplicates: false }); + await provider[Method.Random]({ method: Method.Random, errors: [], count: 5, unique: false }); } }, { - name: `${Method.RandomKey} (Duplicates)`, + name: `${Method.RandomKey} (Unique)`, beforeAll: async ({ provider, entries }) => { await provider[Method.SetMany]({ @@ -434,7 +434,7 @@ export const BENCHMARK_TESTS: Benchmark.Test[] = [ }, run: async ({ provider }) => { - await provider[Method.RandomKey]({ method: Method.RandomKey, errors: [], count: 5, duplicates: true }); + await provider[Method.RandomKey]({ method: Method.RandomKey, errors: [], count: 5, unique: true }); } }, { @@ -450,7 +450,7 @@ export const BENCHMARK_TESTS: Benchmark.Test[] = [ }, run: async ({ provider }) => { - await provider[Method.RandomKey]({ method: Method.RandomKey, errors: [], count: 5, duplicates: false }); + await provider[Method.RandomKey]({ method: Method.RandomKey, errors: [], count: 5, unique: false }); } }, { diff --git a/packages/indexeddb/.cliff-jumperrc.yml b/packages/indexeddb/.cliff-jumperrc.yml new file mode 100644 index 00000000..11f8cd0d --- /dev/null +++ b/packages/indexeddb/.cliff-jumperrc.yml @@ -0,0 +1,3 @@ +name: indexeddb +org: joshdb +packagePath: packages/indexeddb diff --git a/packages/indexeddb/.typedoc-json-parserrc.yml b/packages/indexeddb/.typedoc-json-parserrc.yml new file mode 100644 index 00000000..92d0e01d --- /dev/null +++ b/packages/indexeddb/.typedoc-json-parserrc.yml @@ -0,0 +1 @@ +json: 'docs/api.json' diff --git a/packages/indexeddb/CHANGELOG.md b/packages/indexeddb/CHANGELOG.md new file mode 100644 index 00000000..6361e43e --- /dev/null +++ b/packages/indexeddb/CHANGELOG.md @@ -0,0 +1,3 @@ +# Changelog + +All notable changes to this project will be documented in this file. diff --git a/packages/indexeddb/README.md b/packages/indexeddb/README.md new file mode 100644 index 00000000..c81cafe0 --- /dev/null +++ b/packages/indexeddb/README.md @@ -0,0 +1,33 @@ +
+ +![Josh Logo](https://evie.codes/josh-light.png) + +# @joshdb/indexeddb + +**A provider for `@joshdb/core`** + +[![GitHub](https://img.shields.io/github/license/josh-development/providers)](https://github.com/josh-development/providers/blob/main/LICENSE.md) +[![codecov](https://codecov.io/gh/josh-development/providers/branch/main/graph/badge.svg?token=JnJcjxqT3k)](https://codecov.io/gh/josh-development/providers) +[![npm](https://img.shields.io/npm/v/@joshdb/indexeddb?color=crimson&logo=npm&style=flat-square)](https://www.npmjs.com/package/@joshdb/indexeddb) + +[![Support Server](https://discord.com/api/guilds/298508738623438848/embed.png?style=banner2)](https://discord.gg/N7ZKH3P) + +
+ +## Description + +A Josh provider + +## Features + +- Written in TypeScript +- Offers CommonJS and ESM bundles +- Fully tested + +## Installation + +You can use the following command to install this package, or replace `npm install` with your package manager of choice. + +```sh +npm install @joshdb/indexeddb +``` diff --git a/packages/indexeddb/cliff.toml b/packages/indexeddb/cliff.toml new file mode 100644 index 00000000..e281775c --- /dev/null +++ b/packages/indexeddb/cliff.toml @@ -0,0 +1,61 @@ +[changelog] +header = """ +# Changelog + +All notable changes to this project will be documented in this file. + +""" +body = """ +{% if version %}\ + # [{{ version | trim_start_matches(pat="v") }}]\ + {% if previous %}\ + {% if previous.version %}\ + (https://github.com/josh-development/providers/compare/{{ previous.version }}...{{ version }})\ + {% else %}\ + (https://github.com/josh-development/providers/tree/{{ version }})\ + {% endif %}\ + {% endif %} \ + - ({{ timestamp | date(format="%Y-%m-%d") }}) +{% else %}\ + # [unreleased] +{% endif %}\ +{% for group, commits in commits | group_by(attribute="group") %} + ## {{ group | upper_first }} + {% for commit in commits %} + - {% if commit.scope %}\ + **{{commit.scope}}:** \ + {% endif %}\ + {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/josh-development/providers/commit/{{ commit.id }}))\ + {% if commit.breaking %}\ + {% for breakingChange in commit.footers %}\ + \n{% raw %} {% endraw %}- πŸ’₯ **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ + {% endfor %}\ + {% endif %}\ + {% endfor %} +{% endfor %}\n +""" +trim = true +footer = "" + +[git] +conventional_commits = true +filter_unconventional = true +commit_parsers = [ + { message = "^feat", group = "πŸš€ Features" }, + { message = "^fix", group = "πŸ› Bug Fixes" }, + { message = "^docs", group = "πŸ“ Documentation" }, + { message = "^perf", group = "πŸƒ Performance" }, + { message = "^refactor", group = "🏠 Refactor" }, + { message = ".*deprecated", body = ".*deprecated", group = "🚨 Deprecation" }, + { message = "^revert", skip = true }, + { message = "^style", group = "πŸͺž Styling" }, + { message = "^test", group = "πŸ§ͺ Testing" }, + { message = "^chore", skip = true }, + { message = "^ci", skip = true }, + { body = ".*security", group = "πŸ›‘οΈ Security" }, +] +filter_commits = true +tag_pattern = "@joshdb/indexeddb@[0-9]*" +ignore_tags = "" +topo_order = false +sort_commits = "newest" diff --git a/packages/indexeddb/package.json b/packages/indexeddb/package.json new file mode 100644 index 00000000..8ae3688a --- /dev/null +++ b/packages/indexeddb/package.json @@ -0,0 +1,65 @@ +{ + "name": "@joshdb/indexeddb", + "version": "2.0.0", + "description": "A Josh provider", + "author": "Γ‰velyne Lachance (https://evie.codes/)", + "contributors": [ + "WilsontheWolf (https://shorty.systems/)", + "DanCodes (https://dancodes.online/)" + ], + "license": "Apache-2.0", + "main": "dist/index.js", + "module": "dist/index.mjs", + "browser": "dist/index.umd.js", + "unpkg": "dist/index.umd.js", + "types": "dist/index.d.ts", + "exports": { + "import": "./dist/index.mjs", + "require": "./dist/index.js", + "types": "./dist/index.d.ts" + }, + "sideEffects": false, + "scripts": { + "test": "vitest run", + "docs": "typedoc-json-parser", + "lint": "eslint src tests --ext ts --fix -c ../../.eslintrc", + "build": "rollup -c rollup.config.ts", + "prepack": "rollup-type-bundler", + "bump": "cliff-jumper", + "check-update": "cliff-jumper --dry-run" + }, + "dependencies": { + "@joshdb/provider": "2.0.0-next.1c9d8d9.0", + "@sapphire/utilities": "^3.12.0", + "property-helpers": "^2.0.0" + }, + "devDependencies": { + "@favware/cliff-jumper": "^2.0.1", + "@favware/rollup-type-bundler": "^1.0.11", + "@vitest/coverage-v8": "^0.32.0", + "fake-indexeddb": "^4.0.1", + "typedoc": "^0.24.8", + "typedoc-json-parser": "^8.1.2", + "vitest": "^0.32.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/josh-development/providers.git" + }, + "files": [ + "dist", + "!dist/*tsbuildinfo" + ], + "engines": { + "node": ">=16.6.0", + "npm": ">=7.0.0" + }, + "keywords": [], + "bugs": { + "url": "https://github.com/josh-development/providers/issues" + }, + "homepage": "https://josh.evie.dev", + "publishConfig": { + "access": "public" + } +} diff --git a/packages/indexeddb/rollup.config.ts b/packages/indexeddb/rollup.config.ts new file mode 100644 index 00000000..3031a35c --- /dev/null +++ b/packages/indexeddb/rollup.config.ts @@ -0,0 +1,34 @@ +import { resolve } from 'path'; +import cleaner from 'rollup-plugin-cleaner'; +import typescript from 'rollup-plugin-typescript2'; +import versionInjector from 'rollup-plugin-version-injector'; + +export default { + input: 'src/index.ts', + output: [ + { + file: './dist/index.js', + format: 'cjs', + exports: 'named', + sourcemap: true + }, + { + file: './dist/index.mjs', + format: 'es', + exports: 'named', + sourcemap: true + }, + { + file: './dist/index.umd.js', + format: 'umd', + name: 'JoshIndexedDBProvider', + exports: 'named', + sourcemap: true, + globals: { + '@joshdb/provider': 'JoshProvider' + } + } + ], + external: ['@joshdb/provider'], + plugins: [cleaner({ targets: ['./dist'] }), typescript({ tsconfig: resolve(process.cwd(), 'src', 'tsconfig.json') }), versionInjector()] +}; diff --git a/packages/indexeddb/src/index.ts b/packages/indexeddb/src/index.ts new file mode 100644 index 00000000..ee50cb6c --- /dev/null +++ b/packages/indexeddb/src/index.ts @@ -0,0 +1 @@ +export * from './lib/IndexedDBProvider'; diff --git a/packages/indexeddb/src/lib/DatabaseHandler.ts b/packages/indexeddb/src/lib/DatabaseHandler.ts new file mode 100644 index 00000000..ab1f3185 --- /dev/null +++ b/packages/indexeddb/src/lib/DatabaseHandler.ts @@ -0,0 +1,278 @@ +import type { Semver } from '@joshdb/provider'; + +export class DatabaseHandler { + private options: DatabaseHandler.Options; + + private factory = globalThis.indexedDB; + + private _database?: IDBDatabase; + + public constructor(options: DatabaseHandler.Options) { + this.options = options; + } + + private get database(): IDBDatabase { + if (this._database instanceof IDBDatabase) return this._database; + + throw new Error('Database not initialized. This is probably because init() was not called.'); + } + + public async init(): Promise { + const { name, version } = this.options; + const request = this.factory.open(name, 1); + + await new Promise((resolve, reject) => { + request.onerror = reject; + + request.onupgradeneeded = () => { + const database = request.result; + + if (!database.objectStoreNames.contains('metadata')) { + database.createObjectStore('metadata', { keyPath: 'key' }); + } + + if (!database.objectStoreNames.contains('entries')) { + database.createObjectStore('entries', { keyPath: 'key' }); + } + }; + + request.onsuccess = async () => { + this._database = request.result; + + const storedVersion = await this.getMetadata('version'); + + if (!storedVersion) { + await this.setMetadata('version', version); + } + + const autoKey = await this.getMetadata('autoKey'); + + if (typeof autoKey !== 'number') { + await this.setMetadata('autoKey', 0); + } + + resolve(); + }; + }); + } + + public async getMetadata(key: string): Promise { + const metadataStore = this.openMetadata(); + const request = metadataStore.get(key); + + const row = await this.handleRequest>>(request); + + return row?.value; + } + + public async setMetadata(key: string, value: unknown): Promise { + const metadataStore = this.openMetadata(); + const request = metadataStore.put({ key, value }); + + await this.handleRequest(request); + } + + public async deleteMetadata(key: string): Promise { + const metadataStore = this.openMetadata(); + const request = metadataStore.delete(key); + + await this.handleRequest(request); + } + + public async clear(): Promise { + const entriesStore = this.openEntries(); + + await this.handleRequest(entriesStore.clear()); + + const metadataStore = this.openMetadata(); + + await this.handleRequest(metadataStore.clear()); + await this.setMetadata('autoKey', 0); + + const { version } = this.options; + + await this.setMetadata('version', version); + } + + public async delete(key: string): Promise { + const exists = await this.has(key); + + if (!exists) return false; + + const entriesStore = this.openEntries(); + const request = entriesStore.delete(key); + + await this.handleRequest(request); + + return true; + } + + public async deleteMany(keys: string[]): Promise { + const entriesStore = this.openEntries(); + const requests = keys.map((key) => entriesStore.delete(key)); + + for (const request of requests) { + await this.handleRequest(request); + } + } + + public async entries(): Promise<[string, StoredValue][]> { + const entriesStore = this.openEntries(); + const request = entriesStore.getAll(); + const data = await this.handleRequest[]>(request); + const entries = data.map(({ key, value }) => [key, value] as [string, StoredValue]); + + return entries; + } + + public async get(key: string): Promise { + const entriesStore = this.openEntries(); + const request = entriesStore.get(key); + const row = await this.handleRequest>>(request); + + return row?.value; + } + + public async getMany(keys: string[]): Promise> { + const entriesStore = this.openEntries(); + const entries: Record = {}; + + for (const key of keys) { + const request = entriesStore.get(key); + const row = await this.handleRequest>>(request); + + entries[key] = row?.value ?? null; + } + + return entries; + } + + public async has(key: string): Promise { + const cursorRequest = this.openEntries().openKeyCursor(); + + return new Promise((resolve, reject) => { + cursorRequest.onsuccess = (event) => { + const target = event.target as IDBRequest; + const cursor = target.result; + + if (cursor) { + console.log(cursor.key, key); + + if (cursor.key === key) { + return resolve(true); + } + + cursor.continue(); + } else { + resolve(false); + } + }; + + cursorRequest.onerror = () => { + reject(cursorRequest.error); + }; + }); + } + + public async keys(): Promise { + const entriesStore = this.openEntries(); + const request = entriesStore.getAllKeys(); + + return this.handleRequest(request); + } + + public async set(key: string, value: Value): Promise { + const entriesStore = this.openEntries(); + const request = entriesStore.put({ key, value }); + + await this.handleRequest(request); + } + + public async setMany(entries: [string, StoredValue][], overwrite: boolean): Promise { + const entriesStore = this.openEntries(); + + for (const [key, value] of entries) { + if (!overwrite) { + const request = entriesStore.add({ key, value }); + + await this.handleRequest(request); + } else { + const request = entriesStore.put({ key, value }); + + await this.handleRequest(request); + } + } + } + + public async size(): Promise { + const entriesStore = this.openEntries(); + const request = entriesStore.count(); + + return this.handleRequest(request); + } + + public async values(): Promise { + const cursorRequest = this.openEntries().openCursor(); + const values: StoredValue[] = []; + + await new Promise((resolve, reject) => { + cursorRequest.onsuccess = () => { + const cursor = cursorRequest.result; + + if (!cursor) { + return resolve(); + } + + const { value } = cursor.value as DatabaseHandler.Row; + + values.push(value); + + cursor.continue(); + }; + + cursorRequest.onerror = () => { + reject(cursorRequest.error); + }; + }); + + return values; + } + + private async handleRequest(request: IDBRequest): Promise { + return new Promise((resolve, reject) => { + request.onsuccess = () => { + resolve(request.result); + }; + + request.onerror = () => { + reject(request.error); + }; + }); + } + + private openEntries() { + const transaction = this.database.transaction('entries', 'readwrite'); + + return transaction.objectStore('entries'); + } + + private openMetadata() { + const transaction = this.database.transaction('metadata', 'readwrite'); + + return transaction.objectStore('metadata'); + } +} + +export namespace DatabaseHandler { + export interface Options { + name: string; + + version: Semver; + } + + export interface Row { + key: string; + + value: T; + } +} diff --git a/packages/indexeddb/src/lib/IndexedDBProvider.ts b/packages/indexeddb/src/lib/IndexedDBProvider.ts new file mode 100644 index 00000000..898496de --- /dev/null +++ b/packages/indexeddb/src/lib/IndexedDBProvider.ts @@ -0,0 +1,809 @@ +import { + CommonIdentifiers, + isEveryByHookPayload, + isEveryByValuePayload, + isFilterByHookPayload, + isFilterByValuePayload, + isFindByHookPayload, + isFindByValuePayload, + isMapByHookPayload, + isMapByPathPayload, + isPartitionByHookPayload, + isPartitionByValuePayload, + isPayloadWithData, + isRemoveByHookPayload, + isRemoveByValuePayload, + isSomeByHookPayload, + isSomeByValuePayload, + JoshProvider, + MathOperator, + Method, + Payload, + resolveVersion, + type Semver +} from '@joshdb/provider'; +import { isPrimitive } from '@sapphire/utilities'; +import { deleteProperty, getProperty, hasProperty, PROPERTY_NOT_FOUND, setProperty } from 'property-helpers'; +import { DatabaseHandler } from './DatabaseHandler'; + +export class IndexedDBProvider extends JoshProvider { + public declare options: IndexedDBProvider.Options; + + public get version() { + return process.env.NODE_ENV === 'test' ? { major: 2, minor: 0, patch: 0 } : resolveVersion('[VI]{version}[/VI]'); + } + + public migrations: JoshProvider.Migration[] = []; + + private _handler?: DatabaseHandler; + + public constructor(options: IndexedDBProvider.Options) { + super(options); + } + + private get handler(): DatabaseHandler { + if (this._handler instanceof DatabaseHandler) return this._handler; + + throw this.error(IndexedDBProvider.Identifiers.DatabaseHandlerNotFound); + } + + public override async init(context: JoshProvider.Context): Promise { + if ('indexedDB' in globalThis === false) { + throw this.error(IndexedDBProvider.Identifiers.MissingIndexedDB); + } + + const { name } = context; + + this._handler = new DatabaseHandler({ name, version: this.version }); + + await this.handler.init(); + + context = await super.init(context); + + return context; + } + + public async deleteMetadata(key: string): Promise { + await this.handler.deleteMetadata(key); + } + + public async getMetadata(key: string): Promise { + return this.handler.getMetadata(key) as Promise; + } + + public async setMetadata(key: string, value: unknown): Promise { + await this.handler.setMetadata(key, value); + } + + public async [Method.AutoKey](payload: Payload.AutoKey): Promise { + let autoKey = await this.getMetadata('autoKey'); + + autoKey++; + payload.data = autoKey.toString(); + + await this.setMetadata('autoKey', autoKey); + + return payload; + } + + public async [Method.Clear](payload: Payload.Clear): Promise { + await this.handler.clear(); + + return payload; + } + + public async [Method.Dec](payload: Payload.Dec): Promise { + const { key, path } = payload; + const getPayload = await this[Method.Get]({ method: Method.Get, errors: [], key, path }); + + if (!isPayloadWithData(getPayload)) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.MissingData, method: Method.Dec }, { key, path })); + + return payload; + } + + const { data } = getPayload; + + if (typeof data !== 'number') { + payload.errors.push(this.error({ identifier: CommonIdentifiers.InvalidDataType, method: Method.Dec }, { key, path, type: 'number' })); + + return payload; + } + + this[Method.Set]({ method: Method.Set, errors: [], key, path, value: data - 1 }); + + return payload; + } + + public async [Method.Delete](payload: Payload.Delete): Promise { + const { key, path } = payload; + + if (path.length === 0) { + await this.handler.delete(key); + } + + if (await this.handler.has(key)) { + const value = await this.handler.get(key); + + deleteProperty(value, path); + await this.handler.set(key, value); + } + + return payload; + } + + public async [Method.DeleteMany](payload: Payload.DeleteMany): Promise { + const { keys } = payload; + + await this.handler.deleteMany(keys); + + return payload; + } + + public async [Method.Each](payload: Payload.Each): Promise> { + const { hook } = payload; + + for (const [key, value] of await this.handler.entries()) { + await hook(value, key); + } + + return payload; + } + + public async [Method.Ensure](payload: Payload.Ensure): Promise> { + const { key, defaultValue } = payload; + + payload.data = defaultValue; + + if (await this.handler.has(key)) { + payload.data = await this.handler.get(key); + } else { + await this.handler.set(key, defaultValue); + } + + return payload; + } + + public async [Method.Entries](payload: Payload.Entries): Promise> { + payload.data = {}; + + for (const [key, value] of await this.handler.entries()) { + payload.data[key] = value; + } + + return payload; + } + + public async [Method.Every](payload: Payload.Every.ByHook): Promise>; + public async [Method.Every](payload: Payload.Every.ByValue): Promise; + public async [Method.Every](payload: Payload.Every): Promise> { + payload.data = true; + + const size = await this.handler.size(); + + if (size === 0) { + return payload; + } + + if (isEveryByHookPayload(payload)) { + const { hook } = payload; + + for (const [key, value] of await this.handler.entries()) { + const result = await hook(value, key); + + if (result) { + continue; + } + + payload.data = false; + } + } + + if (isEveryByValuePayload(payload)) { + const { path, value } = payload; + + for (const [key, storedValue] of await this.handler.entries()) { + const data = getProperty(storedValue, path); + + if (data === PROPERTY_NOT_FOUND) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.MissingData, method: Method.Every }, { key, path })); + + return payload; + } + + if (!isPrimitive(data)) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.InvalidDataType, method: Method.Every }, { key, path, type: 'primitive' })); + + return payload; + } + + if (data === value) { + continue; + } + + payload.data = false; + } + } + + return payload; + } + + public async [Method.Filter](payload: Payload.Filter.ByHook): Promise>; + public async [Method.Filter](payload: Payload.Filter.ByValue): Promise>; + public async [Method.Filter](payload: Payload.Filter): Promise> { + payload.data = {}; + + if (isFilterByHookPayload(payload)) { + const { hook } = payload; + + for (const [key, value] of await this.handler.entries()) { + if (await hook(value, key)) { + payload.data[key] = value; + } + } + } + + if (isFilterByValuePayload(payload)) { + const { path, value } = payload; + + for (const [key, storedValue] of await this.handler.entries()) { + const data = getProperty(storedValue, path, false); + + if (data === PROPERTY_NOT_FOUND) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.MissingData, method: Method.Filter }, { key, path })); + + return payload; + } + + if (!isPrimitive(data)) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.InvalidDataType, method: Method.Filter }, { key, path, type: 'primitive' })); + + return payload; + } + + if (data === value) { + payload.data[key] = storedValue; + } + } + } + + return payload; + } + + public async [Method.Find](payload: Payload.Find.ByHook): Promise>; + public async [Method.Find](payload: Payload.Find.ByValue): Promise>; + public async [Method.Find](payload: Payload.Find): Promise> { + payload.data = [null, null]; + + if (isFindByHookPayload(payload)) { + const { hook } = payload; + + for (const [key, value] of await this.handler.entries()) { + const result = await hook(value, key); + + if (!result) { + continue; + } + + payload.data = [key, value]; + + break; + } + } + + if (isFindByValuePayload(payload)) { + const { path, value } = payload; + + if (!isPrimitive(value)) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.InvalidDataType, method: Method.Find }, { path, type: 'primitive' })); + + return payload; + } + + for (const [key, storedValue] of await this.handler.entries()) { + if (payload.data[0] !== null && payload.data[1] !== null) { + break; + } + + const data = getProperty(storedValue, path, false); + + if (data === PROPERTY_NOT_FOUND) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.MissingData, method: Method.Find }, { key, path })); + + return payload; + } + + if (!isPrimitive(data)) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.InvalidDataType, method: Method.Find }, { key, path, type: 'primitive' })); + + return payload; + } + + if (data !== value) { + continue; + } + + payload.data = [key, storedValue]; + + break; + } + } + + return payload; + } + + public async [Method.Get](payload: Payload.Get): Promise> { + const { key, path } = payload; + + if (path.length === 0) { + if (await this.handler.has(key)) { + payload.data = await this.handler.get(key); + } + } else { + const data = getProperty(await this.handler.get(key), path); + + if (data !== PROPERTY_NOT_FOUND) { + payload.data = data; + } + } + + return payload; + } + + public async [Method.GetMany](payload: Payload.GetMany): Promise> { + const { keys } = payload; + + payload.data = await this.handler.getMany(keys); + + return payload; + } + + public async [Method.Has](payload: Payload.Has): Promise { + const { key, path } = payload; + + payload.data = (await this.handler.has(key)) ?? hasProperty(await this.handler.get(key), path); + + return payload; + } + + public async [Method.Inc](payload: Payload.Inc): Promise { + const { key, path } = payload; + const getPayload = await this[Method.Get]({ method: Method.Get, errors: [], key, path }); + + if (!isPayloadWithData(getPayload)) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.MissingData, method: Method.Inc }, { key, path })); + + return payload; + } + + const { data } = getPayload; + + if (typeof data !== 'number') { + payload.errors.push(this.error({ identifier: CommonIdentifiers.InvalidDataType, method: Method.Inc }, { key, path, type: 'number' })); + + return payload; + } + + await this[Method.Set]({ method: Method.Set, errors: [], key, path, value: data + 1 }); + + return payload; + } + + public async [Method.Keys](payload: Payload.Keys): Promise { + payload.data = await this.handler.keys(); + + return payload; + } + + public async [Method.Map](payload: Payload.Map.ByHook): Promise>; + public async [Method.Map](payload: Payload.Map.ByPath): Promise>; + public async [Method.Map](payload: Payload.Map): Promise> { + payload.data = []; + + if (isMapByHookPayload(payload)) { + const { hook } = payload; + + for (const [key, value] of await this.handler.entries()) { + payload.data.push(await hook(value, key)); + } + } + + if (isMapByPathPayload(payload)) { + const { path } = payload; + + for (const value of await this.handler.values()) { + const data = getProperty(value, path); + + if (data !== PROPERTY_NOT_FOUND) { + payload.data.push(data); + } + } + } + + return payload; + } + + public async [Method.Math](payload: Payload.Math): Promise { + const { key, path, operator, operand } = payload; + const getPayload = await this[Method.Get]({ method: Method.Get, errors: [], key, path }); + + if (!isPayloadWithData(getPayload)) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.MissingData, method: Method.Math }, { key, path })); + + return payload; + } + + let { data } = getPayload; + + if (typeof data !== 'number') { + payload.errors.push(this.error({ identifier: CommonIdentifiers.InvalidDataType, method: Method.Math }, { key, path, type: 'number' })); + + return payload; + } + + switch (operator) { + case MathOperator.Addition: + data += operand; + + break; + + case MathOperator.Subtraction: + data -= operand; + + break; + + case MathOperator.Multiplication: + data *= operand; + + break; + + case MathOperator.Division: + data /= operand; + + break; + + case MathOperator.Remainder: + data %= operand; + + break; + + case MathOperator.Exponent: + data **= operand; + + break; + } + + this[Method.Set]({ method: Method.Set, errors: [], key, path, value: data }); + + return payload; + } + + public async [Method.Partition](payload: Payload.Partition.ByHook): Promise>; + public async [Method.Partition](payload: Payload.Partition.ByValue): Promise>; + public async [Method.Partition](payload: Payload.Partition): Promise> { + payload.data = { truthy: {}, falsy: {} }; + + if (isPartitionByHookPayload(payload)) { + const { hook } = payload; + + for (const [key, value] of await this.handler.entries()) { + const result = await hook(value, key); + + if (result) { + payload.data.truthy[key] = value; + } else { + payload.data.falsy[key] = value; + } + } + } + + if (isPartitionByValuePayload(payload)) { + const { path, value } = payload; + + for (const [key, storedValue] of await this.handler.entries()) { + const data = getProperty(storedValue, path); + + if (data === PROPERTY_NOT_FOUND) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.MissingData, method: Method.Partition }, { key, path })); + + return payload; + } + + if (!isPrimitive(data)) { + payload.errors.push( + this.error({ identifier: CommonIdentifiers.InvalidDataType, method: Method.Partition }, { key, path, type: 'primitive' }) + ); + + return payload; + } + + if (value === data) { + payload.data.truthy[key] = storedValue; + } else { + payload.data.falsy[key] = storedValue; + } + } + } + + return payload; + } + + public async [Method.Push](payload: Payload.Push): Promise> { + const { key, path, value } = payload; + const getPayload = await this[Method.Get]({ method: Method.Get, errors: [], key, path }); + + if (!isPayloadWithData(getPayload)) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.MissingData, method: Method.Push }, { key, path })); + + return payload; + } + + const { data } = getPayload; + + if (!Array.isArray(data)) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.InvalidDataType, method: Method.Push }, { key, path, type: 'array' })); + + return payload; + } + + data.push(value); + await this[Method.Set]({ method: Method.Set, errors: [], key, path, value: data }); + + return payload; + } + + public async [Method.Random](payload: Payload.Random): Promise> { + const { count, unique } = payload; + const size = await this.handler.size(); + + if (unique && size < count) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.InvalidCount, method: Method.Random })); + + return payload; + } + + if (size === 0) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.MissingData, method: Method.Random, context: { unique, count } })); + + return payload; + } + + payload.data = []; + + const keys = await this.handler.keys(); + + if (unique) { + const randomKeys = new Set(); + + while (randomKeys.size < count) { + randomKeys.add(keys[Math.floor(Math.random() * keys.length)]); + } + + for (const key of randomKeys) { + payload.data.push((await this.handler.get(key))!); + } + } else { + while (payload.data.length < count) { + const key = keys[Math.floor(Math.random() * keys.length)]; + + payload.data.push((await this.handler.get(key))!); + } + } + + return payload; + } + + public async [Method.RandomKey](payload: Payload.RandomKey): Promise { + const { count, unique } = payload; + const size = await this.handler.size(); + + if (unique && size < count) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.InvalidCount, method: Method.RandomKey })); + + return payload; + } + + if (size === 0) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.MissingData, method: Method.RandomKey })); + + return payload; + } + + payload.data = []; + + const keys = Array.from(await this.handler.keys()); + + if (unique) { + const randomKeys = new Set(); + + while (randomKeys.size < count) { + randomKeys.add(keys[Math.floor(Math.random() * keys.length)]); + } + + for (const key of randomKeys) { + payload.data.push(key); + } + } else { + while (payload.data.length < count) { + payload.data.push(keys[Math.floor(Math.random() * keys.length)]); + } + } + + return payload; + } + + public async [Method.Remove](payload: Payload.Remove.ByHook): Promise>; + public async [Method.Remove](payload: Payload.Remove.ByValue): Promise; + public async [Method.Remove](payload: Payload.Remove): Promise> { + if (isRemoveByHookPayload(payload)) { + const { key, path, hook } = payload; + const getPayload = await this[Method.Get]({ method: Method.Get, errors: [], key, path }); + + if (!isPayloadWithData(getPayload)) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.MissingData, method: Method.Remove }, { key, path })); + + return payload; + } + + const { data } = getPayload; + + if (!Array.isArray(data)) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.InvalidDataType, method: Method.Remove }, { key, path, type: 'array' })); + + return payload; + } + + const filterValues = await Promise.all(data.map((value) => hook(value, key))); + + await this[Method.Set]({ method: Method.Set, errors: [], key, path, value: data.filter((_, index) => !filterValues[index]) }); + } + + if (isRemoveByValuePayload(payload)) { + const { key, path, value } = payload; + const getPayload = await this[Method.Get]({ method: Method.Get, errors: [], key, path }); + + if (!isPayloadWithData(getPayload)) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.MissingData, method: Method.Remove }, { key, path })); + + return payload; + } + + const { data } = getPayload; + + if (!Array.isArray(data)) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.InvalidDataType, method: Method.Remove }, { key, path, type: 'array' })); + + return payload; + } + + await this[Method.Set]({ method: Method.Set, errors: [], key, path, value: data.filter((storedValue) => value !== storedValue) }); + } + + return payload; + } + + public async [Method.Set](payload: Payload.Set): Promise> { + const { key, path, value } = payload; + + if (path.length === 0) { + await this.handler.set(key, value as unknown as StoredValue); + } else { + const storedValue = await this.handler.get(key); + + await this.handler.set(key, setProperty(storedValue, path, value)); + } + + return payload; + } + + public async [Method.SetMany](payload: Payload.SetMany): Promise { + const { entries, overwrite } = payload; + + for (const { key, path, value } of entries) { + if (overwrite) { + await this[Method.Set]({ method: Method.Set, errors: [], key, path, value }); + } else if (!(await this[Method.Has]({ method: Method.Has, errors: [], key, path })).data) { + await this[Method.Set]({ method: Method.Set, errors: [], key, path, value }); + } + } + + return payload; + } + + public async [Method.Size](payload: Payload.Size): Promise { + payload.data = await this.handler.size(); + + return payload; + } + + public async [Method.Some](payload: Payload.Some.ByHook): Promise>; + public async [Method.Some](payload: Payload.Some.ByValue): Promise; + public async [Method.Some](payload: Payload.Some): Promise> { + payload.data = false; + + if (isSomeByHookPayload(payload)) { + const { hook } = payload; + + for (const [key, value] of await this.handler.entries()) { + const result = await hook(value, key); + + if (!result) { + continue; + } + + payload.data = true; + + break; + } + } + + if (isSomeByValuePayload(payload)) { + const { path, value } = payload; + + for (const [key, storedValue] of await this.handler.entries()) { + const data = getProperty(storedValue, path); + + if (data === PROPERTY_NOT_FOUND) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.MissingData, method: Method.Some }, { key, path })); + + return payload; + } + + if (!isPrimitive(data)) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.InvalidDataType, method: Method.Some }, { key, path, type: 'primitive' })); + + return payload; + } + + if (data !== value) { + continue; + } + + payload.data = true; + + break; + } + } + + return payload; + } + + public async [Method.Update](payload: Payload.Update): Promise> { + const { key, hook } = payload; + const getPayload = await this[Method.Get]({ method: Method.Get, errors: [], key, path: [] }); + + if (!isPayloadWithData(getPayload)) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.MissingData, method: Method.Update }, { key })); + + return payload; + } + + const { data } = getPayload; + + await this[Method.Set]({ method: Method.Set, errors: [], key, path: [], value: await hook(data, key) }); + + return payload; + } + + public async [Method.Values](payload: Payload.Values): Promise> { + payload.data = await this.handler.values(); + + return payload; + } + + protected fetchVersion() { + return this.getMetadata('version'); + } +} + +export namespace IndexedDBProvider { + export interface Options {} + + export enum Identifiers { + DatabaseHandlerNotFound = 'databaseHandlerNotFound', + + MissingIndexedDB = 'missingIndexedDB', + + NotInitialized = 'notInitialized' + } +} diff --git a/packages/indexeddb/src/tsconfig.json b/packages/indexeddb/src/tsconfig.json new file mode 100644 index 00000000..608b05a6 --- /dev/null +++ b/packages/indexeddb/src/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "rootDir": "./", + "outDir": "../dist", + "composite": true, + "tsBuildInfoFile": "../dist/.tsbuildinfo", + "lib": ["DOM"] + }, + "include": ["."] +} diff --git a/packages/indexeddb/tests/lib/DatabaseHandler.test.ts b/packages/indexeddb/tests/lib/DatabaseHandler.test.ts new file mode 100644 index 00000000..81337655 --- /dev/null +++ b/packages/indexeddb/tests/lib/DatabaseHandler.test.ts @@ -0,0 +1,202 @@ +import 'fake-indexeddb/auto'; +import { DatabaseHandler } from '../../src/lib/DatabaseHandler'; + +describe('DatabaseHandler', () => { + describe('is a class', () => { + test('GIVEN typeof DatabaseHandler THEN returns function', () => { + expect(typeof DatabaseHandler).toBe('function'); + }); + + test('GIVEN typeof ...prototype THEN returns object', () => { + expect(typeof DatabaseHandler.prototype).toBe('object'); + }); + }); + + describe('can manipulate data', () => { + const handler = new DatabaseHandler({ name: 'test', version: { major: 2, minor: 0, patch: 0 } }); + + beforeAll(async () => { + await handler.init(); + }); + + beforeEach(async () => { + await handler.clear(); + }); + + describe('with clear method', () => { + test('GIVEN no data THEN resolves', async () => { + await expect(handler.clear()).resolves.toBeUndefined(); + await expect(handler.size()).resolves.toBe(0); + }); + + test('GIVEN data THEN clears data', async () => { + await handler.set('key', 'value'); + await expect(handler.size()).resolves.toBe(1); + await expect(handler.clear()).resolves.toBeUndefined(); + await expect(handler.size()).resolves.toBe(0); + }); + }); + + describe('with delete method', () => { + test('GIVEN no data THEN returns false', async () => { + await expect(handler.delete('key')).resolves.toBe(false); + }); + + test('GIVEN data THEN returns true AND deletes value', async () => { + await handler.set('key', 'value'); + await expect(handler.delete('key')).resolves.toBe(true); + }); + }); + + describe('with deleteMany method', () => { + test('GIVEN no data THEN does nothing', async () => { + await expect(handler.deleteMany(['key'])).resolves.toBeUndefined(); + }); + + test('GIVEN data THEN deletes value', async () => { + await handler.set('key', 'value'); + + await expect(handler.deleteMany(['key'])).resolves.toBeUndefined(); + + await expect(handler.has('key')).resolves.toBe(false); + }); + + test('GIVEN data THEN deletes values', async () => { + await handler.set('key', 'value'); + await handler.set('key2', 'value'); + + await expect(handler.deleteMany(['key', 'key2'])).resolves.toBeUndefined(); + + await expect(handler.has('key')).resolves.toBe(false); + await expect(handler.has('key2')).resolves.toBe(false); + }); + }); + + describe('with entries method', () => { + test('GIVEN no data THEN returns empty array', async () => { + await expect(handler.entries()).resolves.toEqual([]); + }); + + test('GIVEN data THEN returns array', async () => { + await handler.set('key', 'value'); + await expect(handler.entries()).resolves.toEqual([['key', 'value']]); + }); + }); + + describe('with get method', () => { + test('GIVEN no data THEN returns undefined', async () => { + await expect(handler.get('key')).resolves.toBeUndefined(); + }); + + test('GIVEN data THEN returns value', async () => { + await handler.set('key', 'value'); + await expect(handler.get('key')).resolves.toBe('value'); + }); + }); + + describe('with getMany method', () => { + test('GIVEN no data THEN returns empty array', async () => { + await expect(handler.getMany(['key'])).resolves.toEqual({ key: null }); + }); + + test('GIVEN data THEN returns value', async () => { + await handler.set('key', 'value'); + await expect(handler.getMany(['key'])).resolves.toEqual({ key: 'value' }); + }); + + test('GIVEN data THEN returns values', async () => { + await handler.set('key', 'value'); + await handler.set('key2', 'value'); + await expect(handler.getMany(['key', 'key2'])).resolves.toEqual({ key: 'value', key2: 'value' }); + }); + }); + + describe('with has method', () => { + test('GIVEN no data THEN returns false', async () => { + await expect(handler.has('key')).resolves.toBe(false); + }); + + test('GIVEN data THEN returns true', async () => { + await handler.set('key', 'value'); + await expect(handler.has('key')).resolves.toBe(true); + }); + }); + + describe('with keys method', () => { + test('with no data THEN returns empty array', async () => { + await expect(handler.keys()).resolves.toEqual([]); + }); + + test('with data THEN returns array', async () => { + await handler.set('key', 'value'); + await expect(handler.keys()).resolves.toEqual(['key']); + }); + }); + + describe('with set method', () => { + test('GIVEN no data THEN sets value', async () => { + await expect(handler.set('key', 'value')).resolves.toBeUndefined(); + await expect(handler.has('key')).resolves.toBe(true); + }); + }); + + describe('with setMany method', () => { + test('GIVEN no data THEN sets values', async () => { + await expect(handler.setMany([['key', 'value']], true)).resolves.toBeUndefined(); + + await expect(handler.has('key')).resolves.toBe(true); + }); + + test('GIVEN data THEN sets value', async () => { + await handler.set('key', 'value'); + await expect(handler.setMany([['key', 'value']], true)).resolves.toBeUndefined(); + + await expect(handler.has('key')).resolves.toBe(true); + }); + + test('GIVEN data THEN skips value', async () => { + await handler.set('key', 'value'); + await expect(handler.setMany([['key', 'value2']], false)).resolves.toBeUndefined(); + + await expect(handler.get('key')).resolves.toBe('value'); + }); + + test('GIVEN data THEN sets values', async () => { + await expect( + handler.setMany( + [ + ['key', 'value'], + ['key2', 'value'] + ], + true + ) + ).resolves.toBeUndefined(); + + await expect(handler.has('key')).resolves.toBe(true); + await expect(handler.has('key2')).resolves.toBe(true); + }); + }); + + describe('with size method', () => { + test('GIVEN no data THEN returns 0', async () => { + await expect(handler.size()).resolves.toBe(0); + }); + + test('GIVEN data THEN returns 1', async () => { + await handler.set('key', 'value'); + await expect(handler.size()).resolves.toBe(1); + }); + }); + + describe('with values method', () => { + test('GIVEN no data THEN returns empty array', async () => { + await expect(handler.values()).resolves.toEqual([]); + }); + + test('GIVEN data THEN returns array', async () => { + await handler.set('key', 'value'); + await expect(handler.values()).resolves.toEqual(['value']); + }); + }); + }); +}); diff --git a/packages/indexeddb/tests/lib/IndexedDBProvider.test.ts b/packages/indexeddb/tests/lib/IndexedDBProvider.test.ts new file mode 100644 index 00000000..f3e9ea40 --- /dev/null +++ b/packages/indexeddb/tests/lib/IndexedDBProvider.test.ts @@ -0,0 +1,8 @@ +import { runProviderTest } from '@joshdb/provider/tests'; +import 'fake-indexeddb/auto'; +import { IndexedDBProvider } from '../../src'; + +runProviderTest({ + providerConstructor: IndexedDBProvider, + providerOptions: {} +}); diff --git a/packages/indexeddb/tests/tsconfig.json b/packages/indexeddb/tests/tsconfig.json new file mode 100644 index 00000000..016ad86a --- /dev/null +++ b/packages/indexeddb/tests/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "rootDir": "./", + "outDir": "./build", + "tsBuildInfoFile": "./build/.tsbuildinfo", + "types": ["vitest/globals"], + "lib": ["DOM"] + }, + "include": ["./"], + "references": [ + { + "path": "../src" + } + ] +} diff --git a/packages/indexeddb/tsconfig.eslint.json b/packages/indexeddb/tsconfig.eslint.json new file mode 100644 index 00000000..23fb482d --- /dev/null +++ b/packages/indexeddb/tsconfig.eslint.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "allowJs": true, + "checkJs": true + }, + "include": ["src", "tests"] +} diff --git a/packages/indexeddb/typedoc.json b/packages/indexeddb/typedoc.json new file mode 100644 index 00000000..308c2b62 --- /dev/null +++ b/packages/indexeddb/typedoc.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://typedoc.org/schema.json", + "entryPoints": ["src/index.ts"], + "json": "docs/api.json", + "tsconfig": "src/tsconfig.json", + "treatWarningsAsErrors": true +} diff --git a/packages/indexeddb/vitest.config.ts b/packages/indexeddb/vitest.config.ts new file mode 100644 index 00000000..2dd4d4f2 --- /dev/null +++ b/packages/indexeddb/vitest.config.ts @@ -0,0 +1,11 @@ +import { resolve } from 'node:path'; +import { createVitestConfig } from '../../scripts/vitest.config'; + +export default createVitestConfig({ + test: { + coverage: { + reportsDirectory: '../../coverage' + } + }, + resolve: { alias: [{ find: '@joshdb/provider/tests', replacement: resolve('../../node_modules/@joshdb/provider/tests') }] } +}); diff --git a/packages/json/cliff.toml b/packages/json/cliff.toml index 6af1d12d..0698da18 100644 --- a/packages/json/cliff.toml +++ b/packages/json/cliff.toml @@ -6,32 +6,31 @@ All notable changes to this project will be documented in this file.\n """ body = """ {% if version %}\ - # [{{ version | trim_start_matches(pat="v") }}]\ - {% if previous %}\ - {% if previous.version %}\ - (https://github.com/josh-development/providers/compare/{{ previous.version }}...{{ version }})\ - {% else %}\ - (https://github.com/josh-development/providers/tree/{{ version }})\ - {% endif %}\ - {% endif %} \ - - ({{ timestamp | date(format="%Y-%m-%d") }}) + # [{{ version | trim_start_matches(pat="v") }}]\ + {% if previous %}\ + {% if previous.version %}\ + (https://github.com/josh-development/providers/compare/{{ previous.version }}...{{ version }})\ + {% else %}\ + (https://github.com/josh-development/providers/tree/{{ version }})\ + {% endif %}\ + {% endif %} \ + - ({{ timestamp | date(format="%Y-%m-%d") }}) {% else %}\ - # [unreleased] + # [unreleased] {% endif %}\ {% for group, commits in commits | group_by(attribute="group") %} - ## {{ group | upper_first }} - {% for commit in commits %} + ## {{ group | upper_first }} + {% for commit in commits %} - {% if commit.scope %}\ **{{commit.scope}}:** \ - {% endif %}\ - {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/josh-development/providers/commit/{{ commit.id }}))\ + {% endif %}\ + {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/josh-development/providers/commit/{{ commit.id }}))\ {% if commit.breaking %}\ - \n\n {% raw %} {% endraw %}### πŸ’₯ Breaking Changes:\n\n\ {% for breakingChange in commit.footers %}\ - {% raw %} {% endraw %}- {{ breakingChange }}\n\ + \n{% raw %} {% endraw %}- πŸ’₯ **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ {% endfor %}\ {% endif %}\ - {% endfor %} + {% endfor %} {% endfor %}\n """ trim = true diff --git a/packages/json/package.json b/packages/json/package.json index 2e1efd53..db544bfc 100644 --- a/packages/json/package.json +++ b/packages/json/package.json @@ -27,7 +27,7 @@ "check-update": "cliff-jumper --dry-run" }, "dependencies": { - "@joshdb/provider": "2.0.0-next.a699598.0", + "@joshdb/provider": "2.0.0-next.095d141.0", "@sapphire/async-queue": "^1.5.0", "@sapphire/snowflake": "^3.5.1", "@sapphire/utilities": "^3.12.0", diff --git a/packages/json/src/lib/JSONProvider.ts b/packages/json/src/lib/JSONProvider.ts index 690a483c..fc290f05 100644 --- a/packages/json/src/lib/JSONProvider.ts +++ b/packages/json/src/lib/JSONProvider.ts @@ -550,60 +550,70 @@ export class JSONProvider extends JoshProvider): Promise> { - const { count, duplicates } = payload; + const { count, unique } = payload; const size = await this.handler.size(); - if (size === 0) return { ...payload, data: [] }; - if (size < count) { + if (unique && size < count) { payload.errors.push(this.error({ identifier: CommonIdentifiers.InvalidCount, method: Method.Random }, { size })); return payload; } + if (size === 0) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.MissingData, method: Method.Random }, { unique, count })); + + return payload; + } + payload.data = []; const keys = await this.handler.keys(); - if (duplicates) { - while (payload.data.length < count) { - const key = keys[Math.floor(Math.random() * size)]; - - payload.data.push((await this.handler.get(key))!); - } - } else { + if (unique) { const randomKeys = new Set(); while (randomKeys.size < count) randomKeys.add(keys[Math.floor(Math.random() * keys.length)]); for (const key of randomKeys) payload.data.push((await this.handler.get(key))!); + } else { + while (payload.data.length < count) { + const key = keys[Math.floor(Math.random() * size)]; + + payload.data.push((await this.handler.get(key))!); + } } return payload; } public async [Method.RandomKey](payload: Payload.RandomKey): Promise { - const { count, duplicates } = payload; + const { count, unique } = payload; const size = await this.handler.size(); - if (size === 0) return { ...payload, data: [] }; - if (size < count) { + if (unique && size < count) { payload.errors.push(this.error({ identifier: CommonIdentifiers.InvalidCount, method: Method.RandomKey }, { size })); return payload; } + if (size === 0) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.MissingData, method: Method.RandomKey }, { size })); + + return payload; + } + payload.data = []; const keys = await this.handler.keys(); - if (duplicates) { - while (payload.data.length < count) payload.data.push(keys[Math.floor(Math.random() * size)]); - } else { + if (unique) { const randomKeys = new Set(); while (randomKeys.size < count) randomKeys.add(keys[Math.floor(Math.random() * keys.length)]); for (const key of randomKeys) payload.data.push(key); + } else { + while (payload.data.length < count) payload.data.push(keys[Math.floor(Math.random() * size)]); } return payload; diff --git a/packages/map/cliff.toml b/packages/map/cliff.toml index b769aa86..f5f587a5 100644 --- a/packages/map/cliff.toml +++ b/packages/map/cliff.toml @@ -6,32 +6,31 @@ All notable changes to this project will be documented in this file.\n """ body = """ {% if version %}\ - # [{{ version | trim_start_matches(pat="v") }}]\ - {% if previous %}\ - {% if previous.version %}\ - (https://github.com/josh-development/providers/compare/{{ previous.version }}...{{ version }})\ - {% else %}\ - (https://github.com/josh-development/providers/tree/{{ version }})\ - {% endif %}\ - {% endif %} \ - - ({{ timestamp | date(format="%Y-%m-%d") }}) + # [{{ version | trim_start_matches(pat="v") }}]\ + {% if previous %}\ + {% if previous.version %}\ + (https://github.com/josh-development/providers/compare/{{ previous.version }}...{{ version }})\ + {% else %}\ + (https://github.com/josh-development/providers/tree/{{ version }})\ + {% endif %}\ + {% endif %} \ + - ({{ timestamp | date(format="%Y-%m-%d") }}) {% else %}\ - # [unreleased] + # [unreleased] {% endif %}\ {% for group, commits in commits | group_by(attribute="group") %} - ## {{ group | upper_first }} - {% for commit in commits %} + ## {{ group | upper_first }} + {% for commit in commits %} - {% if commit.scope %}\ **{{commit.scope}}:** \ - {% endif %}\ - {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/josh-development/providers/commit/{{ commit.id }}))\ + {% endif %}\ + {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/josh-development/providers/commit/{{ commit.id }}))\ {% if commit.breaking %}\ - \n\n {% raw %} {% endraw %}### πŸ’₯ Breaking Changes:\n\n\ {% for breakingChange in commit.footers %}\ - {% raw %} {% endraw %}- {{ breakingChange }}\n\ + \n{% raw %} {% endraw %}- πŸ’₯ **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ {% endfor %}\ {% endif %}\ - {% endfor %} + {% endfor %} {% endfor %}\n """ trim = true diff --git a/packages/map/package.json b/packages/map/package.json index 1eb1237a..f3caf8b6 100644 --- a/packages/map/package.json +++ b/packages/map/package.json @@ -26,7 +26,7 @@ "check-update": "cliff-jumper --dry-run" }, "dependencies": { - "@joshdb/provider": "2.0.0-next.a699598.0", + "@joshdb/provider": "2.0.0-next.095d141.0", "@sapphire/utilities": "^3.12.0", "better-serialize": "^1.0.0", "property-helpers": "^2.0.0" diff --git a/packages/map/src/lib/MapProvider.ts b/packages/map/src/lib/MapProvider.ts index 722a89a4..56fd215c 100644 --- a/packages/map/src/lib/MapProvider.ts +++ b/packages/map/src/lib/MapProvider.ts @@ -488,60 +488,68 @@ export class MapProvider extends JoshProvider): Payload.Random { - if (this.cache.size === 0) return { ...payload, data: [] }; + const { count, unique } = payload; - const { count, duplicates } = payload; - - if (this.cache.size < count) { + if (unique && this.cache.size < count) { payload.errors.push(this.error({ identifier: CommonIdentifiers.InvalidCount, method: Method.Random })); return payload; } + if (this.cache.size === 0) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.MissingData, method: Method.Random, context: { unique, count } })); + + return payload; + } + payload.data = []; const keys = Array.from(this.cache.keys()); - if (duplicates) { - while (payload.data.length < count) { - const key = keys[Math.floor(Math.random() * keys.length)]; - - payload.data.push(this.cache.get(key)!); - } - } else { + if (unique) { const randomKeys = new Set(); while (randomKeys.size < count) randomKeys.add(keys[Math.floor(Math.random() * keys.length)]); for (const key of randomKeys) payload.data.push(this.cache.get(key)!); + } else { + while (payload.data.length < count) { + const key = keys[Math.floor(Math.random() * keys.length)]; + + payload.data.push(this.cache.get(key)!); + } } return payload; } public [Method.RandomKey](payload: Payload.RandomKey): Payload.RandomKey { - if (this.cache.size === 0) return { ...payload, data: [] }; + const { count, unique } = payload; - const { count, duplicates } = payload; - - if (this.cache.size < count) { + if (unique && this.cache.size < count) { payload.errors.push(this.error({ identifier: CommonIdentifiers.InvalidCount, method: Method.RandomKey })); return payload; } + if (this.cache.size === 0) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.MissingData, method: Method.RandomKey })); + + return payload; + } + payload.data = []; const keys = Array.from(this.cache.keys()); - if (duplicates) { - while (payload.data.length < count) payload.data.push(keys[Math.floor(Math.random() * keys.length)]); - } else { + if (unique) { const randomKeys = new Set(); while (randomKeys.size < count) randomKeys.add(keys[Math.floor(Math.random() * keys.length)]); for (const key of randomKeys) payload.data.push(key); + } else { + while (payload.data.length < count) payload.data.push(keys[Math.floor(Math.random() * keys.length)]); } return payload; diff --git a/packages/maria/cliff.toml b/packages/maria/cliff.toml index c2f9a048..5e7fadf0 100644 --- a/packages/maria/cliff.toml +++ b/packages/maria/cliff.toml @@ -6,32 +6,31 @@ All notable changes to this project will be documented in this file.\n """ body = """ {% if version %}\ - # [{{ version | trim_start_matches(pat="v") }}]\ - {% if previous %}\ - {% if previous.version %}\ - (https://github.com/josh-development/providers/compare/{{ previous.version }}...{{ version }})\ - {% else %}\ - (https://github.com/josh-development/providers/tree/{{ version }})\ - {% endif %}\ - {% endif %} \ - - ({{ timestamp | date(format="%Y-%m-%d") }}) + # [{{ version | trim_start_matches(pat="v") }}]\ + {% if previous %}\ + {% if previous.version %}\ + (https://github.com/josh-development/providers/compare/{{ previous.version }}...{{ version }})\ + {% else %}\ + (https://github.com/josh-development/providers/tree/{{ version }})\ + {% endif %}\ + {% endif %} \ + - ({{ timestamp | date(format="%Y-%m-%d") }}) {% else %}\ - # [unreleased] + # [unreleased] {% endif %}\ {% for group, commits in commits | group_by(attribute="group") %} - ## {{ group | upper_first }} - {% for commit in commits %} + ## {{ group | upper_first }} + {% for commit in commits %} - {% if commit.scope %}\ **{{commit.scope}}:** \ - {% endif %}\ - {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/josh-development/providers/commit/{{ commit.id }}))\ + {% endif %}\ + {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/josh-development/providers/commit/{{ commit.id }}))\ {% if commit.breaking %}\ - \n\n {% raw %} {% endraw %}### πŸ’₯ Breaking Changes:\n\n\ {% for breakingChange in commit.footers %}\ - {% raw %} {% endraw %}- {{ breakingChange }}\n\ + \n{% raw %} {% endraw %}- πŸ’₯ **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ {% endfor %}\ {% endif %}\ - {% endfor %} + {% endfor %} {% endfor %}\n """ trim = true diff --git a/packages/maria/package.json b/packages/maria/package.json index 18584f07..84e8d226 100644 --- a/packages/maria/package.json +++ b/packages/maria/package.json @@ -26,7 +26,7 @@ "check-update": "cliff-jumper --dry-run" }, "dependencies": { - "@joshdb/provider": "2.0.0-next.a699598.0", + "@joshdb/provider": "2.0.0-next.095d141.0", "@sapphire/snowflake": "^3.5.1", "better-serialize": "^1.0.0", "mariadb": "^3.2.0" diff --git a/packages/maria/src/lib/MariaProvider.ts b/packages/maria/src/lib/MariaProvider.ts index 86ba1a1e..89c6a9a1 100644 --- a/packages/maria/src/lib/MariaProvider.ts +++ b/packages/maria/src/lib/MariaProvider.ts @@ -517,60 +517,70 @@ export class MariaProvider extends JoshProvider): Promise> { - const { count, duplicates } = payload; + const { count, unique } = payload; const size = await this.handler.size(); - if (size === 0) return { ...payload, data: [] }; - if (size < count) { + if (unique && size < count) { payload.errors.push(this.error({ identifier: CommonIdentifiers.InvalidCount, method: Method.Random })); return payload; } + if (size === 0) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.MissingData, method: Method.Random, context: { unique, count } })); + + return payload; + } + payload.data = []; const keys = await this.handler.keys(); - if (duplicates) { - while (payload.data.length < count) { - const key = keys[Math.floor(Math.random() * size)]; - - payload.data.push((await this.handler.get(key))!); - } - } else { + if (unique) { const randomKeys = new Set(); while (randomKeys.size < count) randomKeys.add(keys[Math.floor(Math.random() * keys.length)]); for (const key of randomKeys) payload.data.push((await this.handler.get(key))!); + } else { + while (payload.data.length < count) { + const key = keys[Math.floor(Math.random() * size)]; + + payload.data.push((await this.handler.get(key))!); + } } return payload; } public async [Method.RandomKey](payload: Payload.RandomKey): Promise { - const { count, duplicates } = payload; + const { count, unique } = payload; const size = await this.handler.size(); - if (size === 0) return { ...payload, data: [] }; - if (size < count) { + if (unique && size < count) { payload.errors.push(this.error({ identifier: CommonIdentifiers.InvalidCount, method: Method.RandomKey })); return payload; } + if (size === 0) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.MissingData, method: Method.RandomKey })); + + return payload; + } + payload.data = []; const keys = await this.handler.keys(); - if (duplicates) { - while (payload.data.length < count) payload.data.push(keys[Math.floor(Math.random() * size)]); - } else { + if (unique) { const randomKeys = new Set(); while (randomKeys.size < count) randomKeys.add(keys[Math.floor(Math.random() * keys.length)]); for (const key of randomKeys) payload.data.push(key); + } else { + while (payload.data.length < count) payload.data.push(keys[Math.floor(Math.random() * size)]); } return payload; diff --git a/packages/mongo/cliff.toml b/packages/mongo/cliff.toml index 76d0d725..0ae321f1 100644 --- a/packages/mongo/cliff.toml +++ b/packages/mongo/cliff.toml @@ -6,32 +6,31 @@ All notable changes to this project will be documented in this file.\n """ body = """ {% if version %}\ - # [{{ version | trim_start_matches(pat="v") }}]\ - {% if previous %}\ - {% if previous.version %}\ - (https://github.com/josh-development/providers/compare/{{ previous.version }}...{{ version }})\ - {% else %}\ - (https://github.com/josh-development/providers/tree/{{ version }})\ - {% endif %}\ - {% endif %} \ - - ({{ timestamp | date(format="%Y-%m-%d") }}) + # [{{ version | trim_start_matches(pat="v") }}]\ + {% if previous %}\ + {% if previous.version %}\ + (https://github.com/josh-development/providers/compare/{{ previous.version }}...{{ version }})\ + {% else %}\ + (https://github.com/josh-development/providers/tree/{{ version }})\ + {% endif %}\ + {% endif %} \ + - ({{ timestamp | date(format="%Y-%m-%d") }}) {% else %}\ - # [unreleased] + # [unreleased] {% endif %}\ {% for group, commits in commits | group_by(attribute="group") %} - ## {{ group | upper_first }} - {% for commit in commits %} + ## {{ group | upper_first }} + {% for commit in commits %} - {% if commit.scope %}\ **{{commit.scope}}:** \ - {% endif %}\ - {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/josh-development/providers/commit/{{ commit.id }}))\ + {% endif %}\ + {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/josh-development/providers/commit/{{ commit.id }}))\ {% if commit.breaking %}\ - \n\n {% raw %} {% endraw %}### πŸ’₯ Breaking Changes:\n\n\ {% for breakingChange in commit.footers %}\ - {% raw %} {% endraw %}- {{ breakingChange }}\n\ + \n{% raw %} {% endraw %}- πŸ’₯ **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ {% endfor %}\ {% endif %}\ - {% endfor %} + {% endfor %} {% endfor %}\n """ trim = true diff --git a/packages/mongo/package.json b/packages/mongo/package.json index f28ef43f..f11bf299 100644 --- a/packages/mongo/package.json +++ b/packages/mongo/package.json @@ -27,7 +27,7 @@ "check-update": "cliff-jumper --dry-run" }, "dependencies": { - "@joshdb/provider": "2.0.0-next.a699598.0", + "@joshdb/provider": "2.0.0-next.095d141.0", "@sapphire/utilities": "^3.12.0", "better-serialize": "^1.0.0", "mongodb": "~5.6.0", diff --git a/packages/mongo/src/lib/MongoProvider.ts b/packages/mongo/src/lib/MongoProvider.ts index 147c3e9a..4135a366 100644 --- a/packages/mongo/src/lib/MongoProvider.ts +++ b/packages/mongo/src/lib/MongoProvider.ts @@ -601,6 +601,12 @@ export class MongoProvider extends JoshProvider): Promise> { const docCount = await this.collection.countDocuments({}); + // TODO: @dan-online fix this yourself idk how this work + // Basically just this: + // if(unique && size < count) throw InvalidCount + // if (size === 0) throw MissingData + // Also try no to get an infinite loop with unique off and count > size + if (docCount === 0) return { ...payload, data: [] }; if (docCount < payload.count) { payload.errors.push(this.error({ identifier: CommonIdentifiers.InvalidCount, method: Method.Random })); diff --git a/packages/postgresql/cliff.toml b/packages/postgresql/cliff.toml index 7637e28f..0dd7d040 100644 --- a/packages/postgresql/cliff.toml +++ b/packages/postgresql/cliff.toml @@ -6,32 +6,31 @@ All notable changes to this project will be documented in this file.\n """ body = """ {% if version %}\ - # [{{ version | trim_start_matches(pat="v") }}]\ - {% if previous %}\ - {% if previous.version %}\ - (https://github.com/josh-development/providers/compare/{{ previous.version }}...{{ version }})\ - {% else %}\ - (https://github.com/josh-development/providers/tree/{{ version }})\ - {% endif %}\ - {% endif %} \ - - ({{ timestamp | date(format="%Y-%m-%d") }}) + # [{{ version | trim_start_matches(pat="v") }}]\ + {% if previous %}\ + {% if previous.version %}\ + (https://github.com/josh-development/providers/compare/{{ previous.version }}...{{ version }})\ + {% else %}\ + (https://github.com/josh-development/providers/tree/{{ version }})\ + {% endif %}\ + {% endif %} \ + - ({{ timestamp | date(format="%Y-%m-%d") }}) {% else %}\ - # [unreleased] + # [unreleased] {% endif %}\ {% for group, commits in commits | group_by(attribute="group") %} - ## {{ group | upper_first }} - {% for commit in commits %} + ## {{ group | upper_first }} + {% for commit in commits %} - {% if commit.scope %}\ **{{commit.scope}}:** \ - {% endif %}\ - {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/josh-development/providers/commit/{{ commit.id }}))\ + {% endif %}\ + {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/josh-development/providers/commit/{{ commit.id }}))\ {% if commit.breaking %}\ - \n\n {% raw %} {% endraw %}### πŸ’₯ Breaking Changes:\n\n\ {% for breakingChange in commit.footers %}\ - {% raw %} {% endraw %}- {{ breakingChange }}\n\ + \n{% raw %} {% endraw %}- πŸ’₯ **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ {% endfor %}\ {% endif %}\ - {% endfor %} + {% endfor %} {% endfor %}\n """ trim = true diff --git a/packages/postgresql/package.json b/packages/postgresql/package.json index 2bc85228..f575b042 100644 --- a/packages/postgresql/package.json +++ b/packages/postgresql/package.json @@ -28,7 +28,7 @@ "check-update": "cliff-jumper --dry-run" }, "dependencies": { - "@joshdb/provider": "2.0.0-next.a699598.0", + "@joshdb/provider": "2.0.0-next.095d141.0", "@sapphire/snowflake": "^3.5.1", "@sapphire/utilities": "^3.12.0", "better-serialize": "^1.0.0", diff --git a/packages/postgresql/src/lib/PostgreSQLProvider.ts b/packages/postgresql/src/lib/PostgreSQLProvider.ts index 80aca79f..3c6c0785 100644 --- a/packages/postgresql/src/lib/PostgreSQLProvider.ts +++ b/packages/postgresql/src/lib/PostgreSQLProvider.ts @@ -506,60 +506,70 @@ export class PostgreSQLProvider extends JoshProvider): Promise> { - const { count, duplicates } = payload; + const { count, unique } = payload; const size = await this.handler.size(); - if (size === 0) return { ...payload, data: [] }; - if (size < count) { + if (unique && size < count) { payload.errors.push(this.error({ identifier: CommonIdentifiers.InvalidCount, method: Method.Random })); return payload; } + if (size === 0) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.MissingData, method: Method.Random })); + + return payload; + } + payload.data = []; const keys = await this.handler.keys(); - if (duplicates) { - while (payload.data.length < count) { - const key = keys[Math.floor(Math.random() * size)]; - - payload.data.push((await this.handler.get(key))!); - } - } else { + if (unique) { const randomKeys = new Set(); while (randomKeys.size < count) randomKeys.add(keys[Math.floor(Math.random() * keys.length)]); for (const key of randomKeys) payload.data.push((await this.handler.get(key))!); + } else { + while (payload.data.length < count) { + const key = keys[Math.floor(Math.random() * size)]; + + payload.data.push((await this.handler.get(key))!); + } } return payload; } public async [Method.RandomKey](payload: Payload.RandomKey): Promise { - const { count, duplicates } = payload; + const { count, unique } = payload; const size = await this.handler.size(); - if (size === 0) return { ...payload, data: [] }; - if (size < count) { + if (unique && size < count) { payload.errors.push(this.error({ identifier: CommonIdentifiers.InvalidCount, method: Method.RandomKey })); return payload; } + if (size === 0) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.MissingData, method: Method.RandomKey })); + + return payload; + } + payload.data = []; const keys = await this.handler.keys(); - if (duplicates) { - while (payload.data.length < count) payload.data.push(keys[Math.floor(Math.random() * size)]); - } else { + if (unique) { const randomKeys = new Set(); while (randomKeys.size < count) randomKeys.add(keys[Math.floor(Math.random() * keys.length)]); for (const key of randomKeys) payload.data.push(key); + } else { + while (payload.data.length < count) payload.data.push(keys[Math.floor(Math.random() * size)]); } return payload; diff --git a/packages/redis/cliff.toml b/packages/redis/cliff.toml index c631d32c..8b3dd76d 100644 --- a/packages/redis/cliff.toml +++ b/packages/redis/cliff.toml @@ -6,32 +6,31 @@ All notable changes to this project will be documented in this file.\n """ body = """ {% if version %}\ - # [{{ version | trim_start_matches(pat="v") }}]\ - {% if previous %}\ - {% if previous.version %}\ - (https://github.com/josh-development/providers/compare/{{ previous.version }}...{{ version }})\ - {% else %}\ - (https://github.com/josh-development/providers/tree/{{ version }})\ - {% endif %}\ - {% endif %} \ - - ({{ timestamp | date(format="%Y-%m-%d") }}) + # [{{ version | trim_start_matches(pat="v") }}]\ + {% if previous %}\ + {% if previous.version %}\ + (https://github.com/josh-development/providers/compare/{{ previous.version }}...{{ version }})\ + {% else %}\ + (https://github.com/josh-development/providers/tree/{{ version }})\ + {% endif %}\ + {% endif %} \ + - ({{ timestamp | date(format="%Y-%m-%d") }}) {% else %}\ - # [unreleased] + # [unreleased] {% endif %}\ {% for group, commits in commits | group_by(attribute="group") %} - ## {{ group | upper_first }} - {% for commit in commits %} + ## {{ group | upper_first }} + {% for commit in commits %} - {% if commit.scope %}\ **{{commit.scope}}:** \ - {% endif %}\ - {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/josh-development/providers/commit/{{ commit.id }}))\ + {% endif %}\ + {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/josh-development/providers/commit/{{ commit.id }}))\ {% if commit.breaking %}\ - \n\n {% raw %} {% endraw %}### πŸ’₯ Breaking Changes:\n\n\ {% for breakingChange in commit.footers %}\ - {% raw %} {% endraw %}- {{ breakingChange }}\n\ + \n{% raw %} {% endraw %}- πŸ’₯ **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ {% endfor %}\ {% endif %}\ - {% endfor %} + {% endfor %} {% endfor %}\n """ trim = true diff --git a/packages/redis/package.json b/packages/redis/package.json index 5ef808b6..1c88ff00 100644 --- a/packages/redis/package.json +++ b/packages/redis/package.json @@ -24,7 +24,7 @@ "check-update": "cliff-jumper --dry-run" }, "dependencies": { - "@joshdb/provider": "2.0.0-next.a699598.0", + "@joshdb/provider": "2.0.0-next.095d141.0", "better-serialize": "^1.0.0", "redis": "^4.6.7", "uuid": "^9.0.0" diff --git a/packages/redis/src/lib/RedisProvider.ts b/packages/redis/src/lib/RedisProvider.ts index 86310847..69961c28 100644 --- a/packages/redis/src/lib/RedisProvider.ts +++ b/packages/redis/src/lib/RedisProvider.ts @@ -540,24 +540,42 @@ export class RedisProvider extends JoshProvider): Promise> { const docCount = (await this[Method.Size]({ method: Method.Size, errors: [] })).data || 0; + const { unique } = payload; - if (docCount === 0) return { ...payload, data: [] }; - if (docCount < payload.count) { + if (unique && docCount < payload.count) { payload.errors.push(this.error({ identifier: CommonIdentifiers.InvalidCount, method: Method.Random }, { count: payload.count, docCount })); return payload; } + if (docCount === 0) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.MissingData, method: Method.Random }, { count: payload.count, docCount })); + + return payload; + } + const keys = await this[Method.Keys]({ method: Method.Keys, errors: [] }); keys.data = keys.data || []; payload.data = []; - for (let i = 0; i < payload.count; i++) { - const key = keys.data[Math.floor(Math.random() * keys.data.length)]; - const getPayload = await this[Method.Get]({ method: Method.Get, errors: [], key, path: [] }); + if (unique) { + const randomKeys = new Set(); + + while (randomKeys.size < docCount) randomKeys.add(keys.data[Math.floor(Math.random() * keys.data.length)]); - payload.data.push(getPayload.data as StoredValue); + for (const key of randomKeys) { + const getPayload = await this[Method.Get]({ method: Method.Get, errors: [], key, path: [] }); + + payload.data.push(getPayload.data as StoredValue); + } + } else { + for (let i = 0; i < payload.count; i++) { + const key = keys.data[Math.floor(Math.random() * keys.data.length)]; + const getPayload = await this[Method.Get]({ method: Method.Get, errors: [], key, path: [] }); + + payload.data.push(getPayload.data as StoredValue); + } } return payload; @@ -565,22 +583,37 @@ export class RedisProvider extends JoshProvider { const docCount = (await this[Method.Size]({ method: Method.Size, errors: [] })).data || 0; + const { unique } = payload; - if (docCount === 0) return { ...payload, data: [] }; - if (docCount < payload.count) { + if (unique && docCount < payload.count) { payload.errors.push(this.error({ identifier: CommonIdentifiers.InvalidCount, method: Method.RandomKey }, { count: payload.count, docCount })); return payload; } + if (docCount === 0) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.MissingData, method: Method.Random }, { count: payload.count, docCount })); + + return payload; + } + const keys = await this[Method.Keys]({ method: Method.Keys, errors: [] }); keys.data = keys.data || []; payload.data = []; - for (let i = 0; i < payload.count; i++) { - const key = keys.data[Math.floor(Math.random() * keys.data.length)]; - payload.data.push(key); + if (unique) { + const randomKeys = new Set(); + + while (randomKeys.size < docCount) randomKeys.add(keys.data[Math.floor(Math.random() * keys.data.length)]); + + payload.data = Array.from(randomKeys); + } else { + for (let i = 0; i < payload.count; i++) { + const key = keys.data[Math.floor(Math.random() * keys.data.length)]; + + payload.data.push(key); + } } return payload; diff --git a/packages/sqlite/cliff.toml b/packages/sqlite/cliff.toml index dedad3ea..512a3952 100644 --- a/packages/sqlite/cliff.toml +++ b/packages/sqlite/cliff.toml @@ -6,32 +6,31 @@ All notable changes to this project will be documented in this file.\n """ body = """ {% if version %}\ - # [{{ version | trim_start_matches(pat="v") }}]\ - {% if previous %}\ - {% if previous.version %}\ - (https://github.com/josh-development/providers/compare/{{ previous.version }}...{{ version }})\ - {% else %}\ - (https://github.com/josh-development/providers/tree/{{ version }})\ - {% endif %}\ - {% endif %} \ - - ({{ timestamp | date(format="%Y-%m-%d") }}) + # [{{ version | trim_start_matches(pat="v") }}]\ + {% if previous %}\ + {% if previous.version %}\ + (https://github.com/josh-development/providers/compare/{{ previous.version }}...{{ version }})\ + {% else %}\ + (https://github.com/josh-development/providers/tree/{{ version }})\ + {% endif %}\ + {% endif %} \ + - ({{ timestamp | date(format="%Y-%m-%d") }}) {% else %}\ - # [unreleased] + # [unreleased] {% endif %}\ {% for group, commits in commits | group_by(attribute="group") %} - ## {{ group | upper_first }} - {% for commit in commits %} + ## {{ group | upper_first }} + {% for commit in commits %} - {% if commit.scope %}\ **{{commit.scope}}:** \ - {% endif %}\ - {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/josh-development/providers/commit/{{ commit.id }}))\ + {% endif %}\ + {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/josh-development/providers/commit/{{ commit.id }}))\ {% if commit.breaking %}\ - \n\n {% raw %} {% endraw %}### πŸ’₯ Breaking Changes:\n\n\ {% for breakingChange in commit.footers %}\ - {% raw %} {% endraw %}- {{ breakingChange }}\n\ + \n{% raw %} {% endraw %}- πŸ’₯ **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ {% endfor %}\ {% endif %}\ - {% endfor %} + {% endfor %} {% endfor %}\n """ trim = true diff --git a/packages/sqlite/package.json b/packages/sqlite/package.json index 8a5a82f8..9d392906 100644 --- a/packages/sqlite/package.json +++ b/packages/sqlite/package.json @@ -26,7 +26,7 @@ "check-update": "cliff-jumper --dry-run" }, "dependencies": { - "@joshdb/provider": "2.0.0-next.a699598.0", + "@joshdb/provider": "2.0.0-next.095d141.0", "@sapphire/utilities": "^3.12.0", "better-serialize": "^1.0.0", "better-sqlite3": "^8.4.0", diff --git a/packages/sqlite/src/lib/SQLiteProvider.ts b/packages/sqlite/src/lib/SQLiteProvider.ts index 18fab048..eed917d3 100644 --- a/packages/sqlite/src/lib/SQLiteProvider.ts +++ b/packages/sqlite/src/lib/SQLiteProvider.ts @@ -569,60 +569,70 @@ export class SQLiteProvider extends JoshProvider): Payload.Random { - const { count, duplicates } = payload; + const { count, unique } = payload; const size = this.handler.size(); - if (size === 0) return { ...payload, data: [] }; - if (size < count) { + if (unique && size < count) { payload.errors.push(this.error({ identifier: CommonIdentifiers.InvalidCount, method: Method.Random }, { size })); return payload; } + if (size === 0) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.MissingData, method: Method.Random }, { unique, count })); + + return payload; + } + payload.data = []; const keys = this.handler.keys(); - if (duplicates) { - while (payload.data.length < count) { - const key = keys[Math.floor(Math.random() * size)]; - - payload.data.push(this.handler.get(key)!); - } - } else { + if (unique) { const randomKeys = new Set(); while (randomKeys.size < count) randomKeys.add(keys[Math.floor(Math.random() * keys.length)]); for (const key of randomKeys) payload.data.push(this.handler.get(key)!); + } else { + while (payload.data.length < count) { + const key = keys[Math.floor(Math.random() * size)]; + + payload.data.push(this.handler.get(key)!); + } } return payload; } public [Method.RandomKey](payload: Payload.RandomKey): Payload.RandomKey { - const { count, duplicates } = payload; + const { count, unique } = payload; const size = this.handler.size(); - if (size === 0) return { ...payload, data: [] }; - if (size < count) { + if (unique && size < count) { payload.errors.push(this.error({ identifier: CommonIdentifiers.InvalidCount, method: Method.RandomKey }, { size })); return payload; } + if (size === 0) { + payload.errors.push(this.error({ identifier: CommonIdentifiers.MissingData, method: Method.RandomKey }, { size })); + + return payload; + } + payload.data = []; const keys = this.handler.keys(); - if (duplicates) { - while (payload.data.length < count) payload.data.push(keys[Math.floor(Math.random() * size)]); - } else { + if (unique) { const randomKeys = new Set(); while (randomKeys.size < count) randomKeys.add(keys[Math.floor(Math.random() * keys.length)]); for (const key of randomKeys) payload.data.push(key); + } else { + while (payload.data.length < count) payload.data.push(keys[Math.floor(Math.random() * size)]); } return payload; diff --git a/yarn.lock b/yarn.lock index 8bd9770c..c6d42301 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,6 +5,13 @@ __metadata: version: 6 cacheKey: 8 +"@aashutoshrathi/word-wrap@npm:^1.2.3": + version: 1.2.6 + resolution: "@aashutoshrathi/word-wrap@npm:1.2.6" + checksum: ada901b9e7c680d190f1d012c84217ce0063d8f5c5a7725bb91ec3c5ed99bb7572680eb2d2938a531ccbaec39a95422fcd8a6b4a13110c7d98dd75402f66a0cd + languageName: node + linkType: hard + "@ampproject/remapping@npm:^2.2.1": version: 2.2.1 resolution: "@ampproject/remapping@npm:2.2.1" @@ -16,29 +23,29 @@ __metadata: linkType: hard "@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.18.6": - version: 7.21.4 - resolution: "@babel/code-frame@npm:7.21.4" + version: 7.22.5 + resolution: "@babel/code-frame@npm:7.22.5" dependencies: - "@babel/highlight": ^7.18.6 - checksum: e5390e6ec1ac58dcef01d4f18eaf1fd2f1325528661ff6d4a5de8979588b9f5a8e852a54a91b923846f7a5c681b217f0a45c2524eb9560553160cd963b7d592c + "@babel/highlight": ^7.22.5 + checksum: cfe804f518f53faaf9a1d3e0f9f74127ab9a004912c3a16fda07fb6a633393ecb9918a053cb71804204c1b7ec3d49e1699604715e2cfb0c9f7bc4933d324ebb6 languageName: node linkType: hard -"@babel/helper-validator-identifier@npm:^7.18.6": - version: 7.19.1 - resolution: "@babel/helper-validator-identifier@npm:7.19.1" - checksum: 0eca5e86a729162af569b46c6c41a63e18b43dbe09fda1d2a3c8924f7d617116af39cac5e4cd5d431bb760b4dca3c0970e0c444789b1db42bcf1fa41fbad0a3a +"@babel/helper-validator-identifier@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-validator-identifier@npm:7.22.5" + checksum: 7f0f30113474a28298c12161763b49de5018732290ca4de13cdaefd4fd0d635a6fe3f6686c37a02905fb1e64f21a5ee2b55140cf7b070e729f1bd66866506aea languageName: node linkType: hard -"@babel/highlight@npm:^7.18.6": - version: 7.18.6 - resolution: "@babel/highlight@npm:7.18.6" +"@babel/highlight@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/highlight@npm:7.22.5" dependencies: - "@babel/helper-validator-identifier": ^7.18.6 + "@babel/helper-validator-identifier": ^7.22.5 chalk: ^2.0.0 js-tokens: ^4.0.0 - checksum: 92d8ee61549de5ff5120e945e774728e5ccd57fd3b2ed6eace020ec744823d4a98e242be1453d21764a30a14769ecd62170fba28539b211799bbaf232bbb2789 + checksum: f61ae6de6ee0ea8d9b5bcf2a532faec5ab0a1dc0f7c640e5047fc61630a0edb88b18d8c92eb06566d30da7a27db841aca11820ecd3ebe9ce514c9350fbed39c4 languageName: node linkType: hard @@ -427,34 +434,27 @@ __metadata: languageName: node linkType: hard -"@eslint/eslintrc@npm:^2.0.3": - version: 2.0.3 - resolution: "@eslint/eslintrc@npm:2.0.3" +"@eslint/eslintrc@npm:^2.1.0": + version: 2.1.0 + resolution: "@eslint/eslintrc@npm:2.1.0" dependencies: ajv: ^6.12.4 debug: ^4.3.2 - espree: ^9.5.2 + espree: ^9.6.0 globals: ^13.19.0 ignore: ^5.2.0 import-fresh: ^3.2.1 js-yaml: ^4.1.0 minimatch: ^3.1.2 strip-json-comments: ^3.1.1 - checksum: ddc51f25f8524d8231db9c9bf03177e503d941a332e8d5ce3b10b09241be4d5584a378a529a27a527586bfbccf3031ae539eb891352033c340b012b4d0c81d92 + checksum: d5ed0adbe23f6571d8c9bb0ca6edf7618dc6aed4046aa56df7139f65ae7b578874e0d9c796df784c25bda648ceb754b6320277d828c8b004876d7443b8dc018c languageName: node linkType: hard -"@eslint/js@npm:8.41.0": - version: 8.41.0 - resolution: "@eslint/js@npm:8.41.0" - checksum: af013d70fe8d0429cdf5cd8b5dcc6fc384ed026c1eccb0cfe30f5849b968ab91645111373fd1b83282b38955b1bdfbe667c1a7dbda3b06cae753521223cad775 - languageName: node - linkType: hard - -"@eslint/js@npm:8.43.0": - version: 8.43.0 - resolution: "@eslint/js@npm:8.43.0" - checksum: 580487a09c82ac169744d36e4af77bc4f582c9a37749d1e9481eb93626c8f3991b2390c6e4e69e5642e3b6e870912b839229a0e23594fae348156ea5a8ed7e2e +"@eslint/js@npm:8.44.0": + version: 8.44.0 + resolution: "@eslint/js@npm:8.44.0" + checksum: fc539583226a28f5677356e9f00d2789c34253f076643d2e32888250e509a4e13aafe0880cb2425139051de0f3a48d25bfc5afa96b7304f203b706c17340e3cf languageName: node linkType: hard @@ -465,7 +465,7 @@ __metadata: languageName: node linkType: hard -"@favware/cliff-jumper@npm:^2.1.1": +"@favware/cliff-jumper@npm:^2.0.1, @favware/cliff-jumper@npm:^2.1.1": version: 2.1.1 resolution: "@favware/cliff-jumper@npm:2.1.1" dependencies: @@ -540,13 +540,6 @@ __metadata: languageName: node linkType: hard -"@gar/promisify@npm:^1.1.3": - version: 1.1.3 - resolution: "@gar/promisify@npm:1.1.3" - checksum: 4059f790e2d07bf3c3ff3e0fec0daa8144fe35c1f6e0111c9921bd32106adaa97a4ab096ad7dab1e28ee6a9060083c4d1a4ada42a7f5f3f7a96b8812e2b757c1 - languageName: node - linkType: hard - "@humanwhocodes/config-array@npm:^0.11.10": version: 0.11.10 resolution: "@humanwhocodes/config-array@npm:0.11.10" @@ -558,17 +551,6 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/config-array@npm:^0.11.8": - version: 0.11.8 - resolution: "@humanwhocodes/config-array@npm:0.11.8" - dependencies: - "@humanwhocodes/object-schema": ^1.2.1 - debug: ^4.1.1 - minimatch: ^3.0.5 - checksum: 0fd6b3c54f1674ce0a224df09b9c2f9846d20b9e54fabae1281ecfc04f2e6ad69bf19e1d6af6a28f88e8aa3990168b6cb9e1ef755868c3256a630605ec2cb1d3 - languageName: node - linkType: hard - "@humanwhocodes/module-importer@npm:^1.0.1": version: 1.0.1 resolution: "@humanwhocodes/module-importer@npm:1.0.1" @@ -620,13 +602,30 @@ __metadata: languageName: node linkType: hard +"@joshdb/indexeddb@workspace:packages/indexeddb": + version: 0.0.0-use.local + resolution: "@joshdb/indexeddb@workspace:packages/indexeddb" + dependencies: + "@favware/cliff-jumper": ^2.0.1 + "@favware/rollup-type-bundler": ^1.0.11 + "@joshdb/provider": 2.0.0-next.1c9d8d9.0 + "@sapphire/utilities": ^3.12.0 + "@vitest/coverage-v8": ^0.32.0 + fake-indexeddb: ^4.0.1 + property-helpers: ^2.0.0 + typedoc: ^0.24.8 + typedoc-json-parser: ^8.1.2 + vitest: ^0.32.0 + languageName: unknown + linkType: soft + "@joshdb/json@workspace:packages/json": version: 0.0.0-use.local resolution: "@joshdb/json@workspace:packages/json" dependencies: "@favware/cliff-jumper": ^2.1.1 "@favware/rollup-type-bundler": ^1.0.11 - "@joshdb/provider": 2.0.0-next.a699598.0 + "@joshdb/provider": 2.0.0-next.095d141.0 "@sapphire/async-queue": ^1.5.0 "@sapphire/snowflake": ^3.5.1 "@sapphire/utilities": ^3.12.0 @@ -645,7 +644,7 @@ __metadata: dependencies: "@favware/cliff-jumper": ^2.1.1 "@favware/rollup-type-bundler": ^1.0.11 - "@joshdb/provider": 2.0.0-next.a699598.0 + "@joshdb/provider": 2.0.0-next.095d141.0 "@sapphire/utilities": ^3.12.0 "@vitest/coverage-v8": ^0.32.2 better-serialize: ^1.0.0 @@ -662,7 +661,7 @@ __metadata: dependencies: "@favware/cliff-jumper": ^2.1.1 "@favware/rollup-type-bundler": ^1.0.11 - "@joshdb/provider": 2.0.0-next.a699598.0 + "@joshdb/provider": 2.0.0-next.095d141.0 "@sapphire/snowflake": ^3.5.1 "@vitest/coverage-v8": ^0.32.2 better-serialize: ^1.0.0 @@ -679,7 +678,7 @@ __metadata: dependencies: "@favware/cliff-jumper": ^2.1.1 "@favware/rollup-type-bundler": ^1.0.11 - "@joshdb/provider": 2.0.0-next.a699598.0 + "@joshdb/provider": 2.0.0-next.095d141.0 "@sapphire/utilities": ^3.12.0 "@vitest/coverage-v8": ^0.32.2 better-serialize: ^1.0.0 @@ -697,7 +696,7 @@ __metadata: dependencies: "@favware/cliff-jumper": ^2.1.1 "@favware/rollup-type-bundler": ^1.0.11 - "@joshdb/provider": 2.0.0-next.a699598.0 + "@joshdb/provider": 2.0.0-next.095d141.0 "@sapphire/snowflake": ^3.5.1 "@sapphire/utilities": ^3.12.0 "@vitest/coverage-v8": ^0.32.2 @@ -710,6 +709,26 @@ __metadata: languageName: unknown linkType: soft +"@joshdb/provider@npm:2.0.0-next.095d141.0": + version: 2.0.0-next.095d141.0 + resolution: "@joshdb/provider@npm:2.0.0-next.095d141.0" + dependencies: + "@sapphire/utilities": ^3.12.0 + reflect-metadata: ^0.1.13 + checksum: 6b052d5c9fff01c054484d340966a1350ab06358c8a6480bbd4b8220f61a08ba4899ac95684f6252471454b9a410bf4ef62d848bac391643206c6a39d2f32de7 + languageName: node + linkType: hard + +"@joshdb/provider@npm:2.0.0-next.1c9d8d9.0": + version: 2.0.0-next.1c9d8d9.0 + resolution: "@joshdb/provider@npm:2.0.0-next.1c9d8d9.0" + dependencies: + "@sapphire/utilities": ^3.12.0 + reflect-metadata: ^0.1.13 + checksum: 122a365773c15dcb61c620e4f20099ca6753477cde5d88181f34d4a8ab4a487ab2edfa50cc58af38b04456e4b29319671eb60da1719893804ba4fa172c204e94 + languageName: node + linkType: hard + "@joshdb/provider@npm:2.0.0-next.a699598.0": version: 2.0.0-next.a699598.0 resolution: "@joshdb/provider@npm:2.0.0-next.a699598.0" @@ -726,7 +745,7 @@ __metadata: dependencies: "@favware/cliff-jumper": ^2.1.1 "@favware/rollup-type-bundler": ^1.0.11 - "@joshdb/provider": 2.0.0-next.a699598.0 + "@joshdb/provider": 2.0.0-next.095d141.0 "@types/uuid": ^9.0.2 "@vitest/coverage-v8": ^0.32.2 better-serialize: ^1.0.0 @@ -744,7 +763,7 @@ __metadata: dependencies: "@favware/cliff-jumper": ^2.1.1 "@favware/rollup-type-bundler": ^1.0.11 - "@joshdb/provider": 2.0.0-next.a699598.0 + "@joshdb/provider": 2.0.0-next.095d141.0 "@sapphire/utilities": ^3.12.0 "@vitest/coverage-v8": ^0.32.2 better-serialize: ^1.0.0 @@ -858,16 +877,6 @@ __metadata: languageName: node linkType: hard -"@npmcli/fs@npm:^2.1.0": - version: 2.1.2 - resolution: "@npmcli/fs@npm:2.1.2" - dependencies: - "@gar/promisify": ^1.1.3 - semver: ^7.3.5 - checksum: 405074965e72d4c9d728931b64d2d38e6ea12066d4fad651ac253d175e413c06fe4350970c783db0d749181da8fe49c42d3880bd1cbc12cd68e3a7964d820225 - languageName: node - linkType: hard - "@npmcli/fs@npm:^3.1.0": version: 3.1.0 resolution: "@npmcli/fs@npm:3.1.0" @@ -877,16 +886,6 @@ __metadata: languageName: node linkType: hard -"@npmcli/move-file@npm:^2.0.0": - version: 2.0.1 - resolution: "@npmcli/move-file@npm:2.0.1" - dependencies: - mkdirp: ^1.0.4 - rimraf: ^3.0.2 - checksum: 52dc02259d98da517fae4cb3a0a3850227bdae4939dda1980b788a7670636ca2b4a01b58df03dd5f65c1e3cb70c50fa8ce5762b582b3f499ec30ee5ce1fd9380 - languageName: node - linkType: hard - "@pkgjs/parseargs@npm:^0.11.0": version: 0.11.0 resolution: "@pkgjs/parseargs@npm:0.11.0" @@ -1022,20 +1021,13 @@ __metadata: languageName: node linkType: hard -"@sapphire/utilities@npm:3.12.0, @sapphire/utilities@npm:^3.12.0": +"@sapphire/utilities@npm:3.12.0, @sapphire/utilities@npm:^3.11.0, @sapphire/utilities@npm:^3.11.2, @sapphire/utilities@npm:^3.12.0, @sapphire/utilities@npm:^3.9.2": version: 3.12.0 resolution: "@sapphire/utilities@npm:3.12.0" checksum: 002f15263f157fdbb0603c233a43a5660cd3b45a4f3fddaa9d7066d187eec23f473ee42c8d071b0e3dec4e22b08bed337fb7eb336a02b59743a78ebc8922004e languageName: node linkType: hard -"@sapphire/utilities@npm:^3.11.0, @sapphire/utilities@npm:^3.11.2, @sapphire/utilities@npm:^3.9.2": - version: 3.11.2 - resolution: "@sapphire/utilities@npm:3.11.2" - checksum: af06b3f52156af397a3be564f992bedefd728ea2d44fee8ffdc00242de0454075e722091cc213d4ad2fb4ef5c3b78740bf5e7f75242851d31a56206f51a8f403 - languageName: node - linkType: hard - "@tootallnate/once@npm:2": version: 2.0.0 resolution: "@tootallnate/once@npm:2.0.0" @@ -1132,9 +1124,9 @@ __metadata: linkType: hard "@types/node@npm:*": - version: 20.2.5 - resolution: "@types/node@npm:20.2.5" - checksum: 38ce7c7e9d76880dc632f71d71e0d5914fcda9d5e9a7095d6c339abda55ca4affb0f2a882aeb29398f8e09d2c5151f0b6586c81c8ccdfe529c34b1ea3337425e + version: 20.3.3 + resolution: "@types/node@npm:20.3.3" + checksum: 7a0d00800451ca8cd8df63a8cc218c697edadb3143bf46cd6afeb974542a6a1665c3679459be0016c29216ccfed6616b7e55851747527dfa71c5608d9157528c languageName: node linkType: hard @@ -1146,9 +1138,9 @@ __metadata: linkType: hard "@types/node@npm:^18.16.18": - version: 18.16.18 - resolution: "@types/node@npm:18.16.18" - checksum: d32d8a0a04cd3f5ecb361bcb42f3a07623881ac90d680e06bf626defb3c663a94860d11690babe607cfe67265eceeb8a59ba5fe40c0e49f5a1b01e0088640469 + version: 18.16.19 + resolution: "@types/node@npm:18.16.19" + checksum: 63c31f09616508aa7135380a4c79470a897b75f9ff3a70eb069e534dfabdec3f32fb0f9df5939127f1086614d980ddea0fa5e8cc29a49103c4f74cd687618aaf languageName: node linkType: hard @@ -1200,31 +1192,7 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^5.59.2, @typescript-eslint/eslint-plugin@npm:^5.59.7": - version: 5.59.8 - resolution: "@typescript-eslint/eslint-plugin@npm:5.59.8" - dependencies: - "@eslint-community/regexpp": ^4.4.0 - "@typescript-eslint/scope-manager": 5.59.8 - "@typescript-eslint/type-utils": 5.59.8 - "@typescript-eslint/utils": 5.59.8 - debug: ^4.3.4 - grapheme-splitter: ^1.0.4 - ignore: ^5.2.0 - natural-compare-lite: ^1.4.0 - semver: ^7.3.7 - tsutils: ^3.21.0 - peerDependencies: - "@typescript-eslint/parser": ^5.0.0 - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - peerDependenciesMeta: - typescript: - optional: true - checksum: 3e05cd06149ec3741c3c2fb638e2d19a55687b4614a5c8820433db82997687650297e51c17828d320162ccf4241798cf5712c405561e7605cb17e984a6967f7b - languageName: node - linkType: hard - -"@typescript-eslint/eslint-plugin@npm:^5.60.1": +"@typescript-eslint/eslint-plugin@npm:^5.59.2, @typescript-eslint/eslint-plugin@npm:^5.59.7, @typescript-eslint/eslint-plugin@npm:^5.60.1": version: 5.60.1 resolution: "@typescript-eslint/eslint-plugin@npm:5.60.1" dependencies: @@ -1248,24 +1216,7 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/parser@npm:^5.59.2, @typescript-eslint/parser@npm:^5.59.7": - version: 5.59.8 - resolution: "@typescript-eslint/parser@npm:5.59.8" - dependencies: - "@typescript-eslint/scope-manager": 5.59.8 - "@typescript-eslint/types": 5.59.8 - "@typescript-eslint/typescript-estree": 5.59.8 - debug: ^4.3.4 - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - peerDependenciesMeta: - typescript: - optional: true - checksum: bac9f09d8552086ceb882a7b87ce4d98dfaa41579249216c75d97e3fc07af33cddc4cbbd07a127a5823c826a258882643aaf658bec19cb2a434002b55c5f0d12 - languageName: node - linkType: hard - -"@typescript-eslint/parser@npm:^5.60.1": +"@typescript-eslint/parser@npm:^5.59.2, @typescript-eslint/parser@npm:^5.59.7, @typescript-eslint/parser@npm:^5.60.1": version: 5.60.1 resolution: "@typescript-eslint/parser@npm:5.60.1" dependencies: @@ -1282,16 +1233,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:5.59.8": - version: 5.59.8 - resolution: "@typescript-eslint/scope-manager@npm:5.59.8" - dependencies: - "@typescript-eslint/types": 5.59.8 - "@typescript-eslint/visitor-keys": 5.59.8 - checksum: e1e810ee991cfeb433330b04ee949bb6784abe4dbdb7d9480aa7a7536671b4fec914b7803edf662516c8ecb1b31dcff126797f9923270a529c26e2b00b0ea96f - languageName: node - linkType: hard - "@typescript-eslint/scope-manager@npm:5.60.1": version: 5.60.1 resolution: "@typescript-eslint/scope-manager@npm:5.60.1" @@ -1302,23 +1243,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:5.59.8": - version: 5.59.8 - resolution: "@typescript-eslint/type-utils@npm:5.59.8" - dependencies: - "@typescript-eslint/typescript-estree": 5.59.8 - "@typescript-eslint/utils": 5.59.8 - debug: ^4.3.4 - tsutils: ^3.21.0 - peerDependencies: - eslint: "*" - peerDependenciesMeta: - typescript: - optional: true - checksum: d9fde31397da0f0e62a5568f64bad99d06bcd324b7e3aac7fd997a3d045a0fe4c084b2e85d440e0a39645acd2269ad6593f196399c2c0f880d293417fec894e3 - languageName: node - linkType: hard - "@typescript-eslint/type-utils@npm:5.60.1": version: 5.60.1 resolution: "@typescript-eslint/type-utils@npm:5.60.1" @@ -1336,13 +1260,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/types@npm:5.59.8": - version: 5.59.8 - resolution: "@typescript-eslint/types@npm:5.59.8" - checksum: 559473d5601c849eb0da1874a2ac67c753480beed484ad6f6cda62fa6023273f2c3005c7f2864d9c2afb7c6356412d0d304b57db10c53597207f18a7f6cd4f18 - languageName: node - linkType: hard - "@typescript-eslint/types@npm:5.60.1": version: 5.60.1 resolution: "@typescript-eslint/types@npm:5.60.1" @@ -1350,24 +1267,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:5.59.8": - version: 5.59.8 - resolution: "@typescript-eslint/typescript-estree@npm:5.59.8" - dependencies: - "@typescript-eslint/types": 5.59.8 - "@typescript-eslint/visitor-keys": 5.59.8 - debug: ^4.3.4 - globby: ^11.1.0 - is-glob: ^4.0.3 - semver: ^7.3.7 - tsutils: ^3.21.0 - peerDependenciesMeta: - typescript: - optional: true - checksum: d93371cc866f573a6a1ddc0eb10d498a8e59f36763a99ce21da0737fff2b4c942eef1587216aad273f8d896ebc0b19003677cba63a27d2646aa2c087638963eb - languageName: node - linkType: hard - "@typescript-eslint/typescript-estree@npm:5.60.1": version: 5.60.1 resolution: "@typescript-eslint/typescript-estree@npm:5.60.1" @@ -1386,24 +1285,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:5.59.8": - version: 5.59.8 - resolution: "@typescript-eslint/utils@npm:5.59.8" - dependencies: - "@eslint-community/eslint-utils": ^4.2.0 - "@types/json-schema": ^7.0.9 - "@types/semver": ^7.3.12 - "@typescript-eslint/scope-manager": 5.59.8 - "@typescript-eslint/types": 5.59.8 - "@typescript-eslint/typescript-estree": 5.59.8 - eslint-scope: ^5.1.1 - semver: ^7.3.7 - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - checksum: cbaa057485c7f52c45d0dfb4f5a8e9273abccb1c52dcb4426a79f9e71d2c1062cf2525bad6d4aca5ec42db3fe723d749843bcade5a323bde7fbe4b5d5b5d5c3b - languageName: node - linkType: hard - "@typescript-eslint/utils@npm:5.60.1": version: 5.60.1 resolution: "@typescript-eslint/utils@npm:5.60.1" @@ -1422,16 +1303,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:5.59.8": - version: 5.59.8 - resolution: "@typescript-eslint/visitor-keys@npm:5.59.8" - dependencies: - "@typescript-eslint/types": 5.59.8 - eslint-visitor-keys: ^3.3.0 - checksum: 6bfa7918dbb0e08d8a7404aeeef7bcd1a85736dc8d01614d267c0c5ec10f94d2746b50a945bf5c82c54fda67926e8deaeba8565c919da17f725fc11209ef8987 - languageName: node - linkType: hard - "@typescript-eslint/visitor-keys@npm:5.60.1": version: 5.60.1 resolution: "@typescript-eslint/visitor-keys@npm:5.60.1" @@ -1442,7 +1313,7 @@ __metadata: languageName: node linkType: hard -"@vitest/coverage-v8@npm:^0.32.2": +"@vitest/coverage-v8@npm:^0.32.0, @vitest/coverage-v8@npm:^0.32.2": version: 0.32.2 resolution: "@vitest/coverage-v8@npm:0.32.2" dependencies: @@ -1552,12 +1423,12 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^8.4.1, acorn@npm:^8.8.0, acorn@npm:^8.8.2": - version: 8.8.2 - resolution: "acorn@npm:8.8.2" +"acorn@npm:^8.4.1, acorn@npm:^8.8.2, acorn@npm:^8.9.0": + version: 8.9.0 + resolution: "acorn@npm:8.9.0" bin: acorn: bin/acorn - checksum: f790b99a1bf63ef160c967e23c46feea7787e531292bb827126334612c234ed489a0dc2c7ba33156416f0ffa8d25bf2b0fdb7f35c2ba60eb3e960572bece4001 + checksum: 25dfb94952386ecfb847e61934de04a4e7c2dc21c2e700fc4e2ef27ce78cb717700c4c4f279cd630bb4774948633c3859fc16063ec8573bda4568e0a312e6744 languageName: node linkType: hard @@ -1764,6 +1635,13 @@ __metadata: languageName: node linkType: hard +"base64-arraybuffer-es6@npm:^0.7.0": + version: 0.7.0 + resolution: "base64-arraybuffer-es6@npm:0.7.0" + checksum: 6d2fd114df49201b476cea5d470504e5d4e8c4cd42544152b312c9bdcb824313086fe83f1ffc34262e9e276b82d46aefc6e63bb85553f016932061137b355cdf + languageName: node + linkType: hard + "base64-js@npm:^1.3.1": version: 1.5.1 resolution: "base64-js@npm:1.5.1" @@ -1895,32 +1773,6 @@ __metadata: languageName: node linkType: hard -"cacache@npm:^16.1.0": - version: 16.1.3 - resolution: "cacache@npm:16.1.3" - dependencies: - "@npmcli/fs": ^2.1.0 - "@npmcli/move-file": ^2.0.0 - chownr: ^2.0.0 - fs-minipass: ^2.1.0 - glob: ^8.0.1 - infer-owner: ^1.0.4 - lru-cache: ^7.7.1 - minipass: ^3.1.6 - minipass-collect: ^1.0.2 - minipass-flush: ^1.0.5 - minipass-pipeline: ^1.2.4 - mkdirp: ^1.0.4 - p-map: ^4.0.0 - promise-inflight: ^1.0.1 - rimraf: ^3.0.2 - ssri: ^9.0.0 - tar: ^6.1.11 - unique-filename: ^2.0.0 - checksum: d91409e6e57d7d9a3a25e5dcc589c84e75b178ae8ea7de05cbf6b783f77a5fae938f6e8fda6f5257ed70000be27a681e1e44829251bfffe4c10216002f8f14e6 - languageName: node - linkType: hard - "cacache@npm:^17.0.0": version: 17.1.3 resolution: "cacache@npm:17.1.3" @@ -2327,14 +2179,14 @@ __metadata: linkType: hard "cosmiconfig@npm:^8.0.0": - version: 8.1.3 - resolution: "cosmiconfig@npm:8.1.3" + version: 8.2.0 + resolution: "cosmiconfig@npm:8.2.0" dependencies: import-fresh: ^3.2.1 js-yaml: ^4.1.0 parse-json: ^5.0.0 path-type: ^4.0.0 - checksum: b3d277bc3a8a9e649bf4c3fc9740f4c52bf07387481302aa79839f595045368903bf26ea24a8f7f7b8b180bf46037b027c5cb63b1391ab099f3f78814a147b2b + checksum: 836d5d8efa750f3fb17b03d6ca74cd3154ed025dffd045304b3ef59637f662bde1e5dc88f8830080d180ec60841719cf4ea2ce73fb21ec694b16865c478ff297 languageName: node linkType: hard @@ -2509,6 +2361,15 @@ __metadata: languageName: node linkType: hard +"domexception@npm:^1.0.1": + version: 1.0.1 + resolution: "domexception@npm:1.0.1" + dependencies: + webidl-conversions: ^4.0.2 + checksum: f564a9c0915dcb83ceefea49df14aaed106b1468fbe505119e8bcb0b77e242534f3aba861978537c0fc9dc6f35b176d0ffc77b3e342820fb27a8f215e7ae4d52 + languageName: node + linkType: hard + "dot-prop@npm:^5.1.0": version: 5.3.0 resolution: "dot-prop@npm:5.3.0" @@ -2731,63 +2592,14 @@ __metadata: languageName: node linkType: hard -"eslint@npm:^8.39.0, eslint@npm:^8.41.0": - version: 8.41.0 - resolution: "eslint@npm:8.41.0" - dependencies: - "@eslint-community/eslint-utils": ^4.2.0 - "@eslint-community/regexpp": ^4.4.0 - "@eslint/eslintrc": ^2.0.3 - "@eslint/js": 8.41.0 - "@humanwhocodes/config-array": ^0.11.8 - "@humanwhocodes/module-importer": ^1.0.1 - "@nodelib/fs.walk": ^1.2.8 - ajv: ^6.10.0 - chalk: ^4.0.0 - cross-spawn: ^7.0.2 - debug: ^4.3.2 - doctrine: ^3.0.0 - escape-string-regexp: ^4.0.0 - eslint-scope: ^7.2.0 - eslint-visitor-keys: ^3.4.1 - espree: ^9.5.2 - esquery: ^1.4.2 - esutils: ^2.0.2 - fast-deep-equal: ^3.1.3 - file-entry-cache: ^6.0.1 - find-up: ^5.0.0 - glob-parent: ^6.0.2 - globals: ^13.19.0 - graphemer: ^1.4.0 - ignore: ^5.2.0 - import-fresh: ^3.0.0 - imurmurhash: ^0.1.4 - is-glob: ^4.0.0 - is-path-inside: ^3.0.3 - js-yaml: ^4.1.0 - json-stable-stringify-without-jsonify: ^1.0.1 - levn: ^0.4.1 - lodash.merge: ^4.6.2 - minimatch: ^3.1.2 - natural-compare: ^1.4.0 - optionator: ^0.9.1 - strip-ansi: ^6.0.1 - strip-json-comments: ^3.1.0 - text-table: ^0.2.0 - bin: - eslint: bin/eslint.js - checksum: 09979a6f8451dcc508a7005b6670845c8a518376280b3fd96657a406b8b6ef29d0e480d1ba11b4eb48da93d607e0c55c9b877676fe089d09973ec152354e23b2 - languageName: node - linkType: hard - -"eslint@npm:^8.43.0": - version: 8.43.0 - resolution: "eslint@npm:8.43.0" +"eslint@npm:^8.39.0, eslint@npm:^8.41.0, eslint@npm:^8.43.0": + version: 8.44.0 + resolution: "eslint@npm:8.44.0" dependencies: "@eslint-community/eslint-utils": ^4.2.0 "@eslint-community/regexpp": ^4.4.0 - "@eslint/eslintrc": ^2.0.3 - "@eslint/js": 8.43.0 + "@eslint/eslintrc": ^2.1.0 + "@eslint/js": 8.44.0 "@humanwhocodes/config-array": ^0.11.10 "@humanwhocodes/module-importer": ^1.0.1 "@nodelib/fs.walk": ^1.2.8 @@ -2799,7 +2611,7 @@ __metadata: escape-string-regexp: ^4.0.0 eslint-scope: ^7.2.0 eslint-visitor-keys: ^3.4.1 - espree: ^9.5.2 + espree: ^9.6.0 esquery: ^1.4.2 esutils: ^2.0.2 fast-deep-equal: ^3.1.3 @@ -2819,24 +2631,24 @@ __metadata: lodash.merge: ^4.6.2 minimatch: ^3.1.2 natural-compare: ^1.4.0 - optionator: ^0.9.1 + optionator: ^0.9.3 strip-ansi: ^6.0.1 strip-json-comments: ^3.1.0 text-table: ^0.2.0 bin: eslint: bin/eslint.js - checksum: 55654ce00b0d128822b57526e40473d0497c7c6be3886afdc0b41b6b0dfbd34d0eae8159911b18451b4db51a939a0e6d2e117e847ae419086884fc3d4fe23c7c + checksum: d06309ce4aafb9d27d558c8e5e5aa5cba3bbec3ce8ceccbc7d4b7a35f2b67fd40189159155553270e2e6febeb69bd8a3b60d6241c8f5ddc2ef1702ccbd328501 languageName: node linkType: hard -"espree@npm:^9.5.2": - version: 9.5.2 - resolution: "espree@npm:9.5.2" +"espree@npm:^9.6.0": + version: 9.6.0 + resolution: "espree@npm:9.6.0" dependencies: - acorn: ^8.8.0 + acorn: ^8.9.0 acorn-jsx: ^5.3.2 eslint-visitor-keys: ^3.4.1 - checksum: 6506289d6eb26471c0b383ee24fee5c8ae9d61ad540be956b3127be5ce3bf687d2ba6538ee5a86769812c7c552a9d8239e8c4d150f9ea056c6d5cbe8399c03c1 + checksum: 1287979510efb052a6a97c73067ea5d0a40701b29adde87bbe2d3eb1667e39ca55e8129e20e2517fed3da570150e7ef470585228459a8f3e3755f45007a1c662 languageName: node linkType: hard @@ -2944,6 +2756,22 @@ __metadata: languageName: node linkType: hard +"exponential-backoff@npm:^3.1.1": + version: 3.1.1 + resolution: "exponential-backoff@npm:3.1.1" + checksum: 3d21519a4f8207c99f7457287291316306255a328770d320b401114ec8481986e4e467e854cb9914dd965e0a1ca810a23ccb559c642c88f4c7f55c55778a9b48 + languageName: node + linkType: hard + +"fake-indexeddb@npm:^4.0.1": + version: 4.0.1 + resolution: "fake-indexeddb@npm:4.0.1" + dependencies: + realistic-structured-clone: ^3.0.0 + checksum: dd1c82111e3b97c262a647a29dc012209f8c3bed0fbe7ae9630927772842fe8d3276794ff196d0021a5e60563a25a4323eca622a6a7bc6575b62e074328a0c90 + languageName: node + linkType: hard + "fast-deep-equal@npm:^3.1.1, fast-deep-equal@npm:^3.1.3": version: 3.1.3 resolution: "fast-deep-equal@npm:3.1.3" @@ -2959,15 +2787,15 @@ __metadata: linkType: hard "fast-glob@npm:^3.2.9": - version: 3.2.12 - resolution: "fast-glob@npm:3.2.12" + version: 3.3.0 + resolution: "fast-glob@npm:3.3.0" dependencies: "@nodelib/fs.stat": ^2.0.2 "@nodelib/fs.walk": ^1.2.3 glob-parent: ^5.1.2 merge2: ^1.3.0 micromatch: ^4.0.4 - checksum: 0b1990f6ce831c7e28c4d505edcdaad8e27e88ab9fa65eedadb730438cfc7cde4910d6c975d6b7b8dc8a73da4773702ebcfcd6e3518e73938bb1383badfe01c2 + checksum: 20df62be28eb5426fe8e40e0d05601a63b1daceb7c3d87534afcad91bdcf1e4b1743cf2d5247d6e225b120b46df0b9053a032b2691ba34ee121e033acd81f547 languageName: node linkType: hard @@ -3106,7 +2934,7 @@ __metadata: languageName: node linkType: hard -"fs-minipass@npm:^2.0.0, fs-minipass@npm:^2.1.0": +"fs-minipass@npm:^2.0.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" dependencies: @@ -3347,17 +3175,17 @@ __metadata: linkType: hard "glob@npm:^10.2.2, glob@npm:^10.2.5": - version: 10.2.6 - resolution: "glob@npm:10.2.6" + version: 10.3.1 + resolution: "glob@npm:10.3.1" dependencies: foreground-child: ^3.1.0 jackspeak: ^2.0.3 minimatch: ^9.0.1 minipass: ^5.0.0 || ^6.0.2 - path-scurry: ^1.7.0 + path-scurry: ^1.10.0 bin: glob: dist/cjs/src/bin.js - checksum: 94c5964bfa9df95207a69a3bd9b07b99ea7b5ba1f36dd73a8914378cee9436a205b9b5bdff58872abc238684ea7f4b4936e932155b8885250818bcc8d5321ddf + checksum: 19c8c2805658b1002fecf0722cd609a33153d756a0d5260676bd0e9c5e6ef889ec9cce6d3dac0411aa90bce8de3d14f25b6f5589a3292582cccbfeddd0e98cc4 languageName: node linkType: hard @@ -3375,19 +3203,6 @@ __metadata: languageName: node linkType: hard -"glob@npm:^8.0.1": - version: 8.1.0 - resolution: "glob@npm:8.1.0" - dependencies: - fs.realpath: ^1.0.0 - inflight: ^1.0.4 - inherits: 2 - minimatch: ^5.0.1 - once: ^1.3.0 - checksum: 92fbea3221a7d12075f26f0227abac435de868dd0736a17170663783296d0dd8d3d532a5672b4488a439bf5d7fb85cdd07c11185d6cd39184f0385cbdfb86a47 - languageName: node - linkType: hard - "global-dirs@npm:^0.1.1": version: 0.1.1 resolution: "global-dirs@npm:0.1.1" @@ -3510,7 +3325,7 @@ __metadata: languageName: node linkType: hard -"http-cache-semantics@npm:^4.1.0, http-cache-semantics@npm:^4.1.1": +"http-cache-semantics@npm:^4.1.1": version: 4.1.1 resolution: "http-cache-semantics@npm:4.1.1" checksum: 83ac0bc60b17a3a36f9953e7be55e5c8f41acc61b22583060e8dedc9dd5e3607c823a88d0926f9150e571f90946835c7fe150732801010845c72cd8bbff1a236 @@ -3624,13 +3439,6 @@ __metadata: languageName: node linkType: hard -"infer-owner@npm:^1.0.4": - version: 1.0.4 - resolution: "infer-owner@npm:1.0.4" - checksum: 181e732764e4a0611576466b4b87dac338972b839920b2a8cde43642e4ed6bd54dc1fb0b40874728f2a2df9a1b097b8ff83b56d5f8f8e3927f837fdcb47d8a89 - languageName: node - linkType: hard - "inflight@npm:^1.0.4": version: 1.0.6 resolution: "inflight@npm:1.0.6" @@ -4089,7 +3897,7 @@ __metadata: languageName: node linkType: hard -"lodash@npm:^4.17.15, lodash@npm:^4.17.20": +"lodash@npm:^4.17.15, lodash@npm:^4.17.20, lodash@npm:^4.7.0": version: 4.17.21 resolution: "lodash@npm:4.17.21" checksum: eb835a2e51d381e561e508ce932ea50a8e5a68f4ebdd771ea240d3048244a8d13658acbd502cd4829768c56f2e16bdd4340b9ea141297d472517b83868e677f7 @@ -4133,10 +3941,10 @@ __metadata: languageName: node linkType: hard -"lru-cache@npm:^9.1.1": - version: 9.1.1 - resolution: "lru-cache@npm:9.1.1" - checksum: 4d703bb9b66216bbee55ead82a9682820a2b6acbdfca491b235390b1ef1056000a032d56dfb373fdf9ad4492f1fa9d04cc9a05a77f25bd7ce6901d21ad9b68b7 +"lru-cache@npm:^9.1.1 || ^10.0.0": + version: 10.0.0 + resolution: "lru-cache@npm:10.0.0" + checksum: 18f101675fe283bc09cda0ef1e3cc83781aeb8373b439f086f758d1d91b28730950db785999cd060d3c825a8571c03073e8c14512b6655af2188d623031baf50 languageName: node linkType: hard @@ -4181,31 +3989,7 @@ __metadata: languageName: node linkType: hard -"make-fetch-happen@npm:^10.0.3": - version: 10.2.1 - resolution: "make-fetch-happen@npm:10.2.1" - dependencies: - agentkeepalive: ^4.2.1 - cacache: ^16.1.0 - http-cache-semantics: ^4.1.0 - http-proxy-agent: ^5.0.0 - https-proxy-agent: ^5.0.0 - is-lambda: ^1.0.1 - lru-cache: ^7.7.1 - minipass: ^3.1.6 - minipass-collect: ^1.0.2 - minipass-fetch: ^2.0.3 - minipass-flush: ^1.0.5 - minipass-pipeline: ^1.2.4 - negotiator: ^0.6.3 - promise-retry: ^2.0.1 - socks-proxy-agent: ^7.0.0 - ssri: ^9.0.0 - checksum: 2332eb9a8ec96f1ffeeea56ccefabcb4193693597b132cd110734d50f2928842e22b84cfa1508e921b8385cdfd06dda9ad68645fed62b50fff629a580f5fb72c - languageName: node - linkType: hard - -"make-fetch-happen@npm:^11.0.0": +"make-fetch-happen@npm:^11.0.0, make-fetch-happen@npm:^11.0.3": version: 11.1.1 resolution: "make-fetch-happen@npm:11.1.1" dependencies: @@ -4360,21 +4144,12 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^5.0.1": - version: 5.1.6 - resolution: "minimatch@npm:5.1.6" - dependencies: - brace-expansion: ^2.0.1 - checksum: 7564208ef81d7065a370f788d337cd80a689e981042cb9a1d0e6580b6c6a8c9279eba80010516e258835a988363f99f54a6f711a315089b8b42694f5da9d0d77 - languageName: node - linkType: hard - "minimatch@npm:^9.0.0, minimatch@npm:^9.0.1": - version: 9.0.1 - resolution: "minimatch@npm:9.0.1" + version: 9.0.2 + resolution: "minimatch@npm:9.0.2" dependencies: brace-expansion: ^2.0.1 - checksum: 97f5f5284bb57dc65b9415dec7f17a0f6531a33572193991c60ff18450dcfad5c2dad24ffeaf60b5261dccd63aae58cc3306e2209d57e7f88c51295a532d8ec3 + checksum: 2eb12e2047a062fdb973fb51b9803f2455e3a00977858c038d66646d303a5a15bbcbc6ed5a2fc403bc869b1309f829ed3acd881d3246faf044ea7a494974b924 languageName: node linkType: hard @@ -4405,21 +4180,6 @@ __metadata: languageName: node linkType: hard -"minipass-fetch@npm:^2.0.3": - version: 2.1.2 - resolution: "minipass-fetch@npm:2.1.2" - dependencies: - encoding: ^0.1.13 - minipass: ^3.1.6 - minipass-sized: ^1.0.3 - minizlib: ^2.1.2 - dependenciesMeta: - encoding: - optional: true - checksum: 3f216be79164e915fc91210cea1850e488793c740534985da017a4cbc7a5ff50506956d0f73bb0cb60e4fe91be08b6b61ef35101706d3ef5da2c8709b5f08f91 - languageName: node - linkType: hard - "minipass-fetch@npm:^3.0.0": version: 3.0.3 resolution: "minipass-fetch@npm:3.0.3" @@ -4472,7 +4232,7 @@ __metadata: languageName: node linkType: hard -"minipass@npm:^3.0.0, minipass@npm:^3.1.1, minipass@npm:^3.1.6": +"minipass@npm:^3.0.0": version: 3.3.6 resolution: "minipass@npm:3.3.6" dependencies: @@ -4512,7 +4272,7 @@ __metadata: languageName: node linkType: hard -"mkdirp@npm:^1.0.3, mkdirp@npm:^1.0.4": +"mkdirp@npm:^1.0.3": version: 1.0.4 resolution: "mkdirp@npm:1.0.4" bin: @@ -4522,14 +4282,14 @@ __metadata: linkType: hard "mlly@npm:^1.2.0": - version: 1.3.0 - resolution: "mlly@npm:1.3.0" + version: 1.4.0 + resolution: "mlly@npm:1.4.0" dependencies: - acorn: ^8.8.2 - pathe: ^1.1.0 + acorn: ^8.9.0 + pathe: ^1.1.1 pkg-types: ^1.0.3 ufo: ^1.1.2 - checksum: aea2a99131b1a1f02a733219317b6466156e150473e0a2f490802eaf2dc66940a21bb68e0ddd5c003360263e674e7dd0bd02da6520c740e6d16fa0edf5efa46e + checksum: ebf2e2b5cfb4c6e45e8d0bbe82710952247023f12626cb0997c41b1bb6e57c8b6fc113aa709228ad511382ab0b4eebaab759806be0578093b3635d3e940bd63b languageName: node linkType: hard @@ -4648,17 +4408,17 @@ __metadata: linkType: hard "node-abi@npm:^3.3.0": - version: 3.40.0 - resolution: "node-abi@npm:3.40.0" + version: 3.45.0 + resolution: "node-abi@npm:3.45.0" dependencies: semver: ^7.3.5 - checksum: 8f4ef0d9ac82352465e7e7a8ce3915dae49c0fd19d6cb49a93140ff587b612166443531111a60d25e479a18e6e6b9af09698c7870babe0f44aa54287aeaf5eef + checksum: 18c4305d7de5f1132741a2a66ba652941518210d02c9268702abe97ce1c166db468b4fc3e85fff04b9c19218c2e47f4e295f9a46422dc834932f4e11443400cd languageName: node linkType: hard "node-fetch@npm:^2.6.11": - version: 2.6.11 - resolution: "node-fetch@npm:2.6.11" + version: 2.6.12 + resolution: "node-fetch@npm:2.6.12" dependencies: whatwg-url: ^5.0.0 peerDependencies: @@ -4666,18 +4426,19 @@ __metadata: peerDependenciesMeta: encoding: optional: true - checksum: 249d0666a9497553384d46b5ab296ba223521ac88fed4d8a17d6ee6c2efb0fc890f3e8091cafe7f9fba8151a5b8d925db2671543b3409a56c3cd522b468b47b3 + checksum: 3bc1655203d47ee8e313c0d96664b9673a3d4dd8002740318e9d27d14ef306693a4b2ef8d6525775056fd912a19e23f3ac0d7111ad8925877b7567b29a625592 languageName: node linkType: hard "node-gyp@npm:latest": - version: 9.3.1 - resolution: "node-gyp@npm:9.3.1" + version: 9.4.0 + resolution: "node-gyp@npm:9.4.0" dependencies: env-paths: ^2.2.0 + exponential-backoff: ^3.1.1 glob: ^7.1.4 graceful-fs: ^4.2.6 - make-fetch-happen: ^10.0.3 + make-fetch-happen: ^11.0.3 nopt: ^6.0.0 npmlog: ^6.0.0 rimraf: ^3.0.2 @@ -4686,7 +4447,7 @@ __metadata: which: ^2.0.2 bin: node-gyp: bin/node-gyp.js - checksum: b860e9976fa645ca0789c69e25387401b4396b93c8375489b5151a6c55cf2640a3b6183c212b38625ef7c508994930b72198338e3d09b9d7ade5acc4aaf51ea7 + checksum: 78b404e2e0639d64e145845f7f5a3cb20c0520cdaf6dda2f6e025e9b644077202ea7de1232396ba5bde3fee84cdc79604feebe6ba3ec84d464c85d407bb5da99 languageName: node linkType: hard @@ -4823,17 +4584,17 @@ __metadata: languageName: node linkType: hard -"optionator@npm:^0.9.1": - version: 0.9.1 - resolution: "optionator@npm:0.9.1" +"optionator@npm:^0.9.3": + version: 0.9.3 + resolution: "optionator@npm:0.9.3" dependencies: + "@aashutoshrathi/word-wrap": ^1.2.3 deep-is: ^0.1.3 fast-levenshtein: ^2.0.6 levn: ^0.4.1 prelude-ls: ^1.2.1 type-check: ^0.4.0 - word-wrap: ^1.2.3 - checksum: dbc6fa065604b24ea57d734261914e697bd73b69eff7f18e967e8912aa2a40a19a9f599a507fa805be6c13c24c4eae8c71306c239d517d42d4c041c942f508a0 + checksum: 09281999441f2fe9c33a5eeab76700795365a061563d66b098923eb719251a42bdbe432790d35064d0816ead9296dbeb1ad51a733edf4167c96bd5d0882e428a languageName: node linkType: hard @@ -4954,13 +4715,13 @@ __metadata: languageName: node linkType: hard -"path-scurry@npm:^1.7.0": - version: 1.9.2 - resolution: "path-scurry@npm:1.9.2" +"path-scurry@npm:^1.10.0": + version: 1.10.0 + resolution: "path-scurry@npm:1.10.0" dependencies: - lru-cache: ^9.1.1 + lru-cache: ^9.1.1 || ^10.0.0 minipass: ^5.0.0 || ^6.0.2 - checksum: 92888dfb68e285043c6d3291c8e971d5d2bc2f5082f4d7b5392896f34be47024c9d0a8b688dd7ae6d125acc424699195474927cb4f00049a9b1ec7c4256fa8e0 + checksum: 3b66a4a6ab66e45755b577c966ecf0da92d3e068b3c992d8f69aa2cc908ef4eda9358253e9b4f86cad43d3ad810ec445be164105975f5cb3fdab68459c59dc6e languageName: node linkType: hard @@ -4971,10 +4732,10 @@ __metadata: languageName: node linkType: hard -"pathe@npm:^1.1.0": - version: 1.1.0 - resolution: "pathe@npm:1.1.0" - checksum: 6b9be9968ea08a90c0824934799707a1c6a1ad22ac1f22080f377e3f75856d5e53a331b01d327329bfce538a14590587cfb250e8e7947f64408797c84c252056 +"pathe@npm:^1.1.0, pathe@npm:^1.1.1": + version: 1.1.1 + resolution: "pathe@npm:1.1.1" + checksum: 34ab3da2e5aa832ebc6a330ffe3f73d7ba8aec6e899b53b8ec4f4018de08e40742802deb12cf5add9c73b7bf719b62c0778246bd376ca62b0fb23e0dde44b759 languageName: node linkType: hard @@ -5129,13 +4890,6 @@ __metadata: languageName: node linkType: hard -"promise-inflight@npm:^1.0.1": - version: 1.0.1 - resolution: "promise-inflight@npm:1.0.1" - checksum: 22749483091d2c594261517f4f80e05226d4d5ecc1fc917e1886929da56e22b5718b7f2a75f3807e7a7d471bc3be2907fe92e6e8f373ddf5c64bae35b5af3981 - languageName: node - linkType: hard - "promise-retry@npm:^2.0.1": version: 2.0.1 resolution: "promise-retry@npm:2.0.1" @@ -5256,6 +5010,17 @@ __metadata: languageName: node linkType: hard +"realistic-structured-clone@npm:^3.0.0": + version: 3.0.0 + resolution: "realistic-structured-clone@npm:3.0.0" + dependencies: + domexception: ^1.0.1 + typeson: ^6.1.0 + typeson-registry: ^1.0.0-alpha.20 + checksum: b4521b299c8dc320a5e3ef44678f80a92b0f1837901a5fbd1c7be06808110fb0b591b417114306ec55b44ef47fd17968aacca079afc9665afbe1c528026295ec + languageName: node + linkType: hard + "redent@npm:^3.0.0": version: 3.0.0 resolution: "redent@npm:3.0.0" @@ -5483,8 +5248,8 @@ __metadata: linkType: hard "rollup@npm:^3.21.0": - version: 3.23.0 - resolution: "rollup@npm:3.23.0" + version: 3.26.0 + resolution: "rollup@npm:3.26.0" dependencies: fsevents: ~2.3.2 dependenciesMeta: @@ -5492,7 +5257,7 @@ __metadata: optional: true bin: rollup: dist/bin/rollup - checksum: 0721065cf725c5611815be61d2b01f20b4d0027e17035f6e76384d38396b56cf6ed21a3db78eb004d9db4d24c8a6a19da4563b4ff96b5dd36f0a0f7a3baf85e8 + checksum: 2d00f1ec8f5b3e84b005b7158446aacfbe669b61a55cea26d4cfb7014fed9169d78dffa8f845c8ef2c8cbc596b9de6e9f925597b87e7ef9b7de4c7da21f188ad languageName: node linkType: hard @@ -5607,13 +5372,13 @@ __metadata: linkType: hard "semver@npm:^7.0.0, semver@npm:^7.3.2, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.1": - version: 7.5.1 - resolution: "semver@npm:7.5.1" + version: 7.5.3 + resolution: "semver@npm:7.5.3" dependencies: lru-cache: ^6.0.0 bin: semver: bin/semver.js - checksum: d16dbedad53c65b086f79524b9ef766bf38670b2395bdad5c957f824dcc566b624988013564f4812bcace3f9d405355c3635e2007396a39d1bffc71cfec4a2fc + checksum: 9d58db16525e9f749ad0a696a1f27deabaa51f66e91d2fa2b0db3de3e9644e8677de3b7d7a03f4c15bc81521e0c3916d7369e0572dbde250d9bedf5194e2a8a7 languageName: node linkType: hard @@ -5641,14 +5406,14 @@ __metadata: linkType: hard "shiki@npm:^0.14.1": - version: 0.14.2 - resolution: "shiki@npm:0.14.2" + version: 0.14.3 + resolution: "shiki@npm:0.14.3" dependencies: ansi-sequence-parser: ^1.1.0 jsonc-parser: ^3.2.0 vscode-oniguruma: ^1.7.0 vscode-textmate: ^8.0.0 - checksum: f2a14302b1803617e3ff1b751a5c87b4af4ad15214dc00e9215402e42940a84a0b956cf55d628f25dbf1296b18e277b8529571cd9359b971ac599a0ab11303e7 + checksum: a4dd98e3b2a5dd8be207448f111ffb9ad2ed6c530f215714d8b61cbf91ec3edbabb09109b8ec58a26678aacd24e8161d5a9bc0c1fa1b4f64b27ceb180cbd0c89 languageName: node linkType: hard @@ -5847,15 +5612,6 @@ __metadata: languageName: node linkType: hard -"ssri@npm:^9.0.0": - version: 9.0.1 - resolution: "ssri@npm:9.0.1" - dependencies: - minipass: ^3.1.1 - checksum: fb58f5e46b6923ae67b87ad5ef1c5ab6d427a17db0bead84570c2df3cd50b4ceb880ebdba2d60726588272890bae842a744e1ecce5bd2a2a582fccd5068309eb - languageName: node - linkType: hard - "stackback@npm:0.0.2": version: 0.0.2 resolution: "stackback@npm:0.0.2" @@ -6114,6 +5870,15 @@ __metadata: languageName: node linkType: hard +"tr46@npm:^2.1.0": + version: 2.1.0 + resolution: "tr46@npm:2.1.0" + dependencies: + punycode: ^2.1.1 + checksum: ffe6049b9dca3ae329b059aada7f515b0f0064c611b39b51ff6b53897e954650f6f63d9319c6c008d36ead477c7b55e5f64c9dc60588ddc91ff720d64eb710b3 + languageName: node + linkType: hard + "tr46@npm:^3.0.0": version: 3.0.0 resolution: "tr46@npm:3.0.0" @@ -6182,21 +5947,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^2.1.0, tslib@npm:^2.4.0, tslib@npm:^2.5.0": - version: 2.5.2 - resolution: "tslib@npm:2.5.2" - checksum: 4d3c1e238b94127ed0e88aa0380db3c2ddae581dc0f4bae5a982345e9f50ee5eda90835b8bfba99b02df10a5734470be197158c36f9129ac49fdc14a6a9da222 - languageName: node - linkType: hard - -"tslib@npm:^2.5.3": - version: 2.5.3 - resolution: "tslib@npm:2.5.3" - checksum: 88902b309afaf83259131c1e13da1dceb0ad1682a213143a1346a649143924d78cf3760c448b84d796938fd76127183894f8d85cbb3bf9c4fddbfcc140c0003c - languageName: node - linkType: hard - -"tslib@npm:^2.6.0": +"tslib@npm:^2.1.0, tslib@npm:^2.4.0, tslib@npm:^2.5.0, tslib@npm:^2.5.3, tslib@npm:^2.6.0": version: 2.6.0 resolution: "tslib@npm:2.6.0" checksum: c01066038f950016a18106ddeca4649b4d76caa76ec5a31e2a26e10586a59fceb4ee45e96719bf6c715648e7c14085a81fee5c62f7e9ebee68e77a5396e5538f @@ -6223,58 +5974,58 @@ __metadata: languageName: node linkType: hard -"turbo-darwin-64@npm:1.10.6": - version: 1.10.6 - resolution: "turbo-darwin-64@npm:1.10.6" +"turbo-darwin-64@npm:1.10.7": + version: 1.10.7 + resolution: "turbo-darwin-64@npm:1.10.7" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"turbo-darwin-arm64@npm:1.10.6": - version: 1.10.6 - resolution: "turbo-darwin-arm64@npm:1.10.6" +"turbo-darwin-arm64@npm:1.10.7": + version: 1.10.7 + resolution: "turbo-darwin-arm64@npm:1.10.7" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"turbo-linux-64@npm:1.10.6": - version: 1.10.6 - resolution: "turbo-linux-64@npm:1.10.6" +"turbo-linux-64@npm:1.10.7": + version: 1.10.7 + resolution: "turbo-linux-64@npm:1.10.7" conditions: os=linux & cpu=x64 languageName: node linkType: hard -"turbo-linux-arm64@npm:1.10.6": - version: 1.10.6 - resolution: "turbo-linux-arm64@npm:1.10.6" +"turbo-linux-arm64@npm:1.10.7": + version: 1.10.7 + resolution: "turbo-linux-arm64@npm:1.10.7" conditions: os=linux & cpu=arm64 languageName: node linkType: hard -"turbo-windows-64@npm:1.10.6": - version: 1.10.6 - resolution: "turbo-windows-64@npm:1.10.6" +"turbo-windows-64@npm:1.10.7": + version: 1.10.7 + resolution: "turbo-windows-64@npm:1.10.7" conditions: os=win32 & cpu=x64 languageName: node linkType: hard -"turbo-windows-arm64@npm:1.10.6": - version: 1.10.6 - resolution: "turbo-windows-arm64@npm:1.10.6" +"turbo-windows-arm64@npm:1.10.7": + version: 1.10.7 + resolution: "turbo-windows-arm64@npm:1.10.7" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard "turbo@npm:^1.10.6": - version: 1.10.6 - resolution: "turbo@npm:1.10.6" - dependencies: - turbo-darwin-64: 1.10.6 - turbo-darwin-arm64: 1.10.6 - turbo-linux-64: 1.10.6 - turbo-linux-arm64: 1.10.6 - turbo-windows-64: 1.10.6 - turbo-windows-arm64: 1.10.6 + version: 1.10.7 + resolution: "turbo@npm:1.10.7" + dependencies: + turbo-darwin-64: 1.10.7 + turbo-darwin-arm64: 1.10.7 + turbo-linux-64: 1.10.7 + turbo-linux-arm64: 1.10.7 + turbo-windows-64: 1.10.7 + turbo-windows-arm64: 1.10.7 dependenciesMeta: turbo-darwin-64: optional: true @@ -6290,7 +6041,7 @@ __metadata: optional: true bin: turbo: bin/turbo - checksum: 920985d59b088e3e203450ee42446a4e0efa7de3a6455828146089e0e9efc4981e52998f7c13fcb730158e652d84bfc49149ebe33ab4a4cc033db7ab32934390 + checksum: 58329caf13b5fef284ccfc21bd1f841023122371d75d2202be809a385aade84fd886cf5c2093323c115c497d503c9c34e1f7ae09e13d06d1dcb4b649883f60dd languageName: node linkType: hard @@ -6352,7 +6103,7 @@ __metadata: languageName: node linkType: hard -"typedoc-json-parser@npm:^8.2.0": +"typedoc-json-parser@npm:^8.1.2, typedoc-json-parser@npm:^8.2.0": version: 8.2.0 resolution: "typedoc-json-parser@npm:8.2.0" dependencies: @@ -6385,13 +6136,13 @@ __metadata: languageName: node linkType: hard -"typescript@npm:^4.6.4 || ^5.0.0, typescript@npm:^5.0.3, typescript@npm:^5.0.4, typescript@npm:~5.0.4": - version: 5.0.4 - resolution: "typescript@npm:5.0.4" +"typescript@npm:^4.6.4 || ^5.0.0, typescript@npm:^5.0.3, typescript@npm:^5.0.4": + version: 5.1.6 + resolution: "typescript@npm:5.1.6" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 82b94da3f4604a8946da585f7d6c3025fff8410779e5bde2855ab130d05e4fd08938b9e593b6ebed165bda6ad9292b230984f10952cf82f0a0ca07bbeaa08172 + checksum: b2f2c35096035fe1f5facd1e38922ccb8558996331405eb00a5111cc948b2e733163cc22fab5db46992aba7dd520fff637f2c1df4996ff0e134e77d3249a7350 languageName: node linkType: hard @@ -6405,13 +6156,23 @@ __metadata: languageName: node linkType: hard -"typescript@patch:typescript@^4.6.4 || ^5.0.0#~builtin, typescript@patch:typescript@^5.0.3#~builtin, typescript@patch:typescript@^5.0.4#~builtin, typescript@patch:typescript@~5.0.4#~builtin": +"typescript@npm:~5.0.4": version: 5.0.4 - resolution: "typescript@patch:typescript@npm%3A5.0.4#~builtin::version=5.0.4&hash=b5f058" + resolution: "typescript@npm:5.0.4" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: d26b6ba97b6d163c55dbdffd9bbb4c211667ebebc743accfeb2c8c0154aace7afd097b51165a72a5bad2cf65a4612259344ff60f8e642362aa1695c760d303ac + checksum: 82b94da3f4604a8946da585f7d6c3025fff8410779e5bde2855ab130d05e4fd08938b9e593b6ebed165bda6ad9292b230984f10952cf82f0a0ca07bbeaa08172 + languageName: node + linkType: hard + +"typescript@patch:typescript@^4.6.4 || ^5.0.0#~builtin, typescript@patch:typescript@^5.0.3#~builtin, typescript@patch:typescript@^5.0.4#~builtin": + version: 5.1.6 + resolution: "typescript@patch:typescript@npm%3A5.1.6#~builtin::version=5.1.6&hash=5da071" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: f53bfe97f7c8b2b6d23cf572750d4e7d1e0c5fff1c36d859d0ec84556a827b8785077bc27676bf7e71fae538e517c3ecc0f37e7f593be913d884805d931bc8be languageName: node linkType: hard @@ -6425,19 +6186,38 @@ __metadata: languageName: node linkType: hard -"ufo@npm:^1.1.2": - version: 1.1.2 - resolution: "ufo@npm:1.1.2" - checksum: 83c940a6a23b6d4fc0cd116265bb5dcf88ab34a408ad9196e413270ca607a4781c09b547dc518f43caee128a096f20fe80b5a0e62b4bcc0a868619896106d048 +"typescript@patch:typescript@~5.0.4#~builtin": + version: 5.0.4 + resolution: "typescript@patch:typescript@npm%3A5.0.4#~builtin::version=5.0.4&hash=b5f058" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: d26b6ba97b6d163c55dbdffd9bbb4c211667ebebc743accfeb2c8c0154aace7afd097b51165a72a5bad2cf65a4612259344ff60f8e642362aa1695c760d303ac languageName: node linkType: hard -"unique-filename@npm:^2.0.0": - version: 2.0.1 - resolution: "unique-filename@npm:2.0.1" +"typeson-registry@npm:^1.0.0-alpha.20": + version: 1.0.0-alpha.39 + resolution: "typeson-registry@npm:1.0.0-alpha.39" dependencies: - unique-slug: ^3.0.0 - checksum: 807acf3381aff319086b64dc7125a9a37c09c44af7620bd4f7f3247fcd5565660ac12d8b80534dcbfd067e6fe88a67e621386dd796a8af828d1337a8420a255f + base64-arraybuffer-es6: ^0.7.0 + typeson: ^6.0.0 + whatwg-url: ^8.4.0 + checksum: c6b629697acf4652aecfff7be760356d764600afc9beca253278bbfc44fae0fe635b7619201b83e497cdc30645cbce7614d12a04b5726d9b8b505f73e6a3fc2a + languageName: node + linkType: hard + +"typeson@npm:^6.0.0, typeson@npm:^6.1.0": + version: 6.1.0 + resolution: "typeson@npm:6.1.0" + checksum: 00a77b03ac8f704acb103307bad9295fe47d6b304c386297f078ec3be63875c0b81e022a4815edb9dc2c7da0a72a431345411d35c755a8510af4a420e9e46cdc + languageName: node + linkType: hard + +"ufo@npm:^1.1.2": + version: 1.1.2 + resolution: "ufo@npm:1.1.2" + checksum: 83c940a6a23b6d4fc0cd116265bb5dcf88ab34a408ad9196e413270ca607a4781c09b547dc518f43caee128a096f20fe80b5a0e62b4bcc0a868619896106d048 languageName: node linkType: hard @@ -6450,15 +6230,6 @@ __metadata: languageName: node linkType: hard -"unique-slug@npm:^3.0.0": - version: 3.0.0 - resolution: "unique-slug@npm:3.0.0" - dependencies: - imurmurhash: ^0.1.4 - checksum: 49f8d915ba7f0101801b922062ee46b7953256c93ceca74303bd8e6413ae10aa7e8216556b54dc5382895e8221d04f1efaf75f945c2e4a515b4139f77aa6640c - languageName: node - linkType: hard - "unique-slug@npm:^4.0.0": version: 4.0.0 resolution: "unique-slug@npm:4.0.0" @@ -6590,7 +6361,7 @@ __metadata: languageName: node linkType: hard -"vitest@npm:^0.32.2": +"vitest@npm:^0.32.0, vitest@npm:^0.32.2": version: 0.32.2 resolution: "vitest@npm:0.32.2" dependencies: @@ -6672,6 +6443,20 @@ __metadata: languageName: node linkType: hard +"webidl-conversions@npm:^4.0.2": + version: 4.0.2 + resolution: "webidl-conversions@npm:4.0.2" + checksum: c93d8dfe908a0140a4ae9c0ebc87a33805b416a33ee638a605b551523eec94a9632165e54632f6d57a39c5f948c4bab10e0e066525e9a4b87a79f0d04fbca374 + languageName: node + linkType: hard + +"webidl-conversions@npm:^6.1.0": + version: 6.1.0 + resolution: "webidl-conversions@npm:6.1.0" + checksum: 1f526507aa491f972a0c1409d07f8444e1d28778dfa269a9971f2e157182f3d496dc33296e4ed45b157fdb3bf535bb90c90bf10c50dcf1dd6caacb2a34cc84fb + languageName: node + linkType: hard + "webidl-conversions@npm:^7.0.0": version: 7.0.0 resolution: "webidl-conversions@npm:7.0.0" @@ -6706,6 +6491,17 @@ __metadata: languageName: node linkType: hard +"whatwg-url@npm:^8.4.0": + version: 8.7.0 + resolution: "whatwg-url@npm:8.7.0" + dependencies: + lodash: ^4.7.0 + tr46: ^2.1.0 + webidl-conversions: ^6.1.0 + checksum: a87abcc6cefcece5311eb642858c8fdb234e51ec74196bfacf8def2edae1bfbffdf6acb251646ed6301f8cee44262642d8769c707256125a91387e33f405dd1e + languageName: node + linkType: hard + "which@npm:^2.0.1, which@npm:^2.0.2": version: 2.0.2 resolution: "which@npm:2.0.2" @@ -6738,13 +6534,6 @@ __metadata: languageName: node linkType: hard -"word-wrap@npm:^1.2.3": - version: 1.2.3 - resolution: "word-wrap@npm:1.2.3" - checksum: 30b48f91fcf12106ed3186ae4fa86a6a1842416df425be7b60485de14bec665a54a68e4b5156647dec3a70f25e84d270ca8bc8cd23182ed095f5c7206a938c1f - languageName: node - linkType: hard - "wrap-ansi-cjs@npm:wrap-ansi@^7.0.0, wrap-ansi@npm:^7.0.0": version: 7.0.0 resolution: "wrap-ansi@npm:7.0.0"