@anthusai/papyrus 5.110.0 → 5.111.0
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 +63 -0
- package/amplify/data/resource.ts +65 -0
- package/amplify/data/schema.js +63 -1
- package/amplify/data/schema.ts +65 -1
- package/amplify/functions/content-actions/handler.py +5 -1
- package/amplify/functions/editorial-checks/schema.js +10 -2
- package/amplify/functions/editorial-checks/schema.ts +10 -2
- package/amplify/plugins/reader-steering/schema.js +15 -3
- package/amplify/plugins/reader-steering/schema.ts +15 -3
- package/amplify/plugins/signup/schema.js +1 -0
- package/amplify/plugins/signup/schema.ts +1 -0
- package/package.json +1 -1
- package/routes.manifest.json +1 -1
package/amplify/data/resource.js
CHANGED
|
@@ -1442,6 +1442,9 @@ const schema = a.schema({
|
|
|
1442
1442
|
updatedBy: a.string(),
|
|
1443
1443
|
updatedAt: a.datetime().required(),
|
|
1444
1444
|
})
|
|
1445
|
+
.secondaryIndexes((index) => [
|
|
1446
|
+
index("tenantId").sortKeys(["id"]).queryField("listAutomationsByTenant"),
|
|
1447
|
+
])
|
|
1445
1448
|
.authorization((allow) => [
|
|
1446
1449
|
allow.group("editor").to(["read", "create", "update"]),
|
|
1447
1450
|
allow.group(adminGroup).to(authoringOperations),
|
|
@@ -1465,6 +1468,9 @@ const schema = a.schema({
|
|
|
1465
1468
|
appliedIn: a.json(),
|
|
1466
1469
|
updatedAt: a.datetime().required(),
|
|
1467
1470
|
})
|
|
1471
|
+
.secondaryIndexes((index) => [
|
|
1472
|
+
index("tenantId").sortKeys(["id"]).queryField("listReviewRequestsByTenant"),
|
|
1473
|
+
])
|
|
1468
1474
|
.authorization((allow) => [
|
|
1469
1475
|
allow.group("editor").to(["read", "create", "update"]),
|
|
1470
1476
|
allow.group(adminGroup).to(authoringOperations),
|
|
@@ -1478,6 +1484,9 @@ const schema = a.schema({
|
|
|
1478
1484
|
userKey: a.string().required(),
|
|
1479
1485
|
readAt: a.datetime().required(),
|
|
1480
1486
|
})
|
|
1487
|
+
.secondaryIndexes((index) => [
|
|
1488
|
+
index("tenantId").sortKeys(["id"]).queryField("listReviewReadMarksByTenant"),
|
|
1489
|
+
])
|
|
1481
1490
|
.authorization((allow) => [
|
|
1482
1491
|
allow.groups(["editor", adminGroup]).to(["read", "create", "update"]),
|
|
1483
1492
|
]),
|
|
@@ -1511,6 +1520,7 @@ const schema = a.schema({
|
|
|
1511
1520
|
})
|
|
1512
1521
|
.secondaryIndexes((index) => [
|
|
1513
1522
|
index("storyLineageId").sortKeys(["variationNumber"]).queryField("listStoryVariationsByStoryAndNumber"),
|
|
1523
|
+
index("tenantId").sortKeys(["id"]).queryField("listStoryVariationsByTenant"),
|
|
1514
1524
|
])
|
|
1515
1525
|
.authorization((allow) => [
|
|
1516
1526
|
allow.groups(contentWriteGroups).to(["read", "create", "update"]),
|
|
@@ -1573,6 +1583,43 @@ const schema = a.schema({
|
|
|
1573
1583
|
allow.group(adminGroup),
|
|
1574
1584
|
allow.ownerDefinedIn("tenantId").identityClaim("papyrus_tenant_admin").to(["read"]),
|
|
1575
1585
|
]),
|
|
1586
|
+
/** The catalogue row of one site document (kind: site | brand | nav); id = "<tenant>#<kind>". The body lives in S3 (PPY-c020ce). Group "tenancy". */
|
|
1587
|
+
SiteDocument: a
|
|
1588
|
+
.model({
|
|
1589
|
+
id: a.id().required(),
|
|
1590
|
+
tenantId: a.string().required(),
|
|
1591
|
+
kind: a.string().required(),
|
|
1592
|
+
currentVersion: a.integer().required(),
|
|
1593
|
+
s3Key: a.string().required(),
|
|
1594
|
+
sha256: a.string().required(),
|
|
1595
|
+
schemaVersion: a.integer().required(),
|
|
1596
|
+
updatedBy: a.string(),
|
|
1597
|
+
updatedAt: a.datetime().required(),
|
|
1598
|
+
})
|
|
1599
|
+
.authorization((allow) => [
|
|
1600
|
+
allow.group(adminGroup),
|
|
1601
|
+
allow.ownerDefinedIn("tenantId").identityClaim("papyrus_tenant_admin").to(["read"]),
|
|
1602
|
+
]),
|
|
1603
|
+
/** One saved version of a site document; id = "<tenant>#<kind>#<version>". Body in S3 (PPY-c020ce). Group "tenancy". */
|
|
1604
|
+
SiteDocumentVersion: a
|
|
1605
|
+
.model({
|
|
1606
|
+
id: a.id().required(),
|
|
1607
|
+
tenantId: a.string().required(),
|
|
1608
|
+
documentId: a.string().required(),
|
|
1609
|
+
version: a.integer().required(),
|
|
1610
|
+
s3Key: a.string().required(),
|
|
1611
|
+
sha256: a.string().required(),
|
|
1612
|
+
createdBy: a.string(),
|
|
1613
|
+
createdAt: a.datetime().required(),
|
|
1614
|
+
note: a.string(),
|
|
1615
|
+
})
|
|
1616
|
+
.secondaryIndexes((index) => [
|
|
1617
|
+
index("documentId").sortKeys(["version"]).queryField("listSiteDocumentVersionsByDocument"),
|
|
1618
|
+
])
|
|
1619
|
+
.authorization((allow) => [
|
|
1620
|
+
allow.group(adminGroup),
|
|
1621
|
+
allow.ownerDefinedIn("tenantId").identityClaim("papyrus_tenant_admin").to(["read"]),
|
|
1622
|
+
]),
|
|
1576
1623
|
/** Who is told about review requests: scope default, mode or automation. Changed by data, not code. */
|
|
1577
1624
|
ReviewRecipientRule: a
|
|
1578
1625
|
.model({
|
|
@@ -1585,6 +1632,9 @@ const schema = a.schema({
|
|
|
1585
1632
|
updatedBy: a.string(),
|
|
1586
1633
|
updatedAt: a.datetime().required(),
|
|
1587
1634
|
})
|
|
1635
|
+
.secondaryIndexes((index) => [
|
|
1636
|
+
index("tenantId").sortKeys(["id"]).queryField("listReviewRecipientRulesByTenant"),
|
|
1637
|
+
])
|
|
1588
1638
|
.authorization((allow) => [
|
|
1589
1639
|
allow.group("editor").to(["read"]),
|
|
1590
1640
|
allow.group(adminGroup).to(authoringOperations),
|
|
@@ -1680,6 +1730,7 @@ const schema = a.schema({
|
|
|
1680
1730
|
.secondaryIndexes((index) => [
|
|
1681
1731
|
index("ownerId").sortKeys(["payloadKind"]).queryField("listKnowledgeRawPayloadsByOwnerAndKind"),
|
|
1682
1732
|
index("importRunId").sortKeys(["ownerType"]).queryField("listKnowledgeRawPayloadsByImportRunAndOwner"),
|
|
1733
|
+
index("tenantId").sortKeys(["id"]).queryField("listKnowledgeRawPayloadsByTenant"),
|
|
1683
1734
|
])
|
|
1684
1735
|
.authorization((allow) => [
|
|
1685
1736
|
allow.groups(categoryWriteGroups),
|
|
@@ -1698,6 +1749,7 @@ const schema = a.schema({
|
|
|
1698
1749
|
})
|
|
1699
1750
|
.secondaryIndexes((index) => [
|
|
1700
1751
|
index("grantorSub").sortKeys(["createdAt"]).queryField("listCurationDelegationRecordsByGrantor"),
|
|
1752
|
+
index("tenantId").sortKeys(["id"]).queryField("listCurationDelegationRecordsByTenant"),
|
|
1701
1753
|
])
|
|
1702
1754
|
.authorization((allow) => [allow.groups([adminGroup]).to(["read"])]),
|
|
1703
1755
|
KnowledgeArtifact: a
|
|
@@ -1817,6 +1869,7 @@ const schema = a.schema({
|
|
|
1817
1869
|
index("categoryKey").sortKeys(["rank"]).queryField("listCategoryKeywordsByCategoryKeyAndRank"),
|
|
1818
1870
|
index("normalizedKeyword").sortKeys(["categorySetId"]).queryField("listCategoryKeywordsByNormalizedKeywordAndSet"),
|
|
1819
1871
|
index("importRunId").sortKeys(["rank"]).queryField("listCategoryKeywordsByImportRunAndRank"),
|
|
1872
|
+
index("tenantId").sortKeys(["id"]).queryField("listCategoryKeywordsByTenant"),
|
|
1820
1873
|
])
|
|
1821
1874
|
.authorization((allow) => [
|
|
1822
1875
|
allow.groups(categoryWriteGroups),
|
|
@@ -1904,6 +1957,7 @@ const schema = a.schema({
|
|
|
1904
1957
|
.secondaryIndexes((index) => [
|
|
1905
1958
|
index("proposalId").sortKeys(["createdAt"]).queryField("listSteeringDecisionsByProposalAndCreatedAt"),
|
|
1906
1959
|
index("categorySetId").sortKeys(["createdAt"]).queryField("listSteeringDecisionsBySetAndCreatedAt"),
|
|
1960
|
+
index("tenantId").sortKeys(["id"]).queryField("listSteeringDecisionsByTenant"),
|
|
1907
1961
|
])
|
|
1908
1962
|
.authorization((allow) => [
|
|
1909
1963
|
allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
|
|
@@ -2056,6 +2110,7 @@ const schema = a.schema({
|
|
|
2056
2110
|
index("referenceLineageId").sortKeys(["sortKey"]).queryField("listReferenceAttachmentsByReferenceLineageAndSortKey"),
|
|
2057
2111
|
index("storagePath").queryField("referenceAttachmentByStoragePath"),
|
|
2058
2112
|
index("importRunId").sortKeys(["sortKey"]).queryField("listReferenceAttachmentsByImportRunAndSortKey"),
|
|
2113
|
+
index("tenantId").sortKeys(["id"]).queryField("listReferenceAttachmentsByTenant"),
|
|
2059
2114
|
])
|
|
2060
2115
|
.authorization((allow) => [
|
|
2061
2116
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
@@ -2101,6 +2156,7 @@ const schema = a.schema({
|
|
|
2101
2156
|
index("corpusId").sortKeys(["nodeKey"]).queryField("listSemanticNodesByCorpusAndNodeKey"),
|
|
2102
2157
|
index("importRunId").sortKeys(["nodeKey"]).queryField("listSemanticNodesByImportRunAndNodeKey"),
|
|
2103
2158
|
index("versionState").sortKeys(["updatedAt"]).queryField("listSemanticNodesByVersionStateAndUpdatedAt"),
|
|
2159
|
+
index("tenantId").sortKeys(["id"]).queryField("listSemanticNodesByTenant"),
|
|
2104
2160
|
])
|
|
2105
2161
|
.authorization((allow) => [
|
|
2106
2162
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
@@ -2310,6 +2366,7 @@ const schema = a.schema({
|
|
|
2310
2366
|
index("importRunId").sortKeys(["importedAt"]).queryField("listSemanticRelationsByImportRunAndImportedAt"),
|
|
2311
2367
|
index("relationTypeKey").sortKeys(["importedAt"]).queryField("listSemanticRelationsByTypeAndImportedAt"),
|
|
2312
2368
|
index("relationDomain").sortKeys(["importedAt"]).queryField("listSemanticRelationsByDomainAndImportedAt"),
|
|
2369
|
+
index("tenantId").sortKeys(["id"]).queryField("listSemanticRelationsByTenant"),
|
|
2313
2370
|
])
|
|
2314
2371
|
.authorization((allow) => [
|
|
2315
2372
|
allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
|
|
@@ -2437,6 +2494,7 @@ const schema = a.schema({
|
|
|
2437
2494
|
.secondaryIndexes((index) => [
|
|
2438
2495
|
index("slug").queryField("tagBySlug"),
|
|
2439
2496
|
index("type").sortKeys(["label"]).queryField("listTagsByTypeAndLabel"),
|
|
2497
|
+
index("tenantId").sortKeys(["id"]).queryField("listTagsByTenant"),
|
|
2440
2498
|
])
|
|
2441
2499
|
.authorization((allow) => [
|
|
2442
2500
|
allow.groups(contentWriteGroups),
|
|
@@ -2457,6 +2515,7 @@ const schema = a.schema({
|
|
|
2457
2515
|
.secondaryIndexes((index) => [
|
|
2458
2516
|
index("itemId").sortKeys(["tagSlug"]).queryField("listItemTagsByItemAndTag"),
|
|
2459
2517
|
index("tagId").sortKeys(["publishedAt"]).queryField("listItemTagsByTagAndPublishedAt"),
|
|
2518
|
+
index("tenantId").sortKeys(["id"]).queryField("listItemTagsByTenant"),
|
|
2460
2519
|
])
|
|
2461
2520
|
.authorization((allow) => [
|
|
2462
2521
|
allow.groups(contentWriteGroups),
|
|
@@ -2571,6 +2630,7 @@ const schema = a.schema({
|
|
|
2571
2630
|
.secondaryIndexes((index) => [
|
|
2572
2631
|
index("editionId").sortKeys(["sortKey"]).queryField("listEditionItemsByEditionAndSortKey"),
|
|
2573
2632
|
index("itemId").sortKeys(["editionId"]).queryField("listEditionItemsByItemAndEdition"),
|
|
2633
|
+
index("tenantId").sortKeys(["id"]).queryField("listEditionItemsByTenant"),
|
|
2574
2634
|
])
|
|
2575
2635
|
.authorization((allow) => [
|
|
2576
2636
|
allow.groups(contentWriteGroups),
|
|
@@ -2620,6 +2680,7 @@ const schema = a.schema({
|
|
|
2620
2680
|
index("typeStatus").sortKeys(["publishedAt"]).queryField("listPublishedItemsByTypeStatusAndPublishedAt"),
|
|
2621
2681
|
index("sectionStatus").sortKeys(["publishedAt"]).queryField("listPublishedItemsBySectionStatusAndPublishedAt"),
|
|
2622
2682
|
index("itemLineageId").sortKeys(["versionNumber"]).queryField("listPublishedItemsByLineageAndVersion"),
|
|
2683
|
+
index("tenantId").sortKeys(["id"]).queryField("listPublishedItemsByTenant"),
|
|
2623
2684
|
])
|
|
2624
2685
|
.authorization((allow) => [
|
|
2625
2686
|
allow.guest().to(["read"]),
|
|
@@ -2707,6 +2768,7 @@ const schema = a.schema({
|
|
|
2707
2768
|
.secondaryIndexes((index) => [
|
|
2708
2769
|
index("publishedEditionId").sortKeys(["sortKey"]).queryField("listPublishedEditionItemsByEditionAndSortKey"),
|
|
2709
2770
|
index("publishedItemId").sortKeys(["publishedEditionId"]).queryField("listPublishedEditionItemsByItemAndEdition"),
|
|
2771
|
+
index("tenantId").sortKeys(["id"]).queryField("listPublishedEditionItemsByTenant"),
|
|
2710
2772
|
])
|
|
2711
2773
|
.authorization((allow) => [
|
|
2712
2774
|
allow.guest().to(["read"]),
|
|
@@ -2769,6 +2831,7 @@ const schema = a.schema({
|
|
|
2769
2831
|
index("parentCategoryId").sortKeys(["rank"]).queryField("listPublishedCategoriesByParentAndRank"),
|
|
2770
2832
|
index("parentCategoryKey").sortKeys(["rank"]).queryField("listPublishedCategoriesByParentKeyAndRank"),
|
|
2771
2833
|
index("categoryKey").sortKeys(["publishedCategorySetId"]).queryField("listPublishedCategoriesByKeyAndSet"),
|
|
2834
|
+
index("tenantId").sortKeys(["id"]).queryField("listPublishedCategoriesByTenant"),
|
|
2772
2835
|
])
|
|
2773
2836
|
.authorization((allow) => [
|
|
2774
2837
|
allow.guest().to(["read"]),
|
package/amplify/data/resource.ts
CHANGED
|
@@ -1568,6 +1568,9 @@ const schema = a.schema({
|
|
|
1568
1568
|
updatedBy: a.string(),
|
|
1569
1569
|
updatedAt: a.datetime().required(),
|
|
1570
1570
|
})
|
|
1571
|
+
.secondaryIndexes((index) => [
|
|
1572
|
+
index("tenantId").sortKeys(["id"]).queryField("listAutomationsByTenant"),
|
|
1573
|
+
])
|
|
1571
1574
|
.authorization((allow) => [
|
|
1572
1575
|
allow.group("editor").to(["read", "create", "update"]),
|
|
1573
1576
|
allow.group(adminGroup).to(authoringOperations),
|
|
@@ -1592,6 +1595,9 @@ const schema = a.schema({
|
|
|
1592
1595
|
appliedIn: a.json(),
|
|
1593
1596
|
updatedAt: a.datetime().required(),
|
|
1594
1597
|
})
|
|
1598
|
+
.secondaryIndexes((index) => [
|
|
1599
|
+
index("tenantId").sortKeys(["id"]).queryField("listReviewRequestsByTenant"),
|
|
1600
|
+
])
|
|
1595
1601
|
.authorization((allow) => [
|
|
1596
1602
|
allow.group("editor").to(["read", "create", "update"]),
|
|
1597
1603
|
allow.group(adminGroup).to(authoringOperations),
|
|
@@ -1606,6 +1612,9 @@ const schema = a.schema({
|
|
|
1606
1612
|
userKey: a.string().required(),
|
|
1607
1613
|
readAt: a.datetime().required(),
|
|
1608
1614
|
})
|
|
1615
|
+
.secondaryIndexes((index) => [
|
|
1616
|
+
index("tenantId").sortKeys(["id"]).queryField("listReviewReadMarksByTenant"),
|
|
1617
|
+
])
|
|
1609
1618
|
.authorization((allow) => [
|
|
1610
1619
|
allow.groups(["editor", adminGroup]).to(["read", "create", "update"]),
|
|
1611
1620
|
]),
|
|
@@ -1640,6 +1649,7 @@ const schema = a.schema({
|
|
|
1640
1649
|
})
|
|
1641
1650
|
.secondaryIndexes((index) => [
|
|
1642
1651
|
index("storyLineageId").sortKeys(["variationNumber"]).queryField("listStoryVariationsByStoryAndNumber"),
|
|
1652
|
+
index("tenantId").sortKeys(["id"]).queryField("listStoryVariationsByTenant"),
|
|
1643
1653
|
])
|
|
1644
1654
|
.authorization((allow) => [
|
|
1645
1655
|
allow.groups(contentWriteGroups).to(["read", "create", "update"]),
|
|
@@ -1706,6 +1716,45 @@ const schema = a.schema({
|
|
|
1706
1716
|
allow.ownerDefinedIn("tenantId").identityClaim("papyrus_tenant_admin").to(["read"]),
|
|
1707
1717
|
]),
|
|
1708
1718
|
|
|
1719
|
+
/** The catalogue row of one site document (kind: site | brand | nav); id = "<tenant>#<kind>". The body lives in S3 (PPY-c020ce). Group "tenancy". */
|
|
1720
|
+
SiteDocument: a
|
|
1721
|
+
.model({
|
|
1722
|
+
id: a.id().required(),
|
|
1723
|
+
tenantId: a.string().required(),
|
|
1724
|
+
kind: a.string().required(),
|
|
1725
|
+
currentVersion: a.integer().required(),
|
|
1726
|
+
s3Key: a.string().required(),
|
|
1727
|
+
sha256: a.string().required(),
|
|
1728
|
+
schemaVersion: a.integer().required(),
|
|
1729
|
+
updatedBy: a.string(),
|
|
1730
|
+
updatedAt: a.datetime().required(),
|
|
1731
|
+
})
|
|
1732
|
+
.authorization((allow) => [
|
|
1733
|
+
allow.group(adminGroup),
|
|
1734
|
+
allow.ownerDefinedIn("tenantId").identityClaim("papyrus_tenant_admin").to(["read"]),
|
|
1735
|
+
]),
|
|
1736
|
+
|
|
1737
|
+
/** One saved version of a site document; id = "<tenant>#<kind>#<version>". Body in S3 (PPY-c020ce). Group "tenancy". */
|
|
1738
|
+
SiteDocumentVersion: a
|
|
1739
|
+
.model({
|
|
1740
|
+
id: a.id().required(),
|
|
1741
|
+
tenantId: a.string().required(),
|
|
1742
|
+
documentId: a.string().required(),
|
|
1743
|
+
version: a.integer().required(),
|
|
1744
|
+
s3Key: a.string().required(),
|
|
1745
|
+
sha256: a.string().required(),
|
|
1746
|
+
createdBy: a.string(),
|
|
1747
|
+
createdAt: a.datetime().required(),
|
|
1748
|
+
note: a.string(),
|
|
1749
|
+
})
|
|
1750
|
+
.secondaryIndexes((index) => [
|
|
1751
|
+
index("documentId").sortKeys(["version"]).queryField("listSiteDocumentVersionsByDocument"),
|
|
1752
|
+
])
|
|
1753
|
+
.authorization((allow) => [
|
|
1754
|
+
allow.group(adminGroup),
|
|
1755
|
+
allow.ownerDefinedIn("tenantId").identityClaim("papyrus_tenant_admin").to(["read"]),
|
|
1756
|
+
]),
|
|
1757
|
+
|
|
1709
1758
|
|
|
1710
1759
|
/** Who is told about review requests: scope default, mode or automation. Changed by data, not code. */
|
|
1711
1760
|
ReviewRecipientRule: a
|
|
@@ -1719,6 +1768,9 @@ const schema = a.schema({
|
|
|
1719
1768
|
updatedBy: a.string(),
|
|
1720
1769
|
updatedAt: a.datetime().required(),
|
|
1721
1770
|
})
|
|
1771
|
+
.secondaryIndexes((index) => [
|
|
1772
|
+
index("tenantId").sortKeys(["id"]).queryField("listReviewRecipientRulesByTenant"),
|
|
1773
|
+
])
|
|
1722
1774
|
.authorization((allow) => [
|
|
1723
1775
|
allow.group("editor").to(["read"]),
|
|
1724
1776
|
allow.group(adminGroup).to(authoringOperations),
|
|
@@ -1818,6 +1870,7 @@ const schema = a.schema({
|
|
|
1818
1870
|
.secondaryIndexes((index) => [
|
|
1819
1871
|
index("ownerId").sortKeys(["payloadKind"]).queryField("listKnowledgeRawPayloadsByOwnerAndKind"),
|
|
1820
1872
|
index("importRunId").sortKeys(["ownerType"]).queryField("listKnowledgeRawPayloadsByImportRunAndOwner"),
|
|
1873
|
+
index("tenantId").sortKeys(["id"]).queryField("listKnowledgeRawPayloadsByTenant"),
|
|
1821
1874
|
])
|
|
1822
1875
|
.authorization((allow) => [
|
|
1823
1876
|
allow.groups(categoryWriteGroups),
|
|
@@ -1837,6 +1890,7 @@ const schema = a.schema({
|
|
|
1837
1890
|
})
|
|
1838
1891
|
.secondaryIndexes((index) => [
|
|
1839
1892
|
index("grantorSub").sortKeys(["createdAt"]).queryField("listCurationDelegationRecordsByGrantor"),
|
|
1893
|
+
index("tenantId").sortKeys(["id"]).queryField("listCurationDelegationRecordsByTenant"),
|
|
1840
1894
|
])
|
|
1841
1895
|
.authorization((allow) => [allow.groups([adminGroup]).to(["read"])]),
|
|
1842
1896
|
|
|
@@ -1960,6 +2014,7 @@ const schema = a.schema({
|
|
|
1960
2014
|
index("categoryKey").sortKeys(["rank"]).queryField("listCategoryKeywordsByCategoryKeyAndRank"),
|
|
1961
2015
|
index("normalizedKeyword").sortKeys(["categorySetId"]).queryField("listCategoryKeywordsByNormalizedKeywordAndSet"),
|
|
1962
2016
|
index("importRunId").sortKeys(["rank"]).queryField("listCategoryKeywordsByImportRunAndRank"),
|
|
2017
|
+
index("tenantId").sortKeys(["id"]).queryField("listCategoryKeywordsByTenant"),
|
|
1963
2018
|
])
|
|
1964
2019
|
.authorization((allow) => [
|
|
1965
2020
|
allow.groups(categoryWriteGroups),
|
|
@@ -2050,6 +2105,7 @@ const schema = a.schema({
|
|
|
2050
2105
|
.secondaryIndexes((index) => [
|
|
2051
2106
|
index("proposalId").sortKeys(["createdAt"]).queryField("listSteeringDecisionsByProposalAndCreatedAt"),
|
|
2052
2107
|
index("categorySetId").sortKeys(["createdAt"]).queryField("listSteeringDecisionsBySetAndCreatedAt"),
|
|
2108
|
+
index("tenantId").sortKeys(["id"]).queryField("listSteeringDecisionsByTenant"),
|
|
2053
2109
|
])
|
|
2054
2110
|
.authorization((allow) => [
|
|
2055
2111
|
allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
|
|
@@ -2204,6 +2260,7 @@ const schema = a.schema({
|
|
|
2204
2260
|
index("referenceLineageId").sortKeys(["sortKey"]).queryField("listReferenceAttachmentsByReferenceLineageAndSortKey"),
|
|
2205
2261
|
index("storagePath").queryField("referenceAttachmentByStoragePath"),
|
|
2206
2262
|
index("importRunId").sortKeys(["sortKey"]).queryField("listReferenceAttachmentsByImportRunAndSortKey"),
|
|
2263
|
+
index("tenantId").sortKeys(["id"]).queryField("listReferenceAttachmentsByTenant"),
|
|
2207
2264
|
])
|
|
2208
2265
|
.authorization((allow) => [
|
|
2209
2266
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
@@ -2250,6 +2307,7 @@ const schema = a.schema({
|
|
|
2250
2307
|
index("corpusId").sortKeys(["nodeKey"]).queryField("listSemanticNodesByCorpusAndNodeKey"),
|
|
2251
2308
|
index("importRunId").sortKeys(["nodeKey"]).queryField("listSemanticNodesByImportRunAndNodeKey"),
|
|
2252
2309
|
index("versionState").sortKeys(["updatedAt"]).queryField("listSemanticNodesByVersionStateAndUpdatedAt"),
|
|
2310
|
+
index("tenantId").sortKeys(["id"]).queryField("listSemanticNodesByTenant"),
|
|
2253
2311
|
])
|
|
2254
2312
|
.authorization((allow) => [
|
|
2255
2313
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
@@ -2464,6 +2522,7 @@ const schema = a.schema({
|
|
|
2464
2522
|
index("importRunId").sortKeys(["importedAt"]).queryField("listSemanticRelationsByImportRunAndImportedAt"),
|
|
2465
2523
|
index("relationTypeKey").sortKeys(["importedAt"]).queryField("listSemanticRelationsByTypeAndImportedAt"),
|
|
2466
2524
|
index("relationDomain").sortKeys(["importedAt"]).queryField("listSemanticRelationsByDomainAndImportedAt"),
|
|
2525
|
+
index("tenantId").sortKeys(["id"]).queryField("listSemanticRelationsByTenant"),
|
|
2467
2526
|
])
|
|
2468
2527
|
.authorization((allow) => [
|
|
2469
2528
|
allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
|
|
@@ -2594,6 +2653,7 @@ const schema = a.schema({
|
|
|
2594
2653
|
.secondaryIndexes((index) => [
|
|
2595
2654
|
index("slug").queryField("tagBySlug"),
|
|
2596
2655
|
index("type").sortKeys(["label"]).queryField("listTagsByTypeAndLabel"),
|
|
2656
|
+
index("tenantId").sortKeys(["id"]).queryField("listTagsByTenant"),
|
|
2597
2657
|
])
|
|
2598
2658
|
.authorization((allow) => [
|
|
2599
2659
|
allow.groups(contentWriteGroups),
|
|
@@ -2615,6 +2675,7 @@ const schema = a.schema({
|
|
|
2615
2675
|
.secondaryIndexes((index) => [
|
|
2616
2676
|
index("itemId").sortKeys(["tagSlug"]).queryField("listItemTagsByItemAndTag"),
|
|
2617
2677
|
index("tagId").sortKeys(["publishedAt"]).queryField("listItemTagsByTagAndPublishedAt"),
|
|
2678
|
+
index("tenantId").sortKeys(["id"]).queryField("listItemTagsByTenant"),
|
|
2618
2679
|
])
|
|
2619
2680
|
.authorization((allow) => [
|
|
2620
2681
|
allow.groups(contentWriteGroups),
|
|
@@ -2733,6 +2794,7 @@ const schema = a.schema({
|
|
|
2733
2794
|
.secondaryIndexes((index) => [
|
|
2734
2795
|
index("editionId").sortKeys(["sortKey"]).queryField("listEditionItemsByEditionAndSortKey"),
|
|
2735
2796
|
index("itemId").sortKeys(["editionId"]).queryField("listEditionItemsByItemAndEdition"),
|
|
2797
|
+
index("tenantId").sortKeys(["id"]).queryField("listEditionItemsByTenant"),
|
|
2736
2798
|
])
|
|
2737
2799
|
.authorization((allow) => [
|
|
2738
2800
|
allow.groups(contentWriteGroups),
|
|
@@ -2783,6 +2845,7 @@ const schema = a.schema({
|
|
|
2783
2845
|
index("typeStatus").sortKeys(["publishedAt"]).queryField("listPublishedItemsByTypeStatusAndPublishedAt"),
|
|
2784
2846
|
index("sectionStatus").sortKeys(["publishedAt"]).queryField("listPublishedItemsBySectionStatusAndPublishedAt"),
|
|
2785
2847
|
index("itemLineageId").sortKeys(["versionNumber"]).queryField("listPublishedItemsByLineageAndVersion"),
|
|
2848
|
+
index("tenantId").sortKeys(["id"]).queryField("listPublishedItemsByTenant"),
|
|
2786
2849
|
])
|
|
2787
2850
|
.authorization((allow) => [
|
|
2788
2851
|
allow.guest().to(["read"]),
|
|
@@ -2873,6 +2936,7 @@ const schema = a.schema({
|
|
|
2873
2936
|
.secondaryIndexes((index) => [
|
|
2874
2937
|
index("publishedEditionId").sortKeys(["sortKey"]).queryField("listPublishedEditionItemsByEditionAndSortKey"),
|
|
2875
2938
|
index("publishedItemId").sortKeys(["publishedEditionId"]).queryField("listPublishedEditionItemsByItemAndEdition"),
|
|
2939
|
+
index("tenantId").sortKeys(["id"]).queryField("listPublishedEditionItemsByTenant"),
|
|
2876
2940
|
])
|
|
2877
2941
|
.authorization((allow) => [
|
|
2878
2942
|
allow.guest().to(["read"]),
|
|
@@ -2937,6 +3001,7 @@ const schema = a.schema({
|
|
|
2937
3001
|
index("parentCategoryId").sortKeys(["rank"]).queryField("listPublishedCategoriesByParentAndRank"),
|
|
2938
3002
|
index("parentCategoryKey").sortKeys(["rank"]).queryField("listPublishedCategoriesByParentKeyAndRank"),
|
|
2939
3003
|
index("categoryKey").sortKeys(["publishedCategorySetId"]).queryField("listPublishedCategoriesByKeyAndSet"),
|
|
3004
|
+
index("tenantId").sortKeys(["id"]).queryField("listPublishedCategoriesByTenant"),
|
|
2940
3005
|
])
|
|
2941
3006
|
.authorization((allow) => [
|
|
2942
3007
|
allow.guest().to(["read"]),
|
package/amplify/data/schema.js
CHANGED
|
@@ -49,7 +49,8 @@ export const OPTIONAL_MODEL_GROUPS = {
|
|
|
49
49
|
editorial: ["EditorialCheckRun", "EditorialFeedback", "EditorialPolicy", "EditorialCheckSettings"],
|
|
50
50
|
steering: ["SteeringProposal", "SteeringDecision", "LexicalSteeringRule"],
|
|
51
51
|
variations: ["StoryVariation"],
|
|
52
|
-
tenancy: ["Tenant", "TenantMembership", "TenantDomain"],
|
|
52
|
+
tenancy: ["Tenant", "TenantMembership", "TenantDomain", "SiteDocument", "SiteDocumentVersion"],
|
|
53
|
+
localization: ["LocalizationRequest"],
|
|
53
54
|
};
|
|
54
55
|
/**
|
|
55
56
|
* The groups a bootstrap deploy leaves out (`PAPYRUS_BOOTSTRAP_STAGE=1`, docs/site-hosting.md). Every group is deferred,
|
|
@@ -1412,6 +1413,9 @@ function buildBaseDefinitions(excludedGroups = []) {
|
|
|
1412
1413
|
updatedBy: a.string(),
|
|
1413
1414
|
updatedAt: a.datetime().required(),
|
|
1414
1415
|
})
|
|
1416
|
+
.secondaryIndexes((index) => [
|
|
1417
|
+
index("tenantId").sortKeys(["id"]).queryField("listAutomationsByTenant"),
|
|
1418
|
+
])
|
|
1415
1419
|
.authorization((allow) => [
|
|
1416
1420
|
allow.group("editor").to(["read", "create", "update"]),
|
|
1417
1421
|
allow.group(adminGroup).to(authoringOperations),
|
|
@@ -1434,6 +1438,9 @@ function buildBaseDefinitions(excludedGroups = []) {
|
|
|
1434
1438
|
appliedIn: a.json(),
|
|
1435
1439
|
updatedAt: a.datetime().required(),
|
|
1436
1440
|
})
|
|
1441
|
+
.secondaryIndexes((index) => [
|
|
1442
|
+
index("tenantId").sortKeys(["id"]).queryField("listReviewRequestsByTenant"),
|
|
1443
|
+
])
|
|
1437
1444
|
.authorization((allow) => [
|
|
1438
1445
|
allow.group("editor").to(["read", "create", "update"]),
|
|
1439
1446
|
allow.group(adminGroup).to(authoringOperations),
|
|
@@ -1446,6 +1453,9 @@ function buildBaseDefinitions(excludedGroups = []) {
|
|
|
1446
1453
|
userKey: a.string().required(),
|
|
1447
1454
|
readAt: a.datetime().required(),
|
|
1448
1455
|
})
|
|
1456
|
+
.secondaryIndexes((index) => [
|
|
1457
|
+
index("tenantId").sortKeys(["id"]).queryField("listReviewReadMarksByTenant"),
|
|
1458
|
+
])
|
|
1449
1459
|
.authorization((allow) => [
|
|
1450
1460
|
allow.groups(["editor", adminGroup]).to(["read", "create", "update"]),
|
|
1451
1461
|
]),
|
|
@@ -1478,6 +1488,7 @@ function buildBaseDefinitions(excludedGroups = []) {
|
|
|
1478
1488
|
})
|
|
1479
1489
|
.secondaryIndexes((index) => [
|
|
1480
1490
|
index("storyLineageId").sortKeys(["variationNumber"]).queryField("listStoryVariationsByStoryAndNumber"),
|
|
1491
|
+
index("tenantId").sortKeys(["id"]).queryField("listStoryVariationsByTenant"),
|
|
1481
1492
|
])
|
|
1482
1493
|
.authorization((allow) => [
|
|
1483
1494
|
allow.groups(contentWriteGroups).to(["read", "create", "update"]),
|
|
@@ -1493,6 +1504,9 @@ function buildBaseDefinitions(excludedGroups = []) {
|
|
|
1493
1504
|
updatedBy: a.string(),
|
|
1494
1505
|
updatedAt: a.datetime().required(),
|
|
1495
1506
|
})
|
|
1507
|
+
.secondaryIndexes((index) => [
|
|
1508
|
+
index("tenantId").sortKeys(["id"]).queryField("listReviewRecipientRulesByTenant"),
|
|
1509
|
+
])
|
|
1496
1510
|
.authorization((allow) => [
|
|
1497
1511
|
allow.group("editor").to(["read"]),
|
|
1498
1512
|
allow.group(adminGroup).to(authoringOperations),
|
|
@@ -1584,6 +1598,7 @@ function buildBaseDefinitions(excludedGroups = []) {
|
|
|
1584
1598
|
.secondaryIndexes((index) => [
|
|
1585
1599
|
index("ownerId").sortKeys(["payloadKind"]).queryField("listKnowledgeRawPayloadsByOwnerAndKind"),
|
|
1586
1600
|
index("importRunId").sortKeys(["ownerType"]).queryField("listKnowledgeRawPayloadsByImportRunAndOwner"),
|
|
1601
|
+
index("tenantId").sortKeys(["id"]).queryField("listKnowledgeRawPayloadsByTenant"),
|
|
1587
1602
|
])
|
|
1588
1603
|
.authorization((allow) => [
|
|
1589
1604
|
allow.groups(categoryWriteGroups),
|
|
@@ -1601,6 +1616,7 @@ function buildBaseDefinitions(excludedGroups = []) {
|
|
|
1601
1616
|
})
|
|
1602
1617
|
.secondaryIndexes((index) => [
|
|
1603
1618
|
index("grantorSub").sortKeys(["createdAt"]).queryField("listCurationDelegationRecordsByGrantor"),
|
|
1619
|
+
index("tenantId").sortKeys(["id"]).queryField("listCurationDelegationRecordsByTenant"),
|
|
1604
1620
|
])
|
|
1605
1621
|
.authorization((allow) => [allow.groups([adminGroup]).to(["read"])]),
|
|
1606
1622
|
KnowledgeArtifact: modelWithoutSubscriptions({
|
|
@@ -1716,6 +1732,7 @@ function buildBaseDefinitions(excludedGroups = []) {
|
|
|
1716
1732
|
index("categoryKey").sortKeys(["rank"]).queryField("listCategoryKeywordsByCategoryKeyAndRank"),
|
|
1717
1733
|
index("normalizedKeyword").sortKeys(["categorySetId"]).queryField("listCategoryKeywordsByNormalizedKeywordAndSet"),
|
|
1718
1734
|
index("importRunId").sortKeys(["rank"]).queryField("listCategoryKeywordsByImportRunAndRank"),
|
|
1735
|
+
index("tenantId").sortKeys(["id"]).queryField("listCategoryKeywordsByTenant"),
|
|
1719
1736
|
])
|
|
1720
1737
|
.authorization((allow) => [
|
|
1721
1738
|
allow.groups(categoryWriteGroups),
|
|
@@ -1800,6 +1817,7 @@ function buildBaseDefinitions(excludedGroups = []) {
|
|
|
1800
1817
|
.secondaryIndexes((index) => [
|
|
1801
1818
|
index("proposalId").sortKeys(["createdAt"]).queryField("listSteeringDecisionsByProposalAndCreatedAt"),
|
|
1802
1819
|
index("categorySetId").sortKeys(["createdAt"]).queryField("listSteeringDecisionsBySetAndCreatedAt"),
|
|
1820
|
+
index("tenantId").sortKeys(["id"]).queryField("listSteeringDecisionsByTenant"),
|
|
1803
1821
|
])
|
|
1804
1822
|
.authorization((allow) => [
|
|
1805
1823
|
allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
|
|
@@ -1956,6 +1974,7 @@ function buildBaseDefinitions(excludedGroups = []) {
|
|
|
1956
1974
|
index("referenceLineageId").sortKeys(["sortKey"]).queryField("listReferenceAttachmentsByReferenceLineageAndSortKey"),
|
|
1957
1975
|
index("storagePath").queryField("referenceAttachmentByStoragePath"),
|
|
1958
1976
|
index("importRunId").sortKeys(["sortKey"]).queryField("listReferenceAttachmentsByImportRunAndSortKey"),
|
|
1977
|
+
index("tenantId").sortKeys(["id"]).queryField("listReferenceAttachmentsByTenant"),
|
|
1959
1978
|
])
|
|
1960
1979
|
.authorization((allow) => [
|
|
1961
1980
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
@@ -2000,6 +2019,7 @@ function buildBaseDefinitions(excludedGroups = []) {
|
|
|
2000
2019
|
index("corpusId").sortKeys(["nodeKey"]).queryField("listSemanticNodesByCorpusAndNodeKey"),
|
|
2001
2020
|
index("importRunId").sortKeys(["nodeKey"]).queryField("listSemanticNodesByImportRunAndNodeKey"),
|
|
2002
2021
|
index("versionState").sortKeys(["updatedAt"]).queryField("listSemanticNodesByVersionStateAndUpdatedAt"),
|
|
2022
|
+
index("tenantId").sortKeys(["id"]).queryField("listSemanticNodesByTenant"),
|
|
2003
2023
|
])
|
|
2004
2024
|
.authorization((allow) => [
|
|
2005
2025
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
@@ -2204,6 +2224,7 @@ function buildBaseDefinitions(excludedGroups = []) {
|
|
|
2204
2224
|
index("importRunId").sortKeys(["importedAt"]).queryField("listSemanticRelationsByImportRunAndImportedAt"),
|
|
2205
2225
|
index("relationTypeKey").sortKeys(["importedAt"]).queryField("listSemanticRelationsByTypeAndImportedAt"),
|
|
2206
2226
|
index("relationDomain").sortKeys(["importedAt"]).queryField("listSemanticRelationsByDomainAndImportedAt"),
|
|
2227
|
+
index("tenantId").sortKeys(["id"]).queryField("listSemanticRelationsByTenant"),
|
|
2207
2228
|
])
|
|
2208
2229
|
.authorization((allow) => [
|
|
2209
2230
|
allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
|
|
@@ -2328,6 +2349,7 @@ function buildBaseDefinitions(excludedGroups = []) {
|
|
|
2328
2349
|
.secondaryIndexes((index) => [
|
|
2329
2350
|
index("slug").queryField("tagBySlug"),
|
|
2330
2351
|
index("type").sortKeys(["label"]).queryField("listTagsByTypeAndLabel"),
|
|
2352
|
+
index("tenantId").sortKeys(["id"]).queryField("listTagsByTenant"),
|
|
2331
2353
|
])
|
|
2332
2354
|
.authorization((allow) => [
|
|
2333
2355
|
allow.groups(contentWriteGroups),
|
|
@@ -2347,6 +2369,7 @@ function buildBaseDefinitions(excludedGroups = []) {
|
|
|
2347
2369
|
.secondaryIndexes((index) => [
|
|
2348
2370
|
index("itemId").sortKeys(["tagSlug"]).queryField("listItemTagsByItemAndTag"),
|
|
2349
2371
|
index("tagId").sortKeys(["publishedAt"]).queryField("listItemTagsByTagAndPublishedAt"),
|
|
2372
|
+
index("tenantId").sortKeys(["id"]).queryField("listItemTagsByTenant"),
|
|
2350
2373
|
])
|
|
2351
2374
|
.authorization((allow) => [
|
|
2352
2375
|
allow.groups(contentWriteGroups),
|
|
@@ -2432,6 +2455,7 @@ function buildBaseDefinitions(excludedGroups = []) {
|
|
|
2432
2455
|
.secondaryIndexes((index) => [
|
|
2433
2456
|
index("editionId").sortKeys(["sortKey"]).queryField("listEditionItemsByEditionAndSortKey"),
|
|
2434
2457
|
index("itemId").sortKeys(["editionId"]).queryField("listEditionItemsByItemAndEdition"),
|
|
2458
|
+
index("tenantId").sortKeys(["id"]).queryField("listEditionItemsByTenant"),
|
|
2435
2459
|
])
|
|
2436
2460
|
.authorization((allow) => [
|
|
2437
2461
|
allow.groups(contentWriteGroups),
|
|
@@ -2480,6 +2504,7 @@ function buildBaseDefinitions(excludedGroups = []) {
|
|
|
2480
2504
|
index("typeStatus").sortKeys(["publishedAt"]).queryField("listPublishedItemsByTypeStatusAndPublishedAt"),
|
|
2481
2505
|
index("sectionStatus").sortKeys(["publishedAt"]).queryField("listPublishedItemsBySectionStatusAndPublishedAt"),
|
|
2482
2506
|
index("itemLineageId").sortKeys(["versionNumber"]).queryField("listPublishedItemsByLineageAndVersion"),
|
|
2507
|
+
index("tenantId").sortKeys(["id"]).queryField("listPublishedItemsByTenant"),
|
|
2483
2508
|
])
|
|
2484
2509
|
.authorization((allow) => [
|
|
2485
2510
|
allow.guest().to(["read"]),
|
|
@@ -2564,6 +2589,7 @@ function buildBaseDefinitions(excludedGroups = []) {
|
|
|
2564
2589
|
.secondaryIndexes((index) => [
|
|
2565
2590
|
index("publishedEditionId").sortKeys(["sortKey"]).queryField("listPublishedEditionItemsByEditionAndSortKey"),
|
|
2566
2591
|
index("publishedItemId").sortKeys(["publishedEditionId"]).queryField("listPublishedEditionItemsByItemAndEdition"),
|
|
2592
|
+
index("tenantId").sortKeys(["id"]).queryField("listPublishedEditionItemsByTenant"),
|
|
2567
2593
|
])
|
|
2568
2594
|
.authorization((allow) => [
|
|
2569
2595
|
allow.guest().to(["read"]),
|
|
@@ -2624,6 +2650,7 @@ function buildBaseDefinitions(excludedGroups = []) {
|
|
|
2624
2650
|
index("parentCategoryId").sortKeys(["rank"]).queryField("listPublishedCategoriesByParentAndRank"),
|
|
2625
2651
|
index("parentCategoryKey").sortKeys(["rank"]).queryField("listPublishedCategoriesByParentKeyAndRank"),
|
|
2626
2652
|
index("categoryKey").sortKeys(["publishedCategorySetId"]).queryField("listPublishedCategoriesByKeyAndSet"),
|
|
2653
|
+
index("tenantId").sortKeys(["id"]).queryField("listPublishedCategoriesByTenant"),
|
|
2627
2654
|
])
|
|
2628
2655
|
.authorization((allow) => [
|
|
2629
2656
|
allow.guest().to(["read"]),
|
|
@@ -2684,6 +2711,41 @@ function buildBaseDefinitions(excludedGroups = []) {
|
|
|
2684
2711
|
allow.group(adminGroup),
|
|
2685
2712
|
allow.ownerDefinedIn("tenantId").identityClaim("papyrus_tenant_admin").to(["read"]),
|
|
2686
2713
|
]),
|
|
2714
|
+
/** The catalogue row of one site document (kind: site | brand | nav); id = "<tenant>#<kind>". The body lives in S3 (PPY-c020ce). Group "tenancy". */
|
|
2715
|
+
SiteDocument: modelWithoutSubscriptions({
|
|
2716
|
+
id: a.id().required(),
|
|
2717
|
+
tenantId: a.string().required(),
|
|
2718
|
+
kind: a.string().required(),
|
|
2719
|
+
currentVersion: a.integer().required(),
|
|
2720
|
+
s3Key: a.string().required(),
|
|
2721
|
+
sha256: a.string().required(),
|
|
2722
|
+
schemaVersion: a.integer().required(),
|
|
2723
|
+
updatedBy: a.string(),
|
|
2724
|
+
updatedAt: a.datetime().required(),
|
|
2725
|
+
})
|
|
2726
|
+
.authorization((allow) => [
|
|
2727
|
+
allow.group(adminGroup),
|
|
2728
|
+
allow.ownerDefinedIn("tenantId").identityClaim("papyrus_tenant_admin").to(["read"]),
|
|
2729
|
+
]),
|
|
2730
|
+
/** One saved version of a site document; id = "<tenant>#<kind>#<version>". Body in S3 (PPY-c020ce). Group "tenancy". */
|
|
2731
|
+
SiteDocumentVersion: modelWithoutSubscriptions({
|
|
2732
|
+
id: a.id().required(),
|
|
2733
|
+
tenantId: a.string().required(),
|
|
2734
|
+
documentId: a.string().required(),
|
|
2735
|
+
version: a.integer().required(),
|
|
2736
|
+
s3Key: a.string().required(),
|
|
2737
|
+
sha256: a.string().required(),
|
|
2738
|
+
createdBy: a.string(),
|
|
2739
|
+
createdAt: a.datetime().required(),
|
|
2740
|
+
note: a.string(),
|
|
2741
|
+
})
|
|
2742
|
+
.secondaryIndexes((index) => [
|
|
2743
|
+
index("documentId").sortKeys(["version"]).queryField("listSiteDocumentVersionsByDocument"),
|
|
2744
|
+
])
|
|
2745
|
+
.authorization((allow) => [
|
|
2746
|
+
allow.group(adminGroup),
|
|
2747
|
+
allow.ownerDefinedIn("tenantId").identityClaim("papyrus_tenant_admin").to(["read"]),
|
|
2748
|
+
]),
|
|
2687
2749
|
...editorialChecksSchemaDefinitions,
|
|
2688
2750
|
...monitoringViewSchemaDefinitions,
|
|
2689
2751
|
...automationViewSchemaDefinitions,
|
package/amplify/data/schema.ts
CHANGED
|
@@ -52,7 +52,8 @@ export const OPTIONAL_MODEL_GROUPS = {
|
|
|
52
52
|
editorial: ["EditorialCheckRun", "EditorialFeedback", "EditorialPolicy", "EditorialCheckSettings"],
|
|
53
53
|
steering: ["SteeringProposal", "SteeringDecision", "LexicalSteeringRule"],
|
|
54
54
|
variations: ["StoryVariation"],
|
|
55
|
-
tenancy: ["Tenant", "TenantMembership", "TenantDomain"],
|
|
55
|
+
tenancy: ["Tenant", "TenantMembership", "TenantDomain", "SiteDocument", "SiteDocumentVersion"],
|
|
56
|
+
localization: ["LocalizationRequest"],
|
|
56
57
|
} as const;
|
|
57
58
|
|
|
58
59
|
/**
|
|
@@ -1541,6 +1542,9 @@ const definitions = {
|
|
|
1541
1542
|
updatedBy: a.string(),
|
|
1542
1543
|
updatedAt: a.datetime().required(),
|
|
1543
1544
|
})
|
|
1545
|
+
.secondaryIndexes((index) => [
|
|
1546
|
+
index("tenantId").sortKeys(["id"]).queryField("listAutomationsByTenant"),
|
|
1547
|
+
])
|
|
1544
1548
|
.authorization((allow) => [
|
|
1545
1549
|
allow.group("editor").to(["read", "create", "update"]),
|
|
1546
1550
|
allow.group(adminGroup).to(authoringOperations),
|
|
@@ -1564,6 +1568,9 @@ const definitions = {
|
|
|
1564
1568
|
appliedIn: a.json(),
|
|
1565
1569
|
updatedAt: a.datetime().required(),
|
|
1566
1570
|
})
|
|
1571
|
+
.secondaryIndexes((index) => [
|
|
1572
|
+
index("tenantId").sortKeys(["id"]).queryField("listReviewRequestsByTenant"),
|
|
1573
|
+
])
|
|
1567
1574
|
.authorization((allow) => [
|
|
1568
1575
|
allow.group("editor").to(["read", "create", "update"]),
|
|
1569
1576
|
allow.group(adminGroup).to(authoringOperations),
|
|
@@ -1577,6 +1584,9 @@ const definitions = {
|
|
|
1577
1584
|
userKey: a.string().required(),
|
|
1578
1585
|
readAt: a.datetime().required(),
|
|
1579
1586
|
})
|
|
1587
|
+
.secondaryIndexes((index) => [
|
|
1588
|
+
index("tenantId").sortKeys(["id"]).queryField("listReviewReadMarksByTenant"),
|
|
1589
|
+
])
|
|
1580
1590
|
.authorization((allow) => [
|
|
1581
1591
|
allow.groups(["editor", adminGroup]).to(["read", "create", "update"]),
|
|
1582
1592
|
]),
|
|
@@ -1610,6 +1620,7 @@ const definitions = {
|
|
|
1610
1620
|
})
|
|
1611
1621
|
.secondaryIndexes((index) => [
|
|
1612
1622
|
index("storyLineageId").sortKeys(["variationNumber"]).queryField("listStoryVariationsByStoryAndNumber"),
|
|
1623
|
+
index("tenantId").sortKeys(["id"]).queryField("listStoryVariationsByTenant"),
|
|
1613
1624
|
])
|
|
1614
1625
|
.authorization((allow) => [
|
|
1615
1626
|
allow.groups(contentWriteGroups).to(["read", "create", "update"]),
|
|
@@ -1626,6 +1637,9 @@ const definitions = {
|
|
|
1626
1637
|
updatedBy: a.string(),
|
|
1627
1638
|
updatedAt: a.datetime().required(),
|
|
1628
1639
|
})
|
|
1640
|
+
.secondaryIndexes((index) => [
|
|
1641
|
+
index("tenantId").sortKeys(["id"]).queryField("listReviewRecipientRulesByTenant"),
|
|
1642
|
+
])
|
|
1629
1643
|
.authorization((allow) => [
|
|
1630
1644
|
allow.group("editor").to(["read"]),
|
|
1631
1645
|
allow.group(adminGroup).to(authoringOperations),
|
|
@@ -1721,6 +1735,7 @@ const definitions = {
|
|
|
1721
1735
|
.secondaryIndexes((index) => [
|
|
1722
1736
|
index("ownerId").sortKeys(["payloadKind"]).queryField("listKnowledgeRawPayloadsByOwnerAndKind"),
|
|
1723
1737
|
index("importRunId").sortKeys(["ownerType"]).queryField("listKnowledgeRawPayloadsByImportRunAndOwner"),
|
|
1738
|
+
index("tenantId").sortKeys(["id"]).queryField("listKnowledgeRawPayloadsByTenant"),
|
|
1724
1739
|
])
|
|
1725
1740
|
.authorization((allow) => [
|
|
1726
1741
|
allow.groups(categoryWriteGroups),
|
|
@@ -1739,6 +1754,7 @@ const definitions = {
|
|
|
1739
1754
|
})
|
|
1740
1755
|
.secondaryIndexes((index) => [
|
|
1741
1756
|
index("grantorSub").sortKeys(["createdAt"]).queryField("listCurationDelegationRecordsByGrantor"),
|
|
1757
|
+
index("tenantId").sortKeys(["id"]).queryField("listCurationDelegationRecordsByTenant"),
|
|
1742
1758
|
])
|
|
1743
1759
|
.authorization((allow) => [allow.groups([adminGroup]).to(["read"])]),
|
|
1744
1760
|
|
|
@@ -1858,6 +1874,7 @@ const definitions = {
|
|
|
1858
1874
|
index("categoryKey").sortKeys(["rank"]).queryField("listCategoryKeywordsByCategoryKeyAndRank"),
|
|
1859
1875
|
index("normalizedKeyword").sortKeys(["categorySetId"]).queryField("listCategoryKeywordsByNormalizedKeywordAndSet"),
|
|
1860
1876
|
index("importRunId").sortKeys(["rank"]).queryField("listCategoryKeywordsByImportRunAndRank"),
|
|
1877
|
+
index("tenantId").sortKeys(["id"]).queryField("listCategoryKeywordsByTenant"),
|
|
1861
1878
|
])
|
|
1862
1879
|
.authorization((allow) => [
|
|
1863
1880
|
allow.groups(categoryWriteGroups),
|
|
@@ -1945,6 +1962,7 @@ const definitions = {
|
|
|
1945
1962
|
.secondaryIndexes((index) => [
|
|
1946
1963
|
index("proposalId").sortKeys(["createdAt"]).queryField("listSteeringDecisionsByProposalAndCreatedAt"),
|
|
1947
1964
|
index("categorySetId").sortKeys(["createdAt"]).queryField("listSteeringDecisionsBySetAndCreatedAt"),
|
|
1965
|
+
index("tenantId").sortKeys(["id"]).queryField("listSteeringDecisionsByTenant"),
|
|
1948
1966
|
])
|
|
1949
1967
|
.authorization((allow) => [
|
|
1950
1968
|
allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
|
|
@@ -2103,6 +2121,7 @@ const definitions = {
|
|
|
2103
2121
|
index("referenceLineageId").sortKeys(["sortKey"]).queryField("listReferenceAttachmentsByReferenceLineageAndSortKey"),
|
|
2104
2122
|
index("storagePath").queryField("referenceAttachmentByStoragePath"),
|
|
2105
2123
|
index("importRunId").sortKeys(["sortKey"]).queryField("listReferenceAttachmentsByImportRunAndSortKey"),
|
|
2124
|
+
index("tenantId").sortKeys(["id"]).queryField("listReferenceAttachmentsByTenant"),
|
|
2106
2125
|
])
|
|
2107
2126
|
.authorization((allow) => [
|
|
2108
2127
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
@@ -2148,6 +2167,7 @@ const definitions = {
|
|
|
2148
2167
|
index("corpusId").sortKeys(["nodeKey"]).queryField("listSemanticNodesByCorpusAndNodeKey"),
|
|
2149
2168
|
index("importRunId").sortKeys(["nodeKey"]).queryField("listSemanticNodesByImportRunAndNodeKey"),
|
|
2150
2169
|
index("versionState").sortKeys(["updatedAt"]).queryField("listSemanticNodesByVersionStateAndUpdatedAt"),
|
|
2170
|
+
index("tenantId").sortKeys(["id"]).queryField("listSemanticNodesByTenant"),
|
|
2151
2171
|
])
|
|
2152
2172
|
.authorization((allow) => [
|
|
2153
2173
|
allow.groups(categoryWriteGroups).to(["read"]),
|
|
@@ -2357,6 +2377,7 @@ const definitions = {
|
|
|
2357
2377
|
index("importRunId").sortKeys(["importedAt"]).queryField("listSemanticRelationsByImportRunAndImportedAt"),
|
|
2358
2378
|
index("relationTypeKey").sortKeys(["importedAt"]).queryField("listSemanticRelationsByTypeAndImportedAt"),
|
|
2359
2379
|
index("relationDomain").sortKeys(["importedAt"]).queryField("listSemanticRelationsByDomainAndImportedAt"),
|
|
2380
|
+
index("tenantId").sortKeys(["id"]).queryField("listSemanticRelationsByTenant"),
|
|
2360
2381
|
])
|
|
2361
2382
|
.authorization((allow) => [
|
|
2362
2383
|
allow.groups(categoryWriteGroups).to(categoryAppendOnlyOperations),
|
|
@@ -2484,6 +2505,7 @@ const definitions = {
|
|
|
2484
2505
|
.secondaryIndexes((index) => [
|
|
2485
2506
|
index("slug").queryField("tagBySlug"),
|
|
2486
2507
|
index("type").sortKeys(["label"]).queryField("listTagsByTypeAndLabel"),
|
|
2508
|
+
index("tenantId").sortKeys(["id"]).queryField("listTagsByTenant"),
|
|
2487
2509
|
])
|
|
2488
2510
|
.authorization((allow) => [
|
|
2489
2511
|
allow.groups(contentWriteGroups),
|
|
@@ -2504,6 +2526,7 @@ const definitions = {
|
|
|
2504
2526
|
.secondaryIndexes((index) => [
|
|
2505
2527
|
index("itemId").sortKeys(["tagSlug"]).queryField("listItemTagsByItemAndTag"),
|
|
2506
2528
|
index("tagId").sortKeys(["publishedAt"]).queryField("listItemTagsByTagAndPublishedAt"),
|
|
2529
|
+
index("tenantId").sortKeys(["id"]).queryField("listItemTagsByTenant"),
|
|
2507
2530
|
])
|
|
2508
2531
|
.authorization((allow) => [
|
|
2509
2532
|
allow.groups(contentWriteGroups),
|
|
@@ -2592,6 +2615,7 @@ const definitions = {
|
|
|
2592
2615
|
.secondaryIndexes((index) => [
|
|
2593
2616
|
index("editionId").sortKeys(["sortKey"]).queryField("listEditionItemsByEditionAndSortKey"),
|
|
2594
2617
|
index("itemId").sortKeys(["editionId"]).queryField("listEditionItemsByItemAndEdition"),
|
|
2618
|
+
index("tenantId").sortKeys(["id"]).queryField("listEditionItemsByTenant"),
|
|
2595
2619
|
])
|
|
2596
2620
|
.authorization((allow) => [
|
|
2597
2621
|
allow.groups(contentWriteGroups),
|
|
@@ -2641,6 +2665,7 @@ const definitions = {
|
|
|
2641
2665
|
index("typeStatus").sortKeys(["publishedAt"]).queryField("listPublishedItemsByTypeStatusAndPublishedAt"),
|
|
2642
2666
|
index("sectionStatus").sortKeys(["publishedAt"]).queryField("listPublishedItemsBySectionStatusAndPublishedAt"),
|
|
2643
2667
|
index("itemLineageId").sortKeys(["versionNumber"]).queryField("listPublishedItemsByLineageAndVersion"),
|
|
2668
|
+
index("tenantId").sortKeys(["id"]).queryField("listPublishedItemsByTenant"),
|
|
2644
2669
|
])
|
|
2645
2670
|
.authorization((allow) => [
|
|
2646
2671
|
allow.guest().to(["read"]),
|
|
@@ -2728,6 +2753,7 @@ const definitions = {
|
|
|
2728
2753
|
.secondaryIndexes((index) => [
|
|
2729
2754
|
index("publishedEditionId").sortKeys(["sortKey"]).queryField("listPublishedEditionItemsByEditionAndSortKey"),
|
|
2730
2755
|
index("publishedItemId").sortKeys(["publishedEditionId"]).queryField("listPublishedEditionItemsByItemAndEdition"),
|
|
2756
|
+
index("tenantId").sortKeys(["id"]).queryField("listPublishedEditionItemsByTenant"),
|
|
2731
2757
|
])
|
|
2732
2758
|
.authorization((allow) => [
|
|
2733
2759
|
allow.guest().to(["read"]),
|
|
@@ -2790,6 +2816,7 @@ const definitions = {
|
|
|
2790
2816
|
index("parentCategoryId").sortKeys(["rank"]).queryField("listPublishedCategoriesByParentAndRank"),
|
|
2791
2817
|
index("parentCategoryKey").sortKeys(["rank"]).queryField("listPublishedCategoriesByParentKeyAndRank"),
|
|
2792
2818
|
index("categoryKey").sortKeys(["publishedCategorySetId"]).queryField("listPublishedCategoriesByKeyAndSet"),
|
|
2819
|
+
index("tenantId").sortKeys(["id"]).queryField("listPublishedCategoriesByTenant"),
|
|
2793
2820
|
])
|
|
2794
2821
|
.authorization((allow) => [
|
|
2795
2822
|
allow.guest().to(["read"]),
|
|
@@ -2853,6 +2880,43 @@ const definitions = {
|
|
|
2853
2880
|
allow.ownerDefinedIn("tenantId").identityClaim("papyrus_tenant_admin").to(["read"]),
|
|
2854
2881
|
]),
|
|
2855
2882
|
|
|
2883
|
+
/** The catalogue row of one site document (kind: site | brand | nav); id = "<tenant>#<kind>". The body lives in S3 (PPY-c020ce). Group "tenancy". */
|
|
2884
|
+
SiteDocument: modelWithoutSubscriptions({
|
|
2885
|
+
id: a.id().required(),
|
|
2886
|
+
tenantId: a.string().required(),
|
|
2887
|
+
kind: a.string().required(),
|
|
2888
|
+
currentVersion: a.integer().required(),
|
|
2889
|
+
s3Key: a.string().required(),
|
|
2890
|
+
sha256: a.string().required(),
|
|
2891
|
+
schemaVersion: a.integer().required(),
|
|
2892
|
+
updatedBy: a.string(),
|
|
2893
|
+
updatedAt: a.datetime().required(),
|
|
2894
|
+
})
|
|
2895
|
+
.authorization((allow) => [
|
|
2896
|
+
allow.group(adminGroup),
|
|
2897
|
+
allow.ownerDefinedIn("tenantId").identityClaim("papyrus_tenant_admin").to(["read"]),
|
|
2898
|
+
]),
|
|
2899
|
+
|
|
2900
|
+
/** One saved version of a site document; id = "<tenant>#<kind>#<version>". Body in S3 (PPY-c020ce). Group "tenancy". */
|
|
2901
|
+
SiteDocumentVersion: modelWithoutSubscriptions({
|
|
2902
|
+
id: a.id().required(),
|
|
2903
|
+
tenantId: a.string().required(),
|
|
2904
|
+
documentId: a.string().required(),
|
|
2905
|
+
version: a.integer().required(),
|
|
2906
|
+
s3Key: a.string().required(),
|
|
2907
|
+
sha256: a.string().required(),
|
|
2908
|
+
createdBy: a.string(),
|
|
2909
|
+
createdAt: a.datetime().required(),
|
|
2910
|
+
note: a.string(),
|
|
2911
|
+
})
|
|
2912
|
+
.secondaryIndexes((index) => [
|
|
2913
|
+
index("documentId").sortKeys(["version"]).queryField("listSiteDocumentVersionsByDocument"),
|
|
2914
|
+
])
|
|
2915
|
+
.authorization((allow) => [
|
|
2916
|
+
allow.group(adminGroup),
|
|
2917
|
+
allow.ownerDefinedIn("tenantId").identityClaim("papyrus_tenant_admin").to(["read"]),
|
|
2918
|
+
]),
|
|
2919
|
+
|
|
2856
2920
|
...editorialChecksSchemaDefinitions,
|
|
2857
2921
|
...monitoringViewSchemaDefinitions,
|
|
2858
2922
|
...automationViewSchemaDefinitions,
|
|
@@ -43,6 +43,7 @@ from papyrus_content.story_schedule import TASK_NAME as PUBLISH_SCHEDULED_TASK,
|
|
|
43
43
|
from papyrus_content.live_schema import wait_for_live_schema
|
|
44
44
|
from papyrus_content.publication import ensure_publication_from_environment
|
|
45
45
|
from papyrus_content.editorial_checks import GraphQLEditorialStore, ensure_default_policies
|
|
46
|
+
from papyrus_content.item_language_backfill import ensure_item_languages
|
|
46
47
|
from papyrus_content.reference_intake import IntakeError, intake_email_submission_references, intake_references
|
|
47
48
|
from papyrus_content.publish_alerts import PUBLISHED_TASK_KEY, announce_published
|
|
48
49
|
from papyrus_content.publishing import (
|
|
@@ -52,6 +53,7 @@ from papyrus_content.publishing import (
|
|
|
52
53
|
published_item_id_for,
|
|
53
54
|
save_item,
|
|
54
55
|
unpublish_item,
|
|
56
|
+
utc_now_iso,
|
|
55
57
|
)
|
|
56
58
|
|
|
57
59
|
|
|
@@ -373,8 +375,10 @@ def ensure_default_editorial_policies(client) -> None:
|
|
|
373
375
|
def run_deploy_render_task(client) -> dict:
|
|
374
376
|
"""Render every published page after a backend deploy, then report drift (a dry run: nothing is deleted)."""
|
|
375
377
|
ensure_publication_from_environment(client)
|
|
376
|
-
ensure_default_editorial_policies(client)
|
|
377
378
|
context = projection_context(client)
|
|
379
|
+
# Before anything reads a language (the render, the editorial policies' checks): rows written before the fields get them, once per site.
|
|
380
|
+
print(json.dumps(ensure_item_languages(client, context.writer, now=utc_now_iso, echo=lambda line: None)))
|
|
381
|
+
ensure_default_editorial_policies(client)
|
|
378
382
|
if targeted_invalidation(os.environ):
|
|
379
383
|
context.invalidate = None # the default, "targeted": a deploy never purges; pages age out with the HTML lifetime (PPY-2745c1)
|
|
380
384
|
report = deploy_render(context)
|
|
@@ -28,6 +28,7 @@ export const editorialChecksSchemaDefinitions = {
|
|
|
28
28
|
source: a.string().required(),
|
|
29
29
|
})
|
|
30
30
|
.disableOperations(["subscriptions"])
|
|
31
|
+
.secondaryIndexes((index) => [index("tenantId").sortKeys(["id"]).queryField("listEditorialPoliciesByTenant")])
|
|
31
32
|
.authorization((allow) => [allow.group("editor").to(["read"]), allow.group("admin")]),
|
|
32
33
|
EditorialCheckSettings: a
|
|
33
34
|
.model({
|
|
@@ -36,6 +37,7 @@ export const editorialChecksSchemaDefinitions = {
|
|
|
36
37
|
settings: a.json().required(),
|
|
37
38
|
})
|
|
38
39
|
.disableOperations(["subscriptions"])
|
|
40
|
+
.secondaryIndexes((index) => [index("tenantId").sortKeys(["id"]).queryField("listEditorialCheckSettingsByTenant")])
|
|
39
41
|
.authorization((allow) => [allow.group("editor").to(["read"]), allow.group("admin")]),
|
|
40
42
|
EditorialFeedback: a
|
|
41
43
|
.model({
|
|
@@ -52,7 +54,10 @@ export const editorialChecksSchemaDefinitions = {
|
|
|
52
54
|
text: a.string(),
|
|
53
55
|
})
|
|
54
56
|
.disableOperations(["subscriptions"])
|
|
55
|
-
.secondaryIndexes((index) => [
|
|
57
|
+
.secondaryIndexes((index) => [
|
|
58
|
+
index("itemId").queryField("listEditorialFeedbackByItem"),
|
|
59
|
+
index("tenantId").sortKeys(["id"]).queryField("listEditorialFeedbackByTenant"),
|
|
60
|
+
])
|
|
56
61
|
.authorization((allow) => [allow.group("editor").to(["create", "read"]), allow.group("admin")]),
|
|
57
62
|
EditorialCheckRun: a
|
|
58
63
|
.model({
|
|
@@ -71,7 +76,10 @@ export const editorialChecksSchemaDefinitions = {
|
|
|
71
76
|
checkedAt: a.datetime().required(),
|
|
72
77
|
})
|
|
73
78
|
.disableOperations(["subscriptions"])
|
|
74
|
-
.secondaryIndexes((index) => [
|
|
79
|
+
.secondaryIndexes((index) => [
|
|
80
|
+
index("lineageId").sortKeys(["versionNumber"]).queryField("listEditorialCheckRunsByLineage"),
|
|
81
|
+
index("tenantId").sortKeys(["id"]).queryField("listEditorialCheckRunsByTenant"),
|
|
82
|
+
])
|
|
75
83
|
.authorization((allow) => [allow.group("editor").to(["read"]), allow.group("admin")]),
|
|
76
84
|
listEditorialStarterPacks: a
|
|
77
85
|
.query()
|
|
@@ -30,6 +30,7 @@ export const editorialChecksSchemaDefinitions = {
|
|
|
30
30
|
source: a.string().required(),
|
|
31
31
|
})
|
|
32
32
|
.disableOperations(["subscriptions"])
|
|
33
|
+
.secondaryIndexes((index) => [index("tenantId").sortKeys(["id"]).queryField("listEditorialPoliciesByTenant")])
|
|
33
34
|
.authorization((allow) => [allow.group("editor").to(["read"]), allow.group("admin")]),
|
|
34
35
|
EditorialCheckSettings: a
|
|
35
36
|
.model({
|
|
@@ -38,6 +39,7 @@ export const editorialChecksSchemaDefinitions = {
|
|
|
38
39
|
settings: a.json().required(),
|
|
39
40
|
})
|
|
40
41
|
.disableOperations(["subscriptions"])
|
|
42
|
+
.secondaryIndexes((index) => [index("tenantId").sortKeys(["id"]).queryField("listEditorialCheckSettingsByTenant")])
|
|
41
43
|
.authorization((allow) => [allow.group("editor").to(["read"]), allow.group("admin")]),
|
|
42
44
|
EditorialFeedback: a
|
|
43
45
|
.model({
|
|
@@ -54,7 +56,10 @@ export const editorialChecksSchemaDefinitions = {
|
|
|
54
56
|
text: a.string(),
|
|
55
57
|
})
|
|
56
58
|
.disableOperations(["subscriptions"])
|
|
57
|
-
.secondaryIndexes((index) => [
|
|
59
|
+
.secondaryIndexes((index) => [
|
|
60
|
+
index("itemId").queryField("listEditorialFeedbackByItem"),
|
|
61
|
+
index("tenantId").sortKeys(["id"]).queryField("listEditorialFeedbackByTenant"),
|
|
62
|
+
])
|
|
58
63
|
.authorization((allow) => [allow.group("editor").to(["create", "read"]), allow.group("admin")]),
|
|
59
64
|
EditorialCheckRun: a
|
|
60
65
|
.model({
|
|
@@ -73,7 +78,10 @@ export const editorialChecksSchemaDefinitions = {
|
|
|
73
78
|
checkedAt: a.datetime().required(),
|
|
74
79
|
})
|
|
75
80
|
.disableOperations(["subscriptions"])
|
|
76
|
-
.secondaryIndexes((index) => [
|
|
81
|
+
.secondaryIndexes((index) => [
|
|
82
|
+
index("lineageId").sortKeys(["versionNumber"]).queryField("listEditorialCheckRunsByLineage"),
|
|
83
|
+
index("tenantId").sortKeys(["id"]).queryField("listEditorialCheckRunsByTenant"),
|
|
84
|
+
])
|
|
77
85
|
.authorization((allow) => [allow.group("editor").to(["read"]), allow.group("admin")]),
|
|
78
86
|
listEditorialStarterPacks: a
|
|
79
87
|
.query()
|
|
@@ -21,7 +21,10 @@ export function readerSteeringSchemaDefinitions() {
|
|
|
21
21
|
karma: a.integer(),
|
|
22
22
|
})
|
|
23
23
|
.disableOperations(["subscriptions"])
|
|
24
|
-
.secondaryIndexes((index) => [
|
|
24
|
+
.secondaryIndexes((index) => [
|
|
25
|
+
index("readerId").name("profilesByReader").queryField("listReaderProfilesByReader"),
|
|
26
|
+
index("tenantId").sortKeys(["id"]).name("profilesByTenant").queryField("listReaderProfilesByTenant"),
|
|
27
|
+
])
|
|
25
28
|
.authorization(staffOnly),
|
|
26
29
|
ReaderHandle: a
|
|
27
30
|
.model({
|
|
@@ -30,6 +33,7 @@ export function readerSteeringSchemaDefinitions() {
|
|
|
30
33
|
readerId: a.string().required(),
|
|
31
34
|
})
|
|
32
35
|
.disableOperations(["subscriptions"])
|
|
36
|
+
.secondaryIndexes((index) => [index("tenantId").sortKeys(["id"]).name("handlesByTenant").queryField("listReaderHandlesByTenant")])
|
|
33
37
|
.authorization(staffOnly),
|
|
34
38
|
ReaderVote: a
|
|
35
39
|
.model({
|
|
@@ -43,6 +47,7 @@ export function readerSteeringSchemaDefinitions() {
|
|
|
43
47
|
voterRole: a.string().required(),
|
|
44
48
|
})
|
|
45
49
|
.disableOperations(["subscriptions"])
|
|
50
|
+
.secondaryIndexes((index) => [index("tenantId").sortKeys(["id"]).name("votesByTenant").queryField("listReaderVotesByTenant")])
|
|
46
51
|
.authorization(staffOnly),
|
|
47
52
|
ReaderFlag: a
|
|
48
53
|
.model({
|
|
@@ -59,6 +64,7 @@ export function readerSteeringSchemaDefinitions() {
|
|
|
59
64
|
createdAt: a.datetime().required(),
|
|
60
65
|
})
|
|
61
66
|
.disableOperations(["subscriptions"])
|
|
67
|
+
.secondaryIndexes((index) => [index("tenantId").sortKeys(["id"]).name("flagsByTenant").queryField("listReaderFlagsByTenant")])
|
|
62
68
|
.authorization(staffOnly),
|
|
63
69
|
ReaderComment: a
|
|
64
70
|
.model({
|
|
@@ -125,7 +131,10 @@ export function readerSteeringSchemaDefinitions() {
|
|
|
125
131
|
createdAt: a.datetime().required(),
|
|
126
132
|
})
|
|
127
133
|
.disableOperations(["subscriptions"])
|
|
128
|
-
.secondaryIndexes((index) => [
|
|
134
|
+
.secondaryIndexes((index) => [
|
|
135
|
+
index("target").sortKeys(["createdAt"]).name("reportsByTarget").queryField("listReaderReportsByTargetAndCreatedAt"),
|
|
136
|
+
index("tenantId").sortKeys(["id"]).name("reportsByTenant").queryField("listReaderReportsByTenant"),
|
|
137
|
+
])
|
|
129
138
|
.authorization(staffOnly),
|
|
130
139
|
ModerationAction: a
|
|
131
140
|
.model({
|
|
@@ -146,7 +155,10 @@ export function readerSteeringSchemaDefinitions() {
|
|
|
146
155
|
at: a.datetime().required(),
|
|
147
156
|
})
|
|
148
157
|
.disableOperations(["subscriptions"])
|
|
149
|
-
.secondaryIndexes((index) => [
|
|
158
|
+
.secondaryIndexes((index) => [
|
|
159
|
+
index("target").sortKeys(["at"]).name("actionsByTarget").queryField("listModerationActionsByTargetAndAt"),
|
|
160
|
+
index("tenantId").sortKeys(["id"]).name("actionsByTenant").queryField("listModerationActionsByTenant"),
|
|
161
|
+
])
|
|
150
162
|
.authorization(staffOnly),
|
|
151
163
|
ModerationReceipt: a.customType({
|
|
152
164
|
status: a.string().required(),
|
|
@@ -23,7 +23,10 @@ export function readerSteeringSchemaDefinitions() {
|
|
|
23
23
|
karma: a.integer(),
|
|
24
24
|
})
|
|
25
25
|
.disableOperations(["subscriptions"])
|
|
26
|
-
.secondaryIndexes((index) => [
|
|
26
|
+
.secondaryIndexes((index) => [
|
|
27
|
+
index("readerId").name("profilesByReader").queryField("listReaderProfilesByReader"),
|
|
28
|
+
index("tenantId").sortKeys(["id"]).name("profilesByTenant").queryField("listReaderProfilesByTenant"),
|
|
29
|
+
])
|
|
27
30
|
.authorization(staffOnly),
|
|
28
31
|
ReaderHandle: a
|
|
29
32
|
.model({
|
|
@@ -32,6 +35,7 @@ export function readerSteeringSchemaDefinitions() {
|
|
|
32
35
|
readerId: a.string().required(),
|
|
33
36
|
})
|
|
34
37
|
.disableOperations(["subscriptions"])
|
|
38
|
+
.secondaryIndexes((index) => [index("tenantId").sortKeys(["id"]).name("handlesByTenant").queryField("listReaderHandlesByTenant")])
|
|
35
39
|
.authorization(staffOnly),
|
|
36
40
|
ReaderVote: a
|
|
37
41
|
.model({
|
|
@@ -45,6 +49,7 @@ export function readerSteeringSchemaDefinitions() {
|
|
|
45
49
|
voterRole: a.string().required(),
|
|
46
50
|
})
|
|
47
51
|
.disableOperations(["subscriptions"])
|
|
52
|
+
.secondaryIndexes((index) => [index("tenantId").sortKeys(["id"]).name("votesByTenant").queryField("listReaderVotesByTenant")])
|
|
48
53
|
.authorization(staffOnly),
|
|
49
54
|
ReaderFlag: a
|
|
50
55
|
.model({
|
|
@@ -61,6 +66,7 @@ export function readerSteeringSchemaDefinitions() {
|
|
|
61
66
|
createdAt: a.datetime().required(),
|
|
62
67
|
})
|
|
63
68
|
.disableOperations(["subscriptions"])
|
|
69
|
+
.secondaryIndexes((index) => [index("tenantId").sortKeys(["id"]).name("flagsByTenant").queryField("listReaderFlagsByTenant")])
|
|
64
70
|
.authorization(staffOnly),
|
|
65
71
|
ReaderComment: a
|
|
66
72
|
.model({
|
|
@@ -127,7 +133,10 @@ export function readerSteeringSchemaDefinitions() {
|
|
|
127
133
|
createdAt: a.datetime().required(),
|
|
128
134
|
})
|
|
129
135
|
.disableOperations(["subscriptions"])
|
|
130
|
-
.secondaryIndexes((index) => [
|
|
136
|
+
.secondaryIndexes((index) => [
|
|
137
|
+
index("target").sortKeys(["createdAt"]).name("reportsByTarget").queryField("listReaderReportsByTargetAndCreatedAt"),
|
|
138
|
+
index("tenantId").sortKeys(["id"]).name("reportsByTenant").queryField("listReaderReportsByTenant"),
|
|
139
|
+
])
|
|
131
140
|
.authorization(staffOnly),
|
|
132
141
|
ModerationAction: a
|
|
133
142
|
.model({
|
|
@@ -148,7 +157,10 @@ export function readerSteeringSchemaDefinitions() {
|
|
|
148
157
|
at: a.datetime().required(),
|
|
149
158
|
})
|
|
150
159
|
.disableOperations(["subscriptions"])
|
|
151
|
-
.secondaryIndexes((index) => [
|
|
160
|
+
.secondaryIndexes((index) => [
|
|
161
|
+
index("target").sortKeys(["at"]).name("actionsByTarget").queryField("listModerationActionsByTargetAndAt"),
|
|
162
|
+
index("tenantId").sortKeys(["id"]).name("actionsByTenant").queryField("listModerationActionsByTenant"),
|
|
163
|
+
])
|
|
152
164
|
.authorization(staffOnly),
|
|
153
165
|
ModerationReceipt: a.customType({
|
|
154
166
|
status: a.string().required(),
|
|
@@ -18,6 +18,7 @@ export function signupSchemaDefinitions() {
|
|
|
18
18
|
.disableOperations(["subscriptions"])
|
|
19
19
|
.secondaryIndexes((index) => [
|
|
20
20
|
index("form").sortKeys(["submittedAt"]).queryField("listSignupEntriesByFormAndSubmittedAt"),
|
|
21
|
+
index("tenantId").sortKeys(["id"]).queryField("listSignupEntriesByTenant"),
|
|
21
22
|
])
|
|
22
23
|
.authorization((allow) => [
|
|
23
24
|
allow.group("editor").to(["read"]),
|
|
@@ -19,6 +19,7 @@ export function signupSchemaDefinitions() {
|
|
|
19
19
|
.disableOperations(["subscriptions"])
|
|
20
20
|
.secondaryIndexes((index) => [
|
|
21
21
|
index("form").sortKeys(["submittedAt"]).queryField("listSignupEntriesByFormAndSubmittedAt"),
|
|
22
|
+
index("tenantId").sortKeys(["id"]).queryField("listSignupEntriesByTenant"),
|
|
22
23
|
])
|
|
23
24
|
.authorization((allow) => [
|
|
24
25
|
allow.group("editor").to(["read"]),
|
package/package.json
CHANGED
package/routes.manifest.json
CHANGED