@postonus/cli 0.1.27 → 0.1.29
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 +168 -64
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7010,6 +7010,87 @@ var adminContract = {
|
|
|
7010
7010
|
}).errors(authedErrors).input(object({ audience: AdminAudienceSchema })).output(DeveloperUsageSchema)
|
|
7011
7011
|
};
|
|
7012
7012
|
|
|
7013
|
+
// ../../packages/api-contract/src/analytics.ts
|
|
7014
|
+
var AnalyticsPeriodSchema = _enum(["7d", "30d", "90d"]).default("7d");
|
|
7015
|
+
var AnalyticsTotalsSchema = object({
|
|
7016
|
+
impressions: number2().int(),
|
|
7017
|
+
engagements: number2().int(),
|
|
7018
|
+
clicks: number2().int(),
|
|
7019
|
+
shares: number2().int(),
|
|
7020
|
+
comments: number2().int(),
|
|
7021
|
+
engagementRate: number2(),
|
|
7022
|
+
publishedCount: number2().int()
|
|
7023
|
+
});
|
|
7024
|
+
var AnalyticsTimeSeriesPointSchema = object({
|
|
7025
|
+
date: string2(),
|
|
7026
|
+
impressions: number2().int(),
|
|
7027
|
+
engagements: number2().int(),
|
|
7028
|
+
clicks: number2().int(),
|
|
7029
|
+
shares: number2().int()
|
|
7030
|
+
});
|
|
7031
|
+
var AnalyticsTopPostSchema = object({
|
|
7032
|
+
postId: Uuid,
|
|
7033
|
+
scheduleId: Uuid,
|
|
7034
|
+
platform: PlatformSchema,
|
|
7035
|
+
scheduledAt: Timestamp,
|
|
7036
|
+
content: string2(),
|
|
7037
|
+
impressions: number2().int(),
|
|
7038
|
+
engagements: number2().int(),
|
|
7039
|
+
clicks: number2().int(),
|
|
7040
|
+
shares: number2().int(),
|
|
7041
|
+
comments: number2().int(),
|
|
7042
|
+
engagementRate: number2()
|
|
7043
|
+
});
|
|
7044
|
+
var AnalyticsTakeawaysSchema = object({
|
|
7045
|
+
headline: string2(),
|
|
7046
|
+
whatWorked: array(string2()),
|
|
7047
|
+
whatToImprove: array(string2()),
|
|
7048
|
+
recommendedActions: array(string2()),
|
|
7049
|
+
generatedAt: Timestamp
|
|
7050
|
+
});
|
|
7051
|
+
var AnalyticsSummarySchema = object({
|
|
7052
|
+
period: AnalyticsPeriodSchema,
|
|
7053
|
+
totals: AnalyticsTotalsSchema,
|
|
7054
|
+
timeSeries: array(AnalyticsTimeSeriesPointSchema),
|
|
7055
|
+
topPosts: array(AnalyticsTopPostSchema),
|
|
7056
|
+
takeaways: AnalyticsTakeawaysSchema.nullable()
|
|
7057
|
+
});
|
|
7058
|
+
var AnalyticsExportFormatSchema = _enum(["csv", "json"]).default("csv");
|
|
7059
|
+
var AnalyticsExportSchema = object({
|
|
7060
|
+
format: AnalyticsExportFormatSchema,
|
|
7061
|
+
filename: string2(),
|
|
7062
|
+
data: string2()
|
|
7063
|
+
});
|
|
7064
|
+
var GetAnalyticsSummaryInputSchema = object({
|
|
7065
|
+
period: AnalyticsPeriodSchema.optional(),
|
|
7066
|
+
platform: PlatformSchema.optional()
|
|
7067
|
+
});
|
|
7068
|
+
var GenerateAnalyticsTakeawaysInputSchema = object({
|
|
7069
|
+
period: AnalyticsPeriodSchema.optional()
|
|
7070
|
+
});
|
|
7071
|
+
var ExportAnalyticsInputSchema = object({
|
|
7072
|
+
period: AnalyticsPeriodSchema.optional(),
|
|
7073
|
+
format: AnalyticsExportFormatSchema.optional()
|
|
7074
|
+
});
|
|
7075
|
+
var publicTagged = base.route({ tags: ["Analytics"] });
|
|
7076
|
+
var internal2 = publicTagged.meta({ internal: true });
|
|
7077
|
+
var analyticsTakeawayErrors = {
|
|
7078
|
+
...writableErrors,
|
|
7079
|
+
AI_CREDITS_EXHAUSTED: {
|
|
7080
|
+
status: 402,
|
|
7081
|
+
message: "AI credits exhausted. Upgrade your plan or wait for your credits to renew."
|
|
7082
|
+
},
|
|
7083
|
+
NO_ANALYTICS_DATA: {
|
|
7084
|
+
status: 400,
|
|
7085
|
+
message: "No published posts or metrics found for this period to generate takeaways."
|
|
7086
|
+
}
|
|
7087
|
+
};
|
|
7088
|
+
var analyticsContract = {
|
|
7089
|
+
getSummary: publicTagged.route({ method: "GET", path: "/analytics/summary", summary: "Get workspace analytics summary" }).errors(orgErrors).input(GetAnalyticsSummaryInputSchema).output(AnalyticsSummarySchema),
|
|
7090
|
+
generateTakeaways: internal2.route({ method: "POST", path: "/analytics/takeaways", summary: "Generate AI analytics takeaways" }).errors(analyticsTakeawayErrors).input(GenerateAnalyticsTakeawaysInputSchema).output(AnalyticsTakeawaysSchema),
|
|
7091
|
+
exportData: publicTagged.route({ method: "GET", path: "/analytics/export", summary: "Export workspace analytics data" }).errors(orgErrors).input(ExportAnalyticsInputSchema).output(AnalyticsExportSchema)
|
|
7092
|
+
};
|
|
7093
|
+
|
|
7013
7094
|
// ../../packages/api-contract/src/api-keys.ts
|
|
7014
7095
|
var ApiKeySchema = object({
|
|
7015
7096
|
id: string2(),
|
|
@@ -7308,11 +7389,11 @@ var UpdateChannelGroupInputSchema = object({
|
|
|
7308
7389
|
name: ChannelGroupNameSchema.optional(),
|
|
7309
7390
|
integrationIds: ChannelGroupIntegrationIdsSchema.optional()
|
|
7310
7391
|
});
|
|
7311
|
-
var
|
|
7312
|
-
var tagged5 =
|
|
7392
|
+
var publicTagged2 = base.route({ tags: ["Channel Groups"] });
|
|
7393
|
+
var tagged5 = publicTagged2.meta({ internal: true });
|
|
7313
7394
|
var channelGroupsContract = {
|
|
7314
7395
|
// Public read: the composer in the browser extension shows group chips.
|
|
7315
|
-
get:
|
|
7396
|
+
get: publicTagged2.route({ method: "GET", path: "/channel-groups", summary: "List channel groups" }).errors(orgErrors).output(array(ChannelGroupSchema)),
|
|
7316
7397
|
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),
|
|
7317
7398
|
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),
|
|
7318
7399
|
delete: tagged5.route({ method: "DELETE", path: "/channel-groups/{id}", summary: "Delete a channel group" }).errors(orgErrors).input(IdPathParam).output(object({ success: literal(true) }))
|
|
@@ -7361,7 +7442,8 @@ var commentsContract = {
|
|
|
7361
7442
|
updatePublic: tagged6.route({ method: "PATCH", path: "/share/{token}/comments/{id}", summary: "Edit a comment on a shared post" }).errors(shareAuthedErrors).input(object({ token: string2(), id: Uuid, content: ContentInput })).output(CommentSchema),
|
|
7362
7443
|
delete: tagged6.route({ method: "DELETE", path: "/comments/{id}", summary: "Delete a comment" }).errors(orgErrors).input(object({ id: Uuid })).output(DeletedSchema),
|
|
7363
7444
|
deletePublic: tagged6.route({ method: "DELETE", path: "/share/{token}/comments/{id}", summary: "Delete a comment on a shared post" }).errors(shareAuthedErrors).input(object({ token: string2(), id: Uuid })).output(DeletedSchema),
|
|
7364
|
-
resolve: tagged6.route({ method: "POST", path: "/comments/{id}/resolve", summary: "Resolve or reopen a comment" }).errors(writableErrors).input(object({ id: Uuid, resolved: boolean2() })).output(CommentSchema)
|
|
7445
|
+
resolve: tagged6.route({ method: "POST", path: "/comments/{id}/resolve", summary: "Resolve or reopen a comment" }).errors(writableErrors).input(object({ id: Uuid, resolved: boolean2() })).output(CommentSchema),
|
|
7446
|
+
resolveMany: tagged6.route({ method: "POST", path: "/comments/resolve-many", summary: "Resolve multiple comments in bulk" }).errors(writableErrors).input(object({ ids: array(Uuid).min(1), resolved: boolean2().default(true) })).output(object({ resolvedCount: number2() }))
|
|
7365
7447
|
};
|
|
7366
7448
|
|
|
7367
7449
|
// ../../packages/api-contract/src/platforms.ts
|
|
@@ -7524,29 +7606,29 @@ var DisconnectImpactSchema = object({
|
|
|
7524
7606
|
isLastBinding: boolean2()
|
|
7525
7607
|
});
|
|
7526
7608
|
var tagged8 = base.route({ tags: ["Integrations"] });
|
|
7527
|
-
var
|
|
7609
|
+
var internal3 = tagged8.meta({ internal: true });
|
|
7528
7610
|
var integrationsContract = {
|
|
7529
7611
|
get: tagged8.route({ method: "GET", path: "/integrations", summary: "List active integrations with health" }).errors(orgErrors).output(array(IntegrationSchema)),
|
|
7530
|
-
getCapacity:
|
|
7531
|
-
listUnhealthy:
|
|
7532
|
-
listAtRiskSchedules:
|
|
7612
|
+
getCapacity: internal3.route({ method: "GET", path: "/integrations/capacity", summary: "Social-account plan capacity" }).errors(orgErrors).output(IntegrationCapacitySchema),
|
|
7613
|
+
listUnhealthy: internal3.route({ method: "GET", path: "/integrations/unhealthy", summary: "Integrations needing reconnect" }).errors(orgErrors).output(array(UnhealthyIntegrationSchema)),
|
|
7614
|
+
listAtRiskSchedules: internal3.route({
|
|
7533
7615
|
method: "GET",
|
|
7534
7616
|
path: "/integrations/at-risk-schedules",
|
|
7535
7617
|
summary: "Scheduled posts whose channel cannot currently publish"
|
|
7536
7618
|
}).errors(orgErrors).output(array(AtRiskScheduleSchema)),
|
|
7537
|
-
listPendingSelection:
|
|
7619
|
+
listPendingSelection: internal3.route({ method: "GET", path: "/integrations/pending-selection", summary: "Channels stuck at the account picker" }).errors(orgErrors).output(array(PendingSelectionIntegrationSchema)),
|
|
7538
7620
|
connectIntegration: tagged8.route({ method: "POST", path: "/integrations/connect", summary: "Start an OAuth connect" }).errors(writableErrors).input(ConnectIntegrationInputSchema).output(object({ redirectUrl: string2() })),
|
|
7539
|
-
connectCredentialIntegration:
|
|
7621
|
+
connectCredentialIntegration: internal3.route({
|
|
7540
7622
|
method: "POST",
|
|
7541
7623
|
path: "/integrations/connect-with-credentials",
|
|
7542
7624
|
summary: "Connect a platform with an app password or bot token"
|
|
7543
7625
|
}).errors(writableErrors).input(ConnectCredentialIntegrationInputSchema).output(ConnectCredentialResultSchema),
|
|
7544
|
-
listConnectAccounts:
|
|
7545
|
-
finalizeConnect:
|
|
7546
|
-
disconnectIntegration:
|
|
7547
|
-
disconnectImpact:
|
|
7548
|
-
cancelPendingSelection:
|
|
7549
|
-
refreshIntegration:
|
|
7626
|
+
listConnectAccounts: internal3.route({ method: "GET", path: "/integrations/{id}/accounts", summary: "Accounts a pending connect may select" }).errors(orgErrors).input(IdPathParam).output(array(SelectableAccountSchema)),
|
|
7627
|
+
finalizeConnect: internal3.route({ method: "POST", path: "/integrations/{id}/select", summary: "Finalize a picked account" }).errors(writableErrors).input(FinalizeConnectInputSchema).output(FinalizeConnectResultSchema),
|
|
7628
|
+
disconnectIntegration: internal3.route({ method: "DELETE", path: "/integrations/{id}", summary: "Disconnect an integration" }).errors(orgErrors).input(IdPathParam).output(DisconnectResultSchema),
|
|
7629
|
+
disconnectImpact: internal3.route({ method: "GET", path: "/integrations/{id}/disconnect-impact", summary: "What a disconnect would cost" }).errors(orgErrors).input(IdPathParam).output(DisconnectImpactSchema),
|
|
7630
|
+
cancelPendingSelection: internal3.route({ method: "POST", path: "/integrations/{id}/cancel-selection", summary: "Abandon a half-finished connect" }).errors(writableErrors).input(IdPathParam).output(DeletedSchema),
|
|
7631
|
+
refreshIntegration: internal3.route({ method: "POST", path: "/integrations/{id}/refresh", summary: "Manually refresh a credential" }).errors(writableErrors).input(IdPathParam).output(DeletedSchema)
|
|
7550
7632
|
};
|
|
7551
7633
|
|
|
7552
7634
|
// ../../packages/api-contract/src/upload.ts
|
|
@@ -7726,23 +7808,23 @@ var DeleteMediaOutputSchema = object({
|
|
|
7726
7808
|
blocked: array(object({ mediaId: Uuid, usedInPostsCount: number2().int() }))
|
|
7727
7809
|
});
|
|
7728
7810
|
var tagged10 = base.route({ tags: ["Media library"] });
|
|
7729
|
-
var
|
|
7811
|
+
var internal4 = tagged10.meta({ internal: true });
|
|
7730
7812
|
var folderErrors = {
|
|
7731
7813
|
...writableErrors,
|
|
7732
7814
|
FOLDER_CYCLE: { status: 422, message: "A folder cannot be moved inside itself." }
|
|
7733
7815
|
};
|
|
7734
7816
|
var mediaContract = {
|
|
7735
|
-
list:
|
|
7817
|
+
list: internal4.route({ method: "GET", path: "/media", summary: "List library media" }).errors(orgErrors).input(ListMediaInputSchema).output(ListMediaOutputSchema),
|
|
7736
7818
|
// Declared before `getById` for readability only — oRPC matches a literal
|
|
7737
7819
|
// segment ahead of a path parameter regardless of declaration order.
|
|
7738
|
-
listFolders:
|
|
7739
|
-
createFolder:
|
|
7740
|
-
updateFolder:
|
|
7741
|
-
deleteFolder:
|
|
7742
|
-
getById:
|
|
7743
|
-
update:
|
|
7744
|
-
move:
|
|
7745
|
-
delete:
|
|
7820
|
+
listFolders: internal4.route({ method: "GET", path: "/media/folders", summary: "List media folders with counts" }).errors(orgErrors).output(ListMediaFoldersOutputSchema),
|
|
7821
|
+
createFolder: internal4.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),
|
|
7822
|
+
updateFolder: internal4.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),
|
|
7823
|
+
deleteFolder: internal4.route({ method: "DELETE", path: "/media/folders/{id}", summary: "Delete a media folder" }).errors(writableErrors).input(IdPathParam).output(DeletedSchema),
|
|
7824
|
+
getById: internal4.route({ method: "GET", path: "/media/{id}", summary: "Get a library asset" }).errors(orgErrors).input(IdPathParam).output(LibraryMediaSchema),
|
|
7825
|
+
update: internal4.route({ method: "PATCH", path: "/media/{id}", summary: "Rename or refile a library asset" }).errors(writableErrors).input(UpdateMediaInputSchema).output(LibraryMediaSchema),
|
|
7826
|
+
move: internal4.route({ method: "POST", path: "/media/move", summary: "File assets into a folder" }).errors(writableErrors).input(MoveMediaInputSchema).output(object({ movedIds: array(Uuid) })),
|
|
7827
|
+
delete: internal4.route({ method: "POST", path: "/media/delete", summary: "Delete library assets" }).errors(writableErrors).input(DeleteMediaInputSchema).output(DeleteMediaOutputSchema)
|
|
7746
7828
|
};
|
|
7747
7829
|
|
|
7748
7830
|
// ../../packages/api-contract/src/media-sources.ts
|
|
@@ -8179,6 +8261,17 @@ var BulkScheduleInWindowsOutputSchema = object({
|
|
|
8179
8261
|
placed: array(object({ scheduleId: string2(), scheduledAt: Timestamp })),
|
|
8180
8262
|
deferred: array(string2())
|
|
8181
8263
|
});
|
|
8264
|
+
var ApplyReviewCommentsInputSchema = object({
|
|
8265
|
+
id: Uuid,
|
|
8266
|
+
postScheduleId: Uuid.optional(),
|
|
8267
|
+
customInstructions: string2().max(1e3).optional()
|
|
8268
|
+
});
|
|
8269
|
+
var ApplyReviewCommentsOutputSchema = object({
|
|
8270
|
+
originalContent: string2(),
|
|
8271
|
+
revisedContent: string2(),
|
|
8272
|
+
appliedCommentIds: array(string2()),
|
|
8273
|
+
changesSummary: string2()
|
|
8274
|
+
});
|
|
8182
8275
|
var DeletePostInputSchema = object({ id: Uuid, deleteRemote: boolean2().default(false) });
|
|
8183
8276
|
var postDomainErrors = {
|
|
8184
8277
|
POST_QUOTA_EXCEEDED: { status: 403, message: "Post limit reached.", data: ErrorDataSchema },
|
|
@@ -8207,7 +8300,12 @@ var postDomainErrors = {
|
|
|
8207
8300
|
data: ErrorDataSchema
|
|
8208
8301
|
},
|
|
8209
8302
|
NOT_A_DRAFT: { status: 409, message: "That post is not a draft." },
|
|
8210
|
-
DRAFT_HAS_NO_CHANNELS: { status: 400, message: "Choose the channels to schedule this draft on." }
|
|
8303
|
+
DRAFT_HAS_NO_CHANNELS: { status: 400, message: "Choose the channels to schedule this draft on." },
|
|
8304
|
+
NO_OPEN_COMMENTS: { status: 400, message: "There are no unresolved comments to apply." },
|
|
8305
|
+
AI_CREDITS_EXHAUSTED: {
|
|
8306
|
+
status: 402,
|
|
8307
|
+
message: "AI credits exhausted. Upgrade your plan or wait for your credits to renew."
|
|
8308
|
+
}
|
|
8211
8309
|
};
|
|
8212
8310
|
var tagged13 = base.route({ tags: ["Posts"] });
|
|
8213
8311
|
var idempotent = tagged13.route({
|
|
@@ -8225,14 +8323,14 @@ var idempotent = tagged13.route({
|
|
|
8225
8323
|
]
|
|
8226
8324
|
})
|
|
8227
8325
|
});
|
|
8228
|
-
var
|
|
8326
|
+
var internal5 = tagged13.meta({ internal: true });
|
|
8229
8327
|
var postsContract = {
|
|
8230
8328
|
list: tagged13.route({ method: "GET", path: "/posts", summary: "List posts" }).errors(orgErrors).input(ListPostsInputSchema).output(PostsListOutputSchema),
|
|
8231
8329
|
// Declared before `getById` so `/posts/counts` is not read as `/posts/{id}`.
|
|
8232
8330
|
// Dashboard plumbing: the status segment row on `/posts`.
|
|
8233
|
-
counts:
|
|
8331
|
+
counts: internal5.route({ method: "GET", path: "/posts/counts", summary: "Count posts per status" }).errors(orgErrors).input(CountPostsInputSchema).output(CountPostsOutputSchema),
|
|
8234
8332
|
getById: tagged13.route({ method: "GET", path: "/posts/{id}", summary: "Get a post" }).errors(orgErrors).input(IdPathParam).output(PostWithRelationsSchema),
|
|
8235
|
-
mediaById:
|
|
8333
|
+
mediaById: internal5.route({ method: "GET", path: "/posts/media/{id}", summary: "Get post media metadata" }).errors(orgErrors).input(IdPathParam).output(MediaMetadataSchema),
|
|
8236
8334
|
create: idempotent.route({ method: "POST", path: "/posts", summary: "Create posts in bulk", successStatus: 201 }).errors({ ...writableErrors, ...postDomainErrors }).input(CreatePostsInputSchema).output(CreatePostsOutputSchema),
|
|
8237
8335
|
update: idempotent.route({ method: "PATCH", path: "/posts/{id}", summary: "Update a post" }).errors({ ...writableErrors, ...postDomainErrors }).input(UpdatePostInputSchema).output(PostStateSchema),
|
|
8238
8336
|
scheduleDraft: idempotent.route({ method: "POST", path: "/posts/{id}/schedule", summary: "Schedule a draft" }).errors({ ...writableErrors, ...postDomainErrors }).input(ScheduleDraftInputSchema).output(PostStateSchema),
|
|
@@ -8243,16 +8341,21 @@ var postsContract = {
|
|
|
8243
8341
|
path: "/posts/schedules/{scheduleId}/reschedule",
|
|
8244
8342
|
summary: "Move a schedule to a new time"
|
|
8245
8343
|
}).errors({ ...writableErrors, ...postDomainErrors }).input(RescheduleInputSchema).output(PostStateSchema),
|
|
8246
|
-
bulkScheduleInWindows:
|
|
8344
|
+
bulkScheduleInWindows: internal5.route({
|
|
8247
8345
|
method: "POST",
|
|
8248
8346
|
path: "/posts/schedules/bulk-schedule-windows",
|
|
8249
8347
|
summary: "Spread schedules across optimal windows"
|
|
8250
8348
|
}).errors({ ...writableErrors, ...postDomainErrors }).input(BulkScheduleInWindowsInputSchema).output(BulkScheduleInWindowsOutputSchema),
|
|
8251
|
-
addChannels:
|
|
8349
|
+
addChannels: internal5.route({
|
|
8252
8350
|
method: "POST",
|
|
8253
8351
|
path: "/posts/{id}/channels",
|
|
8254
8352
|
summary: "Schedule an existing post to more channels"
|
|
8255
|
-
}).errors({ ...publishErrors, ...postDomainErrors }).input(AddChannelsInputSchema).output(AddChannelsOutputSchema)
|
|
8353
|
+
}).errors({ ...publishErrors, ...postDomainErrors }).input(AddChannelsInputSchema).output(AddChannelsOutputSchema),
|
|
8354
|
+
applyReviewComments: internal5.route({
|
|
8355
|
+
method: "POST",
|
|
8356
|
+
path: "/posts/{id}/apply-review-comments",
|
|
8357
|
+
summary: "Rewrite post or variant from unresolved review and client comments"
|
|
8358
|
+
}).errors({ ...writableErrors, ...postDomainErrors }).input(ApplyReviewCommentsInputSchema).output(ApplyReviewCommentsOutputSchema)
|
|
8256
8359
|
};
|
|
8257
8360
|
|
|
8258
8361
|
// ../../packages/api-contract/src/public-calendar.ts
|
|
@@ -9113,13 +9216,13 @@ var CreateSnippetInputSchema = object({
|
|
|
9113
9216
|
content: SnippetContentSchema,
|
|
9114
9217
|
tags: array(SnippetTagSchema).default([])
|
|
9115
9218
|
});
|
|
9116
|
-
var
|
|
9117
|
-
var
|
|
9219
|
+
var publicTagged3 = base.route({ tags: ["Snippets"] });
|
|
9220
|
+
var internal6 = publicTagged3.meta({ internal: true });
|
|
9118
9221
|
var snippetsContract = {
|
|
9119
|
-
list:
|
|
9120
|
-
getById:
|
|
9121
|
-
create:
|
|
9122
|
-
delete:
|
|
9222
|
+
list: publicTagged3.route({ method: "GET", path: "/snippets", summary: "List saved snippets and hashtag groups" }).errors(orgErrors).output(array(SnippetSchema)),
|
|
9223
|
+
getById: publicTagged3.route({ method: "GET", path: "/snippets/{id}", summary: "Get a snippet" }).errors(orgErrors).input(IdPathParam).output(SnippetSchema),
|
|
9224
|
+
create: internal6.route({ method: "POST", path: "/snippets", summary: "Create a snippet", successStatus: 201 }).errors(writableErrors).input(CreateSnippetInputSchema).output(SnippetSchema),
|
|
9225
|
+
delete: internal6.route({ method: "DELETE", path: "/snippets/{id}", summary: "Delete a snippet" }).errors(writableErrors).input(IdPathParam).output(DeletedSchema)
|
|
9123
9226
|
};
|
|
9124
9227
|
|
|
9125
9228
|
// ../../packages/api-contract/src/support.ts
|
|
@@ -9169,19 +9272,19 @@ var UpdateTicketStatusInputSchema = object({
|
|
|
9169
9272
|
status: _enum(["waiting_on_user", "resolved"])
|
|
9170
9273
|
});
|
|
9171
9274
|
var ticketErrors = { ...authedErrors, NOT_FOUND: { message: "Ticket not found." } };
|
|
9172
|
-
var
|
|
9275
|
+
var internal7 = base.route({ tags: ["Support"] }).meta({ internal: true });
|
|
9173
9276
|
var supportContract = {
|
|
9174
|
-
createTicket:
|
|
9175
|
-
getMyTickets:
|
|
9176
|
-
getTicket:
|
|
9177
|
-
createMessage:
|
|
9277
|
+
createTicket: internal7.route({ method: "POST", path: "/internal/support/tickets", summary: "Open a support ticket", successStatus: 201 }).errors(authedErrors).input(CreateTicketInputSchema).output(SupportTicketSchema),
|
|
9278
|
+
getMyTickets: internal7.route({ method: "GET", path: "/internal/support/tickets", summary: "List the caller\u2019s support tickets" }).errors(authedErrors).output(array(TicketWithUserSchema)),
|
|
9279
|
+
getTicket: internal7.route({ method: "GET", path: "/internal/support/tickets/{ticketId}", summary: "Get a ticket and its messages" }).errors(ticketErrors).input(GetTicketInputSchema).output(TicketWithMessagesSchema),
|
|
9280
|
+
createMessage: internal7.route({
|
|
9178
9281
|
method: "POST",
|
|
9179
9282
|
path: "/internal/support/tickets/{ticketId}/messages",
|
|
9180
9283
|
summary: "Reply on a support ticket",
|
|
9181
9284
|
successStatus: 201
|
|
9182
9285
|
}).errors(ticketErrors).input(CreateMessageInputSchema).output(SupportMessageSchema),
|
|
9183
|
-
getAdminTickets:
|
|
9184
|
-
updateTicketStatus:
|
|
9286
|
+
getAdminTickets: internal7.route({ method: "GET", path: "/internal/support/admin/tickets", summary: "List tickets for staff triage" }).errors(authedErrors).input(GetAdminTicketsInputSchema).output(array(TicketWithUserSchema)),
|
|
9287
|
+
updateTicketStatus: internal7.route({
|
|
9185
9288
|
method: "PATCH",
|
|
9186
9289
|
path: "/internal/support/admin/tickets/{ticketId}/status",
|
|
9187
9290
|
summary: "Update a ticket\u2019s status"
|
|
@@ -9203,7 +9306,7 @@ var CreateTagInputSchema = object({ name: TagNameSchema });
|
|
|
9203
9306
|
var UpdateTagInputSchema = object({ id: Uuid, name: TagNameSchema });
|
|
9204
9307
|
var TagUsageCountSchema = object({ tagId: Uuid, count: AggregateCount });
|
|
9205
9308
|
var tagged17 = base.route({ tags: ["Tags"] });
|
|
9206
|
-
var
|
|
9309
|
+
var internal8 = tagged17.meta({ internal: true });
|
|
9207
9310
|
var tagsContract = {
|
|
9208
9311
|
list: tagged17.route({ method: "GET", path: "/tags", summary: "List tags" }).errors(orgErrors).output(array(TagSchema)),
|
|
9209
9312
|
/**
|
|
@@ -9211,11 +9314,11 @@ var tagsContract = {
|
|
|
9211
9314
|
* segment ahead of a path parameter regardless of declaration order, so
|
|
9212
9315
|
* `/tags/usage-counts` never resolves as `/tags/{id}`.
|
|
9213
9316
|
*/
|
|
9214
|
-
getUsageCounts:
|
|
9317
|
+
getUsageCounts: internal8.route({ method: "GET", path: "/tags/usage-counts", summary: "Count posts per tag" }).errors(orgErrors).output(array(TagUsageCountSchema)),
|
|
9215
9318
|
getById: tagged17.route({ method: "GET", path: "/tags/{id}", summary: "Get a tag" }).errors(orgErrors).input(IdPathParam).output(TagSchema),
|
|
9216
|
-
create:
|
|
9217
|
-
update:
|
|
9218
|
-
delete:
|
|
9319
|
+
create: internal8.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),
|
|
9320
|
+
update: internal8.route({ method: "PATCH", path: "/tags/{id}", summary: "Rename a tag" }).errors(writableErrors).input(UpdateTagInputSchema).output(TagSchema),
|
|
9321
|
+
delete: internal8.route({ method: "DELETE", path: "/tags/{id}", summary: "Delete a tag" }).errors(orgErrors).input(IdPathParam).output(DeletedSchema)
|
|
9219
9322
|
};
|
|
9220
9323
|
|
|
9221
9324
|
// ../../packages/api-contract/src/usage.ts
|
|
@@ -9251,11 +9354,11 @@ var UsageEventSchema = object({
|
|
|
9251
9354
|
createdAt: Timestamp
|
|
9252
9355
|
});
|
|
9253
9356
|
var tagged18 = base.route({ tags: ["Usage"] });
|
|
9254
|
-
var
|
|
9357
|
+
var internal9 = tagged18.meta({ internal: true });
|
|
9255
9358
|
var usageContract = {
|
|
9256
9359
|
summary: tagged18.route({ method: "GET", path: "/usage", summary: "Get API and MCP call totals for the workspace" }).errors(orgErrors).input(object({ days: WindowDays })).output(UsageSummarySchema),
|
|
9257
|
-
daily:
|
|
9258
|
-
events:
|
|
9360
|
+
daily: internal9.route({ method: "GET", path: "/usage/daily", summary: "Get daily call counts for one surface" }).errors(orgErrors).input(object({ surface: UsageSurfaceSchema, days: WindowDays })).output(object({ items: array(UsageDailyPointSchema) })),
|
|
9361
|
+
events: internal9.route({ method: "GET", path: "/usage/events", summary: "List recent API and MCP calls" }).errors(orgErrors).input(
|
|
9259
9362
|
object({
|
|
9260
9363
|
surface: UsageSurfaceSchema.optional(),
|
|
9261
9364
|
limit: coerce_exports.number().int().min(1).max(100).default(25),
|
|
@@ -9405,16 +9508,16 @@ var AiQuotaSchema = object({
|
|
|
9405
9508
|
unlimited: boolean2()
|
|
9406
9509
|
});
|
|
9407
9510
|
var tagged19 = base.route({ tags: ["User"] });
|
|
9408
|
-
var
|
|
9511
|
+
var internal10 = tagged19.meta({ internal: true });
|
|
9409
9512
|
var userContract = {
|
|
9410
9513
|
me: tagged19.route({ method: "GET", path: "/users/me", summary: "Get the current user" }).errors({ ...authedErrors, NOT_FOUND: { message: "User not found." } }).output(MeSchema),
|
|
9411
|
-
update:
|
|
9514
|
+
update: internal10.route({ method: "PATCH", path: "/users/me", summary: "Update the current user" }).errors({ ...authedErrors, NOT_FOUND: { message: "User not found." } }).input(UpdateUserInputSchema).output(UserAccountSchema),
|
|
9412
9515
|
getPreferences: tagged19.route({ method: "GET", path: "/users/me/preferences", summary: "Get the current user's preferences" }).errors(authedErrors).output(UserPreferencesSchema),
|
|
9413
|
-
updatePreferences:
|
|
9414
|
-
resetPreferences:
|
|
9516
|
+
updatePreferences: internal10.route({ method: "PATCH", path: "/users/me/preferences", summary: "Update the current user's preferences" }).errors(authedErrors).input(UpdatePreferencesInputSchema).output(UserPreferencesSchema),
|
|
9517
|
+
resetPreferences: internal10.route({ method: "DELETE", path: "/users/me/preferences", summary: "Reset the current user's preferences" }).errors(authedErrors).output(object({ message: string2() })),
|
|
9415
9518
|
getPlanQuota: tagged19.route({ method: "GET", path: "/users/me/plan-quota", summary: "Get the active workspace's plan quota" }).errors(orgErrors).input(object({ platforms: array(PlatformEnum).optional() })).output(PlanQuotaSchema),
|
|
9416
|
-
getAiQuota:
|
|
9417
|
-
setDefaultWorkspace:
|
|
9519
|
+
getAiQuota: internal10.route({ method: "GET", path: "/users/me/ai-quota", summary: "Get the active workspace's AI credit quota" }).errors(orgErrors).output(AiQuotaSchema),
|
|
9520
|
+
setDefaultWorkspace: internal10.route({ method: "POST", path: "/users/me/default-workspace", summary: "Set the current user's default workspace" }).errors({ ...authedErrors, FORBIDDEN: { message: "You are not a member of this workspace." } }).input(object({ organizationId: string2() })).output(DeletedSchema)
|
|
9418
9521
|
};
|
|
9419
9522
|
|
|
9420
9523
|
// ../../packages/api-contract/src/workspace.ts
|
|
@@ -9474,15 +9577,15 @@ var WorkspaceSummarySchema = object({
|
|
|
9474
9577
|
logo: string2().nullable(),
|
|
9475
9578
|
role: string2()
|
|
9476
9579
|
});
|
|
9477
|
-
var
|
|
9478
|
-
var tagged20 =
|
|
9580
|
+
var publicTagged4 = base.route({ tags: ["Workspace"] });
|
|
9581
|
+
var tagged20 = publicTagged4.meta({ internal: true });
|
|
9479
9582
|
var workspaceContract = {
|
|
9480
9583
|
/**
|
|
9481
9584
|
* Public, so an OAuth client can offer a workspace switcher: the chosen id goes
|
|
9482
9585
|
* back as `x-workspace-id`. An API key is pinned to one workspace, so it lists
|
|
9483
9586
|
* only that one.
|
|
9484
9587
|
*/
|
|
9485
|
-
list:
|
|
9588
|
+
list: publicTagged4.route({ method: "GET", path: "/workspaces", summary: "List your workspaces" }).errors(authedErrors).output(array(WorkspaceSummarySchema)),
|
|
9486
9589
|
getOwnedCapacity: tagged20.route({ method: "GET", path: "/workspaces/owned-capacity", summary: "Get owned workspace capacity" }).errors(authedErrors).output(OwnedCapacitySchema),
|
|
9487
9590
|
create: tagged20.route({ method: "POST", path: "/workspaces", summary: "Create a workspace", successStatus: 201 }).errors({
|
|
9488
9591
|
...authedErrors,
|
|
@@ -9527,6 +9630,7 @@ var workspaceContract = {
|
|
|
9527
9630
|
var contract = {
|
|
9528
9631
|
activity: activityContract,
|
|
9529
9632
|
admin: adminContract,
|
|
9633
|
+
analytics: analyticsContract,
|
|
9530
9634
|
apiKeys: apiKeysContract,
|
|
9531
9635
|
assistants: assistantsContract,
|
|
9532
9636
|
billing: billingContract,
|
|
@@ -12231,7 +12335,7 @@ function formatTable(headers, rows) {
|
|
|
12231
12335
|
}
|
|
12232
12336
|
|
|
12233
12337
|
// src/version.ts
|
|
12234
|
-
var CLI_VERSION = "0.1.
|
|
12338
|
+
var CLI_VERSION = "0.1.29";
|
|
12235
12339
|
|
|
12236
12340
|
// src/client.ts
|
|
12237
12341
|
var DEVICE_CODE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:device_code";
|