@postonus/cli 0.1.54 → 0.1.56

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
@@ -81,7 +81,6 @@ var PLAN_CONFIGS = {
81
81
  perPlatformMonthlyPosts: { TWITTER: 1e3 },
82
82
  mediaStorageGb: UNLIMITED,
83
83
  vaCredits: UNLIMITED,
84
- // Finite on purpose — see the `requestsPerMinute` doc comment.
85
84
  requestsPerMinute: 6e3,
86
85
  requestsPerMinutePerKey: 3e3,
87
86
  webRequestsPerMinute: 2400,
@@ -174,12 +173,6 @@ var SITE = {
174
173
  description: "Plan, automate and track your social content across platforms with ease.",
175
174
  shortDescription: "Post once and publish everywhere.",
176
175
  colorScheme: "light",
177
- /**
178
- * GA4 measurement id for the marketing site. Public by design — it ships in
179
- * the page source of every site that uses gtag — so it is a constant rather
180
- * than an env var, and there is nothing per-environment to configure. The tag
181
- * only loads in production, so a dev session cannot pollute the property.
182
- */
183
176
  gaMeasurementId: "G-896SCPPTRK"
184
177
  };
185
178
 
@@ -193,8 +186,6 @@ var scenarios = {
193
186
  "image/png",
194
187
  "image/webp",
195
188
  "image/gif",
196
- // Cloudflare re-encodes our CDN's image responses to AVIF, so a user who
197
- // downloads their own image and re-uploads it sends us one of these.
198
189
  "image/avif",
199
190
  "video/mp4",
200
191
  "video/webm",
@@ -6959,21 +6950,15 @@ var ActivityEventTypeSchema = _enum([
6959
6950
  ]);
6960
6951
  var ActivityActorSchema = object({
6961
6952
  userId: string2().nullable(),
6962
- // null for system events (e.g. approval_reset)
6963
6953
  name: string2().nullable(),
6964
6954
  image: string2().nullable(),
6965
6955
  organizationName: string2().nullable()
6966
- // for cross-org commenters; null otherwise
6967
6956
  });
6968
6957
  var ActivityEventSchema = object({
6969
6958
  id: string2(),
6970
- // stable id: `${type}:${sourceId}` (e.g. "review_decision:<uuid>")
6971
6959
  type: ActivityEventTypeSchema,
6972
6960
  occurredAt: Timestamp,
6973
6961
  actor: ActivityActorSchema,
6974
- // The event payload's shape is a function of `type` and is never branched on by
6975
- // the server — it is opaque data assembled for the client to render, matching
6976
- // the tRPC-era shape.
6977
6962
  data: unknown()
6978
6963
  });
6979
6964
  var tagged = base.route({ tags: ["Activity"] }).meta({ internal: true });
@@ -7363,7 +7348,6 @@ var AdminUserSchema = object({
7363
7348
  lastActiveAt: Timestamp.nullable(),
7364
7349
  workspaceCount: AggregateCount,
7365
7350
  apiKeyCount: AggregateCount,
7366
- /** Calls in the last 30 days. */
7367
7351
  apiCalls: AggregateCount,
7368
7352
  mcpCalls: AggregateCount,
7369
7353
  lastDeveloperCallAt: Timestamp.nullable()
@@ -7391,9 +7375,7 @@ var WorkspaceDeveloperUsageSchema = object({
7391
7375
  });
7392
7376
  var AdminUserListSchema = object({ users: array(AdminUserSchema), total: AggregateCount });
7393
7377
  var DeveloperUsageSchema = object({
7394
- /** Last 30 days, per user, workspace and credential. */
7395
7378
  callers: array(DeveloperCallerSchema),
7396
- /** Lifetime, per workspace. */
7397
7379
  workspaces: array(WorkspaceDeveloperUsageSchema)
7398
7380
  });
7399
7381
  var AdminEmailLogStatusSchema = _enum(["all", "sent", "bounced", "pending"]);
@@ -7541,12 +7523,6 @@ var ApiKeySchema = object({
7541
7523
  lastRequest: Timestamp.nullable(),
7542
7524
  expiresAt: Timestamp.nullable(),
7543
7525
  createdAt: Timestamp,
7544
- /**
7545
- * Calls in the last 30 days, from `api_usage_event`. Deliberately not
7546
- * better-auth's `apikey.requestCount`: that counter is lifetime and
7547
- * unwindowed, so it could never agree with the chart beside it. `lastRequest`
7548
- * stays as better-auth writes it — it outlives the event log's retention.
7549
- */
7550
7526
  callCount: AggregateCount
7551
7527
  });
7552
7528
  var CreatedApiKeySchema = object({
@@ -7570,20 +7546,8 @@ var CreateApiKeyInputSchema = object({
7570
7546
  var tagged2 = base.route({ tags: ["ApiKeys"] }).meta({ internal: true });
7571
7547
  var apiKeysContract = {
7572
7548
  list: tagged2.route({ method: "GET", path: "/api-keys", summary: "List the caller\u2019s API keys" }).errors(orgErrors).output(array(ApiKeySchema)),
7573
- /**
7574
- * Org-wide count, deliberately separate from `list` (which is scoped to the
7575
- * calling member per ADR-0002) — the cap counts every member's keys.
7576
- */
7577
7549
  usage: tagged2.route({ method: "GET", path: "/api-keys/usage", summary: "Get the org-wide API key cap usage" }).errors(orgErrors).output(ApiKeyUsageSchema),
7578
- /**
7579
- * `writableBase`, not `orgBase`: minting a credential is a write, so a
7580
- * read-only workspace must not be able to do it. An API-key caller never
7581
- * reaches the handler at all — the whole slice is `internal`, so
7582
- * `publicSurfaceMiddleware` answers NOT_FOUND. That is what keeps one leaked
7583
- * key from minting more.
7584
- */
7585
7550
  create: tagged2.route({ method: "POST", path: "/api-keys", summary: "Create an API key", successStatus: 201 }).errors(writableErrors).input(CreateApiKeyInputSchema).output(CreatedApiKeySchema),
7586
- /** `orgBase`, not `writableBase` — revoking a key is allowed even read-only. */
7587
7551
  revoke: tagged2.route({ method: "DELETE", path: "/api-keys/{id}", summary: "Revoke an API key" }).errors(orgErrors).input(IdPathParam).output(object({ id: string2() }))
7588
7552
  };
7589
7553
 
@@ -7632,7 +7596,6 @@ var CancelSubscriptionOutputSchema = object({
7632
7596
  var tagged4 = base.route({ tags: ["Billing"] }).meta({ internal: true });
7633
7597
  var billingContract = {
7634
7598
  getCancellationStats: tagged4.route({ method: "GET", path: "/billing/cancellation-stats", summary: "Get cancellation stats" }).errors(orgErrors).output(CancellationStatsSchema),
7635
- /** Only the billing owner may cancel — verified in the handler, not by the transport. */
7636
7599
  cancelSubscription: tagged4.route({ method: "POST", path: "/billing/cancel", summary: "Cancel the workspace subscription" }).errors({
7637
7600
  ...orgErrors,
7638
7601
  BAD_REQUEST: { message: "No active subscription to cancel." },
@@ -7691,23 +7654,16 @@ var UpdateShareLinkInputSchema = object({
7691
7654
  id: Uuid,
7692
7655
  allowComments: boolean2().optional(),
7693
7656
  audience: ShareAudienceSchema.optional(),
7694
- /** When present, replaces the whole recipient list. */
7695
7657
  recipientUserIds: RecipientUserIds,
7696
7658
  expiresAt: DateInput.optional().nullable()
7697
7659
  });
7698
7660
  var shareTagged = base.route({ tags: ["Share"] }).meta({ internal: true });
7699
7661
  var shareContract = {
7700
- /** Type-ahead for the "share with specific people" picker. */
7701
7662
  searchPeople: shareTagged.route({ method: "GET", path: "/share-links/people", summary: "Search workspace members to invite" }).errors(orgErrors).input(SearchSharePeopleInputSchema).output(array(SharePersonSchema)),
7702
7663
  createLink: shareTagged.route({ method: "POST", path: "/share-links", summary: "Create a post share link", successStatus: 201 }).errors(orgErrors).input(CreateShareLinkInputSchema).output(PostShareLinkWithTokenSchema),
7703
7664
  listLinks: shareTagged.route({ method: "GET", path: "/share-links", summary: "List share links for a post" }).errors(orgErrors).input(ListShareLinksInputSchema).output(array(PostShareLinkWithRecipientsSchema)),
7704
7665
  revokeLink: shareTagged.route({ method: "POST", path: "/share-links/{id}/revoke", summary: "Revoke a share link" }).errors(orgErrors).input(IdPathParam).output(PostShareLinkSchema),
7705
7666
  updateLink: shareTagged.route({ method: "PATCH", path: "/share-links/{id}", summary: "Update a share link" }).errors(orgErrors).input(UpdateShareLinkInputSchema).output(PostShareLinkSchema),
7706
- /**
7707
- * Issues a fresh token for an existing link and invalidates the old URL.
7708
- * Tokens are stored hashed, so the plaintext URL cannot be shown again after
7709
- * creation — rotating is how you recover a lost link.
7710
- */
7711
7667
  rotateLink: shareTagged.route({ method: "POST", path: "/share-links/{id}/rotate", summary: "Rotate a share link token" }).errors(orgErrors).input(IdPathParam).output(PostShareLinkWithTokenSchema)
7712
7668
  };
7713
7669
 
@@ -7761,7 +7717,6 @@ var UpdateCalendarShareLinkInputSchema = object({
7761
7717
  allowApprovals: boolean2().optional(),
7762
7718
  watermark: boolean2().optional(),
7763
7719
  audience: ShareAudienceSchema.optional(),
7764
- /** `null` clears the password, `undefined` leaves it unchanged. */
7765
7720
  password: SharePasswordSchema.optional().nullable(),
7766
7721
  expiresAt: DateInput.optional().nullable()
7767
7722
  });
@@ -7790,11 +7745,6 @@ var calendarShareContract = {
7790
7745
  listLinks: calendarShareTagged.route({ method: "GET", path: "/calendar-share-links", summary: "List calendar share links" }).errors(orgErrors).input(ListCalendarShareLinksInputSchema).output(array(CalendarShareLinkWithRecipientsSchema)),
7791
7746
  updateLink: calendarShareTagged.route({ method: "PATCH", path: "/calendar-share-links/{id}", summary: "Update a calendar share link" }).errors(orgErrors).input(UpdateCalendarShareLinkInputSchema).output(CalendarShareLinkSchema),
7792
7747
  revokeLink: calendarShareTagged.route({ method: "POST", path: "/calendar-share-links/{id}/revoke", summary: "Revoke a calendar share link" }).errors(orgErrors).input(IdPathParam).output(CalendarShareLinkSchema),
7793
- /**
7794
- * Names a reviewer on the link. Only meaningful once `audience` is
7795
- * `invited`, but allowed either way so the list can be filled in before
7796
- * switching the link over.
7797
- */
7798
7748
  addRecipient: calendarShareTagged.route({
7799
7749
  method: "POST",
7800
7750
  path: "/calendar-share-links/{id}/recipients",
@@ -7832,7 +7782,6 @@ var UpdateChannelGroupInputSchema = object({
7832
7782
  var publicTagged2 = base.route({ tags: ["Channel Groups"] });
7833
7783
  var tagged5 = publicTagged2.meta({ internal: true });
7834
7784
  var channelGroupsContract = {
7835
- // Public read: the composer in the browser extension shows group chips.
7836
7785
  get: publicTagged2.route({ method: "GET", path: "/channel-groups", summary: "List channel groups" }).errors(orgErrors).output(array(ChannelGroupSchema)),
7837
7786
  create: tagged5.route({ method: "POST", path: "/channel-groups", summary: "Create a channel group", successStatus: 201 }).errors({ ...orgErrors, CONFLICT: { message: "A Channel Group with this name already exists." } }).input(CreateChannelGroupInputSchema).output(ChannelGroupSchema),
7838
7787
  update: tagged5.route({ method: "PATCH", path: "/channel-groups/{id}", summary: "Rename or re-member a channel group" }).errors({ ...orgErrors, CONFLICT: { message: "A Channel Group with this name already exists." } }).input(UpdateChannelGroupInputSchema).output(ChannelGroupSchema),
@@ -7941,7 +7890,6 @@ var commentsContract = {
7941
7890
  var PlatformLimitsSchema = object({
7942
7891
  maxChars: number2().int(),
7943
7892
  maxCharsWithMedia: number2().int().nullable(),
7944
- /** `grapheme` where the platform counts an emoji as one; otherwise UTF-16 units. */
7945
7893
  countUnit: _enum(["grapheme", "utf16"]),
7946
7894
  maxTitleChars: number2().int().nullable(),
7947
7895
  supportsThreads: boolean2(),
@@ -7957,13 +7905,11 @@ var BestTimeSlotSchema = object({
7957
7905
  scheduledAt: Timestamp,
7958
7906
  platforms: array(string2()),
7959
7907
  strength: number2(),
7960
- /** Where the slot came from: the user's saved windows, research several platforms share, one platform's research, or a default. */
7961
7908
  source: _enum(["user", "consensus", "platform", "default"])
7962
7909
  });
7963
7910
  var BestTimesSchema = object({
7964
7911
  timezone: string2(),
7965
7912
  slots: array(BestTimeSlotSchema),
7966
- /** Requested platforms with no research data; their slots are a default, not a recommendation. */
7967
7913
  platformsWithoutData: array(PlatformSchema)
7968
7914
  });
7969
7915
  var BestTimesInputSchema = object({
@@ -7993,7 +7939,6 @@ var IntegrationSchema = object({
7993
7939
  id: Uuid,
7994
7940
  platform: PlatformSchema,
7995
7941
  name: string2(),
7996
- // The account handle. Two channels on one platform can share a display name.
7997
7942
  username: string2().nullable(),
7998
7943
  image: string2(),
7999
7944
  tokenStatus: IntegrationTokenStatusSchema,
@@ -8004,7 +7949,6 @@ var IntegrationSchema = object({
8004
7949
  expiresAt: Timestamp.nullable(),
8005
7950
  autoRefreshUnavailable: boolean2(),
8006
7951
  hasFailedSchedules: boolean2(),
8007
- /** The channel's publishing limits, the same values `GET /platforms/rules` reports for its platform. */
8008
7952
  limits: PlatformLimitsSchema
8009
7953
  });
8010
7954
  var UnhealthyIntegrationSchema = object({
@@ -8175,11 +8119,6 @@ var CompleteUploadInputSchema = object({
8175
8119
  uploadId: Uuid,
8176
8120
  checksum: ChecksumSchema,
8177
8121
  multipartParts: array(object({ partNumber: number2().int().positive(), etag: string2().min(1) })).optional(),
8178
- /**
8179
- * Scenario-specific payload, validated against that scenario's own schema in
8180
- * `uploadScenarios` rather than here — the wire shape stays the same for every
8181
- * scenario while what each one accepts does not.
8182
- */
8183
8122
  input: record(string2(), unknown()).optional()
8184
8123
  });
8185
8124
  var CompleteUploadOutputSchema = object({
@@ -8193,7 +8132,6 @@ var CompleteUploadOutputSchema = object({
8193
8132
  bytes: number2().int().optional(),
8194
8133
  variants: MediaVariantsSchema.nullable(),
8195
8134
  variantsStatus: MediaVariantsStatusSchema.nullable(),
8196
- /** Set only by scenarios that change something the client renders immediately (`user_avatar`). */
8197
8135
  avatarUrl: string2().nullable()
8198
8136
  });
8199
8137
  var DeleteFileInputSchema = object({ uploadId: Uuid });
@@ -8212,12 +8150,7 @@ var tagged9 = base.route({ tags: ["Uploads"] });
8212
8150
  var uploadContract = {
8213
8151
  initiateUpload: tagged9.route({ method: "POST", path: "/uploads/initiate", summary: "Get a signed URL to upload a file" }).errors(uploadErrors).input(InitiateUploadInputSchema).output(InitiateUploadOutputSchema),
8214
8152
  completeUpload: tagged9.route({ method: "POST", path: "/uploads/complete", summary: "Complete an upload once its bytes are in storage" }).errors(uploadErrors).input(CompleteUploadInputSchema).output(CompleteUploadOutputSchema),
8215
- /** Org-scoped, not gated on `canWrite` — deleting is always allowed, even read-only. */
8216
8153
  deleteFile: tagged9.route({ method: "DELETE", path: "/uploads/{uploadId}", summary: "Delete an uploaded file" }).errors(orgErrors).input(DeleteFileInputSchema).output(DeletedSchema),
8217
- /**
8218
- * Fetches a caller-supplied URL server-side (through `fetchPublicUrl`'s SSRF
8219
- * guard) and stores the result as a completed upload.
8220
- */
8221
8154
  fromUrl: tagged9.route({
8222
8155
  method: "POST",
8223
8156
  path: "/uploads/from-url",
@@ -8233,7 +8166,6 @@ var MediaFolderFilterSchema = union([Uuid, literal("unfiled")]);
8233
8166
  var MediaFolderParentSchema = Uuid.nullable();
8234
8167
  var LibraryMediaSchema = object({
8235
8168
  id: Uuid,
8236
- /** Null for an asset that arrived with no filename to borrow — a GIPHY link. */
8237
8169
  name: string2().nullable(),
8238
8170
  url: string2(),
8239
8171
  type: MediaTypeSchema,
@@ -8253,7 +8185,6 @@ var MediaFolderSchema = object({
8253
8185
  id: Uuid,
8254
8186
  name: string2(),
8255
8187
  parentId: Uuid.nullable(),
8256
- /** Direct members only. A parent folder does not count what its children hold. */
8257
8188
  mediaCount: AggregateCount,
8258
8189
  createdAt: Timestamp
8259
8190
  });
@@ -8272,7 +8203,6 @@ var ListMediaOutputSchema = object({
8272
8203
  });
8273
8204
  var ListMediaFoldersOutputSchema = object({
8274
8205
  folders: array(MediaFolderSchema),
8275
- /** For the rail's two fixed rows, which are not folders and have no id. */
8276
8206
  totalCount: AggregateCount,
8277
8207
  unfiledCount: AggregateCount
8278
8208
  });
@@ -8288,7 +8218,6 @@ var UpdateMediaFolderInputSchema = object({
8288
8218
  var UpdateMediaInputSchema = object({
8289
8219
  id: Uuid,
8290
8220
  name: MediaNameSchema.optional(),
8291
- /** Absent leaves the asset where it is; null unfiles it. */
8292
8221
  folderId: Uuid.nullish()
8293
8222
  });
8294
8223
  var MoveMediaInputSchema = object({
@@ -8310,8 +8239,6 @@ var folderErrors = {
8310
8239
  };
8311
8240
  var mediaContract = {
8312
8241
  list: internal6.route({ method: "GET", path: "/media", summary: "List library media" }).errors(orgErrors).input(ListMediaInputSchema).output(ListMediaOutputSchema),
8313
- // Declared before `getById` for readability only — oRPC matches a literal
8314
- // segment ahead of a path parameter regardless of declaration order.
8315
8242
  listFolders: internal6.route({ method: "GET", path: "/media/folders", summary: "List media folders with counts" }).errors(orgErrors).output(ListMediaFoldersOutputSchema),
8316
8243
  createFolder: internal6.route({ method: "POST", path: "/media/folders", summary: "Create a media folder", successStatus: 201 }).errors({ ...writableErrors, CONFLICT: { message: "A folder with that name already exists here." } }).input(CreateMediaFolderInputSchema).output(MediaFolderSchema),
8317
8244
  updateFolder: internal6.route({ method: "PATCH", path: "/media/folders/{id}", summary: "Rename or move a media folder" }).errors({ ...folderErrors, CONFLICT: { message: "A folder with that name already exists here." } }).input(UpdateMediaFolderInputSchema).output(MediaFolderSchema),
@@ -8333,7 +8260,6 @@ var MediaSourceSchema = object({
8333
8260
  comingSoon: boolean2().optional(),
8334
8261
  enabled: boolean2(),
8335
8262
  configured: boolean2(),
8336
- /** Only the public env keys a picker widget needs client-side (never a secret). */
8337
8263
  clientConfig: record(string2(), string2())
8338
8264
  });
8339
8265
  var SourceIdInputSchema = object({ sourceId: string2() });
@@ -8349,7 +8275,6 @@ var ImportedAssetSchema = object({
8349
8275
  width: number2().int().positive().optional(),
8350
8276
  height: number2().int().positive().optional(),
8351
8277
  thumbnailUrl: string2().url().optional(),
8352
- /** Unsplash ToS download-location ping. */
8353
8278
  downloadLocation: string2().url().optional()
8354
8279
  });
8355
8280
  var ImportAssetInputSchema = object({ asset: ImportedAssetSchema, scenario: literal("post_attachments") });
@@ -8420,12 +8345,7 @@ var NotificationSchema = object({
8420
8345
  var WorkspaceUnreadCountSchema = object({ organizationId: string2(), unread: number2().int() });
8421
8346
  var tagged12 = base.route({ tags: ["Notifications"] }).meta({ internal: true });
8422
8347
  var notificationsContract = {
8423
- /** Full history across every workspace — backs the standalone /notifications page. */
8424
8348
  list: tagged12.route({ method: "GET", path: "/notifications", summary: "List notifications across every workspace" }).errors(authedErrors).input(object({ limit: number2().int().positive().max(100).optional() })).output(object({ notifications: array(NotificationSchema) })),
8425
- /**
8426
- * Bell-dropdown feed: current workspace + user-global rows, plus a compact
8427
- * "other workspaces" unread summary.
8428
- */
8429
8349
  bellFeed: tagged12.route({ method: "GET", path: "/notifications/bell-feed", summary: "Get the bell-dropdown notification feed" }).errors(orgErrors).input(object({ limit: number2().int().positive().max(50).optional() })).output(
8430
8350
  object({
8431
8351
  notifications: array(NotificationSchema),
@@ -8505,12 +8425,6 @@ var SharedPostFields = {
8505
8425
  integrationSettings: IntegrationSettingsInputSchema.optional(),
8506
8426
  subreddit: string2().trim().min(1).optional(),
8507
8427
  xLinkHandling: _enum(["first_reply", "plain_text", "keep_live"]).optional(),
8508
- /**
8509
- * Which of the post's media each channel publishes, in publish order, by url.
8510
- * Omit a channel to send it as much of the post's media as its platform can
8511
- * carry — the caps live in `@postonus/integrations`, so the API never asks the
8512
- * caller to know them.
8513
- */
8514
8428
  integrationMedia: record(string2(), array(string2())).optional(),
8515
8429
  integrationTimeOffsets: record(string2(), number2().int().min(-12).max(12)).optional(),
8516
8430
  delivery: _enum(SCHEDULE_DELIVERY_VALUES).optional(),
@@ -8526,11 +8440,6 @@ var CreatePostRowSchema = object({
8526
8440
  var ThreadSchema = array(string2().trim().min(1).max(DRAFT_MAX_CHARS)).min(2).max(MAX_THREAD_SEGMENTS);
8527
8441
  var DryRunField = boolean2().optional();
8528
8442
  var TargetFields = {
8529
- /**
8530
- * Every active channel on these platforms. The alternative to
8531
- * `selectedIntegrations`, which names channels by id and is the only way to pick
8532
- * between two channels on one platform.
8533
- */
8534
8443
  platforms: array(PlatformSchema).min(1).optional(),
8535
8444
  thread: ThreadSchema.optional()
8536
8445
  };
@@ -8556,7 +8465,6 @@ var UpdatePostInputSchema = object({
8556
8465
  media: array(PostMediaInputSchema).optional(),
8557
8466
  scheduledAt: InstantInput.nullable().optional(),
8558
8467
  postAction: PostActionEnum.optional(),
8559
- /** Move named schedules individually. Applied after the rest of the update. */
8560
8468
  scheduleTimes: array(object({ scheduleId: Uuid, scheduledAt: InstantInput })).min(1).optional(),
8561
8469
  dryRun: DryRunField,
8562
8470
  ...SharedPostFields,
@@ -8575,7 +8483,6 @@ var ScheduleDraftInputSchema = object({
8575
8483
  id: Uuid,
8576
8484
  scheduledAt: InstantInput.optional(),
8577
8485
  useOptimalTime: boolean2().optional(),
8578
- // Required when the draft was saved with no channels; replaces them otherwise.
8579
8486
  selectedIntegrations: array(string2()).min(1).optional(),
8580
8487
  platforms: array(PlatformSchema).min(1).optional(),
8581
8488
  delivery: _enum(SCHEDULE_DELIVERY_VALUES).optional(),
@@ -8613,14 +8520,7 @@ var AddChannelsInputSchema = object({
8613
8520
  });
8614
8521
  var RetryScheduleInputSchema = object({
8615
8522
  scheduleId: Uuid,
8616
- /** Replacement copy for this channel only. Omitted leaves it as it was. */
8617
8523
  content: string2().trim().max(DRAFT_MAX_CHARS).optional(),
8618
- /**
8619
- * Which of the post's existing attachments this channel publishes, in order.
8620
- * Must be a subset of what the post already has: adding media would mean
8621
- * writing the post, which is shared with channels that may have published.
8622
- * An empty array publishes this channel with no media.
8623
- */
8624
8524
  attachmentMediaUrls: array(string2()).optional()
8625
8525
  });
8626
8526
  var RescheduleInputSchema = object({ scheduleId: Uuid, scheduledAt: InstantInput });
@@ -8673,12 +8573,10 @@ var PostScheduleSchema = object({
8673
8573
  publishedAt: Timestamp.nullable(),
8674
8574
  failureReason: string2().nullable(),
8675
8575
  failureDetail: ScheduleFailureDetailSchema.nullable(),
8676
- /** Set when the platform removed the post after we published it. */
8677
8576
  platformDeletedAt: Timestamp.nullable(),
8678
8577
  scheduledContent: string2().nullable(),
8679
8578
  firstComment: string2().nullable(),
8680
8579
  settings: record(string2(), unknown()).nullable(),
8681
- /** Null means this channel publishes every attachment the post has. */
8682
8580
  attachmentMediaUrls: array(string2()).nullable().optional(),
8683
8581
  platformPostId: string2().nullable(),
8684
8582
  releaseUrl: string2().nullable(),
@@ -8732,11 +8630,6 @@ var MediaMetadataSchema = object({
8732
8630
  variants: MediaVariantsSchema.nullable(),
8733
8631
  variantsStatus: MediaVariantsStatusSchema.nullable(),
8734
8632
  durationMs: number2().int().nullable(),
8735
- /**
8736
- * The frame captured for this video after upload, used as its cover wherever
8737
- * the post names none. Null for images, and for a video whose capture has not
8738
- * finished yet — the composer polls until it appears.
8739
- */
8740
8633
  autoCover: object({ id: string2(), url: string2(), timestampMs: number2().int().nullable() }).nullable()
8741
8634
  });
8742
8635
  var PostScheduleStateSchema = object({
@@ -8754,11 +8647,8 @@ var PostStateSchema = object({
8754
8647
  thread: array(string2()).nullable(),
8755
8648
  media: array(object({ url: string2(), type: MediaTypeSchema, altText: string2().nullable() })),
8756
8649
  schedules: array(PostScheduleStateSchema),
8757
- /** The post in the dashboard, for a human to take over. */
8758
8650
  url: string2(),
8759
- /** `pending` while the workspace's review gate holds the post. */
8760
8651
  review: _enum(["pending"]).nullable(),
8761
- /** True when the write was rehearsed with `dryRun` and nothing was stored. */
8762
8652
  dryRun: boolean2()
8763
8653
  });
8764
8654
  var CreatePostsOutputSchema = object({ posts: array(PostStateSchema) });
@@ -8839,8 +8729,6 @@ var idempotent = tagged13.route({
8839
8729
  var internal7 = tagged13.meta({ internal: true });
8840
8730
  var postsContract = {
8841
8731
  list: tagged13.route({ method: "GET", path: "/posts", summary: "List posts" }).errors(orgErrors).input(ListPostsInputSchema).output(PostsListOutputSchema),
8842
- // Declared before `getById` so `/posts/counts` is not read as `/posts/{id}`.
8843
- // Dashboard plumbing: the status segment row on `/posts`.
8844
8732
  counts: internal7.route({ method: "GET", path: "/posts/counts", summary: "Count posts per status" }).errors(orgErrors).input(CountPostsInputSchema).output(CountPostsOutputSchema),
8845
8733
  getById: tagged13.route({ method: "GET", path: "/posts/{id}", summary: "Get a post" }).errors(orgErrors).input(IdPathParam).output(PostWithRelationsSchema),
8846
8734
  mediaById: internal7.route({ method: "GET", path: "/posts/media/{id}", summary: "Get post media metadata" }).errors(orgErrors).input(IdPathParam).output(MediaMetadataSchema),
@@ -8890,8 +8778,6 @@ var CalendarReadInputSchema = CalendarTokenPathParam.extend({ accessKey: string2
8890
8778
  var CalendarScheduleReadInputSchema = CalendarReadInputSchema.extend({ postScheduleId: Uuid });
8891
8779
  var ReviewerIdentityFields = {
8892
8780
  reviewerName: string2().trim().min(1).max(100),
8893
- // Not optional. A decision with no email identifies nobody, so it can be
8894
- // neither deduplicated nor attributed.
8895
8781
  reviewerEmail: string2().trim().toLowerCase().email()
8896
8782
  };
8897
8783
  var CalendarUnlockInputSchema = CalendarTokenPathParam.extend({ password: string2().min(1) });
@@ -8902,10 +8788,8 @@ var PublicCalendarMetaSchema = object({
8902
8788
  allowComments: boolean2(),
8903
8789
  allowApprovals: boolean2(),
8904
8790
  watermark: boolean2(),
8905
- /** Lets the identity prompt say which email to use. The allow-list is checked server-side when a decision arrives. */
8906
8791
  audience: ShareAudienceSchema,
8907
8792
  passwordProtected: boolean2(),
8908
- /** The zone the schedules were planned in — the link creator's, not the viewer's. */
8909
8793
  timezone: string2()
8910
8794
  });
8911
8795
  var PublicScheduleMediaSchema = object({
@@ -8940,10 +8824,6 @@ var PublicScheduleSchema = object({
8940
8824
  approvalCompletedAt: Timestamp.nullable(),
8941
8825
  integrationName: string2(),
8942
8826
  integrationImage: string2().nullable(),
8943
- /**
8944
- * Every post in this card's thread, in publish order. Empty when the card is a
8945
- * single post — so an empty list means "render the body", not "a thread of none".
8946
- */
8947
8827
  threadSegments: array(string2()),
8948
8828
  media: array(PublicScheduleMediaSchema),
8949
8829
  reviews: array(PublicScheduleReviewSchema),
@@ -8975,7 +8855,6 @@ var AddCommentOutputSchema = object({
8975
8855
  var ListCommentsInputSchema = CalendarScheduleReadInputSchema;
8976
8856
  var calendarTagged = base.route({ tags: ["Public Calendar"] }).meta({ internal: true });
8977
8857
  var publicCalendarContract = {
8978
- /** `publicCalendar.unlock` only. Tighter bucket, and reaches a still-locked link. */
8979
8858
  unlock: calendarTagged.route({
8980
8859
  method: "POST",
8981
8860
  path: "/calendar-share/{token}/unlock",
@@ -8988,11 +8867,6 @@ var publicCalendarContract = {
8988
8867
  summary: "Read a shared calendar",
8989
8868
  spec: anonymous
8990
8869
  }).errors(shareErrors).input(GetCalendarInputSchema).output(PublicCalendarSchema),
8991
- /**
8992
- * Deciding is gated; *viewing* is not. A viewer has no way to prove an email
8993
- * before the identity prompt, so gating `getCalendar` would make the link
8994
- * unopenable for the very people it names.
8995
- */
8996
8870
  submitDecision: calendarTagged.route({
8997
8871
  method: "POST",
8998
8872
  path: "/calendar-share/{token}/schedules/{postScheduleId}/decision",
@@ -9045,10 +8919,6 @@ var SharedPostVariantSchema = object({
9045
8919
  scheduledContent: string2().nullable(),
9046
8920
  firstComment: string2().nullable(),
9047
8921
  scheduledAt: Timestamp.nullable(),
9048
- /**
9049
- * Every post in this channel's thread, in publish order. Empty when the channel
9050
- * sends a single post, which is what tells the view to render the body instead.
9051
- */
9052
8922
  threadSegments: array(string2())
9053
8923
  });
9054
8924
  var SharedPostSchema = object({
@@ -9071,13 +8941,6 @@ var SharedPostViewSchema = object({
9071
8941
  });
9072
8942
  var publicPostTagged = base.route({ tags: ["Public Post"] }).meta({ internal: true });
9073
8943
  var publicPostContract = {
9074
- /**
9075
- * The one anonymous read that used to sit on a bare `publicProcedure`: no
9076
- * bucket, and an unconditional view-count update per call, so a leaked link
9077
- * was an unmetered write loop. Graceful — an invite-only link this viewer is
9078
- * not on resolves to a "who are you" screen, not an error, so they can sign
9079
- * in with the right account.
9080
- */
9081
8944
  getByShareToken: publicPostTagged.route({ method: "GET", path: "/share/{token}/post", summary: "Read a shared post", spec: anonymous2 }).errors(shareErrors).input(TokenPathParam).output(SharedPostViewSchema)
9082
8945
  };
9083
8946
 
@@ -9117,7 +8980,6 @@ var recycleRuleTagged = base.route({ tags: ["Recycle Rules"] }).meta({ internal:
9117
8980
  var recycleRulesContract = {
9118
8981
  list: recycleRuleTagged.route({ method: "GET", path: "/recycle-rules", summary: "List recycle rules" }).errors(orgErrors).output(array(RecycleRuleSchema)),
9119
8982
  getById: recycleRuleTagged.route({ method: "GET", path: "/recycle-rules/{id}", summary: "Get a recycle rule" }).errors(orgErrors).input(IdPathParam).output(RecycleRuleSchema),
9120
- /** `publishErrors`: recycle rules spend money outbound, same as scheduling and publishing. */
9121
8983
  create: recycleRuleTagged.route({ method: "POST", path: "/recycle-rules", summary: "Create a recycle rule", successStatus: 201 }).errors(publishErrors).input(CreateRecycleRuleInputSchema).output(RecycleRuleSchema),
9122
8984
  update: recycleRuleTagged.route({ method: "PATCH", path: "/recycle-rules/{id}", summary: "Update a recycle rule" }).errors(publishErrors).input(UpdateRecycleRuleInputSchema).output(RecycleRuleSchema),
9123
8985
  delete: recycleRuleTagged.route({ method: "DELETE", path: "/recycle-rules/{id}", summary: "Delete a recycle rule" }).errors(orgErrors).input(IdPathParam).output(DeletedSchema)
@@ -9383,11 +9245,6 @@ var draftsContract = {
9383
9245
  }).errors(orgErrors).input(object({ workflowId: Uuid, limit: number2().int().min(1).max(100).optional() })).output(array(DraftListItemSchema))
9384
9246
  };
9385
9247
  var runsContract = {
9386
- /**
9387
- * Declared before `get` for readability only, as with `tags.getUsageCounts` —
9388
- * oRPC matches the literal `recent-statuses` segment ahead of `{runId}`
9389
- * regardless of declaration order.
9390
- */
9391
9248
  recentStatuses: tagged14.route({
9392
9249
  method: "GET",
9393
9250
  path: "/repurpose/workflows/{workflowId}/runs/recent-statuses",
@@ -9540,13 +9397,6 @@ var ReviewStatusSchema = object({
9540
9397
  var tagged15 = base.route({ tags: ["Reviews"] }).meta({ internal: true });
9541
9398
  var reviewsContract = {
9542
9399
  getStatus: tagged15.route({ method: "GET", path: "/posts/{postId}/reviews/status", summary: "Get review status and history" }).errors(orgErrors).input(object({ postId: Uuid, postScheduleId: Uuid.optional() })).output(ReviewStatusSchema),
9543
- /**
9544
- * Sends mail from our domain to addresses the caller names, so it spends
9545
- * outbound reputation — `publishBase`, not `writableBase`, same rule as
9546
- * invitations. Approver ids are validated as members of the caller's org
9547
- * before anything is queued, so a caller cannot use this to email an
9548
- * arbitrary address.
9549
- */
9550
9400
  requestReview: tagged15.route({ method: "POST", path: "/posts/{postId}/reviews/request", summary: "Request review of a post" }).errors(publishErrors).input(
9551
9401
  object({
9552
9402
  postId: Uuid,
@@ -9574,10 +9424,6 @@ var ListSchedulesInputSchema = object({
9574
9424
  limit: coerce_exports.number().int().min(1).max(100).default(20),
9575
9425
  cursor: ScheduleListCursorInputSchema.optional(),
9576
9426
  direction: _enum(["forward", "backward"]).default("forward"),
9577
- // Enums, not free strings. Both reach a Postgres enum column, so a value
9578
- // outside the set is not a typed refusal but a query that throws — the
9579
- // endpoint answered 500 for `statuses[]=PENDING`, a status that has never
9580
- // existed. `posts.ts` already types the equivalent filters this way.
9581
9427
  platforms: array(PlatformSchema).optional(),
9582
9428
  statuses: array(_enum(SCHEDULE_STATUS_VALUES)).optional(),
9583
9429
  integrationIds: array(string2()).optional(),
@@ -9599,11 +9445,6 @@ var CountSchedulesInputSchema = object({
9599
9445
  var GetScheduleByIdInputSchema = object({ id: Uuid, postId: Uuid });
9600
9446
  var DeleteScheduleInputSchema = object({
9601
9447
  id: Uuid,
9602
- /**
9603
- * Also delete the post on the platform. Ignored for a channel that never
9604
- * published — there is nothing live to take down — and refused on Instagram,
9605
- * Threads and TikTok, whose APIs cannot delete a post at all.
9606
- */
9607
9448
  deleteRemote: boolean2().default(false)
9608
9449
  });
9609
9450
  var ScheduleListItemSchema = object({
@@ -9618,7 +9459,6 @@ var ScheduleListItemSchema = object({
9618
9459
  originRecycleEventId: string2().nullable(),
9619
9460
  failureReason: string2().nullable(),
9620
9461
  failureDetail: ScheduleFailureDetailSchema.nullable(),
9621
- /** Set when the platform removed the post after we published it. */
9622
9462
  platformDeletedAt: Timestamp.nullable(),
9623
9463
  scheduledContent: string2().nullable(),
9624
9464
  retryCount: number2(),
@@ -9628,22 +9468,11 @@ var ScheduleListItemSchema = object({
9628
9468
  approvalStatus: _enum(APPROVAL_STATUS_VALUES).nullable(),
9629
9469
  approvalRequestedAt: Timestamp.nullable(),
9630
9470
  approvalCompletedAt: Timestamp.nullable(),
9631
- /**
9632
- * Posts in this row's thread, itself included. 1 for a plain schedule.
9633
- *
9634
- * The list returns thread roots only, so a chip needs this to say "and six
9635
- * more" rather than showing the opening segment as the whole post.
9636
- */
9637
9471
  threadTotal: number2().int().min(1),
9638
9472
  post: object({
9639
9473
  id: string2(),
9640
9474
  content: string2(),
9641
9475
  createdAt: Timestamp,
9642
- /**
9643
- * The post's first attachment, for the calendar cell that leads with an
9644
- * image. `type` is the attachment's own type, so a VIDEO still reads as a
9645
- * video even though `url` is its poster frame.
9646
- */
9647
9476
  thumbnail: object({
9648
9477
  url: string2(),
9649
9478
  type: MediaTypeSchema,
@@ -9688,7 +9517,6 @@ var ScheduleWithIntegrationSchema = object({
9688
9517
  originRecycleEventId: string2().nullable(),
9689
9518
  failureReason: string2().nullable(),
9690
9519
  failureDetail: ScheduleFailureDetailSchema.nullable(),
9691
- /** Set when the platform removed the post after we published it. */
9692
9520
  platformDeletedAt: Timestamp.nullable(),
9693
9521
  scheduledContent: string2().nullable(),
9694
9522
  retryCount: number2(),
@@ -9698,20 +9526,16 @@ var ScheduleWithIntegrationSchema = object({
9698
9526
  approvalStatus: _enum(APPROVAL_STATUS_VALUES).nullable(),
9699
9527
  approvalRequestedAt: Timestamp.nullable(),
9700
9528
  approvalCompletedAt: Timestamp.nullable(),
9701
- /** 0 on the root and on a plain schedule; 1..N down a thread. */
9702
9529
  threadOrder: number2().int(),
9703
9530
  integration: object({ id: string2(), platform: PlatformSchema, name: string2(), tokenStatus: string2() }),
9704
9531
  post: PostRowSchema
9705
9532
  });
9706
9533
  var ScheduleWithPostSchema = PostRowSchema.extend({
9707
- /** The requested schedule, followed by the rest of its thread in publish order. */
9708
9534
  schedules: array(ScheduleWithIntegrationSchema)
9709
9535
  });
9710
9536
  var tagged16 = base.route({ tags: ["Schedules"] });
9711
9537
  var schedulesContract = {
9712
9538
  list: tagged16.route({ method: "GET", path: "/schedules", summary: "List schedules (calendar view)" }).errors(orgErrors).input(ListSchedulesInputSchema).output(ListSchedulesOutputSchema),
9713
- // Dashboard plumbing: the status segment row on `/posts` and `/calendar`. No
9714
- // external caller needs it, so it stays out of the public surface.
9715
9539
  counts: tagged16.route({ method: "GET", path: "/schedules/counts", summary: "Count schedules per status" }).meta({ internal: true }).errors(orgErrors).input(CountSchedulesInputSchema).output(CountSchedulesOutputSchema),
9716
9540
  getById: tagged16.route({ method: "GET", path: "/schedules/{id}", summary: "Get a schedule" }).errors(orgErrors).input(GetScheduleByIdInputSchema).output(ScheduleWithPostSchema),
9717
9541
  delete: tagged16.route({ method: "DELETE", path: "/schedules/{id}", summary: "Delete a schedule" }).errors({ ...writableErrors, ...postDomainErrors }).input(DeleteScheduleInputSchema).output(DeletedSchema)
@@ -9829,11 +9653,6 @@ var tagged17 = base.route({ tags: ["Tags"] });
9829
9653
  var internal10 = tagged17.meta({ internal: true });
9830
9654
  var tagsContract = {
9831
9655
  list: tagged17.route({ method: "GET", path: "/tags", summary: "List tags" }).errors(orgErrors).output(array(TagSchema)),
9832
- /**
9833
- * Declared before `getById` for readability only — oRPC matches a literal
9834
- * segment ahead of a path parameter regardless of declaration order, so
9835
- * `/tags/usage-counts` never resolves as `/tags/{id}`.
9836
- */
9837
9656
  getUsageCounts: internal10.route({ method: "GET", path: "/tags/usage-counts", summary: "Count posts per tag" }).errors(orgErrors).output(array(TagUsageCountSchema)),
9838
9657
  getById: tagged17.route({ method: "GET", path: "/tags/{id}", summary: "Get a tag" }).errors(orgErrors).input(IdPathParam).output(TagSchema),
9839
9658
  create: internal10.route({ method: "POST", path: "/tags", summary: "Create a tag", successStatus: 201 }).errors({ ...writableErrors, CONFLICT: { message: "A tag with that name already exists." } }).input(CreateTagInputSchema).output(TagSchema),
@@ -9855,7 +9674,6 @@ var UsageSummarySchema = object({
9855
9674
  mcp: SurfaceTotalsSchema
9856
9675
  });
9857
9676
  var UsageDailyPointSchema = object({
9858
- /** `YYYY-MM-DD`, UTC. Every day in the window is present, including silent ones. */
9859
9677
  day: string2(),
9860
9678
  calls: AggregateCount,
9861
9679
  errors: AggregateCount
@@ -9863,13 +9681,11 @@ var UsageDailyPointSchema = object({
9863
9681
  var UsageEventSchema = object({
9864
9682
  id: number2().int(),
9865
9683
  surface: UsageSurfaceSchema,
9866
- /** Contract path for `api`, tool name for `mcp`. */
9867
9684
  operation: string2(),
9868
9685
  status: _enum(["ok", "error"]),
9869
9686
  statusCode: number2().int().nullable(),
9870
9687
  durationMs: number2().int(),
9871
9688
  callerKind: _enum(["api-key", "assistant", "unknown"]),
9872
- /** Key name or assistant name, resolved by the handler. */
9873
9689
  callerLabel: string2().nullable(),
9874
9690
  createdAt: Timestamp
9875
9691
  });
@@ -9882,7 +9698,6 @@ var usageContract = {
9882
9698
  object({
9883
9699
  surface: UsageSurfaceSchema.optional(),
9884
9700
  limit: coerce_exports.number().int().min(1).max(100).default(25),
9885
- /** `id` of the last row from the previous page. */
9886
9701
  cursor: coerce_exports.number().int().positive().optional()
9887
9702
  })
9888
9703
  ).output(
@@ -9904,7 +9719,6 @@ var MeSchema = object({
9904
9719
  createdAt: Timestamp,
9905
9720
  updatedAt: Timestamp,
9906
9721
  defaultOrganizationId: string2().nullable(),
9907
- /** Who the user posts for. Null until they answer the one onboarding question. */
9908
9722
  postingFor: _enum(POSTING_FOR_VALUES).nullable()
9909
9723
  });
9910
9724
  var UserAccountSchema = object({
@@ -10012,8 +9826,6 @@ var PlatformQuotaSchema = object({
10012
9826
  var PlanQuotaSchema = object({
10013
9827
  plan: string2().nullable(),
10014
9828
  periodStart: Timestamp,
10015
- // `partialRecord`, not `record`: only the requested platforms are present,
10016
- // matching `Partial<Record<Platform, PlatformQuota>>` on the old tRPC output.
10017
9829
  platforms: partialRecord(PlatformEnum, PlatformQuotaSchema)
10018
9830
  });
10019
9831
  var AiQuotaSchema = object({
@@ -10059,9 +9871,6 @@ var CreateWorkspaceInputSchema = object({
10059
9871
  });
10060
9872
  var OwnedCapacitySchema = object({
10061
9873
  planKey: string2().nullable(),
10062
- // `ownedWorkspaces` can be `UNLIMITED` (`Number.POSITIVE_INFINITY`), which
10063
- // `JSON.stringify` silently turns into `null` — nullable here so the contract
10064
- // states what the wire actually carries, and the handler converts explicitly.
10065
9874
  limit: number2().nullable(),
10066
9875
  used: number2(),
10067
9876
  overLimit: boolean2()
@@ -10096,11 +9905,6 @@ var WorkspaceSummarySchema = object({
10096
9905
  var publicTagged4 = base.route({ tags: ["Workspace"] });
10097
9906
  var tagged20 = publicTagged4.meta({ internal: true });
10098
9907
  var workspaceContract = {
10099
- /**
10100
- * Public, so an OAuth client can offer a workspace switcher: the chosen id goes
10101
- * back as `x-workspace-id`. An API key is pinned to one workspace, so it lists
10102
- * only that one.
10103
- */
10104
9908
  list: publicTagged4.route({ method: "GET", path: "/workspaces", summary: "List your workspaces" }).errors(authedErrors).output(array(WorkspaceSummarySchema)),
10105
9909
  getOwnedCapacity: tagged20.route({ method: "GET", path: "/workspaces/owned-capacity", summary: "Get owned workspace capacity" }).errors(authedErrors).output(OwnedCapacitySchema),
10106
9910
  create: tagged20.route({ method: "POST", path: "/workspaces", summary: "Create a workspace", successStatus: 201 }).errors({
@@ -10108,11 +9912,6 @@ var workspaceContract = {
10108
9912
  FORBIDDEN: { message: "You have reached your workspace capacity." },
10109
9913
  INTERNAL_SERVER_ERROR: { message: "Failed to create workspace." }
10110
9914
  }).input(CreateWorkspaceInputSchema).output(WorkspaceSchema),
10111
- /**
10112
- * Not org-scoped through `orgBase` — the caller may not have the target
10113
- * workspace active. Ownership is verified against the `organizationId` in
10114
- * the body, exactly as the tRPC procedure did.
10115
- */
10116
9915
  transferOwnership: tagged20.route({
10117
9916
  method: "POST",
10118
9917
  path: "/workspaces/{organizationId}/transfer-ownership",
@@ -12965,7 +12764,7 @@ function formatTable(headers, rows, isTty = process.stdout.isTTY) {
12965
12764
  }
12966
12765
 
12967
12766
  // src/version.ts
12968
- var CLI_VERSION = "0.1.54";
12767
+ var CLI_VERSION = "0.1.56";
12969
12768
 
12970
12769
  // src/client.ts
12971
12770
  var DEVICE_CODE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:device_code";