@alepha/bucket-vercel 0.13.3 → 0.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +90 -88
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { del, head, put } from "@vercel/blob";
|
|
2
2
|
import * as typebox0 from "typebox";
|
|
3
3
|
import { Static, StaticDecode as Static$1, StaticEncode, TAny, TArray, TArray as TArray$1, TBoolean, TInteger, TNumber, TObject, TObject as TObject$1, TOptional, TOptionalAdd, TRecord, TSchema, TSchema as TSchema$1, TString, TUnsafe } from "typebox";
|
|
4
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
5
4
|
import { Readable } from "node:stream";
|
|
6
5
|
import { ReadableStream as ReadableStream$1 } from "node:stream/web";
|
|
6
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
7
7
|
import { Validator } from "typebox/compile";
|
|
8
8
|
import dayjsDuration from "dayjs/plugin/duration.js";
|
|
9
9
|
import DayjsApi, { Dayjs, ManipulateType, PluginFunc } from "dayjs";
|
|
@@ -107,6 +107,93 @@ interface LoggerInterface {
|
|
|
107
107
|
error(message: string, data?: unknown): void;
|
|
108
108
|
}
|
|
109
109
|
//#endregion
|
|
110
|
+
//#region ../alepha/src/core/helpers/FileLike.d.ts
|
|
111
|
+
interface FileLike {
|
|
112
|
+
/**
|
|
113
|
+
* Filename.
|
|
114
|
+
* @default "file"
|
|
115
|
+
*/
|
|
116
|
+
name: string;
|
|
117
|
+
/**
|
|
118
|
+
* Mandatory MIME type of the file.
|
|
119
|
+
* @default "application/octet-stream"
|
|
120
|
+
*/
|
|
121
|
+
type: string;
|
|
122
|
+
/**
|
|
123
|
+
* Size of the file in bytes.
|
|
124
|
+
*
|
|
125
|
+
* Always 0 for streams, as the size is not known until the stream is fully read.
|
|
126
|
+
*
|
|
127
|
+
* @default 0
|
|
128
|
+
*/
|
|
129
|
+
size: number;
|
|
130
|
+
/**
|
|
131
|
+
* Last modified timestamp in milliseconds since epoch.
|
|
132
|
+
*
|
|
133
|
+
* Always the current timestamp for streams, as the last modified time is not known.
|
|
134
|
+
* We use this field to ensure compatibility with File API.
|
|
135
|
+
*
|
|
136
|
+
* @default Date.now()
|
|
137
|
+
*/
|
|
138
|
+
lastModified: number;
|
|
139
|
+
/**
|
|
140
|
+
* Returns a ReadableStream or Node.js Readable stream of the file content.
|
|
141
|
+
*
|
|
142
|
+
* For streams, this is the original stream.
|
|
143
|
+
*/
|
|
144
|
+
stream(): StreamLike;
|
|
145
|
+
/**
|
|
146
|
+
* Returns the file content as an ArrayBuffer.
|
|
147
|
+
*
|
|
148
|
+
* For streams, this reads the entire stream into memory.
|
|
149
|
+
*/
|
|
150
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
151
|
+
/**
|
|
152
|
+
* Returns the file content as a string.
|
|
153
|
+
*
|
|
154
|
+
* For streams, this reads the entire stream into memory and converts it to a string.
|
|
155
|
+
*/
|
|
156
|
+
text(): Promise<string>;
|
|
157
|
+
/**
|
|
158
|
+
* Optional file path, if the file is stored on disk.
|
|
159
|
+
*
|
|
160
|
+
* This is not from the File API, but rather a custom field to indicate where the file is stored.
|
|
161
|
+
*/
|
|
162
|
+
filepath?: string;
|
|
163
|
+
}
|
|
164
|
+
type StreamLike = ReadableStream | ReadableStream$1 | Readable | NodeJS.ReadableStream;
|
|
165
|
+
//#endregion
|
|
166
|
+
//#region ../alepha/src/core/providers/TypeProvider.d.ts
|
|
167
|
+
declare module "typebox" {
|
|
168
|
+
interface TString {
|
|
169
|
+
format?: string;
|
|
170
|
+
minLength?: number;
|
|
171
|
+
maxLength?: number;
|
|
172
|
+
}
|
|
173
|
+
interface TNumber {
|
|
174
|
+
format?: "int64";
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region ../alepha/src/core/primitives/$atom.d.ts
|
|
179
|
+
type AtomOptions<T extends TAtomObject, N extends string> = {
|
|
180
|
+
name: N;
|
|
181
|
+
schema: T;
|
|
182
|
+
description?: string;
|
|
183
|
+
} & (T extends TOptionalAdd<T> ? {
|
|
184
|
+
default?: Static$1<T>;
|
|
185
|
+
} : {
|
|
186
|
+
default: Static$1<T>;
|
|
187
|
+
});
|
|
188
|
+
declare class Atom<T extends TAtomObject = TObject$1, N extends string = string> {
|
|
189
|
+
readonly options: AtomOptions<T, N>;
|
|
190
|
+
get schema(): T;
|
|
191
|
+
get key(): N;
|
|
192
|
+
constructor(options: AtomOptions<T, N>);
|
|
193
|
+
}
|
|
194
|
+
type TAtomObject = TObject$1<any> | TArray;
|
|
195
|
+
type AtomStatic<T extends TAtomObject> = T extends TOptionalAdd<T> ? Static$1<T> | undefined : Static$1<T>;
|
|
196
|
+
//#endregion
|
|
110
197
|
//#region ../alepha/src/core/primitives/$inject.d.ts
|
|
111
198
|
interface InjectOptions<T extends object = any> {
|
|
112
199
|
/**
|
|
@@ -203,74 +290,6 @@ declare class Json {
|
|
|
203
290
|
parse(text: string, reviver?: (this: any, key: string, value: any) => any): any;
|
|
204
291
|
}
|
|
205
292
|
//#endregion
|
|
206
|
-
//#region ../alepha/src/core/helpers/FileLike.d.ts
|
|
207
|
-
interface FileLike {
|
|
208
|
-
/**
|
|
209
|
-
* Filename.
|
|
210
|
-
* @default "file"
|
|
211
|
-
*/
|
|
212
|
-
name: string;
|
|
213
|
-
/**
|
|
214
|
-
* Mandatory MIME type of the file.
|
|
215
|
-
* @default "application/octet-stream"
|
|
216
|
-
*/
|
|
217
|
-
type: string;
|
|
218
|
-
/**
|
|
219
|
-
* Size of the file in bytes.
|
|
220
|
-
*
|
|
221
|
-
* Always 0 for streams, as the size is not known until the stream is fully read.
|
|
222
|
-
*
|
|
223
|
-
* @default 0
|
|
224
|
-
*/
|
|
225
|
-
size: number;
|
|
226
|
-
/**
|
|
227
|
-
* Last modified timestamp in milliseconds since epoch.
|
|
228
|
-
*
|
|
229
|
-
* Always the current timestamp for streams, as the last modified time is not known.
|
|
230
|
-
* We use this field to ensure compatibility with File API.
|
|
231
|
-
*
|
|
232
|
-
* @default Date.now()
|
|
233
|
-
*/
|
|
234
|
-
lastModified: number;
|
|
235
|
-
/**
|
|
236
|
-
* Returns a ReadableStream or Node.js Readable stream of the file content.
|
|
237
|
-
*
|
|
238
|
-
* For streams, this is the original stream.
|
|
239
|
-
*/
|
|
240
|
-
stream(): StreamLike;
|
|
241
|
-
/**
|
|
242
|
-
* Returns the file content as an ArrayBuffer.
|
|
243
|
-
*
|
|
244
|
-
* For streams, this reads the entire stream into memory.
|
|
245
|
-
*/
|
|
246
|
-
arrayBuffer(): Promise<ArrayBuffer>;
|
|
247
|
-
/**
|
|
248
|
-
* Returns the file content as a string.
|
|
249
|
-
*
|
|
250
|
-
* For streams, this reads the entire stream into memory and converts it to a string.
|
|
251
|
-
*/
|
|
252
|
-
text(): Promise<string>;
|
|
253
|
-
/**
|
|
254
|
-
* Optional file path, if the file is stored on disk.
|
|
255
|
-
*
|
|
256
|
-
* This is not from the File API, but rather a custom field to indicate where the file is stored.
|
|
257
|
-
*/
|
|
258
|
-
filepath?: string;
|
|
259
|
-
}
|
|
260
|
-
type StreamLike = ReadableStream | ReadableStream$1 | Readable | NodeJS.ReadableStream;
|
|
261
|
-
//#endregion
|
|
262
|
-
//#region ../alepha/src/core/providers/TypeProvider.d.ts
|
|
263
|
-
declare module "typebox" {
|
|
264
|
-
interface TString {
|
|
265
|
-
format?: string;
|
|
266
|
-
minLength?: number;
|
|
267
|
-
maxLength?: number;
|
|
268
|
-
}
|
|
269
|
-
interface TNumber {
|
|
270
|
-
format?: "int64";
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
//#endregion
|
|
274
293
|
//#region ../alepha/src/core/providers/SchemaCodec.d.ts
|
|
275
294
|
declare abstract class SchemaCodec {
|
|
276
295
|
/**
|
|
@@ -440,25 +459,6 @@ declare class EventManager {
|
|
|
440
459
|
}): Promise<void>;
|
|
441
460
|
}
|
|
442
461
|
//#endregion
|
|
443
|
-
//#region ../alepha/src/core/primitives/$atom.d.ts
|
|
444
|
-
type AtomOptions<T extends TAtomObject, N extends string> = {
|
|
445
|
-
name: N;
|
|
446
|
-
schema: T;
|
|
447
|
-
description?: string;
|
|
448
|
-
} & (T extends TOptionalAdd<T> ? {
|
|
449
|
-
default?: Static$1<T>;
|
|
450
|
-
} : {
|
|
451
|
-
default: Static$1<T>;
|
|
452
|
-
});
|
|
453
|
-
declare class Atom<T extends TAtomObject = TObject$1, N extends string = string> {
|
|
454
|
-
readonly options: AtomOptions<T, N>;
|
|
455
|
-
get schema(): T;
|
|
456
|
-
get key(): N;
|
|
457
|
-
constructor(options: AtomOptions<T, N>);
|
|
458
|
-
}
|
|
459
|
-
type TAtomObject = TObject$1<any> | TArray;
|
|
460
|
-
type AtomStatic<T extends TAtomObject> = T extends TOptionalAdd<T> ? Static$1<T> | undefined : Static$1<T>;
|
|
461
|
-
//#endregion
|
|
462
462
|
//#region ../alepha/src/core/providers/StateManager.d.ts
|
|
463
463
|
interface AtomWithValue {
|
|
464
464
|
atom: Atom;
|
|
@@ -735,6 +735,8 @@ declare class Alepha {
|
|
|
735
735
|
*/
|
|
736
736
|
get env(): Readonly<Env>;
|
|
737
737
|
constructor(init?: Partial<State>);
|
|
738
|
+
set<T extends TAtomObject>(target: Atom<T>, value: AtomStatic<T>): this;
|
|
739
|
+
set<Key extends keyof State>(target: Key, value: State[Key] | undefined): this;
|
|
738
740
|
/**
|
|
739
741
|
* True when start() is called.
|
|
740
742
|
*
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"blob"
|
|
11
11
|
],
|
|
12
12
|
"author": "Nicolas Foures",
|
|
13
|
-
"version": "0.13.
|
|
13
|
+
"version": "0.13.4",
|
|
14
14
|
"type": "module",
|
|
15
15
|
"engines": {
|
|
16
16
|
"node": ">=22.0.0"
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/node": "^24.10.1",
|
|
30
|
-
"alepha": "0.13.
|
|
30
|
+
"alepha": "0.13.4",
|
|
31
31
|
"tsdown": "^0.16.8",
|
|
32
32
|
"vitest": "^4.0.15"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"alepha": "0.13.
|
|
35
|
+
"alepha": "0.13.4"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"lint": "alepha lint",
|