@openpeepshq/core 0.1.31
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/LICENSE +674 -0
- package/dist/accessTokens/finders.d.ts +11 -0
- package/dist/accessTokens/finders.js +43 -0
- package/dist/accessTokens/helpers.d.ts +13 -0
- package/dist/accessTokens/helpers.js +15 -0
- package/dist/accessTokens/index.d.ts +4 -0
- package/dist/accessTokens/index.js +4 -0
- package/dist/accessTokens/mapping.d.ts +10 -0
- package/dist/accessTokens/mapping.js +25 -0
- package/dist/accessTokens/mutations.d.ts +4 -0
- package/dist/accessTokens/mutations.js +24 -0
- package/dist/accessTokens/revokations.d.ts +2 -0
- package/dist/accessTokens/revokations.js +18 -0
- package/dist/accessTokens/tokens.d.ts +31 -0
- package/dist/accessTokens/tokens.js +174 -0
- package/dist/accounts/cache.d.ts +3 -0
- package/dist/accounts/cache.js +13 -0
- package/dist/accounts/finders.d.ts +6 -0
- package/dist/accounts/finders.js +17 -0
- package/dist/accounts/helpers.d.ts +7 -0
- package/dist/accounts/helpers.js +36 -0
- package/dist/accounts/index.d.ts +6 -0
- package/dist/accounts/index.js +6 -0
- package/dist/accounts/mapping.d.ts +10 -0
- package/dist/accounts/mapping.js +28 -0
- package/dist/accounts/mutations.d.ts +21 -0
- package/dist/accounts/mutations.js +204 -0
- package/dist/analytics/cache.d.ts +6 -0
- package/dist/analytics/cache.js +29 -0
- package/dist/analytics/compile.d.ts +4 -0
- package/dist/analytics/compile.js +296 -0
- package/dist/analytics/dateRange.d.ts +39 -0
- package/dist/analytics/dateRange.js +181 -0
- package/dist/analytics/index.d.ts +8 -0
- package/dist/analytics/index.js +8 -0
- package/dist/analytics/jobs.d.ts +20 -0
- package/dist/analytics/jobs.js +84 -0
- package/dist/analytics/metrics.d.ts +4 -0
- package/dist/analytics/metrics.js +13 -0
- package/dist/analytics/pdfReport.d.ts +8 -0
- package/dist/analytics/pdfReport.js +821 -0
- package/dist/analytics/read.d.ts +6 -0
- package/dist/analytics/read.js +696 -0
- package/dist/analytics/report.d.ts +293 -0
- package/dist/analytics/report.js +153 -0
- package/dist/analytics/settings.d.ts +3 -0
- package/dist/analytics/settings.js +37 -0
- package/dist/backups/index.d.ts +5 -0
- package/dist/backups/index.js +260 -0
- package/dist/backups/metadata.d.ts +9 -0
- package/dist/backups/metadata.js +2 -0
- package/dist/config/db.d.ts +7 -0
- package/dist/config/db.js +26 -0
- package/dist/config/defaults/capabilities.d.ts +2 -0
- package/dist/config/defaults/capabilities.js +47 -0
- package/dist/config/defaults/community.d.ts +2 -0
- package/dist/config/defaults/community.js +41 -0
- package/dist/config/defaults/core.d.ts +2 -0
- package/dist/config/defaults/core.js +113 -0
- package/dist/config/defaults/db.d.ts +6 -0
- package/dist/config/defaults/db.js +8 -0
- package/dist/config/defaults/logs.d.ts +6 -0
- package/dist/config/defaults/logs.js +7 -0
- package/dist/config/defaults/redis.d.ts +4 -0
- package/dist/config/defaults/redis.js +5 -0
- package/dist/config/helpers.d.ts +11 -0
- package/dist/config/helpers.js +31 -0
- package/dist/config/index.d.ts +392 -0
- package/dist/config/index.js +83 -0
- package/dist/config/pruneEmptyConfigStrings.d.ts +7 -0
- package/dist/config/pruneEmptyConfigStrings.js +29 -0
- package/dist/db/aql.d.ts +0 -0
- package/dist/db/aql.js +1 -0
- package/dist/db/arango.d.ts +2 -0
- package/dist/db/arango.js +110 -0
- package/dist/db/bootMigrate.d.ts +1 -0
- package/dist/db/bootMigrate.js +15 -0
- package/dist/db/examples.d.ts +1 -0
- package/dist/db/examples.js +13 -0
- package/dist/db/explorer/csv.d.ts +1 -0
- package/dist/db/explorer/csv.js +18 -0
- package/dist/db/explorer/index.d.ts +6 -0
- package/dist/db/explorer/index.js +5 -0
- package/dist/db/explorer/mutate.d.ts +6 -0
- package/dist/db/explorer/mutate.js +66 -0
- package/dist/db/explorer/query.d.ts +17 -0
- package/dist/db/explorer/query.js +48 -0
- package/dist/db/explorer/sql.d.ts +11 -0
- package/dist/db/explorer/sql.js +42 -0
- package/dist/db/explorer/tables.d.ts +9 -0
- package/dist/db/explorer/tables.js +65 -0
- package/dist/db/helpers.d.ts +64 -0
- package/dist/db/helpers.js +240 -0
- package/dist/db/index.d.ts +13 -0
- package/dist/db/index.js +15 -0
- package/dist/db/init.d.ts +2 -0
- package/dist/db/init.js +10 -0
- package/dist/db/migration/autoMigrate.d.ts +2 -0
- package/dist/db/migration/autoMigrate.js +111 -0
- package/dist/db/migration/cli.d.ts +1 -0
- package/dist/db/migration/cli.js +56 -0
- package/dist/db/migration/detect.d.ts +6 -0
- package/dist/db/migration/detect.js +87 -0
- package/dist/db/migration/exportArango.d.ts +4 -0
- package/dist/db/migration/exportArango.js +80 -0
- package/dist/db/migration/importCollections.d.ts +19 -0
- package/dist/db/migration/importCollections.js +280 -0
- package/dist/db/migration/importPostgres.d.ts +3 -0
- package/dist/db/migration/importPostgres.js +18 -0
- package/dist/db/migration/shared.d.ts +39 -0
- package/dist/db/migration/shared.js +158 -0
- package/dist/db/migration/transform.d.ts +18 -0
- package/dist/db/migration/transform.js +209 -0
- package/dist/db/migration/validate.d.ts +18 -0
- package/dist/db/migration/validate.js +69 -0
- package/dist/db/pg/client.d.ts +35 -0
- package/dist/db/pg/client.js +126 -0
- package/dist/db/pg/collections.d.ts +48 -0
- package/dist/db/pg/collections.js +53 -0
- package/dist/db/pg/filters/common.d.ts +21 -0
- package/dist/db/pg/filters/common.js +48 -0
- package/dist/db/pg/filters/edges.d.ts +9 -0
- package/dist/db/pg/filters/edges.js +10 -0
- package/dist/db/pg/filters/groups.d.ts +7 -0
- package/dist/db/pg/filters/groups.js +15 -0
- package/dist/db/pg/filters/index.d.ts +22 -0
- package/dist/db/pg/filters/index.js +35 -0
- package/dist/db/pg/filters/notifications.d.ts +6 -0
- package/dist/db/pg/filters/notifications.js +10 -0
- package/dist/db/pg/filters/posts.d.ts +18 -0
- package/dist/db/pg/filters/posts.js +25 -0
- package/dist/db/pg/filters/profiles.d.ts +6 -0
- package/dist/db/pg/filters/profiles.js +9 -0
- package/dist/db/pg/filters/types.d.ts +7 -0
- package/dist/db/pg/filters/types.js +5 -0
- package/dist/db/pg/helpers.d.ts +19 -0
- package/dist/db/pg/helpers.js +67 -0
- package/dist/db/pg/map/filters.d.ts +22 -0
- package/dist/db/pg/map/filters.js +566 -0
- package/dist/db/pg/map/helpers.d.ts +2 -0
- package/dist/db/pg/map/helpers.js +2 -0
- package/dist/db/pg/map/index.d.ts +46 -0
- package/dist/db/pg/map/index.js +93 -0
- package/dist/db/pg/map/mutations.d.ts +11 -0
- package/dist/db/pg/map/mutations.js +135 -0
- package/dist/db/pg/map/queryTypes.d.ts +115 -0
- package/dist/db/pg/map/queryTypes.js +1 -0
- package/dist/db/pg/map/registry.d.ts +29 -0
- package/dist/db/pg/map/registry.js +413 -0
- package/dist/db/pg/map/relations.d.ts +28 -0
- package/dist/db/pg/map/relations.js +399 -0
- package/dist/db/pg/map/search.d.ts +6 -0
- package/dist/db/pg/map/search.js +190 -0
- package/dist/db/pg/map/types.d.ts +11 -0
- package/dist/db/pg/map/types.js +1 -0
- package/dist/db/pg/mappers.d.ts +28 -0
- package/dist/db/pg/mappers.js +29 -0
- package/dist/db/pg/migrate.d.ts +14 -0
- package/dist/db/pg/migrate.js +134 -0
- package/dist/db/pg/queries/activity.d.ts +10 -0
- package/dist/db/pg/queries/activity.js +47 -0
- package/dist/db/pg/queries/computed.d.ts +7 -0
- package/dist/db/pg/queries/computed.js +19 -0
- package/dist/db/pg/queries/derived.d.ts +22 -0
- package/dist/db/pg/queries/derived.js +100 -0
- package/dist/db/pg/queries/index.d.ts +4 -0
- package/dist/db/pg/queries/index.js +4 -0
- package/dist/db/pg/queries/sorts.d.ts +10 -0
- package/dist/db/pg/queries/sorts.js +9 -0
- package/dist/db/pg/schema/analytics.d.ts +998 -0
- package/dist/db/pg/schema/analytics.js +110 -0
- package/dist/db/pg/schema/base.d.ts +36 -0
- package/dist/db/pg/schema/base.js +23 -0
- package/dist/db/pg/schema/documents.d.ts +2002 -0
- package/dist/db/pg/schema/documents.js +40 -0
- package/dist/db/pg/schema/edges.d.ts +2725 -0
- package/dist/db/pg/schema/edges.js +34 -0
- package/dist/db/pg/schema/index.d.ts +5724 -0
- package/dist/db/pg/schema/index.js +7 -0
- package/dist/db/pg/sql/0000_bizarre_chat.sql +456 -0
- package/dist/db/pg/sql/0001_search_vector.sql +122 -0
- package/dist/db/pg/sql/0002_data_migrations_id_text.sql +1 -0
- package/dist/db/pg/sql/0003_fix_group_post_visibility.sql +4 -0
- package/dist/db/pg/sql/0004_analytics.sql +90 -0
- package/dist/db/pg/sql/meta/0000_snapshot.json +3380 -0
- package/dist/db/pg/sql/meta/0004_snapshot.json +4114 -0
- package/dist/db/pg/sql/meta/_journal.json +41 -0
- package/dist/db/replaceHostname.d.ts +1 -0
- package/dist/db/replaceHostname.js +88 -0
- package/dist/db/types.d.ts +17 -0
- package/dist/db/types.js +1 -0
- package/dist/email/index.d.ts +9 -0
- package/dist/email/index.js +19 -0
- package/dist/email/jobs.d.ts +3 -0
- package/dist/email/jobs.js +13 -0
- package/dist/email/queueStats.d.ts +2 -0
- package/dist/email/queueStats.js +27 -0
- package/dist/email/registry.d.ts +3 -0
- package/dist/email/registry.js +4 -0
- package/dist/email/render.d.ts +8 -0
- package/dist/email/render.js +34 -0
- package/dist/email/send.d.ts +9 -0
- package/dist/email/send.js +97 -0
- package/dist/email/smtpTest.d.ts +2 -0
- package/dist/email/smtpTest.js +26 -0
- package/dist/errors/index.d.ts +8 -0
- package/dist/errors/index.js +13 -0
- package/dist/events/index.d.ts +31 -0
- package/dist/events/index.js +66 -0
- package/dist/events/once.d.ts +4 -0
- package/dist/events/once.js +23 -0
- package/dist/groups/finders.d.ts +125 -0
- package/dist/groups/finders.js +18 -0
- package/dist/groups/helpers.d.ts +227 -0
- package/dist/groups/helpers.js +17 -0
- package/dist/groups/index.d.ts +3 -0
- package/dist/groups/index.js +3 -0
- package/dist/groups/mapping.d.ts +188 -0
- package/dist/groups/mapping.js +47 -0
- package/dist/groups/mutations.d.ts +26 -0
- package/dist/groups/mutations.js +41 -0
- package/dist/hashtags/finders.d.ts +3 -0
- package/dist/hashtags/finders.js +22 -0
- package/dist/hashtags/index.d.ts +2 -0
- package/dist/hashtags/index.js +2 -0
- package/dist/hashtags/mapping.d.ts +4 -0
- package/dist/hashtags/mapping.js +5 -0
- package/dist/hashtags/mutations.d.ts +0 -0
- package/dist/hashtags/mutations.js +1 -0
- package/dist/i18n/index.d.ts +14 -0
- package/dist/i18n/index.js +53 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.js +1 -0
- package/dist/inviteLinks/finders.d.ts +3 -0
- package/dist/inviteLinks/finders.js +5 -0
- package/dist/inviteLinks/helpers.d.ts +20 -0
- package/dist/inviteLinks/helpers.js +4 -0
- package/dist/inviteLinks/index.d.ts +3 -0
- package/dist/inviteLinks/index.js +3 -0
- package/dist/inviteLinks/mapping.d.ts +10 -0
- package/dist/inviteLinks/mapping.js +35 -0
- package/dist/inviteLinks/mutations.d.ts +4 -0
- package/dist/inviteLinks/mutations.js +39 -0
- package/dist/jams/cache.d.ts +9 -0
- package/dist/jams/cache.js +13 -0
- package/dist/jams/finders.d.ts +23 -0
- package/dist/jams/finders.js +24 -0
- package/dist/jams/helpers.d.ts +70 -0
- package/dist/jams/helpers.js +29 -0
- package/dist/jams/index.d.ts +15 -0
- package/dist/jams/index.js +108 -0
- package/dist/jams/jobs.d.ts +9 -0
- package/dist/jams/jobs.js +42 -0
- package/dist/jams/livekit.d.ts +24 -0
- package/dist/jams/livekit.js +220 -0
- package/dist/jams/mapping.d.ts +137 -0
- package/dist/jams/mapping.js +35 -0
- package/dist/jams/mutations.d.ts +40 -0
- package/dist/jams/mutations.js +4 -0
- package/dist/jams/recording.d.ts +8 -0
- package/dist/jams/recording.js +67 -0
- package/dist/jams/recordingUploadAuth.d.ts +9 -0
- package/dist/jams/recordingUploadAuth.js +19 -0
- package/dist/jams/token.d.ts +4 -0
- package/dist/jams/token.js +129 -0
- package/dist/jams/waitingRoom.d.ts +5 -0
- package/dist/jams/waitingRoom.js +71 -0
- package/dist/jobs/index.d.ts +10 -0
- package/dist/jobs/index.js +60 -0
- package/dist/jobs/jobDetail.d.ts +2 -0
- package/dist/jobs/jobDetail.js +31 -0
- package/dist/jobs/jobLog.d.ts +18 -0
- package/dist/jobs/jobLog.js +61 -0
- package/dist/jwt/index.d.ts +10 -0
- package/dist/jwt/index.js +43 -0
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/index.js +2 -0
- package/dist/lib/streams.d.ts +2 -0
- package/dist/lib/streams.js +56 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +17 -0
- package/dist/lib/zodDeepPartial.d.ts +3 -0
- package/dist/lib/zodDeepPartial.js +26 -0
- package/dist/location/index.d.ts +2 -0
- package/dist/location/index.js +28 -0
- package/dist/log/index.d.ts +3 -0
- package/dist/log/index.js +97 -0
- package/dist/mastodon/index.d.ts +4 -0
- package/dist/mastodon/index.js +51 -0
- package/dist/mastodon/types.d.ts +7579 -0
- package/dist/mastodon/types.js +523 -0
- package/dist/mastodon/typescript.d.ts +1578 -0
- package/dist/mastodon/typescript.js +1 -0
- package/dist/media/index.d.ts +40 -0
- package/dist/media/index.js +248 -0
- package/dist/media/ipfs/index.d.ts +0 -0
- package/dist/media/ipfs/index.js +39 -0
- package/dist/media/jobs.d.ts +19 -0
- package/dist/media/jobs.js +90 -0
- package/dist/media/openpeeps/index.d.ts +3 -0
- package/dist/media/openpeeps/index.js +131 -0
- package/dist/media/processing.d.ts +19 -0
- package/dist/media/processing.js +83 -0
- package/dist/media/streaming.d.ts +77 -0
- package/dist/media/streaming.js +257 -0
- package/dist/media/streamingCleanupJobs.d.ts +14 -0
- package/dist/media/streamingCleanupJobs.js +47 -0
- package/dist/media/streamingJobs.d.ts +5 -0
- package/dist/media/streamingJobs.js +329 -0
- package/dist/media/streamingPrewarm.d.ts +36 -0
- package/dist/media/streamingPrewarm.js +109 -0
- package/dist/mediaAttachments/finders.d.ts +1 -0
- package/dist/mediaAttachments/finders.js +3 -0
- package/dist/mediaAttachments/index.d.ts +5 -0
- package/dist/mediaAttachments/index.js +12 -0
- package/dist/mediaAttachments/mapping.d.ts +21 -0
- package/dist/mediaAttachments/mapping.js +4 -0
- package/dist/mediaAttachments/mutations.d.ts +3 -0
- package/dist/mediaAttachments/mutations.js +10 -0
- package/dist/notifications/defaultNotifications/announcement/index.d.ts +24 -0
- package/dist/notifications/defaultNotifications/announcement/index.js +42 -0
- package/dist/notifications/defaultNotifications/directMessage/index.d.ts +28 -0
- package/dist/notifications/defaultNotifications/directMessage/index.js +69 -0
- package/dist/notifications/defaultNotifications/follow/index.d.ts +24 -0
- package/dist/notifications/defaultNotifications/follow/index.js +31 -0
- package/dist/notifications/defaultNotifications/groupAdded/index.d.ts +18 -0
- package/dist/notifications/defaultNotifications/groupAdded/index.js +33 -0
- package/dist/notifications/defaultNotifications/groupMemberJoined/index.d.ts +18 -0
- package/dist/notifications/defaultNotifications/groupMemberJoined/index.js +36 -0
- package/dist/notifications/defaultNotifications/groupMemberLeft/index.d.ts +18 -0
- package/dist/notifications/defaultNotifications/groupMemberLeft/index.js +36 -0
- package/dist/notifications/defaultNotifications/index.d.ts +3 -0
- package/dist/notifications/defaultNotifications/index.js +43 -0
- package/dist/notifications/defaultNotifications/jamModerator/index.d.ts +23 -0
- package/dist/notifications/defaultNotifications/jamModerator/index.js +49 -0
- package/dist/notifications/defaultNotifications/jamSpeaker/index.d.ts +23 -0
- package/dist/notifications/defaultNotifications/jamSpeaker/index.js +47 -0
- package/dist/notifications/defaultNotifications/jamStarted/index.d.ts +18 -0
- package/dist/notifications/defaultNotifications/jamStarted/index.js +82 -0
- package/dist/notifications/defaultNotifications/mention/index.d.ts +24 -0
- package/dist/notifications/defaultNotifications/mention/index.js +89 -0
- package/dist/notifications/defaultNotifications/newGroupPost/index.d.ts +24 -0
- package/dist/notifications/defaultNotifications/newGroupPost/index.js +47 -0
- package/dist/notifications/defaultNotifications/newProfile/index.d.ts +24 -0
- package/dist/notifications/defaultNotifications/newProfile/index.js +40 -0
- package/dist/notifications/defaultNotifications/pollVote/index.d.ts +19 -0
- package/dist/notifications/defaultNotifications/pollVote/index.js +40 -0
- package/dist/notifications/defaultNotifications/reaction/index.d.ts +18 -0
- package/dist/notifications/defaultNotifications/reaction/index.js +43 -0
- package/dist/notifications/defaultNotifications/reply/index.d.ts +25 -0
- package/dist/notifications/defaultNotifications/reply/index.js +57 -0
- package/dist/notifications/defaultNotifications/repost/index.d.ts +18 -0
- package/dist/notifications/defaultNotifications/repost/index.js +42 -0
- package/dist/notifications/defaultNotifications/rsvp/index.d.ts +19 -0
- package/dist/notifications/defaultNotifications/rsvp/index.js +40 -0
- package/dist/notifications/fcmCredential.d.ts +14 -0
- package/dist/notifications/fcmCredential.js +68 -0
- package/dist/notifications/finders.d.ts +7 -0
- package/dist/notifications/finders.js +13 -0
- package/dist/notifications/firebase.d.ts +1 -0
- package/dist/notifications/firebase.js +33 -0
- package/dist/notifications/handlers.d.ts +3 -0
- package/dist/notifications/handlers.js +6 -0
- package/dist/notifications/helpers.d.ts +7 -0
- package/dist/notifications/helpers.js +31 -0
- package/dist/notifications/index.d.ts +9 -0
- package/dist/notifications/index.js +43 -0
- package/dist/notifications/jobs.d.ts +2 -0
- package/dist/notifications/jobs.js +75 -0
- package/dist/notifications/mapping.d.ts +25 -0
- package/dist/notifications/mapping.js +25 -0
- package/dist/notifications/mutations.d.ts +6 -0
- package/dist/notifications/mutations.js +40 -0
- package/dist/notifications/push.d.ts +9 -0
- package/dist/notifications/push.js +261 -0
- package/dist/notifications/pushInvalidation.d.ts +10 -0
- package/dist/notifications/pushInvalidation.js +10 -0
- package/dist/performance/index.d.ts +24 -0
- package/dist/performance/index.js +61 -0
- package/dist/plugins/helpers.d.ts +3 -0
- package/dist/plugins/helpers.js +72 -0
- package/dist/plugins/index.d.ts +10 -0
- package/dist/plugins/index.js +84 -0
- package/dist/plugins/pluginAuth.d.ts +30 -0
- package/dist/plugins/pluginAuth.js +44 -0
- package/dist/posts/contextClosure.d.ts +16 -0
- package/dist/posts/contextClosure.js +66 -0
- package/dist/posts/finders.d.ts +298 -0
- package/dist/posts/finders.js +259 -0
- package/dist/posts/helpers/filters.d.ts +14 -0
- package/dist/posts/helpers/filters.js +39 -0
- package/dist/posts/helpers/index.d.ts +837 -0
- package/dist/posts/helpers/index.js +117 -0
- package/dist/posts/index.d.ts +6 -0
- package/dist/posts/index.js +6 -0
- package/dist/posts/mapping.d.ts +2187 -0
- package/dist/posts/mapping.js +222 -0
- package/dist/posts/mutations.d.ts +19 -0
- package/dist/posts/mutations.js +202 -0
- package/dist/posts/rsvpConfirmationEmail.d.ts +2 -0
- package/dist/posts/rsvpConfirmationEmail.js +82 -0
- package/dist/processingStats/index.d.ts +3 -0
- package/dist/processingStats/index.js +3 -0
- package/dist/processingStats/mapping.d.ts +7 -0
- package/dist/processingStats/mapping.js +4 -0
- package/dist/processingStats/mutations.d.ts +2 -0
- package/dist/processingStats/mutations.js +6 -0
- package/dist/processingStats/queries.d.ts +4 -0
- package/dist/processingStats/queries.js +46 -0
- package/dist/profileSettings/cache.d.ts +2 -0
- package/dist/profileSettings/cache.js +24 -0
- package/dist/profileSettings/finders.d.ts +1 -0
- package/dist/profileSettings/finders.js +2 -0
- package/dist/profileSettings/index.d.ts +3 -0
- package/dist/profileSettings/index.js +3 -0
- package/dist/profileSettings/mapping.d.ts +38 -0
- package/dist/profileSettings/mapping.js +5 -0
- package/dist/profileSettings/mutations.d.ts +3 -0
- package/dist/profileSettings/mutations.js +24 -0
- package/dist/profiles/cache.d.ts +5 -0
- package/dist/profiles/cache.js +19 -0
- package/dist/profiles/capacity.d.ts +2 -0
- package/dist/profiles/capacity.js +20 -0
- package/dist/profiles/export.d.ts +3 -0
- package/dist/profiles/export.js +85 -0
- package/dist/profiles/finders.d.ts +11 -0
- package/dist/profiles/finders.js +39 -0
- package/dist/profiles/helpers.d.ts +35 -0
- package/dist/profiles/helpers.js +10 -0
- package/dist/profiles/index.d.ts +5 -0
- package/dist/profiles/index.js +18 -0
- package/dist/profiles/mapping.d.ts +157 -0
- package/dist/profiles/mapping.js +132 -0
- package/dist/profiles/mutations.d.ts +9 -0
- package/dist/profiles/mutations.js +75 -0
- package/dist/pushSubscriptions/finders.d.ts +187 -0
- package/dist/pushSubscriptions/finders.js +6 -0
- package/dist/pushSubscriptions/helpers.d.ts +99 -0
- package/dist/pushSubscriptions/helpers.js +3 -0
- package/dist/pushSubscriptions/index.d.ts +3 -0
- package/dist/pushSubscriptions/index.js +3 -0
- package/dist/pushSubscriptions/mapping.d.ts +261 -0
- package/dist/pushSubscriptions/mapping.js +6 -0
- package/dist/pushSubscriptions/mutations.d.ts +95 -0
- package/dist/pushSubscriptions/mutations.js +21 -0
- package/dist/redis/connection.d.ts +4 -0
- package/dist/redis/connection.js +17 -0
- package/dist/redis/index.d.ts +1 -0
- package/dist/redis/index.js +1 -0
- package/dist/reports/finders.d.ts +6 -0
- package/dist/reports/finders.js +44 -0
- package/dist/reports/helpers.d.ts +21 -0
- package/dist/reports/helpers.js +12 -0
- package/dist/reports/index.d.ts +3 -0
- package/dist/reports/index.js +3 -0
- package/dist/reports/mapping.d.ts +9 -0
- package/dist/reports/mapping.js +34 -0
- package/dist/reports/mutations.d.ts +5 -0
- package/dist/reports/mutations.js +16 -0
- package/dist/roles/defaults.d.ts +2 -0
- package/dist/roles/defaults.js +94 -0
- package/dist/roles/finders.d.ts +5 -0
- package/dist/roles/finders.js +9 -0
- package/dist/roles/index.d.ts +4 -0
- package/dist/roles/index.js +4 -0
- package/dist/roles/mapping.d.ts +11 -0
- package/dist/roles/mapping.js +5 -0
- package/dist/roles/mutations.d.ts +4 -0
- package/dist/roles/mutations.js +30 -0
- package/dist/search/finders.d.ts +47 -0
- package/dist/search/finders.js +59 -0
- package/dist/search/helpers.d.ts +3 -0
- package/dist/search/helpers.js +1 -0
- package/dist/search/index.d.ts +1 -0
- package/dist/search/index.js +1 -0
- package/dist/search/mapping.d.ts +40 -0
- package/dist/search/mapping.js +43 -0
- package/dist/sentry/index.d.ts +34 -0
- package/dist/sentry/index.js +113 -0
- package/dist/server/helpers.d.ts +0 -0
- package/dist/server/helpers.js +1 -0
- package/dist/server/index.d.ts +105 -0
- package/dist/server/index.js +64 -0
- package/dist/stats/finders.d.ts +16156 -0
- package/dist/stats/finders.js +167 -0
- package/dist/stats/helpers.d.ts +17 -0
- package/dist/stats/helpers.js +34 -0
- package/dist/stats/index.d.ts +1 -0
- package/dist/stats/index.js +1 -0
- package/dist/stats/mapping.d.ts +188 -0
- package/dist/stats/mapping.js +19 -0
- package/dist/stripe/cache.d.ts +30 -0
- package/dist/stripe/cache.js +37 -0
- package/dist/stripe/connection.d.ts +5 -0
- package/dist/stripe/connection.js +23 -0
- package/dist/stripe/helpers.d.ts +25 -0
- package/dist/stripe/helpers.js +211 -0
- package/dist/stripe/index.d.ts +3 -0
- package/dist/stripe/index.js +3 -0
- package/package.json +99 -0
|
@@ -0,0 +1,523 @@
|
|
|
1
|
+
// Generated by ts-to-zod
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { extendZodWithOpenApi } from '@asteasolutions/zod-to-openapi';
|
|
4
|
+
extendZodWithOpenApi(z);
|
|
5
|
+
export const emojiSchema = z.object({
|
|
6
|
+
category: z.string(),
|
|
7
|
+
shortcode: z.string(),
|
|
8
|
+
static_url: z.string(),
|
|
9
|
+
url: z.string(),
|
|
10
|
+
visible_in_picker: z.boolean(),
|
|
11
|
+
});
|
|
12
|
+
export const announcementAccountSchema = z.object({
|
|
13
|
+
acct: z.string(),
|
|
14
|
+
id: z.string(),
|
|
15
|
+
url: z.string(),
|
|
16
|
+
handle: z.string(),
|
|
17
|
+
});
|
|
18
|
+
export const reactionSchema = z.object({
|
|
19
|
+
count: z.number(),
|
|
20
|
+
me: z.boolean().optional(),
|
|
21
|
+
name: z.string(),
|
|
22
|
+
static_url: z.string().optional(),
|
|
23
|
+
url: z.string().optional(),
|
|
24
|
+
});
|
|
25
|
+
export const announcementStatusSchema = z.object({
|
|
26
|
+
id: z.string(),
|
|
27
|
+
url: z.string(),
|
|
28
|
+
});
|
|
29
|
+
export const applicationSchema = z.object({
|
|
30
|
+
client_id: z.string().optional(),
|
|
31
|
+
client_secret: z.string().optional(),
|
|
32
|
+
name: z.string(),
|
|
33
|
+
vapid_key: z.string().optional(),
|
|
34
|
+
website: z.string().optional().nullable(),
|
|
35
|
+
});
|
|
36
|
+
const baseCardSchema = z.object({
|
|
37
|
+
description: z.string(),
|
|
38
|
+
title: z.string(),
|
|
39
|
+
type: z.string(),
|
|
40
|
+
url: z.string(),
|
|
41
|
+
});
|
|
42
|
+
export const linkCardSchema = baseCardSchema.extend({
|
|
43
|
+
type: z.literal('link'),
|
|
44
|
+
});
|
|
45
|
+
export const photoCardSchema = baseCardSchema.extend({
|
|
46
|
+
author_name: z.string(),
|
|
47
|
+
author_url: z.string(),
|
|
48
|
+
blurhash: z.string(),
|
|
49
|
+
embed_url: z.string(),
|
|
50
|
+
height: z.number(),
|
|
51
|
+
image: z.string().optional(),
|
|
52
|
+
provider_name: z.string(),
|
|
53
|
+
provider_url: z.string(),
|
|
54
|
+
type: z.literal('photo'),
|
|
55
|
+
width: z.number(),
|
|
56
|
+
});
|
|
57
|
+
export const iframeCardSchema = baseCardSchema.extend({
|
|
58
|
+
type: z.literal('rich'),
|
|
59
|
+
});
|
|
60
|
+
export const videoCardSchema = baseCardSchema.extend({
|
|
61
|
+
author_name: z.string(),
|
|
62
|
+
author_url: z.string(),
|
|
63
|
+
blurhash: z.string().optional(),
|
|
64
|
+
height: z.number(),
|
|
65
|
+
html: z.string(),
|
|
66
|
+
image: z.string().optional(),
|
|
67
|
+
provider_name: z.string(),
|
|
68
|
+
provider_url: z.string(),
|
|
69
|
+
type: z.literal('video'),
|
|
70
|
+
width: z.number(),
|
|
71
|
+
});
|
|
72
|
+
export const listReplyPolicySchema = z.union([
|
|
73
|
+
z.literal('followed'),
|
|
74
|
+
z.literal('list'),
|
|
75
|
+
z.literal('none'),
|
|
76
|
+
]);
|
|
77
|
+
export const listAccountsDeleteSchema = z.object({
|
|
78
|
+
account_ids: z.array(z.string()),
|
|
79
|
+
});
|
|
80
|
+
export const listAccountsPostSchema = z.object({
|
|
81
|
+
account_ids: z.array(z.string()),
|
|
82
|
+
});
|
|
83
|
+
export const listPostSchema = z.object({
|
|
84
|
+
id: z.string().optional(),
|
|
85
|
+
replies_policy: z.string().optional(),
|
|
86
|
+
title: z.string(),
|
|
87
|
+
});
|
|
88
|
+
export const audioAttachmentMetaOriginalSchema = z.object({
|
|
89
|
+
bitrate: z.number(),
|
|
90
|
+
duration: z.number(),
|
|
91
|
+
});
|
|
92
|
+
export const gIFVAttachmentMetaOriginalSchema = z.object({
|
|
93
|
+
bitrate: z.number(),
|
|
94
|
+
duration: z.number(),
|
|
95
|
+
frame_rate: z.string(),
|
|
96
|
+
height: z.number(),
|
|
97
|
+
width: z.number(),
|
|
98
|
+
});
|
|
99
|
+
export const gIFVAttachmentMetaSmallSchema = z.object({
|
|
100
|
+
aspect: z.number(),
|
|
101
|
+
height: z.number(),
|
|
102
|
+
size: z.string(),
|
|
103
|
+
width: z.number(),
|
|
104
|
+
});
|
|
105
|
+
export const imageAttachmentMetaFocusSchema = z.object({
|
|
106
|
+
x: z.number(),
|
|
107
|
+
y: z.number(),
|
|
108
|
+
});
|
|
109
|
+
export const imageAttachmentMetaOriginalSchema = z.object({
|
|
110
|
+
aspect: z.number(),
|
|
111
|
+
height: z.number(),
|
|
112
|
+
size: z.string(),
|
|
113
|
+
width: z.number(),
|
|
114
|
+
});
|
|
115
|
+
export const imageAttachmentMetaSmallSchema = z.object({
|
|
116
|
+
aspect: z.number(),
|
|
117
|
+
height: z.number(),
|
|
118
|
+
size: z.string(),
|
|
119
|
+
width: z.number(),
|
|
120
|
+
});
|
|
121
|
+
export const unknownAttachmentSchema = z.object({
|
|
122
|
+
description: z.string().optional().nullable(),
|
|
123
|
+
id: z.string(),
|
|
124
|
+
meta: z.record(z.string(), z.record(z.string(), z.union([z.number(), z.string()]))),
|
|
125
|
+
preview_url: z.string(),
|
|
126
|
+
remote_url: z.string().optional().nullable(),
|
|
127
|
+
text_url: z.string().optional().nullable(),
|
|
128
|
+
type: z.literal('unknown'),
|
|
129
|
+
url: z.string().nullable(),
|
|
130
|
+
});
|
|
131
|
+
export const videoAttachmentMetaOriginalSchema = z.object({
|
|
132
|
+
bitrate: z.number(),
|
|
133
|
+
duration: z.number(),
|
|
134
|
+
frame_rate: z.string(),
|
|
135
|
+
height: z.number(),
|
|
136
|
+
width: z.number(),
|
|
137
|
+
});
|
|
138
|
+
export const videoAttachmentMetaSmallSchema = z.object({
|
|
139
|
+
aspect: z.number(),
|
|
140
|
+
height: z.number(),
|
|
141
|
+
size: z.string(),
|
|
142
|
+
width: z.number(),
|
|
143
|
+
});
|
|
144
|
+
export const notificationTypeSchema = z.union([
|
|
145
|
+
z.literal('mention'),
|
|
146
|
+
z.literal('status'),
|
|
147
|
+
z.literal('reblog'),
|
|
148
|
+
z.literal('follow'),
|
|
149
|
+
z.literal('follow_request'),
|
|
150
|
+
z.literal('favourite'),
|
|
151
|
+
z.literal('poll'),
|
|
152
|
+
z.literal('update'),
|
|
153
|
+
z.literal('admin.sign_up'),
|
|
154
|
+
z.literal('admin.report'),
|
|
155
|
+
]);
|
|
156
|
+
export const pollOptionSchema = z.object({
|
|
157
|
+
title: z.string(),
|
|
158
|
+
votes_count: z.number().optional().nullable(),
|
|
159
|
+
});
|
|
160
|
+
export const pollVotePostSchema = z.object({
|
|
161
|
+
choices: z.array(z.number()),
|
|
162
|
+
});
|
|
163
|
+
export const searchSchema = z.object({
|
|
164
|
+
account_id: z.string().optional(),
|
|
165
|
+
exclude_unreviewed: z.boolean().optional(),
|
|
166
|
+
following: z.boolean().optional(),
|
|
167
|
+
max_id: z.string().optional(),
|
|
168
|
+
min_id: z.string().optional(),
|
|
169
|
+
q: z.string(),
|
|
170
|
+
limit: z.number().optional(),
|
|
171
|
+
offset: z.number().optional(),
|
|
172
|
+
resolve: z.boolean().optional(),
|
|
173
|
+
type: z.string().optional(),
|
|
174
|
+
});
|
|
175
|
+
export const statusVisibilitySchema = z.union([
|
|
176
|
+
z.literal('direct'),
|
|
177
|
+
z.literal('private'),
|
|
178
|
+
z.literal('public'),
|
|
179
|
+
z.literal('unlisted'),
|
|
180
|
+
z.literal('local'),
|
|
181
|
+
]);
|
|
182
|
+
export const statusMentionSchema = z.object({
|
|
183
|
+
acct: z.string(),
|
|
184
|
+
id: z.string(),
|
|
185
|
+
handle: z.string(),
|
|
186
|
+
url: z.string(),
|
|
187
|
+
});
|
|
188
|
+
export const textStatusPostPollSchema = z.object({
|
|
189
|
+
expires_in: z.number(),
|
|
190
|
+
hide_totals: z.boolean().optional(),
|
|
191
|
+
multiple: z.boolean().optional(),
|
|
192
|
+
options: z.array(z.string()),
|
|
193
|
+
});
|
|
194
|
+
export const streamEventTypeSchema = z.union([
|
|
195
|
+
z.literal('announcement'),
|
|
196
|
+
z.literal('announcement.delete'),
|
|
197
|
+
z.literal('announcement.reaction'),
|
|
198
|
+
z.literal('conversation'),
|
|
199
|
+
z.literal('delete'),
|
|
200
|
+
z.literal('encrypted_message'),
|
|
201
|
+
z.literal('filters_changed'),
|
|
202
|
+
z.literal('notification'),
|
|
203
|
+
z.literal('status.update'),
|
|
204
|
+
z.literal('update'),
|
|
205
|
+
]);
|
|
206
|
+
export const streamTypeSchema = z.union([
|
|
207
|
+
z.literal('direct'),
|
|
208
|
+
z.literal('hashtag'),
|
|
209
|
+
z.literal('hashtag:local'),
|
|
210
|
+
z.literal('list'),
|
|
211
|
+
z.literal('public'),
|
|
212
|
+
z.literal('public:local'),
|
|
213
|
+
z.literal('public:local:media'),
|
|
214
|
+
z.literal('public:media'),
|
|
215
|
+
z.literal('public:remote'),
|
|
216
|
+
z.literal('public:remote:media'),
|
|
217
|
+
z.literal('account'),
|
|
218
|
+
z.literal('account:notification'),
|
|
219
|
+
]);
|
|
220
|
+
export const streamParamsSchema = z.object({
|
|
221
|
+
list: z.string().optional(),
|
|
222
|
+
tag: z.string().optional(),
|
|
223
|
+
});
|
|
224
|
+
export const tagStatisticSchema = z.object({
|
|
225
|
+
accounts: z.number(),
|
|
226
|
+
day: z.number(),
|
|
227
|
+
following: z.boolean().optional(),
|
|
228
|
+
uses: z.number(),
|
|
229
|
+
});
|
|
230
|
+
const baseAccountSchema = z.object({
|
|
231
|
+
acct: z.string(),
|
|
232
|
+
avatar: z.string(),
|
|
233
|
+
avatar_static: z.string(),
|
|
234
|
+
bot: z.boolean(),
|
|
235
|
+
created_at: z.string(),
|
|
236
|
+
discoverable: z.boolean().optional(),
|
|
237
|
+
display_name: z.string(),
|
|
238
|
+
emojis: z.array(emojiSchema),
|
|
239
|
+
fields: z.array(z.unknown()),
|
|
240
|
+
followers_count: z.number(),
|
|
241
|
+
following_count: z.number(),
|
|
242
|
+
group: z.boolean(),
|
|
243
|
+
header: z.string(),
|
|
244
|
+
header_static: z.string(),
|
|
245
|
+
id: z.string(),
|
|
246
|
+
last_status_at: z.string().optional(),
|
|
247
|
+
limited: z.boolean().optional(),
|
|
248
|
+
locked: z.boolean(),
|
|
249
|
+
noindex: z.boolean().optional(),
|
|
250
|
+
note: z.string(),
|
|
251
|
+
statuses_count: z.number(),
|
|
252
|
+
suspended: z.boolean().optional(),
|
|
253
|
+
url: z.string(),
|
|
254
|
+
handle: z.string(),
|
|
255
|
+
});
|
|
256
|
+
export const accountSchema = baseAccountSchema.extend({
|
|
257
|
+
moved: baseAccountSchema,
|
|
258
|
+
});
|
|
259
|
+
export const tagSchema = z.object({
|
|
260
|
+
history: z.array(tagStatisticSchema).optional(),
|
|
261
|
+
name: z.string(),
|
|
262
|
+
url: z.string(),
|
|
263
|
+
});
|
|
264
|
+
export const cardSchema = z.union([
|
|
265
|
+
linkCardSchema,
|
|
266
|
+
photoCardSchema,
|
|
267
|
+
iframeCardSchema,
|
|
268
|
+
videoCardSchema,
|
|
269
|
+
]);
|
|
270
|
+
export const listSchema = z.object({
|
|
271
|
+
id: z.string(),
|
|
272
|
+
replies_policy: listReplyPolicySchema.optional(),
|
|
273
|
+
title: z.string(),
|
|
274
|
+
});
|
|
275
|
+
export const listAccountsSchema = z.array(accountSchema);
|
|
276
|
+
export const audioAttachmentMetaSchema = z.object({
|
|
277
|
+
audio_bitrate: z.string(),
|
|
278
|
+
audio_channels: z.string(),
|
|
279
|
+
audio_encode: z.string(),
|
|
280
|
+
duration: z.number(),
|
|
281
|
+
length: z.string(),
|
|
282
|
+
original: audioAttachmentMetaOriginalSchema,
|
|
283
|
+
});
|
|
284
|
+
export const gIFVAttachmentMetaSchema = z.object({
|
|
285
|
+
aspect: z.number(),
|
|
286
|
+
duration: z.number(),
|
|
287
|
+
fps: z.number(),
|
|
288
|
+
height: z.number(),
|
|
289
|
+
length: z.string(),
|
|
290
|
+
original: gIFVAttachmentMetaOriginalSchema,
|
|
291
|
+
size: z.string(),
|
|
292
|
+
small: gIFVAttachmentMetaSmallSchema,
|
|
293
|
+
width: z.number(),
|
|
294
|
+
});
|
|
295
|
+
export const imageAttachmentMetaSchema = z.object({
|
|
296
|
+
focus: imageAttachmentMetaFocusSchema.optional(),
|
|
297
|
+
original: imageAttachmentMetaOriginalSchema,
|
|
298
|
+
small: imageAttachmentMetaSmallSchema,
|
|
299
|
+
});
|
|
300
|
+
export const videoAttachmentMetaSchema = z.object({
|
|
301
|
+
aspect: z.number().optional(),
|
|
302
|
+
audio_bitrate: z.string().optional(),
|
|
303
|
+
audio_channels: z.string().optional(),
|
|
304
|
+
audio_encode: z.string().optional(),
|
|
305
|
+
duration: z.number().optional(),
|
|
306
|
+
fps: z.number().optional(),
|
|
307
|
+
height: z.number().optional(),
|
|
308
|
+
length: z.string().optional(),
|
|
309
|
+
original: videoAttachmentMetaOriginalSchema,
|
|
310
|
+
size: z.string().optional(),
|
|
311
|
+
small: videoAttachmentMetaSmallSchema,
|
|
312
|
+
width: z.number().optional(),
|
|
313
|
+
});
|
|
314
|
+
export const pollSchema = z.object({
|
|
315
|
+
emojis: z.array(emojiSchema),
|
|
316
|
+
expired: z.boolean(),
|
|
317
|
+
expires_at: z.string().optional().nullable(),
|
|
318
|
+
id: z.string(),
|
|
319
|
+
multiple: z.boolean().optional(),
|
|
320
|
+
options: z.array(pollOptionSchema),
|
|
321
|
+
own_votes: z.array(z.number()).optional(),
|
|
322
|
+
voted: z.boolean().optional(),
|
|
323
|
+
voters_count: z.number().optional().nullable(),
|
|
324
|
+
votes_count: z.number(),
|
|
325
|
+
});
|
|
326
|
+
export const mediaStatusPostSchema = z.object({
|
|
327
|
+
id: z.string().optional(),
|
|
328
|
+
in_reply_to_id: z.string().optional(),
|
|
329
|
+
media_ids: z.array(z.string()),
|
|
330
|
+
poll: z.undefined().optional(),
|
|
331
|
+
scheduled_at: z.date().optional(),
|
|
332
|
+
sensitive: z.boolean().optional(),
|
|
333
|
+
spoiler_text: z.string().optional(),
|
|
334
|
+
status: z.string().optional(),
|
|
335
|
+
visibility: statusVisibilitySchema.optional(),
|
|
336
|
+
});
|
|
337
|
+
export const textStatusPostSchema = z.object({
|
|
338
|
+
id: z.string().optional(),
|
|
339
|
+
in_reply_to_id: z.string().optional(),
|
|
340
|
+
media_ids: z.undefined().optional(),
|
|
341
|
+
poll: textStatusPostPollSchema.optional(),
|
|
342
|
+
scheduled_at: z.date().optional(),
|
|
343
|
+
sensitive: z.boolean().optional(),
|
|
344
|
+
spoiler_text: z.string().optional(),
|
|
345
|
+
status: z.string(),
|
|
346
|
+
visibility: statusVisibilitySchema.optional(),
|
|
347
|
+
});
|
|
348
|
+
export const announcementSchema = z.object({
|
|
349
|
+
all_day: z.boolean(),
|
|
350
|
+
content: z.string(),
|
|
351
|
+
emojis: z.array(emojiSchema),
|
|
352
|
+
ends_at: z.string().optional().nullable(),
|
|
353
|
+
id: z.string(),
|
|
354
|
+
mentions: z.array(announcementAccountSchema),
|
|
355
|
+
published: z.boolean().optional(),
|
|
356
|
+
published_at: z.string().optional().nullable(),
|
|
357
|
+
read: z.boolean().optional(),
|
|
358
|
+
reactions: z.array(reactionSchema),
|
|
359
|
+
starts_at: z.string().optional().nullable(),
|
|
360
|
+
statuses: z.array(announcementStatusSchema),
|
|
361
|
+
tags: z.array(tagSchema),
|
|
362
|
+
updated_at: z.string().optional().nullable(),
|
|
363
|
+
});
|
|
364
|
+
export const audioAttachmentSchema = z.object({
|
|
365
|
+
blurhash: z.string().optional().nullable(),
|
|
366
|
+
description: z.string().optional().nullable(),
|
|
367
|
+
id: z.string(),
|
|
368
|
+
meta: audioAttachmentMetaSchema,
|
|
369
|
+
preview_url: z.string(),
|
|
370
|
+
remote_url: z.string().optional().nullable(),
|
|
371
|
+
text_url: z.string().optional().nullable(),
|
|
372
|
+
type: z.literal('audio'),
|
|
373
|
+
url: z.string(),
|
|
374
|
+
});
|
|
375
|
+
export const gIFVAttachmentSchema = z.object({
|
|
376
|
+
blurhash: z.string(),
|
|
377
|
+
description: z.string().optional().nullable(),
|
|
378
|
+
id: z.string(),
|
|
379
|
+
meta: gIFVAttachmentMetaSchema,
|
|
380
|
+
preview_url: z.string(),
|
|
381
|
+
remote_url: z.string().optional().nullable(),
|
|
382
|
+
text_url: z.string().optional().nullable(),
|
|
383
|
+
type: z.literal('gifv'),
|
|
384
|
+
url: z.string(),
|
|
385
|
+
});
|
|
386
|
+
export const imageAttachmentSchema = z.object({
|
|
387
|
+
blurhash: z.string(),
|
|
388
|
+
description: z.string().optional().nullable(),
|
|
389
|
+
id: z.string(),
|
|
390
|
+
meta: imageAttachmentMetaSchema,
|
|
391
|
+
preview_remote_url: z.string().optional().nullable(),
|
|
392
|
+
preview_url: z.string(),
|
|
393
|
+
remote_url: z.string().optional().nullable(),
|
|
394
|
+
text_url: z.string().optional().nullable(),
|
|
395
|
+
type: z.literal('image'),
|
|
396
|
+
url: z.string(),
|
|
397
|
+
});
|
|
398
|
+
export const videoAttachmentSchema = z.object({
|
|
399
|
+
blurhash: z.string(),
|
|
400
|
+
description: z.string().optional().nullable(),
|
|
401
|
+
id: z.string(),
|
|
402
|
+
meta: videoAttachmentMetaSchema,
|
|
403
|
+
preview_url: z.string(),
|
|
404
|
+
remote_url: z.string().optional().nullable(),
|
|
405
|
+
text_url: z.string().optional().nullable(),
|
|
406
|
+
type: z.literal('video'),
|
|
407
|
+
url: z.string().nullable(),
|
|
408
|
+
});
|
|
409
|
+
export const statusPostSchema = z.union([
|
|
410
|
+
mediaStatusPostSchema,
|
|
411
|
+
textStatusPostSchema,
|
|
412
|
+
]);
|
|
413
|
+
export const mediaAttachmentSchema = z.union([
|
|
414
|
+
audioAttachmentSchema,
|
|
415
|
+
gIFVAttachmentSchema,
|
|
416
|
+
imageAttachmentSchema,
|
|
417
|
+
unknownAttachmentSchema,
|
|
418
|
+
videoAttachmentSchema,
|
|
419
|
+
]);
|
|
420
|
+
export const baseStatusSchema = z.object({
|
|
421
|
+
account: accountSchema,
|
|
422
|
+
application: applicationSchema.optional(),
|
|
423
|
+
bookmarked: z.boolean().optional(),
|
|
424
|
+
card: cardSchema.optional().nullable(),
|
|
425
|
+
created_at: z.string(),
|
|
426
|
+
content: z.string(),
|
|
427
|
+
edited_at: z.string().optional(),
|
|
428
|
+
emojis: z.array(emojiSchema),
|
|
429
|
+
favourited: z.boolean().optional(),
|
|
430
|
+
favourites_count: z.number(),
|
|
431
|
+
filtered: z.array(z.unknown()).optional(),
|
|
432
|
+
id: z.string(),
|
|
433
|
+
in_reply_to_account_id: z.string().optional().nullable(),
|
|
434
|
+
in_reply_to_id: z.string().optional().nullable(),
|
|
435
|
+
language: z.string().optional().nullable(),
|
|
436
|
+
media_attachments: z.array(mediaAttachmentSchema),
|
|
437
|
+
mentions: z.array(statusMentionSchema),
|
|
438
|
+
muted: z.boolean().optional(),
|
|
439
|
+
pinned: z.boolean().optional(),
|
|
440
|
+
poll: pollSchema.optional().nullable(),
|
|
441
|
+
reblogged: z.boolean().optional(),
|
|
442
|
+
reblogs_count: z.number(),
|
|
443
|
+
replies_count: z.number(),
|
|
444
|
+
sensitive: z.boolean(),
|
|
445
|
+
spoiler_text: z.string(),
|
|
446
|
+
tags: z.array(tagSchema),
|
|
447
|
+
text: z.string().optional().nullable(),
|
|
448
|
+
uri: z.string(),
|
|
449
|
+
url: z.string().optional().nullable(),
|
|
450
|
+
visibility: statusVisibilitySchema,
|
|
451
|
+
});
|
|
452
|
+
export const statusSchema = baseStatusSchema.extend({
|
|
453
|
+
reblog: baseStatusSchema.optional().nullable(),
|
|
454
|
+
});
|
|
455
|
+
export const searchResultsSchema = z.object({
|
|
456
|
+
accounts: z.array(accountSchema),
|
|
457
|
+
hashtags: z.array(tagSchema),
|
|
458
|
+
statuses: z.array(statusSchema),
|
|
459
|
+
});
|
|
460
|
+
export const statusContextSchema = z.object({
|
|
461
|
+
ancestors: z.array(statusSchema),
|
|
462
|
+
descendants: z.array(statusSchema),
|
|
463
|
+
});
|
|
464
|
+
export const statusScheduleSchema = z.object({
|
|
465
|
+
id: z.string().optional(),
|
|
466
|
+
media_attachments: z.array(mediaAttachmentSchema),
|
|
467
|
+
params: statusSchema,
|
|
468
|
+
scheduled_at: z.string(),
|
|
469
|
+
});
|
|
470
|
+
export const notificationSchema = z.object({
|
|
471
|
+
account: accountSchema,
|
|
472
|
+
created_at: z.string(),
|
|
473
|
+
id: z.string(),
|
|
474
|
+
report: z.unknown().optional(),
|
|
475
|
+
type: notificationTypeSchema,
|
|
476
|
+
status: statusSchema.optional(),
|
|
477
|
+
});
|
|
478
|
+
export const streamPayloadSchema = z.union([notificationSchema, statusSchema]);
|
|
479
|
+
export const streamDataSchema = z.object({
|
|
480
|
+
event: streamEventTypeSchema,
|
|
481
|
+
payload: streamPayloadSchema.optional(),
|
|
482
|
+
stream: z.array(streamTypeSchema),
|
|
483
|
+
});
|
|
484
|
+
export const statusCreateRequestSchema = z
|
|
485
|
+
.object({
|
|
486
|
+
status: z.string().optional(),
|
|
487
|
+
mediaIds: z.array(z.string()).optional(),
|
|
488
|
+
poll: pollSchema.optional(),
|
|
489
|
+
inReplyToId: z.string().optional(),
|
|
490
|
+
sensitive: z.boolean().optional(),
|
|
491
|
+
spoilerText: z.string().optional(),
|
|
492
|
+
visibility: z.enum(['public', 'unlisted', 'private', 'direct']),
|
|
493
|
+
language: z.string().optional(),
|
|
494
|
+
scheduledAt: z
|
|
495
|
+
.string()
|
|
496
|
+
.optional()
|
|
497
|
+
.refine((data) => {
|
|
498
|
+
if (data) {
|
|
499
|
+
const scheduledDate = new Date(data);
|
|
500
|
+
const now = new Date();
|
|
501
|
+
now.setMinutes(now.getMinutes() + 5);
|
|
502
|
+
return scheduledDate > now;
|
|
503
|
+
}
|
|
504
|
+
return true;
|
|
505
|
+
}, {
|
|
506
|
+
message: 'Scheduled time must be at least 5 minutes in the future',
|
|
507
|
+
}),
|
|
508
|
+
})
|
|
509
|
+
.refine((data) => data.status || data.mediaIds || data.poll, {
|
|
510
|
+
message: 'No content provided',
|
|
511
|
+
})
|
|
512
|
+
.refine((data) => !(data.poll && data.mediaIds), {
|
|
513
|
+
message: 'Polls cannot have media',
|
|
514
|
+
})
|
|
515
|
+
.refine((data) => !(data.poll && !data.poll.expires_at), {
|
|
516
|
+
message: 'Poll expiration is required',
|
|
517
|
+
})
|
|
518
|
+
.refine((data) => !(data.poll && data.poll.options && data.poll.options.length === 0), {
|
|
519
|
+
message: 'Poll options are required',
|
|
520
|
+
})
|
|
521
|
+
.refine((data) => !(data.mediaIds && data.status === undefined && !data.poll), {
|
|
522
|
+
message: "Text can't be blank",
|
|
523
|
+
});
|