zeno.id 0.4.0 → 0.5.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.
@@ -1,7 +1,7 @@
1
1
  import { a as ApiOptions, i as ApiKey, n as ProxyOptions, r as createProxy, t as ProxyHandler } from "./proxy-CUZ-Jwgy.cjs";
2
2
  //#region src/server/index.d.ts
3
3
  /** Every signal an event checks, the keys of its `signals`. */
4
- declare const SIGNALS: readonly ['automation', 'headless', 'software-renderer', 'tampering', 'timezone-mismatch', 'privacy-settings', 'vpn', 'proxy', 'tor', 'datacenter', 'abusive-ip', 'incognito', 'virtual-machine', 'developer-tools', 'ai-agent', 'privacy-browser', 'rare-device', 'high-activity', 'replayed', 'residential-proxy', 'private-relay', 'forged-payload', 'stored-id-rejected'];
4
+ declare const SIGNALS: readonly ['automation', 'headless', 'software-renderer', 'tampering', 'timezone-mismatch', 'privacy-settings', 'vpn', 'proxy', 'tor', 'datacenter', 'abusive-ip', 'incognito', 'virtual-machine', 'developer-tools', 'ai-agent', 'privacy-browser', 'high-activity', 'replayed', 'residential-proxy', 'private-relay', 'forged-payload', 'stored-id-rejected'];
5
5
  type Signal = (typeof SIGNALS)[number];
6
6
  /** The bot verdict: a known good bot (a search engine's crawler), a bad one (automation, a headless browser), or none. */
7
7
  type Bot = 'good' | 'bad' | 'not-detected';
@@ -11,7 +11,7 @@ type Bot = 'good' | 'bad' | 'not-detected';
11
11
  * Chromium's static storage quota, the same in normal and private windows; no WebGL or canvas; too few devices were
12
12
  * seen yet to call hardware rare; the request carried no nonce.
13
13
  */
14
- type SignalReason = 'ip-lookup-failed' | 'ip-lookup-timeout' | 'no-time-zone' | 'no-ip-time-zone' | 'probe-timeout' | 'probe-failed' | 'not-collected' | 'no-webgl' | 'no-canvas' | 'too-few-visitors' | 'no-nonce';
14
+ type SignalReason = 'ip-lookup-failed' | 'ip-lookup-timeout' | 'no-time-zone' | 'no-ip-time-zone' | 'probe-timeout' | 'probe-failed' | 'not-collected' | 'no-webgl' | 'no-canvas' | 'no-nonce';
15
15
  type Confidence = 'high' | 'medium' | 'low';
16
16
  /** A contradiction in the device's browser data, in `signals.tampering`. */
17
17
  type Contradiction = 'platform-not-user-agent-os' | 'client-hints-not-user-agent-os' | 'gpu-not-user-agent-os' | 'browser-functions-overridden' | 'chromium-without-client-hints' | 'usable-area-larger-than-screen' | 'no-languages' | 'client-hints-blank' | 'client-hints-malformed' | 'clock-offset-not-time-zone' | 'standard-signals-missing' | 'window-larger-than-screen' | 'screen-not-css-screen' | 'codecs-not-claimed-browser' | 'api-surface-not-claimed-browser' | 'api-surface-rare-for-claimed-browser' | 'gpu-output-not-claimed-renderer' | 'canvas-challenge-not-consensus' | 'user-agent-not-request-header';
@@ -326,6 +326,16 @@ type Event = {
326
326
  rawDeviceAttributes?: RawDeviceAttributes;
327
327
  /** Only on getEvent and verify, not in webhooks or sealed results. */
328
328
  velocity?: Record<'5m' | '1h' | '24h', Velocity>;
329
+ /**
330
+ * Your other users this event ties to, by external id: those sharing its `visitorId`, its residential IP
331
+ * (`residentialIp`), and both its `broadVisitorId` and its IP (`broadVisitorId`, as a broad visitor ID isn't strong
332
+ * enough on its own). Up to 25 of each. Only on getEvent and verify, not in webhooks or sealed results.
333
+ */
334
+ related?: {
335
+ visitorId: string[];
336
+ residentialIp: string[];
337
+ broadVisitorId: string[];
338
+ };
329
339
  } & GlobalFields;
330
340
  /** A list filter takes one value, or several to match any of. */
331
341
  type AnyOf<T> = T | T[];
@@ -403,10 +413,11 @@ type Visitor = {
403
413
  })[];
404
414
  };
