@anthusai/papyrus 5.43.0-next.45 → 5.43.0-next.46
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/amplify/data/resource.js
CHANGED
|
@@ -1670,6 +1670,9 @@ const schema = a.schema({
|
|
|
1670
1670
|
authorSub: a.string(),
|
|
1671
1671
|
authorUserProfileId: a.id(),
|
|
1672
1672
|
authorLabel: a.string(),
|
|
1673
|
+
editedAt: a.datetime(),
|
|
1674
|
+
deletedAt: a.datetime(),
|
|
1675
|
+
deletedBySub: a.string(),
|
|
1673
1676
|
threadId: a.id(),
|
|
1674
1677
|
parentMessageId: a.id(),
|
|
1675
1678
|
sequenceNumber: a.integer(),
|
|
@@ -1704,8 +1707,12 @@ const schema = a.schema({
|
|
|
1704
1707
|
index("searchVisibility").sortKeys(["createdAt"]).name("messagesBySearchVisibilityCreatedAt").queryField("listMessagesBySearchVisibilityAndCreatedAt"),
|
|
1705
1708
|
])
|
|
1706
1709
|
.authorization((allow) => [
|
|
1707
|
-
|
|
1710
|
+
// One rule per group (a group may appear once per model): editors read and add; admins also delete, for moderation.
|
|
1711
|
+
allow.group("editor").to(categoryAppendOnlyOperations),
|
|
1712
|
+
allow.group(adminGroup).to(["read", "create", "delete"]),
|
|
1708
1713
|
allow.authenticated("identityPool").to(["read", "create", "update"]),
|
|
1714
|
+
// Messages belong to their author: the author edits (and soft-deletes) their own, and only an admin can remove someone else's.
|
|
1715
|
+
allow.ownerDefinedIn("authorSub").identityClaim("sub").to(["read", "update", "delete"]),
|
|
1709
1716
|
]),
|
|
1710
1717
|
MessageThread: a
|
|
1711
1718
|
.model({
|
package/amplify/data/resource.ts
CHANGED
|
@@ -1786,6 +1786,9 @@ const schema = a.schema({
|
|
|
1786
1786
|
authorSub: a.string(),
|
|
1787
1787
|
authorUserProfileId: a.id(),
|
|
1788
1788
|
authorLabel: a.string(),
|
|
1789
|
+
editedAt: a.datetime(),
|
|
1790
|
+
deletedAt: a.datetime(),
|
|
1791
|
+
deletedBySub: a.string(),
|
|
1789
1792
|
threadId: a.id(),
|
|
1790
1793
|
parentMessageId: a.id(),
|
|
1791
1794
|
sequenceNumber: a.integer(),
|
|
@@ -1820,8 +1823,12 @@ const schema = a.schema({
|
|
|
1820
1823
|
index("searchVisibility").sortKeys(["createdAt"]).name("messagesBySearchVisibilityCreatedAt").queryField("listMessagesBySearchVisibilityAndCreatedAt"),
|
|
1821
1824
|
])
|
|
1822
1825
|
.authorization((allow) => [
|
|
1823
|
-
|
|
1826
|
+
// One rule per group (a group may appear once per model): editors read and add; admins also delete, for moderation.
|
|
1827
|
+
allow.group("editor").to(categoryAppendOnlyOperations),
|
|
1828
|
+
allow.group(adminGroup).to(["read", "create", "delete"]),
|
|
1824
1829
|
allow.authenticated("identityPool").to(["read", "create", "update"]),
|
|
1830
|
+
// Messages belong to their author: the author edits (and soft-deletes) their own, and only an admin can remove someone else's.
|
|
1831
|
+
allow.ownerDefinedIn("authorSub").identityClaim("sub").to(["read", "update", "delete"]),
|
|
1825
1832
|
]),
|
|
1826
1833
|
|
|
1827
1834
|
MessageThread: a
|
package/amplify/data/schema.js
CHANGED
|
@@ -1573,6 +1573,9 @@ function buildBaseDefinitions(includeEditions) {
|
|
|
1573
1573
|
authorSub: a.string(),
|
|
1574
1574
|
authorUserProfileId: a.id(),
|
|
1575
1575
|
authorLabel: a.string(),
|
|
1576
|
+
editedAt: a.datetime(),
|
|
1577
|
+
deletedAt: a.datetime(),
|
|
1578
|
+
deletedBySub: a.string(),
|
|
1576
1579
|
threadId: a.id(),
|
|
1577
1580
|
parentMessageId: a.id(),
|
|
1578
1581
|
sequenceNumber: a.integer(),
|
|
@@ -1607,7 +1610,11 @@ function buildBaseDefinitions(includeEditions) {
|
|
|
1607
1610
|
index("searchVisibility").sortKeys(["createdAt"]).name("messagesBySearchVisibilityCreatedAt").queryField("listMessagesBySearchVisibilityAndCreatedAt"),
|
|
1608
1611
|
])
|
|
1609
1612
|
.authorization((allow) => [
|
|
1610
|
-
|
|
1613
|
+
// One rule per group (a group may appear once per model): editors read and add; admins also delete, for moderation.
|
|
1614
|
+
allow.group("editor").to(categoryAppendOnlyOperations),
|
|
1615
|
+
allow.group(adminGroup).to(["read", "create", "delete"]),
|
|
1616
|
+
// Messages belong to their author: the author edits (and soft-deletes) their own, and only an admin can remove someone else's.
|
|
1617
|
+
allow.ownerDefinedIn("authorSub").identityClaim("sub").to(["read", "update", "delete"]),
|
|
1611
1618
|
]),
|
|
1612
1619
|
MessageThread: realtimeModel({
|
|
1613
1620
|
id: a.id().required(),
|
package/amplify/data/schema.ts
CHANGED
|
@@ -1687,6 +1687,9 @@ const definitions = {
|
|
|
1687
1687
|
authorSub: a.string(),
|
|
1688
1688
|
authorUserProfileId: a.id(),
|
|
1689
1689
|
authorLabel: a.string(),
|
|
1690
|
+
editedAt: a.datetime(),
|
|
1691
|
+
deletedAt: a.datetime(),
|
|
1692
|
+
deletedBySub: a.string(),
|
|
1690
1693
|
threadId: a.id(),
|
|
1691
1694
|
parentMessageId: a.id(),
|
|
1692
1695
|
sequenceNumber: a.integer(),
|
|
@@ -1721,7 +1724,11 @@ const definitions = {
|
|
|
1721
1724
|
index("searchVisibility").sortKeys(["createdAt"]).name("messagesBySearchVisibilityCreatedAt").queryField("listMessagesBySearchVisibilityAndCreatedAt"),
|
|
1722
1725
|
])
|
|
1723
1726
|
.authorization((allow) => [
|
|
1724
|
-
|
|
1727
|
+
// One rule per group (a group may appear once per model): editors read and add; admins also delete, for moderation.
|
|
1728
|
+
allow.group("editor").to(categoryAppendOnlyOperations),
|
|
1729
|
+
allow.group(adminGroup).to(["read", "create", "delete"]),
|
|
1730
|
+
// Messages belong to their author: the author edits (and soft-deletes) their own, and only an admin can remove someone else's.
|
|
1731
|
+
allow.ownerDefinedIn("authorSub").identityClaim("sub").to(["read", "update", "delete"]),
|
|
1725
1732
|
]),
|
|
1726
1733
|
|
|
1727
1734
|
MessageThread: realtimeModel({
|
package/package.json
CHANGED
package/routes.manifest.json
CHANGED