@jitsu/protocols 0.0.1-alpha.174 → 0.0.1-alpha.183
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/analytics.d.ts +18 -13
- package/functions.d.ts +2 -1
- package/package.json +1 -1
package/analytics.d.ts
CHANGED
|
@@ -38,18 +38,18 @@ export interface AnalyticsClientEvent {
|
|
|
38
38
|
sentAt?: Date | ISO8601Date;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
* A context of an event that is added on server-side
|
|
43
|
-
*/
|
|
44
|
-
export type ServerContext = {
|
|
41
|
+
export type ServerContextReservedProps = {
|
|
45
42
|
request_ip?: string;
|
|
46
43
|
receivedAt?: ISO8601Date;
|
|
47
44
|
sentAt?: ISO8601Date;
|
|
48
45
|
timestamp?: ISO8601Date;
|
|
49
46
|
userId?: ISO8601Date;
|
|
50
47
|
type?: ISO8601Date;
|
|
51
|
-
[k: string]: any;
|
|
52
48
|
};
|
|
49
|
+
/**
|
|
50
|
+
* A context of an event that is added on server-side
|
|
51
|
+
*/
|
|
52
|
+
export type ServerContext = ServerContextReservedProps & { [k: string]: any };
|
|
53
53
|
|
|
54
54
|
interface ProcessingContext {
|
|
55
55
|
$table?: string;
|
|
@@ -89,6 +89,16 @@ export interface CompactMetric {
|
|
|
89
89
|
e: number; // timestamp in unit milliseconds
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
export type PageReservedProps = {
|
|
93
|
+
path?: string;
|
|
94
|
+
referrer?: string;
|
|
95
|
+
host?: string;
|
|
96
|
+
referring_domain?: string;
|
|
97
|
+
search?: string;
|
|
98
|
+
title?: string;
|
|
99
|
+
url?: string;
|
|
100
|
+
};
|
|
101
|
+
|
|
92
102
|
interface AnalyticsContext {
|
|
93
103
|
/**
|
|
94
104
|
* Ip address of the originating request. Generally, shouldn't be set
|
|
@@ -96,18 +106,13 @@ interface AnalyticsContext {
|
|
|
96
106
|
*/
|
|
97
107
|
ip?: string;
|
|
98
108
|
|
|
99
|
-
page?: {
|
|
100
|
-
path?: string;
|
|
101
|
-
referrer?: string;
|
|
102
|
-
search?: string;
|
|
103
|
-
title?: string;
|
|
104
|
-
url?: string;
|
|
105
|
-
[key: string]: any;
|
|
106
|
-
};
|
|
109
|
+
page?: PageReservedProps & { [key: string]: any };
|
|
107
110
|
metrics?: CompactMetric[];
|
|
108
111
|
|
|
109
112
|
userAgent?: string;
|
|
110
113
|
|
|
114
|
+
userAgentVendor?: string;
|
|
115
|
+
|
|
111
116
|
locale?: string;
|
|
112
117
|
|
|
113
118
|
library?: {
|
package/functions.d.ts
CHANGED
|
@@ -89,4 +89,5 @@ export interface JitsuFunction<E extends AnyEvent = AnyEvent, P extends AnyProps
|
|
|
89
89
|
description?: any;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
export type BuiltinFunctionName = `builtin.${
|
|
92
|
+
export type BuiltinFunctionName<T extends string = string> = `builtin.${T}`;
|
|
93
|
+
export type BuiltinDestinationFunctionName = BuiltinFunctionName<`destination.${string}`>;
|