@keystrokehq/cli 0.0.109 → 0.0.110

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.mjs CHANGED
@@ -2419,7 +2419,7 @@ const GatewayAttachmentSourceSchema = object({
2419
2419
  channelIds: array(string()).optional(),
2420
2420
  subscribeOnMention: boolean()
2421
2421
  });
2422
- object({ attachments: array(object({
2422
+ const GatewayAttachmentRecordSchema = object({
2423
2423
  id: string(),
2424
2424
  key: string(),
2425
2425
  agentKey: string(),
@@ -2428,13 +2428,14 @@ object({ attachments: array(object({
2428
2428
  source: GatewayAttachmentSourceSchema,
2429
2429
  registeredAt: string(),
2430
2430
  updatedAt: string()
2431
- })) });
2432
- object({
2431
+ });
2432
+ object({ attachments: array(GatewayAttachmentRecordSchema) });
2433
+ const UpsertGatewayAttachmentBodySchema = object({
2433
2434
  agentKey: string().min(1),
2434
2435
  mode: SlackGatewayModeSchema.optional(),
2435
2436
  subscribeOnMention: boolean().optional()
2436
2437
  });
2437
- object({ agents: array(object({
2438
+ const AgentListResponseSchema = object({ agents: array(object({
2438
2439
  key: string(),
2439
2440
  name: string().optional(),
2440
2441
  route: string()
@@ -3125,6 +3126,28 @@ function createArtifactsResource(http) {
3125
3126
  }
3126
3127
  };
3127
3128
  }
3129
+ function createGatewayAttachmentsResource(http) {
3130
+ const projectPrefix = (projectId) => `/api/projects/${encodeURIComponent(projectId)}/gateways/slack/attachments`;
3131
+ return {
3132
+ async listProjectAgents(projectId) {
3133
+ try {
3134
+ const data = await http.get(`/api/projects/${encodeURIComponent(projectId)}/agents`).json();
3135
+ return AgentListResponseSchema.parse(data).agents;
3136
+ } catch (error) {
3137
+ throw await toPlatformError(error);
3138
+ }
3139
+ },
3140
+ async upsertSlackAttachment(projectId, channelId, body) {
3141
+ const payload = UpsertGatewayAttachmentBodySchema.parse(body);
3142
+ try {
3143
+ const data = await http.put(`${projectPrefix(projectId)}/${encodeURIComponent(channelId)}`, { json: payload }).json();
3144
+ return GatewayAttachmentRecordSchema.parse(data);
3145
+ } catch (error) {
3146
+ throw await toPlatformError(error);
3147
+ }
3148
+ }
3149
+ };
3150
+ }
3128
3151
  function createHealthResource(http) {
3129
3152
  return { async check() {
3130
3153
  try {
@@ -6916,6 +6939,7 @@ function createPlatformClient(options) {
6916
6939
  credentials: createCredentialsResource(),
6917
6940
  history: createHistoryResource(),
6918
6941
  deployments: createDeploymentsResource(),
6942
+ gatewayAttachments: createGatewayAttachmentsResource(http),
6919
6943
  projectMetrics: createProjectMetricsResource(),
6920
6944
  projectFiles: createProjectFilesResource(),
6921
6945
  channels: createChannelsResource(),