@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,12 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.lookupExternalIdentitiesResponseSchema = exports.lookupExternalIdentitiesRequestSchema = exports.resolveExternalIdentityResponseSchema = exports.resolveExternalIdentityRequestSchema = exports.externalIdentityReferenceSchema = void 0;
|
|
3
|
+
exports.lookupExternalIdentitiesResponseSchema = exports.lookupExternalIdentitiesRequestSchema = exports.resolveExternalIdentityResponseSchema = exports.resolveExternalIdentityRequestSchema = exports.externalIdentityReferenceSchema = exports.externalIdentityProtocolSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const userResponse_1 = require("./userResponse");
|
|
6
|
+
/**
|
|
7
|
+
* How Oxy observed an external account. `instagram-graph` is Meta's Graph API
|
|
8
|
+
* Business Discovery, a fallback transport for Business/Creator Instagram
|
|
9
|
+
* accounts when the ActivityPub bridge is unavailable.
|
|
10
|
+
*/
|
|
11
|
+
exports.externalIdentityProtocolSchema = zod_1.z.enum(['activitypub', 'atproto', 'instagram-graph']);
|
|
6
12
|
exports.externalIdentityReferenceSchema = zod_1.z.object({
|
|
7
13
|
canonicalAcct: zod_1.z.string().min(1),
|
|
8
14
|
network: zod_1.z.string().min(1),
|
|
9
|
-
protocol:
|
|
15
|
+
protocol: exports.externalIdentityProtocolSchema,
|
|
10
16
|
actorUri: zod_1.z.string().min(1),
|
|
11
17
|
transportAcct: zod_1.z.string().min(1),
|
|
12
18
|
sourceUserId: zod_1.z.string().min(1),
|
|
@@ -15,7 +21,7 @@ exports.resolveExternalIdentityRequestSchema = zod_1.z.object({
|
|
|
15
21
|
actorUri: zod_1.z.string().min(1).max(2048).optional(),
|
|
16
22
|
handle: zod_1.z.string().min(1).max(2048).optional(),
|
|
17
23
|
transportAcct: zod_1.z.string().max(320).optional(),
|
|
18
|
-
protocol:
|
|
24
|
+
protocol: exports.externalIdentityProtocolSchema.optional(),
|
|
19
25
|
}).refine(value => Boolean(value.actorUri) !== Boolean(value.handle), 'Exactly one actorUri or handle is required');
|
|
20
26
|
exports.resolveExternalIdentityResponseSchema = zod_1.z.object({
|
|
21
27
|
user: userResponse_1.userResponseSchema.extend({
|