@anthusai/papyrus 5.136.0-next.3 → 5.136.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.
@@ -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,7 @@ export type ImageOperationName =
48
51
  | "announcements_pinned_change"
49
52
  | "announcements_release"
50
53
  | "announcements_unlock"
54
+ | "announcements_example"
51
55
  | "announcements_correct"
52
56
  | "announcements_record_manual"
53
57
  | "announcements_withdraw"
@@ -1136,10 +1140,56 @@ export type AnnouncementsAccountStatusResult = {
1136
1140
  accountHandle?: string;
1137
1141
  /** For example $0.60 spent of $10.00 this cycle. */
1138
1142
  standing?: string;
1143
+ /** 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. */
1144
+ postCount?: number;
1145
+ suggestion?: {
1146
+ eligibleCount?: number;
1147
+ windowDays?: number;
1148
+ postsPerMonth?: number;
1149
+ dollarsPerMonth?: number;
1150
+ sentence: string;
1151
+ };
1139
1152
  pauseReason?: string;
1140
1153
  pricesAsOf?: string;
1141
1154
  };
1142
1155
 
1156
+ /** Print the newsroom page where the X account is connected. Connecting is a browser step (OAuth): nothing is connected from here. */
1157
+ export type AnnouncementsAccountConnectInput = Record<string, unknown>;
1158
+
1159
+ export type AnnouncementsAccountConnectResult = {
1160
+ /** The address of Administration > Announcements in the newsroom. */
1161
+ url: string;
1162
+ words: string;
1163
+ };
1164
+
1165
+ /** 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). */
1166
+ export type AnnouncementsBlockedInput = Record<string, unknown>;
1167
+
1168
+ export type AnnouncementsBlockedResult = {
1169
+ blocked: {
1170
+ delivery: string;
1171
+ announcementId: string;
1172
+ stories: {
1173
+ lineageId: string;
1174
+ }[];
1175
+ reason: string;
1176
+ words: string;
1177
+ since?: string;
1178
+ }[];
1179
+ };
1180
+
1181
+ /** 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. */
1182
+ export type AnnouncementsRetryInput = {
1183
+ /** The Delivery's id. */
1184
+ delivery: string;
1185
+ };
1186
+
1187
+ export type AnnouncementsRetryResult = {
1188
+ id: string;
1189
+ /** The Delivery's state afterwards: ready. */
1190
+ state: string;
1191
+ };
1192
+
1143
1193
  /** Show the publication's announcement review and each override, and what a channel and kind would get. */
