@oxy.so/contracts 3.0.0 → 4.0.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,9 +1,15 @@
1
1
  import { z } from 'zod';
2
2
  import { userResponseSchema } from './userResponse.js';
3
+ /**
4
+ * How Oxy observed an external account. `instagram-graph` is Meta's Graph API
5
+ * Business Discovery, a fallback transport for Business/Creator Instagram
6
+ * accounts when the ActivityPub bridge is unavailable.
7
+ */
8
+ export const externalIdentityProtocolSchema = z.enum(['activitypub', 'atproto', 'instagram-graph']);
3
9
  export const externalIdentityReferenceSchema = z.object({
4
10
  canonicalAcct: z.string().min(1),
5
11
  network: z.string().min(1),
6
- protocol: z.enum(['activitypub', 'atproto']),
12
+ protocol: externalIdentityProtocolSchema,
7
13
  actorUri: z.string().min(1),
8
14
  transportAcct: z.string().min(1),
9
15
  sourceUserId: z.string().min(1),
@@ -12,7 +18,7 @@ export const resolveExternalIdentityRequestSchema = z.object({
12
18
  actorUri: z.string().min(1).max(2048).optional(),
13
19
  handle: z.string().min(1).max(2048).optional(),
14
20
  transportAcct: z.string().max(320).optional(),
15
- protocol: z.enum(['activitypub', 'atproto']).optional(),
21
+ protocol: externalIdentityProtocolSchema.optional(),
16
22
  }).refine(value => Boolean(value.actorUri) !== Boolean(value.handle), 'Exactly one actorUri or handle is required');
17
23
  export const resolveExternalIdentityResponseSchema = z.object({
18
24
  user: userResponseSchema.extend({