@postonus/cli 0.1.41 → 0.1.43

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/dist/index.js CHANGED
@@ -25,7 +25,7 @@ var PLAN_CONFIGS = {
25
25
  ownedWorkspaces: 1,
26
26
  defaultMonthlyPosts: 300,
27
27
  maxDrafts: UNLIMITED,
28
- perPlatformMonthlyPosts: { TWITTER: 100 },
28
+ perPlatformMonthlyPosts: { TWITTER: 50 },
29
29
  mediaStorageGb: 10,
30
30
  vaCredits: 60,
31
31
  requestsPerMinute: 600,
@@ -53,7 +53,7 @@ var PLAN_CONFIGS = {
53
53
  ownedWorkspaces: 3,
54
54
  defaultMonthlyPosts: UNLIMITED,
55
55
  maxDrafts: UNLIMITED,
56
- perPlatformMonthlyPosts: { TWITTER: 500 },
56
+ perPlatformMonthlyPosts: { TWITTER: 200 },
57
57
  mediaStorageGb: 50,
58
58
  vaCredits: 300,
59
59
  requestsPerMinute: 1800,
@@ -78,7 +78,7 @@ var PLAN_CONFIGS = {
78
78
  ownedWorkspaces: UNLIMITED,
79
79
  defaultMonthlyPosts: UNLIMITED,
80
80
  maxDrafts: UNLIMITED,
81
- perPlatformMonthlyPosts: { TWITTER: 2e3 },
81
+ perPlatformMonthlyPosts: { TWITTER: 1e3 },
82
82
  mediaStorageGb: UNLIMITED,
83
83
  vaCredits: UNLIMITED,
84
84
  // Finite on purpose — see the `requestsPerMinute` doc comment.
@@ -253,6 +253,14 @@ var OUTREACH_ENROLLMENT_STATUS_VALUES = [
253
253
  "finished",
254
254
  "stopped"
255
255
  ];
256
+ var OUTREACH_SUPPRESSION_REASON_VALUES = [
257
+ "unsubscribed",
258
+ "bounced",
259
+ "replied_stop",
260
+ "manual",
261
+ "existing_user"
262
+ ];
263
+ var OUTREACH_EVENT_KIND_VALUES = ["reply", "bounce", "unsubscribe"];
256
264
 
257
265
  // src/index.ts
258
266
  import { Command, Option } from "commander";
@@ -7154,6 +7162,78 @@ var UpdateMailboxInputSchema = object({
7154
7162
  status: _enum(OUTREACH_MAILBOX_STATUS_VALUES).optional(),
7155
7163
  pausedReason: string2().nullable().optional()
7156
7164
  });
7165
+ var OutreachSendingMailboxSchema = object({
7166
+ id: string2(),
7167
+ address: string2(),
7168
+ displayName: string2(),
7169
+ status: _enum(OUTREACH_MAILBOX_STATUS_VALUES),
7170
+ pausedReason: string2().nullable(),
7171
+ sentToday: number2().int(),
7172
+ todayCap: number2().int(),
7173
+ isThrottled: boolean2(),
7174
+ week: number2().int()
7175
+ });
7176
+ var OutreachSendingNextSendSchema = object({
7177
+ id: string2(),
7178
+ prospectEmail: string2(),
7179
+ prospectName: string2().nullable(),
7180
+ stepPosition: number2().int(),
7181
+ subject: string2(),
7182
+ scheduledFor: Timestamp.nullable()
7183
+ });
7184
+ var OutreachSendingRecentEventSchema = object({
7185
+ id: string2(),
7186
+ kind: _enum(OUTREACH_EVENT_KIND_VALUES),
7187
+ bounceClass: string2().nullable(),
7188
+ detail: string2().nullable(),
7189
+ occurredAt: Timestamp,
7190
+ prospectEmail: string2().nullable()
7191
+ });
7192
+ var OutreachSendingStuckMessageSchema = object({
7193
+ id: string2(),
7194
+ prospectEmail: string2(),
7195
+ prospectName: string2().nullable(),
7196
+ stepPosition: number2().int(),
7197
+ subject: string2(),
7198
+ error: string2().nullable(),
7199
+ sentAt: Timestamp.nullable()
7200
+ });
7201
+ var OutreachSendingOverviewSchema = object({
7202
+ mailboxes: array(OutreachSendingMailboxSchema),
7203
+ nextSends: array(OutreachSendingNextSendSchema),
7204
+ recentEvents: array(OutreachSendingRecentEventSchema),
7205
+ stuckMessages: array(OutreachSendingStuckMessageSchema)
7206
+ });
7207
+ var ListSuppressionsInputSchema = object({
7208
+ search: string2().trim().max(200).optional(),
7209
+ limit: coerce_exports.number().int().min(1).max(100).default(50),
7210
+ offset: coerce_exports.number().int().min(0).default(0)
7211
+ });
7212
+ var OutreachSuppressionItemSchema = object({
7213
+ email: string2(),
7214
+ reason: _enum(OUTREACH_SUPPRESSION_REASON_VALUES),
7215
+ createdAt: Timestamp
7216
+ });
7217
+ var OutreachSuppressionListSchema = object({
7218
+ items: array(OutreachSuppressionItemSchema),
7219
+ total: AggregateCount
7220
+ });
7221
+ var AddSuppressionInputSchema = object({
7222
+ email: string2().trim().toLowerCase().email(),
7223
+ reason: _enum(OUTREACH_SUPPRESSION_REASON_VALUES).optional().default("manual")
7224
+ });
7225
+ var RemoveSuppressionInputSchema = object({
7226
+ email: string2().trim().toLowerCase()
7227
+ });
7228
+ var SendTestOutreachInputSchema = object({
7229
+ enrollmentId: string2(),
7230
+ mailboxId: string2()
7231
+ });
7232
+ var SendTestOutreachResultSchema = object({
7233
+ success: boolean2(),
7234
+ sentTo: string2(),
7235
+ count: number2().int()
7236
+ });
7157
7237
  var adminOutreachContract = {
7158
7238
  importProspects: mcpAdmin.route({
7159
7239
  method: "POST",
@@ -7219,7 +7299,32 @@ var adminOutreachContract = {
7219
7299
  method: "PATCH",
7220
7300
  path: "/internal/admin/outreach/mailboxes/{id}",
7221
7301
  summary: "Update mailbox status or placement score (admin only)"
7222
- }).errors(authedErrors).input(UpdateMailboxInputSchema).output(object({ success: boolean2() }))
7302
+ }).errors(authedErrors).input(UpdateMailboxInputSchema).output(object({ success: boolean2() })),
7303
+ getSendingOverview: internal.route({
7304
+ method: "GET",
7305
+ path: "/internal/admin/outreach/sending",
7306
+ summary: "Get sending overview: queues, next sends, recent events, stuck messages (admin only)"
7307
+ }).errors(authedErrors).output(OutreachSendingOverviewSchema),
7308
+ listSuppressions: internal.route({
7309
+ method: "GET",
7310
+ path: "/internal/admin/outreach/suppressions",
7311
+ summary: "List suppressed emails with pagination (admin only)"
7312
+ }).errors(authedErrors).input(ListSuppressionsInputSchema).output(OutreachSuppressionListSchema),
7313
+ addSuppression: internal.route({
7314
+ method: "POST",
7315
+ path: "/internal/admin/outreach/suppressions",
7316
+ summary: "Manually suppress an email address (admin only)"
7317
+ }).errors(authedErrors).input(AddSuppressionInputSchema).output(object({ email: string2(), reason: string2() })),
7318
+ removeSuppression: internal.route({
7319
+ method: "POST",
7320
+ path: "/internal/admin/outreach/suppressions/remove",
7321
+ summary: "Remove an email from suppression list (admin only)"
7322
+ }).errors(authedErrors).input(RemoveSuppressionInputSchema).output(object({ success: boolean2() })),
7323
+ sendTest: internal.route({
7324
+ method: "POST",
7325
+ path: "/internal/admin/outreach/review/send-test",
7326
+ summary: "Send test outreach thread to admin email (admin only)"
7327
+ }).errors(authedErrors).input(SendTestOutreachInputSchema).output(SendTestOutreachResultSchema)
7223
7328
  };
7224
7329
 
7225
7330
  // ../../packages/api-contract/src/admin.ts
@@ -8325,6 +8430,7 @@ var SharedPostFields = {
8325
8430
  integrationContent: record(string2(), string2()).optional(),
8326
8431
  integrationFirstComment: record(string2(), string2()).optional(),
8327
8432
  integrationSettings: IntegrationSettingsInputSchema.optional(),
8433
+ xLinkHandling: _enum(["first_reply", "plain_text", "keep_live"]).optional(),
8328
8434
  /**
8329
8435
  * Which of the post's media each channel publishes, in publish order, by url.
8330
8436
  * Omit a channel to send it as much of the post's media as its platform can
@@ -12765,7 +12871,7 @@ function formatTable(headers, rows, isTty = process.stdout.isTTY) {
12765
12871
  }
12766
12872
 
12767
12873
  // src/version.ts
12768
- var CLI_VERSION = "0.1.41";
12874
+ var CLI_VERSION = "0.1.43";
12769
12875
 
12770
12876
  // src/client.ts
12771
12877
  var DEVICE_CODE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:device_code";
@@ -13790,6 +13896,13 @@ function readCopy(pairs) {
13790
13896
  })
13791
13897
  );
13792
13898
  }
13899
+ function readXLinkHandling(value2) {
13900
+ if (!value2) return void 0;
13901
+ if (value2 === "first_reply" || value2 === "plain_text" || value2 === "keep_live") {
13902
+ return value2;
13903
+ }
13904
+ return failUsage("--x-link-handling must be 'first_reply', 'plain_text', or 'keep_live'.");
13905
+ }
13793
13906
  function readTiming(options) {
13794
13907
  const chosen = [options.at, options.optimal, options.now, options.draft].filter(Boolean);
13795
13908
  if (chosen.length > 1) failUsage("Use one of --at, --optimal, --now or --draft.");
@@ -13834,6 +13947,7 @@ async function post(text, options) {
13834
13947
  const timing = readTiming(options);
13835
13948
  const project = await readProjectConfig();
13836
13949
  const targets = readTargets(options, project?.defaultPlatforms);
13950
+ const xLinkHandling = readXLinkHandling(options.xLinkHandling);
13837
13951
  if (timing.postAction !== "DRAFT" && !targets.platforms && !targets.selectedIntegrations) {
13838
13952
  failUsage("Say where to post: --to x,linkedin or --channel <id> (or use --draft).");
13839
13953
  }
@@ -13848,7 +13962,7 @@ async function post(text, options) {
13848
13962
  media: media2.map((item) => ({ url: item.url, type: item.type, id: item.mediaId, fileId: item.uploadId }))
13849
13963
  }
13850
13964
  ],
13851
- shared: { ...targets, thread, integrationContent: readCopy(options.copy) },
13965
+ shared: { ...targets, thread, integrationContent: readCopy(options.copy), xLinkHandling },
13852
13966
  postAction: timing.postAction,
13853
13967
  dryRun: options.dryRun
13854
13968
  });
@@ -13874,8 +13988,11 @@ async function editPost(postId, text, options) {
13874
13988
  const targets = readTargets(options);
13875
13989
  const integrationContent = readCopy(options.copy);
13876
13990
  const scheduledAt = options.at ? parseInstant(options.at, "--at") : void 0;
13877
- if (!thread && content === void 0 && !targets.platforms && !targets.selectedIntegrations && !integrationContent && !scheduledAt && !options.media?.length) {
13878
- failUsage("Nothing to change. Pass new text, --thread-file, --at, --to, --channel, --copy or --media.");
13991
+ const xLinkHandling = readXLinkHandling(options.xLinkHandling);
13992
+ if (!thread && content === void 0 && !targets.platforms && !targets.selectedIntegrations && !integrationContent && !scheduledAt && !options.media?.length && !xLinkHandling) {
13993
+ failUsage(
13994
+ "Nothing to change. Pass new text, --thread-file, --at, --to, --channel, --copy, --x-link-handling or --media."
13995
+ );
13879
13996
  }
13880
13997
  const { api } = await getApi();
13881
13998
  const media2 = options.media?.length ? await uploadAll(api, options.media) : void 0;
@@ -13887,6 +14004,7 @@ async function editPost(postId, text, options) {
13887
14004
  scheduledAt,
13888
14005
  ...targets,
13889
14006
  integrationContent,
14007
+ xLinkHandling,
13890
14008
  media: media2?.map((item) => ({ url: item.url, type: item.type, id: item.mediaId, fileId: item.uploadId })),
13891
14009
  dryRun: options.dryRun
13892
14010
  });
@@ -14179,8 +14297,11 @@ channels.command("connect").description("connect a new channel via OAuth").optio
14179
14297
  program.command("link").description("link current directory to a Postonus workspace").option("-w, --workspace <id>", "workspace to link to").action(linkWorkspace);
14180
14298
  program.command("unlink").description("unlink current directory from its Postonus workspace").action(unlinkWorkspace);
14181
14299
  var collect = (value2, previous = []) => [...previous, value2];
14182
- var postCommand = program.command("post").alias("posts").description("create a post: scheduled, now, at the next optimal time, or as a draft").argument("[text]", "post content; also accepts piped stdin").option("-t, --to <platforms>", "comma-separated platforms, e.g. x,linkedin").option("-c, --channel <id>", "a channel id from `postonus channels list`; repeatable", collect).option("--channels <ids>", "channel ids; comma-separated or repeatable", collect).option("-a, --at <time>", "RFC 3339 time with an offset").option("-o, --optimal", "the next recommended window").option("--now", "publish as soon as the queue picks it up").option("-d, --draft", "save as a draft without scheduling").option("-f, --file <path>", "read content from a file").option("--thread-file <path>", "read a thread: segments separated by a line of ---").option("-e, --editor", "compose in $EDITOR").option("-m, --media <path...>", "attach local image or video files").option("--copy <channelId=text>", "text that replaces the body on one channel; repeatable", collect).option("--dry-run", "run every server check and show the result without saving").action(post);
14183
- postCommand.command("edit").description("change a post; only the flags given change").argument("<postId>", "post id from `postonus queue list`").argument("[text]", "new content").option("-t, --to <platforms>", "replace the channels with these platforms").option("-c, --channel <id>", "replace the channels with these ids; repeatable", collect).option("--channels <ids>", "alias for --channel", collect).option("-a, --at <time>", "move every channel to this RFC 3339 time").option("-f, --file <path>", "read new content from a file").option("--thread-file <path>", "replace the body with a thread file").option("-m, --media <path...>", "replace the media with these files").option("--copy <channelId=text>", "replace one channel's copy; repeatable", collect).option("--dry-run", "run every server check and show the result without saving").action(editPost);
14300
+ var postCommand = program.command("post").alias("posts").description("create a post: scheduled, now, at the next optimal time, or as a draft").argument("[text]", "post content; also accepts piped stdin").option("-t, --to <platforms>", "comma-separated platforms, e.g. x,linkedin").option("-c, --channel <id>", "a channel id from `postonus channels list`; repeatable", collect).option("--channels <ids>", "channel ids; comma-separated or repeatable", collect).option("-a, --at <time>", "RFC 3339 time with an offset").option("-o, --optimal", "the next recommended window").option("--now", "publish as soon as the queue picks it up").option("-d, --draft", "save as a draft without scheduling").option("-f, --file <path>", "read content from a file").option("--thread-file <path>", "read a thread: segments separated by a line of ---").option("-e, --editor", "compose in $EDITOR").option("-m, --media <path...>", "attach local image or video files").option("--copy <channelId=text>", "text that replaces the body on one channel; repeatable", collect).option(
14301
+ "--x-link-handling <handling>",
14302
+ "how to handle links in X posts: 'first_reply' (default), 'plain_text', or 'keep_live'"
14303
+ ).option("--dry-run", "run every server check and show the result without saving").action(post);
14304
+ postCommand.command("edit").description("change a post; only the flags given change").argument("<postId>", "post id from `postonus queue list`").argument("[text]", "new content").option("-t, --to <platforms>", "replace the channels with these platforms").option("-c, --channel <id>", "replace the channels with these ids; repeatable", collect).option("--channels <ids>", "alias for --channel", collect).option("-a, --at <time>", "move every channel to this RFC 3339 time").option("-f, --file <path>", "read new content from a file").option("--thread-file <path>", "replace the body with a thread file").option("-m, --media <path...>", "replace the media with these files").option("--copy <channelId=text>", "replace one channel's copy; repeatable", collect).option("--x-link-handling <handling>", "how to handle links in X posts: 'first_reply', 'plain_text', or 'keep_live'").option("--dry-run", "run every server check and show the result without saving").action(editPost);
14184
14305
  postCommand.command("delete").alias("rm").alias("del").description("delete a post and every schedule on it").argument("<postId>", "post id from `postonus queue list`").option("--remote", "also delete published copies on their platforms").option("-y, --yes", "skip confirmation prompt").action(deletePost);
14185
14306
  postCommand.command("retry").description("queue a failed schedule to publish again").argument("<scheduleId>", "schedule id from `postonus queue list --status failed`").option("--content <text>", "replacement copy for this channel only").action(retrySchedule);
14186
14307
  program.command("best-times").description("recommended posting windows for the given platforms").requiredOption("-t, --to <platforms>", "comma-separated platforms, e.g. x,linkedin").option("-n, --limit <count>", "how many times to list (1-20)", "5").option("--count <count>", "alias for --limit (deprecated)").action(bestTimes);