405
415
  /**
406
- * What relates two users: the built-in `visitor-id` (a browser, from events only) and `ip`, or a type of your own like
407
- * `phone` or `referral` (a lowercase letter, then up to 31 lowercase letters, digits, `_` or `-`).
416
+ * What relates two users: the built-in `visitor-id` (a browser), `broad-visitor-id` (its hardware), `residential-ip`
417
+ * (an ip of an internet provider, not a VPN, proxy or mobile network), all three from events only, and `ip`, or a type
418
+ * of your own like `phone` or `referral` (a lowercase letter, then up to 31 lowercase letters, digits, `_` or `-`).
408
419
  */
409
- type RelatedType = 'visitor-id' | 'ip' | (string & {});
420
+ type RelatedType = 'visitor-id' | 'broad-visitor-id' | 'ip' | 'residential-ip' | (string & {});
410
421
  /**
411
422
  * `identifier`, a value several users can share (a visitor id, a phone number); `relation`, a direct tie between two
412
423
  * users (a referral, an invite). A type of your own keeps the kind its first relation gave it.
@@ -461,7 +472,7 @@ type Related = {
461
472
  type?: RelatedType;
462
473
  /**
463
474
  * Every other user reached, heaviest first, each with its `weight` to the asked one: what the two share combined
464
- * (`1 - Π(1 - weight)`, so with the default weights two shared ips make 0.64 and a browser and an ip 0.88),
475
+ * (`1 - Π(1 - weight)`, so with the default weights two shared ips make 0.44 and a browser and an ip 0.93),
465
476
  * multiplied along the strongest path for a user further away. With the users each shares a value with or is
466
477
  * related to.
467
478
  */
@@ -478,21 +489,6 @@ type RelatedUser = {
478
489
  externalId: string;
479
490
  createdAt: string;
480
491
  };
481
- /**
482
- * A value more than one user shares, or for a relation type the two users it ties; `count` is how many users share it
483
- * (2 for a relation).
484
- */
485
- type SharedValue = {
486
- type: RelatedType;
487
- weight: number;
488
- value: string;
489
- count: number;
490
- } | {
491
- type: RelatedType;
492
- weight: number;
493
- externalIds: [string, string];
494
- count: number;
495
- };
496
492
  /**
497
493
  * A relation added by hand: an ip seen by another system (`type: 'ip'`), a value of a type of your own (`{ type:
498
494
  * 'phone', value }`), or a tie between two of your users (`{ type: 'referral', relatedExternalId }`). Its weight isn't
@@ -508,8 +504,6 @@ type RelationTarget = {
508
504
  relatedExternalId: string;
509
505
  };
510
506
  type RelationInput = RelationTarget & {
511
- /** Your own word for what happened, like `checkout` or `signup`; up to 1024 characters. */
512
- action?: string;
513
507
  /** When it happened (a Date, an ISO string or epoch milliseconds), now by default; never in the future. */
514
508
  at?: Date | string | number;
515
509
  };
@@ -528,7 +522,6 @@ type RelationRemoval = {
528
522
  };
529
523
  /** The relation as the api stored it: what you sent, with `at` as an ISO string. */
530
524
  type Relation = RelationTarget & {
531
- action?: string;
532
525
  at?: string;
533
526
  };
534
527
  /** A relation as added: `linkWrite` says whether this call made a new link, the billed unit (a link added before isn't). */
@@ -687,11 +680,6 @@ declare const createClient: (apiKey: ApiKey, options?: ClientOptions) => {
687
680
  limit?: number;
688
681
  cursor?: string;
689
682
  }) => Promise<Page<RelatedUser>>;
690
- /** The values of a type more than one of your users share, most shared first, with the type's weight. */
691
- getSharedValues: (type: RelatedType, page?: {
692
- limit?: number;
693
- cursor?: string;
694
- }) => Promise<Page<SharedValue>>;
695
683
  /**
696
684
  * Your users related to one through shared values or relations of every type, or of one `type`, up to `depth`
697
685
  * (1 to 5, 1 by default) hops away, heaviest first, each with its weight.
@@ -714,7 +702,7 @@ declare const createClient: (apiKey: ApiKey, options?: ClientOptions) => {
714
702
  /** The client `createClient` makes. */
715
703
  type Client = ReturnType<typeof createClient>;
716
704
  /** A webhook delivery's body: the event, without its velocity. */
717
- type WebhookEvent = Omit<Event, 'broadVisitorId' | 'proximity' | 'rawDeviceAttributes' | 'velocity' | keyof GlobalFields>;
705
+ type WebhookEvent = Omit<Event, 'broadVisitorId' | 'proximity' | 'rawDeviceAttributes' | 'velocity' | 'related' | keyof GlobalFields>;
718
706
  /**
719
707
  * Checks a webhook delivery's Zeno-Signature header against the project's webhook secret, and that it was signed in the
720
708
  * last `tolerance` seconds, so a captured delivery can't be replayed later. Pass the raw body. Resolves to the event
@@ -753,4 +741,4 @@ type UnsealOptions = {
753
741
  */
