@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,181 @@
|
|
|
1
|
+
import { addDays, addMonths, addWeeks, addYears, differenceInCalendarDays, endOfMonth, endOfYear, format, formatISO, getISOWeek, parseISO, startOfDay, startOfMonth, startOfWeek, startOfYear, subDays, subMonths, subYears, } from 'date-fns';
|
|
2
|
+
const dayString = (d) => formatISO(startOfDay(d), { representation: 'date' });
|
|
3
|
+
const presetBounds = (preset, now) => {
|
|
4
|
+
const to = startOfDay(now);
|
|
5
|
+
switch (preset) {
|
|
6
|
+
case '7d':
|
|
7
|
+
return { from: subDays(to, 6), to };
|
|
8
|
+
case '30d':
|
|
9
|
+
return { from: subDays(to, 29), to };
|
|
10
|
+
case '3m':
|
|
11
|
+
return { from: subMonths(to, 3), to };
|
|
12
|
+
case '6m':
|
|
13
|
+
return { from: subMonths(to, 6), to };
|
|
14
|
+
case '12m':
|
|
15
|
+
return { from: subYears(to, 1), to };
|
|
16
|
+
case 'all':
|
|
17
|
+
return { from: new Date('1970-01-01T00:00:00.000Z'), to };
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
export const resolveAnalyticsRange = (query = {}, now = new Date()) => {
|
|
21
|
+
var _a;
|
|
22
|
+
const preset = (_a = query.preset) !== null && _a !== void 0 ? _a : (!query.from && !query.to ? '30d' : undefined);
|
|
23
|
+
let fromDate;
|
|
24
|
+
let toDate;
|
|
25
|
+
if (query.from && query.to) {
|
|
26
|
+
fromDate = startOfDay(parseISO(query.from));
|
|
27
|
+
toDate = startOfDay(parseISO(query.to));
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
const bounds = presetBounds(preset !== null && preset !== void 0 ? preset : '30d', now);
|
|
31
|
+
fromDate = bounds.from;
|
|
32
|
+
toDate = bounds.to;
|
|
33
|
+
}
|
|
34
|
+
if (fromDate > toDate) {
|
|
35
|
+
const tmp = fromDate;
|
|
36
|
+
fromDate = toDate;
|
|
37
|
+
toDate = tmp;
|
|
38
|
+
}
|
|
39
|
+
const lengthDays = Math.max(1, differenceInCalendarDays(toDate, fromDate) + 1);
|
|
40
|
+
const previousToDate = subDays(fromDate, 1);
|
|
41
|
+
const previousFromDate = subDays(previousToDate, lengthDays - 1);
|
|
42
|
+
return {
|
|
43
|
+
from: dayString(fromDate),
|
|
44
|
+
to: dayString(toDate),
|
|
45
|
+
previousFrom: dayString(previousFromDate),
|
|
46
|
+
previousTo: dayString(previousToDate),
|
|
47
|
+
preset,
|
|
48
|
+
compiledAt: null,
|
|
49
|
+
fromDate,
|
|
50
|
+
toDate,
|
|
51
|
+
previousFromDate,
|
|
52
|
+
previousToDate,
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
export const eachUtcDay = (from, to) => {
|
|
56
|
+
const days = [];
|
|
57
|
+
let cursor = startOfDay(parseISO(from));
|
|
58
|
+
const end = startOfDay(parseISO(to));
|
|
59
|
+
while (cursor <= end) {
|
|
60
|
+
days.push(dayString(cursor));
|
|
61
|
+
cursor = subDays(cursor, -1);
|
|
62
|
+
}
|
|
63
|
+
return days;
|
|
64
|
+
};
|
|
65
|
+
const weekStart = (d) => startOfWeek(d, { weekStartsOn: 1 });
|
|
66
|
+
/** Map inclusive day count → chart grain. */
|
|
67
|
+
export const unitForDayCount = (dayCount) => {
|
|
68
|
+
if (dayCount <= 14)
|
|
69
|
+
return 'day';
|
|
70
|
+
if (dayCount <= 90)
|
|
71
|
+
return 'week';
|
|
72
|
+
if (dayCount <= 800)
|
|
73
|
+
return 'month';
|
|
74
|
+
return 'year';
|
|
75
|
+
};
|
|
76
|
+
const labelForUnit = (unit, start, dayCount) => {
|
|
77
|
+
if (unit === 'day') {
|
|
78
|
+
return dayCount <= 7
|
|
79
|
+
? format(start, 'EEE').toUpperCase()
|
|
80
|
+
: format(start, 'MMM d');
|
|
81
|
+
}
|
|
82
|
+
if (unit === 'week')
|
|
83
|
+
return `W${getISOWeek(start)}`;
|
|
84
|
+
if (unit === 'month')
|
|
85
|
+
return format(start, 'MMM').toUpperCase();
|
|
86
|
+
return format(start, 'yyyy');
|
|
87
|
+
};
|
|
88
|
+
const buildBuckets = (unit, fromDate, toDate) => {
|
|
89
|
+
const dayCount = differenceInCalendarDays(toDate, fromDate) + 1;
|
|
90
|
+
const buckets = [];
|
|
91
|
+
if (unit === 'day') {
|
|
92
|
+
let cursor = fromDate;
|
|
93
|
+
while (cursor <= toDate) {
|
|
94
|
+
const key = dayString(cursor);
|
|
95
|
+
buckets.push({
|
|
96
|
+
key,
|
|
97
|
+
label: labelForUnit('day', cursor, dayCount),
|
|
98
|
+
from: key,
|
|
99
|
+
to: key,
|
|
100
|
+
});
|
|
101
|
+
cursor = addDays(cursor, 1);
|
|
102
|
+
}
|
|
103
|
+
return buckets;
|
|
104
|
+
}
|
|
105
|
+
if (unit === 'week') {
|
|
106
|
+
let cursor = weekStart(fromDate);
|
|
107
|
+
while (cursor <= toDate) {
|
|
108
|
+
const bucketFrom = cursor < fromDate ? fromDate : cursor;
|
|
109
|
+
const weekEnd = addDays(cursor, 6);
|
|
110
|
+
const bucketTo = weekEnd > toDate ? toDate : weekEnd;
|
|
111
|
+
if (bucketFrom <= toDate) {
|
|
112
|
+
buckets.push({
|
|
113
|
+
key: dayString(cursor),
|
|
114
|
+
// Label from week start so partial weeks still show the ISO week.
|
|
115
|
+
label: labelForUnit('week', cursor, dayCount),
|
|
116
|
+
from: dayString(bucketFrom),
|
|
117
|
+
to: dayString(bucketTo),
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
cursor = addWeeks(cursor, 1);
|
|
121
|
+
}
|
|
122
|
+
return buckets;
|
|
123
|
+
}
|
|
124
|
+
if (unit === 'month') {
|
|
125
|
+
let cursor = startOfMonth(fromDate);
|
|
126
|
+
while (cursor <= toDate) {
|
|
127
|
+
const monthEnd = endOfMonth(cursor);
|
|
128
|
+
const bucketFrom = cursor < fromDate ? fromDate : cursor;
|
|
129
|
+
const bucketTo = monthEnd > toDate ? toDate : monthEnd;
|
|
130
|
+
buckets.push({
|
|
131
|
+
key: dayString(startOfMonth(cursor)),
|
|
132
|
+
label: labelForUnit('month', cursor, dayCount),
|
|
133
|
+
from: dayString(bucketFrom),
|
|
134
|
+
to: dayString(bucketTo),
|
|
135
|
+
});
|
|
136
|
+
cursor = addMonths(cursor, 1);
|
|
137
|
+
}
|
|
138
|
+
return buckets;
|
|
139
|
+
}
|
|
140
|
+
let cursor = startOfYear(fromDate);
|
|
141
|
+
while (cursor <= toDate) {
|
|
142
|
+
const yearEnd = endOfYear(cursor);
|
|
143
|
+
const bucketFrom = cursor < fromDate ? fromDate : cursor;
|
|
144
|
+
const bucketTo = yearEnd > toDate ? toDate : yearEnd;
|
|
145
|
+
buckets.push({
|
|
146
|
+
key: dayString(startOfYear(cursor)),
|
|
147
|
+
label: labelForUnit('year', cursor, dayCount),
|
|
148
|
+
from: dayString(bucketFrom),
|
|
149
|
+
to: dayString(bucketTo),
|
|
150
|
+
});
|
|
151
|
+
cursor = addYears(cursor, 1);
|
|
152
|
+
}
|
|
153
|
+
return buckets;
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Choose day / week / month / year buckets from the range length:
|
|
157
|
+
* 1–14d → days, 15–90d → weeks, 91–800d → months, >800d → years.
|
|
158
|
+
*/
|
|
159
|
+
export const selectChartBuckets = (from, to) => {
|
|
160
|
+
const fromDate = startOfDay(parseISO(from));
|
|
161
|
+
const toDate = startOfDay(parseISO(to));
|
|
162
|
+
const dayCount = differenceInCalendarDays(toDate, fromDate) + 1;
|
|
163
|
+
const unit = unitForDayCount(dayCount);
|
|
164
|
+
return { unit, buckets: buildBuckets(unit, fromDate, toDate) };
|
|
165
|
+
};
|
|
166
|
+
export const aggregateSeriesIntoBuckets = (series, buckets) => {
|
|
167
|
+
const byDay = new Map(series.map((p) => [p.day, p.value]));
|
|
168
|
+
return buckets.map((bucket) => {
|
|
169
|
+
var _a;
|
|
170
|
+
let value = 0;
|
|
171
|
+
for (const day of eachUtcDay(bucket.from, bucket.to)) {
|
|
172
|
+
value += (_a = byDay.get(day)) !== null && _a !== void 0 ? _a : 0;
|
|
173
|
+
}
|
|
174
|
+
return { day: bucket.key, label: bucket.label, value };
|
|
175
|
+
});
|
|
176
|
+
};
|
|
177
|
+
/** @internal exposed for tests */
|
|
178
|
+
export const _chartBucketInternals = {
|
|
179
|
+
buildBuckets,
|
|
180
|
+
unitForDayCount,
|
|
181
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { resolveAnalyticsRange, eachUtcDay, type ResolvedAnalyticsRange, } from './dateRange';
|
|
2
|
+
export { analyticsCacheKey, getAnalyticsCache, setAnalyticsCache, invalidateAnalyticsCache, } from './cache';
|
|
3
|
+
export { compileAnalyticsDay, compileRetentionCohorts, compileRecentAnalytics, backfillAnalytics, } from './compile';
|
|
4
|
+
export { getAnalyticsOverview, getAnalyticsGrowth, getAnalyticsEngagement, getAnalyticsRetention, exportAnalyticsCsv, } from './read';
|
|
5
|
+
export { getAnalyticsReportSettings, setAnalyticsReportSettings, } from './settings';
|
|
6
|
+
export { sendMonthlyAnalyticsReport, buildSimplePdf, buildAnalyticsBoardReport, } from './report';
|
|
7
|
+
export { buildAnalyticsPdf, type AnalyticsPdfData } from './pdfReport';
|
|
8
|
+
export { analyticsCompileQueue, analyticsCompileWorker, ensureAnalyticsSchedules, enqueueAnalyticsBackfill, type AnalyticsJobData, type AnalyticsBackfillEnqueueResult, } from './jobs';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { resolveAnalyticsRange, eachUtcDay, } from './dateRange.js';
|
|
2
|
+
export { analyticsCacheKey, getAnalyticsCache, setAnalyticsCache, invalidateAnalyticsCache, } from './cache.js';
|
|
3
|
+
export { compileAnalyticsDay, compileRetentionCohorts, compileRecentAnalytics, backfillAnalytics, } from './compile.js';
|
|
4
|
+
export { getAnalyticsOverview, getAnalyticsGrowth, getAnalyticsEngagement, getAnalyticsRetention, exportAnalyticsCsv, } from './read.js';
|
|
5
|
+
export { getAnalyticsReportSettings, setAnalyticsReportSettings, } from './settings.js';
|
|
6
|
+
export { sendMonthlyAnalyticsReport, buildSimplePdf, buildAnalyticsBoardReport, } from './report.js';
|
|
7
|
+
export { buildAnalyticsPdf } from './pdfReport.js';
|
|
8
|
+
export { analyticsCompileQueue, analyticsCompileWorker, ensureAnalyticsSchedules, enqueueAnalyticsBackfill, } from './jobs.js';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type AnalyticsJobData = {
|
|
2
|
+
type: 'compile-day';
|
|
3
|
+
} | {
|
|
4
|
+
type: 'compile-retention';
|
|
5
|
+
} | {
|
|
6
|
+
type: 'monthly-report';
|
|
7
|
+
} | {
|
|
8
|
+
type: 'backfill';
|
|
9
|
+
from: string;
|
|
10
|
+
to: string;
|
|
11
|
+
};
|
|
12
|
+
export type AnalyticsBackfillEnqueueResult = {
|
|
13
|
+
jobId: string | undefined;
|
|
14
|
+
from: string;
|
|
15
|
+
to: string;
|
|
16
|
+
};
|
|
17
|
+
declare const analyticsCompileQueue: () => import("bullmq").Queue, analyticsCompileWorker: () => import("bullmq").Worker;
|
|
18
|
+
export declare const ensureAnalyticsSchedules: () => Promise<void>;
|
|
19
|
+
export declare const enqueueAnalyticsBackfill: (from?: string, to?: string) => Promise<AnalyticsBackfillEnqueueResult>;
|
|
20
|
+
export { analyticsCompileQueue, analyticsCompileWorker };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { formatISO, startOfDay, subDays } from 'date-fns';
|
|
2
|
+
import { sql } from 'drizzle-orm';
|
|
3
|
+
import { database } from '../db/index.js';
|
|
4
|
+
import { queueAndWorker } from '../jobs/index.js';
|
|
5
|
+
import { logger } from '../log/index.js';
|
|
6
|
+
import { backfillAnalytics, compileRecentAnalytics, compileRetentionCohorts, } from './compile.js';
|
|
7
|
+
import { sendMonthlyAnalyticsReport } from './report.js';
|
|
8
|
+
const log = logger('app:analytics:jobs');
|
|
9
|
+
const ANALYTICS_QUEUE = 'analytics-compile';
|
|
10
|
+
const COMPILE_CRON = '0 * * * *';
|
|
11
|
+
const RETENTION_CRON = '30 3 * * *';
|
|
12
|
+
const MONTHLY_REPORT_CRON = '0 8 1 * *';
|
|
13
|
+
const INITIAL_BACKFILL_JOB_ID = 'analytics-initial-backfill';
|
|
14
|
+
const defaultBackfillRange = () => {
|
|
15
|
+
const to = formatISO(startOfDay(new Date()), { representation: 'date' });
|
|
16
|
+
const from = formatISO(startOfDay(subDays(new Date(), 365)), {
|
|
17
|
+
representation: 'date',
|
|
18
|
+
});
|
|
19
|
+
return { from, to };
|
|
20
|
+
};
|
|
21
|
+
const [analyticsCompileQueue, analyticsCompileWorker] = queueAndWorker(ANALYTICS_QUEUE, async (job) => {
|
|
22
|
+
const data = job.data;
|
|
23
|
+
switch (data.type) {
|
|
24
|
+
case 'compile-day':
|
|
25
|
+
await compileRecentAnalytics();
|
|
26
|
+
return { ok: true };
|
|
27
|
+
case 'compile-retention':
|
|
28
|
+
await compileRetentionCohorts();
|
|
29
|
+
return { ok: true };
|
|
30
|
+
case 'monthly-report':
|
|
31
|
+
return sendMonthlyAnalyticsReport();
|
|
32
|
+
case 'backfill': {
|
|
33
|
+
const count = await backfillAnalytics(data.from, data.to);
|
|
34
|
+
return { days: count };
|
|
35
|
+
}
|
|
36
|
+
default:
|
|
37
|
+
log.warn(`Unknown analytics job: ${JSON.stringify(data)}`);
|
|
38
|
+
return { ok: false };
|
|
39
|
+
}
|
|
40
|
+
}, {
|
|
41
|
+
defaultJobOptions: {
|
|
42
|
+
removeOnComplete: { count: 20 },
|
|
43
|
+
removeOnFail: { age: 86400 * 14, count: 50 },
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
const maybeEnqueueInitialBackfill = async () => {
|
|
47
|
+
var _a;
|
|
48
|
+
const db = await database();
|
|
49
|
+
const result = await db.execute(sql `select exists(select 1 from analytics_daily_totals limit 1) as has_rows`);
|
|
50
|
+
const rows = result.rows;
|
|
51
|
+
if ((_a = rows[0]) === null || _a === void 0 ? void 0 : _a.has_rows)
|
|
52
|
+
return;
|
|
53
|
+
const queue = analyticsCompileQueue();
|
|
54
|
+
const existing = await queue.getJob(INITIAL_BACKFILL_JOB_ID);
|
|
55
|
+
if (existing) {
|
|
56
|
+
const state = await existing.getState();
|
|
57
|
+
if (state !== 'failed')
|
|
58
|
+
return;
|
|
59
|
+
await existing.remove();
|
|
60
|
+
}
|
|
61
|
+
const { from, to } = defaultBackfillRange();
|
|
62
|
+
await queue.add('backfill', { type: 'backfill', from, to }, { jobId: INITIAL_BACKFILL_JOB_ID });
|
|
63
|
+
log.info(`Enqueued initial analytics backfill ${from}..${to}`);
|
|
64
|
+
};
|
|
65
|
+
export const ensureAnalyticsSchedules = async () => {
|
|
66
|
+
const queue = analyticsCompileQueue();
|
|
67
|
+
await queue.upsertJobScheduler('analytics-compile-hourly', { pattern: COMPILE_CRON }, { name: 'compile-day', data: { type: 'compile-day' } });
|
|
68
|
+
await queue.upsertJobScheduler('analytics-retention-daily', { pattern: RETENTION_CRON }, { name: 'compile-retention', data: { type: 'compile-retention' } });
|
|
69
|
+
await queue.upsertJobScheduler('analytics-monthly-report', { pattern: MONTHLY_REPORT_CRON }, { name: 'monthly-report', data: { type: 'monthly-report' } });
|
|
70
|
+
await maybeEnqueueInitialBackfill();
|
|
71
|
+
log.info(`Analytics schedules registered: compile="${COMPILE_CRON}", retention="${RETENTION_CRON}", monthly="${MONTHLY_REPORT_CRON}"`);
|
|
72
|
+
};
|
|
73
|
+
export const enqueueAnalyticsBackfill = async (from, to) => {
|
|
74
|
+
const defaults = defaultBackfillRange();
|
|
75
|
+
const start = from !== null && from !== void 0 ? from : defaults.from;
|
|
76
|
+
const end = to !== null && to !== void 0 ? to : defaults.to;
|
|
77
|
+
const job = await analyticsCompileQueue().add('backfill', {
|
|
78
|
+
type: 'backfill',
|
|
79
|
+
from: start,
|
|
80
|
+
to: end,
|
|
81
|
+
});
|
|
82
|
+
return { jobId: job.id, from: start, to: end };
|
|
83
|
+
};
|
|
84
|
+
export { analyticsCompileQueue, analyticsCompileWorker };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AnalyticsMetricCard, AnalyticsSeriesPoint } from '@openpeepshq/common/types';
|
|
2
|
+
export declare const deltaPct: (current: number, previous: number) => number | null;
|
|
3
|
+
export declare const metricCard: (key: string, value: number, previousValue: number, series?: AnalyticsSeriesPoint[]) => AnalyticsMetricCard;
|
|
4
|
+
export declare const sumSeries: (series: AnalyticsSeriesPoint[]) => number;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const deltaPct = (current, previous) => {
|
|
2
|
+
if (previous === 0)
|
|
3
|
+
return current === 0 ? 0 : null;
|
|
4
|
+
return Math.round(((current - previous) / previous) * 1000) / 10;
|
|
5
|
+
};
|
|
6
|
+
export const metricCard = (key, value, previousValue, series) => ({
|
|
7
|
+
key,
|
|
8
|
+
value,
|
|
9
|
+
previousValue,
|
|
10
|
+
deltaPct: deltaPct(value, previousValue),
|
|
11
|
+
series,
|
|
12
|
+
});
|
|
13
|
+
export const sumSeries = (series) => series.reduce((acc, p) => acc + p.value, 0);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AnalyticsEngagement, AnalyticsGrowth, AnalyticsOverview } from '@openpeepshq/common/types';
|
|
2
|
+
export type AnalyticsPdfData = {
|
|
3
|
+
overview: AnalyticsOverview;
|
|
4
|
+
growth: AnalyticsGrowth;
|
|
5
|
+
engagement: AnalyticsEngagement;
|
|
6
|
+
};
|
|
7
|
+
/** Multi-page visual PDF mirroring the analytics tabs. */
|
|
8
|
+
export declare const buildAnalyticsPdf: (data: AnalyticsPdfData) => Promise<Buffer>;
|