@dotbep/core 0.2.8 → 0.2.10
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 +3 -37
- package/dist/index.js +1262 -1286
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -21,25 +21,6 @@ export declare const ActionSchema: z.ZodObject<{
|
|
|
21
21
|
guideIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
22
22
|
}, z.core.$strip>;
|
|
23
23
|
|
|
24
|
-
export declare type Adapter = z.infer<typeof AdapterSchema>;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Handler registered for a specific Adapter.id.
|
|
28
|
-
* Receives the raw output of a resolver and returns a transformed payload
|
|
29
|
-
* compatible with the target lens input schema.
|
|
30
|
-
*/
|
|
31
|
-
export declare type AdapterHandler = (data: unknown) => unknown;
|
|
32
|
-
|
|
33
|
-
export declare class Adapters extends Entity<Adapter> {
|
|
34
|
-
constructor(getBep: () => BEP);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export declare const AdapterSchema: z.ZodObject<{
|
|
38
|
-
id: z.ZodString;
|
|
39
|
-
name: z.ZodString;
|
|
40
|
-
description: z.ZodString;
|
|
41
|
-
}, z.core.$strip>;
|
|
42
|
-
|
|
43
24
|
/** Input type for add() on non-autoId entities — id is optional, validated by the Zod schema */
|
|
44
25
|
declare type AddInput<T extends object> = Omit<T, 'id'> & {
|
|
45
26
|
id?: string;
|
|
@@ -117,7 +98,6 @@ export declare class Bep {
|
|
|
117
98
|
private _zip;
|
|
118
99
|
readonly project: Singleton<Project>;
|
|
119
100
|
readonly actions: Actions;
|
|
120
|
-
readonly adapters: Adapters;
|
|
121
101
|
readonly annexes: Annexes;
|
|
122
102
|
readonly deliverables: Deliverables;
|
|
123
103
|
readonly effects: Effects;
|
|
@@ -408,11 +388,6 @@ export declare const BEPSchema: z.ZodObject<{
|
|
|
408
388
|
description: z.ZodString;
|
|
409
389
|
envKeys: z.ZodArray<z.ZodString>;
|
|
410
390
|
}, z.core.$strip>>;
|
|
411
|
-
adapters: z.ZodArray<z.ZodObject<{
|
|
412
|
-
id: z.ZodString;
|
|
413
|
-
name: z.ZodString;
|
|
414
|
-
description: z.ZodString;
|
|
415
|
-
}, z.core.$strip>>;
|
|
416
391
|
remoteData: z.ZodArray<z.ZodObject<{
|
|
417
392
|
id: z.ZodUUID;
|
|
418
393
|
name: z.ZodString;
|
|
@@ -608,7 +583,6 @@ export declare interface BepTypes {
|
|
|
608
583
|
eventId: string;
|
|
609
584
|
} & Record<string, unknown>>;
|
|
610
585
|
resolvers: Record<string, (url: string, ...args: any[]) => unknown>;
|
|
611
|
-
adapters: Record<string, (data: unknown) => unknown>;
|
|
612
586
|
env: Record<string, string>;
|
|
613
587
|
}
|
|
614
588
|
|
|
@@ -869,8 +843,9 @@ export declare class Effects extends Entity<FlowEffect> {
|
|
|
869
843
|
export declare class Engine {
|
|
870
844
|
private readonly getBep;
|
|
871
845
|
private readonly getHistoricalBep?;
|
|
872
|
-
private
|
|
846
|
+
private _runtime;
|
|
873
847
|
private storage;
|
|
848
|
+
get runtime(): Runtime<any>;
|
|
874
849
|
private skipRaci;
|
|
875
850
|
private readonly transitionListeners;
|
|
876
851
|
private readonly createdListeners;
|
|
@@ -931,11 +906,6 @@ export declare class Engine {
|
|
|
931
906
|
* Throws if the remoteDataId does not exist in the BEP or has no resolver assigned.
|
|
932
907
|
*/
|
|
933
908
|
getRemoteData(remoteDataId: string): Promise<unknown>;
|
|
934
|
-
/**
|
|
935
|
-
* Runs an adapter to transform data into a lens-compatible format.
|
|
936
|
-
* Throws if the adapterId has no registered handler.
|
|
937
|
-
*/
|
|
938
|
-
useAdapter(adapterId: string, data: unknown): unknown;
|
|
939
909
|
private _assertInit;
|
|
940
910
|
private _resolveBep;
|
|
941
911
|
private _fire;
|
|
@@ -2252,21 +2222,17 @@ export declare class Runtime<T extends {
|
|
|
2252
2222
|
effects: Record<string, any>;
|
|
2253
2223
|
automations: Record<string, any>;
|
|
2254
2224
|
resolvers: Record<string, any>;
|
|
2255
|
-
adapters: Record<string, any>;
|
|
2256
2225
|
env: Record<string, any>;
|
|
2257
2226
|
} = BepTypes> {
|
|
2258
|
-
|
|
2227
|
+
env: T['env'];
|
|
2259
2228
|
readonly effects: Record<string, EffectHandler>;
|
|
2260
2229
|
readonly automations: Record<string, AutomationHandler>;
|
|
2261
2230
|
readonly resolvers: Record<string, ResolverHandler>;
|
|
2262
|
-
readonly adapters: Record<string, AdapterHandler>;
|
|
2263
2231
|
constructor({ env }?: RuntimeOptions);
|
|
2264
2232
|
protected effect<K extends keyof T['effects'] & string>(key: K, handler: (instance: WorkflowInstance, ...args: Parameters<T['effects'][K]>) => Promise<void>): this;
|
|
2265
2233
|
protected automation<K extends keyof T['automations'] & string>(key: K, handler: (instance: WorkflowInstance, ...args: Parameters<T['automations'][K]>) => Promise<ReturnType<T['automations'][K]>>): this;
|
|
2266
2234
|
protected resolver<K extends keyof T['resolvers'] & string>(key: K, handler: (...args: Parameters<T['resolvers'][K]>) => Promise<ReturnType<T['resolvers'][K]>>): this;
|
|
2267
|
-
protected adapter<K extends keyof T['adapters'] & string>(key: K, handler: (...args: Parameters<T['adapters'][K]>) => ReturnType<T['adapters'][K]>): this;
|
|
2268
2235
|
/* Excluded from this release type: _runResolver */
|
|
2269
|
-
/* Excluded from this release type: _runAdapter */
|
|
2270
2236
|
}
|
|
2271
2237
|
|
|
2272
2238
|
/**
|