@walkeros/core 4.7.1 → 4.7.2-next-1791213015481
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/CHANGELOG.md +28 -0
- package/dist/dev.d.mts +8 -6
- package/dist/dev.d.ts +8 -6
- package/dist/dev.js +1 -1
- package/dist/dev.js.map +1 -1
- package/dist/dev.mjs +1 -1
- package/dist/dev.mjs.map +1 -1
- package/dist/index.d.mts +189 -13
- package/dist/index.d.ts +189 -13
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -542,6 +542,26 @@ interface InitConfig extends Partial<Config$6> {
|
|
|
542
542
|
*/
|
|
543
543
|
observers?: ObserverFn[];
|
|
544
544
|
}
|
|
545
|
+
/**
|
|
546
|
+
* Typed authoring form of `InitConfig`, taken by `startFlow`.
|
|
547
|
+
*
|
|
548
|
+
* Each entry of `sources`, `destinations`, `transformers` and `stores` is
|
|
549
|
+
* checked against the Types inferred from its own `code`, so its `config`
|
|
550
|
+
* (settings, mapping rule settings, ...) autocompletes and type-checks. An
|
|
551
|
+
* entry without inferable Types stays as loose as `InitConfig`, alone, and
|
|
552
|
+
* an `InitConfig` value is accepted as is. `startFlow` infers the four maps
|
|
553
|
+
* and owns their defaults.
|
|
554
|
+
*/
|
|
555
|
+
interface InitConfigOf<S, D, T, St> extends Omit<InitConfig, 'sources' | 'destinations' | 'transformers' | 'stores'> {
|
|
556
|
+
/** Source configurations */
|
|
557
|
+
sources?: InitSourcesOf<S>;
|
|
558
|
+
/** Destination configurations */
|
|
559
|
+
destinations?: InitDestinationsOf<D>;
|
|
560
|
+
/** Transformer configurations */
|
|
561
|
+
transformers?: InitTransformersOf<T>;
|
|
562
|
+
/** Store configurations */
|
|
563
|
+
stores?: InitStoresOf<St>;
|
|
564
|
+
}
|
|
545
565
|
interface SessionData extends Properties {
|
|
546
566
|
isStart: boolean;
|
|
547
567
|
storage: boolean;
|
|
@@ -833,6 +853,7 @@ type collector_CommandType = CommandType;
|
|
|
833
853
|
type collector_DestinationStatus = DestinationStatus;
|
|
834
854
|
type collector_DroppedCounters = DroppedCounters;
|
|
835
855
|
type collector_InitConfig = InitConfig;
|
|
856
|
+
type collector_InitConfigOf<S, D, T, St> = InitConfigOf<S, D, T, St>;
|
|
836
857
|
type collector_PushOptions = PushOptions;
|
|
837
858
|
type collector_SessionData = SessionData;
|
|
838
859
|
type collector_SourceStatus = SourceStatus;
|
|
@@ -841,7 +862,7 @@ type collector_Status = Status;
|
|
|
841
862
|
type collector_StepKind = StepKind;
|
|
842
863
|
declare const collector_stepId: typeof stepId;
|
|
843
864
|
declare namespace collector {
|
|
844
|
-
export { type collector_BreakerState as BreakerState, type collector_Cascade as Cascade, type collector_CommandFn as CommandFn, type collector_CommandType as CommandType, type Config$6 as Config, type collector_DestinationStatus as DestinationStatus, type Destinations$1 as Destinations, type collector_DroppedCounters as DroppedCounters, type collector_InitConfig as InitConfig, type Instance$6 as Instance, type PushFn$1 as PushFn, type collector_PushOptions as PushOptions, type collector_SessionData as SessionData, type collector_SourceStatus as SourceStatus, type collector_Sources as Sources, type collector_Status as Status, type collector_StepKind as StepKind, type Stores$1 as Stores, type Transformers$1 as Transformers, collector_stepId as stepId };
|
|
865
|
+
export { type collector_BreakerState as BreakerState, type collector_Cascade as Cascade, type collector_CommandFn as CommandFn, type collector_CommandType as CommandType, type Config$6 as Config, type collector_DestinationStatus as DestinationStatus, type Destinations$1 as Destinations, type collector_DroppedCounters as DroppedCounters, type collector_InitConfig as InitConfig, type collector_InitConfigOf as InitConfigOf, type Instance$6 as Instance, type PushFn$1 as PushFn, type collector_PushOptions as PushOptions, type collector_SessionData as SessionData, type collector_SourceStatus as SourceStatus, type collector_Sources as Sources, type collector_Status as Status, type collector_StepKind as StepKind, type Stores$1 as Stores, type Transformers$1 as Transformers, collector_stepId as stepId };
|
|
845
866
|
}
|
|
846
867
|
|
|
847
868
|
/**
|
|
@@ -969,6 +990,86 @@ declare namespace lifecycle {
|
|
|
969
990
|
export type { lifecycle_DestroyContext as DestroyContext, lifecycle_DestroyFn as DestroyFn, lifecycle_LifecycleContext as LifecycleContext, lifecycle_SetupFn as SetupFn };
|
|
970
991
|
}
|
|
971
992
|
|
|
993
|
+
/**
|
|
994
|
+
* Package-internal type helpers. Not re-exported from `types/index.ts`.
|
|
995
|
+
*/
|
|
996
|
+
/**
|
|
997
|
+
* `true` when A and B are the same type, `false` otherwise.
|
|
998
|
+
*
|
|
999
|
+
* The double-function indirection compares the two types strictly; a plain
|
|
1000
|
+
* mutual `extends` check is fooled by `any` and by distributive types.
|
|
1001
|
+
*/
|
|
1002
|
+
type IsExactly<A, B> = (<V>() => V extends A ? 1 : 2) extends <V>() => V extends B ? 1 : 2 ? true : false;
|
|
1003
|
+
type AnyFunction$2 = (...args: never[]) => unknown;
|
|
1004
|
+
/**
|
|
1005
|
+
* `true` when an object type has a function-valued property. Such objects
|
|
1006
|
+
* (class instances, DOM nodes, SDK clients) are values, not plain data, so
|
|
1007
|
+
* widening leaves them as they are instead of recursing into them.
|
|
1008
|
+
*/
|
|
1009
|
+
type HasMethod<T> = true extends {
|
|
1010
|
+
[K in keyof T]-?: NonNullable<T[K]> extends AnyFunction$2 ? true : false;
|
|
1011
|
+
}[keyof T] ? true : false;
|
|
1012
|
+
/**
|
|
1013
|
+
* A literal leaf also accepts its primitive. `(string & {})` keeps the
|
|
1014
|
+
* literal members visible (completions, error messages) instead of collapsing
|
|
1015
|
+
* the union to `string`; a leaf typed as plain `string` stays `string`.
|
|
1016
|
+
*/
|
|
1017
|
+
type WidenValue<T> = T extends string ? string extends T ? T : T | (string & {}) : T extends number ? number extends T ? T : T | (number & {}) : T extends boolean ? boolean : T extends AnyFunction$2 ? T : T extends readonly (infer U)[] ? readonly WidenValue<U>[] : T extends object ? HasMethod<T> extends true ? T : WidenLiterals<T> : T;
|
|
1018
|
+
/**
|
|
1019
|
+
* An object type whose string, number and boolean literals also accept their
|
|
1020
|
+
* primitive (`transport: 'beacon'` widens to `transport: string`), through
|
|
1021
|
+
* plain objects and arrays: what a config value declared in a separate
|
|
1022
|
+
* variable looks like. Keys, required fields and value kinds stay checked,
|
|
1023
|
+
* and literal completions still come from `T`. Functions and objects with
|
|
1024
|
+
* methods stay as they are.
|
|
1025
|
+
*/
|
|
1026
|
+
type WidenLiterals<T> = {
|
|
1027
|
+
[K in keyof T]: WidenValue<T[K]>;
|
|
1028
|
+
};
|
|
1029
|
+
/**
|
|
1030
|
+
* `WidenLiterals` for a config slot of any shape. The top level is always
|
|
1031
|
+
* mapped, so a settings object with a callback still has its literal
|
|
1032
|
+
* properties widened; a slot that is not an object (`unknown`, `any`, a
|
|
1033
|
+
* primitive) keeps its own looseness.
|
|
1034
|
+
*/
|
|
1035
|
+
type WidenConfig<T> = T extends AnyFunction$2 ? T : T extends readonly unknown[] ? WidenValue<T> : T extends object ? WidenLiterals<T> : WidenValue<T>;
|
|
1036
|
+
/**
|
|
1037
|
+
* Types of one step entry, inferred from its `code`. `Generic` is the kind's
|
|
1038
|
+
* `TypesGeneric`, `Default` its bare `Types`. Falls back to `Generic` (the
|
|
1039
|
+
* looseness of the erased `Init*` maps) for this entry alone when nothing is
|
|
1040
|
+
* inferable (no typed `code`, a code-less hop, an untyped mock) or when
|
|
1041
|
+
* `code` uses the bare default Types. Its siblings stay checked.
|
|
1042
|
+
*/
|
|
1043
|
+
type EntryTypes<X, Generic, Default> = X extends Generic ? IsExactly<X, Default> extends true ? Generic : X : Generic;
|
|
1044
|
+
/** The Types slots a step config reads: settings, mapping, setup, credentials. */
|
|
1045
|
+
type ConfigSlot = 'initSettings' | 'mapping' | 'setup' | 'credentials';
|
|
1046
|
+
/**
|
|
1047
|
+
* A kind's Types as its `config` accepts them: every config slot the kind
|
|
1048
|
+
* has also takes its widened form (`WidenConfig`), so a config declared in a
|
|
1049
|
+
* separate variable compiles as it did before typing. Slots a kind lacks are
|
|
1050
|
+
* simply absent, so one definition serves all kinds.
|
|
1051
|
+
*/
|
|
1052
|
+
type ConfigTypes<T> = {
|
|
1053
|
+
[P in keyof T]: P extends ConfigSlot ? WidenConfig<T[P]> : T[P];
|
|
1054
|
+
};
|
|
1055
|
+
/**
|
|
1056
|
+
* One typed step entry, from the kind's Init type for the entry's Types
|
|
1057
|
+
* (`Typed`), for its `ConfigTypes` (`Configured`) and for its `TypesGeneric`
|
|
1058
|
+
* (`Generic`): `code` and the routing keys come from `Typed`, `config` from
|
|
1059
|
+
* `Configured`, and `env` offers `Typed`'s keys while still accepting every
|
|
1060
|
+
* deep-partial mock that `Generic` accepts.
|
|
1061
|
+
*/
|
|
1062
|
+
type TypedStepEntry<Typed extends {
|
|
1063
|
+
env?: unknown;
|
|
1064
|
+
}, Configured extends {
|
|
1065
|
+
config?: unknown;
|
|
1066
|
+
}, Generic extends {
|
|
1067
|
+
env?: unknown;
|
|
1068
|
+
}> = Omit<Typed, 'config' | 'env'> & {
|
|
1069
|
+
config?: Configured['config'];
|
|
1070
|
+
env?: Typed['env'] | Generic['env'];
|
|
1071
|
+
};
|
|
1072
|
+
|
|
972
1073
|
/**
|
|
973
1074
|
* Base environment requirements interface for walkerOS destinations
|
|
974
1075
|
*
|
|
@@ -1204,6 +1305,12 @@ type Init$3<T extends TypesGeneric$3 = Types$4> = {
|
|
|
1204
1305
|
interface InitDestinations {
|
|
1205
1306
|
[key: string]: Init$3<any>;
|
|
1206
1307
|
}
|
|
1308
|
+
/** One typed destination entry for `startFlow`; the rules are in `types/util.ts`. */
|
|
1309
|
+
type InitDestinationEntry<T extends TypesGeneric$3> = TypedStepEntry<Init$3<T>, Init$3<ConfigTypes<T>>, Init$3<TypesGeneric$3>>;
|
|
1310
|
+
/** Typed counterpart of `InitDestinations` for `startFlow`; the rules are in `types/util.ts`. */
|
|
1311
|
+
type InitDestinationsOf<D> = {
|
|
1312
|
+
[K in keyof D]: InitDestinationEntry<EntryTypes<D[K], TypesGeneric$3, Types$4>>;
|
|
1313
|
+
};
|
|
1207
1314
|
interface Destinations {
|
|
1208
1315
|
[key: string]: Instance$5;
|
|
1209
1316
|
}
|
|
@@ -1350,7 +1457,9 @@ type destination_DLQ = DLQ;
|
|
|
1350
1457
|
type destination_Data = Data;
|
|
1351
1458
|
type destination_Destinations = Destinations;
|
|
1352
1459
|
type destination_EnvObserve = EnvObserve;
|
|
1460
|
+
type destination_InitDestinationEntry<T extends TypesGeneric$3> = InitDestinationEntry<T>;
|
|
1353
1461
|
type destination_InitDestinations = InitDestinations;
|
|
1462
|
+
type destination_InitDestinationsOf<D> = InitDestinationsOf<D>;
|
|
1354
1463
|
type destination_Policy = Policy;
|
|
1355
1464
|
type destination_PushBatchContext<T extends TypesGeneric$3 = Types$4> = PushBatchContext<T>;
|
|
1356
1465
|
type destination_PushBatchFn<T extends TypesGeneric$3 = Types$4> = PushBatchFn<T>;
|
|
@@ -1361,7 +1470,7 @@ type destination_PushFn<T extends TypesGeneric$3 = Types$4> = PushFn<T>;
|
|
|
1361
1470
|
type destination_Ref = Ref;
|
|
1362
1471
|
declare const destination_getDestination: typeof getDestination;
|
|
1363
1472
|
declare namespace destination {
|
|
1364
|
-
export { type BaseEnv$3 as BaseEnv, type destination_Batch as Batch, type destination_BatchEntry as BatchEntry, type destination_BatchFailure as BatchFailure, type destination_BatchOptions as BatchOptions, type destination_BatchOutcome as BatchOutcome, type destination_BatchRegistry as BatchRegistry, type destination_BreakerOptions as BreakerOptions, type Code$1 as Code, type Config$5 as Config, type Context$5 as Context, type Credentials$2 as Credentials, type destination_DLQ as DLQ, type destination_Data as Data, type destination_Destinations as Destinations, type Env$3 as Env, type destination_EnvObserve as EnvObserve, type Init$3 as Init, type destination_InitDestinations as InitDestinations, type InitFn$2 as InitFn, type InitSettings$3 as InitSettings, type Instance$5 as Instance, type Mapping$1 as Mapping, type PartialConfig$2 as PartialConfig, type destination_Policy as Policy, type Push$1 as Push, type destination_PushBatchContext as PushBatchContext, type destination_PushBatchFn as PushBatchFn, type destination_PushContext as PushContext, type destination_PushEvent as PushEvent, type destination_PushEvents as PushEvents, type destination_PushFn as PushFn, type destination_Ref as Ref, type Settings$3 as Settings, type SetupOptions$2 as SetupOptions, type Types$4 as Types, type TypesGeneric$3 as TypesGeneric, type TypesOf$3 as TypesOf, destination_getDestination as getDestination };
|
|
1473
|
+
export { type BaseEnv$3 as BaseEnv, type destination_Batch as Batch, type destination_BatchEntry as BatchEntry, type destination_BatchFailure as BatchFailure, type destination_BatchOptions as BatchOptions, type destination_BatchOutcome as BatchOutcome, type destination_BatchRegistry as BatchRegistry, type destination_BreakerOptions as BreakerOptions, type Code$1 as Code, type Config$5 as Config, type Context$5 as Context, type Credentials$2 as Credentials, type destination_DLQ as DLQ, type destination_Data as Data, type destination_Destinations as Destinations, type Env$3 as Env, type destination_EnvObserve as EnvObserve, type Init$3 as Init, type destination_InitDestinationEntry as InitDestinationEntry, type destination_InitDestinations as InitDestinations, type destination_InitDestinationsOf as InitDestinationsOf, type InitFn$2 as InitFn, type InitSettings$3 as InitSettings, type Instance$5 as Instance, type Mapping$1 as Mapping, type PartialConfig$2 as PartialConfig, type destination_Policy as Policy, type Push$1 as Push, type destination_PushBatchContext as PushBatchContext, type destination_PushBatchFn as PushBatchFn, type destination_PushContext as PushContext, type destination_PushEvent as PushEvent, type destination_PushEvents as PushEvents, type destination_PushFn as PushFn, type destination_Ref as Ref, type Settings$3 as Settings, type SetupOptions$2 as SetupOptions, type Types$4 as Types, type TypesGeneric$3 as TypesGeneric, type TypesOf$3 as TypesOf, destination_getDestination as getDestination };
|
|
1365
1474
|
}
|
|
1366
1475
|
|
|
1367
1476
|
interface EventFn<R = Promise<PushResult>> {
|
|
@@ -1555,10 +1664,11 @@ interface Config$4<T extends TypesGeneric$2 = Types$3> {
|
|
|
1555
1664
|
* when a rule has `ignore: true`).
|
|
1556
1665
|
*
|
|
1557
1666
|
* At the transformer position, only event-mutating fields apply:
|
|
1558
|
-
* `policy`, `
|
|
1559
|
-
*
|
|
1560
|
-
* `
|
|
1561
|
-
*
|
|
1667
|
+
* `policy`, and per rule `condition`, `policy`, `name` and `ignore`.
|
|
1668
|
+
* Everything else does nothing here and is named in a one-time init
|
|
1669
|
+
* warning: `consent`, `include` and `data`, and per rule `consent`,
|
|
1670
|
+
* `include`, `remove`, `batch`, `settings`, `extend`, `data` and
|
|
1671
|
+
* `silent`. A `config.mapping` wins over the step-level `mapping`.
|
|
1562
1672
|
*/
|
|
1563
1673
|
mapping?: Config$7;
|
|
1564
1674
|
}
|
|
@@ -1661,8 +1771,9 @@ type Init$2<T extends TypesGeneric$2 = Types$3> = (context: Context$4<Types$3<Pa
|
|
|
1661
1771
|
type InitTransformer<T extends TypesGeneric$2 = Types$3> = {
|
|
1662
1772
|
/**
|
|
1663
1773
|
* Initialization function. When omitted, the entry is a pass-through step:
|
|
1664
|
-
* - If `mapping` is present, the collector
|
|
1665
|
-
* push using `processEventMapping`.
|
|
1774
|
+
* - If `mapping` or `config.mapping` is present, the collector
|
|
1775
|
+
* synthesizes a mapping-only push using `processEventMapping`. With
|
|
1776
|
+
* `code`, a mapping never runs (warned at init).
|
|
1666
1777
|
* - Otherwise it's a named hop that only hosts a `before` / `next` /
|
|
1667
1778
|
* `cache` chain.
|
|
1668
1779
|
*
|
|
@@ -1686,6 +1797,12 @@ type InitTransformer<T extends TypesGeneric$2 = Types$3> = {
|
|
|
1686
1797
|
interface InitTransformers {
|
|
1687
1798
|
[transformerId: string]: InitTransformer<any>;
|
|
1688
1799
|
}
|
|
1800
|
+
/** One typed transformer entry for `startFlow`; the rules are in `types/util.ts`. */
|
|
1801
|
+
type InitTransformerEntry<T extends TypesGeneric$2> = TypedStepEntry<InitTransformer<T>, InitTransformer<ConfigTypes<T>>, InitTransformer<TypesGeneric$2>>;
|
|
1802
|
+
/** Typed counterpart of `InitTransformers` for `startFlow`; the rules are in `types/util.ts`. */
|
|
1803
|
+
type InitTransformersOf<T> = {
|
|
1804
|
+
[K in keyof T]: InitTransformerEntry<EntryTypes<T[K], TypesGeneric$2, Types$3>>;
|
|
1805
|
+
};
|
|
1689
1806
|
/**
|
|
1690
1807
|
* Active transformer instances registry.
|
|
1691
1808
|
*/
|
|
@@ -1715,7 +1832,9 @@ declare function getTransformer<T extends TypesGeneric$2 = Types$3>(collector: {
|
|
|
1715
1832
|
type transformer_ChainCopy<E = DeepPartialEvent> = ChainCopy<E>;
|
|
1716
1833
|
type transformer_ChainResult = ChainResult;
|
|
1717
1834
|
type transformer_InitTransformer<T extends TypesGeneric$2 = Types$3> = InitTransformer<T>;
|
|
1835
|
+
type transformer_InitTransformerEntry<T extends TypesGeneric$2> = InitTransformerEntry<T>;
|
|
1718
1836
|
type transformer_InitTransformers = InitTransformers;
|
|
1837
|
+
type transformer_InitTransformersOf<T> = InitTransformersOf<T>;
|
|
1719
1838
|
type transformer_Route = Route;
|
|
1720
1839
|
type transformer_RouteConfig = RouteConfig;
|
|
1721
1840
|
type transformer_RouteGateConfig = RouteGateConfig;
|
|
@@ -1726,7 +1845,7 @@ type transformer_RouteStopConfig = RouteStopConfig;
|
|
|
1726
1845
|
type transformer_Transformers = Transformers;
|
|
1727
1846
|
declare const transformer_getTransformer: typeof getTransformer;
|
|
1728
1847
|
declare namespace transformer {
|
|
1729
|
-
export { type BaseEnv$2 as BaseEnv, type transformer_ChainCopy as ChainCopy, type transformer_ChainResult as ChainResult, type Config$4 as Config, type Context$4 as Context, type Env$2 as Env, type Fn$2 as Fn, type Init$2 as Init, type InitFn$1 as InitFn, type InitSettings$2 as InitSettings, type transformer_InitTransformer as InitTransformer, type transformer_InitTransformers as InitTransformers, type Instance$4 as Instance, type Result$1 as Result, type transformer_Route as Route, type transformer_RouteConfig as RouteConfig, type transformer_RouteGateConfig as RouteGateConfig, type transformer_RouteManyConfig as RouteManyConfig, type transformer_RouteNextConfig as RouteNextConfig, type transformer_RouteOneConfig as RouteOneConfig, type transformer_RouteStopConfig as RouteStopConfig, type Settings$2 as Settings, type transformer_Transformers as Transformers, type Types$3 as Types, type TypesGeneric$2 as TypesGeneric, type TypesOf$2 as TypesOf, transformer_getTransformer as getTransformer };
|
|
1848
|
+
export { type BaseEnv$2 as BaseEnv, type transformer_ChainCopy as ChainCopy, type transformer_ChainResult as ChainResult, type Config$4 as Config, type Context$4 as Context, type Env$2 as Env, type Fn$2 as Fn, type Init$2 as Init, type InitFn$1 as InitFn, type InitSettings$2 as InitSettings, type transformer_InitTransformer as InitTransformer, type transformer_InitTransformerEntry as InitTransformerEntry, type transformer_InitTransformers as InitTransformers, type transformer_InitTransformersOf as InitTransformersOf, type Instance$4 as Instance, type Result$1 as Result, type transformer_Route as Route, type transformer_RouteConfig as RouteConfig, type transformer_RouteGateConfig as RouteGateConfig, type transformer_RouteManyConfig as RouteManyConfig, type transformer_RouteNextConfig as RouteNextConfig, type transformer_RouteOneConfig as RouteOneConfig, type transformer_RouteStopConfig as RouteStopConfig, type Settings$2 as Settings, type transformer_Transformers as Transformers, type Types$3 as Types, type TypesGeneric$2 as TypesGeneric, type TypesOf$2 as TypesOf, transformer_getTransformer as getTransformer };
|
|
1730
1849
|
}
|
|
1731
1850
|
|
|
1732
1851
|
/**
|
|
@@ -3004,6 +3123,12 @@ type InitSource<T extends TypesGeneric$1 = Types$1> = {
|
|
|
3004
3123
|
interface InitSources {
|
|
3005
3124
|
[sourceId: string]: InitSource<any>;
|
|
3006
3125
|
}
|
|
3126
|
+
/** One typed source entry for `startFlow`; the rules are in `types/util.ts`. */
|
|
3127
|
+
type InitSourceEntry<T extends TypesGeneric$1> = TypedStepEntry<InitSource<T>, InitSource<ConfigTypes<T>>, InitSource<TypesGeneric$1>>;
|
|
3128
|
+
/** Typed counterpart of `InitSources` for `startFlow`; the rules are in `types/util.ts`. */
|
|
3129
|
+
type InitSourcesOf<S> = {
|
|
3130
|
+
[K in keyof S]: InitSourceEntry<EntryTypes<S[K], TypesGeneric$1, Types$1>>;
|
|
3131
|
+
};
|
|
3007
3132
|
/**
|
|
3008
3133
|
* Renderer hint for source simulation UI.
|
|
3009
3134
|
* - 'browser': Source needs a real DOM (iframe with live preview)
|
|
@@ -3032,7 +3157,9 @@ declare function getSource<T extends TypesGeneric$1 = Types$1>(collector: {
|
|
|
3032
3157
|
}, id: string): Instance$2<T>;
|
|
3033
3158
|
|
|
3034
3159
|
type source_InitSource<T extends TypesGeneric$1 = Types$1> = InitSource<T>;
|
|
3160
|
+
type source_InitSourceEntry<T extends TypesGeneric$1> = InitSourceEntry<T>;
|
|
3035
3161
|
type source_InitSources = InitSources;
|
|
3162
|
+
type source_InitSourcesOf<S> = InitSourcesOf<S>;
|
|
3036
3163
|
type source_Mapping<T extends TypesGeneric$1 = Types$1> = Mapping<T>;
|
|
3037
3164
|
type source_Push<T extends TypesGeneric$1 = Types$1> = Push<T>;
|
|
3038
3165
|
type source_Renderer = Renderer;
|
|
@@ -3040,7 +3167,7 @@ type source_Scope = Scope;
|
|
|
3040
3167
|
type source_ScopeEnv<T extends TypesGeneric$1 = Types$1> = ScopeEnv<T>;
|
|
3041
3168
|
declare const source_getSource: typeof getSource;
|
|
3042
3169
|
declare namespace source {
|
|
3043
|
-
export { type BaseEnv$1 as BaseEnv, type Config$1 as Config, type Context$1 as Context, type Credentials$1 as Credentials, type Env$1 as Env, type Init$1 as Init, type InitSettings$1 as InitSettings, type source_InitSource as InitSource, type source_InitSources as InitSources, type Instance$2 as Instance, type source_Mapping as Mapping, type PartialConfig$1 as PartialConfig, type source_Push as Push, type source_Renderer as Renderer, type source_Scope as Scope, type source_ScopeEnv as ScopeEnv, type Settings$1 as Settings, type SetupOptions$1 as SetupOptions, type Types$1 as Types, type TypesGeneric$1 as TypesGeneric, type TypesOf$1 as TypesOf, source_getSource as getSource };
|
|
3170
|
+
export { type BaseEnv$1 as BaseEnv, type Config$1 as Config, type Context$1 as Context, type Credentials$1 as Credentials, type Env$1 as Env, type Init$1 as Init, type InitSettings$1 as InitSettings, type source_InitSource as InitSource, type source_InitSourceEntry as InitSourceEntry, type source_InitSources as InitSources, type source_InitSourcesOf as InitSourcesOf, type Instance$2 as Instance, type source_Mapping as Mapping, type PartialConfig$1 as PartialConfig, type source_Push as Push, type source_Renderer as Renderer, type source_Scope as Scope, type source_ScopeEnv as ScopeEnv, type Settings$1 as Settings, type SetupOptions$1 as SetupOptions, type Types$1 as Types, type TypesGeneric$1 as TypesGeneric, type TypesOf$1 as TypesOf, source_getSource as getSource };
|
|
3044
3171
|
}
|
|
3045
3172
|
|
|
3046
3173
|
interface BaseEnv {
|
|
@@ -3134,6 +3261,12 @@ type InitStore<T extends TypesGeneric = Types> = {
|
|
|
3134
3261
|
interface InitStores {
|
|
3135
3262
|
[storeId: string]: InitStore<any>;
|
|
3136
3263
|
}
|
|
3264
|
+
/** One typed store entry for `startFlow`; the rules are in `types/util.ts`. */
|
|
3265
|
+
type InitStoreEntry<T extends TypesGeneric> = TypedStepEntry<InitStore<T>, InitStore<ConfigTypes<T>>, InitStore<TypesGeneric>>;
|
|
3266
|
+
/** Typed counterpart of `InitStores` for `startFlow`; the rules are in `types/util.ts`. */
|
|
3267
|
+
type InitStoresOf<St> = {
|
|
3268
|
+
[K in keyof St]: InitStoreEntry<EntryTypes<St[K], TypesGeneric, Types>>;
|
|
3269
|
+
};
|
|
3137
3270
|
interface Stores {
|
|
3138
3271
|
[storeId: string]: Instance$1;
|
|
3139
3272
|
}
|
|
@@ -3178,7 +3311,9 @@ type store_Init<T extends TypesGeneric = Types> = Init<T>;
|
|
|
3178
3311
|
type store_InitFn<T extends TypesGeneric = Types> = InitFn<T>;
|
|
3179
3312
|
type store_InitSettings<T extends TypesGeneric = Types> = InitSettings<T>;
|
|
3180
3313
|
type store_InitStore<T extends TypesGeneric = Types> = InitStore<T>;
|
|
3314
|
+
type store_InitStoreEntry<T extends TypesGeneric> = InitStoreEntry<T>;
|
|
3181
3315
|
type store_InitStores = InitStores;
|
|
3316
|
+
type store_InitStoresOf<St> = InitStoresOf<St>;
|
|
3182
3317
|
type store_PartialConfig<T extends TypesGeneric = Types> = PartialConfig<T>;
|
|
3183
3318
|
type store_SetFn<T extends StoreValue = StoreValue> = SetFn<T>;
|
|
3184
3319
|
type store_Settings<T extends TypesGeneric = Types> = Settings<T>;
|
|
@@ -3191,7 +3326,7 @@ type store_TypesOf<I> = TypesOf<I>;
|
|
|
3191
3326
|
declare const store_getStore: typeof getStore;
|
|
3192
3327
|
declare const store_getStoreValue: typeof getStoreValue;
|
|
3193
3328
|
declare namespace store {
|
|
3194
|
-
export { type store_BaseEnv as BaseEnv, type store_Config as Config, type store_Context as Context, type store_Credentials as Credentials, type store_DeleteFn as DeleteFn, type store_Env as Env, type store_GetFn as GetFn, type store_Init as Init, type store_InitFn as InitFn, type store_InitSettings as InitSettings, type store_InitStore as InitStore, type store_InitStores as InitStores, type Instance$1 as Instance, type store_PartialConfig as PartialConfig, type store_SetFn as SetFn, type store_Settings as Settings, type store_SetupOptions as SetupOptions, type store_StoreValue as StoreValue, type store_Stores as Stores, type store_Types as Types, type store_TypesGeneric as TypesGeneric, type store_TypesOf as TypesOf, store_getStore as getStore, store_getStoreValue as getStoreValue };
|
|
3329
|
+
export { type store_BaseEnv as BaseEnv, type store_Config as Config, type store_Context as Context, type store_Credentials as Credentials, type store_DeleteFn as DeleteFn, type store_Env as Env, type store_GetFn as GetFn, type store_Init as Init, type store_InitFn as InitFn, type store_InitSettings as InitSettings, type store_InitStore as InitStore, type store_InitStoreEntry as InitStoreEntry, type store_InitStores as InitStores, type store_InitStoresOf as InitStoresOf, type Instance$1 as Instance, type store_PartialConfig as PartialConfig, type store_SetFn as SetFn, type store_Settings as Settings, type store_SetupOptions as SetupOptions, type store_StoreValue as StoreValue, type store_Stores as Stores, type store_Types as Types, type store_TypesGeneric as TypesGeneric, type store_TypesOf as TypesOf, store_getStore as getStore, store_getStoreValue as getStoreValue };
|
|
3195
3330
|
}
|
|
3196
3331
|
|
|
3197
3332
|
/**
|
|
@@ -4299,6 +4434,13 @@ declare function isElementOrDocument(elem: unknown): elem is Element;
|
|
|
4299
4434
|
* @returns True if the value is a function, false otherwise.
|
|
4300
4435
|
*/
|
|
4301
4436
|
declare function isFunction(value: unknown): value is Function;
|
|
4437
|
+
/**
|
|
4438
|
+
* Checks if a value is a thenable (a promise, from any realm).
|
|
4439
|
+
*
|
|
4440
|
+
* @param value The value to check.
|
|
4441
|
+
* @returns True if the value is an object with a callable `then`.
|
|
4442
|
+
*/
|
|
4443
|
+
declare function isThenable(value: unknown): value is PromiseLike<unknown>;
|
|
4302
4444
|
/**
|
|
4303
4445
|
* Checks if a value is a number.
|
|
4304
4446
|
*
|
|
@@ -4364,7 +4506,7 @@ declare function createLogger(config?: Config$3): Instance$3;
|
|
|
4364
4506
|
*
|
|
4365
4507
|
* @param event The event to get the mapping for (can be partial or full).
|
|
4366
4508
|
* @param mapping The mapping rules.
|
|
4367
|
-
* @param collector Required to evaluate rule-level conditions against the unified Context. Legacy callers may omit; rule-level conditions then run
|
|
4509
|
+
* @param collector Required to evaluate rule-level conditions against the unified Context. Legacy callers may omit; rule-level conditions then run without a context and a throw propagates (defensive).
|
|
4368
4510
|
* @returns The mapping result.
|
|
4369
4511
|
*/
|
|
4370
4512
|
declare function getMappingEvent(event: DeepPartialEvent | PartialEvent | Event, mapping?: Rules, collector?: Instance$6): Promise<Result$2>;
|
|
@@ -5385,6 +5527,11 @@ interface ObservedEnv<T extends object = Record<string, unknown>> {
|
|
|
5385
5527
|
*/
|
|
5386
5528
|
declare function observeEnv<T extends object = Record<string, unknown>>(env: T, paths: string[], record?: EnvObserve['record']): ObservedEnv<T>;
|
|
5387
5529
|
|
|
5530
|
+
/**
|
|
5531
|
+
* A successful MCP tool result. `structuredContent` is always an object and
|
|
5532
|
+
* the text block is the same object serialized, so a client reading either
|
|
5533
|
+
* one sees the same answer. Hints are attached as `_hints`.
|
|
5534
|
+
*/
|
|
5388
5535
|
declare function mcpResult(result: unknown, hints?: {
|
|
5389
5536
|
next?: string[];
|
|
5390
5537
|
warnings?: string[];
|
|
@@ -6030,6 +6177,35 @@ interface StepEntryValidation {
|
|
|
6030
6177
|
declare function validateStepEntry(entry: Record<string, unknown>, kind: Flow.StepKind): StepEntryValidation;
|
|
6031
6178
|
declare function isPathStepEntry(entry: Record<string, unknown>, kind: Flow.StepKind): boolean;
|
|
6032
6179
|
|
|
6180
|
+
/**
|
|
6181
|
+
* A transformer entry as far as its declarative mapping is concerned: a
|
|
6182
|
+
* runtime init entry (`Transformer.InitTransformer`) or a flow step
|
|
6183
|
+
* (`Flow.Transformer`, whose `config` the caller narrows to an object).
|
|
6184
|
+
*/
|
|
6185
|
+
interface TransformerMappingEntry<M = unknown> {
|
|
6186
|
+
code?: unknown;
|
|
6187
|
+
package?: unknown;
|
|
6188
|
+
mapping?: M;
|
|
6189
|
+
config?: {
|
|
6190
|
+
mapping?: M;
|
|
6191
|
+
};
|
|
6192
|
+
}
|
|
6193
|
+
/**
|
|
6194
|
+
* The mapping a transformer step declares. A `config.mapping` wins over the
|
|
6195
|
+
* step-level `mapping`, as `config.state` wins over `state`.
|
|
6196
|
+
*/
|
|
6197
|
+
declare function getTransformerMapping<M>(entry: TransformerMappingEntry<M>): M | undefined;
|
|
6198
|
+
/**
|
|
6199
|
+
* Warnings for a transformer's declarative mapping, one definition for the
|
|
6200
|
+
* collector's init warning and `validateFlowStructure`. They never reject
|
|
6201
|
+
* the entry: a rejected transformer would be skipped whole.
|
|
6202
|
+
*
|
|
6203
|
+
* - A transformer with `code` or `package` never runs its mapping.
|
|
6204
|
+
* - On a code-less transformer, a step-level `mapping` that `config.mapping`
|
|
6205
|
+
* overrides, and fields that do nothing at this position.
|
|
6206
|
+
*/
|
|
6207
|
+
declare function getTransformerMappingWarnings(entry: TransformerMappingEntry): string[];
|
|
6208
|
+
|
|
6033
6209
|
type StepOut = Flow.StepOut;
|
|
6034
6210
|
/**
|
|
6035
6211
|
* Format a step example's `out` as readable code for docs/app rendering.
|
|
@@ -6075,4 +6251,4 @@ declare const REF_CODE_PREFIX = "$code:";
|
|
|
6075
6251
|
*/
|
|
6076
6252
|
declare function scanFlowRefs(value: unknown, into?: Set<string>): Set<string>;
|
|
6077
6253
|
|
|
6078
|
-
export { type ActivationGrant, type AssembleJourneysOptions, type BatchResponse, type BatchedPosterOptions, type BreakerState, type BuildFlag, CLOCK_SKEW_MS, cache as Cache, type CacheEnvelope, type CacheResult, type ChainContinuation, type ChainFrame, type ChainStep, type ClickIdEntry, collector as Collector, type CompiledCache, Const, context as Context, type Credential, type Debounced, destination as Destination, type DestroyContext, type DestroyFn, type DroppedCounters, ENV_MARKER_PREFIX, elb as Elb, type EmitFn, type EventOutcome, type ExampleSummary, FatalError, Flow, type FlowConfigResolver, FlowCycleError, FlowReferenceError, type FlowState, type FlowStateBatch, type FlowStatePhase, type FlowStepType, type GetStore, hint as Hint, hooks as Hooks, type Ingest, type IngestEnvelope, type IngestMeta, InvalidEventError, type Journey, type JourneyAssembly, type JourneyBranch, type JourneyCorrelation, type JourneyEntry, type JourneyGap, type JourneyHop, type JourneyHopStatus, type JourneyPlatform, type JourneyStatus, type JourneyTopology, type JourneyTopologyNode, type JourneyUnattributed, type JsonSchema, Level, lifecycle as Lifecycle, type LifecycleContext, logger as Logger, MAX_SESSION_MS, mapping as Mapping, type MarketingParameters, matcher as Matcher, type MockLogger, type NextSteps, type NodeLikeRequest, OBSERVE_ENV_KEY, OBSERVE_STORAGE_KEY, type Observe, type ObserveCredential, type ObserveServer, type ObserveWeb, type ObservedEnv, type ObserverFn, on as On, type ParsedGrant, type ParsedTraceparent, type PosterFetch, type PosterResponse, type PreviewCrypto, type PreviewFailure, type PreviewKey, type PreviewSubtle, REF_CODE_PREFIX, REF_CONTRACT, REF_ENV, REF_FLOW, REF_SECRET, REF_STORE, REF_VAR_FULL, REF_VAR_INLINE, RESERVED_WINDOW_GLOBALS, request as Request, type ResolveContractsOptions, type ResolveOptions, type RespondFn, type RespondOptions, type RouteContinuation, type RouteDecision, type RouteGraphNode, type RouteLabel, SECRET_MARKER_PREFIX, SESSION_STORAGE_KEY, STEP_FIELD_ROLES, STEP_OPERATIVE_FIELDS, type ScheduleOptions, type SendDataValue, type SendHeaders, type SendResponse, type ServiceAccount, type SetupFn, simulation as Simulation, source as Source, type State, type StepEntryErrorCode, type StepEntryValidation, type StepField, type StepFieldRole, type StepKind, type StorageType, store as Store, StoreCodecError, type SwapActivatorConfig, type TelemetryLevel, type TelemetryOptions, type TelemetryOptionsSupplier, type Timer, transformer as Transformer, trigger as Trigger, URL_WINDOW_MS, type ValidateEvents, type VerifyParams, type VerifyResult, walkeros as WalkerOS, type WalkerOSPackage, type WalkerOSPackageInfo, type WalkerOSPackageMeta, type WindowCollectorCheck, advanceChain, anonymizeIP, applyState, applyUpdate, assembleJourneys, assign, batchResponse, branch, browserSwapActivator, buildScopeFromNodeRequest, castToProperty, castValue, checkCache, checkWindowCollector, clone, compileCache, compileMatcher, compileState, createBatchedPoster, createDestination, createEvent, createIngest, createLogger, createMappingRoot, createMockContext, createMockLogger, createRespond, createTelemetryObserver, createTimer, debounce, deepMerge, defaultClickIds, deleteByPath, deriveSpanId, deserializeStoreValue, emitStep, fetchPackage, fetchPackageSchema, filterValues, flattenIncludeSections, formatOut, getBrowser, getBrowserVersion, getByPath, getDeviceType, getErrorMessage, getEvent, getFlowSettings, getGrantedConsent, getHeaders, getId, getMappingEvent, getMappingValue, getMarketingParameters, getNextSteps, getOS, getOSVersion, getPlatform, getRouteGraph, getSpanId, getStepFieldRole, getStepRuntimeProps, getTraceId, getTraceUntil, isArguments, isArray, isBatchBody, isBoolean, isChainContinuation, isCommand, isDefined, isElementOrDocument, isEnvObserve, isFunction, isNumber, isObject, isPathStepEntry, isPropertyType, isRouteArray, isRouteConfigEntry, isRouteContinuation, isSameType, isSampled, isScope, isStoreValue, isString, mcpError, mcpResult, mergeContractSchemas, mergeMappingRule, mockEnv, normalizeBody, normalizeHeaders, normalizeQuery, observeEnv, observeFromEnv, packageNameToVariable, parseCallPath, parseGrant, parseObserveCredential, parseTraceparent, parseUserAgent, processEventMapping, pushResultToOutcome, readCacheEnvelope, requestToData, requestToParameter, resolveContracts, resolveSetup, resolveTelemetryOptions, scanFlowRefs, serializeStoreValue, setByPath, setTraceUntil, startChain, stepId, storeCache, throttle, throwError, toEventList, transformData, traverseEnv, trim, tryCatch, tryCatchAsync, useHooks, validateStepEntry, verifyActivation, walkPath, wrapCacheEnvelope, wrapCondition, wrapFn, wrapValidate };
|
|
6254
|
+
export { type ActivationGrant, type AssembleJourneysOptions, type BatchResponse, type BatchedPosterOptions, type BreakerState, type BuildFlag, CLOCK_SKEW_MS, cache as Cache, type CacheEnvelope, type CacheResult, type ChainContinuation, type ChainFrame, type ChainStep, type ClickIdEntry, collector as Collector, type CompiledCache, Const, context as Context, type Credential, type Debounced, destination as Destination, type DestroyContext, type DestroyFn, type DroppedCounters, ENV_MARKER_PREFIX, elb as Elb, type EmitFn, type EventOutcome, type ExampleSummary, FatalError, Flow, type FlowConfigResolver, FlowCycleError, FlowReferenceError, type FlowState, type FlowStateBatch, type FlowStatePhase, type FlowStepType, type GetStore, hint as Hint, hooks as Hooks, type Ingest, type IngestEnvelope, type IngestMeta, InvalidEventError, type Journey, type JourneyAssembly, type JourneyBranch, type JourneyCorrelation, type JourneyEntry, type JourneyGap, type JourneyHop, type JourneyHopStatus, type JourneyPlatform, type JourneyStatus, type JourneyTopology, type JourneyTopologyNode, type JourneyUnattributed, type JsonSchema, Level, lifecycle as Lifecycle, type LifecycleContext, logger as Logger, MAX_SESSION_MS, mapping as Mapping, type MarketingParameters, matcher as Matcher, type MockLogger, type NextSteps, type NodeLikeRequest, OBSERVE_ENV_KEY, OBSERVE_STORAGE_KEY, type Observe, type ObserveCredential, type ObserveServer, type ObserveWeb, type ObservedEnv, type ObserverFn, on as On, type ParsedGrant, type ParsedTraceparent, type PosterFetch, type PosterResponse, type PreviewCrypto, type PreviewFailure, type PreviewKey, type PreviewSubtle, REF_CODE_PREFIX, REF_CONTRACT, REF_ENV, REF_FLOW, REF_SECRET, REF_STORE, REF_VAR_FULL, REF_VAR_INLINE, RESERVED_WINDOW_GLOBALS, request as Request, type ResolveContractsOptions, type ResolveOptions, type RespondFn, type RespondOptions, type RouteContinuation, type RouteDecision, type RouteGraphNode, type RouteLabel, SECRET_MARKER_PREFIX, SESSION_STORAGE_KEY, STEP_FIELD_ROLES, STEP_OPERATIVE_FIELDS, type ScheduleOptions, type SendDataValue, type SendHeaders, type SendResponse, type ServiceAccount, type SetupFn, simulation as Simulation, source as Source, type State, type StepEntryErrorCode, type StepEntryValidation, type StepField, type StepFieldRole, type StepKind, type StorageType, store as Store, StoreCodecError, type SwapActivatorConfig, type TelemetryLevel, type TelemetryOptions, type TelemetryOptionsSupplier, type Timer, transformer as Transformer, type TransformerMappingEntry, trigger as Trigger, URL_WINDOW_MS, type ValidateEvents, type VerifyParams, type VerifyResult, walkeros as WalkerOS, type WalkerOSPackage, type WalkerOSPackageInfo, type WalkerOSPackageMeta, type WindowCollectorCheck, advanceChain, anonymizeIP, applyState, applyUpdate, assembleJourneys, assign, batchResponse, branch, browserSwapActivator, buildScopeFromNodeRequest, castToProperty, castValue, checkCache, checkWindowCollector, clone, compileCache, compileMatcher, compileState, createBatchedPoster, createDestination, createEvent, createIngest, createLogger, createMappingRoot, createMockContext, createMockLogger, createRespond, createTelemetryObserver, createTimer, debounce, deepMerge, defaultClickIds, deleteByPath, deriveSpanId, deserializeStoreValue, emitStep, fetchPackage, fetchPackageSchema, filterValues, flattenIncludeSections, formatOut, getBrowser, getBrowserVersion, getByPath, getDeviceType, getErrorMessage, getEvent, getFlowSettings, getGrantedConsent, getHeaders, getId, getMappingEvent, getMappingValue, getMarketingParameters, getNextSteps, getOS, getOSVersion, getPlatform, getRouteGraph, getSpanId, getStepFieldRole, getStepRuntimeProps, getTraceId, getTraceUntil, getTransformerMapping, getTransformerMappingWarnings, isArguments, isArray, isBatchBody, isBoolean, isChainContinuation, isCommand, isDefined, isElementOrDocument, isEnvObserve, isFunction, isNumber, isObject, isPathStepEntry, isPropertyType, isRouteArray, isRouteConfigEntry, isRouteContinuation, isSameType, isSampled, isScope, isStoreValue, isString, isThenable, mcpError, mcpResult, mergeContractSchemas, mergeMappingRule, mockEnv, normalizeBody, normalizeHeaders, normalizeQuery, observeEnv, observeFromEnv, packageNameToVariable, parseCallPath, parseGrant, parseObserveCredential, parseTraceparent, parseUserAgent, processEventMapping, pushResultToOutcome, readCacheEnvelope, requestToData, requestToParameter, resolveContracts, resolveSetup, resolveTelemetryOptions, scanFlowRefs, serializeStoreValue, setByPath, setTraceUntil, startChain, stepId, storeCache, throttle, throwError, toEventList, transformData, traverseEnv, trim, tryCatch, tryCatchAsync, useHooks, validateStepEntry, verifyActivation, walkPath, wrapCacheEnvelope, wrapCondition, wrapFn, wrapValidate };
|