@oxyhq/contracts 0.7.0 → 0.8.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.
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deviceSessionSyncSchema = exports.activeTokenSchema = exports.deviceSessionStateSchema = exports.sessionAccountSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.sessionAccountSchema = zod_1.z.object({
6
+ accountId: zod_1.z.string(),
7
+ sessionId: zod_1.z.string(),
8
+ authuser: zod_1.z.number().int().nonnegative(),
9
+ operatedByUserId: zod_1.z.string().optional(),
10
+ });
11
+ exports.deviceSessionStateSchema = zod_1.z.object({
12
+ deviceId: zod_1.z.string(),
13
+ accounts: zod_1.z.array(exports.sessionAccountSchema),
14
+ activeAccountId: zod_1.z.string().nullable(),
15
+ revision: zod_1.z.number().int().nonnegative(),
16
+ updatedAt: zod_1.z.number(),
17
+ });
18
+ exports.activeTokenSchema = zod_1.z.object({
19
+ accessToken: zod_1.z.string(),
20
+ expiresAt: zod_1.z.string(),
21
+ });
22
+ exports.deviceSessionSyncSchema = zod_1.z.object({
23
+ state: exports.deviceSessionStateSchema,
24
+ activeToken: exports.activeTokenSchema.nullable(),
25
+ });
@@ -45,5 +45,12 @@ exports.fedcmTokenPayloadSchema = zod_1.z
45
45
  exp: zod_1.z.number().optional(),
46
46
  iat: zod_1.z.number().optional(),
47
47
  nonce: zod_1.z.string().optional(),
48
+ /**
49
+ * An explicit central deviceId minted by the IdP, threaded through so the
50
+ * RP session can inherit a unified device id instead of deriving one from
51
+ * the (userId, RP origin) stableDeviceKey. Optional and additive — omitted
52
+ * tokens fall back to the existing stableDeviceKey/UA-IP derivation.
53
+ */
54
+ deviceId: zod_1.z.string().optional(),
48
55
  })
49
56
  .passthrough();
@@ -41,12 +41,27 @@
41
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
42
  exports.exportBundleSchema = exports.exportAttestationSchema = exports.authMethodsResponseSchema = exports.authMethodEntrySchema = exports.domainVerificationInstructionsSchema = exports.domainVerificationRequestSchema = exports.verifiedDomainSchema = exports.signedRecordEnvelopeSchema = exports.didDocumentSchema = exports.didServiceSchema = exports.verificationMethodSchema = void 0;
43
43
  const zod_1 = require("zod");
44
- exports.verificationMethodSchema = zod_1.z.object({
44
+ // The option schemas are left UN-annotated so they keep their concrete
45
+ // `ZodObject` type — `z.discriminatedUnion` requires object options and an
46
+ // explicit `z.ZodType<>` annotation would erase the shape it discriminates on.
47
+ // `z.object` already infers each option's type exactly (id/type/controller +
48
+ // the key field), so the union is structurally `VerificationMethod`.
49
+ const secp256k1VerificationMethodSchema = zod_1.z.object({
45
50
  id: zod_1.z.string(),
46
51
  type: zod_1.z.literal('EcdsaSecp256k1VerificationKey2019'),
47
52
  controller: zod_1.z.string(),
48
53
  publicKeyHex: zod_1.z.string(),
49
54
  });
55
+ const multikeyVerificationMethodSchema = zod_1.z.object({
56
+ id: zod_1.z.string(),
57
+ type: zod_1.z.literal('Multikey'),
58
+ controller: zod_1.z.string(),
59
+ publicKeyMultibase: zod_1.z.string(),
60
+ });
61
+ exports.verificationMethodSchema = zod_1.z.discriminatedUnion('type', [
62
+ secp256k1VerificationMethodSchema,
63
+ multikeyVerificationMethodSchema,
64
+ ]);
50
65
  exports.didServiceSchema = zod_1.z.object({
51
66
  id: zod_1.z.string(),
52
67
  type: zod_1.z.string(),
package/dist/cjs/index.js CHANGED
@@ -12,7 +12,7 @@
12
12
  */
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.personhoodStatusResultSchema = 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.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.deviceSessionsResponseSchema = exports.deviceSessionAccountSchema = exports.currentUserResponseSchema = exports.refreshAllResponseSchema = exports.refreshAllAccountSchema = exports.userProfileUpdateSchema = exports.userResponseSchema = exports.userNameSchema = void 0;
15
- exports.linkPreviewResponseSchema = exports.linkPreviewBatchResponseSchema = exports.linkPreviewBatchRequestSchema = exports.linkPreviewSchema = exports.credentialVerifyResultSchema = exports.credentialListResultSchema = exports.credentialIssueResultSchema = exports.verifiableCredentialResponseSchema = exports.credentialRecordSchema = exports.vouchResultSchema = void 0;
15
+ 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 = 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; } });
@@ -93,3 +93,8 @@ Object.defineProperty(exports, "linkPreviewSchema", { enumerable: true, get: fun
93
93
  Object.defineProperty(exports, "linkPreviewBatchRequestSchema", { enumerable: true, get: function () { return links_1.linkPreviewBatchRequestSchema; } });
94
94
  Object.defineProperty(exports, "linkPreviewBatchResponseSchema", { enumerable: true, get: function () { return links_1.linkPreviewBatchResponseSchema; } });
95
95
  Object.defineProperty(exports, "linkPreviewResponseSchema", { enumerable: true, get: function () { return links_1.linkPreviewResponseSchema; } });
96
+ var deviceSession_1 = require("./deviceSession");
97
+ Object.defineProperty(exports, "sessionAccountSchema", { enumerable: true, get: function () { return deviceSession_1.sessionAccountSchema; } });
98
+ Object.defineProperty(exports, "deviceSessionStateSchema", { enumerable: true, get: function () { return deviceSession_1.deviceSessionStateSchema; } });
99
+ Object.defineProperty(exports, "activeTokenSchema", { enumerable: true, get: function () { return deviceSession_1.activeTokenSchema; } });
100
+ Object.defineProperty(exports, "deviceSessionSyncSchema", { enumerable: true, get: function () { return deviceSession_1.deviceSessionSyncSchema; } });