@oxyhq/contracts 0.14.2 → 0.15.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,10 +1,11 @@
1
1
  /**
2
2
  * First-party login result contract.
3
3
  *
4
- * SINGLE SOURCE OF TRUTH for the first-party password login result (2FA arm vs.
5
- * session arm). The API validates its OUTPUT against this schema; every consumer
6
- * (`@oxyhq/core`'s auth mixin) validates its INPUT against the same definition,
7
- * so producer and consumers cannot drift.
4
+ * SINGLE SOURCE OF TRUTH for the first-party login result (the session arm). The
5
+ * API validates its OUTPUT against this schema; every consumer (`@oxyhq/core`'s
6
+ * auth mixin) validates its INPUT against the same definition, so producer and
7
+ * consumers cannot drift. Sign-in is passkey (WebAuthn) or Commons handoff —
8
+ * password and 2FA were removed, so the only outcome is a completed session.
8
9
  *
9
10
  * The device transport is `deviceId` + `deviceSecret` + `POST /session/device/token`
10
11
  * (see `deviceSession.ts`). The legacy cookie/bootstrap/refresh-family lanes were
@@ -39,18 +40,9 @@ export interface SecurityAlert {
39
40
  anomalies: SecurityAlertAnomaly[];
40
41
  }
41
42
  /**
42
- * `POST /auth/login` when the account has 2FA enabled: a short-lived login
43
- * token to be presented at the 2FA challenge, and no session yet.
44
- */
45
- export interface LoginTwoFactorRequired {
46
- twoFactorRequired: true;
47
- loginToken: string;
48
- }
49
- /**
50
- * `POST /auth/login` when authentication completed in one step. Matches the
51
- * API's `SessionAuthResponse` EXACTLY (`buildSessionAuthResponse`). `user` is the
52
- * truncated session-user shape the login endpoint emits (NOT the full
53
- * `userResponseSchema`).
43
+ * A successful sign-in. Matches the API's `SessionAuthResponse` EXACTLY
44
+ * (`buildSessionAuthResponse`). `user` is the truncated session-user shape the
45
+ * sign-in endpoints emit (NOT the full `userResponseSchema`).
54
46
  */
55
47
  export interface LoginSessionResult {
56
48
  sessionId: string;
@@ -77,6 +69,6 @@ export interface LoginSessionResult {
77
69
  avatar?: string;
78
70
  };
79
71
  }
80
- /** The discriminated outcome of `POST /auth/login`. */
81
- export type LoginResult = LoginTwoFactorRequired | LoginSessionResult;
72
+ /** The outcome of a successful sign-in — always a completed session. */
73
+ export type LoginResult = LoginSessionResult;
82
74
  export declare const loginResultSchema: z.ZodType<LoginResult>;
@@ -275,15 +275,15 @@ export declare const domainVerificationInstructionsSchema: z.ZodObject<{
275
275
  export type DomainVerificationInstructions = z.infer<typeof domainVerificationInstructionsSchema>;
276
276
  /**
277
277
  * One linked authentication method. Mirrors a `User.authMethods[]` entry.
278
- * `verificationMethodId` is present for `identity` methods (a key) and absent
279
- * for `password`/social methods, linking the auth method to its DID
280
- * verification-method fragment. For `webauthn` methods `credentialId` identifies
281
- * the specific passkey (one entry per registered credential) and `name` is its
282
- * user-facing label; a passkey is NOT a DID verification method, so it carries
283
- * no `verificationMethodId` (a passkey-only account stays custodial).
278
+ * `verificationMethodId` is present for `identity` methods (a key), linking the
279
+ * auth method to its DID verification-method fragment. For `webauthn` methods
280
+ * `credentialId` identifies the specific passkey (one entry per registered
281
+ * credential) and `name` is its user-facing label; a passkey is NOT a DID
282
+ * verification method, so it carries no `verificationMethodId` (a passkey-only
283
+ * account stays custodial).
284
284
  */
285
285
  export interface AuthMethodEntry {
286
- type: 'identity' | 'password' | 'google' | 'apple' | 'github' | 'webauthn';
286
+ type: 'identity' | 'webauthn';
287
287
  linkedAt: string | Date;
288
288
  verificationMethodId?: string;
289
289
  credentialId?: string;
@@ -30,7 +30,7 @@ export type { LinkPreviewStatus, LinkPreview, LinkPreviewBatchRequest, LinkPrevi
30
30
  export { sessionAccountSchema, deviceSessionStateSchema, activeTokenSchema, deviceSessionSyncSchema, deviceTokenMintRequestSchema, deviceTokenMintResponseSchema, deviceHubTicketIssueRequestSchema, deviceHubTicketIssueResponseSchema, deviceHubTicketRedeemRequestSchema, deviceHubTicketRedeemResponseSchema, SESSION_ACCOUNTS_CHANGED_EVENT, sessionAccountsChangedReasonSchema, sessionAccountsChangedEventSchema, } from './deviceSession';
31
31
  export type { SessionAccount, DeviceSessionState, ActiveToken, DeviceSessionSync, DeviceTokenMintRequest, DeviceTokenMintResponse, DeviceHubTicketIssueRequest, DeviceHubTicketIssueResponse, DeviceHubTicketRedeemRequest, DeviceHubTicketRedeemResponse, SessionAccountsChangedReason, SessionAccountsChangedEvent, } from './deviceSession';
32
32
  export { loginResultSchema, } from './deviceBoot';
33
- export type { LoginTwoFactorRequired, LoginSessionResult, LoginResult, SecurityAlert, SecurityAlertAnomaly, } from './deviceBoot';
33
+ export type { LoginSessionResult, LoginResult, SecurityAlert, SecurityAlertAnomaly, } from './deviceBoot';
34
34
  export { updatePlatformSchema, updateStatusSchema, updateAssetStatusSchema, sha256HexSchema, channelNameSchema, runtimeVersionSchema, rolloutPercentSchema, assetInitItemSchema, assetInitRequestSchema, assetUploadTicketSchema, assetInitResponseSchema, assetCompleteRequestSchema, assetCompleteResultItemSchema, assetCompleteResponseSchema, updateAssetRefSchema, createUpdateRequestSchema, updateSchema, createUpdateResponseSchema, rollbackToEmbeddedEntrySchema, channelSchema, channelListResponseSchema, updateListResponseSchema, rollbackRequestSchema, rollbackToEmbeddedRequestSchema, promoteRequestSchema, updateRolloutPatchSchema, } from './updates';
35
35
  export type { UpdatePlatform, UpdateStatus, UpdateAssetStatus, AssetInitItem, AssetInitRequest, AssetUploadTicket, AssetInitResponse, AssetCompleteRequest, AssetCompleteResultItem, AssetCompleteResponse, UpdateAssetRef, CreateUpdateRequest, Update, CreateUpdateResponse, RollbackToEmbeddedEntry, Channel, ChannelListResponse, UpdateListResponse, RollbackRequest, RollbackToEmbeddedRequest, PromoteRequest, UpdateRolloutPatch, } from './updates';
36
36
  export { webauthnRegisterOptionsRequestSchema, webauthnLoginOptionsRequestSchema, webauthnRegisterVerifyRequestSchema, webauthnLoginVerifyRequestSchema, } from './webauthn';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxyhq/contracts",
3
- "version": "0.14.2",
3
+ "version": "0.15.0",
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",