@oxyhq/contracts 0.14.0 → 0.14.1

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.
@@ -315,3 +315,45 @@ export type DeviceHubTicketIssueRequest = z.infer<typeof deviceHubTicketIssueReq
315
315
  export type DeviceHubTicketIssueResponse = z.infer<typeof deviceHubTicketIssueResponseSchema>;
316
316
  export type DeviceHubTicketRedeemRequest = z.infer<typeof deviceHubTicketRedeemRequestSchema>;
317
317
  export type DeviceHubTicketRedeemResponse = z.infer<typeof deviceHubTicketRedeemResponseSchema>;
318
+ /**
319
+ * Name of the token-free Socket.IO event emitted to room `user:<userId>` on
320
+ * every DeviceSession mutation that changes what is signed in for that user.
321
+ *
322
+ * This is a pure SIGNAL — it carries NO access token, NO deviceSecret and NO
323
+ * account bodies. A client that receives it re-fetches its authenticated
324
+ * session/account state (`GET /session/device/state`, `GET /accounts`). Unlike
325
+ * `session_state` (scoped to `device:<deviceId>`, i.e. a single origin), this
326
+ * reaches ALL of a user's connected sockets across their devices/origins so
327
+ * every Oxy app reflects an add / switch / signout instantly.
328
+ */
329
+ export declare const SESSION_ACCOUNTS_CHANGED_EVENT = "session_accounts_changed";
330
+ /**
331
+ * Why the signed-in set changed:
332
+ * - `login` — a brand-new session was minted for the user (QR / cross-app authorize)
333
+ * - `add` — an account was registered onto a device set
334
+ * - `switch` — the active account on a device changed
335
+ * - `signout` — one or all accounts were signed out of a device
336
+ * - `revoke` — a dead/revoked account was healed out of a device set
337
+ */
338
+ export declare const sessionAccountsChangedReasonSchema: z.ZodEnum<["login", "add", "switch", "signout", "revoke"]>;
339
+ /**
340
+ * Payload of {@link SESSION_ACCOUNTS_CHANGED_EVENT}. `revision` is the mutated
341
+ * DeviceSession revision for device-scoped reasons (`add`/`switch`/`signout`/
342
+ * `revoke`); for `login` (no device mutation at emit time) it is `0`. The
343
+ * payload is deliberately minimal and secret-free — the client refetches.
344
+ */
345
+ export declare const sessionAccountsChangedEventSchema: z.ZodObject<{
346
+ userId: z.ZodString;
347
+ revision: z.ZodNumber;
348
+ reason: z.ZodEnum<["login", "add", "switch", "signout", "revoke"]>;
349
+ }, "strip", z.ZodTypeAny, {
350
+ userId: string;
351
+ reason: "login" | "add" | "switch" | "signout" | "revoke";
352
+ revision: number;
353
+ }, {
354
+ userId: string;
355
+ reason: "login" | "add" | "switch" | "signout" | "revoke";
356
+ revision: number;
357
+ }>;
358
+ export type SessionAccountsChangedReason = z.infer<typeof sessionAccountsChangedReasonSchema>;
359
+ export type SessionAccountsChangedEvent = z.infer<typeof sessionAccountsChangedEventSchema>;
@@ -27,7 +27,7 @@ export { publicCardSchema, signedPublicCardSchema, realLifeAttestationRecordSche
27
27
  export type { CardTrustTier, PersonhoodStatus, PublicCard, SignedPublicCard, RealLifeAttestationRecord, RealLifeAttestationResult, ValidationVerdict, ValidationRequestStatus, ValidationVerdictRecord, ValidationOpenRequest, ValidationOpenResult, ValidationRequestSummary, ValidationVoteResult, PersonhoodVouchRecord, PersonhoodBreakdown, PersonhoodStatusResult, VouchResult, CredentialStatus, CredentialRecord, VerifiableCredentialResponse, CredentialIssueResult, CredentialListResult, CredentialVerifyResult, } from './civic';
28
28
  export { linkPreviewSchema, linkPreviewBatchRequestSchema, linkPreviewBatchResponseSchema, linkPreviewResponseSchema, } from './links';
29
29
  export type { LinkPreviewStatus, LinkPreview, LinkPreviewBatchRequest, LinkPreviewBatchResponse, } from './links';
30
- export { sessionAccountSchema, deviceSessionStateSchema, activeTokenSchema, deviceSessionSyncSchema, deviceTokenMintRequestSchema, deviceTokenMintResponseSchema, deviceHubTicketIssueRequestSchema, deviceHubTicketIssueResponseSchema, deviceHubTicketRedeemRequestSchema, deviceHubTicketRedeemResponseSchema, } from './deviceSession';
31
- export type { SessionAccount, DeviceSessionState, ActiveToken, DeviceSessionSync, DeviceTokenMintRequest, DeviceTokenMintResponse, DeviceHubTicketIssueRequest, DeviceHubTicketIssueResponse, DeviceHubTicketRedeemRequest, DeviceHubTicketRedeemResponse, } from './deviceSession';
30
+ export { sessionAccountSchema, deviceSessionStateSchema, activeTokenSchema, deviceSessionSyncSchema, deviceTokenMintRequestSchema, deviceTokenMintResponseSchema, deviceHubTicketIssueRequestSchema, deviceHubTicketIssueResponseSchema, deviceHubTicketRedeemRequestSchema, deviceHubTicketRedeemResponseSchema, SESSION_ACCOUNTS_CHANGED_EVENT, sessionAccountsChangedReasonSchema, sessionAccountsChangedEventSchema, } from './deviceSession';
31
+ export type { SessionAccount, DeviceSessionState, ActiveToken, DeviceSessionSync, DeviceTokenMintRequest, DeviceTokenMintResponse, DeviceHubTicketIssueRequest, DeviceHubTicketIssueResponse, DeviceHubTicketRedeemRequest, DeviceHubTicketRedeemResponse, SessionAccountsChangedReason, SessionAccountsChangedEvent, } from './deviceSession';
32
32
  export { loginResultSchema, } from './deviceBoot';
33
33
  export type { LoginTwoFactorRequired, LoginSessionResult, LoginResult, SecurityAlert, SecurityAlertAnomaly, } from './deviceBoot';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxyhq/contracts",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "description": "OxyHQ API contracts — single source of truth for request/response Zod schemas and inferred types, shared by the backend and the client SDKs",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",