754
742
  declare const unsealResult: (sealed: string | undefined | null, options: UnsealOptions) => Promise<VerifyResult>;
755
743
  //#endregion
756
- export { AddedRelation, type ApiOptions, Bot, BotType, Client, ClientOptions, Confidence, Connection, Contradiction, Embed, Event, EventBot, EventBrowser, EventIp, ForgedPayloadIndicator, GlobalFields, Metadata, NetworkOwnerType, Outcome, Page, type ProxyHandler, type ProxyOptions, RawDeviceAttributes, Related, RelatedKind, RelatedType, RelatedUser, RelatedValue, RelatedValues, Relation, RelationInput, RelationRemoval, SIGNALS, SearchEvent, SearchFilters, SearchResult, SharedValue, Signal, SignalDetails, SignalReason, SignalResult, Signals, UnsealOptions, Velocity, Verdict, VerdictAction, VerdictReason, VerifyCheck, VerifyOptions, VerifyResult, VirtualMachineIndicator, Visitor, WebhookEvent, ZenoError, ZenoErrorCode, createClient, createProxy, unsealResult, verifyWebhook };
744
+ export { AddedRelation, type ApiOptions, Bot, BotType, Client, ClientOptions, Confidence, Connection, Contradiction, Embed, Event, EventBot, EventBrowser, EventIp, ForgedPayloadIndicator, GlobalFields, Metadata, NetworkOwnerType, Outcome, Page, type ProxyHandler, type ProxyOptions, RawDeviceAttributes, Related, RelatedKind, RelatedType, RelatedUser, RelatedValue, RelatedValues, Relation, RelationInput, RelationRemoval, SIGNALS, SearchEvent, SearchFilters, SearchResult, Signal, SignalDetails, SignalReason, SignalResult, Signals, UnsealOptions, Velocity, Verdict, VerdictAction, VerdictReason, VerifyCheck, VerifyOptions, VerifyResult, VirtualMachineIndicator, Visitor, WebhookEvent, ZenoError, ZenoErrorCode, createClient, createProxy, unsealResult, verifyWebhook };
@@ -1,7 +1,7 @@
1
1
  import { a as ApiOptions, i as ApiKey, n as ProxyOptions, r as createProxy, t as ProxyHandler } from "./proxy-CUZ-Jwgy.js";
2
2
  //#region src/server/index.d.ts
3
3
  /** Every signal an event checks, the keys of its `signals`. */
4
- declare const SIGNALS: readonly ['automation', 'headless', 'software-renderer', 'tampering', 'timezone-mismatch', 'privacy-settings', 'vpn', 'proxy', 'tor', 'datacenter', 'abusive-ip', 'incognito', 'virtual-machine', 'developer-tools', 'ai-agent', 'privacy-browser', 'rare-device', 'high-activity', 'replayed', 'residential-proxy', 'private-relay', 'forged-payload', 'stored-id-rejected'];
4
+ declare const SIGNALS: readonly ['automation', 'headless', 'software-renderer', 'tampering', 'timezone-mismatch', 'privacy-settings', 'vpn', 'proxy', 'tor', 'datacenter', 'abusive-ip', 'incognito', 'virtual-machine', 'developer-tools', 'ai-agent', 'privacy-browser', 'high-activity', 'replayed', 'residential-proxy', 'private-relay', 'forged-payload', 'stored-id-rejected'];
5
5
  type Signal = (typeof SIGNALS)[number];
6
6
  /** The bot verdict: a known good bot (a search engine's crawler), a bad one (automation, a headless browser), or none. */
7
7
  type Bot = 'good' | 'bad' | 'not-detected';
@@ -11,7 +11,7 @@ type Bot = 'good' | 'bad' | 'not-detected';
11
11
  * Chromium's static storage quota, the same in normal and private windows; no WebGL or canvas; too few devices were
12
12
  * seen yet to call hardware rare; the request carried no nonce.
13
13
  */
14
- type SignalReason = 'ip-lookup-failed' | 'ip-lookup-timeout' | 'no-time-zone' | 'no-ip-time-zone' | 'probe-timeout' | 'probe-failed' | 'not-collected' | 'no-webgl' | 'no-canvas' | 'too-few-visitors' | 'no-nonce';
14
+ type SignalReason = 'ip-lookup-failed' | 'ip-lookup-timeout' | 'no-time-zone' | 'no-ip-time-zone' | 'probe-timeout' | 'probe-failed' | 'not-collected' | 'no-webgl' | 'no-canvas' | 'no-nonce';
15
15
  type Confidence = 'high' | 'medium' | 'low';
