mindbricks-analytics-shared 0.1.0
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/auth.d.ts +14 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +2 -0
- package/dist/auth.js.map +1 -0
- package/dist/eventNames.d.ts +66 -0
- package/dist/eventNames.d.ts.map +1 -0
- package/dist/eventNames.js +73 -0
- package/dist/eventNames.js.map +1 -0
- package/dist/hmac.d.ts +22 -0
- package/dist/hmac.d.ts.map +1 -0
- package/dist/hmac.js +33 -0
- package/dist/hmac.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/limits.d.ts +14 -0
- package/dist/limits.d.ts.map +1 -0
- package/dist/limits.js +14 -0
- package/dist/limits.js.map +1 -0
- package/dist/schemas.d.ts +1076 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +105 -0
- package/dist/schemas.js.map +1 -0
- package/dist/types.d.ts +72 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +36 -0
package/dist/auth.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface AuthUser {
|
|
2
|
+
id: string;
|
|
3
|
+
email?: string;
|
|
4
|
+
fullname?: string;
|
|
5
|
+
roleId?: string;
|
|
6
|
+
isActive?: boolean;
|
|
7
|
+
isAdmin: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface ProjectMembership {
|
|
10
|
+
projectId: string;
|
|
11
|
+
userId: string;
|
|
12
|
+
roleId?: string;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
package/dist/auth.js
ADDED
package/dist/auth.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mindbricks-standard system event names. All auto-emitted events use a
|
|
3
|
+
* `$` prefix so they're trivially distinguishable from user/business events
|
|
4
|
+
* like `payment_completed` or `cart_updated`.
|
|
5
|
+
*
|
|
6
|
+
* The seven canonical events the dashboards rely on:
|
|
7
|
+
* $page_view, $session_start, $session_end, $click,
|
|
8
|
+
* $form_submit, $error, $performance
|
|
9
|
+
*
|
|
10
|
+
* Supplementary events ($page_enter, $scroll_depth, $rage_click, …) are
|
|
11
|
+
* kept on the same prefix for consistency. They are richer signals that
|
|
12
|
+
* deeper product-analytics views can opt into.
|
|
13
|
+
*/
|
|
14
|
+
export declare const AUTO_EVENTS: {
|
|
15
|
+
readonly PAGE_VIEW: "$page_view";
|
|
16
|
+
readonly SESSION_START: "$session_start";
|
|
17
|
+
readonly SESSION_END: "$session_end";
|
|
18
|
+
readonly CLICK: "$click";
|
|
19
|
+
readonly FORM_SUBMIT: "$form_submit";
|
|
20
|
+
readonly ERROR: "$error";
|
|
21
|
+
readonly PERFORMANCE: "$performance";
|
|
22
|
+
readonly PAGE_ENTER: "$page_enter";
|
|
23
|
+
readonly PAGE_LEAVE: "$page_leave";
|
|
24
|
+
readonly TAB_HIDDEN: "$tab_hidden";
|
|
25
|
+
readonly TAB_VISIBLE: "$tab_visible";
|
|
26
|
+
readonly FORM_START: "$form_start";
|
|
27
|
+
readonly FORM_ABANDON: "$form_abandon";
|
|
28
|
+
readonly INPUT_FOCUS: "$input_focus";
|
|
29
|
+
readonly SCROLL_DEPTH: "$scroll_depth";
|
|
30
|
+
readonly RAGE_CLICK: "$rage_click";
|
|
31
|
+
readonly DEAD_CLICK: "$dead_click";
|
|
32
|
+
readonly NETWORK_ONLINE: "$network_online";
|
|
33
|
+
readonly NETWORK_OFFLINE: "$network_offline";
|
|
34
|
+
readonly IDENTIFY: "$identify";
|
|
35
|
+
};
|
|
36
|
+
export type AutoEventName = (typeof AUTO_EVENTS)[keyof typeof AUTO_EVENTS];
|
|
37
|
+
/**
|
|
38
|
+
* Critical business events. The ingestion API rejects these on the
|
|
39
|
+
* untrusted (frontend) endpoint — they may only arrive via the trusted
|
|
40
|
+
* server-side endpoint, signed with the project's secretKey.
|
|
41
|
+
*
|
|
42
|
+
* Business events deliberately do NOT use the `$` prefix; that prefix is
|
|
43
|
+
* reserved for SDK-emitted system events.
|
|
44
|
+
*/
|
|
45
|
+
export declare const SERVER_ONLY_EVENTS: ReadonlySet<string>;
|
|
46
|
+
export declare const TRAFFIC_SOURCE: {
|
|
47
|
+
readonly DIRECT: "direct";
|
|
48
|
+
readonly REFERRAL: "referral";
|
|
49
|
+
readonly ORGANIC_SEARCH: "organic_search";
|
|
50
|
+
readonly PAID_SEARCH: "paid_search";
|
|
51
|
+
readonly SOCIAL: "social";
|
|
52
|
+
readonly EMAIL: "email";
|
|
53
|
+
readonly UNKNOWN: "unknown";
|
|
54
|
+
};
|
|
55
|
+
export type TrafficSource = (typeof TRAFFIC_SOURCE)[keyof typeof TRAFFIC_SOURCE];
|
|
56
|
+
/** Web Vitals metric names emitted as the `metric` property of $performance. */
|
|
57
|
+
export declare const PERFORMANCE_METRICS: {
|
|
58
|
+
readonly LCP: "lcp";
|
|
59
|
+
readonly FID: "fid";
|
|
60
|
+
readonly CLS: "cls";
|
|
61
|
+
readonly TTFB: "ttfb";
|
|
62
|
+
readonly INP: "inp";
|
|
63
|
+
readonly FCP: "fcp";
|
|
64
|
+
};
|
|
65
|
+
export type PerformanceMetric = (typeof PERFORMANCE_METRICS)[keyof typeof PERFORMANCE_METRICS];
|
|
66
|
+
//# sourceMappingURL=eventNames.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eventNames.d.ts","sourceRoot":"","sources":["../src/eventNames.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;CAwBd,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAE3E;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAQjD,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;CAQjB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAEjF,gFAAgF;AAChF,eAAO,MAAM,mBAAmB;;;;;;;CAOtB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mindbricks-standard system event names. All auto-emitted events use a
|
|
3
|
+
* `$` prefix so they're trivially distinguishable from user/business events
|
|
4
|
+
* like `payment_completed` or `cart_updated`.
|
|
5
|
+
*
|
|
6
|
+
* The seven canonical events the dashboards rely on:
|
|
7
|
+
* $page_view, $session_start, $session_end, $click,
|
|
8
|
+
* $form_submit, $error, $performance
|
|
9
|
+
*
|
|
10
|
+
* Supplementary events ($page_enter, $scroll_depth, $rage_click, …) are
|
|
11
|
+
* kept on the same prefix for consistency. They are richer signals that
|
|
12
|
+
* deeper product-analytics views can opt into.
|
|
13
|
+
*/
|
|
14
|
+
export const AUTO_EVENTS = {
|
|
15
|
+
// --- canonical 7 ---------------------------------------------------------
|
|
16
|
+
PAGE_VIEW: "$page_view",
|
|
17
|
+
SESSION_START: "$session_start",
|
|
18
|
+
SESSION_END: "$session_end",
|
|
19
|
+
CLICK: "$click",
|
|
20
|
+
FORM_SUBMIT: "$form_submit",
|
|
21
|
+
ERROR: "$error",
|
|
22
|
+
PERFORMANCE: "$performance",
|
|
23
|
+
// --- supplementary signals ----------------------------------------------
|
|
24
|
+
PAGE_ENTER: "$page_enter",
|
|
25
|
+
PAGE_LEAVE: "$page_leave",
|
|
26
|
+
TAB_HIDDEN: "$tab_hidden",
|
|
27
|
+
TAB_VISIBLE: "$tab_visible",
|
|
28
|
+
FORM_START: "$form_start",
|
|
29
|
+
FORM_ABANDON: "$form_abandon",
|
|
30
|
+
INPUT_FOCUS: "$input_focus",
|
|
31
|
+
SCROLL_DEPTH: "$scroll_depth",
|
|
32
|
+
RAGE_CLICK: "$rage_click",
|
|
33
|
+
DEAD_CLICK: "$dead_click",
|
|
34
|
+
NETWORK_ONLINE: "$network_online",
|
|
35
|
+
NETWORK_OFFLINE: "$network_offline",
|
|
36
|
+
IDENTIFY: "$identify",
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Critical business events. The ingestion API rejects these on the
|
|
40
|
+
* untrusted (frontend) endpoint — they may only arrive via the trusted
|
|
41
|
+
* server-side endpoint, signed with the project's secretKey.
|
|
42
|
+
*
|
|
43
|
+
* Business events deliberately do NOT use the `$` prefix; that prefix is
|
|
44
|
+
* reserved for SDK-emitted system events.
|
|
45
|
+
*/
|
|
46
|
+
export const SERVER_ONLY_EVENTS = new Set([
|
|
47
|
+
"payment_completed",
|
|
48
|
+
"order_created",
|
|
49
|
+
"subscription_started",
|
|
50
|
+
"user_registered",
|
|
51
|
+
"plan_upgraded",
|
|
52
|
+
"credit_spent",
|
|
53
|
+
"quota_used",
|
|
54
|
+
]);
|
|
55
|
+
export const TRAFFIC_SOURCE = {
|
|
56
|
+
DIRECT: "direct",
|
|
57
|
+
REFERRAL: "referral",
|
|
58
|
+
ORGANIC_SEARCH: "organic_search",
|
|
59
|
+
PAID_SEARCH: "paid_search",
|
|
60
|
+
SOCIAL: "social",
|
|
61
|
+
EMAIL: "email",
|
|
62
|
+
UNKNOWN: "unknown",
|
|
63
|
+
};
|
|
64
|
+
/** Web Vitals metric names emitted as the `metric` property of $performance. */
|
|
65
|
+
export const PERFORMANCE_METRICS = {
|
|
66
|
+
LCP: "lcp",
|
|
67
|
+
FID: "fid",
|
|
68
|
+
CLS: "cls",
|
|
69
|
+
TTFB: "ttfb",
|
|
70
|
+
INP: "inp",
|
|
71
|
+
FCP: "fcp",
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=eventNames.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eventNames.js","sourceRoot":"","sources":["../src/eventNames.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,4EAA4E;IAC5E,SAAS,EAAE,YAAY;IACvB,aAAa,EAAE,gBAAgB;IAC/B,WAAW,EAAE,cAAc;IAC3B,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,cAAc;IAC3B,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,cAAc;IAE3B,2EAA2E;IAC3E,UAAU,EAAE,aAAa;IACzB,UAAU,EAAE,aAAa;IACzB,UAAU,EAAE,aAAa;IACzB,WAAW,EAAE,cAAc;IAC3B,UAAU,EAAE,aAAa;IACzB,YAAY,EAAE,eAAe;IAC7B,WAAW,EAAE,cAAc;IAC3B,YAAY,EAAE,eAAe;IAC7B,UAAU,EAAE,aAAa;IACzB,UAAU,EAAE,aAAa;IACzB,cAAc,EAAE,iBAAiB;IACjC,eAAe,EAAE,kBAAkB;IACnC,QAAQ,EAAE,WAAW;CACb,CAAC;AAIX;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAwB,IAAI,GAAG,CAAC;IAC7D,mBAAmB;IACnB,eAAe;IACf,sBAAsB;IACtB,iBAAiB;IACjB,eAAe;IACf,cAAc;IACd,YAAY;CACb,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,cAAc,EAAE,gBAAgB;IAChC,WAAW,EAAE,aAAa;IAC1B,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;CACV,CAAC;AAIX,gFAAgF;AAChF,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;CACF,CAAC"}
|
package/dist/hmac.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface SignedRequest {
|
|
2
|
+
timestamp: string;
|
|
3
|
+
body: string;
|
|
4
|
+
signature: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Sign a request body with the project's secretKey. The timestamp is part
|
|
8
|
+
* of the signed payload so the receiver can reject replays beyond a skew.
|
|
9
|
+
*
|
|
10
|
+
* Format used in headers:
|
|
11
|
+
* X-Analytics-Timestamp: <iso8601>
|
|
12
|
+
* X-Analytics-Signature: <hex hmac-sha256>
|
|
13
|
+
*/
|
|
14
|
+
export declare function signRequest(secretKey: string, timestamp: string, body: string): string;
|
|
15
|
+
export declare function verifyRequest(secretKey: string, timestamp: string, body: string, signature: string): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* The DB stores only a hash of the secretKey (defence-in-depth: a leaked
|
|
18
|
+
* row dump must not reveal usable keys). The hash is salted with a stable
|
|
19
|
+
* project-scoped salt so we can still do a cheap lookup.
|
|
20
|
+
*/
|
|
21
|
+
export declare function hashSecretKey(secretKey: string, salt: string): string;
|
|
22
|
+
//# sourceMappingURL=hmac.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmac.d.ts","sourceRoot":"","sources":["../src/hmac.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMtF;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAM5G;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAErE"}
|
package/dist/hmac.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createHmac, timingSafeEqual } from "node:crypto";
|
|
2
|
+
/**
|
|
3
|
+
* Sign a request body with the project's secretKey. The timestamp is part
|
|
4
|
+
* of the signed payload so the receiver can reject replays beyond a skew.
|
|
5
|
+
*
|
|
6
|
+
* Format used in headers:
|
|
7
|
+
* X-Analytics-Timestamp: <iso8601>
|
|
8
|
+
* X-Analytics-Signature: <hex hmac-sha256>
|
|
9
|
+
*/
|
|
10
|
+
export function signRequest(secretKey, timestamp, body) {
|
|
11
|
+
const h = createHmac("sha256", secretKey);
|
|
12
|
+
h.update(timestamp);
|
|
13
|
+
h.update("\n");
|
|
14
|
+
h.update(body);
|
|
15
|
+
return h.digest("hex");
|
|
16
|
+
}
|
|
17
|
+
export function verifyRequest(secretKey, timestamp, body, signature) {
|
|
18
|
+
const expected = signRequest(secretKey, timestamp, body);
|
|
19
|
+
const a = Buffer.from(expected, "hex");
|
|
20
|
+
const b = Buffer.from(signature, "hex");
|
|
21
|
+
if (a.length !== b.length || a.length === 0)
|
|
22
|
+
return false;
|
|
23
|
+
return timingSafeEqual(a, b);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The DB stores only a hash of the secretKey (defence-in-depth: a leaked
|
|
27
|
+
* row dump must not reveal usable keys). The hash is salted with a stable
|
|
28
|
+
* project-scoped salt so we can still do a cheap lookup.
|
|
29
|
+
*/
|
|
30
|
+
export function hashSecretKey(secretKey, salt) {
|
|
31
|
+
return createHmac("sha256", salt).update(secretKey).digest("hex");
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=hmac.js.map
|
package/dist/hmac.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmac.js","sourceRoot":"","sources":["../src/hmac.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAQ1D;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,SAAiB,EAAE,SAAiB,EAAE,IAAY;IAC5E,MAAM,CAAC,GAAG,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IAC1C,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACpB,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACf,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACf,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,SAAiB,EAAE,SAAiB,EAAE,IAAY,EAAE,SAAiB;IACjG,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IACzD,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IACvC,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IACxC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAC1D,OAAO,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,SAAiB,EAAE,IAAY;IAC3D,OAAO,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACpE,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
|
package/dist/limits.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const LIMITS: {
|
|
2
|
+
readonly EVENT_NAME_MAX_LEN: 64;
|
|
3
|
+
readonly PROPERTY_KEY_MAX_LEN: 64;
|
|
4
|
+
readonly PROPERTY_VALUE_MAX_LEN: number;
|
|
5
|
+
readonly PROPERTY_COUNT_MAX: 128;
|
|
6
|
+
readonly BATCH_SIZE_MAX: 200;
|
|
7
|
+
readonly PAYLOAD_BYTES_MAX: 512000;
|
|
8
|
+
readonly USER_ID_MAX_LEN: 128;
|
|
9
|
+
readonly ANON_ID_MAX_LEN: 64;
|
|
10
|
+
readonly SESSION_ID_MAX_LEN: 64;
|
|
11
|
+
readonly EVENT_ID_MAX_LEN: 64;
|
|
12
|
+
readonly URL_MAX_LEN: 2048;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=limits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../src/limits.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;CAYT,CAAC"}
|
package/dist/limits.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const LIMITS = {
|
|
2
|
+
EVENT_NAME_MAX_LEN: 64,
|
|
3
|
+
PROPERTY_KEY_MAX_LEN: 64,
|
|
4
|
+
PROPERTY_VALUE_MAX_LEN: 8 * 1024,
|
|
5
|
+
PROPERTY_COUNT_MAX: 128,
|
|
6
|
+
BATCH_SIZE_MAX: 200,
|
|
7
|
+
PAYLOAD_BYTES_MAX: 512_000,
|
|
8
|
+
USER_ID_MAX_LEN: 128,
|
|
9
|
+
ANON_ID_MAX_LEN: 64,
|
|
10
|
+
SESSION_ID_MAX_LEN: 64,
|
|
11
|
+
EVENT_ID_MAX_LEN: 64,
|
|
12
|
+
URL_MAX_LEN: 2048,
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=limits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.js","sourceRoot":"","sources":["../src/limits.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,kBAAkB,EAAE,EAAE;IACtB,oBAAoB,EAAE,EAAE;IACxB,sBAAsB,EAAE,CAAC,GAAG,IAAI;IAChC,kBAAkB,EAAE,GAAG;IACvB,cAAc,EAAE,GAAG;IACnB,iBAAiB,EAAE,OAAO;IAC1B,eAAe,EAAE,GAAG;IACpB,eAAe,EAAE,EAAE;IACnB,kBAAkB,EAAE,EAAE;IACtB,gBAAgB,EAAE,EAAE;IACpB,WAAW,EAAE,IAAI;CACT,CAAC"}
|