@reopt-ai/data-contract 0.6.0 → 0.6.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.
Files changed (45) hide show
  1. package/dist/{chunk-JHHCT3GA.cjs → chunk-AOS53KAV.cjs} +2 -2
  2. package/dist/{chunk-JHHCT3GA.cjs.map → chunk-AOS53KAV.cjs.map} +1 -1
  3. package/dist/{chunk-OGL3P7IH.cjs → chunk-BA52YA7N.cjs} +13 -6
  4. package/dist/chunk-BA52YA7N.cjs.map +1 -0
  5. package/dist/{chunk-5BRCHDS3.js → chunk-DUJSYMYY.js} +11 -4
  6. package/dist/chunk-DUJSYMYY.js.map +1 -0
  7. package/dist/{chunk-6ZJOC4NJ.js → chunk-FMOKJTQD.js} +56 -7
  8. package/dist/chunk-FMOKJTQD.js.map +1 -0
  9. package/dist/{chunk-KRJPEMFD.cjs → chunk-FQSCQSMP.cjs} +57 -8
  10. package/dist/chunk-FQSCQSMP.cjs.map +1 -0
  11. package/dist/{chunk-IXPP5K4I.js → chunk-ZCKVMUIQ.js} +2 -2
  12. package/dist/{chunk-IXPP5K4I.js.map → chunk-ZCKVMUIQ.js.map} +1 -1
  13. package/dist/client.cjs +11 -11
  14. package/dist/client.d.cts +1 -1
  15. package/dist/client.d.ts +1 -1
  16. package/dist/client.js +3 -3
  17. package/dist/control.cjs +1 -1
  18. package/dist/control.d.cts +6 -6
  19. package/dist/control.d.ts +6 -6
  20. package/dist/control.js +1 -1
  21. package/dist/identity.cjs +13 -3
  22. package/dist/identity.cjs.map +1 -1
  23. package/dist/identity.d.cts +40 -4
  24. package/dist/identity.d.ts +40 -4
  25. package/dist/identity.js +14 -4
  26. package/dist/index.cjs +2 -2
  27. package/dist/index.d.cts +1 -1
  28. package/dist/index.d.ts +1 -1
  29. package/dist/index.js +1 -1
  30. package/dist/ingest.cjs +6 -4
  31. package/dist/ingest.cjs.map +1 -1
  32. package/dist/ingest.d.cts +34 -7
  33. package/dist/ingest.d.ts +34 -7
  34. package/dist/ingest.js +5 -3
  35. package/dist/query.cjs +1 -1
  36. package/dist/query.d.cts +13 -13
  37. package/dist/query.d.ts +13 -13
  38. package/dist/query.js +1 -1
  39. package/dist/{version-CC4_BBvq.d.cts → version-BANKB6Og.d.cts} +1 -1
  40. package/dist/{version-CC4_BBvq.d.ts → version-BANKB6Og.d.ts} +1 -1
  41. package/package.json +1 -1
  42. package/dist/chunk-5BRCHDS3.js.map +0 -1
  43. package/dist/chunk-6ZJOC4NJ.js.map +0 -1
  44. package/dist/chunk-KRJPEMFD.cjs.map +0 -1
  45. package/dist/chunk-OGL3P7IH.cjs.map +0 -1
