@oxyhq/contracts 0.11.0 → 0.12.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.
@@ -94,6 +94,7 @@ exports.authTokenBundleSchema = zod_1.z.object({
94
94
  refreshToken: zod_1.z.string(),
95
95
  expiresAt: zod_1.z.string(),
96
96
  user: userResponse_1.userResponseSchema,
97
+ deviceSecret: zod_1.z.string().optional(),
97
98
  });
98
99
  // Internal (unexported) arm schemas — PLAIN `z.object` literals (no
99
100
  // `z.ZodType<>` annotation) so `z.discriminatedUnion` can introspect the
@@ -158,6 +159,7 @@ const loginSessionResultSchema = zod_1.z.object({
158
159
  expiresAt: zod_1.z.string(),
159
160
  accessToken: zod_1.z.string().optional(),
160
161
  refreshToken: zod_1.z.string().optional(),
162
+ deviceSecret: zod_1.z.string().optional(),
161
163
  user: zod_1.z.object({
162
164
  id: zod_1.z.string(),
163
165
  username: zod_1.z.string().optional(),
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deviceSessionSyncSchema = exports.activeTokenSchema = exports.deviceSessionStateSchema = exports.sessionAccountSchema = void 0;
3
+ exports.deviceTokenMintResponseSchema = exports.deviceTokenMintRequestSchema = exports.deviceSessionSyncSchema = exports.activeTokenSchema = exports.deviceSessionStateSchema = exports.sessionAccountSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.sessionAccountSchema = zod_1.z.object({
6
6
  accountId: zod_1.z.string(),
@@ -23,3 +23,30 @@ exports.deviceSessionSyncSchema = zod_1.z.object({
23
23
  state: exports.deviceSessionStateSchema,
24
24
  activeToken: exports.activeTokenSchema.nullable(),
25
25
  });
26
+ /* -------------------------------------------------------------------------- */
27
+ /* Device-secret token mint (phase 2c — zero-cookie transport) */
28
+ /* -------------------------------------------------------------------------- */
29
+ /**
30
+ * Request body for `POST /session/device/token` — the client presents the
31
+ * `deviceId` it stored first-party plus the opaque `deviceSecret`. NO bearer:
32
+ * possession of the secret IS the proof of device ownership. The server matches
33
+ * `sha256(deviceSecret)` against the device's stored `secretHash` (constant-time)
34
+ * and mints a short access token for the device's active account.
35
+ */
36
+ exports.deviceTokenMintRequestSchema = zod_1.z.object({
37
+ deviceId: zod_1.z.string().min(1),
38
+ deviceSecret: zod_1.z.string().min(1),
39
+ });
40
+ /**
41
+ * Wire shape of a successful `POST /session/device/token`: the freshly-minted
42
+ * short access token for the active account, its expiry, the NEXT rotating
43
+ * device secret the client must persist (rotation-in-use — the presented secret
44
+ * stays valid for a short grace so multi-tab races don't lock out), and the
45
+ * projected device-session state.
46
+ */
47
+ exports.deviceTokenMintResponseSchema = zod_1.z.object({
48
+ accessToken: zod_1.z.string(),
49
+ expiresAt: zod_1.z.string(),
50
+ nextDeviceSecret: zod_1.z.string(),
51
+ state: exports.deviceSessionStateSchema,
52
+ });
package/dist/cjs/index.js CHANGED
@@ -12,7 +12,7 @@
12
12
  */
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.personhoodBreakdownSchema = exports.personhoodVouchRecordSchema = exports.validationVoteResultSchema = exports.validationRequestSummarySchema = exports.validationOpenResultSchema = exports.validationOpenRequestSchema = exports.validationVerdictRecordSchema = exports.realLifeAttestationResultSchema = exports.realLifeAttestationRecordSchema = exports.signedPublicCardSchema = exports.publicCardSchema = exports.logPageResponseSchema = exports.chainHeadResponseSchema = exports.oxySignedRecordTypeSchema = exports.exportBundleSchema = exports.exportAttestationSchema = exports.authMethodsResponseSchema = exports.authMethodEntrySchema = exports.domainVerificationInstructionsSchema = exports.domainVerificationRequestSchema = exports.verifiedDomainSchema = exports.signedRecordEnvelopeSchema = exports.didDocumentSchema = exports.didServiceSchema = exports.verificationMethodSchema = exports.appAffinityEventsIngestSchema = exports.appAffinityEventSchema = exports.appAffinityEventTypeSchema = exports.appUserSignalIngestSchema = exports.appInterestInputSchema = exports.appEndorsementInputSchema = exports.recommendationResponseSchema = exports.recommendationItemSchema = exports.recommendationCountSchema = exports.recommendationRequestSchema = exports.recommendationSignalWeightsSchema = exports.recommendationBoostSchema = exports.recommendationExcludeTypeSchema = exports.fedcmTokenPayloadSchema = exports.sessionStatusSchema = exports.publicApplicationSchema = exports.applicationTypeSchema = exports.safeParseContract = exports.resolveUserId = exports.deviceLinkedSessionsResponseSchema = exports.deviceLinkedSessionSchema = exports.currentUserResponseSchema = exports.userProfileUpdateSchema = exports.userResponseSchema = exports.userNameSchema = void 0;
15
- exports.deviceResolveResponseSchema = exports.deviceResolveRequestSchema = exports.loginResultSchema = exports.deviceTokenIssueResponseSchema = exports.tokenRefreshResponseSchema = exports.tokenRefreshRequestSchema = exports.webSessionResultSchema = exports.authTokenBundleSchema = exports.deviceExchangeRequestSchema = exports.deviceBootFragmentSchema = exports.deviceBootReasonSchema = exports.deviceSessionSyncSchema = exports.activeTokenSchema = exports.deviceSessionStateSchema = exports.sessionAccountSchema = exports.linkPreviewResponseSchema = exports.linkPreviewBatchResponseSchema = exports.linkPreviewBatchRequestSchema = exports.linkPreviewSchema = exports.credentialVerifyResultSchema = exports.credentialListResultSchema = exports.credentialIssueResultSchema = exports.verifiableCredentialResponseSchema = exports.credentialRecordSchema = exports.vouchResultSchema = exports.personhoodStatusResultSchema = void 0;
15
+ exports.deviceResolveResponseSchema = exports.deviceResolveRequestSchema = exports.loginResultSchema = exports.deviceTokenIssueResponseSchema = exports.tokenRefreshResponseSchema = exports.tokenRefreshRequestSchema = exports.webSessionResultSchema = exports.authTokenBundleSchema = exports.deviceExchangeRequestSchema = exports.deviceBootFragmentSchema = exports.deviceBootReasonSchema = exports.deviceTokenMintResponseSchema = exports.deviceTokenMintRequestSchema = exports.deviceSessionSyncSchema = exports.activeTokenSchema = exports.deviceSessionStateSchema = exports.sessionAccountSchema = exports.linkPreviewResponseSchema = exports.linkPreviewBatchResponseSchema = exports.linkPreviewBatchRequestSchema = exports.linkPreviewSchema = exports.credentialVerifyResultSchema = exports.credentialListResultSchema = exports.credentialIssueResultSchema = exports.verifiableCredentialResponseSchema = exports.credentialRecordSchema = exports.vouchResultSchema = exports.personhoodStatusResultSchema = void 0;
16
16
  var userResponse_1 = require("./userResponse");
17
17
  // Schemas
18
18
  Object.defineProperty(exports, "userNameSchema", { enumerable: true, get: function () { return userResponse_1.userNameSchema; } });
@@ -99,6 +99,8 @@ Object.defineProperty(exports, "sessionAccountSchema", { enumerable: true, get:
99
99
  Object.defineProperty(exports, "deviceSessionStateSchema", { enumerable: true, get: function () { return deviceSession_1.deviceSessionStateSchema; } });
100
100
  Object.defineProperty(exports, "activeTokenSchema", { enumerable: true, get: function () { return deviceSession_1.activeTokenSchema; } });
101
101
  Object.defineProperty(exports, "deviceSessionSyncSchema", { enumerable: true, get: function () { return deviceSession_1.deviceSessionSyncSchema; } });
102
+ Object.defineProperty(exports, "deviceTokenMintRequestSchema", { enumerable: true, get: function () { return deviceSession_1.deviceTokenMintRequestSchema; } });
103
+ Object.defineProperty(exports, "deviceTokenMintResponseSchema", { enumerable: true, get: function () { return deviceSession_1.deviceTokenMintResponseSchema; } });
102
104
  var deviceBoot_1 = require("./deviceBoot");
103
105
  // Schemas
104
106
  Object.defineProperty(exports, "deviceBootReasonSchema", { enumerable: true, get: function () { return deviceBoot_1.deviceBootReasonSchema; } });