@anthusai/papyrus 5.136.0-next.3 → 5.136.0-next.5
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/functions/announcements/schema.js +5 -0
- package/amplify/functions/announcements/schema.ts +5 -0
- package/amplify/plugins/newsletter/config.js +2 -1
- package/amplify/plugins/newsletter/config.ts +4 -1
- package/amplify/plugins/newsletter/papyrus.plugin.js +1 -1
- package/amplify/plugins/newsletter/papyrus.plugin.ts +1 -1
- package/lib/images/operations.generated.ts +111 -0
- package/package.json +1 -1
- package/routes.manifest.json +1 -1
|
@@ -86,6 +86,11 @@ export const announcementsSchemaDefinitions = {
|
|
|
86
86
|
lockedAt: a.datetime(),
|
|
87
87
|
lockedVersion: a.integer(),
|
|
88
88
|
preferredVersion: a.integer(),
|
|
89
|
+
machineVersion: a.integer(),
|
|
90
|
+
exampleScope: a.string(),
|
|
91
|
+
exampleState: a.string(),
|
|
92
|
+
exampleAt: a.datetime(),
|
|
93
|
+
exampleKey: a.string(),
|
|
89
94
|
nextAttemptAt: a.datetime(),
|
|
90
95
|
waitingFor: a.string(),
|
|
91
96
|
dueAt: a.datetime(),
|
|
@@ -89,6 +89,11 @@ export const announcementsSchemaDefinitions = {
|
|
|
89
89
|
lockedAt: a.datetime(),
|
|
90
90
|
lockedVersion: a.integer(),
|
|
91
91
|
preferredVersion: a.integer(),
|
|
92
|
+
machineVersion: a.integer(),
|
|
93
|
+
exampleScope: a.string(),
|
|
94
|
+
exampleState: a.string(),
|
|
95
|
+
exampleAt: a.datetime(),
|
|
96
|
+
exampleKey: a.string(),
|
|
92
97
|
nextAttemptAt: a.datetime(),
|
|
93
98
|
waitingFor: a.string(),
|
|
94
99
|
dueAt: a.datetime(),
|
|
@@ -25,7 +25,7 @@ const KNOWN_KEYS = new Set([
|
|
|
25
25
|
"configurationSet", "eventTopicName", "itemUrlStyle", "floorStars",
|
|
26
26
|
]);
|
|
27
27
|
const LIST_KEYS = {
|
|
28
|
-
roundup: ["id", "name", "description", "kind", "schedule", "issueType", "archivePath"],
|
|
28
|
+
roundup: ["id", "name", "description", "kind", "schedule", "issueType", "types", "archivePath"],
|
|
29
29
|
alert: ["id", "name", "description", "kind", "rule", "approval"],
|
|
30
30
|
};
|
|
31
31
|
function fail(message) {
|
|
@@ -199,6 +199,7 @@ function resolveList(raw, index) {
|
|
|
199
199
|
timezone: timeZone(schedule.timezone, `${label}.schedule.timezone`),
|
|
200
200
|
},
|
|
201
201
|
issueType: matching(list.issueType, `${label}.issueType`, ISSUE_TYPE, "the lowercase Item type the site gives its issues, such as post (a site-defined Story type, never a default of the engine)"),
|
|
202
|
+
types: stringList(list.types, `${label}.types`) ?? fail(`${label}.types is required: the Story types the roundup carries, such as ["article"]`),
|
|
202
203
|
archivePath: matching(list.archivePath, `${label}.archivePath`, ARCHIVE_PATH, 'a path that starts and ends with "/", such as /roundup/'),
|
|
203
204
|
};
|
|
204
205
|
}
|
|
@@ -61,6 +61,8 @@ export type RoundupList = ListBase & {
|
|
|
61
61
|
schedule: { draft: string; timezone: string };
|
|
62
62
|
/** The CMS item type of an issue. */
|
|
63
63
|
issueType: string;
|
|
64
|
+
/** The Story types the roundup carries, such as `["article"]`. There is no default of every type: wiki pages and other kinds never qualify unless named. */
|
|
65
|
+
types: string[];
|
|
64
66
|
/** Where the sent issue is archived, such as `/roundup/`: one path segment, also the section the issue Items are filed under. */
|
|
65
67
|
archivePath: string;
|
|
66
68
|
};
|
|
@@ -102,7 +104,7 @@ const KNOWN_KEYS = new Set([
|
|
|
102
104
|
"configurationSet", "eventTopicName", "itemUrlStyle", "floorStars",
|
|
103
105
|
]);
|
|
104
106
|
const LIST_KEYS = {
|
|
105
|
-
roundup: ["id", "name", "description", "kind", "schedule", "issueType", "archivePath"],
|
|
107
|
+
roundup: ["id", "name", "description", "kind", "schedule", "issueType", "types", "archivePath"],
|
|
106
108
|
alert: ["id", "name", "description", "kind", "rule", "approval"],
|
|
107
109
|
};
|
|
108
110
|
|
|
@@ -263,6 +265,7 @@ function resolveList(raw: unknown, index: number): NewsletterList {
|
|
|
263
265
|
timezone: timeZone(schedule.timezone, `${label}.schedule.timezone`),
|
|
264
266
|
},
|
|
265
267
|
issueType: matching(list.issueType, `${label}.issueType`, ISSUE_TYPE, "the lowercase Item type the site gives its issues, such as post (a site-defined Story type, never a default of the engine)"),
|
|
268
|
+
types: stringList(list.types, `${label}.types`) ?? fail(`${label}.types is required: the Story types the roundup carries, such as ["article"]`),
|
|
266
269
|
archivePath: matching(list.archivePath, `${label}.archivePath`, ARCHIVE_PATH, 'a path that starts and ends with "/", such as /roundup/'),
|
|
267
270
|
};
|
|
268
271
|
}
|
|
@@ -78,7 +78,7 @@ export function newsletterEnvironment(config, tableName, keyParameter) {
|
|
|
78
78
|
description: list.description,
|
|
79
79
|
kind: list.kind,
|
|
80
80
|
// A roundup's issue type, archive section and time zone are what drafting needs; its schedule stays in the stack.
|
|
81
|
-
...(list.kind === "roundup" ? { issueType: list.issueType, archivePath: list.archivePath, timezone: list.schedule.timezone } : {}),
|
|
81
|
+
...(list.kind === "roundup" ? { issueType: list.issueType, types: list.types, archivePath: list.archivePath, timezone: list.schedule.timezone } : {}),
|
|
82
82
|
// An alert's rule and approval decide which published items raise an alert and whether an admin approves it.
|
|
83
83
|
...(list.kind === "alert" ? { rule: list.rule, approval: list.approval } : {}),
|
|
84
84
|
}))),
|
|
@@ -92,7 +92,7 @@ export function newsletterEnvironment(config: NewsletterConfig, tableName: strin
|
|
|
92
92
|
description: list.description,
|
|
93
93
|
kind: list.kind,
|
|
94
94
|
// A roundup's issue type, archive section and time zone are what drafting needs; its schedule stays in the stack.
|
|
95
|
-
...(list.kind === "roundup" ? { issueType: list.issueType, archivePath: list.archivePath, timezone: list.schedule.timezone } : {}),
|
|
95
|
+
...(list.kind === "roundup" ? { issueType: list.issueType, types: list.types, archivePath: list.archivePath, timezone: list.schedule.timezone } : {}),
|
|
96
96
|
// An alert's rule and approval decide which published items raise an alert and whether an admin approves it.
|
|
97
97
|
...(list.kind === "alert" ? { rule: list.rule, approval: list.approval } : {}),
|
|
98
98
|
})),
|
|
@@ -39,6 +39,9 @@ export type ImageOperationName =
|
|
|
39
39
|
| "announcements_settings_show"
|
|
40
40
|
| "announcements_settings_set"
|
|
41
41
|
| "announcements_account_status"
|
|
42
|
+
| "announcements_account_connect"
|
|
43
|
+
| "announcements_blocked"
|
|
44
|
+
| "announcements_retry"
|
|
42
45
|
| "announcements_review_show"
|
|
43
46
|
| "announcements_review_set"
|
|
44
47
|
| "announcements_delivery_review_set"
|
|
@@ -48,6 +51,8 @@ export type ImageOperationName =
|
|
|
48
51
|
| "announcements_pinned_change"
|
|
49
52
|
| "announcements_release"
|
|
50
53
|
| "announcements_unlock"
|
|
54
|
+
| "announcements_example"
|
|
55
|
+
| "announcements_preferred"
|
|
51
56
|
| "announcements_correct"
|
|
52
57
|
| "announcements_record_manual"
|
|
53
58
|
| "announcements_withdraw"
|
|
@@ -1136,10 +1141,56 @@ export type AnnouncementsAccountStatusResult = {
|
|
|
1136
1141
|
accountHandle?: string;
|
|
1137
1142
|
/** For example $0.60 spent of $10.00 this cycle. */
|
|
1138
1143
|
standing?: string;
|
|
1144
|
+
/** Our count of the posts this account sent in the current billing cycle, a post later deleted included (X charged for it). X's own count is read beside it on the page. */
|
|
1145
|
+
postCount?: number;
|
|
1146
|
+
suggestion?: {
|
|
1147
|
+
eligibleCount?: number;
|
|
1148
|
+
windowDays?: number;
|
|
1149
|
+
postsPerMonth?: number;
|
|
1150
|
+
dollarsPerMonth?: number;
|
|
1151
|
+
sentence: string;
|
|
1152
|
+
};
|
|
1139
1153
|
pauseReason?: string;
|
|
1140
1154
|
pricesAsOf?: string;
|
|
1141
1155
|
};
|
|
1142
1156
|
|
|
1157
|
+
/** Print the newsroom page where the X account is connected. Connecting is a browser step (OAuth): nothing is connected from here. */
|
|
1158
|
+
export type AnnouncementsAccountConnectInput = Record<string, unknown>;
|
|
1159
|
+
|
|
1160
|
+
export type AnnouncementsAccountConnectResult = {
|
|
1161
|
+
/** The address of Administration > Announcements in the newsroom. */
|
|
1162
|
+
url: string;
|
|
1163
|
+
words: string;
|
|
1164
|
+
};
|
|
1165
|
+
|
|
1166
|
+
/** List the Stories that qualified for X and are waiting, each with its reason (paused, budget reached, the account needs connecting again, a failed check). */
|
|
1167
|
+
export type AnnouncementsBlockedInput = Record<string, unknown>;
|
|
1168
|
+
|
|
1169
|
+
export type AnnouncementsBlockedResult = {
|
|
1170
|
+
blocked: {
|
|
1171
|
+
delivery: string;
|
|
1172
|
+
announcementId: string;
|
|
1173
|
+
stories: {
|
|
1174
|
+
lineageId: string;
|
|
1175
|
+
}[];
|
|
1176
|
+
reason: string;
|
|
1177
|
+
words: string;
|
|
1178
|
+
since?: string;
|
|
1179
|
+
}[];
|
|
1180
|
+
};
|
|
1181
|
+
|
|
1182
|
+
/** Try a failed Delivery again: it goes back to ready, and the next try is the next attempt. The attempts so far stay in its log. */
|
|
1183
|
+
export type AnnouncementsRetryInput = {
|
|
1184
|
+
/** The Delivery's id. */
|
|
1185
|
+
delivery: string;
|
|
1186
|
+
};
|
|
1187
|
+
|
|
1188
|
+
export type AnnouncementsRetryResult = {
|
|
1189
|
+
id: string;
|
|
1190
|
+
/** The Delivery's state afterwards: ready. */
|
|
1191
|
+
state: string;
|
|
1192
|
+
};
|
|
1193
|
+
|
|
1143
1194
|
/** Show the publication's announcement review and each override, and what a channel and kind would get. */
|
|
1144
1195
|
export type AnnouncementsReviewShowInput = {
|
|
1145
1196
|
/** Narrow to one channel, such as linkedin. */
|
|
@@ -1332,6 +1383,56 @@ export type AnnouncementsUnlockResult = {
|
|
|
1332
1383
|
lockedVersion?: number | null;
|
|
1333
1384
|
};
|
|
1334
1385
|
|
|
1386
|
+
/** Say how far what a person changed in an announcement should reach, so later drafts can follow it. */
|
|
1387
|
+
export type AnnouncementsExampleInput = {
|
|
1388
|
+
/** The Delivery's id: one that went out, or one with a preferred version. */
|
|
1389
|
+
delivery: string;
|
|
1390
|
+
/** How far the change reaches: just this one, this channel, this kind of announcement on this channel, or the whole publication. Leave it out to keep the edit as a candidate. */
|
|
1391
|
+
scope?: "this_one" | "channel" | "kind" | "publication";
|
|
1392
|
+
/** One line on why, kept with the words in S3 and never in the catalog. It goes with a scope. */
|
|
1393
|
+
reason?: string;
|
|
1394
|
+
};
|
|
1395
|
+
|
|
1396
|
+
export type AnnouncementsExampleResult = {
|
|
1397
|
+
id: string;
|
|
1398
|
+
recorded: boolean;
|
|
1399
|
+
exampleState?: string | null;
|
|
1400
|
+
exampleScope?: string | null;
|
|
1401
|
+
machineVersion?: number | null;
|
|
1402
|
+
finalVersion?: number | null;
|
|
1403
|
+
reason?: string | null;
|
|
1404
|
+
};
|
|
1405
|
+
|
|
1406
|
+
/** Save how a Delivery that went out should have read, as a preferred version that is never sent. It teaches; it changes no public text. */
|
|
1407
|
+
export type AnnouncementsPreferredInput = {
|
|
1408
|
+
/** The Delivery's id: one that went out, or has an attempt open. */
|
|
1409
|
+
delivery: string;
|
|
1410
|
+
/** The version of the Delivery you read. */
|
|
1411
|
+
replaces: number;
|
|
1412
|
+
/** How it should have read. */
|
|
1413
|
+
text: string;
|
|
1414
|
+
/** Also record how far it reaches, in the same step. Leave it out to keep it as a candidate. */
|
|
1415
|
+
scope?: "this_one" | "channel" | "kind" | "publication";
|
|
1416
|
+
/** One line on why. It goes with a scope. */
|
|
1417
|
+
reason?: string;
|
|
1418
|
+
};
|
|
1419
|
+
|
|
1420
|
+
export type AnnouncementsPreferredResult = {
|
|
1421
|
+
id: string;
|
|
1422
|
+
/** saved: a new version. preferred: saved while an attempt is open, so it never changes that attempt. unchanged: the words are the ones you read. dropped: a machine's redraft that the person's newer version outranks. candidate: kept beside the draft. */
|
|
1423
|
+
status: "saved" | "preferred" | "unchanged" | "dropped" | "candidate";
|
|
1424
|
+
version?: number;
|
|
1425
|
+
replaces?: number | null;
|
|
1426
|
+
reason?: string;
|
|
1427
|
+
/** The candidate's id, when one was kept. */
|
|
1428
|
+
candidate?: string;
|
|
1429
|
+
approvedVersion?: number | null;
|
|
1430
|
+
lockedVersion?: number | null;
|
|
1431
|
+
preferredVersion?: number | null;
|
|
1432
|
+
/** Each block's owner (human or machine) and whether it is pinned. */
|
|
1433
|
+
blocks?: Record<string, unknown>[];
|
|
1434
|
+
};
|
|
1435
|
+
|
|
1335
1436
|
/** Correct a Delivery that went with a new public text: the next generation, which supersedes the one that went. */
|
|
1336
1437
|
export type AnnouncementsCorrectInput = {
|
|
1337
1438
|
/** The id of the Delivery that went and is to be corrected. */
|
|
@@ -1647,6 +1748,9 @@ export interface ImageOperations {
|
|
|
1647
1748
|
announcements_settings_show: { input: AnnouncementsSettingsShowInput; result: AnnouncementsSettingsShowResult };
|
|
1648
1749
|
announcements_settings_set: { input: AnnouncementsSettingsSetInput; result: AnnouncementsSettingsSetResult };
|
|
1649
1750
|
announcements_account_status: { input: AnnouncementsAccountStatusInput; result: AnnouncementsAccountStatusResult };
|
|
1751
|
+
announcements_account_connect: { input: AnnouncementsAccountConnectInput; result: AnnouncementsAccountConnectResult };
|
|
1752
|
+
announcements_blocked: { input: AnnouncementsBlockedInput; result: AnnouncementsBlockedResult };
|
|
1753
|
+
announcements_retry: { input: AnnouncementsRetryInput; result: AnnouncementsRetryResult };
|
|
1650
1754
|
announcements_review_show: { input: AnnouncementsReviewShowInput; result: AnnouncementsReviewShowResult };
|
|
1651
1755
|
announcements_review_set: { input: AnnouncementsReviewSetInput; result: AnnouncementsReviewSetResult };
|
|
1652
1756
|
announcements_delivery_review_set: { input: AnnouncementsDeliveryReviewSetInput; result: AnnouncementsDeliveryReviewSetResult };
|
|
@@ -1656,6 +1760,8 @@ export interface ImageOperations {
|
|
|
1656
1760
|
announcements_pinned_change: { input: AnnouncementsPinnedChangeInput; result: AnnouncementsPinnedChangeResult };
|
|
1657
1761
|
announcements_release: { input: AnnouncementsReleaseInput; result: AnnouncementsReleaseResult };
|
|
1658
1762
|
announcements_unlock: { input: AnnouncementsUnlockInput; result: AnnouncementsUnlockResult };
|
|
1763
|
+
announcements_example: { input: AnnouncementsExampleInput; result: AnnouncementsExampleResult };
|
|
1764
|
+
announcements_preferred: { input: AnnouncementsPreferredInput; result: AnnouncementsPreferredResult };
|
|
1659
1765
|
announcements_correct: { input: AnnouncementsCorrectInput; result: AnnouncementsCorrectResult };
|
|
1660
1766
|
announcements_record_manual: { input: AnnouncementsRecordManualInput; result: AnnouncementsRecordManualResult };
|
|
1661
1767
|
announcements_withdraw: { input: AnnouncementsWithdrawInput; result: AnnouncementsWithdrawResult };
|
|
@@ -1704,6 +1810,9 @@ export const IMAGE_OPERATIONS = {
|
|
|
1704
1810
|
announcements_settings_show: { effect: "read", agentAllowed: true, agentRung: "observe", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements settings show" },
|
|
1705
1811
|
announcements_settings_set: { effect: "write", agentAllowed: false, agentRung: "person", agentRefusal: "blocked", group: "announcements", command: "papyrus announcements settings set" },
|
|
1706
1812
|
announcements_account_status: { effect: "read", agentAllowed: true, agentRung: "observe", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements account status" },
|
|
1813
|
+
announcements_account_connect: { effect: "read", agentAllowed: true, agentRung: "observe", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements account connect" },
|
|
1814
|
+
announcements_blocked: { effect: "read", agentAllowed: true, agentRung: "observe", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements blocked" },
|
|
1815
|
+
announcements_retry: { effect: "write", agentAllowed: false, agentRung: "person", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements retry" },
|
|
1707
1816
|
announcements_review_show: { effect: "read", agentAllowed: true, agentRung: "observe", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements review show" },
|
|
1708
1817
|
announcements_review_set: { effect: "write", agentAllowed: false, agentRung: "person", agentRefusal: "blocked", group: "announcements", command: "papyrus announcements review set" },
|
|
1709
1818
|
announcements_delivery_review_set: { effect: "write", agentAllowed: false, agentRung: "person", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements delivery review" },
|
|
@@ -1713,6 +1822,8 @@ export const IMAGE_OPERATIONS = {
|
|
|
1713
1822
|
announcements_pinned_change: { effect: "write", agentAllowed: false, agentRung: "person", agentRefusal: "blocked", group: "announcements", command: "papyrus announcements pinned" },
|
|
1714
1823
|
announcements_release: { effect: "write", agentAllowed: true, agentRung: "publish_auto", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements release" },
|
|
1715
1824
|
announcements_unlock: { effect: "write", agentAllowed: false, agentRung: "person", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements unlock" },
|
|
1825
|
+
announcements_example: { effect: "write", agentAllowed: false, agentRung: "person", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements example" },
|
|
1826
|
+
announcements_preferred: { effect: "write", agentAllowed: false, agentRung: "person", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements preferred" },
|
|
1716
1827
|
announcements_correct: { effect: "write", agentAllowed: true, agentRung: "prepare", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements correct" },
|
|
1717
1828
|
announcements_record_manual: { effect: "write", agentAllowed: false, agentRung: "person", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements record-manual" },
|
|
1718
1829
|
announcements_withdraw: { effect: "write", agentAllowed: true, agentRung: "prepare", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements withdraw" },
|
package/package.json
CHANGED
package/routes.manifest.json
CHANGED