@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,125 @@
|
|
|
1
|
+
import { AuthorizationData, PublicProfile } from '@openpeepshq/common/types';
|
|
2
|
+
export declare const findGroup: (id: string) => Promise<{
|
|
3
|
+
handle: string;
|
|
4
|
+
capabilities: Record<string, {
|
|
5
|
+
add?: string[] | undefined;
|
|
6
|
+
remove?: string[] | undefined;
|
|
7
|
+
} | undefined>;
|
|
8
|
+
membersCount: number;
|
|
9
|
+
id: string;
|
|
10
|
+
createdAt: string;
|
|
11
|
+
updatedAt: string;
|
|
12
|
+
avatar?: string | null | undefined;
|
|
13
|
+
header?: string | null | undefined;
|
|
14
|
+
displayName?: string | undefined;
|
|
15
|
+
description?: string | undefined;
|
|
16
|
+
rules?: string | undefined;
|
|
17
|
+
pinnedPostId?: string | undefined;
|
|
18
|
+
discoverable?: boolean | undefined;
|
|
19
|
+
lastPostAt?: string | null | undefined;
|
|
20
|
+
deletedAt?: string | null | undefined;
|
|
21
|
+
} | undefined>;
|
|
22
|
+
export declare const findGroupByHandle: (handle: string) => Promise<{
|
|
23
|
+
handle: string;
|
|
24
|
+
capabilities: Record<string, {
|
|
25
|
+
add?: string[] | undefined;
|
|
26
|
+
remove?: string[] | undefined;
|
|
27
|
+
} | undefined>;
|
|
28
|
+
membersCount: number;
|
|
29
|
+
id: string;
|
|
30
|
+
createdAt: string;
|
|
31
|
+
updatedAt: string;
|
|
32
|
+
avatar?: string | null | undefined;
|
|
33
|
+
header?: string | null | undefined;
|
|
34
|
+
displayName?: string | undefined;
|
|
35
|
+
description?: string | undefined;
|
|
36
|
+
rules?: string | undefined;
|
|
37
|
+
pinnedPostId?: string | undefined;
|
|
38
|
+
discoverable?: boolean | undefined;
|
|
39
|
+
lastPostAt?: string | null | undefined;
|
|
40
|
+
deletedAt?: string | null | undefined;
|
|
41
|
+
} | undefined>;
|
|
42
|
+
export declare const existsGroupByHandle: (handle: string) => Promise<boolean>;
|
|
43
|
+
export declare const listGroups: (authData: AuthorizationData) => Promise<{
|
|
44
|
+
handle: string;
|
|
45
|
+
capabilities: Record<string, {
|
|
46
|
+
add?: string[] | undefined;
|
|
47
|
+
remove?: string[] | undefined;
|
|
48
|
+
} | undefined>;
|
|
49
|
+
membersCount: number;
|
|
50
|
+
id: string;
|
|
51
|
+
createdAt: string;
|
|
52
|
+
updatedAt: string;
|
|
53
|
+
avatar?: string | null | undefined;
|
|
54
|
+
header?: string | null | undefined;
|
|
55
|
+
displayName?: string | undefined;
|
|
56
|
+
description?: string | undefined;
|
|
57
|
+
rules?: string | undefined;
|
|
58
|
+
pinnedPostId?: string | undefined;
|
|
59
|
+
discoverable?: boolean | undefined;
|
|
60
|
+
lastPostAt?: string | null | undefined;
|
|
61
|
+
deletedAt?: string | null | undefined;
|
|
62
|
+
}[]>;
|
|
63
|
+
export declare const listGroupsByProfile: (profile: PublicProfile) => Promise<import("@openpeepshq/common").GroupMember[]>;
|
|
64
|
+
export declare const listAdminGroups: () => Promise<{
|
|
65
|
+
handle: string;
|
|
66
|
+
capabilities: Record<string, {
|
|
67
|
+
add?: string[] | undefined;
|
|
68
|
+
remove?: string[] | undefined;
|
|
69
|
+
} | undefined>;
|
|
70
|
+
membersCount: number;
|
|
71
|
+
id: string;
|
|
72
|
+
createdAt: string;
|
|
73
|
+
updatedAt: string;
|
|
74
|
+
postsCount: number;
|
|
75
|
+
admins: {
|
|
76
|
+
handle: string;
|
|
77
|
+
type: "guest" | "local" | "federated";
|
|
78
|
+
id: string;
|
|
79
|
+
createdAt: string;
|
|
80
|
+
updatedAt: string;
|
|
81
|
+
deletedHandle?: string | undefined;
|
|
82
|
+
avatar?: string | null | undefined;
|
|
83
|
+
header?: string | null | undefined;
|
|
84
|
+
displayName?: string | undefined;
|
|
85
|
+
bio?: string | undefined;
|
|
86
|
+
timeZone?: string | undefined;
|
|
87
|
+
location?: {
|
|
88
|
+
text: string;
|
|
89
|
+
coordinates?: {
|
|
90
|
+
lat: number;
|
|
91
|
+
lng: number;
|
|
92
|
+
alt?: number | undefined;
|
|
93
|
+
} | undefined;
|
|
94
|
+
} | undefined;
|
|
95
|
+
locked?: boolean | undefined;
|
|
96
|
+
bot?: boolean | undefined;
|
|
97
|
+
discoverable?: boolean | undefined;
|
|
98
|
+
hideSocialGraph?: boolean | undefined;
|
|
99
|
+
indexable?: boolean | undefined;
|
|
100
|
+
fields?: {
|
|
101
|
+
name: string;
|
|
102
|
+
value: string;
|
|
103
|
+
}[] | undefined;
|
|
104
|
+
activityPub?: {
|
|
105
|
+
domain: string;
|
|
106
|
+
} | undefined;
|
|
107
|
+
guestData?: {
|
|
108
|
+
email?: string | undefined;
|
|
109
|
+
resource?: {
|
|
110
|
+
type: "profiles" | "groups" | "posts" | "notifications" | "reports" | "db" | "self" | "jams" | "*" | "jam" | "webhooks" | "analytics" | "render";
|
|
111
|
+
id?: string | undefined;
|
|
112
|
+
} | undefined;
|
|
113
|
+
} | undefined;
|
|
114
|
+
deletedAt?: string | null | undefined;
|
|
115
|
+
}[];
|
|
116
|
+
avatar?: string | null | undefined;
|
|
117
|
+
header?: string | null | undefined;
|
|
118
|
+
displayName?: string | undefined;
|
|
119
|
+
description?: string | undefined;
|
|
120
|
+
rules?: string | undefined;
|
|
121
|
+
pinnedPostId?: string | undefined;
|
|
122
|
+
discoverable?: boolean | undefined;
|
|
123
|
+
lastPostAt?: string | null | undefined;
|
|
124
|
+
deletedAt?: string | null | undefined;
|
|
125
|
+
}[]>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { allpeepDb } from '../db/index.js';
|
|
2
|
+
import { adminGroupsMapping, groupsMapping } from './mapping.js';
|
|
3
|
+
import { profilesMapping, membersRelation } from '../profiles/mapping.js';
|
|
4
|
+
import { canSeeGroupFilter } from './helpers.js';
|
|
5
|
+
import { sorts } from '../db/pg/queries/index.js';
|
|
6
|
+
export const findGroup = (id) => allpeepDb().then((db) => groupsMapping.find(db.db, id));
|
|
7
|
+
export const findGroupByHandle = (handle) => allpeepDb().then((db) => groupsMapping.findOneBy(db.db, { matches: { handle } }));
|
|
8
|
+
export const existsGroupByHandle = (handle) => allpeepDb()
|
|
9
|
+
.then((db) => groupsMapping
|
|
10
|
+
.ignoreSoftDelete()
|
|
11
|
+
.findOneBy(db.db, { matches: { handle } }))
|
|
12
|
+
.then(Boolean);
|
|
13
|
+
export const listGroups = (authData) => allpeepDb().then((db) => groupsMapping
|
|
14
|
+
.filter(canSeeGroupFilter(authData.profile))
|
|
15
|
+
.sort(sorts.lastPostAtDesc)
|
|
16
|
+
.all(db.db));
|
|
17
|
+
export const listGroupsByProfile = (profile) => allpeepDb().then(({ db }) => profilesMapping.relationsFrom(profile, membersRelation).all(db));
|
|
18
|
+
export const listAdminGroups = () => allpeepDb().then((db) => adminGroupsMapping.sort(sorts.lastPostAtDesc).all(db.db));
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import type { GroupWithMeta, ProfileWithMeta } from '@openpeepshq/common/types';
|
|
2
|
+
import type { PgFilter } from '../db/pg/map/queryTypes';
|
|
3
|
+
export declare const addMember: (db: import("../db").PgDb, from: {
|
|
4
|
+
id: string;
|
|
5
|
+
type: "guest" | "local" | "federated";
|
|
6
|
+
createdAt: string;
|
|
7
|
+
updatedAt: string;
|
|
8
|
+
handle: string;
|
|
9
|
+
memberships: {
|
|
10
|
+
group: {
|
|
11
|
+
handle: string;
|
|
12
|
+
capabilities: Record<string, {
|
|
13
|
+
add?: string[] | undefined;
|
|
14
|
+
remove?: string[] | undefined;
|
|
15
|
+
} | undefined>;
|
|
16
|
+
id: string;
|
|
17
|
+
createdAt: string;
|
|
18
|
+
updatedAt: string;
|
|
19
|
+
avatar?: string | null | undefined;
|
|
20
|
+
header?: string | null | undefined;
|
|
21
|
+
displayName?: string | undefined;
|
|
22
|
+
description?: string | undefined;
|
|
23
|
+
rules?: string | undefined;
|
|
24
|
+
pinnedPostId?: string | undefined;
|
|
25
|
+
discoverable?: boolean | undefined;
|
|
26
|
+
deletedAt?: string | null | undefined;
|
|
27
|
+
};
|
|
28
|
+
roles?: ("none" | "local" | "member" | "admin" | "moderator" | "invited")[] | null | undefined;
|
|
29
|
+
}[] | undefined;
|
|
30
|
+
deletedAt?: string | null | undefined;
|
|
31
|
+
avatar?: string | null | undefined;
|
|
32
|
+
header?: string | null | undefined;
|
|
33
|
+
displayName?: string | undefined;
|
|
34
|
+
bio?: string | undefined;
|
|
35
|
+
location?: {
|
|
36
|
+
text: string;
|
|
37
|
+
coordinates?: {
|
|
38
|
+
lat: number;
|
|
39
|
+
lng: number;
|
|
40
|
+
alt?: number | undefined;
|
|
41
|
+
} | undefined;
|
|
42
|
+
} | undefined;
|
|
43
|
+
locked?: boolean | undefined;
|
|
44
|
+
bot?: boolean | undefined;
|
|
45
|
+
discoverable?: boolean | undefined;
|
|
46
|
+
fields?: {
|
|
47
|
+
name: string;
|
|
48
|
+
value: string;
|
|
49
|
+
}[] | undefined;
|
|
50
|
+
profileStats?: {
|
|
51
|
+
followersCount: number;
|
|
52
|
+
followingCount: number;
|
|
53
|
+
} | undefined;
|
|
54
|
+
}, to: {
|
|
55
|
+
handle: string;
|
|
56
|
+
capabilities: Record<string, {
|
|
57
|
+
add?: string[] | undefined;
|
|
58
|
+
remove?: string[] | undefined;
|
|
59
|
+
} | undefined>;
|
|
60
|
+
membersCount: number;
|
|
61
|
+
id: string;
|
|
62
|
+
createdAt: string;
|
|
63
|
+
updatedAt: string;
|
|
64
|
+
avatar?: string | null | undefined;
|
|
65
|
+
header?: string | null | undefined;
|
|
66
|
+
displayName?: string | undefined;
|
|
67
|
+
description?: string | undefined;
|
|
68
|
+
rules?: string | undefined;
|
|
69
|
+
pinnedPostId?: string | undefined;
|
|
70
|
+
discoverable?: boolean | undefined;
|
|
71
|
+
lastPostAt?: string | null | undefined;
|
|
72
|
+
deletedAt?: string | null | undefined;
|
|
73
|
+
}, data?: {
|
|
74
|
+
roles?: ("member" | "moderator" | "admin" | "local" | "none" | "invited")[] | null | undefined;
|
|
75
|
+
} & {
|
|
76
|
+
id?: string;
|
|
77
|
+
}) => Promise<import("../db/pg/map").WithId<{
|
|
78
|
+
roles?: ("member" | "moderator" | "admin" | "local" | "none" | "invited")[] | null | undefined;
|
|
79
|
+
} & {
|
|
80
|
+
_from: string;
|
|
81
|
+
_to: string;
|
|
82
|
+
}>>;
|
|
83
|
+
export declare const removeMember: (db: import("../db").PgDb, from: {
|
|
84
|
+
id: string;
|
|
85
|
+
type: "guest" | "local" | "federated";
|
|
86
|
+
createdAt: string;
|
|
87
|
+
updatedAt: string;
|
|
88
|
+
handle: string;
|
|
89
|
+
memberships: {
|
|
90
|
+
group: {
|
|
91
|
+
handle: string;
|
|
92
|
+
capabilities: Record<string, {
|
|
93
|
+
add?: string[] | undefined;
|
|
94
|
+
remove?: string[] | undefined;
|
|
95
|
+
} | undefined>;
|
|
96
|
+
id: string;
|
|
97
|
+
createdAt: string;
|
|
98
|
+
updatedAt: string;
|
|
99
|
+
avatar?: string | null | undefined;
|
|
100
|
+
header?: string | null | undefined;
|
|
101
|
+
displayName?: string | undefined;
|
|
102
|
+
description?: string | undefined;
|
|
103
|
+
rules?: string | undefined;
|
|
104
|
+
pinnedPostId?: string | undefined;
|
|
105
|
+
discoverable?: boolean | undefined;
|
|
106
|
+
deletedAt?: string | null | undefined;
|
|
107
|
+
};
|
|
108
|
+
roles?: ("none" | "local" | "member" | "admin" | "moderator" | "invited")[] | null | undefined;
|
|
109
|
+
}[] | undefined;
|
|
110
|
+
deletedAt?: string | null | undefined;
|
|
111
|
+
avatar?: string | null | undefined;
|
|
112
|
+
header?: string | null | undefined;
|
|
113
|
+
displayName?: string | undefined;
|
|
114
|
+
bio?: string | undefined;
|
|
115
|
+
location?: {
|
|
116
|
+
text: string;
|
|
117
|
+
coordinates?: {
|
|
118
|
+
lat: number;
|
|
119
|
+
lng: number;
|
|
120
|
+
alt?: number | undefined;
|
|
121
|
+
} | undefined;
|
|
122
|
+
} | undefined;
|
|
123
|
+
locked?: boolean | undefined;
|
|
124
|
+
bot?: boolean | undefined;
|
|
125
|
+
discoverable?: boolean | undefined;
|
|
126
|
+
fields?: {
|
|
127
|
+
name: string;
|
|
128
|
+
value: string;
|
|
129
|
+
}[] | undefined;
|
|
130
|
+
profileStats?: {
|
|
131
|
+
followersCount: number;
|
|
132
|
+
followingCount: number;
|
|
133
|
+
} | undefined;
|
|
134
|
+
}, to: {
|
|
135
|
+
handle: string;
|
|
136
|
+
capabilities: Record<string, {
|
|
137
|
+
add?: string[] | undefined;
|
|
138
|
+
remove?: string[] | undefined;
|
|
139
|
+
} | undefined>;
|
|
140
|
+
membersCount: number;
|
|
141
|
+
id: string;
|
|
142
|
+
createdAt: string;
|
|
143
|
+
updatedAt: string;
|
|
144
|
+
avatar?: string | null | undefined;
|
|
145
|
+
header?: string | null | undefined;
|
|
146
|
+
displayName?: string | undefined;
|
|
147
|
+
description?: string | undefined;
|
|
148
|
+
rules?: string | undefined;
|
|
149
|
+
pinnedPostId?: string | undefined;
|
|
150
|
+
discoverable?: boolean | undefined;
|
|
151
|
+
lastPostAt?: string | null | undefined;
|
|
152
|
+
deletedAt?: string | null | undefined;
|
|
153
|
+
}) => Promise<void>;
|
|
154
|
+
export declare const updateMember: (db: import("../db").PgDb, from: {
|
|
155
|
+
id: string;
|
|
156
|
+
type: "guest" | "local" | "federated";
|
|
157
|
+
createdAt: string;
|
|
158
|
+
updatedAt: string;
|
|
159
|
+
handle: string;
|
|
160
|
+
memberships: {
|
|
161
|
+
group: {
|
|
162
|
+
handle: string;
|
|
163
|
+
capabilities: Record<string, {
|
|
164
|
+
add?: string[] | undefined;
|
|
165
|
+
remove?: string[] | undefined;
|
|
166
|
+
} | undefined>;
|
|
167
|
+
id: string;
|
|
168
|
+
createdAt: string;
|
|
169
|
+
updatedAt: string;
|
|
170
|
+
avatar?: string | null | undefined;
|
|
171
|
+
header?: string | null | undefined;
|
|
172
|
+
displayName?: string | undefined;
|
|
173
|
+
description?: string | undefined;
|
|
174
|
+
rules?: string | undefined;
|
|
175
|
+
pinnedPostId?: string | undefined;
|
|
176
|
+
discoverable?: boolean | undefined;
|
|
177
|
+
deletedAt?: string | null | undefined;
|
|
178
|
+
};
|
|
179
|
+
roles?: ("none" | "local" | "member" | "admin" | "moderator" | "invited")[] | null | undefined;
|
|
180
|
+
}[] | undefined;
|
|
181
|
+
deletedAt?: string | null | undefined;
|
|
182
|
+
avatar?: string | null | undefined;
|
|
183
|
+
header?: string | null | undefined;
|
|
184
|
+
displayName?: string | undefined;
|
|
185
|
+
bio?: string | undefined;
|
|
186
|
+
location?: {
|
|
187
|
+
text: string;
|
|
188
|
+
coordinates?: {
|
|
189
|
+
lat: number;
|
|
190
|
+
lng: number;
|
|
191
|
+
alt?: number | undefined;
|
|
192
|
+
} | undefined;
|
|
193
|
+
} | undefined;
|
|
194
|
+
locked?: boolean | undefined;
|
|
195
|
+
bot?: boolean | undefined;
|
|
196
|
+
discoverable?: boolean | undefined;
|
|
197
|
+
fields?: {
|
|
198
|
+
name: string;
|
|
199
|
+
value: string;
|
|
200
|
+
}[] | undefined;
|
|
201
|
+
profileStats?: {
|
|
202
|
+
followersCount: number;
|
|
203
|
+
followingCount: number;
|
|
204
|
+
} | undefined;
|
|
205
|
+
}, to: {
|
|
206
|
+
handle: string;
|
|
207
|
+
capabilities: Record<string, {
|
|
208
|
+
add?: string[] | undefined;
|
|
209
|
+
remove?: string[] | undefined;
|
|
210
|
+
} | undefined>;
|
|
211
|
+
membersCount: number;
|
|
212
|
+
id: string;
|
|
213
|
+
createdAt: string;
|
|
214
|
+
updatedAt: string;
|
|
215
|
+
avatar?: string | null | undefined;
|
|
216
|
+
header?: string | null | undefined;
|
|
217
|
+
displayName?: string | undefined;
|
|
218
|
+
description?: string | undefined;
|
|
219
|
+
rules?: string | undefined;
|
|
220
|
+
pinnedPostId?: string | undefined;
|
|
221
|
+
discoverable?: boolean | undefined;
|
|
222
|
+
lastPostAt?: string | null | undefined;
|
|
223
|
+
deletedAt?: string | null | undefined;
|
|
224
|
+
}, data?: {
|
|
225
|
+
roles?: ("member" | "moderator" | "admin" | "local" | "none" | "invited")[] | null | undefined;
|
|
226
|
+
} | undefined) => Promise<void>;
|
|
227
|
+
export declare const canSeeGroupFilter: (profile?: ProfileWithMeta) => PgFilter<GroupWithMeta> | undefined;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { checkRoleCapabilities, isLocal } from '@openpeepshq/common/lib';
|
|
2
|
+
import { connectionUpdater, connector, disconnector } from '../db/helpers.js';
|
|
3
|
+
import { collectionInfos } from '../db/index.js';
|
|
4
|
+
import { groupFilters } from '../db/pg/filters/index.js';
|
|
5
|
+
export const addMember = connector(collectionInfos.profilesCollection, collectionInfos.groupsCollection, collectionInfos.userGroupsCollection);
|
|
6
|
+
export const removeMember = disconnector(collectionInfos.profilesCollection, collectionInfos.groupsCollection, collectionInfos.userGroupsCollection);
|
|
7
|
+
export const updateMember = connectionUpdater(collectionInfos.profilesCollection, collectionInfos.groupsCollection, collectionInfos.userGroupsCollection);
|
|
8
|
+
export const canSeeGroupFilter = (profile) => {
|
|
9
|
+
var _a;
|
|
10
|
+
if (checkRoleCapabilities((_a = profile === null || profile === void 0 ? void 0 : profile.roles) !== null && _a !== void 0 ? _a : [], ['core-groups-read']).success) {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
if (!profile || !isLocal(profile)) {
|
|
14
|
+
return groupFilters.publiclyReadable();
|
|
15
|
+
}
|
|
16
|
+
return groupFilters.readableByLocalProfile(profile.memberships.map((m) => m.group.id));
|
|
17
|
+
};
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
export declare const groupsMapping: import("../db/pg/map").Mapping<{
|
|
2
|
+
handle: string;
|
|
3
|
+
capabilities: Record<string, {
|
|
4
|
+
add?: string[] | undefined;
|
|
5
|
+
remove?: string[] | undefined;
|
|
6
|
+
} | undefined>;
|
|
7
|
+
avatar?: string | null | undefined;
|
|
8
|
+
header?: string | null | undefined;
|
|
9
|
+
displayName?: string | undefined;
|
|
10
|
+
description?: string | undefined;
|
|
11
|
+
rules?: string | undefined;
|
|
12
|
+
pinnedPostId?: string | undefined;
|
|
13
|
+
discoverable?: boolean | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
handle: string;
|
|
16
|
+
capabilities: Record<string, {
|
|
17
|
+
add?: string[] | undefined;
|
|
18
|
+
remove?: string[] | undefined;
|
|
19
|
+
} | undefined>;
|
|
20
|
+
membersCount: number;
|
|
21
|
+
id: string;
|
|
22
|
+
createdAt: string;
|
|
23
|
+
updatedAt: string;
|
|
24
|
+
avatar?: string | null | undefined;
|
|
25
|
+
header?: string | null | undefined;
|
|
26
|
+
displayName?: string | undefined;
|
|
27
|
+
description?: string | undefined;
|
|
28
|
+
rules?: string | undefined;
|
|
29
|
+
pinnedPostId?: string | undefined;
|
|
30
|
+
discoverable?: boolean | undefined;
|
|
31
|
+
lastPostAt?: string | null | undefined;
|
|
32
|
+
deletedAt?: string | null | undefined;
|
|
33
|
+
}, {
|
|
34
|
+
handle: string;
|
|
35
|
+
capabilities: Record<string, {
|
|
36
|
+
add?: string[] | undefined;
|
|
37
|
+
remove?: string[] | undefined;
|
|
38
|
+
} | undefined>;
|
|
39
|
+
membersCount: number;
|
|
40
|
+
id: string;
|
|
41
|
+
createdAt: string;
|
|
42
|
+
updatedAt: string;
|
|
43
|
+
avatar?: string | null | undefined;
|
|
44
|
+
header?: string | null | undefined;
|
|
45
|
+
displayName?: string | undefined;
|
|
46
|
+
description?: string | undefined;
|
|
47
|
+
rules?: string | undefined;
|
|
48
|
+
pinnedPostId?: string | undefined;
|
|
49
|
+
discoverable?: boolean | undefined;
|
|
50
|
+
lastPostAt?: string | null | undefined;
|
|
51
|
+
deletedAt?: string | null | undefined;
|
|
52
|
+
}>;
|
|
53
|
+
export declare const adminGroupsMapping: import("../db/pg/map").Mapping<{
|
|
54
|
+
handle: string;
|
|
55
|
+
capabilities: Record<string, {
|
|
56
|
+
add?: string[] | undefined;
|
|
57
|
+
remove?: string[] | undefined;
|
|
58
|
+
} | undefined>;
|
|
59
|
+
avatar?: string | null | undefined;
|
|
60
|
+
header?: string | null | undefined;
|
|
61
|
+
displayName?: string | undefined;
|
|
62
|
+
description?: string | undefined;
|
|
63
|
+
rules?: string | undefined;
|
|
64
|
+
pinnedPostId?: string | undefined;
|
|
65
|
+
discoverable?: boolean | undefined;
|
|
66
|
+
}, {
|
|
67
|
+
handle: string;
|
|
68
|
+
capabilities: Record<string, {
|
|
69
|
+
add?: string[] | undefined;
|
|
70
|
+
remove?: string[] | undefined;
|
|
71
|
+
} | undefined>;
|
|
72
|
+
membersCount: number;
|
|
73
|
+
id: string;
|
|
74
|
+
createdAt: string;
|
|
75
|
+
updatedAt: string;
|
|
76
|
+
postsCount: number;
|
|
77
|
+
admins: {
|
|
78
|
+
handle: string;
|
|
79
|
+
type: "guest" | "local" | "federated";
|
|
80
|
+
id: string;
|
|
81
|
+
createdAt: string;
|
|
82
|
+
updatedAt: string;
|
|
83
|
+
deletedHandle?: string | undefined;
|
|
84
|
+
avatar?: string | null | undefined;
|
|
85
|
+
header?: string | null | undefined;
|
|
86
|
+
displayName?: string | undefined;
|
|
87
|
+
bio?: string | undefined;
|
|
88
|
+
timeZone?: string | undefined;
|
|
89
|
+
location?: {
|
|
90
|
+
text: string;
|
|
91
|
+
coordinates?: {
|
|
92
|
+
lat: number;
|
|
93
|
+
lng: number;
|
|
94
|
+
alt?: number | undefined;
|
|
95
|
+
} | undefined;
|
|
96
|
+
} | undefined;
|
|
97
|
+
locked?: boolean | undefined;
|
|
98
|
+
bot?: boolean | undefined;
|
|
99
|
+
discoverable?: boolean | undefined;
|
|
100
|
+
hideSocialGraph?: boolean | undefined;
|
|
101
|
+
indexable?: boolean | undefined;
|
|
102
|
+
fields?: {
|
|
103
|
+
name: string;
|
|
104
|
+
value: string;
|
|
105
|
+
}[] | undefined;
|
|
106
|
+
activityPub?: {
|
|
107
|
+
domain: string;
|
|
108
|
+
} | undefined;
|
|
109
|
+
guestData?: {
|
|
110
|
+
email?: string | undefined;
|
|
111
|
+
resource?: {
|
|
112
|
+
type: "profiles" | "groups" | "posts" | "notifications" | "reports" | "db" | "self" | "jams" | "*" | "jam" | "webhooks" | "analytics" | "render";
|
|
113
|
+
id?: string | undefined;
|
|
114
|
+
} | undefined;
|
|
115
|
+
} | undefined;
|
|
116
|
+
deletedAt?: string | null | undefined;
|
|
117
|
+
}[];
|
|
118
|
+
avatar?: string | null | undefined;
|
|
119
|
+
header?: string | null | undefined;
|
|
120
|
+
displayName?: string | undefined;
|
|
121
|
+
description?: string | undefined;
|
|
122
|
+
rules?: string | undefined;
|
|
123
|
+
pinnedPostId?: string | undefined;
|
|
124
|
+
discoverable?: boolean | undefined;
|
|
125
|
+
lastPostAt?: string | null | undefined;
|
|
126
|
+
deletedAt?: string | null | undefined;
|
|
127
|
+
}, {
|
|
128
|
+
handle: string;
|
|
129
|
+
capabilities: Record<string, {
|
|
130
|
+
add?: string[] | undefined;
|
|
131
|
+
remove?: string[] | undefined;
|
|
132
|
+
} | undefined>;
|
|
133
|
+
membersCount: number;
|
|
134
|
+
id: string;
|
|
135
|
+
createdAt: string;
|
|
136
|
+
updatedAt: string;
|
|
137
|
+
postsCount: number;
|
|
138
|
+
admins: {
|
|
139
|
+
handle: string;
|
|
140
|
+
type: "guest" | "local" | "federated";
|
|
141
|
+
id: string;
|
|
142
|
+
createdAt: string;
|
|
143
|
+
updatedAt: string;
|
|
144
|
+
deletedHandle?: string | undefined;
|
|
145
|
+
avatar?: string | null | undefined;
|
|
146
|
+
header?: string | null | undefined;
|
|
147
|
+
displayName?: string | undefined;
|
|
148
|
+
bio?: string | undefined;
|
|
149
|
+
timeZone?: string | undefined;
|
|
150
|
+
location?: {
|
|
151
|
+
text: string;
|
|
152
|
+
coordinates?: {
|
|
153
|
+
lat: number;
|
|
154
|
+
lng: number;
|
|
155
|
+
alt?: number | undefined;
|
|
156
|
+
} | undefined;
|
|
157
|
+
} | undefined;
|
|
158
|
+
locked?: boolean | undefined;
|
|
159
|
+
bot?: boolean | undefined;
|
|
160
|
+
discoverable?: boolean | undefined;
|
|
161
|
+
hideSocialGraph?: boolean | undefined;
|
|
162
|
+
indexable?: boolean | undefined;
|
|
163
|
+
fields?: {
|
|
164
|
+
name: string;
|
|
165
|
+
value: string;
|
|
166
|
+
}[] | undefined;
|
|
167
|
+
activityPub?: {
|
|
168
|
+
domain: string;
|
|
169
|
+
} | undefined;
|
|
170
|
+
guestData?: {
|
|
171
|
+
email?: string | undefined;
|
|
172
|
+
resource?: {
|
|
173
|
+
type: "profiles" | "groups" | "posts" | "notifications" | "reports" | "db" | "self" | "jams" | "*" | "jam" | "webhooks" | "analytics" | "render";
|
|
174
|
+
id?: string | undefined;
|
|
175
|
+
} | undefined;
|
|
176
|
+
} | undefined;
|
|
177
|
+
deletedAt?: string | null | undefined;
|
|
178
|
+
}[];
|
|
179
|
+
avatar?: string | null | undefined;
|
|
180
|
+
header?: string | null | undefined;
|
|
181
|
+
displayName?: string | undefined;
|
|
182
|
+
description?: string | undefined;
|
|
183
|
+
rules?: string | undefined;
|
|
184
|
+
pinnedPostId?: string | undefined;
|
|
185
|
+
discoverable?: boolean | undefined;
|
|
186
|
+
lastPostAt?: string | null | undefined;
|
|
187
|
+
deletedAt?: string | null | undefined;
|
|
188
|
+
}>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { map } from '../db/pg/map/index.js';
|
|
2
|
+
import { computedFields } from '../db/pg/queries/index.js';
|
|
3
|
+
import { edgeFilters } from '../db/pg/filters/index.js';
|
|
4
|
+
const groupRelations = [
|
|
5
|
+
{
|
|
6
|
+
alias: 'membersCount',
|
|
7
|
+
edgeCollection: 'userGroups',
|
|
8
|
+
direction: 'INBOUND',
|
|
9
|
+
skipEdge: true,
|
|
10
|
+
cardinality: 'one',
|
|
11
|
+
count: true,
|
|
12
|
+
mapping: {
|
|
13
|
+
collection: `profiles`,
|
|
14
|
+
softDelete: true,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
const adminGroupComputedFields = [
|
|
19
|
+
computedFields.groupLastPostAt(),
|
|
20
|
+
computedFields.groupPostsCount(),
|
|
21
|
+
];
|
|
22
|
+
export const groupsMapping = map({
|
|
23
|
+
collection: 'groups',
|
|
24
|
+
relations: groupRelations,
|
|
25
|
+
computedFields: [computedFields.groupLastPostAt()],
|
|
26
|
+
softDelete: true,
|
|
27
|
+
});
|
|
28
|
+
export const adminGroupsMapping = map({
|
|
29
|
+
collection: 'groups',
|
|
30
|
+
relations: [
|
|
31
|
+
...groupRelations,
|
|
32
|
+
{
|
|
33
|
+
alias: 'admins',
|
|
34
|
+
edgeCollection: 'userGroups',
|
|
35
|
+
direction: 'INBOUND',
|
|
36
|
+
skipEdge: true,
|
|
37
|
+
cardinality: 'many',
|
|
38
|
+
edgeFilter: edgeFilters.groupAdminRole(),
|
|
39
|
+
mapping: {
|
|
40
|
+
collection: 'profiles',
|
|
41
|
+
softDelete: true,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
computedFields: adminGroupComputedFields,
|
|
46
|
+
softDelete: true,
|
|
47
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { GroupData, GroupRelationship, GroupWithMeta, ProfileWithMeta, PublicProfile } from '@openpeepshq/common/types';
|
|
2
|
+
export declare const addMembersToGroup: (group: GroupWithMeta, members: PublicProfile[]) => Promise<boolean[]>;
|
|
3
|
+
export declare const removeMembersFromGroup: (group: GroupWithMeta, members: PublicProfile[]) => Promise<boolean[]>;
|
|
4
|
+
export declare const createGroup: (groupData: GroupData, profile: ProfileWithMeta, members?: PublicProfile[]) => Promise<GroupWithMeta>;
|
|
5
|
+
export declare const updateGroup: (group: GroupWithMeta, groupData: GroupData) => Promise<{
|
|
6
|
+
handle: string;
|
|
7
|
+
capabilities: Record<string, {
|
|
8
|
+
add?: string[] | undefined;
|
|
9
|
+
remove?: string[] | undefined;
|
|
10
|
+
} | undefined>;
|
|
11
|
+
membersCount: number;
|
|
12
|
+
id: string;
|
|
13
|
+
createdAt: string;
|
|
14
|
+
updatedAt: string;
|
|
15
|
+
avatar?: string | null | undefined;
|
|
16
|
+
header?: string | null | undefined;
|
|
17
|
+
displayName?: string | undefined;
|
|
18
|
+
description?: string | undefined;
|
|
19
|
+
rules?: string | undefined;
|
|
20
|
+
pinnedPostId?: string | undefined;
|
|
21
|
+
discoverable?: boolean | undefined;
|
|
22
|
+
lastPostAt?: string | null | undefined;
|
|
23
|
+
deletedAt?: string | null | undefined;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const deleteGroup: (group: GroupWithMeta) => Promise<void>;
|
|
26
|
+
export declare const setMemberRoles: (profile: PublicProfile, group: GroupWithMeta, roles: GroupRelationship[]) => Promise<void>;
|