@sixb/server 0.1.0 → 0.1.1

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.
Files changed (49) hide show
  1. package/dist/auth/scope.d.ts +8 -0
  2. package/dist/auth/scope.d.ts.map +1 -1
  3. package/dist/files/content.d.ts +11 -0
  4. package/dist/files/content.d.ts.map +1 -1
  5. package/dist/index.js +2114 -2080
  6. package/dist/index.js.map +14 -14
  7. package/dist/routes/action-runs.d.ts.map +1 -1
  8. package/dist/routes/agent-api-gateway.d.ts.map +1 -1
  9. package/dist/routes/agents.d.ts +21 -21
  10. package/dist/routes/auth.d.ts +6 -6
  11. package/dist/routes/datasets.d.ts +7 -5
  12. package/dist/routes/datasets.d.ts.map +1 -1
  13. package/dist/routes/events.d.ts +1 -1
  14. package/dist/routes/files.d.ts.map +1 -1
  15. package/dist/routes/links.d.ts.map +1 -1
  16. package/dist/routes/logs.d.ts +2 -2
  17. package/dist/routes/ontology.d.ts +24 -24
  18. package/dist/routes/pipelines.d.ts +4 -0
  19. package/dist/routes/pipelines.d.ts.map +1 -1
  20. package/dist/routes/syncs.d.ts +7 -5
  21. package/dist/routes/syncs.d.ts.map +1 -1
  22. package/dist/routes/workflows.d.ts +61 -62
  23. package/dist/routes/workflows.d.ts.map +1 -1
  24. package/dist/routes/ws/logs.d.ts +10 -10
  25. package/dist/schemas/agents.d.ts +84 -84
  26. package/dist/schemas/auth.d.ts +26 -26
  27. package/dist/schemas/datasets.d.ts +27 -21
  28. package/dist/schemas/datasets.d.ts.map +1 -1
  29. package/dist/schemas/events.d.ts +10 -10
  30. package/dist/schemas/logs.d.ts +18 -18
  31. package/dist/schemas/ontology.d.ts +88 -88
  32. package/dist/schemas/pipelines.d.ts +36 -0
  33. package/dist/schemas/pipelines.d.ts.map +1 -1
  34. package/dist/schemas/syncs.d.ts +23 -16
  35. package/dist/schemas/syncs.d.ts.map +1 -1
  36. package/dist/schemas/workflows.d.ts +299 -246
  37. package/dist/schemas/workflows.d.ts.map +1 -1
  38. package/package.json +8 -5
  39. package/src/auth/scope.ts +16 -2
  40. package/src/files/content.ts +11 -0
  41. package/src/routes/action-runs.ts +10 -3
  42. package/src/routes/agent-api-gateway.ts +46 -4
  43. package/src/routes/files.ts +2 -1
  44. package/src/routes/links.ts +1 -0
  45. package/src/routes/workflows.ts +39 -16
  46. package/src/schemas/datasets.ts +3 -2
  47. package/src/schemas/pipelines.ts +1 -25
  48. package/src/schemas/syncs.ts +3 -2
  49. package/src/schemas/workflows.ts +27 -20
@@ -1,4 +1,7 @@
1
1
  import { z } from "zod"
2
+ import { JsonValueSchema } from "./common"
3
+
4
+ export const WorkflowIOSnapshotSchema = z.record(JsonValueSchema)
2
5
 