@@ -181,27 +181,27 @@ declare const zEventMetaResponse: z.ZodObject<{
181
181
  type EventMetaResponse = z.infer<typeof zEventMetaResponse>;
182
182
  declare const CONTROL_ERROR_CODES: readonly ["unauthorized", "organization_scope_mismatch", "external_id_conflict", "project_external_id_mismatch", "not_found", "validation_failed", "rate_limited", "internal_error"];
183
183
  declare const zControlErrorCode: z.ZodEnum<{
184
- validation_failed: "validation_failed";
185
184
  unauthorized: "unauthorized";
186
- rate_limited: "rate_limited";
187
- internal_error: "internal_error";
188
185
  organization_scope_mismatch: "organization_scope_mismatch";
189
186
  external_id_conflict: "external_id_conflict";
190
187
  project_external_id_mismatch: "project_external_id_mismatch";
191
188
  not_found: "not_found";
189
+ validation_failed: "validation_failed";
190
+ rate_limited: "rate_limited";
191
+ internal_error: "internal_error";
192
192
  }>;
193
193
  type ControlErrorCode = z.infer<typeof zControlErrorCode>;
194
194
  declare const zControlError: z.ZodObject<{
195
195
  status: z.ZodNumber;
196
196
  code: z.ZodEnum<{
197
- validation_failed: "validation_failed";
198
197
  unauthorized: "unauthorized";
199
- rate_limited: "rate_limited";
200
- internal_error: "internal_error";
201
198
  organization_scope_mismatch: "organization_scope_mismatch";
202
199
  external_id_conflict: "external_id_conflict";
203
200
  project_external_id_mismatch: "project_external_id_mismatch";
204
201
  not_found: "not_found";
202
+ validation_failed: "validation_failed";
203
+ rate_limited: "rate_limited";
204
+ internal_error: "internal_error";
205
205
  }>;
206
206
  error: z.ZodString;
207
207
  message: z.ZodOptional<z.ZodString>;
package/dist/control.d.ts CHANGED
@@ -181,27 +181,27 @@ declare const zEventMetaResponse: z.ZodObject<{
181
181
  type EventMetaResponse = z.infer<typeof zEventMetaResponse>;
182
182
  declare const CONTROL_ERROR_CODES: readonly ["unauthorized", "organization_scope_mismatch", "external_id_conflict", "project_external_id_mismatch", "not_found", "validation_failed", "rate_limited", "internal_error"];
183
183
  declare const zControlErrorCode: z.ZodEnum<{
184
- validation_failed: "validation_failed";
185
184
  unauthorized: "unauthorized";
186
- rate_limited: "rate_limited";
187
- internal_error: "internal_error";
188
185
  organization_scope_mismatch: "organization_scope_mismatch";
189
186
  external_id_conflict: "external_id_conflict";
190
187
  project_external_id_mismatch: "project_external_id_mismatch";
191
188
  not_found: "not_found";
189
+ validation_failed: "validation_failed";
190
+ rate_limited: "rate_limited";
191
+ internal_error: "internal_error";
192
192
  }>;
193
193
  type ControlErrorCode = z.infer<typeof zControlErrorCode>;
194
194
  declare const zControlError: z.ZodObject<{
195
195
  status: z.ZodNumber;
196
196
  code: z.ZodEnum<{
197
- validation_failed: "validation_failed";
198
197
  unauthorized: "unauthorized";
199
- rate_limited: "rate_limited";
200
- internal_error: "internal_error";
201
198
  organization_scope_mismatch: "organization_scope_mismatch";
202
199
  external_id_conflict: "external_id_conflict";
203
200
  project_external_id_mismatch: "project_external_id_mismatch";
204
201
  not_found: "not_found";
202
+ validation_failed: "validation_failed";
203
+ rate_limited: "rate_limited";
204
+ internal_error: "internal_error";
205
205
  }>;
206
206
  error: z.ZodString;
207
207
  message: z.ZodOptional<z.ZodString>;
package/dist/control.js CHANGED
@@ -26,7 +26,7 @@ import {
26
26
  } from "./chunk-IY4MXH35.js";
27
27
  import "./chunk-L3WJGIKD.js";
28
28
  import "./chunk-33BCA2LH.js";
29
- import "./chunk-IXPP5K4I.js";
29
+ import "./chunk-ZCKVMUIQ.js";
30
30
  export {
31
31
  CONTROL_API_PATHS,
32
32
  CONTROL_ERROR_CODES,
package/dist/identity.cjs CHANGED
@@ -12,21 +12,21 @@
12
12
 
13
13
 
14
14
 
15
- var _chunkKRJPEMFDcjs = require('./chunk-KRJPEMFD.cjs');
16
15
 
17
16
 
18
17
 
19
18
 
20
19
 
20
+ var _chunkFQSCQSMPcjs = require('./chunk-FQSCQSMP.cjs');
21
21
 
22
22
 
23
23
 
24
- var _chunkJHHCT3GAcjs = require('./chunk-JHHCT3GA.cjs');
25
24
 
26
25
 
27
26
 
28
27
 
29
28
 
29
+ var _chunkAOS53KAVcjs = require('./chunk-AOS53KAV.cjs');
30
30
 
31
31
 
32
32
 
@@ -43,5 +43,15 @@ var _chunkJHHCT3GAcjs = require('./chunk-JHHCT3GA.cjs');
43
43
 
44
44
 
45
45
 
46
- exports.CLIENT_ID_HEADER = _chunkJHHCT3GAcjs.CLIENT_ID_HEADER; exports.CLIENT_SECRET_HEADER = _chunkJHHCT3GAcjs.CLIENT_SECRET_HEADER; exports.CONTRACT_VERSION = _chunkJHHCT3GAcjs.CONTRACT_VERSION; exports.CONTRACT_VERSION_HEADER = _chunkJHHCT3GAcjs.CONTRACT_VERSION_HEADER; exports.COOKIE_MAX_AGE_SECONDS = _chunkKRJPEMFDcjs.COOKIE_MAX_AGE_SECONDS; exports.DEVICE_ID_HEADER = _chunkJHHCT3GAcjs.DEVICE_ID_HEADER; exports.IDENTITY_ID_PATTERN = _chunkKRJPEMFDcjs.IDENTITY_ID_PATTERN; exports.IDENTITY_REQUEST_HEADERS = _chunkKRJPEMFDcjs.IDENTITY_REQUEST_HEADERS; exports.OPT_OUT_CONSENT_CATEGORY = _chunkKRJPEMFDcjs.OPT_OUT_CONSENT_CATEGORY; exports.REQUEST_ID_HEADER = _chunkJHHCT3GAcjs.REQUEST_ID_HEADER; exports.SESSION_ID_HEADER = _chunkKRJPEMFDcjs.SESSION_ID_HEADER; exports.WRITE_KEY_HEADER = _chunkJHHCT3GAcjs.WRITE_KEY_HEADER; exports.consentCookieName = _chunkKRJPEMFDcjs.consentCookieName; exports.deviceCookieName = _chunkKRJPEMFDcjs.deviceCookieName; exports.isOptedOut = _chunkKRJPEMFDcjs.isOptedOut; exports.isValidIdentityId = _chunkKRJPEMFDcjs.isValidIdentityId; exports.parseConsentCookie = _chunkKRJPEMFDcjs.parseConsentCookie; exports.parseDeviceCookie = _chunkKRJPEMFDcjs.parseDeviceCookie; exports.serializeConsentCookie = _chunkKRJPEMFDcjs.serializeConsentCookie; exports.serializeDeviceCookie = _chunkKRJPEMFDcjs.serializeDeviceCookie;
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+ exports.CLIENT_ID_HEADER = _chunkAOS53KAVcjs.CLIENT_ID_HEADER; exports.CLIENT_SECRET_HEADER = _chunkAOS53KAVcjs.CLIENT_SECRET_HEADER; exports.CONTRACT_VERSION = _chunkAOS53KAVcjs.CONTRACT_VERSION; exports.CONTRACT_VERSION_HEADER = _chunkAOS53KAVcjs.CONTRACT_VERSION_HEADER; exports.COOKIE_MAX_AGE_SECONDS = _chunkFQSCQSMPcjs.COOKIE_MAX_AGE_SECONDS; exports.DEVICE_ID_HEADER = _chunkAOS53KAVcjs.DEVICE_ID_HEADER; exports.IDENTITY_ID_PATTERN = _chunkFQSCQSMPcjs.IDENTITY_ID_PATTERN; exports.IDENTITY_REQUEST_HEADERS = _chunkFQSCQSMPcjs.IDENTITY_REQUEST_HEADERS; exports.OPT_OUT_CONSENT_CATEGORY = _chunkFQSCQSMPcjs.OPT_OUT_CONSENT_CATEGORY; exports.REQUEST_ID_HEADER = _chunkAOS53KAVcjs.REQUEST_ID_HEADER; exports.SESSION_HEADER_SEPARATOR = _chunkFQSCQSMPcjs.SESSION_HEADER_SEPARATOR; exports.SESSION_ID_HEADER = _chunkFQSCQSMPcjs.SESSION_ID_HEADER; exports.WRITE_KEY_HEADER = _chunkAOS53KAVcjs.WRITE_KEY_HEADER; exports.consentCookieName = _chunkFQSCQSMPcjs.consentCookieName; exports.deviceCookieName = _chunkFQSCQSMPcjs.deviceCookieName; exports.formatSessionHeader = _chunkFQSCQSMPcjs.formatSessionHeader; exports.isOptedOut = _chunkFQSCQSMPcjs.isOptedOut; exports.isValidIdentityId = _chunkFQSCQSMPcjs.isValidIdentityId; exports.parseConsentCookie = _chunkFQSCQSMPcjs.parseConsentCookie; exports.parseDeviceCookie = _chunkFQSCQSMPcjs.parseDeviceCookie; exports.parseSessionHeader = _chunkFQSCQSMPcjs.parseSessionHeader; exports.serializeConsentCookie = _chunkFQSCQSMPcjs.serializeConsentCookie; exports.serializeDeviceCookie = _chunkFQSCQSMPcjs.serializeDeviceCookie; exports.signSessionToken = _chunkFQSCQSMPcjs.signSessionToken; exports.verifySessionToken = _chunkFQSCQSMPcjs.verifySessionToken;
47
57
  //# sourceMappingURL=identity.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/eric/reopt-ai/reopt-data/packages/data-contract/dist/identity.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,20CAAC","file":"/Users/eric/reopt-ai/reopt-data/packages/data-contract/dist/identity.cjs"}
1
+ {"version":3,"sources":["/Users/eric/reopt-ai/reopt-data/packages/data-contract/dist/identity.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,oqDAAC","file":"/Users/eric/reopt-ai/reopt-data/packages/data-contract/dist/identity.cjs"}
@@ -1,4 +1,4 @@
1
- export { C as CLIENT_ID_HEADER, a as CLIENT_SECRET_HEADER, b as CONTRACT_VERSION, c as CONTRACT_VERSION_HEADER, D as DEVICE_ID_HEADER, R as REQUEST_ID_HEADER, W as WRITE_KEY_HEADER } from './version-CC4_BBvq.cjs';
1
+ export { C as CLIENT_ID_HEADER, a as CLIENT_SECRET_HEADER, b as CONTRACT_VERSION, c as CONTRACT_VERSION_HEADER, D as DEVICE_ID_HEADER, R as REQUEST_ID_HEADER, W as WRITE_KEY_HEADER } from './version-BANKB6Og.cjs';
2
2
 
3
3
  /**
4
4
  * Request header carrying the browser's current session id. The browser SDK
@@ -18,9 +18,16 @@ declare const IDENTITY_REQUEST_HEADERS: readonly ["reopt-device-id", "reopt-sess
18
18
  declare const COOKIE_MAX_AGE_SECONDS: number;
19
19
  /** Consent category whose refusal means "send nothing at all". */
20
20
  declare const OPT_OUT_CONSENT_CATEGORY = "analytics";
21
- /** `reopt_<writeKey>_device` — device id plus session/profile hints. */
21
+ /**
22
+ * `reopt_<writeKey>_device` — device id plus session/profile hints.
23
+ *
24
+ * The write key is **sanitized**: any character outside `[A-Za-z0-9_-]`
25
+ * becomes `_` (see `cookieSafe`), so do not derive prefix/suffix pieces by
26
+ * probing this with a marker character — the marker is folded too. Always
27
+ * call this with the real write key and compare whole names.
28
+ */
22
29
  declare function deviceCookieName(writeKey: string): string;
23
- /** `reopt_<writeKey>_consent` — per-category consent decisions. */
30
+ /** `reopt_<writeKey>_consent` — per-category consent decisions. Same sanitizing as `deviceCookieName`. */
24
31
  declare function consentCookieName(writeKey: string): string;
25
32
  /** Everything the device cookie may carry. Only `deviceId` is required. */
26
33
  interface DeviceCookieState {
@@ -86,5 +93,34 @@ declare function serializeConsentCookie(state: ConsentCookieState): string;
86
93
  * banners mandatory for every integration.
87
94
  */
88
95
  declare function isOptedOut(consent: ConsentCookieState | null | undefined): boolean;
96
+ /**
97
+ * Sessions are assigned by ingest, not by the browser. To let a later request
98
+ * — from the same browser, or from a server acting for it — join that session
99
+ * with authority, ingest hands the browser its session id together with an
100
+ * HMAC over it, and the browser sends both back as `reopt-session-id`. An
101
+ * unsigned or wrongly signed value is a hint at most: ingest falls back to
102
+ * deciding the session from the device, exactly as if the header were absent.
103
+ *
104
+ * The token is `base64url(HMAC-SHA256(secret, sessionId))`. The secret is
105
+ * per project and never leaves the server. WebCrypto only, so this runs in
106
+ * browsers, edge runtimes and Node alike.
107
+ */
108
+ declare const SESSION_HEADER_SEPARATOR = ".";
109
+ interface SessionCredential {
110
+ id: string;
111
+ token: string;
112
+ }
113
+ /** `<id>.<token>` — what travels in `reopt-session-id`. */
114
+ declare function formatSessionHeader(credential: SessionCredential): string;
115
+ /** Splits a `reopt-session-id` value. `null` unless both parts are well-formed. */
116
+ declare function parseSessionHeader(value: string | null | undefined): SessionCredential | null;
117
+ /** Issues the token for `sessionId`. Server-side only — needs the project secret. */
118
+ declare function signSessionToken(secret: string, sessionId: string): Promise<string>;
119
+ /**
120
+ * Constant-time check of a presented token. Recomputes and compares the
121
+ * digests byte by byte rather than using `subtle.verify` with a decoded
122
+ * token, so a malformed token can never throw its way past the check.
123
+ */
124
+ declare function verifySessionToken(secret: string, credential: SessionCredential): Promise<boolean>;
89
125
 
90
- export { COOKIE_MAX_AGE_SECONDS, type ConsentCookieState, type DeviceCookieState, IDENTITY_ID_PATTERN, IDENTITY_REQUEST_HEADERS, OPT_OUT_CONSENT_CATEGORY, type ReoptBootstrap, SESSION_ID_HEADER, consentCookieName, deviceCookieName, isOptedOut, isValidIdentityId, parseConsentCookie, parseDeviceCookie, serializeConsentCookie, serializeDeviceCookie };
126
+ export { COOKIE_MAX_AGE_SECONDS, type ConsentCookieState, type DeviceCookieState, IDENTITY_ID_PATTERN, IDENTITY_REQUEST_HEADERS, OPT_OUT_CONSENT_CATEGORY, type ReoptBootstrap, SESSION_HEADER_SEPARATOR, SESSION_ID_HEADER, type SessionCredential, consentCookieName, deviceCookieName, formatSessionHeader, isOptedOut, isValidIdentityId, parseConsentCookie, parseDeviceCookie, parseSessionHeader, serializeConsentCookie, serializeDeviceCookie, signSessionToken, verifySessionToken };
@@ -1,4 +1,4 @@
1
- export { C as CLIENT_ID_HEADER, a as CLIENT_SECRET_HEADER, b as CONTRACT_VERSION, c as CONTRACT_VERSION_HEADER, D as DEVICE_ID_HEADER, R as REQUEST_ID_HEADER, W as WRITE_KEY_HEADER } from './version-CC4_BBvq.js';
1
+ export { C as CLIENT_ID_HEADER, a as CLIENT_SECRET_HEADER, b as CONTRACT_VERSION, c as CONTRACT_VERSION_HEADER, D as DEVICE_ID_HEADER, R as REQUEST_ID_HEADER, W as WRITE_KEY_HEADER } from './version-BANKB6Og.js';
2
2
 
3
3
  /**
4
4
  * Request header carrying the browser's current session id. The browser SDK
@@ -18,9 +18,16 @@ declare const IDENTITY_REQUEST_HEADERS: readonly ["reopt-device-id", "reopt-sess
18
18
  declare const COOKIE_MAX_AGE_SECONDS: number;
19
19
  /** Consent category whose refusal means "send nothing at all". */
20
20
  declare const OPT_OUT_CONSENT_CATEGORY = "analytics";
21
- /** `reopt_<writeKey>_device` — device id plus session/profile hints. */
21
+ /**
22
+ * `reopt_<writeKey>_device` — device id plus session/profile hints.
23
+ *
24
+ * The write key is **sanitized**: any character outside `[A-Za-z0-9_-]`
25
+ * becomes `_` (see `cookieSafe`), so do not derive prefix/suffix pieces by
26
+ * probing this with a marker character — the marker is folded too. Always
27
+ * call this with the real write key and compare whole names.
28
+ */
22
29
  declare function deviceCookieName(writeKey: string): string;
23
- /** `reopt_<writeKey>_consent` — per-category consent decisions. */
30
+ /** `reopt_<writeKey>_consent` — per-category consent decisions. Same sanitizing as `deviceCookieName`. */
24
31
  declare function consentCookieName(writeKey: string): string;
25
32
  /** Everything the device cookie may carry. Only `deviceId` is required. */
26
33
  interface DeviceCookieState {
@@ -86,5 +93,34 @@ declare function serializeConsentCookie(state: ConsentCookieState): string;
86
93
  * banners mandatory for every integration.
87
94
  */
88
95
  declare function isOptedOut(consent: ConsentCookieState | null | undefined): boolean;
96
+ /**
97
+ * Sessions are assigned by ingest, not by the browser. To let a later request
98
+ * — from the same browser, or from a server acting for it — join that session
99
+ * with authority, ingest hands the browser its session id together with an
100
+ * HMAC over it, and the browser sends both back as `reopt-session-id`. An
101
+ * unsigned or wrongly signed value is a hint at most: ingest falls back to
102
+ * deciding the session from the device, exactly as if the header were absent.
103
+ *
104
+ * The token is `base64url(HMAC-SHA256(secret, sessionId))`. The secret is
105
+ * per project and never leaves the server. WebCrypto only, so this runs in
106
+ * browsers, edge runtimes and Node alike.
107
+ */
108
+ declare const SESSION_HEADER_SEPARATOR = ".";
109
+ interface SessionCredential {
110
+ id: string;
111
+ token: string;
112
+ }
113
+ /** `<id>.<token>` — what travels in `reopt-session-id`. */
114
+ declare function formatSessionHeader(credential: SessionCredential): string;
115
+ /** Splits a `reopt-session-id` value. `null` unless both parts are well-formed. */
116
+ declare function parseSessionHeader(value: string | null | undefined): SessionCredential | null;
117
+ /** Issues the token for `sessionId`. Server-side only — needs the project secret. */
118
+ declare function signSessionToken(secret: string, sessionId: string): Promise<string>;
119
+ /**
120
+ * Constant-time check of a presented token. Recomputes and compares the
121
+ * digests byte by byte rather than using `subtle.verify` with a decoded
122
+ * token, so a malformed token can never throw its way past the check.
123
+ */
124
+ declare function verifySessionToken(secret: string, credential: SessionCredential): Promise<boolean>;
89
125
 
90
- export { COOKIE_MAX_AGE_SECONDS, type ConsentCookieState, type DeviceCookieState, IDENTITY_ID_PATTERN, IDENTITY_REQUEST_HEADERS, OPT_OUT_CONSENT_CATEGORY, type ReoptBootstrap, SESSION_ID_HEADER, consentCookieName, deviceCookieName, isOptedOut, isValidIdentityId, parseConsentCookie, parseDeviceCookie, serializeConsentCookie, serializeDeviceCookie };
126
+ export { COOKIE_MAX_AGE_SECONDS, type ConsentCookieState, type DeviceCookieState, IDENTITY_ID_PATTERN, IDENTITY_REQUEST_HEADERS, OPT_OUT_CONSENT_CATEGORY, type ReoptBootstrap, SESSION_HEADER_SEPARATOR, SESSION_ID_HEADER, type SessionCredential, consentCookieName, deviceCookieName, formatSessionHeader, isOptedOut, isValidIdentityId, parseConsentCookie, parseDeviceCookie, parseSessionHeader, serializeConsentCookie, serializeDeviceCookie, signSessionToken, verifySessionToken };
package/dist/identity.js CHANGED
@@ -3,16 +3,21 @@ import {
3
3
  IDENTITY_ID_PATTERN,
4
4
  IDENTITY_REQUEST_HEADERS,
5
5
  OPT_OUT_CONSENT_CATEGORY,
6
+ SESSION_HEADER_SEPARATOR,
6
7
  SESSION_ID_HEADER,
7
8
  consentCookieName,
8
9
  deviceCookieName,
10
+ formatSessionHeader,
9
11
  isOptedOut,
10
12
  isValidIdentityId,
11
13
  parseConsentCookie,
12
14
  parseDeviceCookie,
15
+ parseSessionHeader,
13
16
  serializeConsentCookie,
14
- serializeDeviceCookie
15
- } from "./chunk-6ZJOC4NJ.js";
17
+ serializeDeviceCookie,
18
+ signSessionToken,
19
+ verifySessionToken
20
+ } from "./chunk-FMOKJTQD.js";
16
21
  import {
17
22
  CLIENT_ID_HEADER,
18
23
  CLIENT_SECRET_HEADER,
@@ -21,7 +26,7 @@ import {
21
26
  DEVICE_ID_HEADER,
22
27
  REQUEST_ID_HEADER,
23
28
  WRITE_KEY_HEADER
24
- } from "./chunk-IXPP5K4I.js";
29
+ } from "./chunk-ZCKVMUIQ.js";
25
30
  export {
26
31
  CLIENT_ID_HEADER,
27
32
  CLIENT_SECRET_HEADER,
@@ -33,15 +38,20 @@ export {
33
38
  IDENTITY_REQUEST_HEADERS,
34
39
  OPT_OUT_CONSENT_CATEGORY,
35
40
  REQUEST_ID_HEADER,
41
+ SESSION_HEADER_SEPARATOR,
36
42
  SESSION_ID_HEADER,
37
43
  WRITE_KEY_HEADER,
38
44
  consentCookieName,
39
45
  deviceCookieName,
46
+ formatSessionHeader,
40
47
  isOptedOut,
41
48
  isValidIdentityId,
42
49
  parseConsentCookie,
43
50
  parseDeviceCookie,
51
+ parseSessionHeader,
44
52
  serializeConsentCookie,
45
- serializeDeviceCookie
53
+ serializeDeviceCookie,
54
+ signSessionToken,
55
+ verifySessionToken
46
56
  };
47
57
  //# sourceMappingURL=identity.js.map
package/dist/index.cjs CHANGED
@@ -11,7 +11,7 @@ var _chunkYSAEOYPDcjs = require('./chunk-YSAEOYPD.cjs');
11
11
 
12
12
 
13
13
 
14
- var _chunkJHHCT3GAcjs = require('./chunk-JHHCT3GA.cjs');
14
+ var _chunkAOS53KAVcjs = require('./chunk-AOS53KAV.cjs');
15
15
 
16
16
 
17
17
 
@@ -23,5 +23,5 @@ var _chunkJHHCT3GAcjs = require('./chunk-JHHCT3GA.cjs');
23
23
 
24
24
 
25
25
 
26
- exports.CLIENT_ID_HEADER = _chunkJHHCT3GAcjs.CLIENT_ID_HEADER; exports.CLIENT_SECRET_HEADER = _chunkJHHCT3GAcjs.CLIENT_SECRET_HEADER; exports.CONTRACT_VERSION = _chunkJHHCT3GAcjs.CONTRACT_VERSION; exports.CONTRACT_VERSION_HEADER = _chunkJHHCT3GAcjs.CONTRACT_VERSION_HEADER; exports.DEVICE_ID_HEADER = _chunkJHHCT3GAcjs.DEVICE_ID_HEADER; exports.DataApiError = _chunkYSAEOYPDcjs.DataApiError; exports.REQUEST_ID_HEADER = _chunkJHHCT3GAcjs.REQUEST_ID_HEADER; exports.WRITE_KEY_HEADER = _chunkJHHCT3GAcjs.WRITE_KEY_HEADER; exports.zDate = _chunkYSAEOYPDcjs.zDate; exports.zInstant = _chunkYSAEOYPDcjs.zInstant;
26
+ exports.CLIENT_ID_HEADER = _chunkAOS53KAVcjs.CLIENT_ID_HEADER; exports.CLIENT_SECRET_HEADER = _chunkAOS53KAVcjs.CLIENT_SECRET_HEADER; exports.CONTRACT_VERSION = _chunkAOS53KAVcjs.CONTRACT_VERSION; exports.CONTRACT_VERSION_HEADER = _chunkAOS53KAVcjs.CONTRACT_VERSION_HEADER; exports.DEVICE_ID_HEADER = _chunkAOS53KAVcjs.DEVICE_ID_HEADER; exports.DataApiError = _chunkYSAEOYPDcjs.DataApiError; exports.REQUEST_ID_HEADER = _chunkAOS53KAVcjs.REQUEST_ID_HEADER; exports.WRITE_KEY_HEADER = _chunkAOS53KAVcjs.WRITE_KEY_HEADER; exports.zDate = _chunkYSAEOYPDcjs.zDate; exports.zInstant = _chunkYSAEOYPDcjs.zInstant;
27
27
  //# sourceMappingURL=index.cjs.map
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- export { C as CLIENT_ID_HEADER, a as CLIENT_SECRET_HEADER, b as CONTRACT_VERSION, c as CONTRACT_VERSION_HEADER, D as DEVICE_ID_HEADER, R as REQUEST_ID_HEADER, W as WRITE_KEY_HEADER } from './version-CC4_BBvq.cjs';
2
+ export { C as CLIENT_ID_HEADER, a as CLIENT_SECRET_HEADER, b as CONTRACT_VERSION, c as CONTRACT_VERSION_HEADER, D as DEVICE_ID_HEADER, R as REQUEST_ID_HEADER, W as WRITE_KEY_HEADER } from './version-BANKB6Og.cjs';
3
3
 
4
4
  /**
5
5
  * `@reopt-ai/data-contract` — the wire contract between reopt-data and its
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- export { C as CLIENT_ID_HEADER, a as CLIENT_SECRET_HEADER, b as CONTRACT_VERSION, c as CONTRACT_VERSION_HEADER, D as DEVICE_ID_HEADER, R as REQUEST_ID_HEADER, W as WRITE_KEY_HEADER } from './version-CC4_BBvq.js';
2
+ export { C as CLIENT_ID_HEADER, a as CLIENT_SECRET_HEADER, b as CONTRACT_VERSION, c as CONTRACT_VERSION_HEADER, D as DEVICE_ID_HEADER, R as REQUEST_ID_HEADER, W as WRITE_KEY_HEADER } from './version-BANKB6Og.js';
3
3
 
4
4
  /**
5
5
  * `@reopt-ai/data-contract` — the wire contract between reopt-data and its
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  DEVICE_ID_HEADER,
12
12
  REQUEST_ID_HEADER,
13
13
  WRITE_KEY_HEADER
14
- } from "./chunk-IXPP5K4I.js";
14
+ } from "./chunk-ZCKVMUIQ.js";
15
15
  export {
16
16
  CLIENT_ID_HEADER,
17
17
  CLIENT_SECRET_HEADER,
package/dist/ingest.cjs CHANGED
@@ -17,9 +17,10 @@
17
17
 
18
18
 
19
19
 
20
- var _chunkOGL3P7IHcjs = require('./chunk-OGL3P7IH.cjs');
21
- require('./chunk-KRJPEMFD.cjs');
22
- require('./chunk-JHHCT3GA.cjs');
20
+
21
+ var _chunkBA52YA7Ncjs = require('./chunk-BA52YA7N.cjs');
22
+ require('./chunk-FQSCQSMP.cjs');
23
+ require('./chunk-AOS53KAV.cjs');
23
24
 
24
25
 
25
26
 
@@ -53,5 +54,6 @@ var _chunk3EEANNYNcjs = require('./chunk-3EEANNYN.cjs');
53
54
 
54
55
 
55
56
 
56
- exports.AUTO_EVENT_NAMES = _chunk3EEANNYNcjs.AUTO_EVENT_NAMES; exports.AUTO_EVENT_PROPERTIES = _chunk3EEANNYNcjs.AUTO_EVENT_PROPERTIES; exports.AUTO_EVENT_ROLLUP_KEYS = _chunk3EEANNYNcjs.AUTO_EVENT_ROLLUP_KEYS; exports.INGEST_ERROR_CODES = _chunkOGL3P7IHcjs.INGEST_ERROR_CODES; exports.INGEST_MODES = _chunkOGL3P7IHcjs.INGEST_MODES; exports.INGEST_REJECTION_REASONS = _chunkOGL3P7IHcjs.INGEST_REJECTION_REASONS; exports.MAX_TRACK_PAYLOAD_BYTES = _chunkOGL3P7IHcjs.MAX_TRACK_PAYLOAD_BYTES; exports.RESERVED_EVENT_NAMES = _chunk3EEANNYNcjs.RESERVED_EVENT_NAMES; exports.SCROLL_DEPTH_BUCKETS = _chunk3EEANNYNcjs.SCROLL_DEPTH_BUCKETS; exports.reconcileIngestResponse = _chunkOGL3P7IHcjs.reconcileIngestResponse; exports.scrollDepthBucket = _chunk3EEANNYNcjs.scrollDepthBucket; exports.zDecrementPayload = _chunkOGL3P7IHcjs.zDecrementPayload; exports.zIdentifyPayload = _chunkOGL3P7IHcjs.zIdentifyPayload; exports.zIncrementPayload = _chunkOGL3P7IHcjs.zIncrementPayload; exports.zIngestAcceptedResponse = _chunkOGL3P7IHcjs.zIngestAcceptedResponse; exports.zIngestError = _chunkOGL3P7IHcjs.zIngestError; exports.zIngestErrorCode = _chunkOGL3P7IHcjs.zIngestErrorCode; exports.zIngestMode = _chunkOGL3P7IHcjs.zIngestMode; exports.zIngestOkResponse = _chunkOGL3P7IHcjs.zIngestOkResponse; exports.zIngestRejection = _chunkOGL3P7IHcjs.zIngestRejection; exports.zIngestRejectionReason = _chunkOGL3P7IHcjs.zIngestRejectionReason; exports.zIngestResponse = _chunkOGL3P7IHcjs.zIngestResponse; exports.zTrackHandlerPayload = _chunkOGL3P7IHcjs.zTrackHandlerPayload; exports.zTrackPayload = _chunkOGL3P7IHcjs.zTrackPayload;
57
+
58
+ exports.AUTO_EVENT_NAMES = _chunk3EEANNYNcjs.AUTO_EVENT_NAMES; exports.AUTO_EVENT_PROPERTIES = _chunk3EEANNYNcjs.AUTO_EVENT_PROPERTIES; exports.AUTO_EVENT_ROLLUP_KEYS = _chunk3EEANNYNcjs.AUTO_EVENT_ROLLUP_KEYS; exports.INGEST_ERROR_CODES = _chunkBA52YA7Ncjs.INGEST_ERROR_CODES; exports.INGEST_MODES = _chunkBA52YA7Ncjs.INGEST_MODES; exports.INGEST_REJECTION_REASONS = _chunkBA52YA7Ncjs.INGEST_REJECTION_REASONS; exports.MAX_TRACK_PAYLOAD_BYTES = _chunkBA52YA7Ncjs.MAX_TRACK_PAYLOAD_BYTES; exports.RESERVED_EVENT_NAMES = _chunk3EEANNYNcjs.RESERVED_EVENT_NAMES; exports.SCROLL_DEPTH_BUCKETS = _chunk3EEANNYNcjs.SCROLL_DEPTH_BUCKETS; exports.reconcileIngestResponse = _chunkBA52YA7Ncjs.reconcileIngestResponse; exports.scrollDepthBucket = _chunk3EEANNYNcjs.scrollDepthBucket; exports.zDecrementPayload = _chunkBA52YA7Ncjs.zDecrementPayload; exports.zIdentifyPayload = _chunkBA52YA7Ncjs.zIdentifyPayload; exports.zIncrementPayload = _chunkBA52YA7Ncjs.zIncrementPayload; exports.zIngestAcceptedResponse = _chunkBA52YA7Ncjs.zIngestAcceptedResponse; exports.zIngestError = _chunkBA52YA7Ncjs.zIngestError; exports.zIngestErrorCode = _chunkBA52YA7Ncjs.zIngestErrorCode; exports.zIngestMode = _chunkBA52YA7Ncjs.zIngestMode; exports.zIngestOkResponse = _chunkBA52YA7Ncjs.zIngestOkResponse; exports.zIngestRejection = _chunkBA52YA7Ncjs.zIngestRejection; exports.zIngestRejectionReason = _chunkBA52YA7Ncjs.zIngestRejectionReason; exports.zIngestResponse = _chunkBA52YA7Ncjs.zIngestResponse; exports.zSessionCredential = _chunkBA52YA7Ncjs.zSessionCredential; exports.zTrackHandlerPayload = _chunkBA52YA7Ncjs.zTrackHandlerPayload; exports.zTrackPayload = _chunkBA52YA7Ncjs.zTrackPayload;
57
59
  //# sourceMappingURL=ingest.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/eric/reopt-ai/reopt-data/packages/data-contract/dist/ingest.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,qkDAAC","file":"/Users/eric/reopt-ai/reopt-data/packages/data-contract/dist/ingest.cjs"}
1
+ {"version":3,"sources":["/Users/eric/reopt-ai/reopt-data/packages/data-contract/dist/ingest.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,woDAAC","file":"/Users/eric/reopt-ai/reopt-data/packages/data-contract/dist/ingest.cjs"}
package/dist/ingest.d.cts CHANGED
@@ -127,9 +127,24 @@ declare const zIngestRejection: z.ZodObject<{
127
127
  message: z.ZodOptional<z.ZodString>;
128
128
  }, z.core.$strip>;
129
129
  type IngestRejection = z.infer<typeof zIngestRejection>;
130
+ /**
131
+ * The session ingest filed this batch under, with the token that lets the
132
+ * browser (or a server acting for it) join the same session later with
133
+ * authority — see `signSessionToken` in `./identity`. Browser mode only;
134
+ * absent when the batch carried no sessionable event.
135
+ */
136
+ declare const zSessionCredential: z.ZodObject<{
137
+ id: z.ZodString;
138
+ token: z.ZodString;
139
+ }, z.core.$strip>;
140
+ type SessionCredential = z.infer<typeof zSessionCredential>;
130
141
  /** 200 — accepted and handed to the materialize queue. */
131
142
  declare const zIngestOkResponse: z.ZodObject<{
132
143
  queued: z.ZodBoolean;
144
+ session: z.ZodOptional<z.ZodObject<{
145
+ id: z.ZodString;
146
+ token: z.ZodString;
147
+ }, z.core.$strip>>;
133
148
  accepted: z.ZodNumber;
134
149
  duplicates: z.ZodNumber;
135
150
  rejected: z.ZodArray<z.ZodObject<{
@@ -158,6 +173,10 @@ declare const zIngestOkResponse: z.ZodObject<{
158
173
  declare const zIngestAcceptedResponse: z.ZodObject<{
159
174
  backgroundQueued: z.ZodLiteral<false>;
160
175
  replay: z.ZodLiteral<"unmaterialized-raw-events">;
176
+ session: z.ZodOptional<z.ZodObject<{
177
+ id: z.ZodString;
178
+ token: z.ZodString;
179
+ }, z.core.$strip>>;
161
180
  accepted: z.ZodNumber;
162
181
  duplicates: z.ZodNumber;
163
182
  rejected: z.ZodArray<z.ZodObject<{
@@ -179,6 +198,10 @@ declare const zIngestAcceptedResponse: z.ZodObject<{
179
198
  }, z.core.$strip>;
180
199
  declare const zIngestResponse: z.ZodDiscriminatedUnion<[z.ZodObject<{
181
200
  queued: z.ZodBoolean;
201
+ session: z.ZodOptional<z.ZodObject<{
202
+ id: z.ZodString;
203
+ token: z.ZodString;
204
+ }, z.core.$strip>>;
182
205
  accepted: z.ZodNumber;
183
206
  duplicates: z.ZodNumber;
184
207
  rejected: z.ZodArray<z.ZodObject<{
@@ -200,6 +223,10 @@ declare const zIngestResponse: z.ZodDiscriminatedUnion<[z.ZodObject<{
200
223
  }, z.core.$strip>, z.ZodObject<{
201
224
  backgroundQueued: z.ZodLiteral<false>;
202
225
  replay: z.ZodLiteral<"unmaterialized-raw-events">;
226
+ session: z.ZodOptional<z.ZodObject<{
227
+ id: z.ZodString;
228
+ token: z.ZodString;
229
+ }, z.core.$strip>>;
203
230
  accepted: z.ZodNumber;
204
231
  duplicates: z.ZodNumber;
205
232
  rejected: z.ZodArray<z.ZodObject<{
@@ -237,33 +264,33 @@ declare function reconcileIngestResponse(response: IngestResponse, sentCount: nu
237
264
  */
238
265
  declare const INGEST_ERROR_CODES: readonly ["unauthorized", "invalid_json", "payload_too_large", "empty_batch", "alias_unsupported", "project_without_organization", "validation_failed", "rate_limited", "quota_exceeded", "project_purging", "internal_error"];
239
266
  declare const zIngestErrorCode: z.ZodEnum<{
240
- validation_failed: "validation_failed";
241
267
  unauthorized: "unauthorized";
268
+ validation_failed: "validation_failed";
269
+ rate_limited: "rate_limited";
270
+ internal_error: "internal_error";
242
271
  invalid_json: "invalid_json";
243
272
  payload_too_large: "payload_too_large";
244
273
  empty_batch: "empty_batch";
245
274
  alias_unsupported: "alias_unsupported";
246
275
  project_without_organization: "project_without_organization";
247
- rate_limited: "rate_limited";
248
276
  quota_exceeded: "quota_exceeded";
249
277
  project_purging: "project_purging";
250
- internal_error: "internal_error";
251
278
  }>;
252
279
  type IngestErrorCode = z.infer<typeof zIngestErrorCode>;
253
280
  declare const zIngestError: z.ZodObject<{
254
281
  status: z.ZodNumber;
255
282
  code: z.ZodEnum<{
256
- validation_failed: "validation_failed";
257
283
  unauthorized: "unauthorized";
284
+ validation_failed: "validation_failed";
285
+ rate_limited: "rate_limited";
286
+ internal_error: "internal_error";
258
287
  invalid_json: "invalid_json";
259
288
  payload_too_large: "payload_too_large";
260
289
  empty_batch: "empty_batch";
261
290
  alias_unsupported: "alias_unsupported";
262
291
  project_without_organization: "project_without_organization";
263
- rate_limited: "rate_limited";
264
292
  quota_exceeded: "quota_exceeded";
265
293
  project_purging: "project_purging";
266
- internal_error: "internal_error";
267
294
  }>;
268
295
  error: z.ZodString;
269
296
  message: z.ZodOptional<z.ZodString>;
@@ -272,4 +299,4 @@ declare const zIngestError: z.ZodObject<{
272
299
  }, z.core.$strip>;
273
300
  type IngestError = z.infer<typeof zIngestError>;
274
301
 
275
- export { type IDecrementPayload, type IIdentifyPayload, type IIncrementPayload, INGEST_ERROR_CODES, INGEST_MODES, INGEST_REJECTION_REASONS, type ITrackHandlerPayload, type ITrackPayload, type IngestAcceptedResponse, type IngestError, type IngestErrorCode, type IngestMode, type IngestOkResponse, type IngestRejection, type IngestRejectionReason, type IngestResponse, MAX_TRACK_PAYLOAD_BYTES, reconcileIngestResponse, zDecrementPayload, zIdentifyPayload, zIncrementPayload, zIngestAcceptedResponse, zIngestError, zIngestErrorCode, zIngestMode, zIngestOkResponse, zIngestRejection, zIngestRejectionReason, zIngestResponse, zTrackHandlerPayload, zTrackPayload };
302
+ export { type IDecrementPayload, type IIdentifyPayload, type IIncrementPayload, INGEST_ERROR_CODES, INGEST_MODES, INGEST_REJECTION_REASONS, type ITrackHandlerPayload, type ITrackPayload, type IngestAcceptedResponse, type IngestError, type IngestErrorCode, type IngestMode, type IngestOkResponse, type IngestRejection, type IngestRejectionReason, type IngestResponse, MAX_TRACK_PAYLOAD_BYTES, type SessionCredential, reconcileIngestResponse, zDecrementPayload, zIdentifyPayload, zIncrementPayload, zIngestAcceptedResponse, zIngestError, zIngestErrorCode, zIngestMode, zIngestOkResponse, zIngestRejection, zIngestRejectionReason, zIngestResponse, zSessionCredential, zTrackHandlerPayload, zTrackPayload };
package/dist/ingest.d.ts CHANGED
@@ -127,9 +127,24 @@ declare const zIngestRejection: z.ZodObject<{
127
127
  message: z.ZodOptional<z.ZodString>;
128
128
  }, z.core.$strip>;
129
129
  type IngestRejection = z.infer<typeof zIngestRejection>;
130
+ /**
131
+ * The session ingest filed this batch under, with the token that lets the
132
+ * browser (or a server acting for it) join the same session later with
133
+ * authority — see `signSessionToken` in `./identity`. Browser mode only;
134
+ * absent when the batch carried no sessionable event.
135
+ */
136
+ declare const zSessionCredential: z.ZodObject<{
137
+ id: z.ZodString;
138
+ token: z.ZodString;
139
+ }, z.core.$strip>;
140
+ type SessionCredential = z.infer<typeof zSessionCredential>;
130
141
  /** 200 — accepted and handed to the materialize queue. */
131
142
  declare const zIngestOkResponse: z.ZodObject<{
132
143
  queued: z.ZodBoolean;
144
+ session: z.ZodOptional<z.ZodObject<{
145
+ id: z.ZodString;
146
+ token: z.ZodString;
147
+ }, z.core.$strip>>;
133
148
  accepted: z.ZodNumber;
134
149
  duplicates: z.ZodNumber;
135
150
  rejected: z.ZodArray<z.ZodObject<{
@@ -158,6 +173,10 @@ declare const zIngestOkResponse: z.ZodObject<{
158
173
  declare const zIngestAcceptedResponse: z.ZodObject<{
159
174
  backgroundQueued: z.ZodLiteral<false>;
160
175
  replay: z.ZodLiteral<"unmaterialized-raw-events">;
176
+ session: z.ZodOptional<z.ZodObject<{
177
+ id: z.ZodString;
178
+ token: z.ZodString;
179
+ }, z.core.$strip>>;
161
180
  accepted: z.ZodNumber;
162
181
  duplicates: z.ZodNumber;
163
182
  rejected: z.ZodArray<z.ZodObject<{
@@ -179,6 +198,10 @@ declare const zIngestAcceptedResponse: z.ZodObject<{
179
198
  }, z.core.$strip>;
180
199
  declare const zIngestResponse: z.ZodDiscriminatedUnion<[z.ZodObject<{
181
200
  queued: z.ZodBoolean;
201
+ session: z.ZodOptional<z.ZodObject<{
202
+ id: z.ZodString;
203
+ token: z.ZodString;
204
+ }, z.core.$strip>>;
182
205
  accepted: z.ZodNumber;
183
206
  duplicates: z.ZodNumber;
184
207
  rejected: z.ZodArray<z.ZodObject<{
@@ -200,6 +223,10 @@ declare const zIngestResponse: z.ZodDiscriminatedUnion<[z.ZodObject<{
200
223
  }, z.core.$strip>, z.ZodObject<{
201
224
  backgroundQueued: z.ZodLiteral<false>;
202
225
  replay: z.ZodLiteral<"unmaterialized-raw-events">;
226
+ session: z.ZodOptional<z.ZodObject<{
227
+ id: z.ZodString;
228
+ token: z.ZodString;
229
+ }, z.core.$strip>>;
203
230
  accepted: z.ZodNumber;
204
231
  duplicates: z.ZodNumber;
205
232
  rejected: z.ZodArray<z.ZodObject<{
@@ -237,33 +264,33 @@ declare function reconcileIngestResponse(response: IngestResponse, sentCount: nu
237
264
  */
238
265
  declare const INGEST_ERROR_CODES: readonly ["unauthorized", "invalid_json", "payload_too_large", "empty_batch", "alias_unsupported", "project_without_organization", "validation_failed", "rate_limited", "quota_exceeded", "project_purging", "internal_error"];
239
266
  declare const zIngestErrorCode: z.ZodEnum<{
240
- validation_failed: "validation_failed";
241
267
  unauthorized: "unauthorized";
268
+ validation_failed: "validation_failed";
269
+ rate_limited: "rate_limited";
270
+ internal_error: "internal_error";
242
271
  invalid_json: "invalid_json";
243
272
  payload_too_large: "payload_too_large";
244
273
  empty_batch: "empty_batch";
245
274
  alias_unsupported: "alias_unsupported";
246
275
  project_without_organization: "project_without_organization";
247
- rate_limited: "rate_limited";
248
276
  quota_exceeded: "quota_exceeded";
249
277
  project_purging: "project_purging";
250
- internal_error: "internal_error";
251
278
  }>;
252
279
  type IngestErrorCode = z.infer<typeof zIngestErrorCode>;
253
280
  declare const zIngestError: z.ZodObject<{
254
281
  status: z.ZodNumber;
255
282
  code: z.ZodEnum<{
256
- validation_failed: "validation_failed";
257
283
  unauthorized: "unauthorized";
284
+ validation_failed: "validation_failed";
285
+ rate_limited: "rate_limited";
286
+ internal_error: "internal_error";
258
287
  invalid_json: "invalid_json";
259
288
  payload_too_large: "payload_too_large";
260
289
  empty_batch: "empty_batch";
261
290
  alias_unsupported: "alias_unsupported";
262
291
  project_without_organization: "project_without_organization";
263
- rate_limited: "rate_limited";
264
292
  quota_exceeded: "quota_exceeded";
265
293
  project_purging: "project_purging";
266
- internal_error: "internal_error";
267
294
  }>;
268
295
  error: z.ZodString;
269
296
  message: z.ZodOptional<z.ZodString>;
@@ -272,4 +299,4 @@ declare const zIngestError: z.ZodObject<{
272
299
  }, z.core.$strip>;
273
300
  type IngestError = z.infer<typeof zIngestError>;
274
301
 
275
- export { type IDecrementPayload, type IIdentifyPayload, type IIncrementPayload, INGEST_ERROR_CODES, INGEST_MODES, INGEST_REJECTION_REASONS, type ITrackHandlerPayload, type ITrackPayload, type IngestAcceptedResponse, type IngestError, type IngestErrorCode, type IngestMode, type IngestOkResponse, type IngestRejection, type IngestRejectionReason, type IngestResponse, MAX_TRACK_PAYLOAD_BYTES, reconcileIngestResponse, zDecrementPayload, zIdentifyPayload, zIncrementPayload, zIngestAcceptedResponse, zIngestError, zIngestErrorCode, zIngestMode, zIngestOkResponse, zIngestRejection, zIngestRejectionReason, zIngestResponse, zTrackHandlerPayload, zTrackPayload };
302
+ export { type IDecrementPayload, type IIdentifyPayload, type IIncrementPayload, INGEST_ERROR_CODES, INGEST_MODES, INGEST_REJECTION_REASONS, type ITrackHandlerPayload, type ITrackPayload, type IngestAcceptedResponse, type IngestError, type IngestErrorCode, type IngestMode, type IngestOkResponse, type IngestRejection, type IngestRejectionReason, type IngestResponse, MAX_TRACK_PAYLOAD_BYTES, type SessionCredential, reconcileIngestResponse, zDecrementPayload, zIdentifyPayload, zIncrementPayload, zIngestAcceptedResponse, zIngestError, zIngestErrorCode, zIngestMode, zIngestOkResponse, zIngestRejection, zIngestRejectionReason, zIngestResponse, zSessionCredential, zTrackHandlerPayload, zTrackPayload };
package/dist/ingest.js CHANGED
@@ -15,11 +15,12 @@ import {
15
15
  zIngestRejection,
16
16
  zIngestRejectionReason,
17
17
  zIngestResponse,
18
+ zSessionCredential,
18
19
  zTrackHandlerPayload,
19
20
  zTrackPayload
20
- } from "./chunk-5BRCHDS3.js";
21
- import "./chunk-6ZJOC4NJ.js";
22
- import "./chunk-IXPP5K4I.js";
21
+ } from "./chunk-DUJSYMYY.js";
22
+ import "./chunk-FMOKJTQD.js";
23
+ import "./chunk-ZCKVMUIQ.js";
23
24
  import {
24
25
  AUTO_EVENT_NAMES,
25
26
  AUTO_EVENT_PROPERTIES,
@@ -51,6 +52,7 @@ export {
51
52
  zIngestRejection,
52
53
  zIngestRejectionReason,
53
54
  zIngestResponse,
55
+ zSessionCredential,
54
56
  zTrackHandlerPayload,
55
57
  zTrackPayload
56
58
  };
package/dist/query.cjs CHANGED
@@ -41,7 +41,7 @@ var _chunkFUGY5ANJcjs = require('./chunk-FUGY5ANJ.cjs');
41
41
 
42
42
 
43
43
  var _chunkYSAEOYPDcjs = require('./chunk-YSAEOYPD.cjs');
44
- require('./chunk-JHHCT3GA.cjs');
44
+ require('./chunk-AOS53KAV.cjs');
45
45
 
46
46
 
47
47