1144
1194
  export type AnnouncementsReviewShowInput = {
1145
1195
  /** Narrow to one channel, such as linkedin. */
@@ -1332,6 +1382,26 @@ export type AnnouncementsUnlockResult = {
1332
1382
  lockedVersion?: number | null;
1333
1383
  };
1334
1384
 
1385
+ /** Say how far what a person changed in an announcement should reach, so later drafts can follow it. */
1386
+ export type AnnouncementsExampleInput = {
1387
+ /** The Delivery's id: one that went out, or one with a preferred version. */
1388
+ delivery: string;
1389
+ /** 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. */
1390
+ scope?: "this_one" | "channel" | "kind" | "publication";
1391
+ /** One line on why, kept with the words in S3 and never in the catalog. It goes with a scope. */
1392
+ reason?: string;
1393
+ };
1394
+
1395
+ export type AnnouncementsExampleResult = {
1396
+ id: string;
1397
+ recorded: boolean;
1398
+ exampleState?: string | null;
1399
+ exampleScope?: string | null;
1400
+ machineVersion?: number | null;
1401
+ finalVersion?: number | null;
1402
+ reason?: string | null;
1403
+ };
1404
+
1335
1405
  /** Correct a Delivery that went with a new public text: the next generation, which supersedes the one that went. */
1336
1406
  export type AnnouncementsCorrectInput = {
1337
1407
  /** The id of the Delivery that went and is to be corrected. */
@@ -1647,6 +1717,9 @@ export interface ImageOperations {
1647
1717
  announcements_settings_show: { input: AnnouncementsSettingsShowInput; result: AnnouncementsSettingsShowResult };
1648
1718
  announcements_settings_set: { input: AnnouncementsSettingsSetInput; result: AnnouncementsSettingsSetResult };
1649
1719
  announcements_account_status: { input: AnnouncementsAccountStatusInput; result: AnnouncementsAccountStatusResult };
1720
+ announcements_account_connect: { input: AnnouncementsAccountConnectInput; result: AnnouncementsAccountConnectResult };
1721
+ announcements_blocked: { input: AnnouncementsBlockedInput; result: AnnouncementsBlockedResult };
1722
+ announcements_retry: { input: AnnouncementsRetryInput; result: AnnouncementsRetryResult };
1650
1723
  announcements_review_show: { input: AnnouncementsReviewShowInput; result: AnnouncementsReviewShowResult };
1651
1724
  announcements_review_set: { input: AnnouncementsReviewSetInput; result: AnnouncementsReviewSetResult };
1652
1725
  announcements_delivery_review_set: { input: AnnouncementsDeliveryReviewSetInput; result: AnnouncementsDeliveryReviewSetResult };
@@ -1656,6 +1729,7 @@ export interface ImageOperations {
1656
1729
  announcements_pinned_change: { input: AnnouncementsPinnedChangeInput; result: AnnouncementsPinnedChangeResult };
1657
1730
  announcements_release: { input: AnnouncementsReleaseInput; result: AnnouncementsReleaseResult };
1658
1731
  announcements_unlock: { input: AnnouncementsUnlockInput; result: AnnouncementsUnlockResult };
1732
+ announcements_example: { input: AnnouncementsExampleInput; result: AnnouncementsExampleResult };
1659
1733
  announcements_correct: { input: AnnouncementsCorrectInput; result: AnnouncementsCorrectResult };
1660
1734
  announcements_record_manual: { input: AnnouncementsRecordManualInput; result: AnnouncementsRecordManualResult };
1661
1735
  announcements_withdraw: { input: AnnouncementsWithdrawInput; result: AnnouncementsWithdrawResult };
@@ -1704,6 +1778,9 @@ export const IMAGE_OPERATIONS = {
1704
1778
  announcements_settings_show: { effect: "read", agentAllowed: true, agentRung: "observe", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements settings show" },
1705
1779
  announcements_settings_set: { effect: "write", agentAllowed: false, agentRung: "person", agentRefusal: "blocked", group: "announcements", command: "papyrus announcements settings set" },
1706
1780
  announcements_account_status: { effect: "read", agentAllowed: true, agentRung: "observe", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements account status" },
1781
+ announcements_account_connect: { effect: "read", agentAllowed: true, agentRung: "observe", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements account connect" },
1782
+ announcements_blocked: { effect: "read", agentAllowed: true, agentRung: "observe", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements blocked" },
1783
+ announcements_retry: { effect: "write", agentAllowed: false, agentRung: "person", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements retry" },
1707
1784
  announcements_review_show: { effect: "read", agentAllowed: true, agentRung: "observe", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements review show" },
1708
1785
  announcements_review_set: { effect: "write", agentAllowed: false, agentRung: "person", agentRefusal: "blocked", group: "announcements", command: "papyrus announcements review set" },
1709
1786
  announcements_delivery_review_set: { effect: "write", agentAllowed: false, agentRung: "person", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements delivery review" },
@@ -1713,6 +1790,7 @@ export const IMAGE_OPERATIONS = {
1713
1790
  announcements_pinned_change: { effect: "write", agentAllowed: false, agentRung: "person", agentRefusal: "blocked", group: "announcements", command: "papyrus announcements pinned" },
1714
1791
  announcements_release: { effect: "write", agentAllowed: true, agentRung: "publish_auto", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements release" },
1715
1792
  announcements_unlock: { effect: "write", agentAllowed: false, agentRung: "person", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements unlock" },
1793
+ announcements_example: { effect: "write", agentAllowed: false, agentRung: "person", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements example" },
1716
1794
  announcements_correct: { effect: "write", agentAllowed: true, agentRung: "prepare", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements correct" },
1717
1795
  announcements_record_manual: { effect: "write", agentAllowed: false, agentRung: "person", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements record-manual" },
1718
1796
  announcements_withdraw: { effect: "write", agentAllowed: true, agentRung: "prepare", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements withdraw" },
package/package.json CHANGED
@@ -650,7 +650,7 @@
650
650
  "optional": true
651
651
  }
652
652
  },
653
- "version": "5.136.0-next.3",
653
+ "version": "5.136.0-next.4",
654
654
  "dependencies": {
655
655
  "@aws-amplify/adapter-nextjs": "^1.7.3",
656
656
  "@aws-crypto/sha256-js": "5.2.0",
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.136.0-next.3",
2
+ "version": "5.136.0-next.4",
3
3
  "routes": [
4
4
  {
5
5
  "file": "app/%5F_preview/[[...path]]/route.ts",