@postonus/cli 0.1.19 → 0.1.21
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 +38 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7882,6 +7882,21 @@ var notificationsContract = {
|
|
|
7882
7882
|
};
|
|
7883
7883
|
|
|
7884
7884
|
// ../../packages/api-contract/src/posts.ts
|
|
7885
|
+
var POST_SOURCE_VALUES = ["app", "mcp", "api", "cli"];
|
|
7886
|
+
var PostSourceSchema = _enum(POST_SOURCE_VALUES);
|
|
7887
|
+
var PostProvenanceSchema = object({
|
|
7888
|
+
created: object({
|
|
7889
|
+
source: PostSourceSchema,
|
|
7890
|
+
clientLabel: string2().nullable(),
|
|
7891
|
+
at: Timestamp
|
|
7892
|
+
}),
|
|
7893
|
+
lastEdit: object({
|
|
7894
|
+
source: PostSourceSchema,
|
|
7895
|
+
clientLabel: string2().nullable(),
|
|
7896
|
+
by: object({ id: string2(), name: string2() }).nullable(),
|
|
7897
|
+
at: Timestamp
|
|
7898
|
+
}).nullable()
|
|
7899
|
+
});
|
|
7885
7900
|
var MEDIA_PROVIDER_VALUES = ["GIPHY", "S3", "DROPBOX", "GOOGLE_PHOTOS", "ONEDRIVE", "UNSPLASH", "CANVA"];
|
|
7886
7901
|
var THUMBNAIL_SOURCE_VALUES = ["FRAME_CAPTURE", "UPLOADED"];
|
|
7887
7902
|
var INTEGRATION_TOKEN_STATUS_VALUES = ["VALID", "EXPIRED", "UNKNOWN"];
|
|
@@ -7981,7 +7996,8 @@ var ListPostsInputSchema = object({
|
|
|
7981
7996
|
platform: array(PlatformSchema).optional(),
|
|
7982
7997
|
dateFrom: string2().optional(),
|
|
7983
7998
|
dateTo: string2().optional(),
|
|
7984
|
-
tagIds: array(Uuid).optional()
|
|
7999
|
+
tagIds: array(Uuid).optional(),
|
|
8000
|
+
sources: array(PostSourceSchema).optional()
|
|
7985
8001
|
});
|
|
7986
8002
|
var CountPostsInputSchema = ListPostsInputSchema.omit({ status: true, page: true, limit: true });
|
|
7987
8003
|
var CountPostsOutputSchema = record(_enum(SCHEDULE_STATUS_VALUES), coerce_exports.number().int());
|
|
@@ -8096,7 +8112,8 @@ var PostWithRelationsSchema = object({
|
|
|
8096
8112
|
collab: PostCollabSchema,
|
|
8097
8113
|
tags: array(object({ id: string2(), name: string2(), slug: string2() })),
|
|
8098
8114
|
schedules: array(PostScheduleSchema.extend({ integration: IntegrationSummarySchema })),
|
|
8099
|
-
user: object({ id: string2(), name: string2(), email: string2() })
|
|
8115
|
+
user: object({ id: string2(), name: string2(), email: string2() }),
|
|
8116
|
+
provenance: PostProvenanceSchema.optional()
|
|
8100
8117
|
});
|
|
8101
8118
|
var PostsListOutputSchema = object({
|
|
8102
8119
|
items: array(PostWithRelationsSchema),
|
|
@@ -8868,6 +8885,7 @@ var ReviewSchema = object({
|
|
|
8868
8885
|
});
|
|
8869
8886
|
var ApprovalSettingsSchema = object({
|
|
8870
8887
|
required: boolean2(),
|
|
8888
|
+
agentPostsRequireReview: boolean2().default(false),
|
|
8871
8889
|
approverRoles: array(string2()),
|
|
8872
8890
|
minApprovers: number2().int()
|
|
8873
8891
|
});
|
|
@@ -8909,13 +8927,11 @@ var reviewsContract = {
|
|
|
8909
8927
|
};
|
|
8910
8928
|
|
|
8911
8929
|
// ../../packages/api-contract/src/schedules.ts
|
|
8912
|
-
var APPROVAL_STATUS_VALUES2 = ["pending_review", "changes_requested", "approved", "rejected"];
|
|
8913
8930
|
var ScheduleListCursorInputSchema = object({ scheduledAt: DateInput, id: Uuid });
|
|
8914
8931
|
var ScheduleListCursorOutputSchema = object({ scheduledAt: Timestamp, id: string2() });
|
|
8915
8932
|
var ListSchedulesInputSchema = object({
|
|
8916
8933
|
startDate: string2().optional(),
|
|
8917
8934
|
endDate: string2().optional(),
|
|
8918
|
-
view: _enum(["month", "week", "agenda"]).default("agenda"),
|
|
8919
8935
|
limit: coerce_exports.number().int().min(10).max(100).default(20),
|
|
8920
8936
|
cursor: ScheduleListCursorInputSchema.optional(),
|
|
8921
8937
|
direction: _enum(["forward", "backward"]).default("forward"),
|
|
@@ -8925,13 +8941,21 @@ var ListSchedulesInputSchema = object({
|
|
|
8925
8941
|
// existed. `posts.ts` already types the equivalent filters this way.
|
|
8926
8942
|
platforms: array(PlatformSchema).optional(),
|
|
8927
8943
|
statuses: array(_enum(SCHEDULE_STATUS_VALUES)).optional(),
|
|
8928
|
-
integrationIds: array(string2()).optional()
|
|
8944
|
+
integrationIds: array(string2()).optional(),
|
|
8945
|
+
search: string2().trim().min(1).max(200).optional(),
|
|
8946
|
+
tagIds: array(Uuid).optional(),
|
|
8947
|
+
approvalStatuses: array(_enum(APPROVAL_STATUS_VALUES)).optional(),
|
|
8948
|
+
sources: array(PostSourceSchema).optional()
|
|
8929
8949
|
});
|
|
8930
8950
|
var CountSchedulesInputSchema = object({
|
|
8931
8951
|
startDate: string2().optional(),
|
|
8932
8952
|
endDate: string2().optional(),
|
|
8933
8953
|
platforms: array(PlatformSchema).optional(),
|
|
8934
|
-
integrationIds: array(string2()).optional()
|
|
8954
|
+
integrationIds: array(string2()).optional(),
|
|
8955
|
+
search: string2().trim().min(1).max(200).optional(),
|
|
8956
|
+
tagIds: array(Uuid).optional(),
|
|
8957
|
+
approvalStatuses: array(_enum(APPROVAL_STATUS_VALUES)).optional(),
|
|
8958
|
+
sources: array(PostSourceSchema).optional()
|
|
8935
8959
|
});
|
|
8936
8960
|
var GetScheduleByIdInputSchema = object({ id: Uuid, postId: Uuid });
|
|
8937
8961
|
var DeleteScheduleInputSchema = object({
|
|
@@ -8961,7 +8985,7 @@ var ScheduleListItemSchema = object({
|
|
|
8961
8985
|
lastAttempt: Timestamp.nullable(),
|
|
8962
8986
|
createdAt: Timestamp,
|
|
8963
8987
|
updatedAt: Timestamp,
|
|
8964
|
-
approvalStatus: _enum(
|
|
8988
|
+
approvalStatus: _enum(APPROVAL_STATUS_VALUES).nullable(),
|
|
8965
8989
|
approvalRequestedAt: Timestamp.nullable(),
|
|
8966
8990
|
approvalCompletedAt: Timestamp.nullable(),
|
|
8967
8991
|
/**
|
|
@@ -8986,7 +9010,8 @@ var ScheduleListItemSchema = object({
|
|
|
8986
9010
|
width: number2().nullable(),
|
|
8987
9011
|
height: number2().nullable()
|
|
8988
9012
|
}).nullable(),
|
|
8989
|
-
attachmentCount: number2()
|
|
9013
|
+
attachmentCount: number2(),
|
|
9014
|
+
provenance: PostProvenanceSchema.optional()
|
|
8990
9015
|
}),
|
|
8991
9016
|
integration: object({ id: string2(), platform: PlatformSchema, name: string2(), image: string2().nullable() })
|
|
8992
9017
|
});
|
|
@@ -9004,7 +9029,7 @@ var PostRowSchema = object({
|
|
|
9004
9029
|
originSourcePostId: string2().nullable(),
|
|
9005
9030
|
isEvergreen: boolean2(),
|
|
9006
9031
|
lastRecycledAt: Timestamp.nullable(),
|
|
9007
|
-
approvalStatus: _enum(
|
|
9032
|
+
approvalStatus: _enum(APPROVAL_STATUS_VALUES).nullable(),
|
|
9008
9033
|
approvalRequestedAt: Timestamp.nullable(),
|
|
9009
9034
|
approvalCompletedAt: Timestamp.nullable(),
|
|
9010
9035
|
requiredApproverIds: array(string2()).nullable(),
|
|
@@ -9029,7 +9054,7 @@ var ScheduleWithIntegrationSchema = object({
|
|
|
9029
9054
|
lastAttempt: Timestamp.nullable(),
|
|
9030
9055
|
createdAt: Timestamp,
|
|
9031
9056
|
updatedAt: Timestamp,
|
|
9032
|
-
approvalStatus: _enum(
|
|
9057
|
+
approvalStatus: _enum(APPROVAL_STATUS_VALUES).nullable(),
|
|
9033
9058
|
approvalRequestedAt: Timestamp.nullable(),
|
|
9034
9059
|
approvalCompletedAt: Timestamp.nullable(),
|
|
9035
9060
|
/** 0 on the root and on a plain schedule; 1..N down a thread. */
|
|
@@ -9379,6 +9404,7 @@ var TransferOwnershipInputSchema = object({
|
|
|
9379
9404
|
});
|
|
9380
9405
|
var ApprovalSettingsInputSchema = object({
|
|
9381
9406
|
required: boolean2(),
|
|
9407
|
+
agentPostsRequireReview: boolean2().default(false),
|
|
9382
9408
|
approverRoles: array(_enum(["owner", "admin", "member"])),
|
|
9383
9409
|
minApprovers: number2().int().min(1).max(5)
|
|
9384
9410
|
});
|
|
@@ -12099,7 +12125,7 @@ function formatTable(headers, rows) {
|
|
|
12099
12125
|
}
|
|
12100
12126
|
|
|
12101
12127
|
// src/version.ts
|
|
12102
|
-
var CLI_VERSION = "0.1.
|
|
12128
|
+
var CLI_VERSION = "0.1.21";
|
|
12103
12129
|
|
|
12104
12130
|
// src/client.ts
|
|
12105
12131
|
var DEVICE_CODE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:device_code";
|
|
@@ -12169,6 +12195,7 @@ function buildClient(apiUrl, auth) {
|
|
|
12169
12195
|
url: `${apiUrl}/api/v1`,
|
|
12170
12196
|
headers: () => ({
|
|
12171
12197
|
[CLI_VERSION_HEADER]: CLI_VERSION,
|
|
12198
|
+
"x-postonus-client": "cli",
|
|
12172
12199
|
...auth.kind === "api-key" ? { "x-api-key": auth.apiKey } : { authorization: `Bearer ${oauth?.accessToken}` }
|
|
12173
12200
|
}),
|
|
12174
12201
|
fetch: oauth ? createOAuthFetch(apiUrl, oauth, persistRefreshedTokens(apiUrl, oauth)) : (request, init) => fetch(request, init)
|
|
@@ -13073,7 +13100,6 @@ async function listQueue(options) {
|
|
|
13073
13100
|
try {
|
|
13074
13101
|
const result = await api.schedules.list({
|
|
13075
13102
|
limit,
|
|
13076
|
-
view: "agenda",
|
|
13077
13103
|
direction: "forward",
|
|
13078
13104
|
platforms: platforms.length > 0 ? platforms : void 0,
|
|
13079
13105
|
// Default to what "queue" means to a user: not-yet-published work.
|