@oxyhq/contracts 0.16.0 → 0.17.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.
- package/dist/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/index.js +5 -3
- package/dist/cjs/userResponse.js +27 -1
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/userResponse.js +26 -0
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/sessionStatus.d.ts +6 -6
- package/dist/types/userResponse.d.ts +256 -0
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
export { ORGANIZATION_CATEGORIES, organizationCategorySchema, createAccountRequestSchema, } from './accountGraph.js';
|
|
13
13
|
export {
|
|
14
14
|
// Schemas
|
|
15
|
-
userNameSchema, userResponseSchema, userProfileUpdateSchema, currentUserResponseSchema, deviceLinkedSessionSchema, deviceLinkedSessionsResponseSchema,
|
|
15
|
+
userNameSchema, userRelationshipSchema, themePreferenceSchema, userResponseSchema, userProfileUpdateSchema, currentUserResponseSchema, deviceLinkedSessionSchema, deviceLinkedSessionsResponseSchema,
|
|
16
16
|
// Helpers
|
|
17
17
|
resolveUserId, safeParseContract, } from './userResponse.js';
|
|
18
18
|
export {
|
package/dist/esm/userResponse.js
CHANGED
|
@@ -39,6 +39,14 @@ export const userNameSchema = z
|
|
|
39
39
|
displayName: z.string().optional(),
|
|
40
40
|
})
|
|
41
41
|
.passthrough();
|
|
42
|
+
export const userRelationshipSchema = z.object({
|
|
43
|
+
isFollowing: z.boolean(),
|
|
44
|
+
followsYou: z.boolean(),
|
|
45
|
+
});
|
|
46
|
+
export const themePreferenceSchema = z.object({
|
|
47
|
+
mode: z.enum(['light', 'dark', 'system']),
|
|
48
|
+
colorPreset: z.string(),
|
|
49
|
+
});
|
|
42
50
|
/**
|
|
43
51
|
* The canonical user object emitted by `formatUserResponse`.
|
|
44
52
|
*
|
|
@@ -97,6 +105,19 @@ export const userResponseSchema = z
|
|
|
97
105
|
* Absent on personal, project, and bot accounts.
|
|
98
106
|
*/
|
|
99
107
|
organizationCategory: organizationCategorySchema.optional(),
|
|
108
|
+
/**
|
|
109
|
+
* The authenticated viewer's relationship to this profile. Present ONLY
|
|
110
|
+
* on single-profile fetches (`GET /profiles/username/:username`,
|
|
111
|
+
* `GET /users/:userId`) when the request is authenticated; OMITTED for
|
|
112
|
+
* anonymous requests and for the bulk `POST /users/by-ids` fan-out.
|
|
113
|
+
*/
|
|
114
|
+
relationship: userRelationshipSchema.optional(),
|
|
115
|
+
/**
|
|
116
|
+
* Portable theme preference. Rides the self/session payload (cold boot),
|
|
117
|
+
* so it is present on the current-user DTO (`GET /users/me`,
|
|
118
|
+
* `GET /session/user/:sessionId`) and absent until the user sets it.
|
|
119
|
+
*/
|
|
120
|
+
themePreference: themePreferenceSchema.optional(),
|
|
100
121
|
})
|
|
101
122
|
.passthrough();
|
|
102
123
|
export const userProfileUpdateSchema = z
|
|
@@ -137,6 +158,11 @@ export const userProfileUpdateSchema = z
|
|
|
137
158
|
notificationPreferences: z.record(z.unknown()).optional(),
|
|
138
159
|
userPreferences: z.record(z.unknown()).optional(),
|
|
139
160
|
privacySettings: z.record(z.unknown()).optional(),
|
|
161
|
+
/**
|
|
162
|
+
* Portable theme preference. Written through the same `PUT /users/me`
|
|
163
|
+
* settings-update path as `languages`/`userPreferences`.
|
|
164
|
+
*/
|
|
165
|
+
themePreference: themePreferenceSchema.optional(),
|
|
140
166
|
})
|
|
141
167
|
.passthrough();
|
|
142
168
|
/**
|