@builder.io/sdk-qwik 0.16.22 → 0.16.23
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/lib/browser/blocks/form/form/form.qwik.cjs +4 -1
- package/lib/browser/blocks/form/form/form.qwik.mjs +4 -1
- package/lib/browser/components/content/components/enable-editor.qwik.cjs +2 -0
- package/lib/browser/components/content/components/enable-editor.qwik.mjs +2 -0
- package/lib/browser/constants/sdk-version.qwik.cjs +1 -1
- package/lib/browser/constants/sdk-version.qwik.mjs +1 -1
- package/lib/browser/functions/log-fetch.qwik.cjs +11 -0
- package/lib/browser/functions/log-fetch.qwik.mjs +11 -0
- package/lib/browser/functions/track/index.qwik.cjs +4 -1
- package/lib/browser/functions/track/index.qwik.mjs +4 -1
- package/lib/edge/blocks/form/form/form.qwik.cjs +4 -1
- package/lib/edge/blocks/form/form/form.qwik.mjs +4 -1
- package/lib/edge/components/content/components/enable-editor.qwik.cjs +2 -0
- package/lib/edge/components/content/components/enable-editor.qwik.mjs +2 -0
- package/lib/edge/constants/sdk-version.qwik.cjs +1 -1
- package/lib/edge/constants/sdk-version.qwik.mjs +1 -1
- package/lib/edge/functions/log-fetch.qwik.cjs +11 -0
- package/lib/edge/functions/log-fetch.qwik.mjs +11 -0
- package/lib/edge/functions/track/index.qwik.cjs +4 -1
- package/lib/edge/functions/track/index.qwik.mjs +4 -1
- package/lib/node/blocks/form/form/form.qwik.cjs +4 -1
- package/lib/node/blocks/form/form/form.qwik.mjs +4 -1
- package/lib/node/components/content/components/enable-editor.qwik.cjs +2 -0
- package/lib/node/components/content/components/enable-editor.qwik.mjs +2 -0
- package/lib/node/constants/sdk-version.qwik.cjs +1 -1
- package/lib/node/constants/sdk-version.qwik.mjs +1 -1
- package/lib/node/functions/log-fetch.qwik.cjs +11 -0
- package/lib/node/functions/log-fetch.qwik.mjs +11 -0
- package/lib/node/functions/track/index.qwik.cjs +4 -1
- package/lib/node/functions/track/index.qwik.mjs +4 -1
- package/package.json +1 -1
- package/types/src/constants/sdk-version.d.ts +1 -1
- package/types/src/functions/log-fetch.d.ts +1 -0
|
@@ -6,6 +6,7 @@ const blocks = require("../../../components/blocks/blocks.qwik.cjs");
|
|
|
6
6
|
const getEnv = require("../../../functions/get-env.qwik.cjs");
|
|
7
7
|
const get = require("../../../functions/get.qwik.cjs");
|
|
8
8
|
const isEditing = require("../../../functions/is-editing.qwik.cjs");
|
|
9
|
+
const logFetch = require("../../../functions/log-fetch.qwik.cjs");
|
|
9
10
|
const set = require("../../../functions/set.qwik.cjs");
|
|
10
11
|
const mergeNewRootState = function mergeNewRootState2(props, state, formRef, newData) {
|
|
11
12
|
var _a, _b;
|
|
@@ -100,7 +101,9 @@ const onSubmit = function onSubmit2(props, state, formRef, event) {
|
|
|
100
101
|
}
|
|
101
102
|
state.formState = "sending";
|
|
102
103
|
const formUrl = `${getEnv.getEnv() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${props.builderContext.apiKey}&to=${btoa(props.sendSubmissionsToEmail || "")}&name=${encodeURIComponent(props.name || "")}`;
|
|
103
|
-
|
|
104
|
+
const url = props.sendSubmissionsTo === "email" ? formUrl : props.action;
|
|
105
|
+
logFetch.logFetch(url);
|
|
106
|
+
fetch(url, {
|
|
104
107
|
body,
|
|
105
108
|
headers,
|
|
106
109
|
method: props.method || "post"
|
|
@@ -4,6 +4,7 @@ import { Blocks } from "../../../components/blocks/blocks.qwik.mjs";
|
|
|
4
4
|
import { getEnv } from "../../../functions/get-env.qwik.mjs";
|
|
5
5
|
import { get } from "../../../functions/get.qwik.mjs";
|
|
6
6
|
import { isEditing } from "../../../functions/is-editing.qwik.mjs";
|
|
7
|
+
import { logFetch } from "../../../functions/log-fetch.qwik.mjs";
|
|
7
8
|
import { set } from "../../../functions/set.qwik.mjs";
|
|
8
9
|
const mergeNewRootState = function mergeNewRootState2(props, state, formRef, newData) {
|
|
9
10
|
var _a, _b;
|
|
@@ -98,7 +99,9 @@ const onSubmit = function onSubmit2(props, state, formRef, event) {
|
|
|
98
99
|
}
|
|
99
100
|
state.formState = "sending";
|
|
100
101
|
const formUrl = `${getEnv() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${props.builderContext.apiKey}&to=${btoa(props.sendSubmissionsToEmail || "")}&name=${encodeURIComponent(props.name || "")}`;
|
|
101
|
-
|
|
102
|
+
const url = props.sendSubmissionsTo === "email" ? formUrl : props.action;
|
|
103
|
+
logFetch(url);
|
|
104
|
+
fetch(url, {
|
|
102
105
|
body,
|
|
103
106
|
headers,
|
|
104
107
|
method: props.method || "post"
|
|
@@ -9,6 +9,7 @@ const index = require("../../../functions/get-content/index.qwik.cjs");
|
|
|
9
9
|
const isBrowser = require("../../../functions/is-browser.qwik.cjs");
|
|
10
10
|
const isEditing = require("../../../functions/is-editing.qwik.cjs");
|
|
11
11
|
const isPreviewing = require("../../../functions/is-previewing.qwik.cjs");
|
|
12
|
+
const logFetch = require("../../../functions/log-fetch.qwik.cjs");
|
|
12
13
|
const registerComponent = require("../../../functions/register-component.qwik.cjs");
|
|
13
14
|
const index$1 = require("../../../functions/track/index.qwik.cjs");
|
|
14
15
|
const interaction = require("../../../functions/track/interaction.qwik.cjs");
|
|
@@ -108,6 +109,7 @@ const runHttpRequests = function runHttpRequests2(props, state, showContentProps
|
|
|
108
109
|
rootState: props.builderContextSignal.rootState,
|
|
109
110
|
rootSetState: props.builderContextSignal.rootSetState
|
|
110
111
|
})));
|
|
112
|
+
logFetch.logFetch(evaluatedUrl);
|
|
111
113
|
fetch(evaluatedUrl).then((response) => response.json()).then((json) => {
|
|
112
114
|
mergeNewRootState(props, state, showContentProps, elementRef, {
|
|
113
115
|
[key]: json
|
|
@@ -7,6 +7,7 @@ import { fetchOneEntry } from "../../../functions/get-content/index.qwik.mjs";
|
|
|
7
7
|
import { isBrowser } from "../../../functions/is-browser.qwik.mjs";
|
|
8
8
|
import { isEditing } from "../../../functions/is-editing.qwik.mjs";
|
|
9
9
|
import { isPreviewing } from "../../../functions/is-previewing.qwik.mjs";
|
|
10
|
+
import { logFetch } from "../../../functions/log-fetch.qwik.mjs";
|
|
10
11
|
import { createRegisterComponentMessage } from "../../../functions/register-component.qwik.mjs";
|
|
11
12
|
import { _track } from "../../../functions/track/index.qwik.mjs";
|
|
12
13
|
import { getInteractionPropertiesForEvent } from "../../../functions/track/interaction.qwik.mjs";
|
|
@@ -106,6 +107,7 @@ const runHttpRequests = function runHttpRequests2(props, state, showContentProps
|
|
|
106
107
|
rootState: props.builderContextSignal.rootState,
|
|
107
108
|
rootSetState: props.builderContextSignal.rootSetState
|
|
108
109
|
})));
|
|
110
|
+
logFetch(evaluatedUrl);
|
|
109
111
|
fetch(evaluatedUrl).then((response) => response.json()).then((json) => {
|
|
110
112
|
mergeNewRootState(props, state, showContentProps, elementRef, {
|
|
111
113
|
[key]: json
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const logger = require("../helpers/logger.qwik.cjs");
|
|
4
|
+
function logFetch(url) {
|
|
5
|
+
var _a;
|
|
6
|
+
if (typeof process !== "undefined" && ((_a = process.env) == null ? void 0 : _a.DEBUG)) {
|
|
7
|
+
if (String(process.env.DEBUG) == "true")
|
|
8
|
+
logger.logger.log(url);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.logFetch = logFetch;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { logger } from "../helpers/logger.qwik.mjs";
|
|
2
|
+
function logFetch(url) {
|
|
3
|
+
var _a;
|
|
4
|
+
if (typeof process !== "undefined" && ((_a = process.env) == null ? void 0 : _a.DEBUG)) {
|
|
5
|
+
if (String(process.env.DEBUG) == "true")
|
|
6
|
+
logger.log(url);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
logFetch
|
|
11
|
+
};
|
|
@@ -7,6 +7,7 @@ const sessionId = require("../../helpers/sessionId.qwik.cjs");
|
|
|
7
7
|
const visitorId = require("../../helpers/visitorId.qwik.cjs");
|
|
8
8
|
const isBrowser = require("../is-browser.qwik.cjs");
|
|
9
9
|
const isEditing = require("../is-editing.qwik.cjs");
|
|
10
|
+
const logFetch = require("../log-fetch.qwik.cjs");
|
|
10
11
|
const helpers = require("./helpers.qwik.cjs");
|
|
11
12
|
const getTrackingEventData = async ({ canTrack }) => {
|
|
12
13
|
if (!canTrack)
|
|
@@ -52,7 +53,9 @@ async function _track({ apiHost, ...eventProps }) {
|
|
|
52
53
|
if (!(isBrowser.isBrowser() || target.TARGET === "reactNative"))
|
|
53
54
|
return;
|
|
54
55
|
const baseUrl = apiHost || "https://cdn.builder.io";
|
|
55
|
-
|
|
56
|
+
const url = `${baseUrl}/api/v1/track`;
|
|
57
|
+
logFetch.logFetch(url);
|
|
58
|
+
return fetch(url, {
|
|
56
59
|
method: "POST",
|
|
57
60
|
body: JSON.stringify({
|
|
58
61
|
events: [
|
|
@@ -5,6 +5,7 @@ import { getSessionId } from "../../helpers/sessionId.qwik.mjs";
|
|
|
5
5
|
import { getVisitorId } from "../../helpers/visitorId.qwik.mjs";
|
|
6
6
|
import { isBrowser } from "../is-browser.qwik.mjs";
|
|
7
7
|
import { isEditing } from "../is-editing.qwik.mjs";
|
|
8
|
+
import { logFetch } from "../log-fetch.qwik.mjs";
|
|
8
9
|
import { getUserAttributes } from "./helpers.qwik.mjs";
|
|
9
10
|
const getTrackingEventData = async ({ canTrack }) => {
|
|
10
11
|
if (!canTrack)
|
|
@@ -50,7 +51,9 @@ async function _track({ apiHost, ...eventProps }) {
|
|
|
50
51
|
if (!(isBrowser() || TARGET === "reactNative"))
|
|
51
52
|
return;
|
|
52
53
|
const baseUrl = apiHost || "https://cdn.builder.io";
|
|
53
|
-
|
|
54
|
+
const url = `${baseUrl}/api/v1/track`;
|
|
55
|
+
logFetch(url);
|
|
56
|
+
return fetch(url, {
|
|
54
57
|
method: "POST",
|
|
55
58
|
body: JSON.stringify({
|
|
56
59
|
events: [
|
|
@@ -6,6 +6,7 @@ const blocks = require("../../../components/blocks/blocks.qwik.cjs");
|
|
|
6
6
|
const getEnv = require("../../../functions/get-env.qwik.cjs");
|
|
7
7
|
const get = require("../../../functions/get.qwik.cjs");
|
|
8
8
|
const isEditing = require("../../../functions/is-editing.qwik.cjs");
|
|
9
|
+
const logFetch = require("../../../functions/log-fetch.qwik.cjs");
|
|
9
10
|
const set = require("../../../functions/set.qwik.cjs");
|
|
10
11
|
const mergeNewRootState = function mergeNewRootState2(props, state, formRef, newData) {
|
|
11
12
|
var _a, _b;
|
|
@@ -100,7 +101,9 @@ const onSubmit = function onSubmit2(props, state, formRef, event) {
|
|
|
100
101
|
}
|
|
101
102
|
state.formState = "sending";
|
|
102
103
|
const formUrl = `${getEnv.getEnv() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${props.builderContext.apiKey}&to=${btoa(props.sendSubmissionsToEmail || "")}&name=${encodeURIComponent(props.name || "")}`;
|
|
103
|
-
|
|
104
|
+
const url = props.sendSubmissionsTo === "email" ? formUrl : props.action;
|
|
105
|
+
logFetch.logFetch(url);
|
|
106
|
+
fetch(url, {
|
|
104
107
|
body,
|
|
105
108
|
headers,
|
|
106
109
|
method: props.method || "post"
|
|
@@ -4,6 +4,7 @@ import { Blocks } from "../../../components/blocks/blocks.qwik.mjs";
|
|
|
4
4
|
import { getEnv } from "../../../functions/get-env.qwik.mjs";
|
|
5
5
|
import { get } from "../../../functions/get.qwik.mjs";
|
|
6
6
|
import { isEditing } from "../../../functions/is-editing.qwik.mjs";
|
|
7
|
+
import { logFetch } from "../../../functions/log-fetch.qwik.mjs";
|
|
7
8
|
import { set } from "../../../functions/set.qwik.mjs";
|
|
8
9
|
const mergeNewRootState = function mergeNewRootState2(props, state, formRef, newData) {
|
|
9
10
|
var _a, _b;
|
|
@@ -98,7 +99,9 @@ const onSubmit = function onSubmit2(props, state, formRef, event) {
|
|
|
98
99
|
}
|
|
99
100
|
state.formState = "sending";
|
|
100
101
|
const formUrl = `${getEnv() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${props.builderContext.apiKey}&to=${btoa(props.sendSubmissionsToEmail || "")}&name=${encodeURIComponent(props.name || "")}`;
|
|
101
|
-
|
|
102
|
+
const url = props.sendSubmissionsTo === "email" ? formUrl : props.action;
|
|
103
|
+
logFetch(url);
|
|
104
|
+
fetch(url, {
|
|
102
105
|
body,
|
|
103
106
|
headers,
|
|
104
107
|
method: props.method || "post"
|
|
@@ -9,6 +9,7 @@ const index = require("../../../functions/get-content/index.qwik.cjs");
|
|
|
9
9
|
const isBrowser = require("../../../functions/is-browser.qwik.cjs");
|
|
10
10
|
const isEditing = require("../../../functions/is-editing.qwik.cjs");
|
|
11
11
|
const isPreviewing = require("../../../functions/is-previewing.qwik.cjs");
|
|
12
|
+
const logFetch = require("../../../functions/log-fetch.qwik.cjs");
|
|
12
13
|
const registerComponent = require("../../../functions/register-component.qwik.cjs");
|
|
13
14
|
const index$1 = require("../../../functions/track/index.qwik.cjs");
|
|
14
15
|
const interaction = require("../../../functions/track/interaction.qwik.cjs");
|
|
@@ -108,6 +109,7 @@ const runHttpRequests = function runHttpRequests2(props, state, showContentProps
|
|
|
108
109
|
rootState: props.builderContextSignal.rootState,
|
|
109
110
|
rootSetState: props.builderContextSignal.rootSetState
|
|
110
111
|
})));
|
|
112
|
+
logFetch.logFetch(evaluatedUrl);
|
|
111
113
|
fetch(evaluatedUrl).then((response) => response.json()).then((json) => {
|
|
112
114
|
mergeNewRootState(props, state, showContentProps, elementRef, {
|
|
113
115
|
[key]: json
|
|
@@ -7,6 +7,7 @@ import { fetchOneEntry } from "../../../functions/get-content/index.qwik.mjs";
|
|
|
7
7
|
import { isBrowser } from "../../../functions/is-browser.qwik.mjs";
|
|
8
8
|
import { isEditing } from "../../../functions/is-editing.qwik.mjs";
|
|
9
9
|
import { isPreviewing } from "../../../functions/is-previewing.qwik.mjs";
|
|
10
|
+
import { logFetch } from "../../../functions/log-fetch.qwik.mjs";
|
|
10
11
|
import { createRegisterComponentMessage } from "../../../functions/register-component.qwik.mjs";
|
|
11
12
|
import { _track } from "../../../functions/track/index.qwik.mjs";
|
|
12
13
|
import { getInteractionPropertiesForEvent } from "../../../functions/track/interaction.qwik.mjs";
|
|
@@ -106,6 +107,7 @@ const runHttpRequests = function runHttpRequests2(props, state, showContentProps
|
|
|
106
107
|
rootState: props.builderContextSignal.rootState,
|
|
107
108
|
rootSetState: props.builderContextSignal.rootSetState
|
|
108
109
|
})));
|
|
110
|
+
logFetch(evaluatedUrl);
|
|
109
111
|
fetch(evaluatedUrl).then((response) => response.json()).then((json) => {
|
|
110
112
|
mergeNewRootState(props, state, showContentProps, elementRef, {
|
|
111
113
|
[key]: json
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const logger = require("../helpers/logger.qwik.cjs");
|
|
4
|
+
function logFetch(url) {
|
|
5
|
+
var _a;
|
|
6
|
+
if (typeof process !== "undefined" && ((_a = process.env) == null ? void 0 : _a.DEBUG)) {
|
|
7
|
+
if (String(process.env.DEBUG) == "true")
|
|
8
|
+
logger.logger.log(url);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.logFetch = logFetch;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { logger } from "../helpers/logger.qwik.mjs";
|
|
2
|
+
function logFetch(url) {
|
|
3
|
+
var _a;
|
|
4
|
+
if (typeof process !== "undefined" && ((_a = process.env) == null ? void 0 : _a.DEBUG)) {
|
|
5
|
+
if (String(process.env.DEBUG) == "true")
|
|
6
|
+
logger.log(url);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
logFetch
|
|
11
|
+
};
|
|
@@ -7,6 +7,7 @@ const sessionId = require("../../helpers/sessionId.qwik.cjs");
|
|
|
7
7
|
const visitorId = require("../../helpers/visitorId.qwik.cjs");
|
|
8
8
|
const isBrowser = require("../is-browser.qwik.cjs");
|
|
9
9
|
const isEditing = require("../is-editing.qwik.cjs");
|
|
10
|
+
const logFetch = require("../log-fetch.qwik.cjs");
|
|
10
11
|
const helpers = require("./helpers.qwik.cjs");
|
|
11
12
|
const getTrackingEventData = async ({ canTrack }) => {
|
|
12
13
|
if (!canTrack)
|
|
@@ -52,7 +53,9 @@ async function _track({ apiHost, ...eventProps }) {
|
|
|
52
53
|
if (!(isBrowser.isBrowser() || target.TARGET === "reactNative"))
|
|
53
54
|
return;
|
|
54
55
|
const baseUrl = apiHost || "https://cdn.builder.io";
|
|
55
|
-
|
|
56
|
+
const url = `${baseUrl}/api/v1/track`;
|
|
57
|
+
logFetch.logFetch(url);
|
|
58
|
+
return fetch(url, {
|
|
56
59
|
method: "POST",
|
|
57
60
|
body: JSON.stringify({
|
|
58
61
|
events: [
|
|
@@ -5,6 +5,7 @@ import { getSessionId } from "../../helpers/sessionId.qwik.mjs";
|
|
|
5
5
|
import { getVisitorId } from "../../helpers/visitorId.qwik.mjs";
|
|
6
6
|
import { isBrowser } from "../is-browser.qwik.mjs";
|
|
7
7
|
import { isEditing } from "../is-editing.qwik.mjs";
|
|
8
|
+
import { logFetch } from "../log-fetch.qwik.mjs";
|
|
8
9
|
import { getUserAttributes } from "./helpers.qwik.mjs";
|
|
9
10
|
const getTrackingEventData = async ({ canTrack }) => {
|
|
10
11
|
if (!canTrack)
|
|
@@ -50,7 +51,9 @@ async function _track({ apiHost, ...eventProps }) {
|
|
|
50
51
|
if (!(isBrowser() || TARGET === "reactNative"))
|
|
51
52
|
return;
|
|
52
53
|
const baseUrl = apiHost || "https://cdn.builder.io";
|
|
53
|
-
|
|
54
|
+
const url = `${baseUrl}/api/v1/track`;
|
|
55
|
+
logFetch(url);
|
|
56
|
+
return fetch(url, {
|
|
54
57
|
method: "POST",
|
|
55
58
|
body: JSON.stringify({
|
|
56
59
|
events: [
|
|
@@ -6,6 +6,7 @@ const blocks = require("../../../components/blocks/blocks.qwik.cjs");
|
|
|
6
6
|
const getEnv = require("../../../functions/get-env.qwik.cjs");
|
|
7
7
|
const get = require("../../../functions/get.qwik.cjs");
|
|
8
8
|
const isEditing = require("../../../functions/is-editing.qwik.cjs");
|
|
9
|
+
const logFetch = require("../../../functions/log-fetch.qwik.cjs");
|
|
9
10
|
const set = require("../../../functions/set.qwik.cjs");
|
|
10
11
|
const mergeNewRootState = function mergeNewRootState2(props, state, formRef, newData) {
|
|
11
12
|
var _a, _b;
|
|
@@ -100,7 +101,9 @@ const onSubmit = function onSubmit2(props, state, formRef, event) {
|
|
|
100
101
|
}
|
|
101
102
|
state.formState = "sending";
|
|
102
103
|
const formUrl = `${getEnv.getEnv() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${props.builderContext.apiKey}&to=${btoa(props.sendSubmissionsToEmail || "")}&name=${encodeURIComponent(props.name || "")}`;
|
|
103
|
-
|
|
104
|
+
const url = props.sendSubmissionsTo === "email" ? formUrl : props.action;
|
|
105
|
+
logFetch.logFetch(url);
|
|
106
|
+
fetch(url, {
|
|
104
107
|
body,
|
|
105
108
|
headers,
|
|
106
109
|
method: props.method || "post"
|
|
@@ -4,6 +4,7 @@ import { Blocks } from "../../../components/blocks/blocks.qwik.mjs";
|
|
|
4
4
|
import { getEnv } from "../../../functions/get-env.qwik.mjs";
|
|
5
5
|
import { get } from "../../../functions/get.qwik.mjs";
|
|
6
6
|
import { isEditing } from "../../../functions/is-editing.qwik.mjs";
|
|
7
|
+
import { logFetch } from "../../../functions/log-fetch.qwik.mjs";
|
|
7
8
|
import { set } from "../../../functions/set.qwik.mjs";
|
|
8
9
|
const mergeNewRootState = function mergeNewRootState2(props, state, formRef, newData) {
|
|
9
10
|
var _a, _b;
|
|
@@ -98,7 +99,9 @@ const onSubmit = function onSubmit2(props, state, formRef, event) {
|
|
|
98
99
|
}
|
|
99
100
|
state.formState = "sending";
|
|
100
101
|
const formUrl = `${getEnv() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${props.builderContext.apiKey}&to=${btoa(props.sendSubmissionsToEmail || "")}&name=${encodeURIComponent(props.name || "")}`;
|
|
101
|
-
|
|
102
|
+
const url = props.sendSubmissionsTo === "email" ? formUrl : props.action;
|
|
103
|
+
logFetch(url);
|
|
104
|
+
fetch(url, {
|
|
102
105
|
body,
|
|
103
106
|
headers,
|
|
104
107
|
method: props.method || "post"
|
|
@@ -9,6 +9,7 @@ const index = require("../../../functions/get-content/index.qwik.cjs");
|
|
|
9
9
|
const isBrowser = require("../../../functions/is-browser.qwik.cjs");
|
|
10
10
|
const isEditing = require("../../../functions/is-editing.qwik.cjs");
|
|
11
11
|
const isPreviewing = require("../../../functions/is-previewing.qwik.cjs");
|
|
12
|
+
const logFetch = require("../../../functions/log-fetch.qwik.cjs");
|
|
12
13
|
const registerComponent = require("../../../functions/register-component.qwik.cjs");
|
|
13
14
|
const index$1 = require("../../../functions/track/index.qwik.cjs");
|
|
14
15
|
const interaction = require("../../../functions/track/interaction.qwik.cjs");
|
|
@@ -108,6 +109,7 @@ const runHttpRequests = function runHttpRequests2(props, state, showContentProps
|
|
|
108
109
|
rootState: props.builderContextSignal.rootState,
|
|
109
110
|
rootSetState: props.builderContextSignal.rootSetState
|
|
110
111
|
})));
|
|
112
|
+
logFetch.logFetch(evaluatedUrl);
|
|
111
113
|
fetch(evaluatedUrl).then((response) => response.json()).then((json) => {
|
|
112
114
|
mergeNewRootState(props, state, showContentProps, elementRef, {
|
|
113
115
|
[key]: json
|
|
@@ -7,6 +7,7 @@ import { fetchOneEntry } from "../../../functions/get-content/index.qwik.mjs";
|
|
|
7
7
|
import { isBrowser } from "../../../functions/is-browser.qwik.mjs";
|
|
8
8
|
import { isEditing } from "../../../functions/is-editing.qwik.mjs";
|
|
9
9
|
import { isPreviewing } from "../../../functions/is-previewing.qwik.mjs";
|
|
10
|
+
import { logFetch } from "../../../functions/log-fetch.qwik.mjs";
|
|
10
11
|
import { createRegisterComponentMessage } from "../../../functions/register-component.qwik.mjs";
|
|
11
12
|
import { _track } from "../../../functions/track/index.qwik.mjs";
|
|
12
13
|
import { getInteractionPropertiesForEvent } from "../../../functions/track/interaction.qwik.mjs";
|
|
@@ -106,6 +107,7 @@ const runHttpRequests = function runHttpRequests2(props, state, showContentProps
|
|
|
106
107
|
rootState: props.builderContextSignal.rootState,
|
|
107
108
|
rootSetState: props.builderContextSignal.rootSetState
|
|
108
109
|
})));
|
|
110
|
+
logFetch(evaluatedUrl);
|
|
109
111
|
fetch(evaluatedUrl).then((response) => response.json()).then((json) => {
|
|
110
112
|
mergeNewRootState(props, state, showContentProps, elementRef, {
|
|
111
113
|
[key]: json
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const logger = require("../helpers/logger.qwik.cjs");
|
|
4
|
+
function logFetch(url) {
|
|
5
|
+
var _a;
|
|
6
|
+
if (typeof process !== "undefined" && ((_a = process.env) == null ? void 0 : _a.DEBUG)) {
|
|
7
|
+
if (String(process.env.DEBUG) == "true")
|
|
8
|
+
logger.logger.log(url);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.logFetch = logFetch;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { logger } from "../helpers/logger.qwik.mjs";
|
|
2
|
+
function logFetch(url) {
|
|
3
|
+
var _a;
|
|
4
|
+
if (typeof process !== "undefined" && ((_a = process.env) == null ? void 0 : _a.DEBUG)) {
|
|
5
|
+
if (String(process.env.DEBUG) == "true")
|
|
6
|
+
logger.log(url);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
logFetch
|
|
11
|
+
};
|
|
@@ -7,6 +7,7 @@ const sessionId = require("../../helpers/sessionId.qwik.cjs");
|
|
|
7
7
|
const visitorId = require("../../helpers/visitorId.qwik.cjs");
|
|
8
8
|
const isBrowser = require("../is-browser.qwik.cjs");
|
|
9
9
|
const isEditing = require("../is-editing.qwik.cjs");
|
|
10
|
+
const logFetch = require("../log-fetch.qwik.cjs");
|
|
10
11
|
const helpers = require("./helpers.qwik.cjs");
|
|
11
12
|
const getTrackingEventData = async ({ canTrack }) => {
|
|
12
13
|
if (!canTrack)
|
|
@@ -52,7 +53,9 @@ async function _track({ apiHost, ...eventProps }) {
|
|
|
52
53
|
if (!(isBrowser.isBrowser() || target.TARGET === "reactNative"))
|
|
53
54
|
return;
|
|
54
55
|
const baseUrl = apiHost || "https://cdn.builder.io";
|
|
55
|
-
|
|
56
|
+
const url = `${baseUrl}/api/v1/track`;
|
|
57
|
+
logFetch.logFetch(url);
|
|
58
|
+
return fetch(url, {
|
|
56
59
|
method: "POST",
|
|
57
60
|
body: JSON.stringify({
|
|
58
61
|
events: [
|
|
@@ -5,6 +5,7 @@ import { getSessionId } from "../../helpers/sessionId.qwik.mjs";
|
|
|
5
5
|
import { getVisitorId } from "../../helpers/visitorId.qwik.mjs";
|
|
6
6
|
import { isBrowser } from "../is-browser.qwik.mjs";
|
|
7
7
|
import { isEditing } from "../is-editing.qwik.mjs";
|
|
8
|
+
import { logFetch } from "../log-fetch.qwik.mjs";
|
|
8
9
|
import { getUserAttributes } from "./helpers.qwik.mjs";
|
|
9
10
|
const getTrackingEventData = async ({ canTrack }) => {
|
|
10
11
|
if (!canTrack)
|
|
@@ -50,7 +51,9 @@ async function _track({ apiHost, ...eventProps }) {
|
|
|
50
51
|
if (!(isBrowser() || TARGET === "reactNative"))
|
|
51
52
|
return;
|
|
52
53
|
const baseUrl = apiHost || "https://cdn.builder.io";
|
|
53
|
-
|
|
54
|
+
const url = `${baseUrl}/api/v1/track`;
|
|
55
|
+
logFetch(url);
|
|
56
|
+
return fetch(url, {
|
|
54
57
|
method: "POST",
|
|
55
58
|
body: JSON.stringify({
|
|
56
59
|
events: [
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.16.
|
|
1
|
+
export declare const SDK_VERSION = "0.16.23";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function logFetch(url: string): void;
|