@openpeepshq/core 0.1.32 → 0.1.33
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/dist/accessTokens/helpers.d.ts +2 -2
- package/dist/accessTokens/tokens.js +14 -7
- package/dist/accounts/mutations.d.ts +2 -2
- package/dist/analytics/cache.js +12 -7
- package/dist/analytics/pdfReport.d.ts +1 -0
- package/dist/analytics/pdfReport.js +5 -4
- package/dist/analytics/privacy.d.ts +18 -0
- package/dist/analytics/privacy.js +10 -0
- package/dist/analytics/read.js +24 -11
- package/dist/analytics/report.d.ts +1 -1
- package/dist/analytics/report.js +9 -2
- package/dist/backups/index.js +6 -3
- package/dist/backups/metadata.d.ts +7 -0
- package/dist/config/defaults/community.js +0 -6
- package/dist/config/defaults/db.d.ts +0 -2
- package/dist/config/defaults/db.js +0 -2
- package/dist/config/index.d.ts +10 -9
- package/dist/db/helpers.d.ts +6 -28
- package/dist/db/helpers.js +19 -149
- package/dist/db/index.d.ts +2 -0
- package/dist/db/index.js +4 -0
- package/dist/db/init.js +3 -2
- package/dist/db/migration/detect.d.ts +0 -3
- package/dist/db/migration/detect.js +0 -54
- package/dist/db/migration/importCollections.d.ts +1 -1
- package/dist/db/migration/importCollections.js +22 -6
- package/dist/db/migration/shared.d.ts +0 -4
- package/dist/db/migration/shared.js +0 -7
- package/dist/db/migration/transform.d.ts +2 -0
- package/dist/db/migration/transform.js +23 -0
- package/dist/db/pg/client.js +4 -0
- package/dist/db/pg/filters/edges.d.ts +1 -1
- package/dist/db/pg/filters/edges.js +1 -1
- package/dist/db/pg/filters/posts.d.ts +1 -0
- package/dist/db/pg/filters/posts.js +11 -1
- package/dist/db/pg/map/filters.js +5 -0
- package/dist/db/pg/map/relations.d.ts +1 -1
- package/dist/db/pg/map/relations.js +89 -41
- package/dist/db/pg/migrate.d.ts +23 -0
- package/dist/db/pg/migrate.js +87 -1
- package/dist/db/pg/schema/documents.d.ts +143 -0
- package/dist/db/pg/schema/documents.js +22 -1
- package/dist/db/pg/schema/edges.d.ts +1 -0
- package/dist/db/pg/schema/edges.js +2 -1
- package/dist/db/pg/schema/index.d.ts +143 -0
- package/dist/db/pg/sql/0007_shallow_oracle.sql +3 -0
- package/dist/db/pg/sql/0008_group_owner_roles.sql +31 -0
- package/dist/db/pg/sql/0009_event_occurrences.sql +26 -0
- package/dist/db/pg/sql/meta/0007_snapshot.json +4179 -0
- package/dist/db/pg/sql/meta/0009_snapshot.json +4299 -0
- package/dist/db/pg/sql/meta/_journal.json +21 -0
- package/dist/db/replaceOrigin.js +6 -0
- package/dist/db/types.d.ts +0 -4
- package/dist/events/index.d.ts +2 -1
- package/dist/events/index.js +54 -33
- package/dist/groups/finders.d.ts +2 -2
- package/dist/groups/helpers.d.ts +6 -6
- package/dist/groups/mapping.d.ts +4 -4
- package/dist/groups/mapping.js +2 -2
- package/dist/groups/mutations.js +1 -1
- package/dist/inviteLinks/helpers.d.ts +4 -4
- package/dist/jams/cache.d.ts +1 -1
- package/dist/jams/cache.js +2 -1
- package/dist/jams/finders.d.ts +2 -1
- package/dist/jams/finders.js +18 -7
- package/dist/jams/helpers.d.ts +4 -0
- package/dist/jams/index.d.ts +4 -3
- package/dist/jams/index.js +20 -13
- package/dist/jams/livekit.d.ts +46 -8
- package/dist/jams/livekit.js +103 -21
- package/dist/jams/mapping.d.ts +14 -4
- package/dist/jams/mutations.d.ts +2 -0
- package/dist/jams/rtmp.d.ts +5 -0
- package/dist/jams/rtmp.js +8 -0
- package/dist/jams/token.d.ts +3 -3
- package/dist/jams/token.js +15 -12
- package/dist/jams/waitingRoom.d.ts +6 -6
- package/dist/jams/waitingRoom.js +24 -23
- package/dist/migration/index.d.ts +4 -0
- package/dist/migration/index.js +4 -0
- package/dist/notifications/defaultNotifications/groupMemberJoined/index.js +3 -1
- package/dist/notifications/defaultNotifications/groupMemberLeft/index.js +3 -1
- package/dist/notifications/helpers.js +6 -2
- package/dist/notifications/push.js +11 -4
- package/dist/plugins/helpers.d.ts +1 -0
- package/dist/plugins/helpers.js +1 -8
- package/dist/plugins/index.d.ts +5 -0
- package/dist/plugins/index.js +41 -4
- package/dist/plugins/install.d.ts +20 -0
- package/dist/plugins/install.js +223 -0
- package/dist/plugins/state.d.ts +4 -0
- package/dist/plugins/state.js +29 -0
- package/dist/posts/eventAgenda.d.ts +165 -0
- package/dist/posts/eventAgenda.js +120 -0
- package/dist/posts/eventOccurrenceJobs.d.ts +4 -0
- package/dist/posts/eventOccurrenceJobs.js +23 -0
- package/dist/posts/eventOccurrences.d.ts +4 -0
- package/dist/posts/eventOccurrences.js +40 -0
- package/dist/posts/finders.d.ts +32 -8
- package/dist/posts/finders.js +27 -45
- package/dist/posts/helpers/filters.js +1 -1
- package/dist/posts/helpers/index.d.ts +102 -16
- package/dist/posts/helpers/index.js +33 -20
- package/dist/posts/index.d.ts +3 -0
- package/dist/posts/index.js +3 -0
- package/dist/posts/mapping.d.ts +275 -0
- package/dist/posts/mapping.js +37 -3
- package/dist/posts/mutations.d.ts +1 -1
- package/dist/posts/mutations.js +29 -18
- package/dist/posts/rsvpConfirmationEmail.js +2 -1
- package/dist/posts/unseenCounts.d.ts +2 -0
- package/dist/posts/unseenCounts.js +25 -8
- package/dist/profiles/cache.d.ts +3 -1
- package/dist/profiles/cache.js +9 -1
- package/dist/profiles/helpers.d.ts +5 -5
- package/dist/profiles/index.d.ts +1 -1
- package/dist/profiles/index.js +1 -1
- package/dist/profiles/mapping.d.ts +5 -5
- package/dist/profiles/mutations.js +12 -14
- package/dist/pushSubscriptions/helpers.d.ts +2 -2
- package/dist/pushSubscriptions/mutations.js +13 -1
- package/dist/reports/helpers.d.ts +6 -6
- package/dist/roles/defaults.js +1 -0
- package/dist/server/index.d.ts +7 -7
- package/dist/server/index.js +15 -8
- package/dist/stats/finders.d.ts +1692 -142
- package/dist/stats/mapping.d.ts +21 -0
- package/package.json +4 -9
- package/dist/db/arango.d.ts +0 -2
- package/dist/db/arango.js +0 -110
- package/dist/db/migration/autoMigrate.d.ts +0 -2
- package/dist/db/migration/autoMigrate.js +0 -111
- package/dist/db/migration/cli.d.ts +0 -1
- package/dist/db/migration/cli.js +0 -56
- package/dist/db/migration/exportArango.d.ts +0 -4
- package/dist/db/migration/exportArango.js +0 -80
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
-- Rename group membership role admin → owner and split a true admin cap set.
|
|
2
|
+
UPDATE "user_groups"
|
|
3
|
+
SET "body" = jsonb_set(
|
|
4
|
+
COALESCE("body", '{}'::jsonb),
|
|
5
|
+
'{roles}',
|
|
6
|
+
(
|
|
7
|
+
SELECT COALESCE(jsonb_agg(to_jsonb(role)), '[]'::jsonb)
|
|
8
|
+
FROM (
|
|
9
|
+
SELECT DISTINCT CASE WHEN elem = 'admin' THEN 'owner' ELSE elem END AS role
|
|
10
|
+
FROM jsonb_array_elements_text(COALESCE("body"->'roles', '[]'::jsonb)) AS elem
|
|
11
|
+
) renamed
|
|
12
|
+
)
|
|
13
|
+
)
|
|
14
|
+
WHERE COALESCE("body"->'roles', '[]'::jsonb) ? 'admin';
|
|
15
|
+
--> statement-breakpoint
|
|
16
|
+
UPDATE "groups"
|
|
17
|
+
SET "body" = jsonb_set(
|
|
18
|
+
"body" #- '{capabilities,admin}',
|
|
19
|
+
'{capabilities,owner}',
|
|
20
|
+
COALESCE("body"->'capabilities'->'admin', '{"add":["core-posts-*","core-groups-*"]}'::jsonb)
|
|
21
|
+
)
|
|
22
|
+
WHERE ("body"->'capabilities') ? 'admin'
|
|
23
|
+
AND NOT (("body"->'capabilities') ? 'owner');
|
|
24
|
+
--> statement-breakpoint
|
|
25
|
+
UPDATE "groups"
|
|
26
|
+
SET "body" = jsonb_set(
|
|
27
|
+
COALESCE("body", '{}'::jsonb),
|
|
28
|
+
'{capabilities,admin}',
|
|
29
|
+
'{"add":["core-posts-*","core-groups-read","core-groups-update","core-groups-join","core-groups-leave","core-groups-addMember","core-groups-removeMember","core-groups-changeMemberRole"]}'::jsonb
|
|
30
|
+
)
|
|
31
|
+
WHERE NOT (COALESCE("body"->'capabilities', '{}'::jsonb) ? 'admin');
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
CREATE TABLE IF NOT EXISTS "event_occurrences" (
|
|
2
|
+
"id" uuid PRIMARY KEY NOT NULL,
|
|
3
|
+
"post_id" uuid NOT NULL,
|
|
4
|
+
"recurrence_id" timestamp with time zone NOT NULL,
|
|
5
|
+
"start" timestamp with time zone NOT NULL,
|
|
6
|
+
"end" timestamp with time zone,
|
|
7
|
+
"cancelled" boolean DEFAULT false NOT NULL,
|
|
8
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
9
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
10
|
+
);
|
|
11
|
+
--> statement-breakpoint
|
|
12
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "event_occurrences_post_recurrence" ON "event_occurrences" USING btree ("post_id","recurrence_id");--> statement-breakpoint
|
|
13
|
+
CREATE INDEX IF NOT EXISTS "event_occurrences_start_idx" ON "event_occurrences" USING btree ("start");--> statement-breakpoint
|
|
14
|
+
CREATE INDEX IF NOT EXISTS "event_occurrences_post_idx" ON "event_occurrences" USING btree ("post_id");
|
|
15
|
+
--> statement-breakpoint
|
|
16
|
+
INSERT INTO "event_occurrences" ("id", "post_id", "recurrence_id", "start", "end", "cancelled")
|
|
17
|
+
SELECT gen_random_uuid(), "id",
|
|
18
|
+
(body->>'start')::timestamptz,
|
|
19
|
+
(body->>'start')::timestamptz,
|
|
20
|
+
NULLIF(body->>'end', '')::timestamptz,
|
|
21
|
+
false
|
|
22
|
+
FROM "posts"
|
|
23
|
+
WHERE "type" = 'event'
|
|
24
|
+
AND "deleted_at" IS NULL
|
|
25
|
+
AND body->>'start' IS NOT NULL
|
|
26
|
+
ON CONFLICT ("post_id", "recurrence_id") DO NOTHING;
|