@oxy.so/contracts 6.6.0 → 6.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.
@@ -38,8 +38,30 @@ exports.resolveExternalIdentityResponseSchema = zod_1.z
38
38
  externalIdentity: exports.externalIdentityReferenceSchema.extend({ userId: zod_1.z.string() }),
39
39
  externalIdentities: zod_1.z.array(exports.externalIdentityReferenceSchema),
40
40
  redirectedUserIds: zod_1.z.array(zod_1.z.string()),
41
+ /**
42
+ * The source document Oxy fetched and verified for THIS answer: the
43
+ * ActivityPub actor (`id` is `externalIdentity.actorUri`) or the atproto
44
+ * `app.bsky.actor.getProfile` view (`did` is it). Present only when this
45
+ * request fetched the source — an `actorUri` resolve always does — and
46
+ * absent when the answer came from the registry. It is what the source
47
+ * said, bound to the actor by Oxy's verification, so a caller reads the
48
+ * fields Oxy does not keep (banner, counts, profile fields, flags, inbox and
49
+ * keys) from it instead of fetching the source again. Untrusted text: Oxy's
50
+ * own profile (`user`) is the normalized name, bio and avatar.
51
+ */
52
+ sourceDocument: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
41
53
  })
42
54
  .superRefine((value, context) => {
55
+ const document = value.sourceDocument;
56
+ if (document &&
57
+ (value.externalIdentity.protocol === 'atproto' ? document.did : document.id) !==
58
+ value.externalIdentity.actorUri) {
59
+ context.addIssue({
60
+ code: zod_1.z.ZodIssueCode.custom,
61
+ path: ['sourceDocument'],
62
+ message: 'Source document does not name the resolved actor',
63
+ });
64
+ }
43
65
  if (value.externalIdentity.userId !== value.user.id) {
44
66
  context.addIssue({
45
67
  code: zod_1.z.ZodIssueCode.custom,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.safetyErrorSchema = exports.SAFETY_ERROR_CODES = exports.cancelPurchaseSchema = exports.confirmPurchaseSchema = exports.reservePurchaseSchema = exports.purchaseApprovalListSchema = exports.purchaseApprovalSummarySchema = exports.purchaseApprovalSchema = exports.purchaseEffectsSchema = exports.purchaseApprovalLineSchema = exports.supervisionContactsResponseSchema = exports.supervisionStateSchema = exports.supervisionContactSchema = exports.supervisionInvitationSchema = exports.supervisionSchema = exports.safetyRequesterSchema = exports.messagingSessionsResponseSchema = exports.messagingSessionsInputSchema = exports.messageAccessBatchResponseSchema = exports.deliveryAccessBatchInputSchema = exports.messageAccessBatchInputSchema = exports.deliveryAccessInputSchema = exports.contentAccessBatchResponseSchema = exports.contentAccessBatchInputSchema = exports.publicationPoliciesResponseSchema = exports.publicationPoliciesInputSchema = exports.publicationPolicySchema = exports.contentAccessInputSchema = exports.CONTENT_CLASSIFICATIONS = exports.contactAccessResponseSchema = exports.contactAccessInputSchema = exports.messageAccessInputSchema = exports.MESSAGE_ACCESS_MAX_INPUT_BYTES = exports.MESSAGE_ACCESS_MAX_PARTICIPANT_SLOTS = exports.MESSAGE_ACCESS_MAX_SUPERVISED_PARTICIPANTS = exports.MESSAGE_ACCESS_MAX_PARTICIPANTS = exports.MESSAGE_ACCESS_MAX_RESOURCES = exports.profileAccessBatchResponseSchema = exports.profileAccessBatchInputSchema = exports.safetyDecisionSchema = exports.SAFETY_DECISION_REASONS = exports.profileAccessDecisionSchema = exports.profileAccessInputSchema = exports.SUPERVISION_STATUSES = exports.SUPERVISION_INVITATION_STATUSES = exports.SUPERVISION_CONSENT_VERSION = exports.SUPERVISION_CHANGED_EVENT = exports.SUPERVISED_ACTIONS = exports.SAFETY_POLICY_VERSION = exports.PURCHASE_APPROVAL_STATUSES = void 0;
4
- exports.safetyOrganizationsResponseSchema = exports.safetyOrganizationsInputSchema = exports.safetyOrganizationIdentitySchema = exports.safetyPeopleResponseSchema = exports.safetyPeopleInputSchema = exports.safetyPersonSchema = exports.safetySessionValidationSchema = exports.safetySessionInputSchema = exports.purchaseReviewInputSchema = exports.supervisionReviewInputSchema = exports.supervisionContactInputSchema = exports.supervisionAcceptInputSchema = exports.supervisionInviteInputSchema = void 0;
3
+ exports.confirmPurchaseSchema = exports.reservePurchaseSchema = exports.purchaseApprovalListSchema = exports.purchaseApprovalSummarySchema = exports.purchaseApprovalSchema = exports.purchaseEffectsSchema = exports.purchaseApprovalLineSchema = exports.supervisionContactsResponseSchema = exports.supervisionStateSchema = exports.supervisionContactSchema = exports.supervisionInvitationSchema = exports.supervisionSchema = exports.safetyRequesterSchema = exports.messagingSessionsResponseSchema = exports.messagingSessionsInputSchema = exports.notificationAccessBatchResponseSchema = exports.notificationAccessBatchInputSchema = exports.notificationAccessInputSchema = exports.messageAccessBatchResponseSchema = exports.deliveryAccessBatchInputSchema = exports.messageAccessBatchInputSchema = exports.deliveryAccessInputSchema = exports.contentAccessBatchResponseSchema = exports.contentAccessBatchInputSchema = exports.publicationPoliciesResponseSchema = exports.publicationPoliciesInputSchema = exports.publicationPolicySchema = exports.contentAccessInputSchema = exports.CONTENT_CLASSIFICATIONS = exports.contactAccessResponseSchema = exports.contactAccessInputSchema = exports.messageAccessInputSchema = exports.MESSAGE_ACCESS_MAX_INPUT_BYTES = exports.MESSAGE_ACCESS_MAX_PARTICIPANT_SLOTS = exports.MESSAGE_ACCESS_MAX_SUPERVISED_PARTICIPANTS = exports.MESSAGE_ACCESS_MAX_PARTICIPANTS = exports.MESSAGE_ACCESS_MAX_RESOURCES = exports.profileAccessBatchResponseSchema = exports.profileAccessBatchInputSchema = exports.safetyDecisionSchema = exports.SAFETY_DECISION_REASONS = exports.profileAccessDecisionSchema = exports.profileAccessInputSchema = exports.SUPERVISION_STATUSES = exports.SUPERVISION_INVITATION_STATUSES = exports.SUPERVISION_CONSENT_VERSION = exports.SUPERVISION_CHANGED_EVENT = exports.SUPERVISED_ACTIONS = exports.SAFETY_POLICY_VERSION = exports.PURCHASE_APPROVAL_STATUSES = void 0;
4
+ exports.safetyOrganizationsResponseSchema = exports.safetyOrganizationsInputSchema = exports.safetyOrganizationIdentitySchema = exports.safetyPeopleResponseSchema = exports.safetyPeopleInputSchema = exports.safetyPersonSchema = exports.safetySessionValidationSchema = exports.safetySessionInputSchema = exports.purchaseReviewInputSchema = exports.supervisionReviewInputSchema = exports.supervisionContactInputSchema = exports.supervisionAcceptInputSchema = exports.supervisionInviteInputSchema = exports.safetyErrorSchema = exports.SAFETY_ERROR_CODES = exports.cancelPurchaseSchema = void 0;
5
5
  const numberChecks_1 = require("./numberChecks");
6
6
  const stringChecks_1 = require("./stringChecks");
7
7
  const zod_1 = require("zod");
@@ -172,6 +172,25 @@ const messageBatch = (schema) => zod_1.z
172
172
  exports.messageAccessBatchInputSchema = messageBatch(exports.messageAccessInputSchema);
173
173
  exports.deliveryAccessBatchInputSchema = messageBatch(exports.deliveryAccessInputSchema);
174
174
  exports.messageAccessBatchResponseSchema = exports.contentAccessBatchResponseSchema;
175
+ /**
176
+ * May `actorAccountId`'s activity notify `recipientAccountId`? A reviewed
177
+ * background consumer asks before a socket emit or push, with no human proof:
178
+ * the decision covers blocks in either direction, availability and supervised
179
+ * contact approval, and discloses nothing else.
180
+ */
181
+ exports.notificationAccessInputSchema = zod_1.z
182
+ .object({ resourceId, actorAccountId: accountId, recipientAccountId: accountId })
183
+ .strict();
184
+ exports.notificationAccessBatchInputSchema = zod_1.z
185
+ .object({
186
+ items: zod_1.z
187
+ .array(exports.notificationAccessInputSchema)
188
+ .min(1)
189
+ .max(100)
190
+ .refine((items) => new Set(items.map((item) => item.resourceId)).size === items.length, 'Resource IDs must be unique'),
191
+ })
192
+ .strict();
193
+ exports.notificationAccessBatchResponseSchema = exports.contentAccessBatchResponseSchema;
175
194
  /** Live socket-recipient proof; a request ID correlates the result and never identifies an account. */
176
195
  exports.messagingSessionsInputSchema = zod_1.z
177
196
  .object({
@@ -35,8 +35,30 @@ export const resolveExternalIdentityResponseSchema = z
35
35
  externalIdentity: externalIdentityReferenceSchema.extend({ userId: z.string() }),
36
36
  externalIdentities: z.array(externalIdentityReferenceSchema),
37
37
  redirectedUserIds: z.array(z.string()),
38
+ /**
39
+ * The source document Oxy fetched and verified for THIS answer: the
40
+ * ActivityPub actor (`id` is `externalIdentity.actorUri`) or the atproto
41
+ * `app.bsky.actor.getProfile` view (`did` is it). Present only when this
42
+ * request fetched the source — an `actorUri` resolve always does — and
43
+ * absent when the answer came from the registry. It is what the source
44
+ * said, bound to the actor by Oxy's verification, so a caller reads the
45
+ * fields Oxy does not keep (banner, counts, profile fields, flags, inbox and
46
+ * keys) from it instead of fetching the source again. Untrusted text: Oxy's
47
+ * own profile (`user`) is the normalized name, bio and avatar.
48
+ */
49
+ sourceDocument: z.record(z.string(), z.unknown()).optional(),
38
50
  })
39
51
  .superRefine((value, context) => {
52
+ const document = value.sourceDocument;
53
+ if (document &&
54
+ (value.externalIdentity.protocol === 'atproto' ? document.did : document.id) !==
55
+ value.externalIdentity.actorUri) {
56
+ context.addIssue({
57
+ code: z.ZodIssueCode.custom,
58
+ path: ['sourceDocument'],
59
+ message: 'Source document does not name the resolved actor',
60
+ });
61
+ }
40
62
  if (value.externalIdentity.userId !== value.user.id) {
41
63
  context.addIssue({
42
64
  code: z.ZodIssueCode.custom,
@@ -162,6 +162,25 @@ const messageBatch = (schema) => z
162
162
  export const messageAccessBatchInputSchema = messageBatch(messageAccessInputSchema);
163
163
  export const deliveryAccessBatchInputSchema = messageBatch(deliveryAccessInputSchema);
164
164
  export const messageAccessBatchResponseSchema = contentAccessBatchResponseSchema;
165
+ /**
166
+ * May `actorAccountId`'s activity notify `recipientAccountId`? A reviewed
167
+ * background consumer asks before a socket emit or push, with no human proof:
168
+ * the decision covers blocks in either direction, availability and supervised
169
+ * contact approval, and discloses nothing else.
170
+ */
171
+ export const notificationAccessInputSchema = z
172
+ .object({ resourceId, actorAccountId: accountId, recipientAccountId: accountId })
173
+ .strict();
174
+ export const notificationAccessBatchInputSchema = z
175
+ .object({
176
+ items: z
177
+ .array(notificationAccessInputSchema)
178
+ .min(1)
179
+ .max(100)
180
+ .refine((items) => new Set(items.map((item) => item.resourceId)).size === items.length, 'Resource IDs must be unique'),
181
+ })
182
+ .strict();
183
+ export const notificationAccessBatchResponseSchema = contentAccessBatchResponseSchema;
165
184
  /** Live socket-recipient proof; a request ID correlates the result and never identifies an account. */
166
185
  export const messagingSessionsInputSchema = z
167
186
  .object({
@@ -163,6 +163,7 @@ export declare const resolveExternalIdentityResponseSchema: z.ZodObject<{
163
163
  sourceUserId: z.ZodString;
164
164
  }, z.core.$strip>>;
165
165
  redirectedUserIds: z.ZodArray<z.ZodString>;
166
+ sourceDocument: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
166
167
  }, z.core.$strip>;
167
168
  export declare const lookupExternalIdentitiesRequestSchema: z.ZodObject<{
168
169
  identifiers: z.ZodArray<z.ZodString>;
@@ -231,6 +231,48 @@ export declare const messageAccessBatchResponseSchema: z.ZodObject<{
231
231
  }, z.core.$strict>;
232
232
  export type MessageAccessBatchInput = z.infer<typeof messageAccessBatchInputSchema>;
233
233
  export type DeliveryAccessBatchInput = z.infer<typeof deliveryAccessBatchInputSchema>;
234
+ /**
235
+ * May `actorAccountId`'s activity notify `recipientAccountId`? A reviewed
236
+ * background consumer asks before a socket emit or push, with no human proof:
237
+ * the decision covers blocks in either direction, availability and supervised
238
+ * contact approval, and discloses nothing else.
239
+ */
240
+ export declare const notificationAccessInputSchema: z.ZodObject<{
241
+ resourceId: z.ZodString;
242
+ actorAccountId: z.ZodString;
243
+ recipientAccountId: z.ZodString;
244
+ }, z.core.$strict>;
245
+ export declare const notificationAccessBatchInputSchema: z.ZodObject<{
246
+ items: z.ZodArray<z.ZodObject<{
247
+ resourceId: z.ZodString;
248
+ actorAccountId: z.ZodString;
249
+ recipientAccountId: z.ZodString;
250
+ }, z.core.$strict>>;
251
+ }, z.core.$strict>;
252
+ export declare const notificationAccessBatchResponseSchema: z.ZodObject<{
253
+ items: z.ZodArray<z.ZodObject<{
254
+ resourceId: z.ZodString;
255
+ decision: z.ZodObject<{
256
+ allowed: z.ZodBoolean;
257
+ reason: z.ZodEnum<{
258
+ owner: "owner";
259
+ unavailable: "unavailable";
260
+ allowed: "allowed";
261
+ blocked: "blocked";
262
+ private: "private";
263
+ public: "public";
264
+ unsupported_consumer: "unsupported_consumer";
265
+ contact_not_approved: "contact_not_approved";
266
+ mature_content: "mature_content";
267
+ unrated_content: "unrated_content";
268
+ approval_required: "approval_required";
269
+ }>;
270
+ policyVersion: z.ZodLiteral<"2">;
271
+ }, z.core.$strict>;
272
+ }, z.core.$strict>>;
273
+ }, z.core.$strict>;
274
+ export type NotificationAccessInput = z.infer<typeof notificationAccessInputSchema>;
275
+ export type NotificationAccessBatchInput = z.infer<typeof notificationAccessBatchInputSchema>;
234
276
  /** Live socket-recipient proof; a request ID correlates the result and never identifies an account. */
235
277
  export declare const messagingSessionsInputSchema: z.ZodObject<{
236
278
  items: z.ZodArray<z.ZodObject<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxy.so/contracts",
3
- "version": "6.6.0",
3
+ "version": "6.8.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",
@@ -89,6 +89,6 @@
89
89
  "@types/node": "^26.6.6",
90
90
  "jest": "^30.5.2",
91
91
  "typescript": "~6.0.3",
92
- "@oxy.so/bloom": "17.1.0"
92
+ "@oxy.so/bloom": "17.5.0"
93
93
  }
94
94
  }