@croct/plug 0.11.0-alpha.2 → 0.11.0-alpha.3
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/README.md +1 -1
- package/constants.d.ts +1 -1
- package/constants.js +2 -1
- package/constants.js.map +1 -0
- package/eap.js +1 -0
- package/eap.js.map +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -0
- package/package.json +4 -3
- package/playground.js +1 -0
- package/playground.js.map +1 -0
- package/plug.js +1 -0
- package/plug.js.map +1 -0
- package/plugin.js +1 -0
- package/plugin.js.map +1 -0
- package/preview.d.ts +1 -0
- package/preview.js +13 -3
- package/preview.js.map +1 -0
- package/sdk/evaluation.js +1 -0
- package/sdk/evaluation.js.map +1 -0
- package/sdk/index.js +1 -0
- package/sdk/index.js.map +1 -0
- package/sdk/json.js +1 -0
- package/sdk/json.js.map +1 -0
- package/sdk/sdkEvents.js +1 -0
- package/sdk/sdkEvents.js.map +1 -0
- package/sdk/token.js +1 -0
- package/sdk/token.js.map +1 -0
- package/sdk/tracking.js +1 -0
- package/sdk/tracking.js.map +1 -0
- package/sdk/validation.js +1 -0
- package/sdk/validation.js.map +1 -0
- package/slot.js +1 -0
- package/slot.js.map +1 -0
- package/src/constants.ts +5 -0
- package/src/eap.ts +17 -0
- package/src/index.ts +6 -0
- package/src/playground.ts +247 -0
- package/src/plug.ts +470 -0
- package/src/plugin.ts +39 -0
- package/src/preview.ts +187 -0
- package/src/sdk/evaluation.ts +2 -0
- package/src/sdk/index.ts +14 -0
- package/src/sdk/json.ts +4 -0
- package/src/sdk/sdkEvents.ts +1 -0
- package/src/sdk/token.ts +1 -0
- package/src/sdk/tracking.ts +14 -0
- package/src/sdk/validation.ts +2 -0
- package/src/slot.ts +37 -0
package/src/sdk/index.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {EventListener, EventDispatcher, EventSubscriber, EventManager} from '@croct/sdk/eventManager';
|
|
2
|
+
import {SdkEventMap, SdkEventType} from '@croct/sdk/sdkEvents';
|
|
3
|
+
|
|
4
|
+
export {Logger} from '@croct/sdk/logging';
|
|
5
|
+
export {SessionFacade} from '@croct/sdk/facade/sessionFacade';
|
|
6
|
+
export {UserFacade} from '@croct/sdk/facade/userFacade';
|
|
7
|
+
export {Tab} from '@croct/sdk/tab';
|
|
8
|
+
export {CidAssigner} from '@croct/sdk/cid';
|
|
9
|
+
export {SdkEventType, SdkEvent} from '@croct/sdk/sdkEvents';
|
|
10
|
+
|
|
11
|
+
export type SdkEventListener<T extends SdkEventType> = EventListener<SdkEventMap[T]>;
|
|
12
|
+
export type SdkEventDispatcher = EventDispatcher<Record<string, Record<string, any>>>;
|
|
13
|
+
export type SdkEventSubscriber = EventSubscriber<SdkEventMap>;
|
|
14
|
+
export type SdkEventManager = EventManager<SdkEventMap, Record<string, Record<string, any>>>;
|
package/src/sdk/json.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {SdkEvent, SdkEventType} from '@croct/sdk/sdkEvents';
|
package/src/sdk/token.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {Token, TokenPayload, Headers, TokenProvider, TokenStore} from '@croct/sdk/token';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {EventInfo as SdkEventInfo} from '@croct/sdk/tracker';
|
|
2
|
+
import {TrackingEvent, TrackingEventType} from '@croct/sdk/trackingEvents';
|
|
3
|
+
|
|
4
|
+
export {TrackerFacade} from '@croct/sdk/facade/trackerFacade';
|
|
5
|
+
export {EventListener} from '@croct/sdk/tracker';
|
|
6
|
+
export {
|
|
7
|
+
TrackingEvent,
|
|
8
|
+
TrackingEventType,
|
|
9
|
+
ExternalTrackingEvent,
|
|
10
|
+
ExternalTrackingEventPayload,
|
|
11
|
+
ExternalTrackingEventType,
|
|
12
|
+
} from '@croct/sdk/trackingEvents';
|
|
13
|
+
|
|
14
|
+
export type EventInfo<T extends TrackingEventType> = SdkEventInfo<TrackingEvent<T>>;
|
package/src/slot.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {JsonObject} from '@croct/json';
|
|
2
|
+
|
|
3
|
+
export interface SlotMap {
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
type LatestSlotVersionMap = {[K in keyof SlotMap]: {latest: SlotMap[K]}};
|
|
7
|
+
|
|
8
|
+
export interface VersionedSlotMap extends LatestSlotVersionMap {
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
type LatestAlias = 'latest';
|
|
12
|
+
|
|
13
|
+
export type SlotId = keyof VersionedSlotMap extends never ? string : keyof VersionedSlotMap;
|
|
14
|
+
|
|
15
|
+
export type SlotVersion<I extends SlotId = SlotId> = LatestAlias | (
|
|
16
|
+
I extends keyof VersionedSlotMap
|
|
17
|
+
? keyof VersionedSlotMap[I]
|
|
18
|
+
: never
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
export type VersionedSlotId<I extends SlotId = SlotId> = I | {[K in SlotId]: `${K}@${SlotVersion<K> & string}`}[I];
|
|
22
|
+
|
|
23
|
+
type VersionedSlotContent<I extends SlotId, V extends string = LatestAlias, C extends JsonObject = JsonObject> =
|
|
24
|
+
I extends keyof VersionedSlotMap
|
|
25
|
+
? (V extends keyof VersionedSlotMap[I]
|
|
26
|
+
? VersionedSlotMap[I][V]
|
|
27
|
+
: C)
|
|
28
|
+
: C;
|
|
29
|
+
|
|
30
|
+
export type ExtractSlotVersion<I extends string> = I extends `${string}@${infer V}`
|
|
31
|
+
? (LatestAlias extends V ? LatestAlias : (V extends `${number}` ? V : never))
|
|
32
|
+
: LatestAlias;
|
|
33
|
+
|
|
34
|
+
export type ExtractSlotId<I extends string> = I extends `${infer V}@${string}` ? V : I;
|
|
35
|
+
|
|
36
|
+
export type SlotContent<I extends VersionedSlotId, C extends JsonObject = JsonObject> =
|
|
37
|
+
VersionedSlotContent<ExtractSlotId<I>, ExtractSlotVersion<I>, C>;
|