@croct/plug 0.20.1 → 0.21.0
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/api/fetchContent.cjs +3 -2
- package/api/fetchContent.d.cts +3 -3
- package/api/fetchContent.d.ts +3 -3
- package/api/fetchContent.js +3 -2
- package/api/index.d.cts +1 -1
- package/api/index.d.ts +1 -1
- package/constants.cjs +1 -1
- package/constants.d.cts +1 -1
- package/constants.d.ts +1 -1
- package/constants.js +1 -1
- package/global.d.d.cts +2 -1
- package/global.d.d.ts +2 -1
- package/index.d.cts +3 -2
- package/index.d.ts +3 -2
- package/package.json +2 -2
- package/{plug-Cf6SnDp4.d.cts → plug-B9fh6jr4.d.cts} +6 -7
- package/{plug-DjUeWnq0.d.ts → plug-D_pcliI7.d.ts} +6 -7
- package/plug.cjs +3 -1
- package/plug.d.cts +2 -1
- package/plug.d.ts +2 -1
- package/plug.js +3 -1
- package/plugin.d.cts +2 -1
- package/plugin.d.ts +2 -1
- package/plugins/autoTracking/index.d.cts +2 -1
- package/plugins/autoTracking/index.d.ts +2 -1
- package/plugins/globalVariable/index.d.cts +2 -1
- package/plugins/globalVariable/index.d.ts +2 -1
- package/plugins/preview/index.d.cts +2 -1
- package/plugins/preview/index.d.ts +2 -1
package/api/fetchContent.cjs
CHANGED
|
@@ -36,11 +36,12 @@ function fetchContent(slotId, options) {
|
|
|
36
36
|
const auth = { appId, apiKey };
|
|
37
37
|
const [id, version = "latest"] = slotId.split("@");
|
|
38
38
|
const normalizedLocale = preferredLocale === "" ? void 0 : preferredLocale;
|
|
39
|
-
const
|
|
39
|
+
const resolvedOptions = {
|
|
40
40
|
...fetchOptions,
|
|
41
41
|
...normalizedLocale !== void 0 ? { preferredLocale: normalizedLocale } : {},
|
|
42
42
|
...version !== "latest" ? { version } : {}
|
|
43
|
-
}
|
|
43
|
+
};
|
|
44
|
+
const promise = new import_contentFetcher.ContentFetcher({ ...auth, baseEndpointUrl }).fetch(id, resolvedOptions);
|
|
44
45
|
return promise.catch(
|
|
45
46
|
async (error) => {
|
|
46
47
|
if (logger !== void 0) {
|
package/api/fetchContent.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DynamicContentOptions as DynamicContentOptions$1, StaticContentOptions as StaticContentOptions$1 } from '@croct/sdk/contentFetcher';
|
|
1
|
+
import { DynamicContentOptions as DynamicContentOptions$1, StaticContentOptions as StaticContentOptions$1, FetchResponseOptions } from '@croct/sdk/contentFetcher';
|
|
2
2
|
import { ApiKey } from '@croct/sdk/apiKey';
|
|
3
3
|
import { Logger } from '@croct/sdk/logging';
|
|
4
4
|
import { JsonObject, JsonValue } from '@croct/json/mutable';
|
|
5
|
-
import { F as FetchResponse } from '../plug-
|
|
5
|
+
import { F as FetchResponse } from '../plug-B9fh6jr4.cjs';
|
|
6
6
|
import { SlotContent, VersionedSlotId } from '../slot.cjs';
|
|
7
7
|
import '@croct/sdk/facade/sessionFacade';
|
|
8
8
|
import '@croct/sdk/facade/userFacade';
|
|
@@ -39,6 +39,6 @@ type ClientSideAuthOptions = {
|
|
|
39
39
|
type DynamicContentOptions<T extends JsonObject = JsonObject> = Omit<DynamicContentOptions$1, 'version'> & FetchingOptions<T> & AuthOptions;
|
|
40
40
|
type StaticContentOptions<T extends JsonObject = JsonObject> = Omit<StaticContentOptions$1, 'version'> & FetchingOptions<T> & ServerSideAuthOptions;
|
|
41
41
|
type FetchOptions<T extends JsonObject = SlotContent> = DynamicContentOptions<T> | StaticContentOptions<T>;
|
|
42
|
-
declare function fetchContent<I extends VersionedSlotId, C extends JsonObject>(slotId: I, options?: FetchOptions<SlotContent<I, C>>): Promise<
|
|
42
|
+
declare function fetchContent<I extends VersionedSlotId, C extends JsonObject, O extends FetchResponseOptions = FetchResponseOptions>(slotId: I, options?: O & FetchOptions<SlotContent<I, C>>): Promise<FetchResponse<I, C, never, O>>;
|
|
43
43
|
|
|
44
44
|
export { type DynamicContentOptions, type FetchOptions, FetchResponse, type StaticContentOptions, fetchContent };
|
package/api/fetchContent.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DynamicContentOptions as DynamicContentOptions$1, StaticContentOptions as StaticContentOptions$1 } from '@croct/sdk/contentFetcher';
|
|
1
|
+
import { DynamicContentOptions as DynamicContentOptions$1, StaticContentOptions as StaticContentOptions$1, FetchResponseOptions } from '@croct/sdk/contentFetcher';
|
|
2
2
|
import { ApiKey } from '@croct/sdk/apiKey';
|
|
3
3
|
import { Logger } from '@croct/sdk/logging';
|
|
4
4
|
import { JsonObject, JsonValue } from '@croct/json/mutable';
|
|
5
|
-
import { F as FetchResponse } from '../plug-
|
|
5
|
+
import { F as FetchResponse } from '../plug-D_pcliI7.js';
|
|
6
6
|
import { SlotContent, VersionedSlotId } from '../slot.js';
|
|
7
7
|
import '@croct/sdk/facade/sessionFacade';
|
|
8
8
|
import '@croct/sdk/facade/userFacade';
|
|
@@ -39,6 +39,6 @@ type ClientSideAuthOptions = {
|
|
|
39
39
|
type DynamicContentOptions<T extends JsonObject = JsonObject> = Omit<DynamicContentOptions$1, 'version'> & FetchingOptions<T> & AuthOptions;
|
|
40
40
|
type StaticContentOptions<T extends JsonObject = JsonObject> = Omit<StaticContentOptions$1, 'version'> & FetchingOptions<T> & ServerSideAuthOptions;
|
|
41
41
|
type FetchOptions<T extends JsonObject = SlotContent> = DynamicContentOptions<T> | StaticContentOptions<T>;
|
|
42
|
-
declare function fetchContent<I extends VersionedSlotId, C extends JsonObject>(slotId: I, options?: FetchOptions<SlotContent<I, C>>): Promise<
|
|
42
|
+
declare function fetchContent<I extends VersionedSlotId, C extends JsonObject, O extends FetchResponseOptions = FetchResponseOptions>(slotId: I, options?: O & FetchOptions<SlotContent<I, C>>): Promise<FetchResponse<I, C, never, O>>;
|
|
43
43
|
|
|
44
44
|
export { type DynamicContentOptions, type FetchOptions, FetchResponse, type StaticContentOptions, fetchContent };
|
package/api/fetchContent.js
CHANGED
|
@@ -16,11 +16,12 @@ function fetchContent(slotId, options) {
|
|
|
16
16
|
const auth = { appId, apiKey };
|
|
17
17
|
const [id, version = "latest"] = slotId.split("@");
|
|
18
18
|
const normalizedLocale = preferredLocale === "" ? void 0 : preferredLocale;
|
|
19
|
-
const
|
|
19
|
+
const resolvedOptions = {
|
|
20
20
|
...fetchOptions,
|
|
21
21
|
...normalizedLocale !== void 0 ? { preferredLocale: normalizedLocale } : {},
|
|
22
22
|
...version !== "latest" ? { version } : {}
|
|
23
|
-
}
|
|
23
|
+
};
|
|
24
|
+
const promise = new ContentFetcher({ ...auth, baseEndpointUrl }).fetch(id, resolvedOptions);
|
|
24
25
|
return promise.catch(
|
|
25
26
|
async (error) => {
|
|
26
27
|
if (logger !== void 0) {
|
package/api/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { EvaluationOptions, evaluate } from './evaluate.cjs';
|
|
2
2
|
export { DynamicContentOptions, FetchOptions, StaticContentOptions, fetchContent } from './fetchContent.cjs';
|
|
3
|
-
export { F as FetchResponse } from '../plug-
|
|
3
|
+
export { F as FetchResponse } from '../plug-B9fh6jr4.cjs';
|
|
4
4
|
import '@croct/sdk/evaluator';
|
|
5
5
|
import '@croct/sdk/apiKey';
|
|
6
6
|
import '@croct/sdk/logging';
|
package/api/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { EvaluationOptions, evaluate } from './evaluate.js';
|
|
2
2
|
export { DynamicContentOptions, FetchOptions, StaticContentOptions, fetchContent } from './fetchContent.js';
|
|
3
|
-
export { F as FetchResponse } from '../plug-
|
|
3
|
+
export { F as FetchResponse } from '../plug-D_pcliI7.js';
|
|
4
4
|
import '@croct/sdk/evaluator';
|
|
5
5
|
import '@croct/sdk/apiKey';
|
|
6
6
|
import '@croct/sdk/logging';
|
package/constants.cjs
CHANGED
|
@@ -28,7 +28,7 @@ const CDN_URL = "https://cdn.croct.io/js/v1/lib/plug.js";
|
|
|
28
28
|
const PLAYGROUND_ORIGIN = "https://play.croct.com";
|
|
29
29
|
const PLAYGROUND_CONNECT_URL = "https://play.croct.com/connect.html";
|
|
30
30
|
const PREVIEW_WIDGET_ORIGIN = "https://cdn.croct.io";
|
|
31
|
-
const PREVIEW_WIDGET_URL = "https://cdn.croct.io/js/v1/lib/plug/widget-0.
|
|
31
|
+
const PREVIEW_WIDGET_URL = "https://cdn.croct.io/js/v1/lib/plug/widget-0.21.0.html";
|
|
32
32
|
// Annotate the CommonJS export names for ESM import in node:
|
|
33
33
|
0 && (module.exports = {
|
|
34
34
|
CDN_URL,
|
package/constants.d.cts
CHANGED
|
@@ -2,6 +2,6 @@ declare const CDN_URL = "https://cdn.croct.io/js/v1/lib/plug.js";
|
|
|
2
2
|
declare const PLAYGROUND_ORIGIN = "https://play.croct.com";
|
|
3
3
|
declare const PLAYGROUND_CONNECT_URL = "https://play.croct.com/connect.html";
|
|
4
4
|
declare const PREVIEW_WIDGET_ORIGIN = "https://cdn.croct.io";
|
|
5
|
-
declare const PREVIEW_WIDGET_URL = "https://cdn.croct.io/js/v1/lib/plug/widget-0.
|
|
5
|
+
declare const PREVIEW_WIDGET_URL = "https://cdn.croct.io/js/v1/lib/plug/widget-0.21.0.html";
|
|
6
6
|
|
|
7
7
|
export { CDN_URL, PLAYGROUND_CONNECT_URL, PLAYGROUND_ORIGIN, PREVIEW_WIDGET_ORIGIN, PREVIEW_WIDGET_URL };
|
package/constants.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ declare const CDN_URL = "https://cdn.croct.io/js/v1/lib/plug.js";
|
|
|
2
2
|
declare const PLAYGROUND_ORIGIN = "https://play.croct.com";
|
|
3
3
|
declare const PLAYGROUND_CONNECT_URL = "https://play.croct.com/connect.html";
|
|
4
4
|
declare const PREVIEW_WIDGET_ORIGIN = "https://cdn.croct.io";
|
|
5
|
-
declare const PREVIEW_WIDGET_URL = "https://cdn.croct.io/js/v1/lib/plug/widget-0.
|
|
5
|
+
declare const PREVIEW_WIDGET_URL = "https://cdn.croct.io/js/v1/lib/plug/widget-0.21.0.html";
|
|
6
6
|
|
|
7
7
|
export { CDN_URL, PLAYGROUND_CONNECT_URL, PLAYGROUND_ORIGIN, PREVIEW_WIDGET_ORIGIN, PREVIEW_WIDGET_URL };
|
package/constants.js
CHANGED
|
@@ -2,7 +2,7 @@ const CDN_URL = "https://cdn.croct.io/js/v1/lib/plug.js";
|
|
|
2
2
|
const PLAYGROUND_ORIGIN = "https://play.croct.com";
|
|
3
3
|
const PLAYGROUND_CONNECT_URL = "https://play.croct.com/connect.html";
|
|
4
4
|
const PREVIEW_WIDGET_ORIGIN = "https://cdn.croct.io";
|
|
5
|
-
const PREVIEW_WIDGET_URL = "https://cdn.croct.io/js/v1/lib/plug/widget-0.
|
|
5
|
+
const PREVIEW_WIDGET_URL = "https://cdn.croct.io/js/v1/lib/plug/widget-0.21.0.html";
|
|
6
6
|
export {
|
|
7
7
|
CDN_URL,
|
|
8
8
|
PLAYGROUND_CONNECT_URL,
|
package/global.d.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as Plug } from './plug-
|
|
1
|
+
import { P as Plug } from './plug-B9fh6jr4.cjs';
|
|
2
2
|
import '@croct/sdk/facade/sessionFacade';
|
|
3
3
|
import '@croct/sdk/facade/userFacade';
|
|
4
4
|
import '@croct/sdk/facade/trackerFacade';
|
|
@@ -7,6 +7,7 @@ import '@croct/sdk/facade/sdkFacade';
|
|
|
7
7
|
import '@croct/sdk/utilityTypes';
|
|
8
8
|
import '@croct/sdk/trackingEvents';
|
|
9
9
|
import '@croct/sdk/facade/contentFetcherFacade';
|
|
10
|
+
import '@croct/sdk/contentFetcher';
|
|
10
11
|
import '@croct/sdk/token';
|
|
11
12
|
import './sdk/index.cjs';
|
|
12
13
|
import '@croct/sdk/eventManager';
|
package/global.d.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as Plug } from './plug-
|
|
1
|
+
import { P as Plug } from './plug-D_pcliI7.js';
|
|
2
2
|
import '@croct/sdk/facade/sessionFacade';
|
|
3
3
|
import '@croct/sdk/facade/userFacade';
|
|
4
4
|
import '@croct/sdk/facade/trackerFacade';
|
|
@@ -7,6 +7,7 @@ import '@croct/sdk/facade/sdkFacade';
|
|
|
7
7
|
import '@croct/sdk/utilityTypes';
|
|
8
8
|
import '@croct/sdk/trackingEvents';
|
|
9
9
|
import '@croct/sdk/facade/contentFetcherFacade';
|
|
10
|
+
import '@croct/sdk/contentFetcher';
|
|
10
11
|
import '@croct/sdk/token';
|
|
11
12
|
import './sdk/index.js';
|
|
12
13
|
import '@croct/sdk/eventManager';
|
package/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { G as GlobalPlug } from './plug-
|
|
2
|
-
export { C as Configuration, P as Plug } from './plug-
|
|
1
|
+
import { G as GlobalPlug } from './plug-B9fh6jr4.cjs';
|
|
2
|
+
export { C as Configuration, F as FetchResponse, P as Plug } from './plug-B9fh6jr4.cjs';
|
|
3
3
|
import '@croct/sdk/facade/sessionFacade';
|
|
4
4
|
import '@croct/sdk/facade/userFacade';
|
|
5
5
|
import '@croct/sdk/facade/trackerFacade';
|
|
@@ -8,6 +8,7 @@ import '@croct/sdk/facade/sdkFacade';
|
|
|
8
8
|
import '@croct/sdk/utilityTypes';
|
|
9
9
|
import '@croct/sdk/trackingEvents';
|
|
10
10
|
import '@croct/sdk/facade/contentFetcherFacade';
|
|
11
|
+
import '@croct/sdk/contentFetcher';
|
|
11
12
|
import '@croct/sdk/token';
|
|
12
13
|
import './sdk/index.cjs';
|
|
13
14
|
import '@croct/sdk/eventManager';
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { G as GlobalPlug } from './plug-
|
|
2
|
-
export { C as Configuration, P as Plug } from './plug-
|
|
1
|
+
import { G as GlobalPlug } from './plug-D_pcliI7.js';
|
|
2
|
+
export { C as Configuration, F as FetchResponse, P as Plug } from './plug-D_pcliI7.js';
|
|
3
3
|
import '@croct/sdk/facade/sessionFacade';
|
|
4
4
|
import '@croct/sdk/facade/userFacade';
|
|
5
5
|
import '@croct/sdk/facade/trackerFacade';
|
|
@@ -8,6 +8,7 @@ import '@croct/sdk/facade/sdkFacade';
|
|
|
8
8
|
import '@croct/sdk/utilityTypes';
|
|
9
9
|
import '@croct/sdk/trackingEvents';
|
|
10
10
|
import '@croct/sdk/facade/contentFetcherFacade';
|
|
11
|
+
import '@croct/sdk/contentFetcher';
|
|
11
12
|
import '@croct/sdk/token';
|
|
12
13
|
import './sdk/index.js';
|
|
13
14
|
import '@croct/sdk/eventManager';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@croct/plug",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "A fully-featured devkit for building natively personalized applications.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@croct/content": "^1.1.0",
|
|
69
69
|
"@croct/json": "^2.1.0",
|
|
70
|
-
"@croct/sdk": "^0.
|
|
70
|
+
"@croct/sdk": "^0.20.0",
|
|
71
71
|
"tslib": "^2.7.0"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
@@ -6,6 +6,7 @@ import { Configuration as Configuration$1 } from '@croct/sdk/facade/sdkFacade';
|
|
|
6
6
|
import { Optional } from '@croct/sdk/utilityTypes';
|
|
7
7
|
import { ExternalTrackingEventType, ExternalTrackingEventPayload, ExternalTrackingEvent } from '@croct/sdk/trackingEvents';
|
|
8
8
|
import { FetchOptions as FetchOptions$1 } from '@croct/sdk/facade/contentFetcherFacade';
|
|
9
|
+
import { FetchResponseOptions, FetchResponse as FetchResponse$1 } from '@croct/sdk/contentFetcher';
|
|
9
10
|
import { TokenStore } from '@croct/sdk/token';
|
|
10
11
|
import { SdkEventManager } from './sdk/index.cjs';
|
|
11
12
|
import { VersionedSlotId, SlotContent } from './slot.cjs';
|
|
@@ -52,9 +53,7 @@ type Configuration = Optional<Configuration$1, 'appId'> & {
|
|
|
52
53
|
type FetchOptions<T> = Omit<FetchOptions$1, 'version'> & {
|
|
53
54
|
fallback?: T;
|
|
54
55
|
};
|
|
55
|
-
type FetchResponse<I extends VersionedSlotId, C extends JsonObject = JsonObject, F = never> =
|
|
56
|
-
content: SlotContent<I, C> | F;
|
|
57
|
-
};
|
|
56
|
+
type FetchResponse<I extends VersionedSlotId, C extends JsonObject = JsonObject, F = never, O extends FetchResponseOptions = FetchResponseOptions> = Optional<FetchResponse$1<SlotContent<I, C> | F, O>, 'metadata'>;
|
|
58
57
|
interface Plug {
|
|
59
58
|
readonly tracker: TrackerFacade;
|
|
60
59
|
readonly user: UserFacade;
|
|
@@ -71,8 +70,8 @@ interface Plug {
|
|
|
71
70
|
unsetToken(): void;
|
|
72
71
|
track<T extends ExternalTrackingEventType>(type: T, payload: ExternalTrackingEventPayload<T>): Promise<ExternalTrackingEvent<T>>;
|
|
73
72
|
evaluate<T extends JsonValue>(expression: string, options?: EvaluationOptions): Promise<T>;
|
|
74
|
-
fetch<I extends VersionedSlotId>(slotId: I, options?: FetchOptions<SlotContent<I>>): Promise<FetchResponse<I>>;
|
|
75
|
-
fetch<F, I extends VersionedSlotId>(slotId: I, options?: FetchOptions<SlotContent<I> | F>): Promise<FetchResponse<I, JsonObject, F>>;
|
|
73
|
+
fetch<I extends VersionedSlotId, O extends FetchResponseOptions>(slotId: I, options?: O & FetchOptions<SlotContent<I>>): Promise<FetchResponse<I, JsonObject, never, O>>;
|
|
74
|
+
fetch<F, I extends VersionedSlotId, O extends FetchResponseOptions>(slotId: I, options?: O & FetchOptions<SlotContent<I> | F>): Promise<FetchResponse<I, JsonObject, F, O>>;
|
|
76
75
|
unplug(): Promise<void>;
|
|
77
76
|
}
|
|
78
77
|
declare class GlobalPlug implements Plug {
|
|
@@ -102,8 +101,8 @@ declare class GlobalPlug implements Plug {
|
|
|
102
101
|
track<T extends ExternalTrackingEventType>(type: T, payload: ExternalTrackingEventPayload<T>): Promise<ExternalTrackingEvent<T>>;
|
|
103
102
|
evaluate<T extends JsonValue>(query: string, options?: EvaluationOptions): Promise<T>;
|
|
104
103
|
test(expression: string, options?: EvaluationOptions): Promise<boolean>;
|
|
105
|
-
fetch<I extends VersionedSlotId>(slotId: I, options?: FetchOptions<SlotContent<I>>): Promise<FetchResponse<I>>;
|
|
106
|
-
fetch<F, I extends VersionedSlotId>(slotId: I, options?: FetchOptions<SlotContent<I> | F>): Promise<FetchResponse<I, JsonObject, F>>;
|
|
104
|
+
fetch<I extends VersionedSlotId, O extends FetchResponseOptions>(slotId: I, options?: O & FetchOptions<SlotContent<I>>): Promise<FetchResponse<I, JsonObject, never, O>>;
|
|
105
|
+
fetch<F, I extends VersionedSlotId, O extends FetchResponseOptions>(slotId: I, options?: O & FetchOptions<SlotContent<I> | F>): Promise<FetchResponse<I, JsonObject, F, O>>;
|
|
107
106
|
unplug(): Promise<void>;
|
|
108
107
|
}
|
|
109
108
|
|
|
@@ -6,6 +6,7 @@ import { Configuration as Configuration$1 } from '@croct/sdk/facade/sdkFacade';
|
|
|
6
6
|
import { Optional } from '@croct/sdk/utilityTypes';
|
|
7
7
|
import { ExternalTrackingEventType, ExternalTrackingEventPayload, ExternalTrackingEvent } from '@croct/sdk/trackingEvents';
|
|
8
8
|
import { FetchOptions as FetchOptions$1 } from '@croct/sdk/facade/contentFetcherFacade';
|
|
9
|
+
import { FetchResponseOptions, FetchResponse as FetchResponse$1 } from '@croct/sdk/contentFetcher';
|
|
9
10
|
import { TokenStore } from '@croct/sdk/token';
|
|
10
11
|
import { SdkEventManager } from './sdk/index.js';
|
|
11
12
|
import { VersionedSlotId, SlotContent } from './slot.js';
|
|
@@ -52,9 +53,7 @@ type Configuration = Optional<Configuration$1, 'appId'> & {
|
|
|
52
53
|
type FetchOptions<T> = Omit<FetchOptions$1, 'version'> & {
|
|
53
54
|
fallback?: T;
|
|
54
55
|
};
|
|
55
|
-
type FetchResponse<I extends VersionedSlotId, C extends JsonObject = JsonObject, F = never> =
|
|
56
|
-
content: SlotContent<I, C> | F;
|
|
57
|
-
};
|
|
56
|
+
type FetchResponse<I extends VersionedSlotId, C extends JsonObject = JsonObject, F = never, O extends FetchResponseOptions = FetchResponseOptions> = Optional<FetchResponse$1<SlotContent<I, C> | F, O>, 'metadata'>;
|
|
58
57
|
interface Plug {
|
|
59
58
|
readonly tracker: TrackerFacade;
|
|
60
59
|
readonly user: UserFacade;
|
|
@@ -71,8 +70,8 @@ interface Plug {
|
|
|
71
70
|
unsetToken(): void;
|
|
72
71
|
track<T extends ExternalTrackingEventType>(type: T, payload: ExternalTrackingEventPayload<T>): Promise<ExternalTrackingEvent<T>>;
|
|
73
72
|
evaluate<T extends JsonValue>(expression: string, options?: EvaluationOptions): Promise<T>;
|
|
74
|
-
fetch<I extends VersionedSlotId>(slotId: I, options?: FetchOptions<SlotContent<I>>): Promise<FetchResponse<I>>;
|
|
75
|
-
fetch<F, I extends VersionedSlotId>(slotId: I, options?: FetchOptions<SlotContent<I> | F>): Promise<FetchResponse<I, JsonObject, F>>;
|
|
73
|
+
fetch<I extends VersionedSlotId, O extends FetchResponseOptions>(slotId: I, options?: O & FetchOptions<SlotContent<I>>): Promise<FetchResponse<I, JsonObject, never, O>>;
|
|
74
|
+
fetch<F, I extends VersionedSlotId, O extends FetchResponseOptions>(slotId: I, options?: O & FetchOptions<SlotContent<I> | F>): Promise<FetchResponse<I, JsonObject, F, O>>;
|
|
76
75
|
unplug(): Promise<void>;
|
|
77
76
|
}
|
|
78
77
|
declare class GlobalPlug implements Plug {
|
|
@@ -102,8 +101,8 @@ declare class GlobalPlug implements Plug {
|
|
|
102
101
|
track<T extends ExternalTrackingEventType>(type: T, payload: ExternalTrackingEventPayload<T>): Promise<ExternalTrackingEvent<T>>;
|
|
103
102
|
evaluate<T extends JsonValue>(query: string, options?: EvaluationOptions): Promise<T>;
|
|
104
103
|
test(expression: string, options?: EvaluationOptions): Promise<boolean>;
|
|
105
|
-
fetch<I extends VersionedSlotId>(slotId: I, options?: FetchOptions<SlotContent<I>>): Promise<FetchResponse<I>>;
|
|
106
|
-
fetch<F, I extends VersionedSlotId>(slotId: I, options?: FetchOptions<SlotContent<I> | F>): Promise<FetchResponse<I, JsonObject, F>>;
|
|
104
|
+
fetch<I extends VersionedSlotId, O extends FetchResponseOptions>(slotId: I, options?: O & FetchOptions<SlotContent<I>>): Promise<FetchResponse<I, JsonObject, never, O>>;
|
|
105
|
+
fetch<F, I extends VersionedSlotId, O extends FetchResponseOptions>(slotId: I, options?: O & FetchOptions<SlotContent<I> | F>): Promise<FetchResponse<I, JsonObject, F, O>>;
|
|
107
106
|
unplug(): Promise<void>;
|
|
108
107
|
}
|
|
109
108
|
|
package/plug.cjs
CHANGED
package/plug.d.cts
CHANGED
|
@@ -6,7 +6,8 @@ import '@croct/sdk/facade/sdkFacade';
|
|
|
6
6
|
import '@croct/sdk/utilityTypes';
|
|
7
7
|
import '@croct/sdk/trackingEvents';
|
|
8
8
|
import '@croct/sdk/facade/contentFetcherFacade';
|
|
9
|
-
|
|
9
|
+
import '@croct/sdk/contentFetcher';
|
|
10
|
+
export { C as Configuration, f as FetchOptions, F as FetchResponse, G as GlobalPlug, P as Plug, e as PluginConfigurations } from './plug-B9fh6jr4.cjs';
|
|
10
11
|
import './slot.cjs';
|
|
11
12
|
import '@croct/json/mutable';
|
|
12
13
|
import '@croct/sdk/token';
|
package/plug.d.ts
CHANGED
|
@@ -6,7 +6,8 @@ import '@croct/sdk/facade/sdkFacade';
|
|
|
6
6
|
import '@croct/sdk/utilityTypes';
|
|
7
7
|
import '@croct/sdk/trackingEvents';
|
|
8
8
|
import '@croct/sdk/facade/contentFetcherFacade';
|
|
9
|
-
|
|
9
|
+
import '@croct/sdk/contentFetcher';
|
|
10
|
+
export { C as Configuration, f as FetchOptions, F as FetchResponse, G as GlobalPlug, P as Plug, e as PluginConfigurations } from './plug-D_pcliI7.js';
|
|
10
11
|
import './slot.js';
|
|
11
12
|
import '@croct/json/mutable';
|
|
12
13
|
import '@croct/sdk/token';
|
package/plug.js
CHANGED
package/plugin.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import '@croct/sdk/token';
|
|
|
2
2
|
import '@croct/sdk/facade/evaluatorFacade';
|
|
3
3
|
import '@croct/sdk/facade/trackerFacade';
|
|
4
4
|
import './sdk/index.cjs';
|
|
5
|
-
export { a as Plugin, b as PluginArguments, c as PluginFactory, d as PluginSdk } from './plug-
|
|
5
|
+
export { a as Plugin, b as PluginArguments, c as PluginFactory, d as PluginSdk } from './plug-B9fh6jr4.cjs';
|
|
6
6
|
import '@croct/sdk/facade/userFacade';
|
|
7
7
|
import '@croct/sdk/facade/sessionFacade';
|
|
8
8
|
import '@croct/sdk/tab';
|
|
@@ -14,6 +14,7 @@ import '@croct/sdk/facade/sdkFacade';
|
|
|
14
14
|
import '@croct/sdk/utilityTypes';
|
|
15
15
|
import '@croct/sdk/trackingEvents';
|
|
16
16
|
import '@croct/sdk/facade/contentFetcherFacade';
|
|
17
|
+
import '@croct/sdk/contentFetcher';
|
|
17
18
|
import './slot.cjs';
|
|
18
19
|
import '@croct/json';
|
|
19
20
|
import './versioning.cjs';
|
package/plugin.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import '@croct/sdk/token';
|
|
|
2
2
|
import '@croct/sdk/facade/evaluatorFacade';
|
|
3
3
|
import '@croct/sdk/facade/trackerFacade';
|
|
4
4
|
import './sdk/index.js';
|
|
5
|
-
export { a as Plugin, b as PluginArguments, c as PluginFactory, d as PluginSdk } from './plug-
|
|
5
|
+
export { a as Plugin, b as PluginArguments, c as PluginFactory, d as PluginSdk } from './plug-D_pcliI7.js';
|
|
6
6
|
import '@croct/sdk/facade/userFacade';
|
|
7
7
|
import '@croct/sdk/facade/sessionFacade';
|
|
8
8
|
import '@croct/sdk/tab';
|
|
@@ -14,6 +14,7 @@ import '@croct/sdk/facade/sdkFacade';
|
|
|
14
14
|
import '@croct/sdk/utilityTypes';
|
|
15
15
|
import '@croct/sdk/trackingEvents';
|
|
16
16
|
import '@croct/sdk/facade/contentFetcherFacade';
|
|
17
|
+
import '@croct/sdk/contentFetcher';
|
|
17
18
|
import './slot.js';
|
|
18
19
|
import '@croct/json';
|
|
19
20
|
import './versioning.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as Plugin, b as PluginArguments } from '../../plug-
|
|
1
|
+
import { a as Plugin, b as PluginArguments } from '../../plug-B9fh6jr4.cjs';
|
|
2
2
|
import { TrackerFacade } from '@croct/sdk/facade/trackerFacade';
|
|
3
3
|
import { Tab } from '@croct/sdk/tab';
|
|
4
4
|
import '@croct/sdk/facade/sessionFacade';
|
|
@@ -8,6 +8,7 @@ import '@croct/sdk/facade/sdkFacade';
|
|
|
8
8
|
import '@croct/sdk/utilityTypes';
|
|
9
9
|
import '@croct/sdk/trackingEvents';
|
|
10
10
|
import '@croct/sdk/facade/contentFetcherFacade';
|
|
11
|
+
import '@croct/sdk/contentFetcher';
|
|
11
12
|
import '@croct/sdk/token';
|
|
12
13
|
import '../../sdk/index.cjs';
|
|
13
14
|
import '@croct/sdk/eventManager';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as Plugin, b as PluginArguments } from '../../plug-
|
|
1
|
+
import { a as Plugin, b as PluginArguments } from '../../plug-D_pcliI7.js';
|
|
2
2
|
import { TrackerFacade } from '@croct/sdk/facade/trackerFacade';
|
|
3
3
|
import { Tab } from '@croct/sdk/tab';
|
|
4
4
|
import '@croct/sdk/facade/sessionFacade';
|
|
@@ -8,6 +8,7 @@ import '@croct/sdk/facade/sdkFacade';
|
|
|
8
8
|
import '@croct/sdk/utilityTypes';
|
|
9
9
|
import '@croct/sdk/trackingEvents';
|
|
10
10
|
import '@croct/sdk/facade/contentFetcherFacade';
|
|
11
|
+
import '@croct/sdk/contentFetcher';
|
|
11
12
|
import '@croct/sdk/token';
|
|
12
13
|
import '../../sdk/index.js';
|
|
13
14
|
import '@croct/sdk/eventManager';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as Plug, a as Plugin, b as PluginArguments } from '../../plug-
|
|
1
|
+
import { P as Plug, a as Plugin, b as PluginArguments } from '../../plug-B9fh6jr4.cjs';
|
|
2
2
|
import '@croct/sdk/facade/sessionFacade';
|
|
3
3
|
import '@croct/sdk/facade/userFacade';
|
|
4
4
|
import '@croct/sdk/facade/trackerFacade';
|
|
@@ -7,6 +7,7 @@ import '@croct/sdk/facade/sdkFacade';
|
|
|
7
7
|
import '@croct/sdk/utilityTypes';
|
|
8
8
|
import '@croct/sdk/trackingEvents';
|
|
9
9
|
import '@croct/sdk/facade/contentFetcherFacade';
|
|
10
|
+
import '@croct/sdk/contentFetcher';
|
|
10
11
|
import '@croct/sdk/token';
|
|
11
12
|
import '../../sdk/index.cjs';
|
|
12
13
|
import '@croct/sdk/eventManager';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as Plug, a as Plugin, b as PluginArguments } from '../../plug-
|
|
1
|
+
import { P as Plug, a as Plugin, b as PluginArguments } from '../../plug-D_pcliI7.js';
|
|
2
2
|
import '@croct/sdk/facade/sessionFacade';
|
|
3
3
|
import '@croct/sdk/facade/userFacade';
|
|
4
4
|
import '@croct/sdk/facade/trackerFacade';
|
|
@@ -7,6 +7,7 @@ import '@croct/sdk/facade/sdkFacade';
|
|
|
7
7
|
import '@croct/sdk/utilityTypes';
|
|
8
8
|
import '@croct/sdk/trackingEvents';
|
|
9
9
|
import '@croct/sdk/facade/contentFetcherFacade';
|
|
10
|
+
import '@croct/sdk/contentFetcher';
|
|
10
11
|
import '@croct/sdk/token';
|
|
11
12
|
import '../../sdk/index.js';
|
|
12
13
|
import '@croct/sdk/eventManager';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Logger } from '@croct/sdk/logging';
|
|
2
|
-
import { a as Plugin, c as PluginFactory } from '../../plug-
|
|
2
|
+
import { a as Plugin, c as PluginFactory } from '../../plug-B9fh6jr4.cjs';
|
|
3
3
|
import { TokenStore } from '@croct/sdk/token';
|
|
4
4
|
import '@croct/sdk/facade/sessionFacade';
|
|
5
5
|
import '@croct/sdk/facade/userFacade';
|
|
@@ -9,6 +9,7 @@ import '@croct/sdk/facade/sdkFacade';
|
|
|
9
9
|
import '@croct/sdk/utilityTypes';
|
|
10
10
|
import '@croct/sdk/trackingEvents';
|
|
11
11
|
import '@croct/sdk/facade/contentFetcherFacade';
|
|
12
|
+
import '@croct/sdk/contentFetcher';
|
|
12
13
|
import '../../sdk/index.cjs';
|
|
13
14
|
import '@croct/sdk/eventManager';
|
|
14
15
|
import '@croct/sdk/sdkEvents';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Logger } from '@croct/sdk/logging';
|
|
2
|
-
import { a as Plugin, c as PluginFactory } from '../../plug-
|
|
2
|
+
import { a as Plugin, c as PluginFactory } from '../../plug-D_pcliI7.js';
|
|
3
3
|
import { TokenStore } from '@croct/sdk/token';
|
|
4
4
|
import '@croct/sdk/facade/sessionFacade';
|
|
5
5
|
import '@croct/sdk/facade/userFacade';
|
|
@@ -9,6 +9,7 @@ import '@croct/sdk/facade/sdkFacade';
|
|
|
9
9
|
import '@croct/sdk/utilityTypes';
|
|
10
10
|
import '@croct/sdk/trackingEvents';
|
|
11
11
|
import '@croct/sdk/facade/contentFetcherFacade';
|
|
12
|
+
import '@croct/sdk/contentFetcher';
|
|
12
13
|
import '../../sdk/index.js';
|
|
13
14
|
import '@croct/sdk/eventManager';
|
|
14
15
|
import '@croct/sdk/sdkEvents';
|