@alepha/bucket-vercel 0.13.6 → 0.13.7
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 +26 -19
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { del, head, put } from "@vercel/blob";
|
|
2
|
-
import * as
|
|
2
|
+
import * as typebox3 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
4
|
import { Readable } from "node:stream";
|
|
5
5
|
import { ReadableStream as ReadableStream$1 } from "node:stream/web";
|
|
@@ -318,7 +318,7 @@ declare class JsonSchemaCodec extends SchemaCodec {
|
|
|
318
318
|
//#endregion
|
|
319
319
|
//#region ../alepha/src/core/providers/SchemaValidator.d.ts
|
|
320
320
|
declare class SchemaValidator {
|
|
321
|
-
protected cache: Map<TSchema, Validator<
|
|
321
|
+
protected cache: Map<TSchema, Validator<typebox3.TProperties, TSchema, unknown, unknown>>;
|
|
322
322
|
/**
|
|
323
323
|
* Validate the value against the provided schema.
|
|
324
324
|
*
|
|
@@ -422,7 +422,7 @@ declare class CodecManager {
|
|
|
422
422
|
//#endregion
|
|
423
423
|
//#region ../alepha/src/core/providers/EventManager.d.ts
|
|
424
424
|
declare class EventManager {
|
|
425
|
-
|
|
425
|
+
logFn?: () => LoggerInterface | undefined;
|
|
426
426
|
/**
|
|
427
427
|
* List of events that can be triggered. Powered by $hook().
|
|
428
428
|
*/
|
|
@@ -468,7 +468,7 @@ declare class StateManager<State$1 extends object = State> {
|
|
|
468
468
|
protected readonly als: AlsProvider;
|
|
469
469
|
protected readonly events: EventManager;
|
|
470
470
|
protected readonly codec: JsonSchemaCodec;
|
|
471
|
-
protected readonly atoms: Map<keyof State$1, Atom<TObject<
|
|
471
|
+
protected readonly atoms: Map<keyof State$1, Atom<TObject<typebox3.TProperties>, string>>;
|
|
472
472
|
protected store: Partial<State$1>;
|
|
473
473
|
constructor(store?: Partial<State$1>);
|
|
474
474
|
getAtoms(context?: boolean): Array<AtomWithValue>;
|
|
@@ -481,8 +481,8 @@ declare class StateManager<State$1 extends object = State> {
|
|
|
481
481
|
/**
|
|
482
482
|
* Set a value in the state
|
|
483
483
|
*/
|
|
484
|
-
set<T extends TAtomObject>(target: Atom<T>, value: AtomStatic<T
|
|
485
|
-
set<Key extends keyof State$1>(target: Key, value: State$1[Key] | undefined): this;
|
|
484
|
+
set<T extends TAtomObject>(target: Atom<T>, value: AtomStatic<T>, options?: SetStateOptions): this;
|
|
485
|
+
set<Key extends keyof State$1>(target: Key, value: State$1[Key] | undefined, options?: SetStateOptions): this;
|
|
486
486
|
/**
|
|
487
487
|
* Mutate a value in the state.
|
|
488
488
|
*/
|
|
@@ -499,7 +499,7 @@ declare class StateManager<State$1 extends object = State> {
|
|
|
499
499
|
/**
|
|
500
500
|
* Push a value to an array in the state
|
|
501
501
|
*/
|
|
502
|
-
push<Key extends keyof OnlyArray<State$1>>(key: Key, value: NonNullable<State$1[Key]> extends Array<infer U> ? U : never): this;
|
|
502
|
+
push<Key extends keyof OnlyArray<State$1>>(key: Key, ...value: Array<NonNullable<State$1[Key]> extends Array<infer U> ? U : never>): this;
|
|
503
503
|
/**
|
|
504
504
|
* Clear all state
|
|
505
505
|
*/
|
|
@@ -510,6 +510,10 @@ declare class StateManager<State$1 extends object = State> {
|
|
|
510
510
|
keys(): (keyof State$1)[];
|
|
511
511
|
}
|
|
512
512
|
type OnlyArray<T extends object> = { [K in keyof T]: NonNullable<T[K]> extends Array<any> ? K : never };
|
|
513
|
+
interface SetStateOptions {
|
|
514
|
+
skipContext?: boolean;
|
|
515
|
+
skipEvents?: boolean;
|
|
516
|
+
}
|
|
513
517
|
//#endregion
|
|
514
518
|
//#region ../alepha/src/core/Alepha.d.ts
|
|
515
519
|
/**
|
|
@@ -666,12 +670,6 @@ declare class Alepha {
|
|
|
666
670
|
* A promise that resolves when the App has started.
|
|
667
671
|
*/
|
|
668
672
|
protected starting?: PromiseWithResolvers<this>;
|
|
669
|
-
/**
|
|
670
|
-
* Initial state of the container.
|
|
671
|
-
*
|
|
672
|
-
* > Used to initialize the StateManager.
|
|
673
|
-
*/
|
|
674
|
-
protected init: Partial<State>;
|
|
675
673
|
/**
|
|
676
674
|
* During the instantiation process, we keep a list of pending instantiations.
|
|
677
675
|
* > It allows us to detect circular dependencies.
|
|
@@ -711,21 +709,21 @@ declare class Alepha {
|
|
|
711
709
|
*
|
|
712
710
|
* Mocked for browser environments.
|
|
713
711
|
*/
|
|
714
|
-
|
|
712
|
+
context: AlsProvider;
|
|
715
713
|
/**
|
|
716
714
|
* Event manager to handle lifecycle events and custom events.
|
|
717
715
|
*/
|
|
718
|
-
|
|
716
|
+
events: EventManager;
|
|
719
717
|
/**
|
|
720
718
|
* State manager to store arbitrary values.
|
|
721
719
|
*/
|
|
722
|
-
|
|
720
|
+
store: StateManager<State>;
|
|
723
721
|
/**
|
|
724
722
|
* Codec manager for encoding and decoding data with different formats.
|
|
725
723
|
*
|
|
726
724
|
* Supports multiple codec formats (JSON, Protobuf, etc.) with a unified interface.
|
|
727
725
|
*/
|
|
728
|
-
|
|
726
|
+
codec: CodecManager;
|
|
729
727
|
/**
|
|
730
728
|
* Get logger instance.
|
|
731
729
|
*/
|
|
@@ -734,7 +732,7 @@ declare class Alepha {
|
|
|
734
732
|
* The environment variables for the App.
|
|
735
733
|
*/
|
|
736
734
|
get env(): Readonly<Env>;
|
|
737
|
-
constructor(
|
|
735
|
+
constructor(state?: Partial<State>);
|
|
738
736
|
set<T extends TAtomObject>(target: Atom<T>, value: AtomStatic<T>): this;
|
|
739
737
|
set<Key extends keyof State>(target: Key, value: State[Key] | undefined): this;
|
|
740
738
|
/**
|
|
@@ -887,6 +885,15 @@ declare class Alepha {
|
|
|
887
885
|
* @return The schema object with environment variables applied.
|
|
888
886
|
*/
|
|
889
887
|
parseEnv<T extends TObject>(schema: T): Static<T>;
|
|
888
|
+
/**
|
|
889
|
+
* Get all environment variable schemas and their parsed values.
|
|
890
|
+
*
|
|
891
|
+
* This is useful for DevTools to display all expected environment variables.
|
|
892
|
+
*/
|
|
893
|
+
getEnvSchemas(): Array<{
|
|
894
|
+
schema: TSchema$1;
|
|
895
|
+
values: Record<string, any>;
|
|
896
|
+
}>;
|
|
890
897
|
/**
|
|
891
898
|
* Dump the current dependency graph of the App.
|
|
892
899
|
*
|
|
@@ -1270,7 +1277,7 @@ declare const envSchema$1: TObject$1<{
|
|
|
1270
1277
|
/**
|
|
1271
1278
|
* Built-in log formats.
|
|
1272
1279
|
* - "json" - JSON format, useful for structured logging and log aggregation. {@link JsonFormatterProvider}
|
|
1273
|
-
* - "pretty" - Simple text format, human-readable, with colors. {@link
|
|
1280
|
+
* - "pretty" - Simple text format, human-readable, with colors. {@link PrettyFormatterProvider}
|
|
1274
1281
|
* - "raw" - Raw format, no formatting, just the message. {@link RawFormatterProvider}
|
|
1275
1282
|
*/
|
|
1276
1283
|
LOG_FORMAT: TOptional<TUnsafe<"json" | "pretty" | "raw">>;
|
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.7",
|
|
14
14
|
"type": "module",
|
|
15
15
|
"engines": {
|
|
16
16
|
"node": ">=22.0.0"
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"@vercel/blob": "^2.0.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@types/node": "^
|
|
30
|
-
"alepha": "0.13.
|
|
31
|
-
"tsdown": "^0.17.
|
|
29
|
+
"@types/node": "^25.0.0",
|
|
30
|
+
"alepha": "0.13.7",
|
|
31
|
+
"tsdown": "^0.17.2",
|
|
32
32
|
"vitest": "^4.0.15"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"alepha": "0.13.
|
|
35
|
+
"alepha": "0.13.7"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"lint": "alepha lint",
|