16
16
  /** A contradiction in the device's browser data, in `signals.tampering`. */
17
17
  type Contradiction = 'platform-not-user-agent-os' | 'client-hints-not-user-agent-os' | 'gpu-not-user-agent-os' | 'browser-functions-overridden' | 'chromium-without-client-hints' | 'usable-area-larger-than-screen' | 'no-languages' | 'client-hints-blank' | 'client-hints-malformed' | 'clock-offset-not-time-zone' | 'standard-signals-missing' | 'window-larger-than-screen' | 'screen-not-css-screen' | 'codecs-not-claimed-browser' | 'api-surface-not-claimed-browser' | 'api-surface-rare-for-claimed-browser' | 'gpu-output-not-claimed-renderer' | 'canvas-challenge-not-consensus' | 'user-agent-not-request-header';
@@ -326,6 +326,16 @@ type Event = {
326
326
  rawDeviceAttributes?: RawDeviceAttributes;
327
327
  /** Only on getEvent and verify, not in webhooks or sealed results. */
328
328
  velocity?: Record<'5m' | '1h' | '24h', Velocity>;
329
+ /**
330
+ * Your other users this event ties to, by external id: those sharing its `visitorId`, its residential IP
331
+ * (`residentialIp`), and both its `broadVisitorId` and its IP (`broadVisitorId`, as a broad visitor ID isn't strong
332
+ * enough on its own). Up to 25 of each. Only on getEvent and verify, not in webhooks or sealed results.
333
+ */
334
+ related?: {
335
+ visitorId: string[];
336
+ residentialIp: string[];
337
+ broadVisitorId: string[];
338
+ };
329
339
  } & GlobalFields;
330
340
  /** A list filter takes one value, or several to match any of. */
331
341
  type AnyOf<T> = T | T[];
@@ -403,10 +413,11 @@ type Visitor = {
403
413
  })[];
404
414
  };
405
415
  /**
406
- * What relates two users: the built-in `visitor-id` (a browser, from events only) and `ip`, or a type of your own like
407
- * `phone` or `referral` (a lowercase letter, then up to 31 lowercase letters, digits, `_` or `-`).
416
+ * What relates two users: the built-in `visitor-id` (a browser), `broad-visitor-id` (its hardware), `residential-ip`
417
+ * (an ip of an internet provider, not a VPN, proxy or mobile network), all three from events only, and `ip`, or a type
418
+ * of your own like `phone` or `referral` (a lowercase letter, then up to 31 lowercase letters, digits, `_` or `-`).
408
419
  */
409
- type RelatedType = 'visitor-id' | 'ip' | (string & {});
420
+ type RelatedType = 'visitor-id' | 'broad-visitor-id' | 'ip' | 'residential-ip' | (string & {});
410
421
  /**
411
422
  * `identifier`, a value several users can share (a visitor id, a phone number); `relation`, a direct tie between two
412
423
  * users (a referral, an invite). A type of your own keeps the kind its first relation gave it.
@@ -461,7 +472,7 @@ type Related = {
461
472
  type?: RelatedType;
462
473
  /**
463
474
  * Every other user reached, heaviest first, each with its `weight` to the asked one: what the two share combined
464
- * (`1 - Π(1 - weight)`, so with the default weights two shared ips make 0.64 and a browser and an ip 0.88),
475
+ * (`1 - Π(1 - weight)`, so with the default weights two shared ips make 0.44 and a browser and an ip 0.93),
465
476
  * multiplied along the strongest path for a user further away. With the users each shares a value with or is
466
477
  * related to.
467
478
  */
@@ -478,21 +489,6 @@ type RelatedUser = {
478
489
  externalId: string;
479
490
  createdAt: string;
480
491
  };
481
- /**
482
- * A value more than one user shares, or for a relation type the two users it ties; `count` is how many users share it
483
- * (2 for a relation).
484
- */
485
- type SharedValue = {
486
- type: RelatedType;
487
- weight: number;
488
- value: string;
489
- count: number;
490
- } | {
491
- type: RelatedType;
492
- weight: number;
493
- externalIds: [string, string];
494
- count: number;
495
- };
496
492
  /**
497
493
  * A relation added by hand: an ip seen by another system (`type: 'ip'`), a value of a type of your own (`{ type:
498
494
  * 'phone', value }`), or a tie between two of your users (`{ type: 'referral', relatedExternalId }`). Its weight isn't
@@ -508,8 +504,6 @@ type RelationTarget = {
508
504
  relatedExternalId: string;
509
505
  };
510
506
  type RelationInput = RelationTarget & {
511
- /** Your own word for what happened, like `checkout` or `signup`; up to 1024 characters. */
512
- action?: string;
513
507
  /** When it happened (a Date, an ISO string or epoch milliseconds), now by default; never in the future. */
