@postonus/cli 0.1.26 → 0.1.27
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 +54 -25
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9094,6 +9094,34 @@ var schedulesContract = {
|
|
|
9094
9094
|
delete: tagged16.route({ method: "DELETE", path: "/schedules/{id}", summary: "Delete a schedule" }).errors({ ...writableErrors, ...postDomainErrors }).input(DeleteScheduleInputSchema).output(DeletedSchema)
|
|
9095
9095
|
};
|
|
9096
9096
|
|
|
9097
|
+
// ../../packages/api-contract/src/snippets.ts
|
|
9098
|
+
var SnippetNameSchema = string2().trim().min(1, "Enter a name").max(100, "Name must be 100 characters or less");
|
|
9099
|
+
var SnippetContentSchema = string2().min(1, "Enter snippet content").max(5e3, "Snippet content must be 5000 characters or less");
|
|
9100
|
+
var SnippetTagSchema = string2().trim().min(1).max(50);
|
|
9101
|
+
var SnippetSchema = object({
|
|
9102
|
+
id: Uuid,
|
|
9103
|
+
organizationId: string2(),
|
|
9104
|
+
name: SnippetNameSchema,
|
|
9105
|
+
content: SnippetContentSchema,
|
|
9106
|
+
tags: array(SnippetTagSchema),
|
|
9107
|
+
createdByUserId: string2().nullable(),
|
|
9108
|
+
createdAt: Timestamp,
|
|
9109
|
+
updatedAt: Timestamp
|
|
9110
|
+
});
|
|
9111
|
+
var CreateSnippetInputSchema = object({
|
|
9112
|
+
name: SnippetNameSchema,
|
|
9113
|
+
content: SnippetContentSchema,
|
|
9114
|
+
tags: array(SnippetTagSchema).default([])
|
|
9115
|
+
});
|
|
9116
|
+
var publicTagged2 = base.route({ tags: ["Snippets"] });
|
|
9117
|
+
var internal5 = publicTagged2.meta({ internal: true });
|
|
9118
|
+
var snippetsContract = {
|
|
9119
|
+
list: publicTagged2.route({ method: "GET", path: "/snippets", summary: "List saved snippets and hashtag groups" }).errors(orgErrors).output(array(SnippetSchema)),
|
|
9120
|
+
getById: publicTagged2.route({ method: "GET", path: "/snippets/{id}", summary: "Get a snippet" }).errors(orgErrors).input(IdPathParam).output(SnippetSchema),
|
|
9121
|
+
create: internal5.route({ method: "POST", path: "/snippets", summary: "Create a snippet", successStatus: 201 }).errors(writableErrors).input(CreateSnippetInputSchema).output(SnippetSchema),
|
|
9122
|
+
delete: internal5.route({ method: "DELETE", path: "/snippets/{id}", summary: "Delete a snippet" }).errors(writableErrors).input(IdPathParam).output(DeletedSchema)
|
|
9123
|
+
};
|
|
9124
|
+
|
|
9097
9125
|
// ../../packages/api-contract/src/support.ts
|
|
9098
9126
|
var SupportTicketStatusSchema = _enum(["open", "replied", "waiting_on_user", "resolved"]);
|
|
9099
9127
|
var SupportTicketLastReplyBySchema = _enum(["user", "staff"]);
|
|
@@ -9141,19 +9169,19 @@ var UpdateTicketStatusInputSchema = object({
|
|
|
9141
9169
|
status: _enum(["waiting_on_user", "resolved"])
|
|
9142
9170
|
});
|
|
9143
9171
|
var ticketErrors = { ...authedErrors, NOT_FOUND: { message: "Ticket not found." } };
|
|
9144
|
-
var
|
|
9172
|
+
var internal6 = base.route({ tags: ["Support"] }).meta({ internal: true });
|
|
9145
9173
|
var supportContract = {
|
|
9146
|
-
createTicket:
|
|
9147
|
-
getMyTickets:
|
|
9148
|
-
getTicket:
|
|
9149
|
-
createMessage:
|
|
9174
|
+
createTicket: internal6.route({ method: "POST", path: "/internal/support/tickets", summary: "Open a support ticket", successStatus: 201 }).errors(authedErrors).input(CreateTicketInputSchema).output(SupportTicketSchema),
|
|
9175
|
+
getMyTickets: internal6.route({ method: "GET", path: "/internal/support/tickets", summary: "List the caller\u2019s support tickets" }).errors(authedErrors).output(array(TicketWithUserSchema)),
|
|
9176
|
+
getTicket: internal6.route({ method: "GET", path: "/internal/support/tickets/{ticketId}", summary: "Get a ticket and its messages" }).errors(ticketErrors).input(GetTicketInputSchema).output(TicketWithMessagesSchema),
|
|
9177
|
+
createMessage: internal6.route({
|
|
9150
9178
|
method: "POST",
|
|
9151
9179
|
path: "/internal/support/tickets/{ticketId}/messages",
|
|
9152
9180
|
summary: "Reply on a support ticket",
|
|
9153
9181
|
successStatus: 201
|
|
9154
9182
|
}).errors(ticketErrors).input(CreateMessageInputSchema).output(SupportMessageSchema),
|
|
9155
|
-
getAdminTickets:
|
|
9156
|
-
updateTicketStatus:
|
|
9183
|
+
getAdminTickets: internal6.route({ method: "GET", path: "/internal/support/admin/tickets", summary: "List tickets for staff triage" }).errors(authedErrors).input(GetAdminTicketsInputSchema).output(array(TicketWithUserSchema)),
|
|
9184
|
+
updateTicketStatus: internal6.route({
|
|
9157
9185
|
method: "PATCH",
|
|
9158
9186
|
path: "/internal/support/admin/tickets/{ticketId}/status",
|
|
9159
9187
|
summary: "Update a ticket\u2019s status"
|
|
@@ -9175,7 +9203,7 @@ var CreateTagInputSchema = object({ name: TagNameSchema });
|
|
|
9175
9203
|
var UpdateTagInputSchema = object({ id: Uuid, name: TagNameSchema });
|
|
9176
9204
|
var TagUsageCountSchema = object({ tagId: Uuid, count: AggregateCount });
|
|
9177
9205
|
var tagged17 = base.route({ tags: ["Tags"] });
|
|
9178
|
-
var
|
|
9206
|
+
var internal7 = tagged17.meta({ internal: true });
|
|
9179
9207
|
var tagsContract = {
|
|
9180
9208
|
list: tagged17.route({ method: "GET", path: "/tags", summary: "List tags" }).errors(orgErrors).output(array(TagSchema)),
|
|
9181
9209
|
/**
|
|
@@ -9183,11 +9211,11 @@ var tagsContract = {
|
|
|
9183
9211
|
* segment ahead of a path parameter regardless of declaration order, so
|
|
9184
9212
|
* `/tags/usage-counts` never resolves as `/tags/{id}`.
|
|
9185
9213
|
*/
|
|
9186
|
-
getUsageCounts:
|
|
9214
|
+
getUsageCounts: internal7.route({ method: "GET", path: "/tags/usage-counts", summary: "Count posts per tag" }).errors(orgErrors).output(array(TagUsageCountSchema)),
|
|
9187
9215
|
getById: tagged17.route({ method: "GET", path: "/tags/{id}", summary: "Get a tag" }).errors(orgErrors).input(IdPathParam).output(TagSchema),
|
|
9188
|
-
create:
|
|
9189
|
-
update:
|
|
9190
|
-
delete:
|
|
9216
|
+
create: internal7.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),
|
|
9217
|
+
update: internal7.route({ method: "PATCH", path: "/tags/{id}", summary: "Rename a tag" }).errors(writableErrors).input(UpdateTagInputSchema).output(TagSchema),
|
|
9218
|
+
delete: internal7.route({ method: "DELETE", path: "/tags/{id}", summary: "Delete a tag" }).errors(orgErrors).input(IdPathParam).output(DeletedSchema)
|
|
9191
9219
|
};
|
|
9192
9220
|
|
|
9193
9221
|
// ../../packages/api-contract/src/usage.ts
|
|
@@ -9223,11 +9251,11 @@ var UsageEventSchema = object({
|
|
|
9223
9251
|
createdAt: Timestamp
|
|
9224
9252
|
});
|
|
9225
9253
|
var tagged18 = base.route({ tags: ["Usage"] });
|
|
9226
|
-
var
|
|
9254
|
+
var internal8 = tagged18.meta({ internal: true });
|
|
9227
9255
|
var usageContract = {
|
|
9228
9256
|
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),
|
|
9229
|
-
daily:
|
|
9230
|
-
events:
|
|
9257
|
+
daily: internal8.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) })),
|
|
9258
|
+
events: internal8.route({ method: "GET", path: "/usage/events", summary: "List recent API and MCP calls" }).errors(orgErrors).input(
|
|
9231
9259
|
object({
|
|
9232
9260
|
surface: UsageSurfaceSchema.optional(),
|
|
9233
9261
|
limit: coerce_exports.number().int().min(1).max(100).default(25),
|
|
@@ -9377,16 +9405,16 @@ var AiQuotaSchema = object({
|
|
|
9377
9405
|
unlimited: boolean2()
|
|
9378
9406
|
});
|
|
9379
9407
|
var tagged19 = base.route({ tags: ["User"] });
|
|
9380
|
-
var
|
|
9408
|
+
var internal9 = tagged19.meta({ internal: true });
|
|
9381
9409
|
var userContract = {
|
|
9382
9410
|
me: tagged19.route({ method: "GET", path: "/users/me", summary: "Get the current user" }).errors({ ...authedErrors, NOT_FOUND: { message: "User not found." } }).output(MeSchema),
|
|
9383
|
-
update:
|
|
9411
|
+
update: internal9.route({ method: "PATCH", path: "/users/me", summary: "Update the current user" }).errors({ ...authedErrors, NOT_FOUND: { message: "User not found." } }).input(UpdateUserInputSchema).output(UserAccountSchema),
|
|
9384
9412
|
getPreferences: tagged19.route({ method: "GET", path: "/users/me/preferences", summary: "Get the current user's preferences" }).errors(authedErrors).output(UserPreferencesSchema),
|
|
9385
|
-
updatePreferences:
|
|
9386
|
-
resetPreferences:
|
|
9413
|
+
updatePreferences: internal9.route({ method: "PATCH", path: "/users/me/preferences", summary: "Update the current user's preferences" }).errors(authedErrors).input(UpdatePreferencesInputSchema).output(UserPreferencesSchema),
|
|
9414
|
+
resetPreferences: internal9.route({ method: "DELETE", path: "/users/me/preferences", summary: "Reset the current user's preferences" }).errors(authedErrors).output(object({ message: string2() })),
|
|
9387
9415
|
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),
|
|
9388
|
-
getAiQuota:
|
|
9389
|
-
setDefaultWorkspace:
|
|
9416
|
+
getAiQuota: internal9.route({ method: "GET", path: "/users/me/ai-quota", summary: "Get the active workspace's AI credit quota" }).errors(orgErrors).output(AiQuotaSchema),
|
|
9417
|
+
setDefaultWorkspace: internal9.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)
|
|
9390
9418
|
};
|
|
9391
9419
|
|
|
9392
9420
|
// ../../packages/api-contract/src/workspace.ts
|
|
@@ -9446,15 +9474,15 @@ var WorkspaceSummarySchema = object({
|
|
|
9446
9474
|
logo: string2().nullable(),
|
|
9447
9475
|
role: string2()
|
|
9448
9476
|
});
|
|
9449
|
-
var
|
|
9450
|
-
var tagged20 =
|
|
9477
|
+
var publicTagged3 = base.route({ tags: ["Workspace"] });
|
|
9478
|
+
var tagged20 = publicTagged3.meta({ internal: true });
|
|
9451
9479
|
var workspaceContract = {
|
|
9452
9480
|
/**
|
|
9453
9481
|
* Public, so an OAuth client can offer a workspace switcher: the chosen id goes
|
|
9454
9482
|
* back as `x-workspace-id`. An API key is pinned to one workspace, so it lists
|
|
9455
9483
|
* only that one.
|
|
9456
9484
|
*/
|
|
9457
|
-
list:
|
|
9485
|
+
list: publicTagged3.route({ method: "GET", path: "/workspaces", summary: "List your workspaces" }).errors(authedErrors).output(array(WorkspaceSummarySchema)),
|
|
9458
9486
|
getOwnedCapacity: tagged20.route({ method: "GET", path: "/workspaces/owned-capacity", summary: "Get owned workspace capacity" }).errors(authedErrors).output(OwnedCapacitySchema),
|
|
9459
9487
|
create: tagged20.route({ method: "POST", path: "/workspaces", summary: "Create a workspace", successStatus: 201 }).errors({
|
|
9460
9488
|
...authedErrors,
|
|
@@ -9518,6 +9546,7 @@ var contract = {
|
|
|
9518
9546
|
reviews: reviewsContract,
|
|
9519
9547
|
schedules: schedulesContract,
|
|
9520
9548
|
share: shareContract,
|
|
9549
|
+
snippets: snippetsContract,
|
|
9521
9550
|
support: supportContract,
|
|
9522
9551
|
tags: tagsContract,
|
|
9523
9552
|
upload: uploadContract,
|
|
@@ -12202,7 +12231,7 @@ function formatTable(headers, rows) {
|
|
|
12202
12231
|
}
|
|
12203
12232
|
|
|
12204
12233
|
// src/version.ts
|
|
12205
|
-
var CLI_VERSION = "0.1.
|
|
12234
|
+
var CLI_VERSION = "0.1.27";
|
|
12206
12235
|
|
|
12207
12236
|
// src/client.ts
|
|
12208
12237
|
var DEVICE_CODE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:device_code";
|