@oxyhq/core 3.13.1 → 3.14.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/mixins/OxyServices.user.js +21 -0
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/mixins/OxyServices.user.js +21 -0
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/mixins/OxyServices.user.d.ts +9 -0
- package/package.json +1 -1
- package/src/mixins/OxyServices.user.ts +24 -0
|
@@ -295,6 +295,15 @@ export declare function OxyServicesUserMixin<T extends typeof OxyServicesBase>(B
|
|
|
295
295
|
total: number;
|
|
296
296
|
hasMore: boolean;
|
|
297
297
|
}>;
|
|
298
|
+
/**
|
|
299
|
+
* Get user mutuals ("followers you know" — users the authenticated viewer
|
|
300
|
+
* follows who also follow `userId`). The viewer is derived server-side from auth.
|
|
301
|
+
*/
|
|
302
|
+
getUserMutuals(userId: string, pagination?: PaginationParams): Promise<{
|
|
303
|
+
mutuals: User[];
|
|
304
|
+
total: number;
|
|
305
|
+
hasMore: boolean;
|
|
306
|
+
}>;
|
|
298
307
|
/**
|
|
299
308
|
* Get notifications
|
|
300
309
|
*/
|
package/package.json
CHANGED
|
@@ -740,6 +740,30 @@ export function OxyServicesUserMixin<T extends typeof OxyServicesBase>(Base: T)
|
|
|
740
740
|
}
|
|
741
741
|
}
|
|
742
742
|
|
|
743
|
+
/**
|
|
744
|
+
* Get user mutuals ("followers you know" — users the authenticated viewer
|
|
745
|
+
* follows who also follow `userId`). The viewer is derived server-side from auth.
|
|
746
|
+
*/
|
|
747
|
+
async getUserMutuals(
|
|
748
|
+
userId: string,
|
|
749
|
+
pagination?: PaginationParams
|
|
750
|
+
): Promise<{ mutuals: User[]; total: number; hasMore: boolean }> {
|
|
751
|
+
try {
|
|
752
|
+
const params = buildPaginationParams(pagination || {});
|
|
753
|
+
const response = await this.makeRequest<{ data: User[]; pagination: { total: number; hasMore: boolean } }>('GET', `/users/${userId}/mutuals`, params, {
|
|
754
|
+
cache: true,
|
|
755
|
+
cacheTTL: 2 * 60 * 1000, // 2 minutes cache
|
|
756
|
+
});
|
|
757
|
+
return {
|
|
758
|
+
mutuals: response.data || [],
|
|
759
|
+
total: response.pagination.total,
|
|
760
|
+
hasMore: response.pagination.hasMore,
|
|
761
|
+
};
|
|
762
|
+
} catch (error) {
|
|
763
|
+
throw this.handleError(error);
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
|
|
743
767
|
/**
|
|
744
768
|
* Get notifications
|
|
745
769
|
*/
|