514
508
  at?: Date | string | number;
515
509
  };
@@ -528,7 +522,6 @@ type RelationRemoval = {
528
522
  };
529
523
  /** The relation as the api stored it: what you sent, with `at` as an ISO string. */
530
524
  type Relation = RelationTarget & {
531
- action?: string;
532
525
  at?: string;
533
526
  };
534
527
  /** A relation as added: `linkWrite` says whether this call made a new link, the billed unit (a link added before isn't). */
@@ -687,11 +680,6 @@ declare const createClient: (apiKey: ApiKey, options?: ClientOptions) => {
687
680
  limit?: number;
688
681
  cursor?: string;
689
682
  }) => Promise<Page<RelatedUser>>;
690
- /** The values of a type more than one of your users share, most shared first, with the type's weight. */
691
- getSharedValues: (type: RelatedType, page?: {
692
- limit?: number;
693
- cursor?: string;
694
- }) => Promise<Page<SharedValue>>;
695
683
  /**
696
684
  * Your users related to one through shared values or relations of every type, or of one `type`, up to `depth`
697
685
  * (1 to 5, 1 by default) hops away, heaviest first, each with its weight.
@@ -714,7 +702,7 @@ declare const createClient: (apiKey: ApiKey, options?: ClientOptions) => {
714
702
  /** The client `createClient` makes. */
715
703
  type Client = ReturnType<typeof createClient>;
716
704
  /** A webhook delivery's body: the event, without its velocity. */
717
- type WebhookEvent = Omit<Event, 'broadVisitorId' | 'proximity' | 'rawDeviceAttributes' | 'velocity' | keyof GlobalFields>;
705
+ type WebhookEvent = Omit<Event, 'broadVisitorId' | 'proximity' | 'rawDeviceAttributes' | 'velocity' | 'related' | keyof GlobalFields>;
718
706
  /**
719
707
  * Checks a webhook delivery's Zeno-Signature header against the project's webhook secret, and that it was signed in the
720
708
  * last `tolerance` seconds, so a captured delivery can't be replayed later. Pass the raw body. Resolves to the event
@@ -753,4 +741,4 @@ type UnsealOptions = {
753
741
  */
754
742
  declare const unsealResult: (sealed: string | undefined | null, options: UnsealOptions) => Promise<VerifyResult>;
755
743
  //#endregion
756
- export { AddedRelation, type ApiOptions, Bot, BotType, Client, ClientOptions, Confidence, Connection, Contradiction, Embed, Event, EventBot, EventBrowser, EventIp, ForgedPayloadIndicator, GlobalFields, Metadata, NetworkOwnerType, Outcome, Page, type ProxyHandler, type ProxyOptions, RawDeviceAttributes, Related, RelatedKind, RelatedType, RelatedUser, RelatedValue, RelatedValues, Relation, RelationInput, RelationRemoval, SIGNALS, SearchEvent, SearchFilters, SearchResult, SharedValue, Signal, SignalDetails, SignalReason, SignalResult, Signals, UnsealOptions, Velocity, Verdict, VerdictAction, VerdictReason, VerifyCheck, VerifyOptions, VerifyResult, VirtualMachineIndicator, Visitor, WebhookEvent, ZenoError, ZenoErrorCode, createClient, createProxy, unsealResult, verifyWebhook };
744
+ export { AddedRelation, type ApiOptions, Bot, BotType, Client, ClientOptions, Confidence, Connection, Contradiction, Embed, Event, EventBot, EventBrowser, EventIp, ForgedPayloadIndicator, GlobalFields, Metadata, NetworkOwnerType, Outcome, Page, type ProxyHandler, type ProxyOptions, RawDeviceAttributes, Related, RelatedKind, RelatedType, RelatedUser, RelatedValue, RelatedValues, Relation, RelationInput, RelationRemoval, SIGNALS, SearchEvent, SearchFilters, SearchResult, Signal, SignalDetails, SignalReason, SignalResult, Signals, UnsealOptions, Velocity, Verdict, VerdictAction, VerdictReason, VerifyCheck, VerifyOptions, VerifyResult, VirtualMachineIndicator, Visitor, WebhookEvent, ZenoError, ZenoErrorCode, createClient, createProxy, unsealResult, verifyWebhook };