@fuul/sdk 0.8.2 → 0.8.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/lib/cjs/index.js +2 -9
- package/lib/cjs/types/index.d.ts +0 -1
- package/lib/cjs/types/index.d.ts.map +1 -1
- package/lib/cjs/types/types/types.d.ts +1 -2
- package/lib/cjs/types/types/types.d.ts.map +1 -1
- package/lib/esm/index.mjs +2 -9
- package/lib/esm/types/index.d.ts +0 -1
- package/lib/esm/types/index.d.ts.map +1 -1
- package/lib/esm/types/types/types.d.ts +1 -2
- package/lib/esm/types/types/types.d.ts.map +1 -1
- package/package.json +1 -1
package/lib/cjs/index.js
CHANGED
|
@@ -34,7 +34,7 @@ const isEventAlreadySentAndInValidTimestamp = (eventName, params) => {
|
|
|
34
34
|
}
|
|
35
35
|
else {
|
|
36
36
|
return (parsedEvent["tracking_id"] === params.tracking_id &&
|
|
37
|
-
parsedEvent["
|
|
37
|
+
parsedEvent["project_id"] === params.project_id &&
|
|
38
38
|
parsedEvent["referrer_id"] === params.referrer_id &&
|
|
39
39
|
isSameDay);
|
|
40
40
|
}
|
|
@@ -79,17 +79,10 @@ class Fuul {
|
|
|
79
79
|
});
|
|
80
80
|
this.campaignsService = new campaignsService_js_1.CampaignsService(this.httpClient);
|
|
81
81
|
this.init();
|
|
82
|
-
this.events();
|
|
83
82
|
}
|
|
84
83
|
init() {
|
|
85
84
|
globalThis.Fuul = this;
|
|
86
85
|
}
|
|
87
|
-
events() {
|
|
88
|
-
// window.addEventListener("DOMContentLoaded", () => {
|
|
89
|
-
// this.sendEvent("pageview");
|
|
90
|
-
// });
|
|
91
|
-
console.log("we should send pageview event here");
|
|
92
|
-
}
|
|
93
86
|
checkApiKey() {
|
|
94
87
|
if (!this.apiKey) {
|
|
95
88
|
throw new Error("Fuul API key is required");
|
|
@@ -132,7 +125,7 @@ class Fuul {
|
|
|
132
125
|
else {
|
|
133
126
|
if (!referrer_id)
|
|
134
127
|
return;
|
|
135
|
-
params = Object.assign(Object.assign({}, params), { referrer_id });
|
|
128
|
+
params = Object.assign(Object.assign({}, params), { referrer_id, project_id: args === null || args === void 0 ? void 0 : args.project_id });
|
|
136
129
|
reqBody = {
|
|
137
130
|
name,
|
|
138
131
|
session_id,
|
package/lib/cjs/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,aAAa,EACb,SAAS,EACT,qBAAqB,EAEtB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AA0EjE,qBAAa,IAAI;IACf,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA4C;IACzE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,gBAAgB,CAAmB;gBAE/B,MAAM,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,aAAa,EACb,SAAS,EACT,qBAAqB,EAEtB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AA0EjE,qBAAa,IAAI;IACf,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA4C;IACzE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,gBAAgB,CAAmB;gBAE/B,MAAM,EAAE,MAAM;IAkB1B,IAAI;IAIJ,WAAW,IAAI,IAAI;IAMnB;;;;;;;;;;;;;;;OAeG;IACG,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC;IAwDpE,gBAAgB,IAAI,IAAI;IAMxB;;;;;;OAMG;IACH,oBAAoB,CAAC,EACnB,OAAO,EACP,GAAG,EACH,OAAO,GACR,EAAE,qBAAqB,GAAG,MAAM;IAO3B,eAAe,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;CAG7E;;;;AAMD,wBAEE"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export interface SendEventParams {
|
|
2
2
|
name: EventType;
|
|
3
3
|
args?: EventArgsType;
|
|
4
|
-
projectId?: string;
|
|
5
4
|
}
|
|
6
5
|
export type EventArgsType = {
|
|
7
6
|
[key: string]: string;
|
|
@@ -9,7 +8,7 @@ export type EventArgsType = {
|
|
|
9
8
|
export type EventType = "connect_wallet" | "pageview";
|
|
10
9
|
export interface SentEventParams {
|
|
11
10
|
tracking_id: string;
|
|
12
|
-
|
|
11
|
+
project_id?: string;
|
|
13
12
|
referrer_id?: string;
|
|
14
13
|
}
|
|
15
14
|
export interface IGenerateTrackingLink {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,CAAC,EAAE,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,gBAAgB,GAAG,UAAU,CAAC;AAEtD,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
package/lib/esm/index.mjs
CHANGED
|
@@ -31,7 +31,7 @@ const isEventAlreadySentAndInValidTimestamp = (eventName, params) => {
|
|
|
31
31
|
}
|
|
32
32
|
else {
|
|
33
33
|
return (parsedEvent["tracking_id"] === params.tracking_id &&
|
|
34
|
-
parsedEvent["
|
|
34
|
+
parsedEvent["project_id"] === params.project_id &&
|
|
35
35
|
parsedEvent["referrer_id"] === params.referrer_id &&
|
|
36
36
|
isSameDay);
|
|
37
37
|
}
|
|
@@ -76,17 +76,10 @@ export class Fuul {
|
|
|
76
76
|
});
|
|
77
77
|
this.campaignsService = new CampaignsService(this.httpClient);
|
|
78
78
|
this.init();
|
|
79
|
-
this.events();
|
|
80
79
|
}
|
|
81
80
|
init() {
|
|
82
81
|
globalThis.Fuul = this;
|
|
83
82
|
}
|
|
84
|
-
events() {
|
|
85
|
-
// window.addEventListener("DOMContentLoaded", () => {
|
|
86
|
-
// this.sendEvent("pageview");
|
|
87
|
-
// });
|
|
88
|
-
console.log("we should send pageview event here");
|
|
89
|
-
}
|
|
90
83
|
checkApiKey() {
|
|
91
84
|
if (!this.apiKey) {
|
|
92
85
|
throw new Error("Fuul API key is required");
|
|
@@ -129,7 +122,7 @@ export class Fuul {
|
|
|
129
122
|
else {
|
|
130
123
|
if (!referrer_id)
|
|
131
124
|
return;
|
|
132
|
-
params = Object.assign(Object.assign({}, params), { referrer_id });
|
|
125
|
+
params = Object.assign(Object.assign({}, params), { referrer_id, project_id: args === null || args === void 0 ? void 0 : args.project_id });
|
|
133
126
|
reqBody = {
|
|
134
127
|
name,
|
|
135
128
|
session_id,
|
package/lib/esm/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,aAAa,EACb,SAAS,EACT,qBAAqB,EAEtB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AA0EjE,qBAAa,IAAI;IACf,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA4C;IACzE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,gBAAgB,CAAmB;gBAE/B,MAAM,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,aAAa,EACb,SAAS,EACT,qBAAqB,EAEtB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AA0EjE,qBAAa,IAAI;IACf,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA4C;IACzE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,gBAAgB,CAAmB;gBAE/B,MAAM,EAAE,MAAM;IAkB1B,IAAI;IAIJ,WAAW,IAAI,IAAI;IAMnB;;;;;;;;;;;;;;;OAeG;IACG,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC;IAwDpE,gBAAgB,IAAI,IAAI;IAMxB;;;;;;OAMG;IACH,oBAAoB,CAAC,EACnB,OAAO,EACP,GAAG,EACH,OAAO,GACR,EAAE,qBAAqB,GAAG,MAAM;IAO3B,eAAe,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;CAG7E;;;;AAMD,wBAEE"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export interface SendEventParams {
|
|
2
2
|
name: EventType;
|
|
3
3
|
args?: EventArgsType;
|
|
4
|
-
projectId?: string;
|
|
5
4
|
}
|
|
6
5
|
export type EventArgsType = {
|
|
7
6
|
[key: string]: string;
|
|
@@ -9,7 +8,7 @@ export type EventArgsType = {
|
|
|
9
8
|
export type EventType = "connect_wallet" | "pageview";
|
|
10
9
|
export interface SentEventParams {
|
|
11
10
|
tracking_id: string;
|
|
12
|
-
|
|
11
|
+
project_id?: string;
|
|
13
12
|
referrer_id?: string;
|
|
14
13
|
}
|
|
15
14
|
export interface IGenerateTrackingLink {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,CAAC,EAAE,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,gBAAgB,GAAG,UAAU,CAAC;AAEtD,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|