@oxy.so/contracts 6.7.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,
|
|
@@ -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,
|
|
@@ -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>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxy.so/contracts",
|
|
3
|
-
"version": "6.
|
|
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.
|
|
92
|
+
"@oxy.so/bloom": "17.5.0"
|
|
93
93
|
}
|
|
94
94
|
}
|