@anthusai/papyrus 1.2.0-next.3 → 1.2.0-next.4
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.
|
@@ -2194,6 +2194,62 @@ export async function loadNewsroomContentItemVersions(): Promise<ContentItemVers
|
|
|
2194
2194
|
return versionsPerStage.flat();
|
|
2195
2195
|
}
|
|
2196
2196
|
|
|
2197
|
+
const PUBLISHED_ITEMS_QUERY = `
|
|
2198
|
+
query ListPublishedItems($limit: Int, $nextToken: String) {
|
|
2199
|
+
listPublishedItems(limit: $limit, nextToken: $nextToken) {
|
|
2200
|
+
items { sourceItemId itemLineageId versionNumber type status title headline slug section publishedAt }
|
|
2201
|
+
nextToken
|
|
2202
|
+
}
|
|
2203
|
+
}
|
|
2204
|
+
`;
|
|
2205
|
+
|
|
2206
|
+
type PublishedItemBoardRow = {
|
|
2207
|
+
sourceItemId: string;
|
|
2208
|
+
itemLineageId: string;
|
|
2209
|
+
versionNumber: number;
|
|
2210
|
+
type: string;
|
|
2211
|
+
status: string;
|
|
2212
|
+
title?: string | null;
|
|
2213
|
+
headline?: string | null;
|
|
2214
|
+
slug: string;
|
|
2215
|
+
section?: string | null;
|
|
2216
|
+
publishedAt?: string | null;
|
|
2217
|
+
};
|
|
2218
|
+
|
|
2219
|
+
export async function loadNewsroomPublishedContentItemVersions(): Promise<ContentItemVersionRecord[]> {
|
|
2220
|
+
configureAmplifyClient();
|
|
2221
|
+
const client = generateClient<Schema>() as unknown as {
|
|
2222
|
+
graphql: (options: Record<string, unknown>) => Promise<GraphQLConnectionResponse<PublishedItemBoardRow>>;
|
|
2223
|
+
};
|
|
2224
|
+
const rows: PublishedItemBoardRow[] = [];
|
|
2225
|
+
let nextToken: string | null = null;
|
|
2226
|
+
do {
|
|
2227
|
+
const response: GraphQLConnectionResponse<PublishedItemBoardRow> = await client.graphql({
|
|
2228
|
+
query: PUBLISHED_ITEMS_QUERY,
|
|
2229
|
+
variables: { limit: NEWSROOM_PAGE_LIMIT, nextToken },
|
|
2230
|
+
authMode: USER_POOL_AUTH_MODE,
|
|
2231
|
+
});
|
|
2232
|
+
assertNoGraphQLErrors(response.errors);
|
|
2233
|
+
const connection = response.data?.listPublishedItems;
|
|
2234
|
+
if (!connection) throw new Error("Missing GraphQL connection payload for listPublishedItems.");
|
|
2235
|
+
rows.push(...((connection.items ?? []).filter(Boolean) as PublishedItemBoardRow[]));
|
|
2236
|
+
nextToken = connection.nextToken ?? null;
|
|
2237
|
+
} while (nextToken);
|
|
2238
|
+
return rows.map(row => ({
|
|
2239
|
+
id: row.sourceItemId,
|
|
2240
|
+
lineageId: row.itemLineageId,
|
|
2241
|
+
versionNumber: row.versionNumber,
|
|
2242
|
+
stage: "published",
|
|
2243
|
+
type: row.type,
|
|
2244
|
+
status: row.status,
|
|
2245
|
+
title: row.title,
|
|
2246
|
+
headline: row.headline,
|
|
2247
|
+
slug: row.slug,
|
|
2248
|
+
section: row.section,
|
|
2249
|
+
updatedAt: row.publishedAt,
|
|
2250
|
+
}));
|
|
2251
|
+
}
|
|
2252
|
+
|
|
2197
2253
|
export async function loadModelPayloadsForOwner(
|
|
2198
2254
|
ownerKind: string,
|
|
2199
2255
|
ownerId: string,
|
|
@@ -9,7 +9,7 @@ import { canReadNewsroomBoard, contentItemBoardType, newsroomBoardConfig, projec
|
|
|
9
9
|
import type { AssignmentRecord } from "../lib/category-repository";
|
|
10
10
|
import { getContentItemName, SITE_BRAND } from "../lib/site-brand";
|
|
11
11
|
import { getNewsroomNavHref } from "../lib/newsroom-nav";
|
|
12
|
-
import { loadNewsroomAssignmentPage, loadNewsroomContentItemVersions } from "./news-desk-taxonomy-client";
|
|
12
|
+
import { loadNewsroomAssignmentPage, loadNewsroomContentItemVersions, loadNewsroomPublishedContentItemVersions } from "./news-desk-taxonomy-client";
|
|
13
13
|
import { useOptionalNewsDeskClient } from "./news-desk-client-provider";
|
|
14
14
|
import { NewsDeskAccessGate } from "./newsroom-access-gate";
|
|
15
15
|
import { NewsroomOpsShell, NewsroomOpsStatusBanner } from "./newsroom-ops-shell";
|
|
@@ -53,7 +53,7 @@ export function NewsroomBoardView() {
|
|
|
53
53
|
if (!allowed) { setLoading(false); return; }
|
|
54
54
|
setLoading(true);
|
|
55
55
|
Promise.all([
|
|
56
|
-
loadNewsroomContentItemVersions(),
|
|
56
|
+
Promise.all([loadNewsroomContentItemVersions(), loadNewsroomPublishedContentItemVersions()]).then(([workingVersions, publishedVersions]) => [...workingVersions, ...publishedVersions]),
|
|
57
57
|
loadEveryNewsroomAssignment(),
|
|
58
58
|
]).then(([contentItemVersions, assignments]) => {
|
|
59
59
|
if (generation.current !== request) return;
|
package/package.json
CHANGED
package/routes.manifest.json
CHANGED