@postonus/cli 0.1.20 → 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 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,7 +8927,6 @@ 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({
@@ -8927,7 +8944,8 @@ var ListSchedulesInputSchema = object({
8927
8944
  integrationIds: array(string2()).optional(),
8928
8945
  search: string2().trim().min(1).max(200).optional(),
8929
8946
  tagIds: array(Uuid).optional(),
8930
- approvalStatuses: array(_enum(APPROVAL_STATUS_VALUES2)).optional()
8947
+ approvalStatuses: array(_enum(APPROVAL_STATUS_VALUES)).optional(),
8948
+ sources: array(PostSourceSchema).optional()
8931
8949
  });
8932
8950
  var CountSchedulesInputSchema = object({
8933
8951
  startDate: string2().optional(),
@@ -8936,7 +8954,8 @@ var CountSchedulesInputSchema = object({
8936
8954
  integrationIds: array(string2()).optional(),
8937
8955
  search: string2().trim().min(1).max(200).optional(),
8938
8956
  tagIds: array(Uuid).optional(),
8939
- approvalStatuses: array(_enum(APPROVAL_STATUS_VALUES2)).optional()
8957
+ approvalStatuses: array(_enum(APPROVAL_STATUS_VALUES)).optional(),
8958
+ sources: array(PostSourceSchema).optional()
8940
8959
  });
8941
8960
  var GetScheduleByIdInputSchema = object({ id: Uuid, postId: Uuid });
8942
8961
  var DeleteScheduleInputSchema = object({
@@ -8966,7 +8985,7 @@ var ScheduleListItemSchema = object({
8966
8985
  lastAttempt: Timestamp.nullable(),
8967
8986
  createdAt: Timestamp,
8968
8987
  updatedAt: Timestamp,
8969
- approvalStatus: _enum(APPROVAL_STATUS_VALUES2).nullable(),
8988
+ approvalStatus: _enum(APPROVAL_STATUS_VALUES).nullable(),
8970
8989
  approvalRequestedAt: Timestamp.nullable(),
8971
8990
  approvalCompletedAt: Timestamp.nullable(),
8972
8991
  /**
@@ -8991,7 +9010,8 @@ var ScheduleListItemSchema = object({
8991
9010
  width: number2().nullable(),
8992
9011
  height: number2().nullable()
8993
9012
  }).nullable(),
8994
- attachmentCount: number2()
9013
+ attachmentCount: number2(),
9014
+ provenance: PostProvenanceSchema.optional()
8995
9015
  }),
8996
9016
  integration: object({ id: string2(), platform: PlatformSchema, name: string2(), image: string2().nullable() })
8997
9017
  });
@@ -9009,7 +9029,7 @@ var PostRowSchema = object({
9009
9029
  originSourcePostId: string2().nullable(),
9010
9030
  isEvergreen: boolean2(),
9011
9031
  lastRecycledAt: Timestamp.nullable(),
9012
- approvalStatus: _enum(APPROVAL_STATUS_VALUES2).nullable(),
9032
+ approvalStatus: _enum(APPROVAL_STATUS_VALUES).nullable(),
9013
9033
  approvalRequestedAt: Timestamp.nullable(),
9014
9034
  approvalCompletedAt: Timestamp.nullable(),
9015
9035
  requiredApproverIds: array(string2()).nullable(),
@@ -9034,7 +9054,7 @@ var ScheduleWithIntegrationSchema = object({
9034
9054
  lastAttempt: Timestamp.nullable(),
9035
9055
  createdAt: Timestamp,
9036
9056
  updatedAt: Timestamp,
9037
- approvalStatus: _enum(APPROVAL_STATUS_VALUES2).nullable(),
9057
+ approvalStatus: _enum(APPROVAL_STATUS_VALUES).nullable(),
9038
9058
  approvalRequestedAt: Timestamp.nullable(),
9039
9059
  approvalCompletedAt: Timestamp.nullable(),
9040
9060
  /** 0 on the root and on a plain schedule; 1..N down a thread. */
@@ -9384,6 +9404,7 @@ var TransferOwnershipInputSchema = object({
9384
9404
  });
9385
9405
  var ApprovalSettingsInputSchema = object({
9386
9406
  required: boolean2(),
9407
+ agentPostsRequireReview: boolean2().default(false),
9387
9408
  approverRoles: array(_enum(["owner", "admin", "member"])),
9388
9409
  minApprovers: number2().int().min(1).max(5)
9389
9410
  });
@@ -12104,7 +12125,7 @@ function formatTable(headers, rows) {
12104
12125
  }
12105
12126
 
12106
12127
  // src/version.ts
12107
- var CLI_VERSION = "0.1.20";
12128
+ var CLI_VERSION = "0.1.21";
12108
12129
 
12109
12130
  // src/client.ts
12110
12131
  var DEVICE_CODE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:device_code";
@@ -12174,6 +12195,7 @@ function buildClient(apiUrl, auth) {
12174
12195
  url: `${apiUrl}/api/v1`,
12175
12196
  headers: () => ({
12176
12197
  [CLI_VERSION_HEADER]: CLI_VERSION,
12198
+ "x-postonus-client": "cli",
12177
12199
  ...auth.kind === "api-key" ? { "x-api-key": auth.apiKey } : { authorization: `Bearer ${oauth?.accessToken}` }
12178
12200
  }),
12179
12201
  fetch: oauth ? createOAuthFetch(apiUrl, oauth, persistRefreshedTokens(apiUrl, oauth)) : (request, init) => fetch(request, init)