@sixb/server 0.1.3 → 0.1.4
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/README.md +1 -1
- package/dist/index.js +1111 -934
- package/dist/index.js.map +15 -13
- package/dist/openapi/tags.d.ts +6 -2
- package/dist/openapi/tags.d.ts.map +1 -1
- package/dist/registerRoutes.d.ts.map +1 -1
- package/dist/routes/agents.d.ts +15 -0
- package/dist/routes/agents.d.ts.map +1 -1
- package/dist/routes/links.d.ts +0 -51
- package/dist/routes/links.d.ts.map +1 -1
- package/dist/routes/logs.d.ts +1 -1
- package/dist/routes/models.d.ts +60 -0
- package/dist/routes/models.d.ts.map +1 -0
- package/dist/routes/objects.d.ts +48 -0
- package/dist/routes/objects.d.ts.map +1 -1
- package/dist/routes/projections.d.ts +88 -86
- package/dist/routes/projections.d.ts.map +1 -1
- package/dist/routes/syncs.d.ts +32 -32
- package/dist/schemas/agents.d.ts +127 -0
- package/dist/schemas/agents.d.ts.map +1 -1
- package/dist/schemas/ai-accounting.d.ts +26 -26
- package/dist/schemas/connectors.d.ts +11 -1
- package/dist/schemas/connectors.d.ts.map +1 -1
- package/dist/schemas/links.d.ts +0 -41
- package/dist/schemas/links.d.ts.map +1 -1
- package/dist/schemas/logs.d.ts +4 -4
- package/dist/schemas/models.d.ts +50 -0
- package/dist/schemas/models.d.ts.map +1 -0
- package/dist/schemas/objects.d.ts +22 -0
- package/dist/schemas/objects.d.ts.map +1 -1
- package/dist/schemas/projections.d.ts +542 -513
- package/dist/schemas/projections.d.ts.map +1 -1
- package/dist/schemas/syncs.d.ts +23 -23
- package/package.json +4 -4
- package/src/openapi/tags.ts +4 -0
- package/src/registerRoutes.ts +2 -0
- package/src/routes/agents.ts +21 -3
- package/src/routes/links.ts +2 -53
- package/src/routes/models.ts +31 -0
- package/src/routes/objects.ts +103 -0
- package/src/schemas/agents.ts +15 -0
- package/src/schemas/connectors.ts +13 -3
- package/src/schemas/links.ts +0 -17
- package/src/schemas/models.ts +15 -0
- package/src/schemas/objects.ts +104 -0
- package/src/schemas/projections.ts +6 -3
package/dist/index.js
CHANGED
|
@@ -687,6 +687,10 @@ var OPENAPI_TAGS = {
|
|
|
687
687
|
name: "Agents",
|
|
688
688
|
description: "Agent catalog"
|
|
689
689
|
},
|
|
690
|
+
models: {
|
|
691
|
+
name: "Models",
|
|
692
|
+
description: "Project model catalog"
|
|
693
|
+
},
|
|
690
694
|
agentThreads: {
|
|
691
695
|
name: "Agent Threads",
|
|
692
696
|
description: "Agent conversation threads and messages"
|
|
@@ -2693,6 +2697,11 @@ var AgentContextPartSchema = AgentContextEntryInputSchema.extend({
|
|
|
2693
2697
|
var AgentLoopConfigSchema = z8.object({
|
|
2694
2698
|
stopWhen: z8.object({
|
|
2695
2699
|
maxSteps: z8.number().int().positive().optional()
|
|
2700
|
+
}).optional(),
|
|
2701
|
+
context: z8.object({
|
|
2702
|
+
windowTokens: z8.number().int().positive().optional(),
|
|
2703
|
+
reserveTokens: z8.number().int().positive().optional(),
|
|
2704
|
+
keepRecentTokens: z8.number().int().positive().optional()
|
|
2696
2705
|
}).optional()
|
|
2697
2706
|
});
|
|
2698
2707
|
var AgentReasoningLevelSchema = z8.enum(AGENT_REASONING_LEVELS);
|
|
@@ -2791,6 +2800,11 @@ var AgentRunDiagnosticSchema = z8.object({
|
|
|
2791
2800
|
path: z8.string().optional(),
|
|
2792
2801
|
message: z8.string()
|
|
2793
2802
|
});
|
|
2803
|
+
var AgentMessageCompactionSchema = z8.object({
|
|
2804
|
+
checkpointId: z8.string(),
|
|
2805
|
+
summary: z8.string(),
|
|
2806
|
+
createdAt: z8.string()
|
|
2807
|
+
});
|
|
2794
2808
|
var AgentMessageSchema = z8.object({
|
|
2795
2809
|
id: z8.string(),
|
|
2796
2810
|
projectId: z8.string(),
|
|
@@ -2801,6 +2815,7 @@ var AgentMessageSchema = z8.object({
|
|
|
2801
2815
|
seq: z8.number(),
|
|
2802
2816
|
parts: z8.array(AgentMessagePartSchema),
|
|
2803
2817
|
annotations: z8.array(AgentRunDiagnosticSchema),
|
|
2818
|
+
compaction: AgentMessageCompactionSchema.optional(),
|
|
2804
2819
|
metadata: JsonValueSchema.optional(),
|
|
2805
2820
|
contentVersion: z8.number(),
|
|
2806
2821
|
createdAt: z8.string(),
|
|
@@ -2905,7 +2920,7 @@ function serializeThread(thread) {
|
|
|
2905
2920
|
updatedAt: toIsoString(thread.updatedAt)
|
|
2906
2921
|
});
|
|
2907
2922
|
}
|
|
2908
|
-
function serializeMessage(message, annotations = []) {
|
|
2923
|
+
function serializeMessage(message, annotations = [], checkpoint) {
|
|
2909
2924
|
return AgentMessageSchema.parse({
|
|
2910
2925
|
id: message.id,
|
|
2911
2926
|
projectId: message.projectId,
|
|
@@ -2916,6 +2931,11 @@ function serializeMessage(message, annotations = []) {
|
|
|
2916
2931
|
seq: message.seq,
|
|
2917
2932
|
parts: message.parts,
|
|
2918
2933
|
annotations,
|
|
2934
|
+
compaction: checkpoint ? {
|
|
2935
|
+
checkpointId: checkpoint.id,
|
|
2936
|
+
summary: checkpoint.summary,
|
|
2937
|
+
createdAt: toIsoString(checkpoint.createdAt)
|
|
2938
|
+
} : undefined,
|
|
2919
2939
|
metadata: message.metadata,
|
|
2920
2940
|
contentVersion: message.contentVersion,
|
|
2921
2941
|
createdAt: toIsoString(message.createdAt),
|
|
@@ -3200,10 +3220,14 @@ function registerAgentRoutes(app, host) {
|
|
|
3200
3220
|
order: parsed.order
|
|
3201
3221
|
});
|
|
3202
3222
|
const runIds = result.messages.flatMap((message) => message.runId === null ? [] : [message.runId]);
|
|
3203
|
-
const runs = await
|
|
3223
|
+
const [runs, checkpoints] = await Promise.all([
|
|
3224
|
+
storage.runs.getByIds({ projectId: host.id, ids: runIds }),
|
|
3225
|
+
storage.checkpoints.getByRunIds({ projectId: host.id, runIds })
|
|
3226
|
+
]);
|
|
3204
3227
|
const diagnosticsByRunId = new Map(runs.filter((run) => run.threadId === thread.id).map((run) => [run.id, run.diagnostics ?? []]));
|
|
3228
|
+
const checkpointsByRunId = new Map(checkpoints.filter((checkpoint) => checkpoint.threadId === thread.id).map((checkpoint) => [checkpoint.createdByRunId, checkpoint]));
|
|
3205
3229
|
return AgentMessageListResponseSchema.parse({
|
|
3206
|
-
messages: result.messages.map((message) => serializeMessage(message, message.runId === null ? [] : diagnosticsByRunId.get(message.runId) ?? [])),
|
|
3230
|
+
messages: result.messages.map((message) => serializeMessage(message, message.runId === null ? [] : diagnosticsByRunId.get(message.runId) ?? [], message.runId === null ? undefined : checkpointsByRunId.get(message.runId))),
|
|
3207
3231
|
hasMore: result.hasMore,
|
|
3208
3232
|
total: result.total
|
|
3209
3233
|
});
|
|
@@ -3846,9 +3870,11 @@ var ConnectorOAuthCallbackQuerySchema = z10.object({
|
|
|
3846
3870
|
code: z10.string().min(1).optional(),
|
|
3847
3871
|
auth_code: z10.string().min(1).optional(),
|
|
3848
3872
|
error: z10.string().min(1).optional()
|
|
3849
|
-
}).refine((query) =>
|
|
3850
|
-
|
|
3851
|
-
|
|
3873
|
+
}).refine((query) => {
|
|
3874
|
+
const hasAuthorizationCode = query.code !== undefined || query.auth_code !== undefined;
|
|
3875
|
+
const hasProviderError = query.error !== undefined;
|
|
3876
|
+
return hasAuthorizationCode !== hasProviderError;
|
|
3877
|
+
}, { message: "OAuth callback must contain exactly one of an authorization code or error." }).refine((query) => query.code === undefined || query.auth_code === undefined || query.code === query.auth_code, { message: "OAuth callback code and auth_code must match when both are present." }).transform(({ auth_code, ...query }) => ({ ...query, code: query.code ?? auth_code }));
|
|
3852
3878
|
function connectorRouteErrorResponseSchema(codes) {
|
|
3853
3879
|
return ErrorResponseSchema.extend({
|
|
3854
3880
|
code: z10.enum(codes).optional().describe("Stable machine-readable failure code for programmatic handling.")
|
|
@@ -4878,10 +4904,6 @@ var LinkSourceParamsSchema = z14.object({
|
|
|
4878
4904
|
var LinkParamsSchema = LinkSourceParamsSchema.extend({
|
|
4879
4905
|
linkId: z14.string().min(1)
|
|
4880
4906
|
});
|
|
4881
|
-
var LinkQuerySchema = z14.object({
|
|
4882
|
-
linkId: z14.string().optional(),
|
|
4883
|
-
direction: z14.enum(["outgoing", "incoming", "both"]).default("outgoing")
|
|
4884
|
-
});
|
|
4885
4907
|
var RemoveLinkQuerySchema = z14.object({
|
|
4886
4908
|
targetTypeId: z14.string().min(1),
|
|
4887
4909
|
targetId: z14.string().min(1)
|
|
@@ -4891,59 +4913,10 @@ var UpsertLinkBodySchema = z14.object({
|
|
|
4891
4913
|
targetId: z14.string().min(1),
|
|
4892
4914
|
properties: z14.record(z14.unknown()).optional()
|
|
4893
4915
|
});
|
|
4894
|
-
var ObjectLinkSchema = z14.object({
|
|
4895
|
-
projectId: z14.string(),
|
|
4896
|
-
sourceTypeId: z14.string(),
|
|
4897
|
-
sourceId: z14.string(),
|
|
4898
|
-
linkId: z14.string(),
|
|
4899
|
-
targetTypeId: z14.string(),
|
|
4900
|
-
targetId: z14.string(),
|
|
4901
|
-
properties: z14.record(z14.unknown()).optional(),
|
|
4902
|
-
createdAt: z14.string(),
|
|
4903
|
-
updatedAt: z14.string()
|
|
4904
|
-
});
|
|
4905
4916
|
|
|
4906
4917
|
// src/routes/links.ts
|
|
4907
4918
|
function registerLinkRoutes(app, _host) {
|
|
4908
|
-
return app.
|
|
4909
|
-
const { params, query, set } = context;
|
|
4910
|
-
try {
|
|
4911
|
-
const sixb = requireRequestSixb(context);
|
|
4912
|
-
if (!sixb.objects.getTypeById(params.objectTypeId)) {
|
|
4913
|
-
set.status = 404;
|
|
4914
|
-
return { error: "Object not found" };
|
|
4915
|
-
}
|
|
4916
|
-
const parsedQuery = LinkQuerySchema.parse(query);
|
|
4917
|
-
const links = await sixb.objects.listLinks({
|
|
4918
|
-
objectTypeId: params.objectTypeId,
|
|
4919
|
-
objectId: params.objectId,
|
|
4920
|
-
linkId: parsedQuery.linkId,
|
|
4921
|
-
direction: parsedQuery.direction
|
|
4922
|
-
});
|
|
4923
|
-
return links.map((link) => ({
|
|
4924
|
-
...link,
|
|
4925
|
-
createdAt: toIsoString(link.createdAt),
|
|
4926
|
-
updatedAt: toIsoString(link.updatedAt)
|
|
4927
|
-
}));
|
|
4928
|
-
} catch (error) {
|
|
4929
|
-
set.status = 400;
|
|
4930
|
-
return { error: error instanceof Error ? error.message : String(error) };
|
|
4931
|
-
}
|
|
4932
|
-
}, {
|
|
4933
|
-
params: LinkSourceParamsSchema,
|
|
4934
|
-
query: LinkQuerySchema,
|
|
4935
|
-
response: {
|
|
4936
|
-
200: ObjectLinkSchema.array(),
|
|
4937
|
-
400: ErrorResponseSchema,
|
|
4938
|
-
404: ErrorResponseSchema
|
|
4939
|
-
},
|
|
4940
|
-
detail: {
|
|
4941
|
-
summary: "List object links",
|
|
4942
|
-
tags: [OPENAPI_TAGS.links.name],
|
|
4943
|
-
operationId: "listObjectLinks",
|
|
4944
|
-
security: bearerSecurityRequirement("listObjectLinks")
|
|
4945
|
-
}
|
|
4946
|
-
}).put("/api/objects/:objectTypeId/:objectId/links/:linkId", async (context) => {
|
|
4919
|
+
return app.put("/api/objects/:objectTypeId/:objectId/links/:linkId", async (context) => {
|
|
4947
4920
|
const { params, body, set } = context;
|
|
4948
4921
|
try {
|
|
4949
4922
|
const parsedBody = UpsertLinkBodySchema.parse(body);
|
|
@@ -5114,6 +5087,37 @@ function registerLogRoutes(app, _host) {
|
|
|
5114
5087
|
});
|
|
5115
5088
|
}
|
|
5116
5089
|
|
|
5090
|
+
// src/schemas/models.ts
|
|
5091
|
+
import { z as z16 } from "zod";
|
|
5092
|
+
var LanguageModelSchema = z16.object({
|
|
5093
|
+
provider: z16.string(),
|
|
5094
|
+
modelId: z16.string(),
|
|
5095
|
+
isDefault: z16.boolean()
|
|
5096
|
+
});
|
|
5097
|
+
var ModelCatalogSchema = z16.object({
|
|
5098
|
+
language: z16.array(LanguageModelSchema)
|
|
5099
|
+
});
|
|
5100
|
+
|
|
5101
|
+
// src/routes/models.ts
|
|
5102
|
+
function serializeLanguageModel(entry, defaultRef) {
|
|
5103
|
+
return { provider: entry.provider, modelId: entry.modelId, isDefault: entry.ref === defaultRef };
|
|
5104
|
+
}
|
|
5105
|
+
function registerModelRoutes(app, host) {
|
|
5106
|
+
return app.get("/api/models", () => {
|
|
5107
|
+
const language = host.definitions.models?.language;
|
|
5108
|
+
return ModelCatalogSchema.parse({
|
|
5109
|
+
language: language === undefined ? [] : language.list().map((entry) => serializeLanguageModel(entry, language.default.ref))
|
|
5110
|
+
});
|
|
5111
|
+
}, {
|
|
5112
|
+
response: { 200: ModelCatalogSchema },
|
|
5113
|
+
detail: {
|
|
5114
|
+
summary: "List the project model catalog",
|
|
5115
|
+
tags: [OPENAPI_TAGS.models.name],
|
|
5116
|
+
operationId: "listModels"
|
|
5117
|
+
}
|
|
5118
|
+
});
|
|
5119
|
+
}
|
|
5120
|
+
|
|
5117
5121
|
// src/routes/objects.ts
|
|
5118
5122
|
import {
|
|
5119
5123
|
AuthorizationError as AuthorizationError3,
|
|
@@ -5121,35 +5125,35 @@ import {
|
|
|
5121
5125
|
ObjectQueryPlanningError,
|
|
5122
5126
|
ObjectQueryValidationError
|
|
5123
5127
|
} from "@sixb/core";
|
|
5124
|
-
import { ZodError as ZodError3, z as
|
|
5128
|
+
import { ZodError as ZodError3, z as z18 } from "zod";
|
|
5125
5129
|
|
|
5126
5130
|
// src/schemas/objects.ts
|
|
5127
|
-
import { z as
|
|
5128
|
-
var ObjectParamsSchema =
|
|
5129
|
-
objectTypeId:
|
|
5130
|
-
objectId:
|
|
5131
|
-
});
|
|
5132
|
-
var ObjectSearchQuerySchema =
|
|
5133
|
-
q:
|
|
5134
|
-
limit:
|
|
5135
|
-
});
|
|
5136
|
-
var ObjectSearchResponseSchema =
|
|
5137
|
-
items:
|
|
5138
|
-
ref:
|
|
5139
|
-
objectTypeId:
|
|
5140
|
-
primaryId:
|
|
5131
|
+
import { z as z17 } from "zod";
|
|
5132
|
+
var ObjectParamsSchema = z17.object({
|
|
5133
|
+
objectTypeId: z17.string().min(1),
|
|
5134
|
+
objectId: z17.string().min(1)
|
|
5135
|
+
});
|
|
5136
|
+
var ObjectSearchQuerySchema = z17.object({
|
|
5137
|
+
q: z17.string().trim().min(1).max(200),
|
|
5138
|
+
limit: z17.string().regex(/^\d+$/).optional()
|
|
5139
|
+
});
|
|
5140
|
+
var ObjectSearchResponseSchema = z17.object({
|
|
5141
|
+
items: z17.array(z17.object({
|
|
5142
|
+
ref: z17.object({
|
|
5143
|
+
objectTypeId: z17.string(),
|
|
5144
|
+
primaryId: z17.string()
|
|
5141
5145
|
}),
|
|
5142
|
-
label:
|
|
5146
|
+
label: z17.string()
|
|
5143
5147
|
}))
|
|
5144
5148
|
});
|
|
5145
5149
|
var OBJECT_LIST_MAX_LIMIT = 1000;
|
|
5146
|
-
var Rfc3339DateSchema =
|
|
5150
|
+
var Rfc3339DateSchema = z17.string().datetime({ offset: true });
|
|
5147
5151
|
function objectListDateSchema(parameter) {
|
|
5148
|
-
return
|
|
5152
|
+
return z17.string().refine((value) => Rfc3339DateSchema.safeParse(value).success, {
|
|
5149
5153
|
message: `Invalid query parameter '${parameter}': expected an RFC 3339 timestamp.`
|
|
5150
5154
|
}).transform((value) => new Date(value));
|
|
5151
5155
|
}
|
|
5152
|
-
var ObjectListLimitSchema =
|
|
5156
|
+
var ObjectListLimitSchema = z17.string().refine((value) => {
|
|
5153
5157
|
if (!/^\d+$/.test(value))
|
|
5154
5158
|
return false;
|
|
5155
5159
|
const parsed = Number(value);
|
|
@@ -5157,25 +5161,25 @@ var ObjectListLimitSchema = z16.string().refine((value) => {
|
|
|
5157
5161
|
}, {
|
|
5158
5162
|
message: `Invalid query parameter 'limit': expected an integer between 0 and ${OBJECT_LIST_MAX_LIMIT}.`
|
|
5159
5163
|
}).transform(Number);
|
|
5160
|
-
var ObjectListOffsetSchema =
|
|
5164
|
+
var ObjectListOffsetSchema = z17.string().refine((value) => /^\d+$/.test(value) && Number.isSafeInteger(Number(value)), {
|
|
5161
5165
|
message: "Invalid query parameter 'offset': expected a non-negative safe integer."
|
|
5162
5166
|
}).transform(Number);
|
|
5163
|
-
var ObjectsQuerySchema =
|
|
5164
|
-
objectTypeId:
|
|
5165
|
-
idPrefix:
|
|
5166
|
-
idSuffix:
|
|
5167
|
+
var ObjectsQuerySchema = z17.object({
|
|
5168
|
+
objectTypeId: z17.string().optional(),
|
|
5169
|
+
idPrefix: z17.string().optional(),
|
|
5170
|
+
idSuffix: z17.string().optional(),
|
|
5167
5171
|
updatedAfter: objectListDateSchema("updatedAfter").optional(),
|
|
5168
5172
|
updatedBefore: objectListDateSchema("updatedBefore").optional(),
|
|
5169
5173
|
createdAfter: objectListDateSchema("createdAfter").optional(),
|
|
5170
5174
|
createdBefore: objectListDateSchema("createdBefore").optional(),
|
|
5171
5175
|
limit: ObjectListLimitSchema.optional(),
|
|
5172
5176
|
offset: ObjectListOffsetSchema.optional(),
|
|
5173
|
-
orderBy:
|
|
5177
|
+
orderBy: z17.enum(["createdAt", "updatedAt", "primaryId"], {
|
|
5174
5178
|
errorMap: () => ({
|
|
5175
5179
|
message: "Invalid query parameter 'orderBy': expected one of createdAt, updatedAt, or primaryId."
|
|
5176
5180
|
})
|
|
5177
5181
|
}).optional(),
|
|
5178
|
-
order:
|
|
5182
|
+
order: z17.enum(["asc", "desc"], {
|
|
5179
5183
|
errorMap: () => ({
|
|
5180
5184
|
message: "Invalid query parameter 'order': expected 'asc' or 'desc'."
|
|
5181
5185
|
})
|
|
@@ -5183,163 +5187,178 @@ var ObjectsQuerySchema = z16.object({
|
|
|
5183
5187
|
}).superRefine((query, context) => {
|
|
5184
5188
|
if (query.updatedAfter && query.updatedBefore && query.updatedAfter > query.updatedBefore) {
|
|
5185
5189
|
context.addIssue({
|
|
5186
|
-
code:
|
|
5190
|
+
code: z17.ZodIssueCode.custom,
|
|
5187
5191
|
path: ["updatedAfter"],
|
|
5188
5192
|
message: "Invalid query parameter range: 'updatedAfter' must be before or equal to 'updatedBefore'."
|
|
5189
5193
|
});
|
|
5190
5194
|
}
|
|
5191
5195
|
if (query.createdAfter && query.createdBefore && query.createdAfter > query.createdBefore) {
|
|
5192
5196
|
context.addIssue({
|
|
5193
|
-
code:
|
|
5197
|
+
code: z17.ZodIssueCode.custom,
|
|
5194
5198
|
path: ["createdAfter"],
|
|
5195
5199
|
message: "Invalid query parameter range: 'createdAfter' must be before or equal to 'createdBefore'."
|
|
5196
5200
|
});
|
|
5197
5201
|
}
|
|
5198
5202
|
});
|
|
5199
|
-
var UpsertObjectBodySchema =
|
|
5200
|
-
properties:
|
|
5203
|
+
var UpsertObjectBodySchema = z17.object({
|
|
5204
|
+
properties: z17.record(z17.unknown())
|
|
5201
5205
|
});
|
|
5202
|
-
var ObjectQueryPredicateSchema =
|
|
5203
|
-
|
|
5204
|
-
op:
|
|
5205
|
-
items:
|
|
5206
|
+
var ObjectQueryPredicateSchema = z17.lazy(() => z17.union([
|
|
5207
|
+
z17.object({
|
|
5208
|
+
op: z17.enum(["and", "or"]),
|
|
5209
|
+
items: z17.array(ObjectQueryPredicateSchema)
|
|
5206
5210
|
}).strict(),
|
|
5207
|
-
|
|
5208
|
-
op:
|
|
5211
|
+
z17.object({
|
|
5212
|
+
op: z17.literal("not"),
|
|
5209
5213
|
item: ObjectQueryPredicateSchema
|
|
5210
5214
|
}).strict(),
|
|
5211
|
-
|
|
5212
|
-
op:
|
|
5213
|
-
propertyId:
|
|
5215
|
+
z17.object({
|
|
5216
|
+
op: z17.enum(["eq", "neq", "lt", "lte", "gt", "gte"]),
|
|
5217
|
+
propertyId: z17.string().min(1),
|
|
5214
5218
|
value: JsonValueSchema
|
|
5215
5219
|
}).strict(),
|
|
5216
|
-
|
|
5217
|
-
op:
|
|
5218
|
-
propertyId:
|
|
5219
|
-
values:
|
|
5220
|
+
z17.object({
|
|
5221
|
+
op: z17.literal("in"),
|
|
5222
|
+
propertyId: z17.string().min(1),
|
|
5223
|
+
values: z17.array(JsonValueSchema)
|
|
5220
5224
|
}).strict(),
|
|
5221
|
-
|
|
5222
|
-
op:
|
|
5223
|
-
propertyId:
|
|
5224
|
-
value:
|
|
5225
|
+
z17.object({
|
|
5226
|
+
op: z17.literal("exists"),
|
|
5227
|
+
propertyId: z17.string().min(1),
|
|
5228
|
+
value: z17.boolean()
|
|
5225
5229
|
}).strict(),
|
|
5226
|
-
|
|
5227
|
-
op:
|
|
5228
|
-
propertyId:
|
|
5230
|
+
z17.object({
|
|
5231
|
+
op: z17.literal("contains"),
|
|
5232
|
+
propertyId: z17.string().min(1),
|
|
5229
5233
|
value: JsonValueSchema
|
|
5230
5234
|
}).strict()
|
|
5231
5235
|
]));
|
|
5232
|
-
var ObjectQuerySortFieldSchema =
|
|
5233
|
-
|
|
5234
|
-
kind:
|
|
5235
|
-
propertyId:
|
|
5236
|
-
direction:
|
|
5236
|
+
var ObjectQuerySortFieldSchema = z17.union([
|
|
5237
|
+
z17.object({
|
|
5238
|
+
kind: z17.literal("property"),
|
|
5239
|
+
propertyId: z17.string().min(1),
|
|
5240
|
+
direction: z17.enum(["asc", "desc"]).optional()
|
|
5237
5241
|
}).strict(),
|
|
5238
|
-
|
|
5239
|
-
kind:
|
|
5240
|
-
direction:
|
|
5242
|
+
z17.object({
|
|
5243
|
+
kind: z17.literal("relevance"),
|
|
5244
|
+
direction: z17.enum(["asc", "desc"]).optional()
|
|
5241
5245
|
}).strict()
|
|
5242
5246
|
]);
|
|
5243
|
-
var ObjectExpansionSchema =
|
|
5244
|
-
linkId:
|
|
5245
|
-
direction:
|
|
5246
|
-
sourceObjectTypeId:
|
|
5247
|
-
limit:
|
|
5248
|
-
orderBy:
|
|
5249
|
-
expand:
|
|
5247
|
+
var ObjectExpansionSchema = z17.lazy(() => z17.object({
|
|
5248
|
+
linkId: z17.string().min(1),
|
|
5249
|
+
direction: z17.enum(["outgoing", "incoming"]),
|
|
5250
|
+
sourceObjectTypeId: z17.string().min(1).optional(),
|
|
5251
|
+
limit: z17.number().int().nonnegative().optional(),
|
|
5252
|
+
orderBy: z17.array(ObjectQuerySortFieldSchema).optional(),
|
|
5253
|
+
expand: z17.array(ObjectExpansionSchema).optional()
|
|
5250
5254
|
}).strict());
|
|
5251
|
-
var ObjectQuerySchema =
|
|
5252
|
-
|
|
5253
|
-
kind:
|
|
5254
|
-
objectTypeId:
|
|
5255
|
-
includeSubtypes:
|
|
5255
|
+
var ObjectQuerySchema = z17.lazy(() => z17.discriminatedUnion("kind", [
|
|
5256
|
+
z17.object({
|
|
5257
|
+
kind: z17.literal("start"),
|
|
5258
|
+
objectTypeId: z17.string().min(1),
|
|
5259
|
+
includeSubtypes: z17.boolean().optional()
|
|
5256
5260
|
}).strict(),
|
|
5257
|
-
|
|
5258
|
-
kind:
|
|
5261
|
+
z17.object({
|
|
5262
|
+
kind: z17.literal("refs"),
|
|
5263
|
+
refs: z17.array(z17.object({
|
|
5264
|
+
objectTypeId: z17.string().min(1),
|
|
5265
|
+
primaryId: z17.string().min(1)
|
|
5266
|
+
}).strict())
|
|
5267
|
+
}).strict(),
|
|
5268
|
+
z17.object({
|
|
5269
|
+
kind: z17.literal("filter"),
|
|
5259
5270
|
input: ObjectQuerySchema,
|
|
5260
5271
|
predicate: ObjectQueryPredicateSchema
|
|
5261
5272
|
}).strict(),
|
|
5262
|
-
|
|
5263
|
-
kind:
|
|
5273
|
+
z17.object({
|
|
5274
|
+
kind: z17.literal("text"),
|
|
5264
5275
|
input: ObjectQuerySchema,
|
|
5265
|
-
query:
|
|
5266
|
-
fields:
|
|
5276
|
+
query: z17.string(),
|
|
5277
|
+
fields: z17.array(z17.string().min(1)).optional()
|
|
5267
5278
|
}).strict(),
|
|
5268
|
-
|
|
5269
|
-
kind:
|
|
5279
|
+
z17.object({
|
|
5280
|
+
kind: z17.literal("vector"),
|
|
5270
5281
|
input: ObjectQuerySchema,
|
|
5271
|
-
vector:
|
|
5272
|
-
propertyId:
|
|
5273
|
-
k:
|
|
5282
|
+
vector: z17.array(z17.number().finite()),
|
|
5283
|
+
propertyId: z17.string().min(1),
|
|
5284
|
+
k: z17.number().int().positive()
|
|
5274
5285
|
}).strict(),
|
|
5275
|
-
|
|
5276
|
-
kind:
|
|
5286
|
+
z17.object({
|
|
5287
|
+
kind: z17.literal("traverse"),
|
|
5277
5288
|
input: ObjectQuerySchema,
|
|
5278
|
-
linkId:
|
|
5279
|
-
direction:
|
|
5280
|
-
sourceObjectTypeId:
|
|
5289
|
+
linkId: z17.string().min(1),
|
|
5290
|
+
direction: z17.enum(["outgoing", "incoming"]),
|
|
5291
|
+
sourceObjectTypeId: z17.string().min(1).optional()
|
|
5281
5292
|
}).strict(),
|
|
5282
|
-
|
|
5283
|
-
kind:
|
|
5284
|
-
op:
|
|
5285
|
-
inputs:
|
|
5293
|
+
z17.object({
|
|
5294
|
+
kind: z17.literal("set"),
|
|
5295
|
+
op: z17.enum(["union", "intersect", "subtract"]),
|
|
5296
|
+
inputs: z17.array(ObjectQuerySchema)
|
|
5286
5297
|
}).strict(),
|
|
5287
|
-
|
|
5288
|
-
kind:
|
|
5298
|
+
z17.object({
|
|
5299
|
+
kind: z17.literal("sort"),
|
|
5289
5300
|
input: ObjectQuerySchema,
|
|
5290
|
-
fields:
|
|
5301
|
+
fields: z17.array(ObjectQuerySortFieldSchema)
|
|
5291
5302
|
}).strict(),
|
|
5292
|
-
|
|
5293
|
-
kind:
|
|
5303
|
+
z17.object({
|
|
5304
|
+
kind: z17.literal("limit"),
|
|
5294
5305
|
input: ObjectQuerySchema,
|
|
5295
|
-
limit:
|
|
5306
|
+
limit: z17.number().int().nonnegative()
|
|
5296
5307
|
}).strict(),
|
|
5297
|
-
|
|
5298
|
-
kind:
|
|
5308
|
+
z17.object({
|
|
5309
|
+
kind: z17.literal("page"),
|
|
5299
5310
|
input: ObjectQuerySchema,
|
|
5300
|
-
pageSize:
|
|
5301
|
-
pageToken:
|
|
5311
|
+
pageSize: z17.number().int().positive(),
|
|
5312
|
+
pageToken: z17.string().optional()
|
|
5302
5313
|
}).strict(),
|
|
5303
|
-
|
|
5304
|
-
kind:
|
|
5314
|
+
z17.object({
|
|
5315
|
+
kind: z17.literal("project"),
|
|
5305
5316
|
input: ObjectQuerySchema,
|
|
5306
|
-
properties:
|
|
5317
|
+
properties: z17.array(z17.string().min(1)).optional()
|
|
5307
5318
|
}).strict(),
|
|
5308
|
-
|
|
5309
|
-
kind:
|
|
5319
|
+
z17.object({
|
|
5320
|
+
kind: z17.literal("expand"),
|
|
5310
5321
|
input: ObjectQuerySchema,
|
|
5311
|
-
expansions:
|
|
5322
|
+
expansions: z17.array(ObjectExpansionSchema)
|
|
5312
5323
|
}).strict()
|
|
5313
5324
|
]));
|
|
5314
|
-
var ObjectQueryRequestSchema =
|
|
5325
|
+
var ObjectQueryRequestSchema = z17.object({
|
|
5315
5326
|
query: ObjectQuerySchema,
|
|
5316
|
-
includeTotal:
|
|
5327
|
+
includeTotal: z17.boolean().optional()
|
|
5317
5328
|
}).strict();
|
|
5318
|
-
var ObjectQueryCountRequestSchema =
|
|
5329
|
+
var ObjectQueryCountRequestSchema = z17.object({
|
|
5319
5330
|
query: ObjectQuerySchema
|
|
5320
5331
|
}).strict();
|
|
5321
|
-
var ObjectQueryExistsRequestSchema =
|
|
5332
|
+
var ObjectQueryExistsRequestSchema = z17.object({
|
|
5322
5333
|
query: ObjectQuerySchema
|
|
5323
5334
|
}).strict();
|
|
5324
|
-
var ObjectQueryFacetRequestSchema =
|
|
5325
|
-
propertyId:
|
|
5326
|
-
limit:
|
|
5335
|
+
var ObjectQueryFacetRequestSchema = z17.object({
|
|
5336
|
+
propertyId: z17.string().min(1),
|
|
5337
|
+
limit: z17.number().int().positive()
|
|
5338
|
+
}).strict();
|
|
5339
|
+
var ObjectQueryFacetsRequestSchema = z17.object({
|
|
5340
|
+
query: ObjectQuerySchema,
|
|
5341
|
+
facets: z17.array(ObjectQueryFacetRequestSchema).min(1)
|
|
5327
5342
|
}).strict();
|
|
5328
|
-
var
|
|
5343
|
+
var ObjectQueryLinksRequestSchema = z17.object({
|
|
5329
5344
|
query: ObjectQuerySchema,
|
|
5330
|
-
|
|
5345
|
+
direction: z17.enum(["outgoing", "incoming", "both"]).default("both"),
|
|
5346
|
+
linkId: z17.string().min(1).optional(),
|
|
5347
|
+
includeObjects: z17.boolean().default(false),
|
|
5348
|
+
pageSize: z17.number().int().positive().max(1000).default(100),
|
|
5349
|
+
pageToken: z17.string().min(1).optional()
|
|
5331
5350
|
}).strict();
|
|
5332
|
-
var TwinObjectSchema =
|
|
5333
|
-
primaryId:
|
|
5334
|
-
objectTypeId:
|
|
5335
|
-
properties:
|
|
5336
|
-
createdAt:
|
|
5337
|
-
updatedAt:
|
|
5338
|
-
});
|
|
5339
|
-
var ObjectListResponseSchema =
|
|
5340
|
-
objects:
|
|
5341
|
-
hasMore:
|
|
5342
|
-
total:
|
|
5351
|
+
var TwinObjectSchema = z17.object({
|
|
5352
|
+
primaryId: z17.string(),
|
|
5353
|
+
objectTypeId: z17.string(),
|
|
5354
|
+
properties: z17.record(z17.unknown()),
|
|
5355
|
+
createdAt: z17.string(),
|
|
5356
|
+
updatedAt: z17.string()
|
|
5357
|
+
});
|
|
5358
|
+
var ObjectListResponseSchema = z17.object({
|
|
5359
|
+
objects: z17.array(TwinObjectSchema),
|
|
5360
|
+
hasMore: z17.boolean(),
|
|
5361
|
+
total: z17.number()
|
|
5343
5362
|
});
|
|
5344
5363
|
var anyJsonValueSchema = {};
|
|
5345
5364
|
var stringArraySchema = { type: "array", items: { type: "string", minLength: 1 } };
|
|
@@ -5347,6 +5366,7 @@ var objectQueryRef = { $ref: "#/components/schemas/ObjectQuery" };
|
|
|
5347
5366
|
var objectQueryPredicateRef = { $ref: "#/components/schemas/ObjectQueryPredicate" };
|
|
5348
5367
|
var objectQuerySortFieldRef = { $ref: "#/components/schemas/ObjectQuerySortField" };
|
|
5349
5368
|
var objectExpansionRef = { $ref: "#/components/schemas/ObjectExpansion" };
|
|
5369
|
+
var objectRefSchemaRef = { $ref: "#/components/schemas/ObjectRef" };
|
|
5350
5370
|
var ObjectQueryOpenApiSchemas = {
|
|
5351
5371
|
ErrorResponse: {
|
|
5352
5372
|
type: "object",
|
|
@@ -5485,6 +5505,38 @@ var ObjectQueryOpenApiSchemas = {
|
|
|
5485
5505
|
plan: { $ref: "#/components/schemas/ObjectQueryPlanSummary" }
|
|
5486
5506
|
}
|
|
5487
5507
|
},
|
|
5508
|
+
ObjectQueryLink: {
|
|
5509
|
+
type: "object",
|
|
5510
|
+
required: ["source", "linkId", "target", "createdAt", "updatedAt"],
|
|
5511
|
+
additionalProperties: false,
|
|
5512
|
+
properties: {
|
|
5513
|
+
source: objectRefSchemaRef,
|
|
5514
|
+
linkId: { type: "string" },
|
|
5515
|
+
target: objectRefSchemaRef,
|
|
5516
|
+
properties: { type: "object", additionalProperties: true },
|
|
5517
|
+
createdAt: { type: "string" },
|
|
5518
|
+
updatedAt: { type: "string" }
|
|
5519
|
+
}
|
|
5520
|
+
},
|
|
5521
|
+
ObjectQueryLinksResponse: {
|
|
5522
|
+
type: "object",
|
|
5523
|
+
required: ["objects", "links", "hasMore"],
|
|
5524
|
+
additionalProperties: false,
|
|
5525
|
+
properties: {
|
|
5526
|
+
objects: {
|
|
5527
|
+
type: "array",
|
|
5528
|
+
description: "Selected objects followed by visible endpoint objects from this link page, de-duplicated. Empty unless includeObjects is true.",
|
|
5529
|
+
items: { $ref: "#/components/schemas/ObjectQueryObject" }
|
|
5530
|
+
},
|
|
5531
|
+
links: {
|
|
5532
|
+
type: "array",
|
|
5533
|
+
description: "Visible physical links in deterministic identity order.",
|
|
5534
|
+
items: { $ref: "#/components/schemas/ObjectQueryLink" }
|
|
5535
|
+
},
|
|
5536
|
+
hasMore: { type: "boolean" },
|
|
5537
|
+
nextPageToken: { type: "string" }
|
|
5538
|
+
}
|
|
5539
|
+
},
|
|
5488
5540
|
ObjectQueryErrorResponse: {
|
|
5489
5541
|
type: "object",
|
|
5490
5542
|
required: ["error"],
|
|
@@ -5544,6 +5596,36 @@ var ObjectQueryOpenApiSchemas = {
|
|
|
5544
5596
|
}
|
|
5545
5597
|
}
|
|
5546
5598
|
},
|
|
5599
|
+
ObjectQueryLinksRequest: {
|
|
5600
|
+
type: "object",
|
|
5601
|
+
required: ["query"],
|
|
5602
|
+
additionalProperties: false,
|
|
5603
|
+
properties: {
|
|
5604
|
+
query: objectQueryRef,
|
|
5605
|
+
direction: { type: "string", enum: ["outgoing", "incoming", "both"], default: "both" },
|
|
5606
|
+
linkId: { type: "string", minLength: 1 },
|
|
5607
|
+
includeObjects: {
|
|
5608
|
+
type: "boolean",
|
|
5609
|
+
default: false,
|
|
5610
|
+
description: "Include selected objects and visible endpoints from the current link page."
|
|
5611
|
+
},
|
|
5612
|
+
pageSize: { type: "integer", minimum: 1, maximum: 1000, default: 100 },
|
|
5613
|
+
pageToken: {
|
|
5614
|
+
type: "string",
|
|
5615
|
+
minLength: 1,
|
|
5616
|
+
description: "Opaque token from the previous page. The project, normalized query, direction, and linkId must remain unchanged."
|
|
5617
|
+
}
|
|
5618
|
+
}
|
|
5619
|
+
},
|
|
5620
|
+
ObjectRef: {
|
|
5621
|
+
type: "object",
|
|
5622
|
+
required: ["objectTypeId", "primaryId"],
|
|
5623
|
+
additionalProperties: false,
|
|
5624
|
+
properties: {
|
|
5625
|
+
objectTypeId: { type: "string", minLength: 1 },
|
|
5626
|
+
primaryId: { type: "string", minLength: 1 }
|
|
5627
|
+
}
|
|
5628
|
+
},
|
|
5547
5629
|
ObjectQuery: {
|
|
5548
5630
|
oneOf: [
|
|
5549
5631
|
{
|
|
@@ -5556,6 +5638,20 @@ var ObjectQueryOpenApiSchemas = {
|
|
|
5556
5638
|
includeSubtypes: { type: "boolean" }
|
|
5557
5639
|
}
|
|
5558
5640
|
},
|
|
5641
|
+
{
|
|
5642
|
+
type: "object",
|
|
5643
|
+
required: ["kind", "refs"],
|
|
5644
|
+
additionalProperties: false,
|
|
5645
|
+
properties: {
|
|
5646
|
+
kind: { type: "string", enum: ["refs"] },
|
|
5647
|
+
refs: {
|
|
5648
|
+
type: "array",
|
|
5649
|
+
minItems: 1,
|
|
5650
|
+
description: "One to 1,000 unique identities after normalization; duplicate entries are accepted and removed.",
|
|
5651
|
+
items: objectRefSchemaRef
|
|
5652
|
+
}
|
|
5653
|
+
}
|
|
5654
|
+
},
|
|
5559
5655
|
{
|
|
5560
5656
|
type: "object",
|
|
5561
5657
|
required: ["kind", "input", "predicate"],
|
|
@@ -5769,7 +5865,7 @@ var ObjectQueryOpenApiSchemas = {
|
|
|
5769
5865
|
|
|
5770
5866
|
// src/routes/objects.ts
|
|
5771
5867
|
var ObjectFileContentQuerySchema = FileContentQuerySchema.extend({
|
|
5772
|
-
path:
|
|
5868
|
+
path: z18.string().min(1).regex(/^\/properties(?:\/|$)/, "Object file content paths must start with /properties/")
|
|
5773
5869
|
});
|
|
5774
5870
|
function serializeObject(row) {
|
|
5775
5871
|
return {
|
|
@@ -5780,6 +5876,22 @@ function serializeObject(row) {
|
|
|
5780
5876
|
updatedAt: toIsoString(row.updatedAt)
|
|
5781
5877
|
};
|
|
5782
5878
|
}
|
|
5879
|
+
function serializeObjectLink(link) {
|
|
5880
|
+
return {
|
|
5881
|
+
source: {
|
|
5882
|
+
objectTypeId: link.sourceTypeId,
|
|
5883
|
+
primaryId: link.sourceId
|
|
5884
|
+
},
|
|
5885
|
+
linkId: link.linkId,
|
|
5886
|
+
target: {
|
|
5887
|
+
objectTypeId: link.targetTypeId,
|
|
5888
|
+
primaryId: link.targetId
|
|
5889
|
+
},
|
|
5890
|
+
...link.properties === undefined ? {} : { properties: link.properties },
|
|
5891
|
+
createdAt: toIsoString(link.createdAt),
|
|
5892
|
+
updatedAt: toIsoString(link.updatedAt)
|
|
5893
|
+
};
|
|
5894
|
+
}
|
|
5783
5895
|
function serializeExpandedObject(row) {
|
|
5784
5896
|
const serialized = serializeObject(row);
|
|
5785
5897
|
if (row.links)
|
|
@@ -6066,6 +6178,69 @@ function registerObjectRoutes(app, host) {
|
|
|
6066
6178
|
}
|
|
6067
6179
|
}
|
|
6068
6180
|
}
|
|
6181
|
+
}).post("/api/objects/query/links", async (context) => {
|
|
6182
|
+
const { body, set } = context;
|
|
6183
|
+
try {
|
|
6184
|
+
const parsed = ObjectQueryLinksRequestSchema.parse(body);
|
|
6185
|
+
const result = await requireRequestSixb(context).objects.queryLinks(parsed);
|
|
6186
|
+
return {
|
|
6187
|
+
objects: result.objects.map(serializeObject),
|
|
6188
|
+
links: result.links.map(serializeObjectLink),
|
|
6189
|
+
hasMore: result.hasMore,
|
|
6190
|
+
...result.nextPageToken === undefined ? {} : { nextPageToken: result.nextPageToken }
|
|
6191
|
+
};
|
|
6192
|
+
} catch (error) {
|
|
6193
|
+
return handleObjectQueryError(error, set);
|
|
6194
|
+
}
|
|
6195
|
+
}, {
|
|
6196
|
+
detail: {
|
|
6197
|
+
summary: "Query object links",
|
|
6198
|
+
tags: [OPENAPI_TAGS.links.name],
|
|
6199
|
+
operationId: "queryObjectLinks",
|
|
6200
|
+
security: bearerSecurityRequirement("queryObjectLinks"),
|
|
6201
|
+
requestBody: {
|
|
6202
|
+
required: true,
|
|
6203
|
+
content: {
|
|
6204
|
+
"application/json": {
|
|
6205
|
+
schema: { $ref: "#/components/schemas/ObjectQueryLinksRequest" }
|
|
6206
|
+
}
|
|
6207
|
+
}
|
|
6208
|
+
},
|
|
6209
|
+
responses: {
|
|
6210
|
+
200: {
|
|
6211
|
+
description: "Response for status 200",
|
|
6212
|
+
content: {
|
|
6213
|
+
"application/json": {
|
|
6214
|
+
schema: { $ref: "#/components/schemas/ObjectQueryLinksResponse" }
|
|
6215
|
+
}
|
|
6216
|
+
}
|
|
6217
|
+
},
|
|
6218
|
+
400: {
|
|
6219
|
+
description: "Response for status 400",
|
|
6220
|
+
content: {
|
|
6221
|
+
"application/json": {
|
|
6222
|
+
schema: { $ref: "#/components/schemas/ObjectQueryErrorResponse" }
|
|
6223
|
+
}
|
|
6224
|
+
}
|
|
6225
|
+
},
|
|
6226
|
+
403: {
|
|
6227
|
+
description: "Response for status 403",
|
|
6228
|
+
content: {
|
|
6229
|
+
"application/json": {
|
|
6230
|
+
schema: { $ref: "#/components/schemas/ErrorResponse" }
|
|
6231
|
+
}
|
|
6232
|
+
}
|
|
6233
|
+
},
|
|
6234
|
+
500: {
|
|
6235
|
+
description: "Response for status 500",
|
|
6236
|
+
content: {
|
|
6237
|
+
"application/json": {
|
|
6238
|
+
schema: { $ref: "#/components/schemas/ErrorResponse" }
|
|
6239
|
+
}
|
|
6240
|
+
}
|
|
6241
|
+
}
|
|
6242
|
+
}
|
|
6243
|
+
}
|
|
6069
6244
|
}).post("/api/objects/query/count", async (context) => {
|
|
6070
6245
|
const { body, set } = context;
|
|
6071
6246
|
try {
|
|
@@ -6426,111 +6601,111 @@ function registerOntologyRoutes(app, _host) {
|
|
|
6426
6601
|
import {
|
|
6427
6602
|
PIPELINE_RUN_FAILURE_CODES
|
|
6428
6603
|
} from "@sixb/core/storage";
|
|
6429
|
-
import { z as
|
|
6604
|
+
import { z as z19 } from "zod";
|
|
6430
6605
|
var PipelineRunFailureSchema = sixbFailureSchema(PIPELINE_RUN_FAILURE_CODES);
|
|
6431
|
-
var PipelineParamsSchema =
|
|
6432
|
-
pipelineId:
|
|
6606
|
+
var PipelineParamsSchema = z19.object({
|
|
6607
|
+
pipelineId: z19.string().min(1)
|
|
6433
6608
|
});
|
|
6434
|
-
var PipelineRunParamsSchema =
|
|
6435
|
-
runId:
|
|
6609
|
+
var PipelineRunParamsSchema = z19.object({
|
|
6610
|
+
runId: z19.string().min(1)
|
|
6436
6611
|
});
|
|
6437
|
-
var PipelineRunStatusSchema =
|
|
6612
|
+
var PipelineRunStatusSchema = z19.enum([
|
|
6438
6613
|
"queued",
|
|
6439
6614
|
"running",
|
|
6440
6615
|
"succeeded",
|
|
6441
6616
|
"failed",
|
|
6442
6617
|
"cancelled"
|
|
6443
6618
|
]);
|
|
6444
|
-
var PipelineStepRunStatusSchema =
|
|
6445
|
-
var PipelineRunsQuerySchema =
|
|
6446
|
-
pipelineId:
|
|
6619
|
+
var PipelineStepRunStatusSchema = z19.enum(["running", "succeeded", "failed", "cancelled"]);
|
|
6620
|
+
var PipelineRunsQuerySchema = z19.object({
|
|
6621
|
+
pipelineId: z19.string().optional(),
|
|
6447
6622
|
status: PipelineRunStatusSchema.optional(),
|
|
6448
|
-
startedAfter:
|
|
6449
|
-
startedBefore:
|
|
6450
|
-
limit:
|
|
6451
|
-
offset:
|
|
6452
|
-
order:
|
|
6453
|
-
});
|
|
6454
|
-
var DatasetVersionRefSchema2 =
|
|
6455
|
-
datasetId:
|
|
6456
|
-
versionId:
|
|
6457
|
-
});
|
|
6458
|
-
var PipelineTriggerSchema =
|
|
6459
|
-
type:
|
|
6460
|
-
scheduleId:
|
|
6461
|
-
});
|
|
6462
|
-
var PipelineStepExecutorSchema =
|
|
6463
|
-
|
|
6464
|
-
kind:
|
|
6465
|
-
dialect:
|
|
6623
|
+
startedAfter: z19.string().optional(),
|
|
6624
|
+
startedBefore: z19.string().optional(),
|
|
6625
|
+
limit: z19.string().optional(),
|
|
6626
|
+
offset: z19.string().optional(),
|
|
6627
|
+
order: z19.enum(["asc", "desc"]).optional()
|
|
6628
|
+
});
|
|
6629
|
+
var DatasetVersionRefSchema2 = z19.object({
|
|
6630
|
+
datasetId: z19.string(),
|
|
6631
|
+
versionId: z19.string()
|
|
6632
|
+
});
|
|
6633
|
+
var PipelineTriggerSchema = z19.object({
|
|
6634
|
+
type: z19.literal("schedule"),
|
|
6635
|
+
scheduleId: z19.string()
|
|
6636
|
+
});
|
|
6637
|
+
var PipelineStepExecutorSchema = z19.union([
|
|
6638
|
+
z19.object({
|
|
6639
|
+
kind: z19.literal("sql"),
|
|
6640
|
+
dialect: z19.literal("duckdb")
|
|
6466
6641
|
}),
|
|
6467
|
-
|
|
6468
|
-
kind:
|
|
6642
|
+
z19.object({
|
|
6643
|
+
kind: z19.literal("run")
|
|
6469
6644
|
})
|
|
6470
6645
|
]);
|
|
6471
|
-
var PipelineRunSchema =
|
|
6472
|
-
id:
|
|
6473
|
-
projectId:
|
|
6474
|
-
pipelineId:
|
|
6646
|
+
var PipelineRunSchema = z19.object({
|
|
6647
|
+
id: z19.string(),
|
|
6648
|
+
projectId: z19.string(),
|
|
6649
|
+
pipelineId: z19.string(),
|
|
6475
6650
|
status: PipelineRunStatusSchema,
|
|
6476
|
-
queuedAt:
|
|
6477
|
-
startedAt:
|
|
6478
|
-
finishedAt:
|
|
6651
|
+
queuedAt: z19.string(),
|
|
6652
|
+
startedAt: z19.string().optional(),
|
|
6653
|
+
finishedAt: z19.string().optional(),
|
|
6479
6654
|
output: DatasetVersionRefSchema2.optional(),
|
|
6480
6655
|
error: PipelineRunFailureSchema.optional()
|
|
6481
6656
|
});
|
|
6482
|
-
var PipelineStepRunSchema =
|
|
6483
|
-
id:
|
|
6484
|
-
projectId:
|
|
6485
|
-
pipelineRunId:
|
|
6486
|
-
pipelineId:
|
|
6487
|
-
stepId:
|
|
6488
|
-
datasetId:
|
|
6489
|
-
mode:
|
|
6657
|
+
var PipelineStepRunSchema = z19.object({
|
|
6658
|
+
id: z19.string(),
|
|
6659
|
+
projectId: z19.string(),
|
|
6660
|
+
pipelineRunId: z19.string(),
|
|
6661
|
+
pipelineId: z19.string(),
|
|
6662
|
+
stepId: z19.string(),
|
|
6663
|
+
datasetId: z19.string(),
|
|
6664
|
+
mode: z19.enum(["snapshot", "append"]),
|
|
6490
6665
|
status: PipelineStepRunStatusSchema,
|
|
6491
|
-
startedAt:
|
|
6492
|
-
finishedAt:
|
|
6493
|
-
inputs:
|
|
6666
|
+
startedAt: z19.string(),
|
|
6667
|
+
finishedAt: z19.string().optional(),
|
|
6668
|
+
inputs: z19.array(DatasetVersionRefSchema2),
|
|
6494
6669
|
output: DatasetVersionRefSchema2.optional(),
|
|
6495
|
-
rowsWritten:
|
|
6670
|
+
rowsWritten: z19.number().optional(),
|
|
6496
6671
|
error: PipelineRunFailureSchema.optional()
|
|
6497
6672
|
});
|
|
6498
|
-
var PipelineStepSchema =
|
|
6499
|
-
id:
|
|
6500
|
-
mode:
|
|
6673
|
+
var PipelineStepSchema = z19.object({
|
|
6674
|
+
id: z19.string(),
|
|
6675
|
+
mode: z19.enum(["snapshot", "append"]),
|
|
6501
6676
|
executor: PipelineStepExecutorSchema,
|
|
6502
|
-
inputs:
|
|
6503
|
-
name:
|
|
6677
|
+
inputs: z19.array(z19.object({
|
|
6678
|
+
name: z19.string(),
|
|
6504
6679
|
dataset: DatasetDefinitionSchema
|
|
6505
6680
|
})),
|
|
6506
6681
|
output: DatasetDefinitionSchema
|
|
6507
6682
|
});
|
|
6508
|
-
var PipelineSchema =
|
|
6509
|
-
id:
|
|
6510
|
-
triggers:
|
|
6511
|
-
graph:
|
|
6512
|
-
kind:
|
|
6513
|
-
nodes:
|
|
6514
|
-
kind:
|
|
6683
|
+
var PipelineSchema = z19.object({
|
|
6684
|
+
id: z19.string(),
|
|
6685
|
+
triggers: z19.array(PipelineTriggerSchema),
|
|
6686
|
+
graph: z19.object({
|
|
6687
|
+
kind: z19.literal("sequence"),
|
|
6688
|
+
nodes: z19.array(z19.object({
|
|
6689
|
+
kind: z19.literal("step"),
|
|
6515
6690
|
step: PipelineStepSchema
|
|
6516
6691
|
}))
|
|
6517
6692
|
}),
|
|
6518
6693
|
latestRun: PipelineRunSchema.nullable()
|
|
6519
6694
|
});
|
|
6520
|
-
var PipelineRunListResponseSchema =
|
|
6521
|
-
runs:
|
|
6522
|
-
hasMore:
|
|
6523
|
-
total:
|
|
6695
|
+
var PipelineRunListResponseSchema = z19.object({
|
|
6696
|
+
runs: z19.array(PipelineRunSchema),
|
|
6697
|
+
hasMore: z19.boolean(),
|
|
6698
|
+
total: z19.number()
|
|
6524
6699
|
});
|
|
6525
|
-
var PipelineRunDetailResponseSchema =
|
|
6700
|
+
var PipelineRunDetailResponseSchema = z19.object({
|
|
6526
6701
|
run: PipelineRunSchema,
|
|
6527
|
-
steps:
|
|
6702
|
+
steps: z19.array(PipelineStepRunSchema)
|
|
6528
6703
|
});
|
|
6529
|
-
var RequestPipelineRunResponseSchema =
|
|
6530
|
-
runId:
|
|
6531
|
-
jobId:
|
|
6532
|
-
pipelineId:
|
|
6533
|
-
queuedAt:
|
|
6704
|
+
var RequestPipelineRunResponseSchema = z19.object({
|
|
6705
|
+
runId: z19.string(),
|
|
6706
|
+
jobId: z19.string(),
|
|
6707
|
+
pipelineId: z19.string(),
|
|
6708
|
+
queuedAt: z19.string()
|
|
6534
6709
|
});
|
|
6535
6710
|
|
|
6536
6711
|
// src/routes/pipelines.ts
|
|
@@ -6752,9 +6927,9 @@ function registerPipelineRoutes(app, host) {
|
|
|
6752
6927
|
}
|
|
6753
6928
|
|
|
6754
6929
|
// src/schemas/project.ts
|
|
6755
|
-
import { z as
|
|
6756
|
-
var ProjectInfoResponseSchema =
|
|
6757
|
-
id:
|
|
6930
|
+
import { z as z20 } from "zod";
|
|
6931
|
+
var ProjectInfoResponseSchema = z20.object({
|
|
6932
|
+
id: z20.string()
|
|
6758
6933
|
});
|
|
6759
6934
|
|
|
6760
6935
|
// src/routes/project.ts
|
|
@@ -6772,146 +6947,147 @@ function registerProjectRoutes(app, host) {
|
|
|
6772
6947
|
|
|
6773
6948
|
// src/schemas/projections.ts
|
|
6774
6949
|
import { PROJECTION_RUN_FAILURE_CODES } from "@sixb/core/storage";
|
|
6775
|
-
import { z as
|
|
6950
|
+
import { z as z21 } from "zod";
|
|
6776
6951
|
var ProjectionRunFailureSchema = sixbFailureSchema(PROJECTION_RUN_FAILURE_CODES);
|
|
6777
|
-
var ProjectionKindSchema =
|
|
6778
|
-
var ProjectionRunStatusSchema =
|
|
6952
|
+
var ProjectionKindSchema = z21.enum(["object", "link", "telemetry"]);
|
|
6953
|
+
var ProjectionRunStatusSchema = z21.enum([
|
|
6779
6954
|
"queued",
|
|
6780
6955
|
"running",
|
|
6781
6956
|
"succeeded",
|
|
6782
6957
|
"failed",
|
|
6783
6958
|
"cancelled"
|
|
6784
6959
|
]);
|
|
6785
|
-
var ProjectionRunIdentityBaseSchema =
|
|
6786
|
-
projectionId:
|
|
6787
|
-
datasetVersion:
|
|
6788
|
-
datasetId:
|
|
6789
|
-
versionId:
|
|
6790
|
-
createdAt:
|
|
6960
|
+
var ProjectionRunIdentityBaseSchema = z21.object({
|
|
6961
|
+
projectionId: z21.string(),
|
|
6962
|
+
datasetVersion: z21.object({
|
|
6963
|
+
datasetId: z21.string(),
|
|
6964
|
+
versionId: z21.string(),
|
|
6965
|
+
createdAt: z21.string()
|
|
6791
6966
|
}),
|
|
6792
|
-
ontologyRevision:
|
|
6793
|
-
projectionRevision:
|
|
6794
|
-
ownershipHash:
|
|
6795
|
-
});
|
|
6796
|
-
var ProjectionRunBaseSchema =
|
|
6797
|
-
id:
|
|
6798
|
-
projectId:
|
|
6799
|
-
executionId:
|
|
6967
|
+
ontologyRevision: z21.string(),
|
|
6968
|
+
projectionRevision: z21.string(),
|
|
6969
|
+
ownershipHash: z21.string()
|
|
6970
|
+
});
|
|
6971
|
+
var ProjectionRunBaseSchema = z21.object({
|
|
6972
|
+
id: z21.string(),
|
|
6973
|
+
projectId: z21.string(),
|
|
6974
|
+
executionId: z21.string(),
|
|
6800
6975
|
status: ProjectionRunStatusSchema,
|
|
6801
|
-
attempt:
|
|
6802
|
-
progress:
|
|
6803
|
-
sourceRowsRead:
|
|
6804
|
-
sourceRowsSkipped:
|
|
6976
|
+
attempt: z21.number(),
|
|
6977
|
+
progress: z21.object({
|
|
6978
|
+
sourceRowsRead: z21.number(),
|
|
6979
|
+
sourceRowsSkipped: z21.number()
|
|
6805
6980
|
}),
|
|
6806
|
-
queuedAt:
|
|
6807
|
-
startedAt:
|
|
6808
|
-
finishedAt:
|
|
6981
|
+
queuedAt: z21.string(),
|
|
6982
|
+
startedAt: z21.string().optional(),
|
|
6983
|
+
finishedAt: z21.string().optional(),
|
|
6809
6984
|
error: ProjectionRunFailureSchema.optional()
|
|
6810
6985
|
});
|
|
6811
6986
|
var ObjectProjectionRunSchema = ProjectionRunBaseSchema.extend({
|
|
6812
6987
|
identity: ProjectionRunIdentityBaseSchema.extend({
|
|
6813
|
-
projectionKind:
|
|
6814
|
-
protocol:
|
|
6988
|
+
projectionKind: z21.literal("object"),
|
|
6989
|
+
protocol: z21.literal("replacement")
|
|
6815
6990
|
}),
|
|
6816
|
-
target:
|
|
6991
|
+
target: z21.object({ objectTypeId: z21.string() })
|
|
6817
6992
|
});
|
|
6818
6993
|
var LinkProjectionRunSchema = ProjectionRunBaseSchema.extend({
|
|
6819
6994
|
identity: ProjectionRunIdentityBaseSchema.extend({
|
|
6820
|
-
projectionKind:
|
|
6821
|
-
protocol:
|
|
6995
|
+
projectionKind: z21.literal("link"),
|
|
6996
|
+
protocol: z21.literal("replacement")
|
|
6822
6997
|
}),
|
|
6823
|
-
target:
|
|
6824
|
-
sourceObjectTypeId:
|
|
6825
|
-
targetObjectTypeId:
|
|
6998
|
+
target: z21.object({
|
|
6999
|
+
sourceObjectTypeId: z21.string(),
|
|
7000
|
+
targetObjectTypeId: z21.string()
|
|
6826
7001
|
})
|
|
6827
7002
|
});
|
|
6828
7003
|
var TelemetryProjectionRunSchema = ProjectionRunBaseSchema.extend({
|
|
6829
7004
|
identity: ProjectionRunIdentityBaseSchema.extend({
|
|
6830
|
-
projectionKind:
|
|
6831
|
-
protocol:
|
|
7005
|
+
projectionKind: z21.literal("telemetry"),
|
|
7006
|
+
protocol: z21.literal("telemetry")
|
|
6832
7007
|
}),
|
|
6833
|
-
target:
|
|
7008
|
+
target: z21.object({ objectTypeId: z21.string() })
|
|
6834
7009
|
});
|
|
6835
|
-
var ProjectionRunSchema =
|
|
7010
|
+
var ProjectionRunSchema = z21.union([
|
|
6836
7011
|
ObjectProjectionRunSchema,
|
|
6837
7012
|
LinkProjectionRunSchema,
|
|
6838
7013
|
TelemetryProjectionRunSchema
|
|
6839
7014
|
]);
|
|
6840
|
-
var ForeignKeyDescriptorSchema =
|
|
6841
|
-
linkId:
|
|
6842
|
-
sourcePropertyId:
|
|
6843
|
-
sourceField:
|
|
6844
|
-
targetObjectTypeId:
|
|
6845
|
-
});
|
|
6846
|
-
var SourceEditConflictResolutionSchema =
|
|
6847
|
-
|
|
6848
|
-
|
|
7015
|
+
var ForeignKeyDescriptorSchema = z21.object({
|
|
7016
|
+
linkId: z21.string(),
|
|
7017
|
+
sourcePropertyId: z21.string().optional(),
|
|
7018
|
+
sourceField: z21.string().optional(),
|
|
7019
|
+
targetObjectTypeId: z21.string()
|
|
7020
|
+
});
|
|
7021
|
+
var SourceEditConflictResolutionSchema = z21.union([
|
|
7022
|
+
z21.object({ strategy: z21.literal("editsWin") }),
|
|
7023
|
+
z21.object({ strategy: z21.literal("mostRecent"), sourceTimestamp: z21.string() })
|
|
6849
7024
|
]);
|
|
6850
|
-
var ObjectProjectionSchema =
|
|
6851
|
-
_tag:
|
|
6852
|
-
id:
|
|
6853
|
-
objectTypeId:
|
|
6854
|
-
datasetId:
|
|
6855
|
-
properties:
|
|
6856
|
-
links:
|
|
7025
|
+
var ObjectProjectionSchema = z21.object({
|
|
7026
|
+
_tag: z21.literal("ObjectProjectionDefinition"),
|
|
7027
|
+
id: z21.string(),
|
|
7028
|
+
objectTypeId: z21.string(),
|
|
7029
|
+
datasetId: z21.string(),
|
|
7030
|
+
properties: z21.record(z21.string()),
|
|
7031
|
+
links: z21.record(ForeignKeyDescriptorSchema),
|
|
6857
7032
|
conflictResolution: SourceEditConflictResolutionSchema,
|
|
6858
7033
|
latestRun: ProjectionRunSchema.nullable()
|
|
6859
7034
|
});
|
|
6860
|
-
var LinkProjectionSchema =
|
|
6861
|
-
_tag:
|
|
6862
|
-
id:
|
|
6863
|
-
linkId:
|
|
6864
|
-
sourceObjectTypeId:
|
|
6865
|
-
targetObjectTypeId:
|
|
6866
|
-
datasetId:
|
|
6867
|
-
sourceField:
|
|
6868
|
-
targetField:
|
|
7035
|
+
var LinkProjectionSchema = z21.object({
|
|
7036
|
+
_tag: z21.literal("LinkProjectionDefinition"),
|
|
7037
|
+
id: z21.string(),
|
|
7038
|
+
linkId: z21.string(),
|
|
7039
|
+
sourceObjectTypeId: z21.string(),
|
|
7040
|
+
targetObjectTypeId: z21.string(),
|
|
7041
|
+
datasetId: z21.string(),
|
|
7042
|
+
sourceField: z21.string(),
|
|
7043
|
+
targetField: z21.string(),
|
|
6869
7044
|
latestRun: ProjectionRunSchema.nullable()
|
|
6870
7045
|
});
|
|
6871
|
-
var TelemetryProjectionSchema =
|
|
6872
|
-
_tag:
|
|
6873
|
-
id:
|
|
6874
|
-
objectTypeId:
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
7046
|
+
var TelemetryProjectionSchema = z21.object({
|
|
7047
|
+
_tag: z21.literal("TelemetryProjectionDefinition"),
|
|
7048
|
+
id: z21.string(),
|
|
7049
|
+
objectTypeId: z21.string(),
|
|
7050
|
+
datasetId: z21.string(),
|
|
7051
|
+
objectIdField: z21.string(),
|
|
7052
|
+
atField: z21.string(),
|
|
7053
|
+
properties: z21.record(z21.object({
|
|
7054
|
+
valueField: z21.string(),
|
|
7055
|
+
unitField: z21.string().optional()
|
|
7056
|
+
})),
|
|
6881
7057
|
latestRun: ProjectionRunSchema.nullable()
|
|
6882
7058
|
});
|
|
6883
|
-
var ProjectionListResponseSchema =
|
|
6884
|
-
objectProjections:
|
|
6885
|
-
linkProjections:
|
|
6886
|
-
telemetryProjections:
|
|
7059
|
+
var ProjectionListResponseSchema = z21.object({
|
|
7060
|
+
objectProjections: z21.array(ObjectProjectionSchema),
|
|
7061
|
+
linkProjections: z21.array(LinkProjectionSchema),
|
|
7062
|
+
telemetryProjections: z21.array(TelemetryProjectionSchema)
|
|
6887
7063
|
});
|
|
6888
|
-
var ProjectionParamsSchema =
|
|
6889
|
-
projectionId:
|
|
7064
|
+
var ProjectionParamsSchema = z21.object({
|
|
7065
|
+
projectionId: z21.string().min(1)
|
|
6890
7066
|
});
|
|
6891
|
-
var ProjectionResponseSchema =
|
|
7067
|
+
var ProjectionResponseSchema = z21.union([
|
|
6892
7068
|
ObjectProjectionSchema,
|
|
6893
7069
|
LinkProjectionSchema,
|
|
6894
7070
|
TelemetryProjectionSchema
|
|
6895
7071
|
]);
|
|
6896
|
-
var ProjectionRunParamsSchema =
|
|
6897
|
-
runId:
|
|
7072
|
+
var ProjectionRunParamsSchema = z21.object({
|
|
7073
|
+
runId: z21.string().min(1)
|
|
6898
7074
|
});
|
|
6899
|
-
var ProjectionRunsQuerySchema =
|
|
6900
|
-
projectionId:
|
|
7075
|
+
var ProjectionRunsQuerySchema = z21.object({
|
|
7076
|
+
projectionId: z21.string().optional(),
|
|
6901
7077
|
projectionKind: ProjectionKindSchema.optional(),
|
|
6902
|
-
datasetId:
|
|
6903
|
-
datasetVersionId:
|
|
7078
|
+
datasetId: z21.string().optional(),
|
|
7079
|
+
datasetVersionId: z21.string().optional(),
|
|
6904
7080
|
status: ProjectionRunStatusSchema.optional(),
|
|
6905
|
-
startedAfter:
|
|
6906
|
-
startedBefore:
|
|
6907
|
-
limit:
|
|
6908
|
-
offset:
|
|
6909
|
-
order:
|
|
7081
|
+
startedAfter: z21.string().optional(),
|
|
7082
|
+
startedBefore: z21.string().optional(),
|
|
7083
|
+
limit: z21.string().optional(),
|
|
7084
|
+
offset: z21.string().optional(),
|
|
7085
|
+
order: z21.enum(["asc", "desc"]).optional()
|
|
6910
7086
|
});
|
|
6911
|
-
var ProjectionRunListResponseSchema =
|
|
6912
|
-
runs:
|
|
6913
|
-
hasMore:
|
|
6914
|
-
total:
|
|
7087
|
+
var ProjectionRunListResponseSchema = z21.object({
|
|
7088
|
+
runs: z21.array(ProjectionRunSchema),
|
|
7089
|
+
hasMore: z21.boolean(),
|
|
7090
|
+
total: z21.number()
|
|
6915
7091
|
});
|
|
6916
7092
|
|
|
6917
7093
|
// src/routes/projections.ts
|
|
@@ -7079,88 +7255,88 @@ function registerProjectionRoutes(app, host) {
|
|
|
7079
7255
|
import { deriveRuleEventDependencies } from "@sixb/core/internal/rules";
|
|
7080
7256
|
|
|
7081
7257
|
// src/schemas/rules.ts
|
|
7082
|
-
import { z as
|
|
7083
|
-
var RuleParamsSchema =
|
|
7084
|
-
ruleId:
|
|
7085
|
-
});
|
|
7086
|
-
var RuleStatesQuerySchema =
|
|
7087
|
-
ruleId:
|
|
7088
|
-
objectTypeId:
|
|
7089
|
-
primaryId:
|
|
7090
|
-
limit:
|
|
7091
|
-
offset:
|
|
7092
|
-
order:
|
|
7093
|
-
});
|
|
7094
|
-
var RuleValueSchema =
|
|
7095
|
-
var RuleSubjectSchema =
|
|
7096
|
-
kind:
|
|
7097
|
-
objectTypeId:
|
|
7098
|
-
});
|
|
7099
|
-
var RuleEventSubjectSchema =
|
|
7100
|
-
kind:
|
|
7101
|
-
objectTypeId:
|
|
7102
|
-
primaryId:
|
|
7103
|
-
});
|
|
7104
|
-
var RulePropertyPredicateSchema =
|
|
7105
|
-
kind:
|
|
7106
|
-
propertyId:
|
|
7107
|
-
op:
|
|
7258
|
+
import { z as z22 } from "zod";
|
|
7259
|
+
var RuleParamsSchema = z22.object({
|
|
7260
|
+
ruleId: z22.string().min(1)
|
|
7261
|
+
});
|
|
7262
|
+
var RuleStatesQuerySchema = z22.object({
|
|
7263
|
+
ruleId: z22.string().optional(),
|
|
7264
|
+
objectTypeId: z22.string().optional(),
|
|
7265
|
+
primaryId: z22.string().optional(),
|
|
7266
|
+
limit: z22.string().optional(),
|
|
7267
|
+
offset: z22.string().optional(),
|
|
7268
|
+
order: z22.enum(["asc", "desc"]).optional()
|
|
7269
|
+
});
|
|
7270
|
+
var RuleValueSchema = z22.union([z22.string(), z22.number(), z22.boolean()]).nullable();
|
|
7271
|
+
var RuleSubjectSchema = z22.object({
|
|
7272
|
+
kind: z22.literal("object"),
|
|
7273
|
+
objectTypeId: z22.string()
|
|
7274
|
+
});
|
|
7275
|
+
var RuleEventSubjectSchema = z22.object({
|
|
7276
|
+
kind: z22.literal("object"),
|
|
7277
|
+
objectTypeId: z22.string(),
|
|
7278
|
+
primaryId: z22.string()
|
|
7279
|
+
});
|
|
7280
|
+
var RulePropertyPredicateSchema = z22.object({
|
|
7281
|
+
kind: z22.literal("property"),
|
|
7282
|
+
propertyId: z22.string(),
|
|
7283
|
+
op: z22.enum(["eq", "notEq", "gt", "gte", "lt", "lte", "isPresent", "isMissing"]),
|
|
7108
7284
|
value: RuleValueSchema.optional()
|
|
7109
7285
|
});
|
|
7110
|
-
var RuleLinkPredicateSchema =
|
|
7111
|
-
kind:
|
|
7112
|
-
linkId:
|
|
7113
|
-
op:
|
|
7286
|
+
var RuleLinkPredicateSchema = z22.object({
|
|
7287
|
+
kind: z22.literal("link"),
|
|
7288
|
+
linkId: z22.string(),
|
|
7289
|
+
op: z22.enum(["exists", "isMissing"])
|
|
7114
7290
|
});
|
|
7115
7291
|
function createRulePredicateSchema(childPredicateSchema) {
|
|
7116
|
-
return
|
|
7117
|
-
|
|
7118
|
-
kind:
|
|
7119
|
-
predicates:
|
|
7292
|
+
return z22.union([
|
|
7293
|
+
z22.object({
|
|
7294
|
+
kind: z22.literal("all"),
|
|
7295
|
+
predicates: z22.array(childPredicateSchema)
|
|
7120
7296
|
}),
|
|
7121
|
-
|
|
7122
|
-
kind:
|
|
7123
|
-
predicates:
|
|
7297
|
+
z22.object({
|
|
7298
|
+
kind: z22.literal("any"),
|
|
7299
|
+
predicates: z22.array(childPredicateSchema)
|
|
7124
7300
|
}),
|
|
7125
|
-
|
|
7126
|
-
kind:
|
|
7301
|
+
z22.object({
|
|
7302
|
+
kind: z22.literal("not"),
|
|
7127
7303
|
predicate: childPredicateSchema
|
|
7128
7304
|
}),
|
|
7129
7305
|
RulePropertyPredicateSchema,
|
|
7130
7306
|
RuleLinkPredicateSchema
|
|
7131
7307
|
]);
|
|
7132
7308
|
}
|
|
7133
|
-
var DeepRulePredicateSchema = createRulePredicateSchema(
|
|
7309
|
+
var DeepRulePredicateSchema = createRulePredicateSchema(z22.unknown());
|
|
7134
7310
|
var NestedRulePredicateSchema = createRulePredicateSchema(DeepRulePredicateSchema);
|
|
7135
7311
|
var RulePredicateSchema = NestedRulePredicateSchema;
|
|
7136
|
-
var RuleEventDependencySchema =
|
|
7137
|
-
|
|
7138
|
-
type:
|
|
7139
|
-
objectTypeId:
|
|
7312
|
+
var RuleEventDependencySchema = z22.union([
|
|
7313
|
+
z22.object({
|
|
7314
|
+
type: z22.enum(["object.created", "object.updated", "object.deleted"]),
|
|
7315
|
+
objectTypeId: z22.string()
|
|
7140
7316
|
}),
|
|
7141
|
-
|
|
7142
|
-
type:
|
|
7143
|
-
sourceTypeId:
|
|
7144
|
-
linkId:
|
|
7317
|
+
z22.object({
|
|
7318
|
+
type: z22.enum(["link.created", "link.updated", "link.deleted"]),
|
|
7319
|
+
sourceTypeId: z22.string(),
|
|
7320
|
+
linkId: z22.string()
|
|
7145
7321
|
})
|
|
7146
7322
|
]);
|
|
7147
|
-
var RuleSchema =
|
|
7148
|
-
kind:
|
|
7149
|
-
id:
|
|
7323
|
+
var RuleSchema = z22.object({
|
|
7324
|
+
kind: z22.literal("rule"),
|
|
7325
|
+
id: z22.string(),
|
|
7150
7326
|
subject: RuleSubjectSchema,
|
|
7151
7327
|
predicate: RulePredicateSchema,
|
|
7152
|
-
dependencies:
|
|
7328
|
+
dependencies: z22.array(RuleEventDependencySchema)
|
|
7153
7329
|
});
|
|
7154
|
-
var RuleStateSchema =
|
|
7155
|
-
projectId:
|
|
7156
|
-
ruleId:
|
|
7330
|
+
var RuleStateSchema = z22.object({
|
|
7331
|
+
projectId: z22.string(),
|
|
7332
|
+
ruleId: z22.string(),
|
|
7157
7333
|
subject: RuleEventSubjectSchema,
|
|
7158
|
-
triggeredAt:
|
|
7334
|
+
triggeredAt: z22.string()
|
|
7159
7335
|
});
|
|
7160
|
-
var RuleStateListResponseSchema =
|
|
7161
|
-
states:
|
|
7162
|
-
hasMore:
|
|
7163
|
-
total:
|
|
7336
|
+
var RuleStateListResponseSchema = z22.object({
|
|
7337
|
+
states: z22.array(RuleStateSchema),
|
|
7338
|
+
hasMore: z22.boolean(),
|
|
7339
|
+
total: z22.number()
|
|
7164
7340
|
});
|
|
7165
7341
|
|
|
7166
7342
|
// src/routes/rules.ts
|
|
@@ -7240,44 +7416,44 @@ function registerRuleRoutes(app, host) {
|
|
|
7240
7416
|
}
|
|
7241
7417
|
|
|
7242
7418
|
// src/schemas/status.ts
|
|
7243
|
-
import { z as
|
|
7244
|
-
var HealthResponseSchema =
|
|
7245
|
-
var StorageReadinessSchema =
|
|
7246
|
-
reachable:
|
|
7247
|
-
schemaValid:
|
|
7419
|
+
import { z as z23 } from "zod";
|
|
7420
|
+
var HealthResponseSchema = z23.object({ status: z23.literal("ok") });
|
|
7421
|
+
var StorageReadinessSchema = z23.object({
|
|
7422
|
+
reachable: z23.boolean(),
|
|
7423
|
+
schemaValid: z23.boolean()
|
|
7248
7424
|
});
|
|
7249
|
-
var ReadinessResponseSchema =
|
|
7250
|
-
status:
|
|
7425
|
+
var ReadinessResponseSchema = z23.object({
|
|
7426
|
+
status: z23.enum(["ready", "unready"]),
|
|
7251
7427
|
storage: StorageReadinessSchema,
|
|
7252
|
-
reason:
|
|
7253
|
-
});
|
|
7254
|
-
var MaintenanceSummarySchema =
|
|
7255
|
-
running:
|
|
7256
|
-
intervalMs:
|
|
7257
|
-
lastStartedAt:
|
|
7258
|
-
lastCompletedAt:
|
|
7259
|
-
lastDurationMs:
|
|
7260
|
-
consecutiveFailures:
|
|
7261
|
-
lastError:
|
|
7262
|
-
outbox:
|
|
7263
|
-
pendingCount:
|
|
7264
|
-
oldestPendingAt:
|
|
7265
|
-
retryingCount:
|
|
7266
|
-
maxAttempts:
|
|
7428
|
+
reason: z23.string().optional()
|
|
7429
|
+
});
|
|
7430
|
+
var MaintenanceSummarySchema = z23.object({
|
|
7431
|
+
running: z23.boolean(),
|
|
7432
|
+
intervalMs: z23.number().int().positive(),
|
|
7433
|
+
lastStartedAt: z23.string().nullable(),
|
|
7434
|
+
lastCompletedAt: z23.string().nullable(),
|
|
7435
|
+
lastDurationMs: z23.number().nonnegative().nullable(),
|
|
7436
|
+
consecutiveFailures: z23.number().int().nonnegative(),
|
|
7437
|
+
lastError: z23.string().nullable(),
|
|
7438
|
+
outbox: z23.object({
|
|
7439
|
+
pendingCount: z23.number().int().nonnegative(),
|
|
7440
|
+
oldestPendingAt: z23.string().nullable(),
|
|
7441
|
+
retryingCount: z23.number().int().nonnegative(),
|
|
7442
|
+
maxAttempts: z23.number().int().nonnegative()
|
|
7267
7443
|
}).nullable(),
|
|
7268
|
-
terminalSources:
|
|
7269
|
-
count:
|
|
7270
|
-
oldestTerminalAt:
|
|
7444
|
+
terminalSources: z23.object({
|
|
7445
|
+
count: z23.number().int().nonnegative(),
|
|
7446
|
+
oldestTerminalAt: z23.string().nullable()
|
|
7271
7447
|
}).nullable(),
|
|
7272
|
-
cleanup:
|
|
7273
|
-
publishedOutboxRowsDeleted:
|
|
7274
|
-
terminalSourceRowsDeleted:
|
|
7275
|
-
terminalSourceMaterializationsDeleted:
|
|
7448
|
+
cleanup: z23.object({
|
|
7449
|
+
publishedOutboxRowsDeleted: z23.number().int().nonnegative(),
|
|
7450
|
+
terminalSourceRowsDeleted: z23.number().int().nonnegative(),
|
|
7451
|
+
terminalSourceMaterializationsDeleted: z23.number().int().nonnegative()
|
|
7276
7452
|
}).nullable()
|
|
7277
7453
|
});
|
|
7278
|
-
var StatusResponseSchema =
|
|
7279
|
-
status:
|
|
7280
|
-
objectTypes:
|
|
7454
|
+
var StatusResponseSchema = z23.object({
|
|
7455
|
+
status: z23.enum(["ok", "degraded"]),
|
|
7456
|
+
objectTypes: z23.number().int().nonnegative(),
|
|
7281
7457
|
maintenance: MaintenanceSummarySchema
|
|
7282
7458
|
});
|
|
7283
7459
|
|
|
@@ -7323,74 +7499,74 @@ function registerStatusRoutes(app, host) {
|
|
|
7323
7499
|
import {
|
|
7324
7500
|
SYNC_RUN_FAILURE_CODES
|
|
7325
7501
|
} from "@sixb/core/storage";
|
|
7326
|
-
import { z as
|
|
7502
|
+
import { z as z24 } from "zod";
|
|
7327
7503
|
var SyncRunFailureSchema = sixbFailureSchema(SYNC_RUN_FAILURE_CODES);
|
|
7328
|
-
var SyncParamsSchema =
|
|
7329
|
-
syncId:
|
|
7330
|
-
});
|
|
7331
|
-
var SyncRunStatusSchema =
|
|
7332
|
-
var SyncModeSchema =
|
|
7333
|
-
var SyncRunsQuerySchema =
|
|
7334
|
-
syncId:
|
|
7335
|
-
datasetId:
|
|
7504
|
+
var SyncParamsSchema = z24.object({
|
|
7505
|
+
syncId: z24.string().min(1)
|
|
7506
|
+
});
|
|
7507
|
+
var SyncRunStatusSchema = z24.enum(["queued", "running", "succeeded", "failed", "cancelled"]);
|
|
7508
|
+
var SyncModeSchema = z24.enum(["snapshot", "append", "merge"]);
|
|
7509
|
+
var SyncRunsQuerySchema = z24.object({
|
|
7510
|
+
syncId: z24.string().optional(),
|
|
7511
|
+
datasetId: z24.string().optional(),
|
|
7336
7512
|
status: SyncRunStatusSchema.optional(),
|
|
7337
|
-
startedAfter:
|
|
7338
|
-
startedBefore:
|
|
7339
|
-
limit:
|
|
7340
|
-
offset:
|
|
7341
|
-
order:
|
|
7342
|
-
});
|
|
7343
|
-
var RequestSyncRunBodySchema =
|
|
7344
|
-
expectedLatestVersionId:
|
|
7345
|
-
commitMessage:
|
|
7346
|
-
});
|
|
7347
|
-
var SyncTriggerSchema =
|
|
7348
|
-
type:
|
|
7349
|
-
scheduleId:
|
|
7350
|
-
});
|
|
7351
|
-
var SyncRunSchema =
|
|
7352
|
-
id:
|
|
7353
|
-
projectId:
|
|
7354
|
-
syncId:
|
|
7355
|
-
datasetId:
|
|
7513
|
+
startedAfter: z24.string().optional(),
|
|
7514
|
+
startedBefore: z24.string().optional(),
|
|
7515
|
+
limit: z24.string().optional(),
|
|
7516
|
+
offset: z24.string().optional(),
|
|
7517
|
+
order: z24.enum(["asc", "desc"]).optional()
|
|
7518
|
+
});
|
|
7519
|
+
var RequestSyncRunBodySchema = z24.object({
|
|
7520
|
+
expectedLatestVersionId: z24.string().optional(),
|
|
7521
|
+
commitMessage: z24.string().optional()
|
|
7522
|
+
});
|
|
7523
|
+
var SyncTriggerSchema = z24.object({
|
|
7524
|
+
type: z24.literal("schedule"),
|
|
7525
|
+
scheduleId: z24.string()
|
|
7526
|
+
});
|
|
7527
|
+
var SyncRunSchema = z24.object({
|
|
7528
|
+
id: z24.string(),
|
|
7529
|
+
projectId: z24.string(),
|
|
7530
|
+
syncId: z24.string(),
|
|
7531
|
+
datasetId: z24.string(),
|
|
7356
7532
|
mode: SyncModeSchema,
|
|
7357
7533
|
status: SyncRunStatusSchema,
|
|
7358
|
-
queuedAt:
|
|
7359
|
-
startedAt:
|
|
7360
|
-
finishedAt:
|
|
7361
|
-
rowsRead:
|
|
7362
|
-
output:
|
|
7363
|
-
datasetId:
|
|
7364
|
-
versionId:
|
|
7534
|
+
queuedAt: z24.string(),
|
|
7535
|
+
startedAt: z24.string().optional(),
|
|
7536
|
+
finishedAt: z24.string().optional(),
|
|
7537
|
+
rowsRead: z24.number().optional(),
|
|
7538
|
+
output: z24.object({
|
|
7539
|
+
datasetId: z24.string(),
|
|
7540
|
+
versionId: z24.string()
|
|
7365
7541
|
}).optional(),
|
|
7366
|
-
expectedLatestVersionId:
|
|
7367
|
-
commitMessage:
|
|
7542
|
+
expectedLatestVersionId: z24.string().optional(),
|
|
7543
|
+
commitMessage: z24.string().optional(),
|
|
7368
7544
|
error: SyncRunFailureSchema.optional()
|
|
7369
7545
|
});
|
|
7370
|
-
var SyncSchema =
|
|
7371
|
-
id:
|
|
7546
|
+
var SyncSchema = z24.object({
|
|
7547
|
+
id: z24.string(),
|
|
7372
7548
|
mode: SyncModeSchema,
|
|
7373
|
-
connector:
|
|
7374
|
-
id:
|
|
7375
|
-
type:
|
|
7549
|
+
connector: z24.object({
|
|
7550
|
+
id: z24.string(),
|
|
7551
|
+
type: z24.string()
|
|
7376
7552
|
}),
|
|
7377
|
-
target:
|
|
7378
|
-
kind:
|
|
7553
|
+
target: z24.object({
|
|
7554
|
+
kind: z24.literal("dataset"),
|
|
7379
7555
|
dataset: DatasetDefinitionSchema
|
|
7380
7556
|
}),
|
|
7381
|
-
triggers:
|
|
7557
|
+
triggers: z24.array(SyncTriggerSchema),
|
|
7382
7558
|
latestRun: SyncRunSchema.nullable()
|
|
7383
7559
|
});
|
|
7384
|
-
var SyncRunListResponseSchema =
|
|
7385
|
-
runs:
|
|
7386
|
-
hasMore:
|
|
7387
|
-
total:
|
|
7560
|
+
var SyncRunListResponseSchema = z24.object({
|
|
7561
|
+
runs: z24.array(SyncRunSchema),
|
|
7562
|
+
hasMore: z24.boolean(),
|
|
7563
|
+
total: z24.number()
|
|
7388
7564
|
});
|
|
7389
|
-
var RequestSyncRunResponseSchema =
|
|
7390
|
-
runId:
|
|
7391
|
-
jobId:
|
|
7392
|
-
syncId:
|
|
7393
|
-
queuedAt:
|
|
7565
|
+
var RequestSyncRunResponseSchema = z24.object({
|
|
7566
|
+
runId: z24.string(),
|
|
7567
|
+
jobId: z24.string(),
|
|
7568
|
+
syncId: z24.string(),
|
|
7569
|
+
queuedAt: z24.string()
|
|
7394
7570
|
});
|
|
7395
7571
|
|
|
7396
7572
|
// src/routes/syncs.ts
|
|
@@ -7544,52 +7720,52 @@ function registerSyncRoutes(app, host) {
|
|
|
7544
7720
|
}
|
|
7545
7721
|
|
|
7546
7722
|
// src/schemas/telemetry.ts
|
|
7547
|
-
import { z as
|
|
7548
|
-
var TelemetryParamsSchema =
|
|
7549
|
-
objectTypeId:
|
|
7550
|
-
objectId:
|
|
7551
|
-
propertyId:
|
|
7552
|
-
});
|
|
7553
|
-
var TelemetryHistoryQuerySchema =
|
|
7554
|
-
from:
|
|
7555
|
-
to:
|
|
7556
|
-
limit:
|
|
7557
|
-
order:
|
|
7723
|
+
import { z as z25 } from "zod";
|
|
7724
|
+
var TelemetryParamsSchema = z25.object({
|
|
7725
|
+
objectTypeId: z25.string().min(1),
|
|
7726
|
+
objectId: z25.string().min(1),
|
|
7727
|
+
propertyId: z25.string().min(1)
|
|
7728
|
+
});
|
|
7729
|
+
var TelemetryHistoryQuerySchema = z25.object({
|
|
7730
|
+
from: z25.string().optional(),
|
|
7731
|
+
to: z25.string().optional(),
|
|
7732
|
+
limit: z25.string().optional(),
|
|
7733
|
+
order: z25.enum(["asc", "desc"]).optional()
|
|
7558
7734
|
});
|
|
7559
|
-
var BulkTelemetryHistorySeriesInputSchema =
|
|
7560
|
-
objectTypeId:
|
|
7561
|
-
objectId:
|
|
7562
|
-
propertyId:
|
|
7735
|
+
var BulkTelemetryHistorySeriesInputSchema = z25.object({
|
|
7736
|
+
objectTypeId: z25.string().min(1),
|
|
7737
|
+
objectId: z25.string().min(1),
|
|
7738
|
+
propertyId: z25.string().min(1)
|
|
7563
7739
|
}).strict();
|
|
7564
|
-
var BulkTelemetryHistoryBodySchema =
|
|
7565
|
-
series:
|
|
7566
|
-
from:
|
|
7567
|
-
to:
|
|
7568
|
-
limitPerSeries:
|
|
7569
|
-
order:
|
|
7740
|
+
var BulkTelemetryHistoryBodySchema = z25.object({
|
|
7741
|
+
series: z25.array(BulkTelemetryHistorySeriesInputSchema).min(1),
|
|
7742
|
+
from: z25.string().optional(),
|
|
7743
|
+
to: z25.string().optional(),
|
|
7744
|
+
limitPerSeries: z25.number().int().nonnegative().optional(),
|
|
7745
|
+
order: z25.enum(["asc", "desc"]).optional()
|
|
7570
7746
|
}).strict();
|
|
7571
|
-
var AppendTelemetryBodySchema =
|
|
7572
|
-
value:
|
|
7573
|
-
unit:
|
|
7574
|
-
at:
|
|
7747
|
+
var AppendTelemetryBodySchema = z25.object({
|
|
7748
|
+
value: z25.unknown(),
|
|
7749
|
+
unit: z25.string().optional(),
|
|
7750
|
+
at: z25.string().optional()
|
|
7575
7751
|
});
|
|
7576
|
-
var TelemetryPointSchema =
|
|
7577
|
-
projectId:
|
|
7578
|
-
objectTypeId:
|
|
7579
|
-
objectId:
|
|
7580
|
-
propertyId:
|
|
7581
|
-
value:
|
|
7582
|
-
unit:
|
|
7583
|
-
at:
|
|
7584
|
-
});
|
|
7585
|
-
var BulkTelemetryHistorySeriesSchema =
|
|
7586
|
-
objectTypeId:
|
|
7587
|
-
objectId:
|
|
7588
|
-
propertyId:
|
|
7589
|
-
points:
|
|
7590
|
-
});
|
|
7591
|
-
var BulkTelemetryHistoryResponseSchema =
|
|
7592
|
-
series:
|
|
7752
|
+
var TelemetryPointSchema = z25.object({
|
|
7753
|
+
projectId: z25.string(),
|
|
7754
|
+
objectTypeId: z25.string(),
|
|
7755
|
+
objectId: z25.string(),
|
|
7756
|
+
propertyId: z25.string(),
|
|
7757
|
+
value: z25.unknown(),
|
|
7758
|
+
unit: z25.string().optional(),
|
|
7759
|
+
at: z25.string()
|
|
7760
|
+
});
|
|
7761
|
+
var BulkTelemetryHistorySeriesSchema = z25.object({
|
|
7762
|
+
objectTypeId: z25.string(),
|
|
7763
|
+
objectId: z25.string(),
|
|
7764
|
+
propertyId: z25.string(),
|
|
7765
|
+
points: z25.array(TelemetryPointSchema)
|
|
7766
|
+
});
|
|
7767
|
+
var BulkTelemetryHistoryResponseSchema = z25.object({
|
|
7768
|
+
series: z25.array(BulkTelemetryHistorySeriesSchema)
|
|
7593
7769
|
});
|
|
7594
7770
|
|
|
7595
7771
|
// src/routes/telemetry.ts
|
|
@@ -7747,40 +7923,40 @@ function registerTelemetryRoutes(app, _host) {
|
|
|
7747
7923
|
|
|
7748
7924
|
// src/schemas/webhook-runs.ts
|
|
7749
7925
|
import { WEBHOOK_RUN_FAILURE_CODES } from "@sixb/core/storage";
|
|
7750
|
-
import { z as
|
|
7926
|
+
import { z as z26 } from "zod";
|
|
7751
7927
|
var WebhookRunFailureSchema = sixbFailureSchema(WEBHOOK_RUN_FAILURE_CODES);
|
|
7752
|
-
var WebhookRunStatusSchema =
|
|
7753
|
-
var WebhookRunsQuerySchema =
|
|
7754
|
-
connectorId:
|
|
7755
|
-
webhookId:
|
|
7928
|
+
var WebhookRunStatusSchema = z26.enum(["running", "succeeded", "failed"]);
|
|
7929
|
+
var WebhookRunsQuerySchema = z26.object({
|
|
7930
|
+
connectorId: z26.string().optional(),
|
|
7931
|
+
webhookId: z26.string().optional(),
|
|
7756
7932
|
status: WebhookRunStatusSchema.optional(),
|
|
7757
|
-
idempotencyKey:
|
|
7758
|
-
startedAfter:
|
|
7759
|
-
startedBefore:
|
|
7760
|
-
limit:
|
|
7761
|
-
offset:
|
|
7762
|
-
order:
|
|
7933
|
+
idempotencyKey: z26.string().optional(),
|
|
7934
|
+
startedAfter: z26.string().optional(),
|
|
7935
|
+
startedBefore: z26.string().optional(),
|
|
7936
|
+
limit: z26.string().optional(),
|
|
7937
|
+
offset: z26.string().optional(),
|
|
7938
|
+
order: z26.enum(["asc", "desc"]).optional()
|
|
7763
7939
|
});
|
|
7764
|
-
var WebhookRunSchema =
|
|
7765
|
-
id:
|
|
7766
|
-
projectId:
|
|
7767
|
-
executionId:
|
|
7768
|
-
connectorId:
|
|
7769
|
-
webhookId:
|
|
7940
|
+
var WebhookRunSchema = z26.object({
|
|
7941
|
+
id: z26.string(),
|
|
7942
|
+
projectId: z26.string(),
|
|
7943
|
+
executionId: z26.string(),
|
|
7944
|
+
connectorId: z26.string(),
|
|
7945
|
+
webhookId: z26.string(),
|
|
7770
7946
|
status: WebhookRunStatusSchema,
|
|
7771
|
-
method:
|
|
7772
|
-
route:
|
|
7773
|
-
startedAt:
|
|
7774
|
-
finishedAt:
|
|
7775
|
-
requestBodyBytes:
|
|
7776
|
-
responseStatus:
|
|
7777
|
-
idempotencyKey:
|
|
7947
|
+
method: z26.string(),
|
|
7948
|
+
route: z26.string(),
|
|
7949
|
+
startedAt: z26.string(),
|
|
7950
|
+
finishedAt: z26.string().optional(),
|
|
7951
|
+
requestBodyBytes: z26.number(),
|
|
7952
|
+
responseStatus: z26.number().optional(),
|
|
7953
|
+
idempotencyKey: z26.string().optional(),
|
|
7778
7954
|
error: WebhookRunFailureSchema.optional()
|
|
7779
7955
|
});
|
|
7780
|
-
var WebhookRunListResponseSchema =
|
|
7781
|
-
runs:
|
|
7782
|
-
hasMore:
|
|
7783
|
-
total:
|
|
7956
|
+
var WebhookRunListResponseSchema = z26.object({
|
|
7957
|
+
runs: z26.array(WebhookRunSchema),
|
|
7958
|
+
hasMore: z26.boolean(),
|
|
7959
|
+
total: z26.number()
|
|
7784
7960
|
});
|
|
7785
7961
|
|
|
7786
7962
|
// src/routes/webhook-runs.ts
|
|
@@ -7855,25 +8031,25 @@ import {
|
|
|
7855
8031
|
snapshotWorkflowInterventionResponse
|
|
7856
8032
|
} from "@sixb/core/internal/workflows";
|
|
7857
8033
|
import { AGENT_RUN_FAILURE_CODES as AGENT_RUN_FAILURE_CODES2, WORKFLOW_RUN_FAILURE_CODES as WORKFLOW_RUN_FAILURE_CODES2 } from "@sixb/core/storage";
|
|
7858
|
-
import { z as
|
|
8034
|
+
import { z as z28 } from "zod";
|
|
7859
8035
|
|
|
7860
8036
|
// src/schemas/workflows.ts
|
|
7861
8037
|
import {
|
|
7862
8038
|
WORKFLOW_RUN_FAILURE_CODES
|
|
7863
8039
|
} from "@sixb/core/storage";
|
|
7864
|
-
import { z as
|
|
7865
|
-
var WorkflowIOSnapshotSchema =
|
|
8040
|
+
import { z as z27 } from "zod";
|
|
8041
|
+
var WorkflowIOSnapshotSchema = z27.record(JsonValueSchema);
|
|
7866
8042
|
var WorkflowRunFailureSchema = sixbFailureSchema(WORKFLOW_RUN_FAILURE_CODES);
|
|
7867
|
-
var WorkflowParamsSchema =
|
|
7868
|
-
workflowId:
|
|
8043
|
+
var WorkflowParamsSchema = z27.object({
|
|
8044
|
+
workflowId: z27.string().min(1)
|
|
7869
8045
|
});
|
|
7870
|
-
var WorkflowRunParamsSchema =
|
|
7871
|
-
runId:
|
|
8046
|
+
var WorkflowRunParamsSchema = z27.object({
|
|
8047
|
+
runId: z27.string().min(1)
|
|
7872
8048
|
});
|
|
7873
|
-
var WorkflowInterventionParamsSchema =
|
|
7874
|
-
interventionId:
|
|
8049
|
+
var WorkflowInterventionParamsSchema = z27.object({
|
|
8050
|
+
interventionId: z27.string().min(1)
|
|
7875
8051
|
});
|
|
7876
|
-
var WorkflowRunStatusSchema =
|
|
8052
|
+
var WorkflowRunStatusSchema = z27.enum([
|
|
7877
8053
|
"queued",
|
|
7878
8054
|
"running",
|
|
7879
8055
|
"waiting",
|
|
@@ -7881,91 +8057,91 @@ var WorkflowRunStatusSchema = z26.enum([
|
|
|
7881
8057
|
"failed",
|
|
7882
8058
|
"cancelled"
|
|
7883
8059
|
]);
|
|
7884
|
-
var WorkflowInterventionStatusSchema =
|
|
8060
|
+
var WorkflowInterventionStatusSchema = z27.enum([
|
|
7885
8061
|
"pending",
|
|
7886
8062
|
"submitted",
|
|
7887
8063
|
"cancelled",
|
|
7888
8064
|
"expired"
|
|
7889
8065
|
]);
|
|
7890
|
-
var WorkflowRunsQuerySchema =
|
|
7891
|
-
workflowId:
|
|
8066
|
+
var WorkflowRunsQuerySchema = z27.object({
|
|
8067
|
+
workflowId: z27.string().optional(),
|
|
7892
8068
|
status: WorkflowRunStatusSchema.optional(),
|
|
7893
|
-
startedAfter:
|
|
7894
|
-
startedBefore:
|
|
7895
|
-
limit:
|
|
7896
|
-
offset:
|
|
7897
|
-
order:
|
|
7898
|
-
});
|
|
7899
|
-
var WorkflowInterventionsQuerySchema =
|
|
7900
|
-
workflowId:
|
|
7901
|
-
workflowRunId:
|
|
7902
|
-
nodeRunId:
|
|
7903
|
-
nodeId:
|
|
7904
|
-
nodeKey:
|
|
7905
|
-
interventionId:
|
|
8069
|
+
startedAfter: z27.string().optional(),
|
|
8070
|
+
startedBefore: z27.string().optional(),
|
|
8071
|
+
limit: z27.string().optional(),
|
|
8072
|
+
offset: z27.string().optional(),
|
|
8073
|
+
order: z27.enum(["asc", "desc"]).optional()
|
|
8074
|
+
});
|
|
8075
|
+
var WorkflowInterventionsQuerySchema = z27.object({
|
|
8076
|
+
workflowId: z27.string().optional(),
|
|
8077
|
+
workflowRunId: z27.string().optional(),
|
|
8078
|
+
nodeRunId: z27.string().optional(),
|
|
8079
|
+
nodeId: z27.string().optional(),
|
|
8080
|
+
nodeKey: z27.string().optional(),
|
|
8081
|
+
interventionId: z27.string().optional(),
|
|
7906
8082
|
status: WorkflowInterventionStatusSchema.optional(),
|
|
7907
|
-
requestedAfter:
|
|
7908
|
-
requestedBefore:
|
|
7909
|
-
limit:
|
|
7910
|
-
offset:
|
|
7911
|
-
order:
|
|
8083
|
+
requestedAfter: z27.string().optional(),
|
|
8084
|
+
requestedBefore: z27.string().optional(),
|
|
8085
|
+
limit: z27.string().optional(),
|
|
8086
|
+
offset: z27.string().optional(),
|
|
8087
|
+
order: z27.enum(["asc", "desc"]).optional()
|
|
7912
8088
|
});
|
|
7913
|
-
var RequestWorkflowRunBodySchema =
|
|
8089
|
+
var RequestWorkflowRunBodySchema = z27.object({
|
|
7914
8090
|
input: WorkflowIOSnapshotSchema.optional()
|
|
7915
8091
|
}).default({});
|
|
7916
|
-
var WorkflowInterventionActorSchema =
|
|
7917
|
-
principalType:
|
|
7918
|
-
principalId:
|
|
8092
|
+
var WorkflowInterventionActorSchema = z27.object({
|
|
8093
|
+
principalType: z27.enum(["user", "serviceAccount", "system"]),
|
|
8094
|
+
principalId: z27.string().min(1)
|
|
7919
8095
|
});
|
|
7920
|
-
var CancelWorkflowRunBodySchema =
|
|
7921
|
-
var SubmitWorkflowInterventionBodySchema =
|
|
8096
|
+
var CancelWorkflowRunBodySchema = z27.object({}).default({});
|
|
8097
|
+
var SubmitWorkflowInterventionBodySchema = z27.object({
|
|
7922
8098
|
response: WorkflowIOSnapshotSchema
|
|
7923
8099
|
});
|
|
7924
|
-
var CancelWorkflowInterventionBodySchema =
|
|
7925
|
-
var WorkflowTriggerSchema =
|
|
7926
|
-
type:
|
|
7927
|
-
scheduleId:
|
|
8100
|
+
var CancelWorkflowInterventionBodySchema = z27.object({}).default({});
|
|
8101
|
+
var WorkflowTriggerSchema = z27.object({
|
|
8102
|
+
type: z27.literal("schedule"),
|
|
8103
|
+
scheduleId: z27.string()
|
|
7928
8104
|
});
|
|
7929
|
-
var WorkflowNodeSchema =
|
|
7930
|
-
|
|
7931
|
-
type:
|
|
7932
|
-
id:
|
|
7933
|
-
key:
|
|
8105
|
+
var WorkflowNodeSchema = z27.union([
|
|
8106
|
+
z27.object({
|
|
8107
|
+
type: z27.literal("step"),
|
|
8108
|
+
id: z27.string(),
|
|
8109
|
+
key: z27.string(),
|
|
7934
8110
|
input: WorkflowIOSnapshotSchema,
|
|
7935
8111
|
output: WorkflowIOSnapshotSchema
|
|
7936
8112
|
}),
|
|
7937
|
-
|
|
7938
|
-
type:
|
|
7939
|
-
id:
|
|
7940
|
-
key:
|
|
7941
|
-
objectTypeId:
|
|
8113
|
+
z27.object({
|
|
8114
|
+
type: z27.literal("action"),
|
|
8115
|
+
id: z27.string(),
|
|
8116
|
+
key: z27.string(),
|
|
8117
|
+
objectTypeId: z27.string().optional(),
|
|
7942
8118
|
params: WorkflowIOSnapshotSchema
|
|
7943
8119
|
}),
|
|
7944
|
-
|
|
7945
|
-
type:
|
|
7946
|
-
id:
|
|
7947
|
-
key:
|
|
8120
|
+
z27.object({
|
|
8121
|
+
type: z27.literal("intervention"),
|
|
8122
|
+
id: z27.string(),
|
|
8123
|
+
key: z27.string(),
|
|
7948
8124
|
input: WorkflowIOSnapshotSchema,
|
|
7949
8125
|
response: WorkflowIOSnapshotSchema,
|
|
7950
|
-
description:
|
|
8126
|
+
description: z27.string().optional()
|
|
7951
8127
|
}),
|
|
7952
|
-
|
|
7953
|
-
type:
|
|
7954
|
-
id:
|
|
7955
|
-
key:
|
|
7956
|
-
agentId:
|
|
8128
|
+
z27.object({
|
|
8129
|
+
type: z27.literal("agent"),
|
|
8130
|
+
id: z27.string(),
|
|
8131
|
+
key: z27.string(),
|
|
8132
|
+
agentId: z27.string(),
|
|
7957
8133
|
input: WorkflowIOSnapshotSchema,
|
|
7958
8134
|
output: WorkflowIOSnapshotSchema
|
|
7959
8135
|
})
|
|
7960
8136
|
]);
|
|
7961
|
-
var WorkflowRunSummarySchema =
|
|
7962
|
-
id:
|
|
7963
|
-
projectId:
|
|
7964
|
-
workflowId:
|
|
8137
|
+
var WorkflowRunSummarySchema = z27.object({
|
|
8138
|
+
id: z27.string(),
|
|
8139
|
+
projectId: z27.string(),
|
|
8140
|
+
workflowId: z27.string(),
|
|
7965
8141
|
status: WorkflowRunStatusSchema,
|
|
7966
|
-
queuedAt:
|
|
7967
|
-
startedAt:
|
|
7968
|
-
finishedAt:
|
|
8142
|
+
queuedAt: z27.string().optional(),
|
|
8143
|
+
startedAt: z27.string(),
|
|
8144
|
+
finishedAt: z27.string().optional(),
|
|
7969
8145
|
error: WorkflowRunFailureSchema.optional(),
|
|
7970
8146
|
requestedBy: WorkflowInterventionActorSchema
|
|
7971
8147
|
});
|
|
@@ -7973,111 +8149,111 @@ var WorkflowRunDetailSchema = WorkflowRunSummarySchema.extend({
|
|
|
7973
8149
|
input: WorkflowIOSnapshotSchema,
|
|
7974
8150
|
output: WorkflowIOSnapshotSchema.optional()
|
|
7975
8151
|
});
|
|
7976
|
-
var WorkflowAgentNodeExecutionSummarySchema =
|
|
7977
|
-
agentId:
|
|
7978
|
-
status:
|
|
7979
|
-
attempt:
|
|
7980
|
-
modelId:
|
|
7981
|
-
finishReason:
|
|
8152
|
+
var WorkflowAgentNodeExecutionSummarySchema = z27.object({
|
|
8153
|
+
agentId: z27.string(),
|
|
8154
|
+
status: z27.enum(["queued", "running", "succeeded", "failed", "cancelled"]),
|
|
8155
|
+
attempt: z27.number().int().nonnegative(),
|
|
8156
|
+
modelId: z27.string().optional(),
|
|
8157
|
+
finishReason: z27.string().optional(),
|
|
7982
8158
|
usage: AiUsageSummarySchema.optional(),
|
|
7983
8159
|
cost: AiCostSummarySchema.optional(),
|
|
7984
|
-
startedAt:
|
|
7985
|
-
completedAt:
|
|
8160
|
+
startedAt: z27.string().optional(),
|
|
8161
|
+
completedAt: z27.string().optional()
|
|
7986
8162
|
});
|
|
7987
|
-
var WorkflowAgentFailurePhaseSchema =
|
|
8163
|
+
var WorkflowAgentFailurePhaseSchema = z27.enum(["agent-loop", "structured-finalizer"]);
|
|
7988
8164
|
var WorkflowAgentNodeExecutionSchema = WorkflowAgentNodeExecutionSummarySchema.extend({
|
|
7989
|
-
nodeRunId:
|
|
7990
|
-
prompt:
|
|
7991
|
-
trace:
|
|
7992
|
-
diagnostics:
|
|
8165
|
+
nodeRunId: z27.string(),
|
|
8166
|
+
prompt: z27.string(),
|
|
8167
|
+
trace: z27.array(AgentMessagePartSchema).optional(),
|
|
8168
|
+
diagnostics: z27.array(JsonValueSchema).optional(),
|
|
7993
8169
|
failurePhase: WorkflowAgentFailurePhaseSchema.optional(),
|
|
7994
8170
|
error: AgentRunFailureSchema.optional(),
|
|
7995
|
-
createdAt:
|
|
7996
|
-
});
|
|
7997
|
-
var WorkflowNodeRunSchema =
|
|
7998
|
-
id:
|
|
7999
|
-
projectId:
|
|
8000
|
-
workflowRunId:
|
|
8001
|
-
workflowId:
|
|
8002
|
-
nodeIndex:
|
|
8003
|
-
nodeType:
|
|
8004
|
-
nodeId:
|
|
8005
|
-
nodeKey:
|
|
8006
|
-
status:
|
|
8171
|
+
createdAt: z27.string()
|
|
8172
|
+
});
|
|
8173
|
+
var WorkflowNodeRunSchema = z27.object({
|
|
8174
|
+
id: z27.string(),
|
|
8175
|
+
projectId: z27.string(),
|
|
8176
|
+
workflowRunId: z27.string(),
|
|
8177
|
+
workflowId: z27.string(),
|
|
8178
|
+
nodeIndex: z27.number(),
|
|
8179
|
+
nodeType: z27.enum(["step", "action", "intervention", "agent"]),
|
|
8180
|
+
nodeId: z27.string(),
|
|
8181
|
+
nodeKey: z27.string(),
|
|
8182
|
+
status: z27.enum(["running", "waiting", "succeeded", "failed", "cancelled"]),
|
|
8007
8183
|
input: WorkflowIOSnapshotSchema,
|
|
8008
|
-
startedAt:
|
|
8009
|
-
finishedAt:
|
|
8184
|
+
startedAt: z27.string(),
|
|
8185
|
+
finishedAt: z27.string().optional(),
|
|
8010
8186
|
output: WorkflowIOSnapshotSchema.optional(),
|
|
8011
8187
|
error: WorkflowRunFailureSchema.optional(),
|
|
8012
8188
|
agentExecution: WorkflowAgentNodeExecutionSummarySchema.optional()
|
|
8013
8189
|
});
|
|
8014
|
-
var WorkflowInterventionSchema =
|
|
8015
|
-
id:
|
|
8016
|
-
projectId:
|
|
8017
|
-
workflowId:
|
|
8018
|
-
workflowRunId:
|
|
8019
|
-
nodeRunId:
|
|
8020
|
-
nodeIndex:
|
|
8021
|
-
nodeId:
|
|
8022
|
-
nodeKey:
|
|
8023
|
-
interventionId:
|
|
8190
|
+
var WorkflowInterventionSchema = z27.object({
|
|
8191
|
+
id: z27.string(),
|
|
8192
|
+
projectId: z27.string(),
|
|
8193
|
+
workflowId: z27.string(),
|
|
8194
|
+
workflowRunId: z27.string(),
|
|
8195
|
+
nodeRunId: z27.string(),
|
|
8196
|
+
nodeIndex: z27.number(),
|
|
8197
|
+
nodeId: z27.string(),
|
|
8198
|
+
nodeKey: z27.string(),
|
|
8199
|
+
interventionId: z27.string(),
|
|
8024
8200
|
input: WorkflowIOSnapshotSchema,
|
|
8025
8201
|
defaultResponse: WorkflowIOSnapshotSchema,
|
|
8026
8202
|
status: WorkflowInterventionStatusSchema,
|
|
8027
|
-
requestedAt:
|
|
8028
|
-
expiresAt:
|
|
8029
|
-
submittedAt:
|
|
8203
|
+
requestedAt: z27.string(),
|
|
8204
|
+
expiresAt: z27.string().optional(),
|
|
8205
|
+
submittedAt: z27.string().optional(),
|
|
8030
8206
|
submittedBy: WorkflowInterventionActorSchema.optional(),
|
|
8031
8207
|
response: WorkflowIOSnapshotSchema.optional(),
|
|
8032
|
-
cancelledAt:
|
|
8208
|
+
cancelledAt: z27.string().optional(),
|
|
8033
8209
|
cancelledBy: WorkflowInterventionActorSchema.optional(),
|
|
8034
|
-
expiredAt:
|
|
8210
|
+
expiredAt: z27.string().optional()
|
|
8035
8211
|
});
|
|
8036
|
-
var WorkflowSchema =
|
|
8037
|
-
id:
|
|
8212
|
+
var WorkflowSchema = z27.object({
|
|
8213
|
+
id: z27.string(),
|
|
8038
8214
|
input: WorkflowIOSnapshotSchema,
|
|
8039
|
-
triggers:
|
|
8040
|
-
nodes:
|
|
8215
|
+
triggers: z27.array(WorkflowTriggerSchema),
|
|
8216
|
+
nodes: z27.array(WorkflowNodeSchema),
|
|
8041
8217
|
latestRun: WorkflowRunSummarySchema.nullable()
|
|
8042
8218
|
});
|
|
8043
|
-
var WorkflowRunListResponseSchema =
|
|
8044
|
-
runs:
|
|
8045
|
-
hasMore:
|
|
8046
|
-
total:
|
|
8219
|
+
var WorkflowRunListResponseSchema = z27.object({
|
|
8220
|
+
runs: z27.array(WorkflowRunSummarySchema),
|
|
8221
|
+
hasMore: z27.boolean(),
|
|
8222
|
+
total: z27.number()
|
|
8047
8223
|
});
|
|
8048
|
-
var WorkflowRunDetailResponseSchema =
|
|
8224
|
+
var WorkflowRunDetailResponseSchema = z27.object({
|
|
8049
8225
|
run: WorkflowRunDetailSchema,
|
|
8050
|
-
nodes:
|
|
8226
|
+
nodes: z27.array(WorkflowNodeRunSchema)
|
|
8051
8227
|
});
|
|
8052
8228
|
var CancelWorkflowRunResponseSchema = WorkflowRunDetailResponseSchema;
|
|
8053
|
-
var WorkflowInterventionListResponseSchema =
|
|
8054
|
-
interventions:
|
|
8055
|
-
hasMore:
|
|
8056
|
-
total:
|
|
8229
|
+
var WorkflowInterventionListResponseSchema = z27.object({
|
|
8230
|
+
interventions: z27.array(WorkflowInterventionSchema),
|
|
8231
|
+
hasMore: z27.boolean(),
|
|
8232
|
+
total: z27.number()
|
|
8057
8233
|
});
|
|
8058
|
-
var SubmitWorkflowInterventionResponseSchema =
|
|
8234
|
+
var SubmitWorkflowInterventionResponseSchema = z27.object({
|
|
8059
8235
|
intervention: WorkflowInterventionSchema,
|
|
8060
|
-
jobId:
|
|
8236
|
+
jobId: z27.string()
|
|
8061
8237
|
});
|
|
8062
|
-
var CancelWorkflowInterventionResponseSchema =
|
|
8238
|
+
var CancelWorkflowInterventionResponseSchema = z27.object({
|
|
8063
8239
|
intervention: WorkflowInterventionSchema
|
|
8064
8240
|
});
|
|
8065
|
-
var RequestWorkflowRunResponseSchema =
|
|
8066
|
-
runId:
|
|
8067
|
-
jobId:
|
|
8068
|
-
workflowId:
|
|
8069
|
-
queuedAt:
|
|
8241
|
+
var RequestWorkflowRunResponseSchema = z27.object({
|
|
8242
|
+
runId: z27.string(),
|
|
8243
|
+
jobId: z27.string(),
|
|
8244
|
+
workflowId: z27.string(),
|
|
8245
|
+
queuedAt: z27.string()
|
|
8070
8246
|
});
|
|
8071
8247
|
|
|
8072
8248
|
// src/routes/workflows.ts
|
|
8073
8249
|
var WorkflowRunFileContentQuerySchema = FileContentQuerySchema.extend({
|
|
8074
|
-
path:
|
|
8250
|
+
path: z28.string().min(1).regex(/^\/(?:input|output)(?:\/|$)/, "Workflow run file content paths must start with /input/ or /output/")
|
|
8075
8251
|
});
|
|
8076
8252
|
var WorkflowNodeFileContentQuerySchema = FileContentQuerySchema.extend({
|
|
8077
|
-
path:
|
|
8253
|
+
path: z28.string().min(1).regex(/^\/(?:input|output)(?:\/|$)/, "Workflow node file content paths must start with /input/ or /output/")
|
|
8078
8254
|
});
|
|
8079
8255
|
var WorkflowNodeFileContentParamsSchema = WorkflowRunParamsSchema.extend({
|
|
8080
|
-
nodeKey:
|
|
8256
|
+
nodeKey: z28.string().min(1)
|
|
8081
8257
|
});
|
|
8082
8258
|
function serializeWorkflowRunSummary(run) {
|
|
8083
8259
|
return {
|
|
@@ -9119,6 +9295,7 @@ function registerHttpRoutes(app, host, options) {
|
|
|
9119
9295
|
registerFileRoutes(app, host);
|
|
9120
9296
|
registerActionRunRoutes(app, host);
|
|
9121
9297
|
registerAgentRoutes(app, host);
|
|
9298
|
+
registerModelRoutes(app, host);
|
|
9122
9299
|
registerLinkRoutes(app, host);
|
|
9123
9300
|
registerTelemetryRoutes(app, host);
|
|
9124
9301
|
registerEventRoutes(app, host);
|
|
@@ -9280,269 +9457,269 @@ function notFoundResponse() {
|
|
|
9280
9457
|
}
|
|
9281
9458
|
|
|
9282
9459
|
// src/schemas/auth.ts
|
|
9283
|
-
import { z as
|
|
9284
|
-
var AuthInvitationStatusSchema =
|
|
9285
|
-
var AuthGroupOptionSchema =
|
|
9286
|
-
id:
|
|
9287
|
-
label:
|
|
9288
|
-
description:
|
|
9289
|
-
});
|
|
9290
|
-
var AuthInvitationSchema =
|
|
9291
|
-
id:
|
|
9292
|
-
email:
|
|
9293
|
-
groupIds:
|
|
9460
|
+
import { z as z29 } from "zod";
|
|
9461
|
+
var AuthInvitationStatusSchema = z29.enum(["pending", "accepted", "revoked"]);
|
|
9462
|
+
var AuthGroupOptionSchema = z29.object({
|
|
9463
|
+
id: z29.string(),
|
|
9464
|
+
label: z29.string().optional(),
|
|
9465
|
+
description: z29.string().optional()
|
|
9466
|
+
});
|
|
9467
|
+
var AuthInvitationSchema = z29.object({
|
|
9468
|
+
id: z29.string(),
|
|
9469
|
+
email: z29.string(),
|
|
9470
|
+
groupIds: z29.array(z29.string()),
|
|
9294
9471
|
status: AuthInvitationStatusSchema,
|
|
9295
|
-
createdAt:
|
|
9296
|
-
updatedAt:
|
|
9297
|
-
expiresAt:
|
|
9298
|
-
acceptedAt:
|
|
9299
|
-
revokedAt:
|
|
9472
|
+
createdAt: z29.string(),
|
|
9473
|
+
updatedAt: z29.string(),
|
|
9474
|
+
expiresAt: z29.string(),
|
|
9475
|
+
acceptedAt: z29.string().optional(),
|
|
9476
|
+
revokedAt: z29.string().optional()
|
|
9300
9477
|
});
|
|
9301
|
-
var AuthInvitationDeliverySchema =
|
|
9302
|
-
status:
|
|
9478
|
+
var AuthInvitationDeliverySchema = z29.object({
|
|
9479
|
+
status: z29.enum(["sent", "skipped", "rate_limited", "not_supported"])
|
|
9303
9480
|
});
|
|
9304
9481
|
var AuthInvitationGroupOptionSchema = AuthGroupOptionSchema;
|
|
9305
|
-
var AuthAccessTokenKindSchema =
|
|
9306
|
-
var AuthAccessTokenSubjectTypeSchema =
|
|
9307
|
-
var AuthAccessTokenStatusSchema =
|
|
9308
|
-
var AuthServiceAccountStatusSchema =
|
|
9309
|
-
var AuthUserStatusSchema =
|
|
9310
|
-
var AuthAccessTokenSchema =
|
|
9311
|
-
id:
|
|
9312
|
-
name:
|
|
9482
|
+
var AuthAccessTokenKindSchema = z29.enum(["personal", "serviceAccount"]);
|
|
9483
|
+
var AuthAccessTokenSubjectTypeSchema = z29.enum(["user", "serviceAccount"]);
|
|
9484
|
+
var AuthAccessTokenStatusSchema = z29.enum(["active", "expired", "revoked"]);
|
|
9485
|
+
var AuthServiceAccountStatusSchema = z29.enum(["active", "suspended"]);
|
|
9486
|
+
var AuthUserStatusSchema = z29.enum(["active", "suspended"]);
|
|
9487
|
+
var AuthAccessTokenSchema = z29.object({
|
|
9488
|
+
id: z29.string(),
|
|
9489
|
+
name: z29.string(),
|
|
9313
9490
|
kind: AuthAccessTokenKindSchema,
|
|
9314
9491
|
status: AuthAccessTokenStatusSchema,
|
|
9315
9492
|
subjectType: AuthAccessTokenSubjectTypeSchema,
|
|
9316
|
-
subjectId:
|
|
9317
|
-
subjectLabel:
|
|
9318
|
-
groupIds:
|
|
9319
|
-
createdAt:
|
|
9320
|
-
expiresAt:
|
|
9321
|
-
revokedAt:
|
|
9322
|
-
lastUsedAt:
|
|
9323
|
-
lastUsedUserAgent:
|
|
9324
|
-
lastUsedIpAddress:
|
|
9325
|
-
});
|
|
9326
|
-
var AuthServiceAccountSchema =
|
|
9327
|
-
id:
|
|
9328
|
-
name:
|
|
9329
|
-
description:
|
|
9493
|
+
subjectId: z29.string(),
|
|
9494
|
+
subjectLabel: z29.string().optional(),
|
|
9495
|
+
groupIds: z29.array(z29.string()).optional(),
|
|
9496
|
+
createdAt: z29.string(),
|
|
9497
|
+
expiresAt: z29.string(),
|
|
9498
|
+
revokedAt: z29.string().optional(),
|
|
9499
|
+
lastUsedAt: z29.string().optional(),
|
|
9500
|
+
lastUsedUserAgent: z29.string().optional(),
|
|
9501
|
+
lastUsedIpAddress: z29.string().optional()
|
|
9502
|
+
});
|
|
9503
|
+
var AuthServiceAccountSchema = z29.object({
|
|
9504
|
+
id: z29.string(),
|
|
9505
|
+
name: z29.string(),
|
|
9506
|
+
description: z29.string().optional(),
|
|
9330
9507
|
status: AuthServiceAccountStatusSchema,
|
|
9331
|
-
groupIds:
|
|
9332
|
-
createdAt:
|
|
9333
|
-
updatedAt:
|
|
9334
|
-
});
|
|
9335
|
-
var AuthMemberUserSchema =
|
|
9336
|
-
id:
|
|
9337
|
-
email:
|
|
9338
|
-
displayName:
|
|
9339
|
-
avatarUrl:
|
|
9508
|
+
groupIds: z29.array(z29.string()),
|
|
9509
|
+
createdAt: z29.string(),
|
|
9510
|
+
updatedAt: z29.string()
|
|
9511
|
+
});
|
|
9512
|
+
var AuthMemberUserSchema = z29.object({
|
|
9513
|
+
id: z29.string(),
|
|
9514
|
+
email: z29.string(),
|
|
9515
|
+
displayName: z29.string().optional(),
|
|
9516
|
+
avatarUrl: z29.string().optional(),
|
|
9340
9517
|
status: AuthUserStatusSchema,
|
|
9341
|
-
createdAt:
|
|
9342
|
-
updatedAt:
|
|
9518
|
+
createdAt: z29.string(),
|
|
9519
|
+
updatedAt: z29.string()
|
|
9343
9520
|
});
|
|
9344
|
-
var AuthManagedMemberSchema =
|
|
9521
|
+
var AuthManagedMemberSchema = z29.object({
|
|
9345
9522
|
user: AuthMemberUserSchema,
|
|
9346
|
-
groupIds:
|
|
9523
|
+
groupIds: z29.array(z29.string())
|
|
9347
9524
|
});
|
|
9348
|
-
var AuthMemberCapabilitiesSchema =
|
|
9349
|
-
assignGroups:
|
|
9350
|
-
suspend:
|
|
9351
|
-
reactivate:
|
|
9525
|
+
var AuthMemberCapabilitiesSchema = z29.object({
|
|
9526
|
+
assignGroups: z29.boolean(),
|
|
9527
|
+
suspend: z29.boolean(),
|
|
9528
|
+
reactivate: z29.boolean()
|
|
9352
9529
|
});
|
|
9353
9530
|
var AuthMemberSchema = AuthManagedMemberSchema.extend({
|
|
9354
9531
|
capabilities: AuthMemberCapabilitiesSchema
|
|
9355
9532
|
});
|
|
9356
|
-
var GetAuthAccessManagementOptionsResponseSchema =
|
|
9357
|
-
groups:
|
|
9533
|
+
var GetAuthAccessManagementOptionsResponseSchema = z29.object({
|
|
9534
|
+
groups: z29.array(AuthGroupOptionSchema)
|
|
9358
9535
|
});
|
|
9359
|
-
var ListAuthAccessTokensResponseSchema =
|
|
9360
|
-
accessTokens:
|
|
9536
|
+
var ListAuthAccessTokensResponseSchema = z29.object({
|
|
9537
|
+
accessTokens: z29.array(AuthAccessTokenSchema)
|
|
9361
9538
|
});
|
|
9362
|
-
var CreateAuthPersonalAccessTokenBodySchema =
|
|
9363
|
-
name:
|
|
9364
|
-
expiresAt:
|
|
9365
|
-
groupIds:
|
|
9539
|
+
var CreateAuthPersonalAccessTokenBodySchema = z29.object({
|
|
9540
|
+
name: z29.string().trim().min(1),
|
|
9541
|
+
expiresAt: z29.string().min(1),
|
|
9542
|
+
groupIds: z29.array(z29.string().min(1)).optional()
|
|
9366
9543
|
});
|
|
9367
|
-
var CreateAuthPersonalAccessTokenResponseSchema =
|
|
9544
|
+
var CreateAuthPersonalAccessTokenResponseSchema = z29.object({
|
|
9368
9545
|
accessToken: AuthAccessTokenSchema,
|
|
9369
|
-
tokenValue:
|
|
9546
|
+
tokenValue: z29.string()
|
|
9370
9547
|
});
|
|
9371
|
-
var RevokeAuthAccessTokenParamsSchema =
|
|
9372
|
-
tokenId:
|
|
9548
|
+
var RevokeAuthAccessTokenParamsSchema = z29.object({
|
|
9549
|
+
tokenId: z29.string().min(1)
|
|
9373
9550
|
});
|
|
9374
|
-
var RevokeAuthAccessTokenResponseSchema =
|
|
9551
|
+
var RevokeAuthAccessTokenResponseSchema = z29.object({
|
|
9375
9552
|
accessToken: AuthAccessTokenSchema
|
|
9376
9553
|
});
|
|
9377
|
-
var ListAuthServiceAccountsResponseSchema =
|
|
9378
|
-
serviceAccounts:
|
|
9554
|
+
var ListAuthServiceAccountsResponseSchema = z29.object({
|
|
9555
|
+
serviceAccounts: z29.array(AuthServiceAccountSchema)
|
|
9379
9556
|
});
|
|
9380
|
-
var CreateAuthServiceAccountBodySchema =
|
|
9381
|
-
id:
|
|
9382
|
-
name:
|
|
9383
|
-
description:
|
|
9384
|
-
groupIds:
|
|
9557
|
+
var CreateAuthServiceAccountBodySchema = z29.object({
|
|
9558
|
+
id: z29.string().trim().min(1).optional(),
|
|
9559
|
+
name: z29.string().trim().min(1),
|
|
9560
|
+
description: z29.string().trim().optional(),
|
|
9561
|
+
groupIds: z29.array(z29.string().min(1)).optional()
|
|
9385
9562
|
});
|
|
9386
|
-
var CreateAuthServiceAccountResponseSchema =
|
|
9563
|
+
var CreateAuthServiceAccountResponseSchema = z29.object({
|
|
9387
9564
|
serviceAccount: AuthServiceAccountSchema
|
|
9388
9565
|
});
|
|
9389
|
-
var AuthServiceAccountParamsSchema =
|
|
9390
|
-
serviceAccountId:
|
|
9566
|
+
var AuthServiceAccountParamsSchema = z29.object({
|
|
9567
|
+
serviceAccountId: z29.string().min(1)
|
|
9391
9568
|
});
|
|
9392
|
-
var DisableAuthServiceAccountResponseSchema =
|
|
9569
|
+
var DisableAuthServiceAccountResponseSchema = z29.object({
|
|
9393
9570
|
serviceAccount: AuthServiceAccountSchema
|
|
9394
9571
|
});
|
|
9395
|
-
var ListAuthServiceAccountAccessTokensResponseSchema =
|
|
9396
|
-
accessTokens:
|
|
9572
|
+
var ListAuthServiceAccountAccessTokensResponseSchema = z29.object({
|
|
9573
|
+
accessTokens: z29.array(AuthAccessTokenSchema)
|
|
9397
9574
|
});
|
|
9398
|
-
var CreateAuthServiceAccountAccessTokenBodySchema =
|
|
9399
|
-
name:
|
|
9400
|
-
expiresAt:
|
|
9401
|
-
groupIds:
|
|
9575
|
+
var CreateAuthServiceAccountAccessTokenBodySchema = z29.object({
|
|
9576
|
+
name: z29.string().trim().min(1),
|
|
9577
|
+
expiresAt: z29.string().min(1),
|
|
9578
|
+
groupIds: z29.array(z29.string().min(1)).optional()
|
|
9402
9579
|
});
|
|
9403
|
-
var CreateAuthServiceAccountAccessTokenResponseSchema =
|
|
9580
|
+
var CreateAuthServiceAccountAccessTokenResponseSchema = z29.object({
|
|
9404
9581
|
accessToken: AuthAccessTokenSchema,
|
|
9405
|
-
tokenValue:
|
|
9582
|
+
tokenValue: z29.string()
|
|
9406
9583
|
});
|
|
9407
9584
|
var RevokeAuthServiceAccountAccessTokenParamsSchema = AuthServiceAccountParamsSchema.extend({
|
|
9408
|
-
tokenId:
|
|
9585
|
+
tokenId: z29.string().min(1)
|
|
9409
9586
|
});
|
|
9410
|
-
var RevokeAuthServiceAccountAccessTokenResponseSchema =
|
|
9587
|
+
var RevokeAuthServiceAccountAccessTokenResponseSchema = z29.object({
|
|
9411
9588
|
accessToken: AuthAccessTokenSchema
|
|
9412
9589
|
});
|
|
9413
|
-
var AuthCreateInvitationCapabilitySchema =
|
|
9414
|
-
|
|
9415
|
-
state:
|
|
9590
|
+
var AuthCreateInvitationCapabilitySchema = z29.union([
|
|
9591
|
+
z29.object({
|
|
9592
|
+
state: z29.literal("enabled")
|
|
9416
9593
|
}),
|
|
9417
|
-
|
|
9418
|
-
state:
|
|
9419
|
-
reason:
|
|
9594
|
+
z29.object({
|
|
9595
|
+
state: z29.literal("disabled"),
|
|
9596
|
+
reason: z29.enum(["missing_membership_policy", "invitation_delivery_not_supported"])
|
|
9420
9597
|
})
|
|
9421
9598
|
]);
|
|
9422
|
-
var AuthInvitationDestinationSchema =
|
|
9423
|
-
id:
|
|
9424
|
-
label:
|
|
9425
|
-
});
|
|
9426
|
-
var GetAuthInvitationOptionsResponseSchema =
|
|
9427
|
-
groups:
|
|
9428
|
-
destinations:
|
|
9429
|
-
defaultDestinationId:
|
|
9430
|
-
canInviteWithoutGroups:
|
|
9431
|
-
capabilities:
|
|
9599
|
+
var AuthInvitationDestinationSchema = z29.object({
|
|
9600
|
+
id: z29.enum(["atlas", "app"]),
|
|
9601
|
+
label: z29.string()
|
|
9602
|
+
});
|
|
9603
|
+
var GetAuthInvitationOptionsResponseSchema = z29.object({
|
|
9604
|
+
groups: z29.array(AuthInvitationGroupOptionSchema),
|
|
9605
|
+
destinations: z29.array(AuthInvitationDestinationSchema),
|
|
9606
|
+
defaultDestinationId: z29.enum(["atlas", "app"]).optional(),
|
|
9607
|
+
canInviteWithoutGroups: z29.boolean(),
|
|
9608
|
+
capabilities: z29.object({
|
|
9432
9609
|
createInvitation: AuthCreateInvitationCapabilitySchema
|
|
9433
9610
|
})
|
|
9434
9611
|
});
|
|
9435
|
-
var GetAuthMembershipOptionsResponseSchema =
|
|
9436
|
-
groups:
|
|
9437
|
-
capabilities:
|
|
9438
|
-
invite:
|
|
9439
|
-
assignGroups:
|
|
9440
|
-
suspend:
|
|
9612
|
+
var GetAuthMembershipOptionsResponseSchema = z29.object({
|
|
9613
|
+
groups: z29.array(AuthGroupOptionSchema),
|
|
9614
|
+
capabilities: z29.object({
|
|
9615
|
+
invite: z29.boolean(),
|
|
9616
|
+
assignGroups: z29.boolean(),
|
|
9617
|
+
suspend: z29.boolean()
|
|
9441
9618
|
})
|
|
9442
9619
|
});
|
|
9443
|
-
var ListAuthMembersQuerySchema =
|
|
9444
|
-
limit:
|
|
9445
|
-
offset:
|
|
9446
|
-
order:
|
|
9620
|
+
var ListAuthMembersQuerySchema = z29.object({
|
|
9621
|
+
limit: z29.string().optional(),
|
|
9622
|
+
offset: z29.string().optional(),
|
|
9623
|
+
order: z29.enum(["asc", "desc"]).optional()
|
|
9447
9624
|
});
|
|
9448
|
-
var ListAuthMembersResponseSchema =
|
|
9449
|
-
members:
|
|
9450
|
-
hasMore:
|
|
9451
|
-
total:
|
|
9625
|
+
var ListAuthMembersResponseSchema = z29.object({
|
|
9626
|
+
members: z29.array(AuthMemberSchema),
|
|
9627
|
+
hasMore: z29.boolean(),
|
|
9628
|
+
total: z29.number()
|
|
9452
9629
|
});
|
|
9453
|
-
var AuthMemberParamsSchema =
|
|
9454
|
-
userId:
|
|
9630
|
+
var AuthMemberParamsSchema = z29.object({
|
|
9631
|
+
userId: z29.string().min(1)
|
|
9455
9632
|
});
|
|
9456
|
-
var UpdateAuthMemberGroupsBodySchema =
|
|
9457
|
-
groupIds:
|
|
9633
|
+
var UpdateAuthMemberGroupsBodySchema = z29.object({
|
|
9634
|
+
groupIds: z29.array(z29.string().min(1))
|
|
9458
9635
|
});
|
|
9459
|
-
var UpdateAuthMemberGroupsResponseSchema =
|
|
9636
|
+
var UpdateAuthMemberGroupsResponseSchema = z29.object({
|
|
9460
9637
|
member: AuthManagedMemberSchema
|
|
9461
9638
|
});
|
|
9462
|
-
var SuspendAuthMemberResponseSchema =
|
|
9639
|
+
var SuspendAuthMemberResponseSchema = z29.object({
|
|
9463
9640
|
member: AuthManagedMemberSchema
|
|
9464
9641
|
});
|
|
9465
|
-
var ReactivateAuthMemberResponseSchema =
|
|
9642
|
+
var ReactivateAuthMemberResponseSchema = z29.object({
|
|
9466
9643
|
member: AuthManagedMemberSchema
|
|
9467
9644
|
});
|
|
9468
|
-
var CreateAuthInvitationBodySchema =
|
|
9469
|
-
email:
|
|
9470
|
-
groupIds:
|
|
9471
|
-
destinationId:
|
|
9472
|
-
expiresAt:
|
|
9473
|
-
returnTo:
|
|
9645
|
+
var CreateAuthInvitationBodySchema = z29.object({
|
|
9646
|
+
email: z29.string().min(1),
|
|
9647
|
+
groupIds: z29.array(z29.string().min(1)).optional(),
|
|
9648
|
+
destinationId: z29.enum(["atlas", "app"]).optional(),
|
|
9649
|
+
expiresAt: z29.string().optional(),
|
|
9650
|
+
returnTo: z29.string().optional()
|
|
9474
9651
|
});
|
|
9475
|
-
var CreateAuthInvitationResponseSchema =
|
|
9652
|
+
var CreateAuthInvitationResponseSchema = z29.object({
|
|
9476
9653
|
invitation: AuthInvitationSchema,
|
|
9477
9654
|
delivery: AuthInvitationDeliverySchema
|
|
9478
9655
|
});
|
|
9479
|
-
var ListAuthInvitationsQuerySchema =
|
|
9480
|
-
email:
|
|
9656
|
+
var ListAuthInvitationsQuerySchema = z29.object({
|
|
9657
|
+
email: z29.string().optional(),
|
|
9481
9658
|
status: AuthInvitationStatusSchema.optional(),
|
|
9482
|
-
limit:
|
|
9483
|
-
offset:
|
|
9484
|
-
order:
|
|
9659
|
+
limit: z29.string().optional(),
|
|
9660
|
+
offset: z29.string().optional(),
|
|
9661
|
+
order: z29.enum(["asc", "desc"]).optional()
|
|
9485
9662
|
});
|
|
9486
|
-
var ListAuthInvitationsResponseSchema =
|
|
9487
|
-
invitations:
|
|
9488
|
-
hasMore:
|
|
9489
|
-
total:
|
|
9663
|
+
var ListAuthInvitationsResponseSchema = z29.object({
|
|
9664
|
+
invitations: z29.array(AuthInvitationSchema),
|
|
9665
|
+
hasMore: z29.boolean(),
|
|
9666
|
+
total: z29.number()
|
|
9490
9667
|
});
|
|
9491
|
-
var RevokeAuthInvitationParamsSchema =
|
|
9492
|
-
invitationId:
|
|
9668
|
+
var RevokeAuthInvitationParamsSchema = z29.object({
|
|
9669
|
+
invitationId: z29.string().min(1)
|
|
9493
9670
|
});
|
|
9494
|
-
var RevokeAuthInvitationResponseSchema =
|
|
9671
|
+
var RevokeAuthInvitationResponseSchema = z29.object({
|
|
9495
9672
|
invitation: AuthInvitationSchema
|
|
9496
9673
|
});
|
|
9497
|
-
var AuthSessionResponseSchema =
|
|
9498
|
-
|
|
9499
|
-
authenticated:
|
|
9674
|
+
var AuthSessionResponseSchema = z29.union([
|
|
9675
|
+
z29.object({
|
|
9676
|
+
authenticated: z29.literal(false)
|
|
9500
9677
|
}),
|
|
9501
|
-
|
|
9502
|
-
authenticated:
|
|
9503
|
-
csrfToken:
|
|
9504
|
-
applicationAccess:
|
|
9505
|
-
allowed:
|
|
9506
|
-
audience:
|
|
9678
|
+
z29.object({
|
|
9679
|
+
authenticated: z29.literal(true),
|
|
9680
|
+
csrfToken: z29.string(),
|
|
9681
|
+
applicationAccess: z29.object({
|
|
9682
|
+
allowed: z29.boolean(),
|
|
9683
|
+
audience: z29.enum(["atlas", "app"])
|
|
9507
9684
|
}),
|
|
9508
|
-
user:
|
|
9509
|
-
id:
|
|
9510
|
-
email:
|
|
9511
|
-
displayName:
|
|
9512
|
-
avatarUrl:
|
|
9513
|
-
groupIds:
|
|
9685
|
+
user: z29.object({
|
|
9686
|
+
id: z29.string(),
|
|
9687
|
+
email: z29.string(),
|
|
9688
|
+
displayName: z29.string().optional(),
|
|
9689
|
+
avatarUrl: z29.string().optional(),
|
|
9690
|
+
groupIds: z29.array(z29.string())
|
|
9514
9691
|
}),
|
|
9515
|
-
session:
|
|
9516
|
-
id:
|
|
9517
|
-
expiresAt:
|
|
9692
|
+
session: z29.object({
|
|
9693
|
+
id: z29.string(),
|
|
9694
|
+
expiresAt: z29.string()
|
|
9518
9695
|
})
|
|
9519
9696
|
})
|
|
9520
9697
|
]);
|
|
9521
|
-
var AuthSignOutResponseSchema =
|
|
9522
|
-
success:
|
|
9698
|
+
var AuthSignOutResponseSchema = z29.object({
|
|
9699
|
+
success: z29.boolean()
|
|
9523
9700
|
});
|
|
9524
|
-
var AuthSessionSummarySchema =
|
|
9525
|
-
id:
|
|
9526
|
-
audience:
|
|
9527
|
-
current:
|
|
9528
|
-
createdAt:
|
|
9529
|
-
expiresAt:
|
|
9530
|
-
lastSeenAt:
|
|
9531
|
-
userAgent:
|
|
9532
|
-
ipAddress:
|
|
9701
|
+
var AuthSessionSummarySchema = z29.object({
|
|
9702
|
+
id: z29.string(),
|
|
9703
|
+
audience: z29.enum(["atlas", "app"]),
|
|
9704
|
+
current: z29.boolean(),
|
|
9705
|
+
createdAt: z29.string(),
|
|
9706
|
+
expiresAt: z29.string(),
|
|
9707
|
+
lastSeenAt: z29.string().optional(),
|
|
9708
|
+
userAgent: z29.string().optional(),
|
|
9709
|
+
ipAddress: z29.string().optional()
|
|
9533
9710
|
});
|
|
9534
|
-
var ListAuthSessionsResponseSchema =
|
|
9535
|
-
sessions:
|
|
9711
|
+
var ListAuthSessionsResponseSchema = z29.object({
|
|
9712
|
+
sessions: z29.array(AuthSessionSummarySchema)
|
|
9536
9713
|
});
|
|
9537
|
-
var RevokeAuthSessionParamsSchema =
|
|
9538
|
-
sessionId:
|
|
9714
|
+
var RevokeAuthSessionParamsSchema = z29.object({
|
|
9715
|
+
sessionId: z29.string().min(1)
|
|
9539
9716
|
});
|
|
9540
|
-
var RevokeAuthSessionResponseSchema =
|
|
9541
|
-
success:
|
|
9717
|
+
var RevokeAuthSessionResponseSchema = z29.object({
|
|
9718
|
+
success: z29.boolean()
|
|
9542
9719
|
});
|
|
9543
|
-
var SignOutAllResponseSchema =
|
|
9544
|
-
success:
|
|
9545
|
-
revokedCount:
|
|
9720
|
+
var SignOutAllResponseSchema = z29.object({
|
|
9721
|
+
success: z29.boolean(),
|
|
9722
|
+
revokedCount: z29.number()
|
|
9546
9723
|
});
|
|
9547
9724
|
|
|
9548
9725
|
// src/routes/auth.ts
|
|
@@ -11424,7 +11601,7 @@ import {
|
|
|
11424
11601
|
isAgentRunActivityEvent
|
|
11425
11602
|
} from "@sixb/core/agents/streams";
|
|
11426
11603
|
import { BrokerCursorExpiredError } from "@sixb/core/broker";
|
|
11427
|
-
import { z as
|
|
11604
|
+
import { z as z30 } from "zod";
|
|
11428
11605
|
|
|
11429
11606
|
// src/utils/ws.ts
|
|
11430
11607
|
function safeSend(target, payload) {
|
|
@@ -11472,25 +11649,25 @@ async function decodeWsMessage(message) {
|
|
|
11472
11649
|
}
|
|
11473
11650
|
|
|
11474
11651
|
// src/routes/ws/agents.ts
|
|
11475
|
-
var SubscribeSchema =
|
|
11476
|
-
type:
|
|
11477
|
-
runId:
|
|
11478
|
-
afterCursor:
|
|
11652
|
+
var SubscribeSchema = z30.object({
|
|
11653
|
+
type: z30.literal("subscribe"),
|
|
11654
|
+
runId: z30.string().min(1),
|
|
11655
|
+
afterCursor: z30.string().min(1).optional()
|
|
11479
11656
|
});
|
|
11480
|
-
var SubscribeActivitySchema =
|
|
11481
|
-
type:
|
|
11657
|
+
var SubscribeActivitySchema = z30.object({
|
|
11658
|
+
type: z30.literal("subscribe.activity")
|
|
11482
11659
|
});
|
|
11483
|
-
var ReplaySchema =
|
|
11484
|
-
type:
|
|
11485
|
-
runId:
|
|
11486
|
-
afterCursor:
|
|
11487
|
-
limit:
|
|
11660
|
+
var ReplaySchema = z30.object({
|
|
11661
|
+
type: z30.literal("replay"),
|
|
11662
|
+
runId: z30.string().min(1),
|
|
11663
|
+
afterCursor: z30.string().min(1).optional(),
|
|
11664
|
+
limit: z30.number().int().positive().max(500).optional()
|
|
11488
11665
|
});
|
|
11489
|
-
var UnsubscribeSchema =
|
|
11490
|
-
type:
|
|
11491
|
-
runId:
|
|
11666
|
+
var UnsubscribeSchema = z30.object({
|
|
11667
|
+
type: z30.literal("unsubscribe"),
|
|
11668
|
+
runId: z30.string().min(1).optional()
|
|
11492
11669
|
});
|
|
11493
|
-
var AgentStreamMessageSchema =
|
|
11670
|
+
var AgentStreamMessageSchema = z30.union([
|
|
11494
11671
|
SubscribeSchema,
|
|
11495
11672
|
SubscribeActivitySchema,
|
|
11496
11673
|
ReplaySchema,
|
|
@@ -11776,22 +11953,22 @@ function errorMessage(error) {
|
|
|
11776
11953
|
|
|
11777
11954
|
// src/routes/ws/events.ts
|
|
11778
11955
|
import { scopeKeysForEvent } from "@sixb/core/events/scope";
|
|
11779
|
-
import { z as
|
|
11780
|
-
var SubscribeSchema2 =
|
|
11781
|
-
type:
|
|
11782
|
-
topic:
|
|
11783
|
-
types:
|
|
11784
|
-
objectTypeId:
|
|
11785
|
-
primaryId:
|
|
11786
|
-
actionId:
|
|
11787
|
-
runId:
|
|
11788
|
-
afterCursor:
|
|
11789
|
-
limit:
|
|
11790
|
-
});
|
|
11791
|
-
var UnsubscribeSchema2 =
|
|
11792
|
-
type:
|
|
11793
|
-
});
|
|
11794
|
-
var SubscriptionMessageSchema =
|
|
11956
|
+
import { z as z31 } from "zod";
|
|
11957
|
+
var SubscribeSchema2 = z31.object({
|
|
11958
|
+
type: z31.literal("subscribe"),
|
|
11959
|
+
topic: z31.enum(EVENT_TOPICS).optional(),
|
|
11960
|
+
types: z31.array(z31.enum(EVENT_TYPES)).optional(),
|
|
11961
|
+
objectTypeId: z31.string().optional(),
|
|
11962
|
+
primaryId: z31.string().optional(),
|
|
11963
|
+
actionId: z31.string().optional(),
|
|
11964
|
+
runId: z31.string().optional(),
|
|
11965
|
+
afterCursor: z31.string().optional(),
|
|
11966
|
+
limit: z31.number().int().positive().max(500).optional()
|
|
11967
|
+
});
|
|
11968
|
+
var UnsubscribeSchema2 = z31.object({
|
|
11969
|
+
type: z31.literal("unsubscribe")
|
|
11970
|
+
});
|
|
11971
|
+
var SubscriptionMessageSchema = z31.union([SubscribeSchema2, UnsubscribeSchema2]);
|
|
11795
11972
|
function parseSubscriptionMessage(payload) {
|
|
11796
11973
|
if (!payload || typeof payload !== "object") {
|
|
11797
11974
|
return { ok: false, error: "Message must be a JSON object." };
|
|
@@ -11981,7 +12158,7 @@ function eventMatchesScope(event, filter) {
|
|
|
11981
12158
|
}
|
|
11982
12159
|
|
|
11983
12160
|
// src/routes/ws/logs.ts
|
|
11984
|
-
import { z as
|
|
12161
|
+
import { z as z32 } from "zod";
|
|
11985
12162
|
|
|
11986
12163
|
// src/routes/ws/log-subscription-hub.ts
|
|
11987
12164
|
import { BrokerCursorExpiredError as BrokerCursorExpiredError2 } from "@sixb/core/broker";
|
|
@@ -12294,26 +12471,26 @@ function socketBufferedAmount(ws) {
|
|
|
12294
12471
|
}
|
|
12295
12472
|
|
|
12296
12473
|
// src/routes/ws/logs.ts
|
|
12297
|
-
var SubscribeSchema3 =
|
|
12298
|
-
type:
|
|
12299
|
-
kinds:
|
|
12300
|
-
levels:
|
|
12301
|
-
run:
|
|
12302
|
-
kind:
|
|
12474
|
+
var SubscribeSchema3 = z32.object({
|
|
12475
|
+
type: z32.literal("subscribe"),
|
|
12476
|
+
kinds: z32.array(z32.enum(SIXB_RUN_KINDS)).min(1).optional(),
|
|
12477
|
+
levels: z32.array(z32.enum(LOG_LEVELS)).min(1).optional(),
|
|
12478
|
+
run: z32.object({
|
|
12479
|
+
kind: z32.enum(SIXB_RUN_KINDS),
|
|
12303
12480
|
id: LogRunIdSchema
|
|
12304
12481
|
}).optional(),
|
|
12305
|
-
afterCursor:
|
|
12482
|
+
afterCursor: z32.string().optional()
|
|
12306
12483
|
}).superRefine((value, context) => {
|
|
12307
12484
|
if (value.run && value.kinds && !value.kinds.includes(value.run.kind)) {
|
|
12308
12485
|
context.addIssue({
|
|
12309
|
-
code:
|
|
12486
|
+
code: z32.ZodIssueCode.custom,
|
|
12310
12487
|
path: ["run"],
|
|
12311
12488
|
message: "run.kind must be included in kinds"
|
|
12312
12489
|
});
|
|
12313
12490
|
}
|
|
12314
12491
|
});
|
|
12315
|
-
var UnsubscribeSchema3 =
|
|
12316
|
-
var SubscriptionMessageSchema2 =
|
|
12492
|
+
var UnsubscribeSchema3 = z32.object({ type: z32.literal("unsubscribe") });
|
|
12493
|
+
var SubscriptionMessageSchema2 = z32.union([SubscribeSchema3, UnsubscribeSchema3]);
|
|
12317
12494
|
function parseLogSubscriptionMessage(payload) {
|
|
12318
12495
|
if (!payload || typeof payload !== "object") {
|
|
12319
12496
|
return { ok: false, error: "Message must be a JSON object." };
|
|
@@ -12696,4 +12873,4 @@ export {
|
|
|
12696
12873
|
SixbServer
|
|
12697
12874
|
};
|
|
12698
12875
|
|
|
12699
|
-
//# debugId=
|
|
12876
|
+
//# debugId=7EBA739DF50836F764756E2164756E21
|