@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,413 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import * as documents from '../schema/documents.js';
|
|
13
|
+
import * as edges from '../schema/edges.js';
|
|
14
|
+
import { modelTimestampsFromRow, rowToModel, } from '../mappers.js';
|
|
15
|
+
export const asTable = (table) => table;
|
|
16
|
+
const bodyOnly = (data) => ({
|
|
17
|
+
scalars: {},
|
|
18
|
+
body: Object.assign({}, data),
|
|
19
|
+
});
|
|
20
|
+
const withScalars = (...scalarKeys) => (data) => {
|
|
21
|
+
const scalars = {};
|
|
22
|
+
const body = Object.assign({}, data);
|
|
23
|
+
for (const key of scalarKeys) {
|
|
24
|
+
if (key in body) {
|
|
25
|
+
scalars[key] = body[key];
|
|
26
|
+
delete body[key];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return { scalars, body };
|
|
30
|
+
};
|
|
31
|
+
const postsSplit = (data) => {
|
|
32
|
+
const { type, visibility, creatorId, data: postBody } = data, rest = __rest(data, ["type", "visibility", "creatorId", "data"]);
|
|
33
|
+
const scalars = {};
|
|
34
|
+
if (type !== undefined)
|
|
35
|
+
scalars.type = type;
|
|
36
|
+
if (visibility !== undefined)
|
|
37
|
+
scalars.visibility = visibility;
|
|
38
|
+
if (creatorId !== undefined)
|
|
39
|
+
scalars.creatorId = creatorId;
|
|
40
|
+
const body = postBody !== undefined ? Object.assign({}, postBody) : Object.assign({}, rest);
|
|
41
|
+
if (postBody === undefined) {
|
|
42
|
+
delete body.type;
|
|
43
|
+
delete body.visibility;
|
|
44
|
+
delete body.creatorId;
|
|
45
|
+
}
|
|
46
|
+
return { scalars, body };
|
|
47
|
+
};
|
|
48
|
+
const profilesSplit = (data) => {
|
|
49
|
+
const { handle, type, activityPub } = data, rest = __rest(data, ["handle", "type", "activityPub"]);
|
|
50
|
+
const scalars = {};
|
|
51
|
+
if (handle !== undefined)
|
|
52
|
+
scalars.handle = handle;
|
|
53
|
+
if (type !== undefined)
|
|
54
|
+
scalars.type = type;
|
|
55
|
+
if (activityPub !== undefined) {
|
|
56
|
+
const domain = activityPub.domain;
|
|
57
|
+
if (domain !== undefined)
|
|
58
|
+
scalars.activityPubDomain = domain;
|
|
59
|
+
}
|
|
60
|
+
return { scalars, body: Object.assign({}, rest) };
|
|
61
|
+
};
|
|
62
|
+
/** App model uses `tag`; Postgres column is `name`. */
|
|
63
|
+
const hashtagsSplit = (data) => {
|
|
64
|
+
const normalized = Object.assign({}, data);
|
|
65
|
+
if ('tag' in normalized && !('name' in normalized)) {
|
|
66
|
+
normalized.name = normalized.tag;
|
|
67
|
+
delete normalized.tag;
|
|
68
|
+
}
|
|
69
|
+
if (typeof normalized.name === 'string') {
|
|
70
|
+
normalized.name = normalized.name.trim().toLowerCase();
|
|
71
|
+
}
|
|
72
|
+
return withScalars('name')(normalized);
|
|
73
|
+
};
|
|
74
|
+
/** Arango jam events use jamId; Postgres column is post_id. */
|
|
75
|
+
const jamEventsSplit = (data) => {
|
|
76
|
+
const { postId, jamId } = data, rest = __rest(data, ["postId", "jamId"]);
|
|
77
|
+
const scalars = {};
|
|
78
|
+
const resolvedPostId = postId !== null && postId !== void 0 ? postId : jamId;
|
|
79
|
+
if (resolvedPostId !== undefined) {
|
|
80
|
+
scalars.postId = resolvedPostId;
|
|
81
|
+
}
|
|
82
|
+
return { scalars, body: Object.assign({}, rest) };
|
|
83
|
+
};
|
|
84
|
+
/** Legacy settings docs use profile id as document id, not profileId. */
|
|
85
|
+
const profileSettingsSplit = (data) => {
|
|
86
|
+
const { profileId, id } = data, rest = __rest(data, ["profileId", "id"]);
|
|
87
|
+
const scalars = {};
|
|
88
|
+
const resolvedProfileId = profileId !== null && profileId !== void 0 ? profileId : id;
|
|
89
|
+
if (resolvedProfileId !== undefined) {
|
|
90
|
+
scalars.profileId = resolvedProfileId;
|
|
91
|
+
}
|
|
92
|
+
return { scalars, body: Object.assign({}, rest) };
|
|
93
|
+
};
|
|
94
|
+
export const documentRegistry = {
|
|
95
|
+
accounts: {
|
|
96
|
+
kind: 'document',
|
|
97
|
+
table: documents.accounts,
|
|
98
|
+
splitPatch: withScalars('email', 'passwordHash', 'emailValidated', 'guest'),
|
|
99
|
+
},
|
|
100
|
+
profiles: {
|
|
101
|
+
kind: 'document',
|
|
102
|
+
table: documents.profiles,
|
|
103
|
+
splitPatch: profilesSplit,
|
|
104
|
+
},
|
|
105
|
+
posts: {
|
|
106
|
+
kind: 'document',
|
|
107
|
+
table: documents.posts,
|
|
108
|
+
splitPatch: postsSplit,
|
|
109
|
+
},
|
|
110
|
+
groups: {
|
|
111
|
+
kind: 'document',
|
|
112
|
+
table: documents.groups,
|
|
113
|
+
splitPatch: withScalars('handle'),
|
|
114
|
+
},
|
|
115
|
+
hashtags: {
|
|
116
|
+
kind: 'document',
|
|
117
|
+
table: documents.hashtags,
|
|
118
|
+
splitPatch: hashtagsSplit,
|
|
119
|
+
},
|
|
120
|
+
roles: {
|
|
121
|
+
kind: 'document',
|
|
122
|
+
table: documents.roles,
|
|
123
|
+
splitPatch: withScalars('key', 'isDefault'),
|
|
124
|
+
},
|
|
125
|
+
notifications: {
|
|
126
|
+
kind: 'document',
|
|
127
|
+
table: documents.notifications,
|
|
128
|
+
splitPatch: withScalars('profileId'),
|
|
129
|
+
},
|
|
130
|
+
reports: {
|
|
131
|
+
kind: 'document',
|
|
132
|
+
table: documents.reports,
|
|
133
|
+
splitPatch: bodyOnly,
|
|
134
|
+
},
|
|
135
|
+
accessTokens: {
|
|
136
|
+
kind: 'document',
|
|
137
|
+
table: documents.accessTokens,
|
|
138
|
+
splitPatch: bodyOnly,
|
|
139
|
+
},
|
|
140
|
+
pushSubscriptions: {
|
|
141
|
+
kind: 'document',
|
|
142
|
+
table: documents.pushSubscriptions,
|
|
143
|
+
splitPatch: bodyOnly,
|
|
144
|
+
},
|
|
145
|
+
inviteLinks: {
|
|
146
|
+
kind: 'document',
|
|
147
|
+
table: documents.inviteLinks,
|
|
148
|
+
splitPatch: withScalars('slug'),
|
|
149
|
+
},
|
|
150
|
+
jamEvents: {
|
|
151
|
+
kind: 'document',
|
|
152
|
+
table: documents.jamEvents,
|
|
153
|
+
splitPatch: jamEventsSplit,
|
|
154
|
+
},
|
|
155
|
+
mediaAttachments: {
|
|
156
|
+
kind: 'document',
|
|
157
|
+
table: documents.mediaAttachments,
|
|
158
|
+
splitPatch: bodyOnly,
|
|
159
|
+
},
|
|
160
|
+
processingStats: {
|
|
161
|
+
kind: 'document',
|
|
162
|
+
table: documents.processingStats,
|
|
163
|
+
splitPatch: withScalars('filetype', 'filesize'),
|
|
164
|
+
},
|
|
165
|
+
profileSettings: {
|
|
166
|
+
kind: 'document',
|
|
167
|
+
table: documents.profileSettings,
|
|
168
|
+
splitPatch: profileSettingsSplit,
|
|
169
|
+
},
|
|
170
|
+
configs: {
|
|
171
|
+
kind: 'document',
|
|
172
|
+
table: documents.configs,
|
|
173
|
+
splitPatch: bodyOnly,
|
|
174
|
+
},
|
|
175
|
+
i18n: {
|
|
176
|
+
kind: 'document',
|
|
177
|
+
table: documents.i18nEntries,
|
|
178
|
+
splitPatch: withScalars('locale', 'namespace'),
|
|
179
|
+
},
|
|
180
|
+
dataMigrations: {
|
|
181
|
+
kind: 'document',
|
|
182
|
+
table: documents.dataMigrations,
|
|
183
|
+
splitPatch: bodyOnly,
|
|
184
|
+
},
|
|
185
|
+
};
|
|
186
|
+
export const edgeRegistry = {
|
|
187
|
+
follows: {
|
|
188
|
+
kind: 'edge',
|
|
189
|
+
table: edges.follows,
|
|
190
|
+
fromCollection: 'profiles',
|
|
191
|
+
toCollection: 'profiles',
|
|
192
|
+
},
|
|
193
|
+
requestsFollow: {
|
|
194
|
+
kind: 'edge',
|
|
195
|
+
table: edges.requestsFollow,
|
|
196
|
+
fromCollection: 'profiles',
|
|
197
|
+
toCollection: 'profiles',
|
|
198
|
+
},
|
|
199
|
+
controls: {
|
|
200
|
+
kind: 'edge',
|
|
201
|
+
table: edges.controls,
|
|
202
|
+
fromCollection: 'accounts',
|
|
203
|
+
toCollection: 'profiles',
|
|
204
|
+
},
|
|
205
|
+
mentions: {
|
|
206
|
+
kind: 'edge',
|
|
207
|
+
table: edges.mentions,
|
|
208
|
+
fromCollection: 'posts',
|
|
209
|
+
toCollection: 'profiles',
|
|
210
|
+
},
|
|
211
|
+
audience: {
|
|
212
|
+
kind: 'edge',
|
|
213
|
+
table: edges.audience,
|
|
214
|
+
fromCollection: 'posts',
|
|
215
|
+
toCollection: 'profiles',
|
|
216
|
+
},
|
|
217
|
+
postHashtags: {
|
|
218
|
+
kind: 'edge',
|
|
219
|
+
table: edges.postHashtags,
|
|
220
|
+
fromCollection: 'posts',
|
|
221
|
+
toCollection: 'hashtags',
|
|
222
|
+
},
|
|
223
|
+
entries: {
|
|
224
|
+
kind: 'edge',
|
|
225
|
+
table: edges.entries,
|
|
226
|
+
fromCollection: 'profiles',
|
|
227
|
+
toCollection: 'posts',
|
|
228
|
+
},
|
|
229
|
+
reactions: {
|
|
230
|
+
kind: 'edge',
|
|
231
|
+
table: edges.reactions,
|
|
232
|
+
fromCollection: 'profiles',
|
|
233
|
+
toCollection: 'posts',
|
|
234
|
+
},
|
|
235
|
+
replyTo: {
|
|
236
|
+
kind: 'edge',
|
|
237
|
+
table: edges.replyTo,
|
|
238
|
+
fromCollection: 'posts',
|
|
239
|
+
toCollection: 'posts',
|
|
240
|
+
},
|
|
241
|
+
repost: {
|
|
242
|
+
kind: 'edge',
|
|
243
|
+
table: edges.repost,
|
|
244
|
+
fromCollection: 'posts',
|
|
245
|
+
toCollection: 'posts',
|
|
246
|
+
},
|
|
247
|
+
bookmarks: {
|
|
248
|
+
kind: 'edge',
|
|
249
|
+
table: edges.bookmarks,
|
|
250
|
+
fromCollection: 'profiles',
|
|
251
|
+
toCollection: 'posts',
|
|
252
|
+
},
|
|
253
|
+
postSeen: {
|
|
254
|
+
kind: 'edge',
|
|
255
|
+
table: edges.postSeen,
|
|
256
|
+
fromCollection: 'profiles',
|
|
257
|
+
toCollection: 'posts',
|
|
258
|
+
},
|
|
259
|
+
hasSeen: {
|
|
260
|
+
kind: 'edge',
|
|
261
|
+
table: edges.hasSeen,
|
|
262
|
+
fromCollection: 'profiles',
|
|
263
|
+
toCollection: 'posts',
|
|
264
|
+
},
|
|
265
|
+
hasRead: {
|
|
266
|
+
kind: 'edge',
|
|
267
|
+
table: edges.hasRead,
|
|
268
|
+
fromCollection: 'profiles',
|
|
269
|
+
toCollection: 'notifications',
|
|
270
|
+
},
|
|
271
|
+
userGroups: {
|
|
272
|
+
kind: 'edge',
|
|
273
|
+
table: edges.userGroups,
|
|
274
|
+
fromCollection: 'profiles',
|
|
275
|
+
toCollection: 'groups',
|
|
276
|
+
},
|
|
277
|
+
postGroups: {
|
|
278
|
+
kind: 'edge',
|
|
279
|
+
table: edges.postGroups,
|
|
280
|
+
fromCollection: 'posts',
|
|
281
|
+
toCollection: 'groups',
|
|
282
|
+
},
|
|
283
|
+
hasRole: {
|
|
284
|
+
kind: 'edge',
|
|
285
|
+
table: edges.hasRole,
|
|
286
|
+
fromCollection: 'profiles',
|
|
287
|
+
toCollection: 'roles',
|
|
288
|
+
},
|
|
289
|
+
profileAccessTokens: {
|
|
290
|
+
kind: 'edge',
|
|
291
|
+
table: edges.profileAccessTokens,
|
|
292
|
+
fromCollection: 'profiles',
|
|
293
|
+
toCollection: 'accessTokens',
|
|
294
|
+
},
|
|
295
|
+
accountToPushSubscription: {
|
|
296
|
+
kind: 'edge',
|
|
297
|
+
table: edges.accountToPushSubscription,
|
|
298
|
+
fromCollection: 'accounts',
|
|
299
|
+
toCollection: 'pushSubscriptions',
|
|
300
|
+
},
|
|
301
|
+
createdReport: {
|
|
302
|
+
kind: 'edge',
|
|
303
|
+
table: edges.createdReport,
|
|
304
|
+
fromCollection: 'profiles',
|
|
305
|
+
toCollection: 'reports',
|
|
306
|
+
},
|
|
307
|
+
isReportedProfile: {
|
|
308
|
+
kind: 'edge',
|
|
309
|
+
table: edges.isReportedProfile,
|
|
310
|
+
fromCollection: 'reports',
|
|
311
|
+
toCollection: 'profiles',
|
|
312
|
+
},
|
|
313
|
+
isReportedObject: {
|
|
314
|
+
kind: 'edge',
|
|
315
|
+
table: edges.isReportedObject,
|
|
316
|
+
fromCollection: 'reports',
|
|
317
|
+
toCollection: 'posts',
|
|
318
|
+
},
|
|
319
|
+
inviteLinkCreators: {
|
|
320
|
+
kind: 'edge',
|
|
321
|
+
table: edges.inviteLinkCreators,
|
|
322
|
+
fromCollection: 'inviteLinks',
|
|
323
|
+
toCollection: 'profiles',
|
|
324
|
+
},
|
|
325
|
+
inviteLinkRedeemers: {
|
|
326
|
+
kind: 'edge',
|
|
327
|
+
table: edges.inviteLinkRedeemers,
|
|
328
|
+
fromCollection: 'inviteLinks',
|
|
329
|
+
toCollection: 'profiles',
|
|
330
|
+
},
|
|
331
|
+
jamRecordings: {
|
|
332
|
+
kind: 'edge',
|
|
333
|
+
table: edges.jamRecordings,
|
|
334
|
+
fromCollection: 'profiles',
|
|
335
|
+
toCollection: 'posts',
|
|
336
|
+
},
|
|
337
|
+
};
|
|
338
|
+
export const getCollectionConfig = (collection) => { var _a; return (_a = documentRegistry[collection]) !== null && _a !== void 0 ? _a : edgeRegistry[collection]; };
|
|
339
|
+
export const getTableForCollection = (collection) => {
|
|
340
|
+
const config = getCollectionConfig(collection);
|
|
341
|
+
if (!config) {
|
|
342
|
+
throw new Error(`Unknown collection: ${collection}`);
|
|
343
|
+
}
|
|
344
|
+
return config.table;
|
|
345
|
+
};
|
|
346
|
+
export const isEdgeCollection = (collection) => collection in edgeRegistry;
|
|
347
|
+
export const parseDocRef = (ref) => {
|
|
348
|
+
const slash = ref.indexOf('/');
|
|
349
|
+
if (slash <= 0)
|
|
350
|
+
return undefined;
|
|
351
|
+
return { collection: ref.slice(0, slash), id: ref.slice(slash + 1) };
|
|
352
|
+
};
|
|
353
|
+
export const docRef = (collection, id) => `${collection}/${id}`;
|
|
354
|
+
const rowTimestamps = (row) => modelTimestampsFromRow(row);
|
|
355
|
+
export const rowToDocument = (collection, row, keepMetadata = false) => {
|
|
356
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
357
|
+
const config = getCollectionConfig(collection);
|
|
358
|
+
if (!config) {
|
|
359
|
+
throw new Error(`Unknown collection: ${collection}`);
|
|
360
|
+
}
|
|
361
|
+
const timestamps = rowTimestamps(row);
|
|
362
|
+
if (config.kind === 'edge') {
|
|
363
|
+
const fromId = row.fromId;
|
|
364
|
+
const toId = row.toId;
|
|
365
|
+
// Body fields first; row id / edge refs / timestamps always win so a
|
|
366
|
+
// stale body.id (from older inserts) cannot shadow the primary key.
|
|
367
|
+
const base = Object.assign(Object.assign({}, ((_a = row.body) !== null && _a !== void 0 ? _a : {})), { id: row.id, _from: docRef(config.fromCollection, fromId), _to: docRef(config.toCollection, toId), createdAt: timestamps.createdAt, updatedAt: timestamps.updatedAt });
|
|
368
|
+
return keepMetadata ? base : base;
|
|
369
|
+
}
|
|
370
|
+
switch (collection) {
|
|
371
|
+
case 'accounts':
|
|
372
|
+
return rowToModel(row.id, {
|
|
373
|
+
email: row.email,
|
|
374
|
+
passwordHash: row.passwordHash,
|
|
375
|
+
emailValidated: row.emailValidated,
|
|
376
|
+
guest: (_b = row.guest) !== null && _b !== void 0 ? _b : undefined,
|
|
377
|
+
}, timestamps);
|
|
378
|
+
case 'profiles':
|
|
379
|
+
return rowToModel(row.id, Object.assign(Object.assign({ handle: row.handle, type: row.type }, (row.activityPubDomain
|
|
380
|
+
? { activityPub: { domain: row.activityPubDomain } }
|
|
381
|
+
: {})), ((_c = row.body) !== null && _c !== void 0 ? _c : {})), timestamps);
|
|
382
|
+
case 'posts':
|
|
383
|
+
return rowToModel(row.id, {
|
|
384
|
+
type: row.type,
|
|
385
|
+
visibility: row.visibility,
|
|
386
|
+
creatorId: row.creatorId,
|
|
387
|
+
data: (_d = row.body) !== null && _d !== void 0 ? _d : {},
|
|
388
|
+
}, timestamps);
|
|
389
|
+
case 'groups':
|
|
390
|
+
return rowToModel(row.id, Object.assign({ handle: row.handle }, ((_e = row.body) !== null && _e !== void 0 ? _e : {})), timestamps);
|
|
391
|
+
case 'hashtags':
|
|
392
|
+
return rowToModel(row.id, { tag: row.name }, timestamps);
|
|
393
|
+
case 'roles':
|
|
394
|
+
return rowToModel(row.id, Object.assign({ key: row.key, isDefault: row.isDefault }, ((_f = row.body) !== null && _f !== void 0 ? _f : {})), timestamps);
|
|
395
|
+
case 'notifications':
|
|
396
|
+
return rowToModel(row.id, Object.assign({ profileId: row.profileId }, ((_g = row.body) !== null && _g !== void 0 ? _g : {})), timestamps);
|
|
397
|
+
case 'jamEvents':
|
|
398
|
+
return rowToModel(row.id, Object.assign({ jamId: row.postId }, ((_h = row.body) !== null && _h !== void 0 ? _h : {})), timestamps);
|
|
399
|
+
case 'processingStats':
|
|
400
|
+
return rowToModel(row.id, Object.assign({ filetype: row.filetype, filesize: row.filesize }, ((_j = row.body) !== null && _j !== void 0 ? _j : {})), timestamps);
|
|
401
|
+
case 'profileSettings':
|
|
402
|
+
return rowToModel(row.profileId, ((_k = row.body) !== null && _k !== void 0 ? _k : {}), timestamps);
|
|
403
|
+
case 'inviteLinks':
|
|
404
|
+
return rowToModel(row.id, Object.assign({ slug: row.slug }, ((_l = row.body) !== null && _l !== void 0 ? _l : {})), timestamps);
|
|
405
|
+
default:
|
|
406
|
+
return rowToModel(row.id, ((_m = row.body) !== null && _m !== void 0 ? _m : {}), timestamps);
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
export const searchViewCollections = {
|
|
410
|
+
groupSearch: 'groups',
|
|
411
|
+
profileSearch: 'profiles',
|
|
412
|
+
postSearch: 'posts',
|
|
413
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { DerivedProperty, MapData, PgFilter, Relation } from './queryTypes';
|
|
2
|
+
import type { PgDb } from '../client';
|
|
3
|
+
type Doc = Record<string, unknown>;
|
|
4
|
+
export declare const fetchRowsByIds: (db: PgDb, collection: string, ids: string[], softDelete?: boolean) => Promise<Doc[]>;
|
|
5
|
+
/**
|
|
6
|
+
* Like {@link fetchRowsByIds}, but applies mapping SQL filters (and SQL sort).
|
|
7
|
+
* Returns `{ docs, postFilters }` so callers can hydrate with the remaining
|
|
8
|
+
* OM filters — same split as {@link executeAll}.
|
|
9
|
+
*/
|
|
10
|
+
export declare const fetchFilteredRowsByIds: (db: PgDb, mapData: MapData<object, object>, ids: string[]) => Promise<{
|
|
11
|
+
docs: Doc[];
|
|
12
|
+
postFilters: PgFilter<Record<string, unknown>>[];
|
|
13
|
+
}>;
|
|
14
|
+
export declare const hydrateMapData: (db: PgDb, mapData: MapData<object, object>, rows: Doc[], postFilters?: PgFilter<Record<string, unknown>>[]) => Promise<Doc[]>;
|
|
15
|
+
export declare const executeFind: (db: PgDb, collection: string, mapData: MapData<object, object>, id: string, ignoreSoftDelete?: boolean) => Promise<Doc | undefined>;
|
|
16
|
+
export declare const executeAll: (db: PgDb, mapData: MapData<object, object>) => Promise<Doc[]>;
|
|
17
|
+
export declare const executeCount: (db: PgDb, mapData: MapData<object, object>) => Promise<number>;
|
|
18
|
+
export declare const executeFirst: (db: PgDb, mapData: MapData<object, object>) => Promise<Doc | undefined>;
|
|
19
|
+
export declare const relationsFrom: (db: PgDb, start: {
|
|
20
|
+
id: string;
|
|
21
|
+
}, parentCollection: string, relation: Relation & {
|
|
22
|
+
mapping: MapData<object, object>;
|
|
23
|
+
}) => Promise<Doc[]>;
|
|
24
|
+
export declare const evaluateDerived: (db: PgDb, doc: Doc, derived: DerivedProperty) => Promise<unknown>;
|
|
25
|
+
export declare const deleteRelationsFor: (db: PgDb, startId: string, relation: Relation & {
|
|
26
|
+
mapping: MapData<object, object>;
|
|
27
|
+
}) => Promise<void>;
|
|
28
|
+
export {};
|