@miniflare/shared
Advanced tools
Comparing version 2.6.0-d1.1 to 2.6.0
import { Awaitable as Awaitable_2 } from '@miniflare/shared'; | ||
import type { Database } from 'better-sqlite3'; | ||
@@ -60,4 +59,2 @@ export declare function addAll<T>(set: Set<T>, values: Iterable<T>): void; | ||
export declare function getSQLiteNativeBindingLocation(): string; | ||
export declare function globsToMatcher(globs?: string[]): Matcher; | ||
@@ -262,2 +259,24 @@ | ||
export declare interface Range { | ||
offset?: number; | ||
length?: number; | ||
suffix?: number; | ||
} | ||
export declare interface RangeStoredMeta<Meta = unknown> extends StoredMeta<Meta> { | ||
range: { | ||
offset: number; | ||
length: number; | ||
}; | ||
} | ||
export declare interface RangeStoredValue extends StoredValue { | ||
range: { | ||
offset: number; | ||
length: number; | ||
}; | ||
} | ||
export declare type RangeStoredValueMeta<Meta = unknown> = RangeStoredValue & RangeStoredMeta<Meta>; | ||
export declare class RequestContext { | ||
@@ -347,4 +366,7 @@ #private; | ||
abstract has(key: string): Awaitable<boolean>; | ||
abstract head<Meta = unknown>(key: string): Awaitable<StoredMeta<Meta> | undefined>; | ||
abstract get<Meta = unknown>(key: string, skipMetadata?: false): Awaitable<StoredValueMeta<Meta> | undefined>; | ||
abstract get(key: string, skipMetadata: true): Awaitable<StoredValue | undefined>; | ||
abstract getRange<Meta = unknown>(key: string, range?: Range, skipMetadata?: false): Awaitable<RangeStoredValueMeta<Meta> | undefined>; | ||
abstract getRange(key: string, range: undefined | Range, skipMetadata: true): Awaitable<RangeStoredValue | undefined>; | ||
abstract put<Meta = unknown>(key: string, value: StoredValueMeta<Meta>): Awaitable<void>; | ||
@@ -354,4 +376,2 @@ abstract delete(key: string): Awaitable<boolean>; | ||
abstract list(options: StorageListOptions, skipMetadata: true): Awaitable<StorageListResult<StoredKey>>; | ||
getSqliteDatabase(): Database; | ||
getRangeMaybeExpired?<Meta = unknown>(key: string, start: number, length: number): Promise<StoredValueMeta<Meta> | undefined>; | ||
hasMany(keys: string[]): Promise<number>; | ||
@@ -382,2 +402,4 @@ getMany<Meta = unknown>(keys: string[], skipMetadata?: false): Promise<(StoredValueMeta<Meta> | undefined)[]>; | ||
limit?: number; | ||
/** If Delimiter, filter all keys containing delimiter and update cursor */ | ||
delimiter?: string; | ||
} | ||
@@ -389,2 +411,4 @@ | ||
cursor: string; | ||
/** DelimitedPrefixes if delimiter */ | ||
delimitedPrefixes?: string[]; | ||
} | ||
@@ -501,6 +525,6 @@ | ||
}[]; | ||
d1_databases?: { | ||
r2_buckets?: { | ||
binding: string; | ||
database_name: string; | ||
database_id: string; | ||
bucket_name?: string; | ||
preview_bucket_name?: string; | ||
}[]; | ||
@@ -536,3 +560,3 @@ site?: { | ||
kv_persist?: boolean | string; | ||
d1_persist?: boolean | string; | ||
r2_persist?: boolean | string; | ||
cache?: boolean; | ||
@@ -567,3 +591,5 @@ cache_persist?: boolean | string; | ||
export declare interface WranglerServiceConfig { | ||
name: string; | ||
/** @deprecated Use `binding` instead */ | ||
name?: string; | ||
binding?: string; | ||
service: string; | ||
@@ -570,0 +596,0 @@ environment: string; |
@@ -53,3 +53,2 @@ var __create = Object.create; | ||
getRequestContext: () => getRequestContext, | ||
getSQLiteNativeBindingLocation: () => getSQLiteNativeBindingLocation, | ||
globsToMatcher: () => globsToMatcher, | ||
@@ -539,7 +538,3 @@ kWrapListener: () => kWrapListener, | ||
// packages/shared/src/storage.ts | ||
var import_node_path = __toModule(require("node:path")); | ||
var Storage = class { | ||
getSqliteDatabase() { | ||
throw new Error("D1 not implemented for this Storage class"); | ||
} | ||
async hasMany(keys) { | ||
@@ -568,5 +563,2 @@ const results = keys.map(this.has.bind(this)); | ||
}; | ||
function getSQLiteNativeBindingLocation() { | ||
return import_node_path.default.resolve(import_node_path.default.dirname(require.resolve("better-sqlite3")), "../build/Release/better_sqlite3.node"); | ||
} | ||
@@ -742,3 +734,2 @@ // packages/shared/src/sync/clock.ts | ||
getRequestContext, | ||
getSQLiteNativeBindingLocation, | ||
globsToMatcher, | ||
@@ -745,0 +736,0 @@ kWrapListener, |
{ | ||
"name": "@miniflare/shared", | ||
"version": "2.6.0-d1.1", | ||
"version": "2.6.0", | ||
"description": "Shared utility module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers", | ||
@@ -38,4 +38,2 @@ "keywords": [ | ||
"dependencies": { | ||
"@types/better-sqlite3": "^7.5.0", | ||
"better-sqlite3": "^7.5.3", | ||
"ignore": "^5.1.8", | ||
@@ -45,4 +43,4 @@ "kleur": "^4.1.4" | ||
"devDependencies": { | ||
"@miniflare/shared-test": "2.6.0-d1.1" | ||
"@miniflare/shared-test": "2.6.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
58235
2
1250
0
0
- Removed@types/better-sqlite3@^7.5.0
- Removedbetter-sqlite3@^7.5.3
- Removed@types/better-sqlite3@7.6.11(transitive)
- Removed@types/node@22.9.0(transitive)
- Removedbase64-js@1.5.1(transitive)
- Removedbetter-sqlite3@7.6.2(transitive)
- Removedbindings@1.5.0(transitive)
- Removedbl@4.1.0(transitive)
- Removedbuffer@5.7.1(transitive)
- Removedchownr@1.1.4(transitive)
- Removeddecompress-response@6.0.0(transitive)
- Removeddeep-extend@0.6.0(transitive)
- Removeddetect-libc@2.0.3(transitive)
- Removedend-of-stream@1.4.4(transitive)
- Removedexpand-template@2.0.3(transitive)
- Removedfile-uri-to-path@1.0.0(transitive)
- Removedfs-constants@1.0.0(transitive)
- Removedgithub-from-package@0.0.0(transitive)
- Removedieee754@1.2.1(transitive)
- Removedinherits@2.0.4(transitive)
- Removedini@1.3.8(transitive)
- Removedmimic-response@3.1.0(transitive)
- Removedminimist@1.2.8(transitive)
- Removedmkdirp-classic@0.5.3(transitive)
- Removednapi-build-utils@1.0.2(transitive)
- Removednode-abi@3.71.0(transitive)
- Removedonce@1.4.0(transitive)
- Removedprebuild-install@7.1.2(transitive)
- Removedpump@3.0.2(transitive)
- Removedrc@1.2.8(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsemver@7.6.3(transitive)
- Removedsimple-concat@1.0.1(transitive)
- Removedsimple-get@4.0.1(transitive)
- Removedstring_decoder@1.3.0(transitive)
- Removedstrip-json-comments@2.0.1(transitive)
- Removedtar-fs@2.1.1(transitive)
- Removedtar-stream@2.2.0(transitive)
- Removedtunnel-agent@0.6.0(transitive)
- Removedundici-types@6.19.8(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedwrappy@1.0.2(transitive)