@shware/analytics 3.8.1 → 3.8.2
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/dist/schema/index.cjs +32 -0
- package/dist/schema/index.cjs.map +1 -1
- package/dist/schema/index.d.cts +130 -1
- package/dist/schema/index.d.cts.map +1 -1
- package/dist/schema/index.d.mts +130 -1
- package/dist/schema/index.d.mts.map +1 -1
- package/dist/schema/index.mjs +33 -2
- package/dist/schema/index.mjs.map +1 -1
- package/dist/third-parties/google-analytics.cjs +2 -2
- package/dist/third-parties/google-analytics.cjs.map +1 -1
- package/dist/third-parties/google-analytics.d.cts +2 -2
- package/dist/third-parties/google-analytics.d.cts.map +1 -1
- package/dist/third-parties/google-analytics.d.mts +2 -2
- package/dist/third-parties/google-analytics.d.mts.map +1 -1
- package/dist/third-parties/google-analytics.mjs +2 -2
- package/dist/third-parties/google-analytics.mjs.map +1 -1
- package/dist/third-parties/linkedin-insight-tag.cjs +2 -2
- package/dist/third-parties/linkedin-insight-tag.cjs.map +1 -1
- package/dist/third-parties/linkedin-insight-tag.d.cts +2 -2
- package/dist/third-parties/linkedin-insight-tag.d.cts.map +1 -1
- package/dist/third-parties/linkedin-insight-tag.d.mts +2 -2
- package/dist/third-parties/linkedin-insight-tag.d.mts.map +1 -1
- package/dist/third-parties/linkedin-insight-tag.mjs +2 -2
- package/dist/third-parties/linkedin-insight-tag.mjs.map +1 -1
- package/dist/third-parties/meta-pixel.cjs +4 -4
- package/dist/third-parties/meta-pixel.cjs.map +1 -1
- package/dist/third-parties/meta-pixel.d.cts +2 -2
- package/dist/third-parties/meta-pixel.d.cts.map +1 -1
- package/dist/third-parties/meta-pixel.d.mts +2 -2
- package/dist/third-parties/meta-pixel.d.mts.map +1 -1
- package/dist/third-parties/meta-pixel.mjs +4 -4
- package/dist/third-parties/meta-pixel.mjs.map +1 -1
- package/dist/third-parties/openai-pixel.cjs +3 -3
- package/dist/third-parties/openai-pixel.cjs.map +1 -1
- package/dist/third-parties/openai-pixel.d.cts +2 -2
- package/dist/third-parties/openai-pixel.d.cts.map +1 -1
- package/dist/third-parties/openai-pixel.d.mts +2 -2
- package/dist/third-parties/openai-pixel.d.mts.map +1 -1
- package/dist/third-parties/openai-pixel.mjs +3 -3
- package/dist/third-parties/openai-pixel.mjs.map +1 -1
- package/dist/third-parties/posthog.cjs +2 -2
- package/dist/third-parties/posthog.cjs.map +1 -1
- package/dist/third-parties/posthog.d.cts +2 -2
- package/dist/third-parties/posthog.d.cts.map +1 -1
- package/dist/third-parties/posthog.d.mts +2 -2
- package/dist/third-parties/posthog.d.mts.map +1 -1
- package/dist/third-parties/posthog.mjs +2 -2
- package/dist/third-parties/posthog.mjs.map +1 -1
- package/dist/third-parties/reddit-pixel.cjs +3 -3
- package/dist/third-parties/reddit-pixel.cjs.map +1 -1
- package/dist/third-parties/reddit-pixel.d.cts +2 -2
- package/dist/third-parties/reddit-pixel.d.cts.map +1 -1
- package/dist/third-parties/reddit-pixel.d.mts +2 -2
- package/dist/third-parties/reddit-pixel.d.mts.map +1 -1
- package/dist/third-parties/reddit-pixel.mjs +3 -3
- package/dist/third-parties/reddit-pixel.mjs.map +1 -1
- package/dist/visitor/index.cjs +6 -5
- package/dist/visitor/index.cjs.map +1 -1
- package/dist/visitor/index.d.cts +3 -2
- package/dist/visitor/index.d.cts.map +1 -1
- package/dist/visitor/index.d.mts +3 -2
- package/dist/visitor/index.d.mts.map +1 -1
- package/dist/visitor/index.mjs +6 -5
- package/dist/visitor/index.mjs.map +1 -1
- package/dist/visitor/types.d.cts +2 -8
- package/dist/visitor/types.d.cts.map +1 -1
- package/dist/visitor/types.d.mts +2 -8
- package/dist/visitor/types.d.mts.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reddit-pixel.mjs","names":[],"sources":["../../src/third-parties/reddit-pixel.ts"],"sourcesContent":["import { type PixelId, type RDT, mapRDTEvent } from '../track/rdt';\nimport type { EventName, TrackName, TrackProperties } from '../track/types';\nimport { getFirst } from '../utils/field';\
|
|
1
|
+
{"version":3,"file":"reddit-pixel.mjs","names":[],"sources":["../../src/third-parties/reddit-pixel.ts"],"sourcesContent":["import type { UpdateVisitorDTO } from '../schema/index';\nimport { type PixelId, type RDT, mapRDTEvent } from '../track/rdt';\nimport type { EventName, TrackName, TrackProperties } from '../track/types';\nimport { getFirst } from '../utils/field';\n\ndeclare global {\n // oxlint-disable-next-line typescript/no-empty-object-type\n interface Window extends RDT {}\n}\n\nconst metrics = ['CLS', 'FCP', 'FID', 'INP', 'LCP', 'TTFB'];\n\nexport function sendRedditEvent<T extends EventName>(\n name: TrackName<T>,\n properties?: TrackProperties<T>,\n eventId?: string\n) {\n if (typeof window === 'undefined' || !window.rdt) {\n console.warn('rdt has not been initialized');\n return;\n }\n if (metrics.includes(name)) return;\n if (window.location.host.includes('127.0.0.1')) return;\n if (window.location.host.includes('localhost')) return;\n\n const [type, params] = mapRDTEvent(name, properties, eventId);\n if (type === 'Custom') {\n window.rdt('track', type, JSON.parse(JSON.stringify(params)));\n } else {\n window.rdt('track', type, JSON.parse(JSON.stringify(params)));\n }\n}\n\nexport function setRedditUser(pixelId: PixelId) {\n return ({ user_id, user_data }: UpdateVisitorDTO) => {\n if (!window.rdt) {\n console.warn('rdt has not been initialized');\n return;\n }\n\n window.rdt('init', pixelId, {\n email: getFirst(user_data?.email),\n phoneNumber: getFirst(user_data?.phone_number),\n externalId: user_id,\n });\n };\n}\n"],"mappings":";;;AAUA,MAAM,UAAU;CAAC;CAAO;CAAO;CAAO;CAAO;CAAO;AAAM;AAE1D,SAAgB,gBACd,MACA,YACA,SACA;CACA,IAAI,OAAO,WAAW,eAAe,CAAC,OAAO,KAAK;EAChD,QAAQ,KAAK,8BAA8B;EAC3C;CACF;CACA,IAAI,QAAQ,SAAS,IAAI,GAAG;CAC5B,IAAI,OAAO,SAAS,KAAK,SAAS,WAAW,GAAG;CAChD,IAAI,OAAO,SAAS,KAAK,SAAS,WAAW,GAAG;CAEhD,MAAM,CAAC,MAAM,UAAU,YAAY,MAAM,YAAY,OAAO;CAC5D,IAAI,SAAS,UACX,OAAO,IAAI,SAAS,MAAM,KAAK,MAAM,KAAK,UAAU,MAAM,CAAC,CAAC;MAE5D,OAAO,IAAI,SAAS,MAAM,KAAK,MAAM,KAAK,UAAU,MAAM,CAAC,CAAC;AAEhE;AAEA,SAAgB,cAAc,SAAkB;CAC9C,QAAQ,EAAE,SAAS,gBAAkC;EACnD,IAAI,CAAC,OAAO,KAAK;GACf,QAAQ,KAAK,8BAA8B;GAC3C;EACF;EAEA,OAAO,IAAI,QAAQ,SAAS;GAC1B,OAAO,SAAS,WAAW,KAAK;GAChC,aAAa,SAAS,WAAW,YAAY;GAC7C,YAAY;EACd,CAAC;CACH;AACF"}
|
package/dist/visitor/index.cjs
CHANGED
|
@@ -47,18 +47,19 @@ async function getVisitor() {
|
|
|
47
47
|
async function setVisitor(dto) {
|
|
48
48
|
const { id } = await getVisitor();
|
|
49
49
|
const tags = await require_setup_index.config.getTags();
|
|
50
|
+
const body = {
|
|
51
|
+
...dto,
|
|
52
|
+
tags
|
|
53
|
+
};
|
|
50
54
|
const response = await (0, _shware_utils.fetch)(`${require_setup_index.config.endpoint}/visitors/${id}`, {
|
|
51
55
|
method: "PATCH",
|
|
52
56
|
credentials: "include",
|
|
53
57
|
headers: await require_setup_index.config.getHeaders(),
|
|
54
|
-
body: JSON.stringify(
|
|
55
|
-
...dto,
|
|
56
|
-
tags
|
|
57
|
-
})
|
|
58
|
+
body: JSON.stringify(body)
|
|
58
59
|
});
|
|
59
60
|
if (!response.ok) throw new Error("Failed to set visitor");
|
|
60
61
|
const data = await response.json();
|
|
61
|
-
require_setup_index.config.thirdPartyUserSetters.forEach((setter) => setter(
|
|
62
|
+
require_setup_index.config.thirdPartyUserSetters.forEach((setter) => setter(body));
|
|
62
63
|
require_setup_index.cache.visitor = data;
|
|
63
64
|
return data;
|
|
64
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["config","keys","cache"],"sources":["../../src/visitor/index.ts"],"sourcesContent":["import { fetch } from '@shware/utils';\nimport { keys } from '../constants/storage';\nimport type { CreateVisitorDTO } from '../schema/index';\nimport { cache, config } from '../setup/index';\nimport type {
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["config","keys","cache"],"sources":["../../src/visitor/index.ts"],"sourcesContent":["import { fetch } from '@shware/utils';\nimport { keys } from '../constants/storage';\nimport type { CreateVisitorDTO, UpdateVisitorDTO } from '../schema/index';\nimport { cache, config } from '../setup/index';\nimport type { Visitor, VisitorProperties } from './types';\n\nasync function createVisitor(): Promise<Visitor> {\n const tags = await config.getTags();\n const dto: CreateVisitorDTO = {\n device_id: await config.getDeviceId(),\n platform: config.platform,\n environment: config.environment,\n tags,\n properties: tags as VisitorProperties,\n };\n\n const response = await fetch(`${config.endpoint}/visitors`, {\n method: 'POST',\n credentials: 'include',\n headers: await config.getHeaders(),\n body: JSON.stringify(dto),\n });\n\n const data = (await response.json()) as Visitor;\n if (data.id) {\n config.storage.setItem(keys.visitor_id, data.id);\n }\n return data;\n}\n\nasync function getOrCreateVisitor(): Promise<Visitor> {\n const visitorId = config.storage.getItem(keys.visitor_id);\n if (visitorId && visitorId !== 'undefined') {\n const response = await fetch(`${config.endpoint}/visitors/${visitorId}`, {\n method: 'GET',\n credentials: 'include',\n headers: await config.getHeaders(),\n });\n\n if (!response.ok) return createVisitor();\n const data = (await response.json()) as Visitor;\n\n // The legacy system used int64 ids (SnowflakeId); the new system switched to UUID_v7. The GET\n // endpoint accepts both, and querying with a legacy id returns the new UUID_v7,\n // so we write it back here to refresh the stored id for a smooth migration.\n if (data.id) {\n config.storage.setItem(keys.visitor_id, data.id);\n }\n return data;\n } else {\n return createVisitor();\n }\n}\n\nlet visitorFetcher: Promise<Visitor> | null = null;\n\nexport async function getVisitor(): Promise<Visitor> {\n if (cache.visitor) return cache.visitor;\n if (visitorFetcher) return visitorFetcher;\n visitorFetcher = getOrCreateVisitor();\n cache.visitor = await visitorFetcher;\n visitorFetcher = null;\n return cache.visitor;\n}\n\nexport async function setVisitor(dto: Omit<UpdateVisitorDTO, 'tags'>) {\n const { id } = await getVisitor();\n const tags = await config.getTags();\n const body: UpdateVisitorDTO = { ...dto, tags };\n const response = await fetch(`${config.endpoint}/visitors/${id}`, {\n method: 'PATCH',\n credentials: 'include',\n headers: await config.getHeaders(),\n body: JSON.stringify(body),\n });\n\n if (!response.ok) throw new Error('Failed to set visitor');\n const data = (await response.json()) as Visitor;\n\n config.thirdPartyUserSetters.forEach((setter) => setter(body));\n cache.visitor = data;\n return data;\n}\n"],"mappings":";;;;;AAMA,eAAe,gBAAkC;CAC/C,MAAM,OAAO,MAAMA,oBAAAA,OAAO,QAAQ;CAClC,MAAM,MAAwB;EAC5B,WAAW,MAAMA,oBAAAA,OAAO,YAAY;EACpC,UAAUA,oBAAAA,OAAO;EACjB,aAAaA,oBAAAA,OAAO;EACpB;EACA,YAAY;CACd;CASA,MAAM,OAAQ,OAAM,OAAA,GAAA,cAAA,MAAA,CAPS,GAAGA,oBAAAA,OAAO,SAAS,YAAY;EAC1D,QAAQ;EACR,aAAa;EACb,SAAS,MAAMA,oBAAAA,OAAO,WAAW;EACjC,MAAM,KAAK,UAAU,GAAG;CAC1B,CAAC,EAAA,CAE4B,KAAK;CAClC,IAAI,KAAK,IACP,oBAAA,OAAO,QAAQ,QAAQC,0BAAAA,KAAK,YAAY,KAAK,EAAE;CAEjD,OAAO;AACT;AAEA,eAAe,qBAAuC;CACpD,MAAM,YAAYD,oBAAAA,OAAO,QAAQ,QAAQC,0BAAAA,KAAK,UAAU;CACxD,IAAI,aAAa,cAAc,aAAa;EAC1C,MAAM,WAAW,OAAA,GAAA,cAAA,MAAA,CAAY,GAAGD,oBAAAA,OAAO,SAAS,YAAY,aAAa;GACvE,QAAQ;GACR,aAAa;GACb,SAAS,MAAMA,oBAAAA,OAAO,WAAW;EACnC,CAAC;EAED,IAAI,CAAC,SAAS,IAAI,OAAO,cAAc;EACvC,MAAM,OAAQ,MAAM,SAAS,KAAK;EAKlC,IAAI,KAAK,IACP,oBAAA,OAAO,QAAQ,QAAQC,0BAAAA,KAAK,YAAY,KAAK,EAAE;EAEjD,OAAO;CACT,OACE,OAAO,cAAc;AAEzB;AAEA,IAAI,iBAA0C;AAE9C,eAAsB,aAA+B;CACnD,IAAIC,oBAAAA,MAAM,SAAS,OAAOA,oBAAAA,MAAM;CAChC,IAAI,gBAAgB,OAAO;CAC3B,iBAAiB,mBAAmB;CACpC,oBAAA,MAAM,UAAU,MAAM;CACtB,iBAAiB;CACjB,OAAOA,oBAAAA,MAAM;AACf;AAEA,eAAsB,WAAW,KAAqC;CACpE,MAAM,EAAE,OAAO,MAAM,WAAW;CAChC,MAAM,OAAO,MAAMF,oBAAAA,OAAO,QAAQ;CAClC,MAAM,OAAyB;EAAE,GAAG;EAAK;CAAK;CAC9C,MAAM,WAAW,OAAA,GAAA,cAAA,MAAA,CAAY,GAAGA,oBAAAA,OAAO,SAAS,YAAY,MAAM;EAChE,QAAQ;EACR,aAAa;EACb,SAAS,MAAMA,oBAAAA,OAAO,WAAW;EACjC,MAAM,KAAK,UAAU,IAAI;CAC3B,CAAC;CAED,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,MAAM,uBAAuB;CACzD,MAAM,OAAQ,MAAM,SAAS,KAAK;CAElC,oBAAA,OAAO,sBAAsB,SAAS,WAAW,OAAO,IAAI,CAAC;CAC7D,oBAAA,MAAM,UAAU;CAChB,OAAO;AACT"}
|
package/dist/visitor/index.d.cts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { UpdateVisitorDTO
|
|
1
|
+
import { UpdateVisitorDTO } from "../schema/index.cjs";
|
|
2
|
+
import { Visitor } from "./types.cjs";
|
|
2
3
|
//#region src/visitor/index.d.ts
|
|
3
4
|
declare function getVisitor(): Promise<Visitor>;
|
|
4
|
-
declare function setVisitor(dto: UpdateVisitorDTO): Promise<Visitor>;
|
|
5
|
+
declare function setVisitor(dto: Omit<UpdateVisitorDTO, 'tags'>): Promise<Visitor>;
|
|
5
6
|
//#endregion
|
|
6
7
|
export { getVisitor, setVisitor };
|
|
7
8
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/visitor/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/visitor/index.ts"],"mappings":";;;iBAwDsB,cAAc,QAAQ;iBAStB,WAAW,KAAK,KAAK,4BAAyB,QAAA"}
|
package/dist/visitor/index.d.mts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { UpdateVisitorDTO
|
|
1
|
+
import { UpdateVisitorDTO } from "../schema/index.mjs";
|
|
2
|
+
import { Visitor } from "./types.mjs";
|
|
2
3
|
//#region src/visitor/index.d.ts
|
|
3
4
|
declare function getVisitor(): Promise<Visitor>;
|
|
4
|
-
declare function setVisitor(dto: UpdateVisitorDTO): Promise<Visitor>;
|
|
5
|
+
declare function setVisitor(dto: Omit<UpdateVisitorDTO, 'tags'>): Promise<Visitor>;
|
|
5
6
|
//#endregion
|
|
6
7
|
export { getVisitor, setVisitor };
|
|
7
8
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/visitor/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/visitor/index.ts"],"mappings":";;;iBAwDsB,cAAc,QAAQ;iBAStB,WAAW,KAAK,KAAK,4BAAyB,QAAA"}
|
package/dist/visitor/index.mjs
CHANGED
|
@@ -46,18 +46,19 @@ async function getVisitor() {
|
|
|
46
46
|
async function setVisitor(dto) {
|
|
47
47
|
const { id } = await getVisitor();
|
|
48
48
|
const tags = await config.getTags();
|
|
49
|
+
const body = {
|
|
50
|
+
...dto,
|
|
51
|
+
tags
|
|
52
|
+
};
|
|
49
53
|
const response = await fetch(`${config.endpoint}/visitors/${id}`, {
|
|
50
54
|
method: "PATCH",
|
|
51
55
|
credentials: "include",
|
|
52
56
|
headers: await config.getHeaders(),
|
|
53
|
-
body: JSON.stringify(
|
|
54
|
-
...dto,
|
|
55
|
-
tags
|
|
56
|
-
})
|
|
57
|
+
body: JSON.stringify(body)
|
|
57
58
|
});
|
|
58
59
|
if (!response.ok) throw new Error("Failed to set visitor");
|
|
59
60
|
const data = await response.json();
|
|
60
|
-
config.thirdPartyUserSetters.forEach((setter) => setter(
|
|
61
|
+
config.thirdPartyUserSetters.forEach((setter) => setter(body));
|
|
61
62
|
cache.visitor = data;
|
|
62
63
|
return data;
|
|
63
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/visitor/index.ts"],"sourcesContent":["import { fetch } from '@shware/utils';\nimport { keys } from '../constants/storage';\nimport type { CreateVisitorDTO } from '../schema/index';\nimport { cache, config } from '../setup/index';\nimport type {
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/visitor/index.ts"],"sourcesContent":["import { fetch } from '@shware/utils';\nimport { keys } from '../constants/storage';\nimport type { CreateVisitorDTO, UpdateVisitorDTO } from '../schema/index';\nimport { cache, config } from '../setup/index';\nimport type { Visitor, VisitorProperties } from './types';\n\nasync function createVisitor(): Promise<Visitor> {\n const tags = await config.getTags();\n const dto: CreateVisitorDTO = {\n device_id: await config.getDeviceId(),\n platform: config.platform,\n environment: config.environment,\n tags,\n properties: tags as VisitorProperties,\n };\n\n const response = await fetch(`${config.endpoint}/visitors`, {\n method: 'POST',\n credentials: 'include',\n headers: await config.getHeaders(),\n body: JSON.stringify(dto),\n });\n\n const data = (await response.json()) as Visitor;\n if (data.id) {\n config.storage.setItem(keys.visitor_id, data.id);\n }\n return data;\n}\n\nasync function getOrCreateVisitor(): Promise<Visitor> {\n const visitorId = config.storage.getItem(keys.visitor_id);\n if (visitorId && visitorId !== 'undefined') {\n const response = await fetch(`${config.endpoint}/visitors/${visitorId}`, {\n method: 'GET',\n credentials: 'include',\n headers: await config.getHeaders(),\n });\n\n if (!response.ok) return createVisitor();\n const data = (await response.json()) as Visitor;\n\n // The legacy system used int64 ids (SnowflakeId); the new system switched to UUID_v7. The GET\n // endpoint accepts both, and querying with a legacy id returns the new UUID_v7,\n // so we write it back here to refresh the stored id for a smooth migration.\n if (data.id) {\n config.storage.setItem(keys.visitor_id, data.id);\n }\n return data;\n } else {\n return createVisitor();\n }\n}\n\nlet visitorFetcher: Promise<Visitor> | null = null;\n\nexport async function getVisitor(): Promise<Visitor> {\n if (cache.visitor) return cache.visitor;\n if (visitorFetcher) return visitorFetcher;\n visitorFetcher = getOrCreateVisitor();\n cache.visitor = await visitorFetcher;\n visitorFetcher = null;\n return cache.visitor;\n}\n\nexport async function setVisitor(dto: Omit<UpdateVisitorDTO, 'tags'>) {\n const { id } = await getVisitor();\n const tags = await config.getTags();\n const body: UpdateVisitorDTO = { ...dto, tags };\n const response = await fetch(`${config.endpoint}/visitors/${id}`, {\n method: 'PATCH',\n credentials: 'include',\n headers: await config.getHeaders(),\n body: JSON.stringify(body),\n });\n\n if (!response.ok) throw new Error('Failed to set visitor');\n const data = (await response.json()) as Visitor;\n\n config.thirdPartyUserSetters.forEach((setter) => setter(body));\n cache.visitor = data;\n return data;\n}\n"],"mappings":";;;;AAMA,eAAe,gBAAkC;CAC/C,MAAM,OAAO,MAAM,OAAO,QAAQ;CAClC,MAAM,MAAwB;EAC5B,WAAW,MAAM,OAAO,YAAY;EACpC,UAAU,OAAO;EACjB,aAAa,OAAO;EACpB;EACA,YAAY;CACd;CASA,MAAM,OAAQ,OAAM,MAPG,MAAM,GAAG,OAAO,SAAS,YAAY;EAC1D,QAAQ;EACR,aAAa;EACb,SAAS,MAAM,OAAO,WAAW;EACjC,MAAM,KAAK,UAAU,GAAG;CAC1B,CAAC,EAAA,CAE4B,KAAK;CAClC,IAAI,KAAK,IACP,OAAO,QAAQ,QAAQ,KAAK,YAAY,KAAK,EAAE;CAEjD,OAAO;AACT;AAEA,eAAe,qBAAuC;CACpD,MAAM,YAAY,OAAO,QAAQ,QAAQ,KAAK,UAAU;CACxD,IAAI,aAAa,cAAc,aAAa;EAC1C,MAAM,WAAW,MAAM,MAAM,GAAG,OAAO,SAAS,YAAY,aAAa;GACvE,QAAQ;GACR,aAAa;GACb,SAAS,MAAM,OAAO,WAAW;EACnC,CAAC;EAED,IAAI,CAAC,SAAS,IAAI,OAAO,cAAc;EACvC,MAAM,OAAQ,MAAM,SAAS,KAAK;EAKlC,IAAI,KAAK,IACP,OAAO,QAAQ,QAAQ,KAAK,YAAY,KAAK,EAAE;EAEjD,OAAO;CACT,OACE,OAAO,cAAc;AAEzB;AAEA,IAAI,iBAA0C;AAE9C,eAAsB,aAA+B;CACnD,IAAI,MAAM,SAAS,OAAO,MAAM;CAChC,IAAI,gBAAgB,OAAO;CAC3B,iBAAiB,mBAAmB;CACpC,MAAM,UAAU,MAAM;CACtB,iBAAiB;CACjB,OAAO,MAAM;AACf;AAEA,eAAsB,WAAW,KAAqC;CACpE,MAAM,EAAE,OAAO,MAAM,WAAW;CAChC,MAAM,OAAO,MAAM,OAAO,QAAQ;CAClC,MAAM,OAAyB;EAAE,GAAG;EAAK;CAAK;CAC9C,MAAM,WAAW,MAAM,MAAM,GAAG,OAAO,SAAS,YAAY,MAAM;EAChE,QAAQ;EACR,aAAa;EACb,SAAS,MAAM,OAAO,WAAW;EACjC,MAAM,KAAK,UAAU,IAAI;CAC3B,CAAC;CAED,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,MAAM,uBAAuB;CACzD,MAAM,OAAQ,MAAM,SAAS,KAAK;CAElC,OAAO,sBAAsB,SAAS,WAAW,OAAO,IAAI,CAAC;CAC7D,MAAM,UAAU;CAChB,OAAO;AACT"}
|
package/dist/visitor/types.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UpdateVisitorDTO } from "../schema/index.cjs";
|
|
2
2
|
import { Environment, Platform, TrackTags } from "../track/types.cjs";
|
|
3
3
|
//#region src/visitor/types.d.ts
|
|
4
4
|
type VisitorProperties = Record<Lowercase<string>, string | number | boolean | null>;
|
|
@@ -9,13 +9,7 @@ interface Visitor {
|
|
|
9
9
|
environment: Environment;
|
|
10
10
|
tags: TrackTags;
|
|
11
11
|
}
|
|
12
|
-
interface UpdateVisitorDTO {
|
|
13
|
-
user_id?: string;
|
|
14
|
-
distinct_id?: string;
|
|
15
|
-
data?: UserProvidedData;
|
|
16
|
-
properties?: VisitorProperties;
|
|
17
|
-
}
|
|
18
12
|
type ThirdPartyUserSetter = (dto: UpdateVisitorDTO) => void;
|
|
19
13
|
//#endregion
|
|
20
|
-
export { ThirdPartyUserSetter,
|
|
14
|
+
export { ThirdPartyUserSetter, Visitor, VisitorProperties };
|
|
21
15
|
//# sourceMappingURL=types.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","names":[],"sources":["../../src/visitor/types.ts"],"mappings":";;;KAGY,oBAAoB,OAAO;UAEtB;EACf;EACA;EACA,UAAU;EACV,aAAa;EACb,MAAM;;
|
|
1
|
+
{"version":3,"file":"types.d.cts","names":[],"sources":["../../src/visitor/types.ts"],"mappings":";;;KAGY,oBAAoB,OAAO;UAEtB;EACf;EACA;EACA,UAAU;EACV,aAAa;EACb,MAAM;;KAGI,wBAAwB,KAAK"}
|
package/dist/visitor/types.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UpdateVisitorDTO } from "../schema/index.mjs";
|
|
2
2
|
import { Environment, Platform, TrackTags } from "../track/types.mjs";
|
|
3
3
|
//#region src/visitor/types.d.ts
|
|
4
4
|
type VisitorProperties = Record<Lowercase<string>, string | number | boolean | null>;
|
|
@@ -9,13 +9,7 @@ interface Visitor {
|
|
|
9
9
|
environment: Environment;
|
|
10
10
|
tags: TrackTags;
|
|
11
11
|
}
|
|
12
|
-
interface UpdateVisitorDTO {
|
|
13
|
-
user_id?: string;
|
|
14
|
-
distinct_id?: string;
|
|
15
|
-
data?: UserProvidedData;
|
|
16
|
-
properties?: VisitorProperties;
|
|
17
|
-
}
|
|
18
12
|
type ThirdPartyUserSetter = (dto: UpdateVisitorDTO) => void;
|
|
19
13
|
//#endregion
|
|
20
|
-
export { ThirdPartyUserSetter,
|
|
14
|
+
export { ThirdPartyUserSetter, Visitor, VisitorProperties };
|
|
21
15
|
//# sourceMappingURL=types.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","names":[],"sources":["../../src/visitor/types.ts"],"mappings":";;;KAGY,oBAAoB,OAAO;UAEtB;EACf;EACA;EACA,UAAU;EACV,aAAa;EACb,MAAM;;
|
|
1
|
+
{"version":3,"file":"types.d.mts","names":[],"sources":["../../src/visitor/types.ts"],"mappings":";;;KAGY,oBAAoB,OAAO;UAEtB;EACf;EACA;EACA,UAAU;EACV,aAAa;EACb,MAAM;;KAGI,wBAAwB,KAAK"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shware/analytics",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
"uuid": "^14.0.1",
|
|
132
132
|
"web-vitals": "^5.3.0",
|
|
133
133
|
"zod": "^4.4.3",
|
|
134
|
-
"@shware/utils": "^1.5.
|
|
134
|
+
"@shware/utils": "^1.5.1"
|
|
135
135
|
},
|
|
136
136
|
"devDependencies": {
|
|
137
137
|
"@types/facebook-nodejs-business-sdk": "^24.0.0",
|