import type { ApiClient } from "@promobase/sdk-runtime"; import { Cursor } from "@promobase/sdk-runtime"; import { metaPagination } from "../../pagination.ts"; import type { CommentFields } from "./comment.ts"; import type { EventFields } from "./event.ts"; import type { PhotoFields } from "./photo.ts"; import type { PlaceFields } from "./place.ts"; import type { ProfileFields } from "./profile.ts"; import type { ProfilePictureSourceFields } from "./profile-picture-source.ts"; export interface AlbumFields { backdated_time: string; backdated_time_granularity: string; can_backdate: boolean; can_upload: boolean; count: number; cover_photo: PhotoFields; created_time: string; description: string; edit_link: string; event: EventFields; from: Record; id: string; is_user_facing: boolean; link: string; location: string; modified_major: string; name: string; photo_count: number; place: PlaceFields; privacy: string; type: string; updated_time: string; video_count: number; } export interface AlbumListCommentsParams { filter?: string; live_filter?: string; order?: string; since?: string; [key: string]: unknown; } export interface AlbumCreateCommentsParams { attachment_id?: string; attachment_share_url?: string; attachment_url?: string; comment_privacy_value?: string; facepile_mentioned_ids?: string[]; feedback_source?: string; is_offline?: boolean; message?: string; nectar_module?: string; object_id?: string; parent_comment_id?: Record; text?: string; tracking?: string; [key: string]: unknown; } export interface AlbumCreateLikesParams { feedback_source?: string; nectar_module?: string; notify?: boolean; tracking?: string; [key: string]: unknown; } export interface AlbumCreatePhotosParams { aid?: string; allow_spherical_photo?: boolean; alt_text_custom?: string; android_key_hash?: string; application_id?: string; attempt?: number; audience_exp?: boolean; backdated_time?: string; backdated_time_granularity?: string; caption?: string; composer_session_id?: string; direct_share_status?: number; feed_targeting?: Record; filter_type?: number; full_res_is_coming_later?: boolean; initial_view_heading_override_degrees?: number; initial_view_pitch_override_degrees?: number; initial_view_vertical_fov_override_degrees?: number; ios_bundle_id?: string; is_explicit_location?: boolean; is_explicit_place?: boolean; manual_privacy?: boolean; message?: string; name?: string; no_story?: boolean; offline_id?: number; og_action_type_id?: string; og_icon_id?: string; og_object_id?: string; og_phrase?: string; og_set_profile_badge?: boolean; og_suggestion_mechanism?: string; place?: Record; privacy?: string; profile_id?: number; provenance_info?: Record; proxied_app_id?: string; published?: boolean; qn?: string; spherical_metadata?: Record; sponsor_id?: string; sponsor_relationship?: number; tags?: Record[]; target_id?: number; targeting?: Record; time_since_original_post?: number; uid?: number; unpublished_content_type?: string; url?: string; user_selected_tags?: boolean; vault_image_id?: string; [key: string]: unknown; } export interface AlbumListPictureParams { redirect?: boolean; type?: string; [key: string]: unknown; } export function albumNode(client: ApiClient, id: string) { return { __path: id, __brand: undefined as unknown as AlbumFields, get: (opts: { fields: F; params?: Record }) => client.get>(`${id}`, opts), comments: { __path: `${id}/comments`, __brand: undefined as unknown as CommentFields, list: (opts: { fields: F; params?: AlbumListCommentsParams }) => new Cursor>(client, `${id}/comments`, opts as { fields: readonly string[]; params?: Record }, metaPagination()), create: (params: AlbumCreateCommentsParams) => client.post(`${id}/comments`, params as Record), }, likes: { __path: `${id}/likes`, __brand: undefined as unknown as ProfileFields, list: (opts: { fields: F; params?: Record }) => new Cursor>(client, `${id}/likes`, opts as { fields: readonly string[]; params?: Record }, metaPagination()), create: (params: AlbumCreateLikesParams) => client.post(`${id}/likes`, params as Record), }, photos: { __path: `${id}/photos`, __brand: undefined as unknown as PhotoFields, list: (opts: { fields: F; params?: Record }) => new Cursor>(client, `${id}/photos`, opts as { fields: readonly string[]; params?: Record }, metaPagination()), create: (params: AlbumCreatePhotosParams) => client.post(`${id}/photos`, params as Record), }, picture: (opts: { fields: F; params?: AlbumListPictureParams }) => new Cursor>(client, `${id}/picture`, opts as { fields: readonly string[]; params?: Record }, metaPagination()), }; }