@saasquatch/squatch-js 2.4.3-4 → 2.4.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/CHANGELOG.md +291 -278
- package/LICENSE +20 -20
- package/README.md +1 -0
- package/demo/sandbox.ts +5 -7
- package/demo/toolbar.tsx +1 -1
- package/dist/api/AnalyticsApi.d.ts +1 -1
- package/dist/api/WidgetApi.d.ts +17 -4
- package/dist/squatch.d.ts +2 -12
- package/dist/squatch.esm.js +159 -267
- package/dist/squatch.esm.js.map +1 -1
- package/dist/squatch.js +158 -268
- package/dist/squatch.js.map +1 -1
- package/dist/squatch.min.js +3 -3
- package/dist/squatch.min.js.map +1 -1
- package/dist/squatch.modern.js +1 -1
- package/dist/squatch.modern.js.map +1 -1
- package/dist/stats.html +1 -1
- package/dist/types.d.ts +8 -10
- package/dist/utils/cookieUtils.d.ts +0 -1
- package/dist/utils/io.d.ts +1 -2
- package/dist/utils/validate.d.ts +0 -2
- package/dist/widgets/Widgets.d.ts +17 -3
- package/package.json +105 -104
- package/dist/utils/utmUtils.d.ts +0 -14
package/demo/toolbar.tsx
CHANGED
|
@@ -245,7 +245,7 @@ function ModeList(props) {
|
|
|
245
245
|
function UserList(props) {
|
|
246
246
|
return (
|
|
247
247
|
<details
|
|
248
|
-
title={"User: " + window["sandbox"].initObj.user
|
|
248
|
+
title={"User: " + window["sandbox"].initObj.user.firstName}
|
|
249
249
|
key={0}
|
|
250
250
|
id={`dropdown-basic-1`}
|
|
251
251
|
>
|
|
@@ -18,7 +18,7 @@ export default class AnalyticsApi {
|
|
|
18
18
|
constructor(config: {
|
|
19
19
|
domain: string;
|
|
20
20
|
});
|
|
21
|
-
pushAnalyticsLoadEvent(params: SQHDetails): Promise<any
|
|
21
|
+
pushAnalyticsLoadEvent(params: SQHDetails): Promise<any>;
|
|
22
22
|
pushAnalyticsShareClickedEvent(params: SQHDetails & {
|
|
23
23
|
shareMedium: string;
|
|
24
24
|
}): Promise<any>;
|
package/dist/api/WidgetApi.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfigOptions, WidgetConfig,
|
|
1
|
+
import { ConfigOptions, CookieUser, WidgetConfig, ReferralCookie } from "../types";
|
|
2
2
|
/**
|
|
3
3
|
*
|
|
4
4
|
* The WidgetApi class is a wrapper around the Widget Endpoints of the SaaSquatch REST API.
|
|
@@ -25,6 +25,19 @@ export default class WidgetApi {
|
|
|
25
25
|
* let squatchApi = new WidgetApi({tenantAlias:'test_12b5bo1b25125'});
|
|
26
26
|
*/
|
|
27
27
|
constructor(config: ConfigOptions);
|
|
28
|
+
/**
|
|
29
|
+
* Creates/upserts an anonymous user.
|
|
30
|
+
*
|
|
31
|
+
* @param {Object} params Parameters for request
|
|
32
|
+
* @param {WidgetType} params.widgetType The content of the widget.
|
|
33
|
+
* @param {EngagementMedium} params.engagementMedium How to display the widget.
|
|
34
|
+
* @param {CookieUser} params.user An optional user object
|
|
35
|
+
* @param {string} params.jwt the JSON Web Token (JWT) that is used to
|
|
36
|
+
* validate the data (can be disabled)
|
|
37
|
+
*
|
|
38
|
+
* @return {Promise} json object if true, with the widget template, jsOptions and user details.
|
|
39
|
+
*/
|
|
40
|
+
cookieUser(params: CookieUser): Promise<any>;
|
|
28
41
|
/**
|
|
29
42
|
* Creates/upserts user.
|
|
30
43
|
*
|
|
@@ -39,7 +52,7 @@ export default class WidgetApi {
|
|
|
39
52
|
*
|
|
40
53
|
* @return {Promise} string if true, with the widget template, jsOptions and user details.
|
|
41
54
|
*/
|
|
42
|
-
upsertUser(params:
|
|
55
|
+
upsertUser(params: WidgetConfig): Promise<any>;
|
|
43
56
|
/**
|
|
44
57
|
* Description here.
|
|
45
58
|
*
|
|
@@ -74,7 +87,7 @@ export default class WidgetApi {
|
|
|
74
87
|
/**
|
|
75
88
|
* Looks up the referral code of the current user, if there is any.
|
|
76
89
|
*
|
|
77
|
-
* @return {Promise<
|
|
90
|
+
* @return {Promise<ReferralCookie>} code referral code if true.
|
|
78
91
|
*/
|
|
79
|
-
squatchReferralCookie(): Promise<
|
|
92
|
+
squatchReferralCookie(): Promise<ReferralCookie>;
|
|
80
93
|
}
|
package/dist/squatch.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import PopupWidget from "./widgets/PopupWidget";
|
|
|
4
4
|
import CtaWidget from "./widgets/CtaWidget";
|
|
5
5
|
import WidgetApi from "./api/WidgetApi";
|
|
6
6
|
import EventsApi from "./api/EventsApi";
|
|
7
|
-
import { ConfigOptions
|
|
7
|
+
import { ConfigOptions } from "./types";
|
|
8
8
|
export * from "./types";
|
|
9
9
|
export * from "./docs";
|
|
10
10
|
export { Widgets, EmbedWidget, PopupWidget, CtaWidget, WidgetApi };
|
|
@@ -32,16 +32,6 @@ export declare function widgets(): Widgets | null;
|
|
|
32
32
|
* @returns EventsApi static instance
|
|
33
33
|
*/
|
|
34
34
|
export declare function events(): EventsApi | null;
|
|
35
|
-
/**
|
|
36
|
-
* Entry-point for high level API to render a widget using the instance of {@link Widgets} created when you call {@link #init init}.
|
|
37
|
-
*/
|
|
38
|
-
export declare function widget(widgetConfig: WidgetConfig): Promise<WidgetResult | undefined> | undefined;
|
|
39
|
-
/**
|
|
40
|
-
* Initial concept for automatic widget rendering
|
|
41
|
-
*
|
|
42
|
-
* - `saasquatchExtra` utm param carries widgetIdent
|
|
43
|
-
*/
|
|
44
|
-
export declare function auto(configIn: ConfigOptions): Promise<WidgetResult | undefined> | undefined;
|
|
45
35
|
/**
|
|
46
36
|
* Initializes the static `squatch` global. This sets up:
|
|
47
37
|
*
|
|
@@ -64,7 +54,7 @@ export declare function init(configIn: ConfigOptions): void;
|
|
|
64
54
|
* @example
|
|
65
55
|
* squatch.ready(function() {
|
|
66
56
|
* console.log("ready!");
|
|
67
|
-
* squatch.api().
|
|
57
|
+
* squatch.api().cookieUser();
|
|
68
58
|
* });
|
|
69
59
|
*/
|
|
70
60
|
export declare function ready(fn: () => any): void;
|