3
6
  export const WorkflowParamsSchema = z.object({
4
7
  workflowId: z.string().min(1),
@@ -55,7 +58,7 @@ export const WorkflowInterventionsQuerySchema = z.object({
55
58
 
56
59
  export const RequestWorkflowRunBodySchema = z
57
60
  .object({
58
- input: z.record(z.unknown()).optional(),
61
+ input: WorkflowIOSnapshotSchema.optional(),
59
62
  })
60
63
  .default({})
61
64
 
@@ -67,7 +70,7 @@ export const WorkflowInterventionActorSchema = z.object({
67
70
  export const CancelWorkflowRunBodySchema = z.object({}).default({})
68
71
 
69
72
  export const SubmitWorkflowInterventionBodySchema = z.object({
70
- response: z.record(z.unknown()),
73
+ response: WorkflowIOSnapshotSchema,
71
74
  })
72
75
 
73
76
  export const CancelWorkflowInterventionBodySchema = z.object({}).default({})
@@ -82,22 +85,22 @@ const WorkflowNodeSchema = z.union([
82
85
  type: z.literal("step"),
83
86
  id: z.string(),
84
87
  key: z.string(),
85
- input: z.record(z.unknown()),
86
- output: z.record(z.unknown()),
88
+ input: WorkflowIOSnapshotSchema,
89
+ output: WorkflowIOSnapshotSchema,
87
90
  }),
88
91
  z.object({
89
92
  type: z.literal("action"),
90
93
  id: z.string(),
91
94
  key: z.string(),
92
95
  objectTypeId: z.string().optional(),
93
- params: z.record(z.unknown()),
96
+ params: WorkflowIOSnapshotSchema,
94
97
  }),
95
98
  z.object({
96
99
  type: z.literal("intervention"),
97
100
  id: z.string(),
98
101
  key: z.string(),
99
- input: z.record(z.unknown()),
100
- response: z.record(z.unknown()),
102
+ input: WorkflowIOSnapshotSchema,
103
+ response: WorkflowIOSnapshotSchema,
101
104
  description: z.string().optional(),
102
105
  }),
103
106
  z.object({
@@ -105,17 +108,16 @@ const WorkflowNodeSchema = z.union([
105
108
  id: z.string(),
106
109
  key: z.string(),
107
110
  agentId: z.string(),
108
- input: z.record(z.unknown()),
109
- output: z.record(z.unknown()),
111
+ input: WorkflowIOSnapshotSchema,
112
+ output: WorkflowIOSnapshotSchema,
110
113
  }),
111
114
  ])
112
115
 
113
- export const WorkflowRunSchema = z.object({
116
+ export const WorkflowRunSummarySchema = z.object({
114
117
  id: z.string(),
115
118
  projectId: z.string(),
116
119
  workflowId: z.string(),
117
120
  status: WorkflowRunStatusSchema,
118
- input: z.record(z.unknown()),
119
121
  queuedAt: z.string().optional(),
120
122
  startedAt: z.string(),
121
123
  finishedAt: z.string().optional(),
@@ -123,6 +125,11 @@ export const WorkflowRunSchema = z.object({
123
125
  requestedBy: WorkflowInterventionActorSchema,
124
126
  })
125
127
 
128
+ export const WorkflowRunDetailSchema = WorkflowRunSummarySchema.extend({
129
+ input: WorkflowIOSnapshotSchema,
130
+ output: WorkflowIOSnapshotSchema.optional(),
131
+ })
132
+
126
133
  export const WorkflowAgentNodeExecutionSummarySchema = z.object({
127
134
  agentId: z.string(),
128
135
  status: z.enum(["queued", "running", "succeeded", "failed", "cancelled"]),
@@ -154,10 +161,10 @@ export const WorkflowNodeRunSchema = z.object({
154
161
  nodeId: z.string(),
155
162
  nodeKey: z.string(),
156
163
  status: z.enum(["running", "waiting", "succeeded", "failed", "cancelled"]),
157
- input: z.record(z.unknown()),
164
+ input: WorkflowIOSnapshotSchema,
158
165
  startedAt: z.string(),
159
166
  finishedAt: z.string().optional(),
160
- output: z.record(z.unknown()).optional(),
167
+ output: WorkflowIOSnapshotSchema.optional(),
161
168
  error: z.string().optional(),
162
169
  agentExecution: WorkflowAgentNodeExecutionSummarySchema.optional(),
163
170
  })
@@ -172,14 +179,14 @@ export const WorkflowInterventionSchema = z.object({
172
179
  nodeId: z.string(),
173
180
  nodeKey: z.string(),
174
181
  interventionId: z.string(),
175
- input: z.record(z.unknown()),
176
- defaultResponse: z.record(z.unknown()),
182
+ input: WorkflowIOSnapshotSchema,
183
+ defaultResponse: WorkflowIOSnapshotSchema,
177
184
  status: WorkflowInterventionStatusSchema,
178
185
  requestedAt: z.string(),
179
186
  expiresAt: z.string().optional(),
180
187
  submittedAt: z.string().optional(),
181
188
  submittedBy: WorkflowInterventionActorSchema.optional(),
182
- response: z.record(z.unknown()).optional(),
189
+ response: WorkflowIOSnapshotSchema.optional(),
183
190
  cancelledAt: z.string().optional(),
184
191
  cancelledBy: WorkflowInterventionActorSchema.optional(),
185
192
  expiredAt: z.string().optional(),
@@ -187,20 +194,20 @@ export const WorkflowInterventionSchema = z.object({
187
194
 
188
195
  export const WorkflowSchema = z.object({
189
196
  id: z.string(),
190
- input: z.record(z.unknown()),
197
+ input: WorkflowIOSnapshotSchema,
191
198
  triggers: z.array(WorkflowTriggerSchema),
192
199
  nodes: z.array(WorkflowNodeSchema),
193
- latestRun: WorkflowRunSchema.nullable(),
200
+ latestRun: WorkflowRunSummarySchema.nullable(),
194
201
  })
195
202
 
196
203
  export const WorkflowRunListResponseSchema = z.object({
197
- runs: z.array(WorkflowRunSchema),
204
+ runs: z.array(WorkflowRunSummarySchema),
198
205
  hasMore: z.boolean(),
199
206
  total: z.number(),
200
207
  })
201
208
 
202
209
  export const WorkflowRunDetailResponseSchema = z.object({
203
- run: WorkflowRunSchema,
210
+ run: WorkflowRunDetailSchema,
204
211
  nodes: z.array(WorkflowNodeRunSchema),
205
212
  })
206
213