@flowmind/cli 0.0.0-stage → 0.1.0
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 +89 -2
- package/dist/flowmind/SKILL.md +169 -0
- package/dist/index.js +4214 -0
- package/package.json +39 -4
package/dist/index.js
ADDED
|
@@ -0,0 +1,4214 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/index.ts
|
|
4
|
+
import { Command as Command9 } from "commander";
|
|
5
|
+
|
|
6
|
+
// src/commands/agent.ts
|
|
7
|
+
import { Command, InvalidArgumentError } from "commander";
|
|
8
|
+
import chalk from "chalk";
|
|
9
|
+
import ora from "ora";
|
|
10
|
+
|
|
11
|
+
// ../../packages/contracts/src/response-errors.ts
|
|
12
|
+
var BridgeError = class extends Error {
|
|
13
|
+
code;
|
|
14
|
+
context;
|
|
15
|
+
constructor(code, context2) {
|
|
16
|
+
super(context2.kind === "api" ? `API request failed (${code})` : context2.kind === "transport" ? "API transport failed" : "API response contract failed");
|
|
17
|
+
this.name = "BridgeError";
|
|
18
|
+
this.code = code;
|
|
19
|
+
this.context = Object.freeze({ ...context2 });
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// src/command-error.ts
|
|
24
|
+
var printCommandError = (action, error, json = false) => {
|
|
25
|
+
let diagnostic;
|
|
26
|
+
if (error instanceof BridgeError) {
|
|
27
|
+
const context2 = error.context;
|
|
28
|
+
const schema = `${context2.schemaId ?? "unavailable"}${context2.schemaPath ?? ""}`;
|
|
29
|
+
diagnostic = `${action} failed: ${error.code} (${context2.kind}); operation=${context2.operation ?? "unavailable"}; stage=${context2.stage ?? "request"}; schema=${schema}; requestId=${context2.requestId ?? "unavailable"}`;
|
|
30
|
+
} else {
|
|
31
|
+
diagnostic = `${action} failed: ${error instanceof Error ? error.message : "Unknown error"}`;
|
|
32
|
+
}
|
|
33
|
+
console.error(json ? JSON.stringify({ error: diagnostic }) : `Error: ${diagnostic}`);
|
|
34
|
+
process.exitCode = 1;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// ../../packages/contracts/src/error-codes.ts
|
|
38
|
+
var ERROR_CODES = {
|
|
39
|
+
BAD_REQUEST: "BAD_REQUEST",
|
|
40
|
+
CONFLICT: "CONFLICT",
|
|
41
|
+
EXPIRED: "EXPIRED",
|
|
42
|
+
FORBIDDEN: "FORBIDDEN",
|
|
43
|
+
INTERNAL_ERROR: "INTERNAL_ERROR",
|
|
44
|
+
INVALID_API_RESPONSE: "INVALID_API_RESPONSE",
|
|
45
|
+
MAX_ACTIVE_JOBS_REACHED: "MAX_ACTIVE_JOBS_REACHED",
|
|
46
|
+
NOT_FOUND: "NOT_FOUND",
|
|
47
|
+
QUOTA_EXCEEDED: "QUOTA_EXCEEDED",
|
|
48
|
+
RATE_LIMIT_EXCEEDED: "RATE_LIMIT_EXCEEDED",
|
|
49
|
+
SERVICE_UNAVAILABLE: "SERVICE_UNAVAILABLE",
|
|
50
|
+
UNDECLARED_API_OPERATION: "UNDECLARED_API_OPERATION",
|
|
51
|
+
UNAUTHENTICATED: "UNAUTHENTICATED",
|
|
52
|
+
VALIDATION_FAILED: "VALIDATION_FAILED"
|
|
53
|
+
};
|
|
54
|
+
var API_ERROR_CODE_VALUES = new Set(Object.values(ERROR_CODES));
|
|
55
|
+
var isApiErrorCode = (value) => API_ERROR_CODE_VALUES.has(value);
|
|
56
|
+
|
|
57
|
+
// ../../packages/contracts/src/headers.ts
|
|
58
|
+
var IDEMPOTENCY_KEY_HEADER = "idempotency-key";
|
|
59
|
+
|
|
60
|
+
// ../../packages/contracts/src/generated/validators/shared/5YWD3P7Y.js
|
|
61
|
+
var c = (b3, a3) => () => (a3 || b3((a3 = { exports: {} }).exports, a3), a3.exports);
|
|
62
|
+
|
|
63
|
+
// ../../packages/contracts/src/generated/validators/shared/2AGKPNBM.js
|
|
64
|
+
var r = c((l6) => {
|
|
65
|
+
"use strict";
|
|
66
|
+
Object.defineProperty(l6, "__esModule", { value: true });
|
|
67
|
+
function d6(u2) {
|
|
68
|
+
let c3 = u2.length, n7 = 0, e3 = 0, t8;
|
|
69
|
+
for (; e3 < c3; ) n7++, t8 = u2.charCodeAt(e3++), t8 >= 55296 && t8 <= 56319 && e3 < c3 && (t8 = u2.charCodeAt(e3), (t8 & 64512) === 56320 && e3++);
|
|
70
|
+
return n7;
|
|
71
|
+
}
|
|
72
|
+
l6.default = d6;
|
|
73
|
+
d6.code = 'require("ajv/dist/runtime/ucs2length").default';
|
|
74
|
+
});
|
|
75
|
+
var o = r().default;
|
|
76
|
+
|
|
77
|
+
// ../../packages/contracts/src/generated/validators/shared/GU3NTZTU.js
|
|
78
|
+
function i(e3, { instancePath: a3 = "", parentData: m5, parentDataProperty: d6, rootData: l6 = e3 } = {}) {
|
|
79
|
+
let p7 = null, s4 = 0;
|
|
80
|
+
if (s4 === 0) if (e3 && typeof e3 == "object" && !Array.isArray(e3)) {
|
|
81
|
+
let o9;
|
|
82
|
+
if (e3.success === void 0 && (o9 = "success") || e3.status === void 0 && (o9 = "status") || e3.message === void 0 && (o9 = "message") || e3.data === void 0 && (o9 = "data") || e3.requestId === void 0 && (o9 = "requestId") || e3.error === void 0 && (o9 = "error") || e3.details === void 0 && (o9 = "details")) return i.errors = [{ instancePath: a3, schemaPath: "#/required", keyword: "required", params: { missingProperty: o9 }, message: "must have required property '" + o9 + "'" }], false;
|
|
83
|
+
{
|
|
84
|
+
let f3 = s4;
|
|
85
|
+
for (let r2 in e3) if (!(r2 === "data" || r2 === "details" || r2 === "error" || r2 === "message" || r2 === "requestId" || r2 === "status" || r2 === "success")) {
|
|
86
|
+
return i.errors = [{ instancePath: a3, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: r2 }, message: "must NOT have additional properties" }], false;
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
if (f3 === s4) {
|
|
90
|
+
if (e3.error !== void 0) {
|
|
91
|
+
let r2 = e3.error, n7 = s4;
|
|
92
|
+
if (typeof r2 != "string" && r2 !== null) return i.errors = [{ instancePath: a3 + "/error", schemaPath: "#/properties/error/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
93
|
+
var t8 = n7 === s4;
|
|
94
|
+
} else var t8 = true;
|
|
95
|
+
if (t8) {
|
|
96
|
+
if (e3.message !== void 0) {
|
|
97
|
+
let r2 = s4;
|
|
98
|
+
if (typeof e3.message != "string") return i.errors = [{ instancePath: a3 + "/message", schemaPath: "#/properties/message/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
99
|
+
var t8 = r2 === s4;
|
|
100
|
+
} else var t8 = true;
|
|
101
|
+
if (t8) {
|
|
102
|
+
if (e3.requestId !== void 0) {
|
|
103
|
+
let r2 = e3.requestId, n7 = s4;
|
|
104
|
+
if (s4 === n7) if (typeof r2 == "string") {
|
|
105
|
+
if (o(r2) < 1) return i.errors = [{ instancePath: a3 + "/requestId", schemaPath: "#/properties/requestId/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }], false;
|
|
106
|
+
} else return i.errors = [{ instancePath: a3 + "/requestId", schemaPath: "#/properties/requestId/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
107
|
+
var t8 = n7 === s4;
|
|
108
|
+
} else var t8 = true;
|
|
109
|
+
if (t8) {
|
|
110
|
+
if (e3.status !== void 0) {
|
|
111
|
+
let r2 = e3.status, n7 = s4;
|
|
112
|
+
if (!(typeof r2 == "number" && isFinite(r2))) return i.errors = [{ instancePath: a3 + "/status", schemaPath: "#/properties/status/type", keyword: "type", params: { type: "number" }, message: "must be number" }], false;
|
|
113
|
+
var t8 = n7 === s4;
|
|
114
|
+
} else var t8 = true;
|
|
115
|
+
if (t8) if (e3.success !== void 0) {
|
|
116
|
+
let r2 = s4;
|
|
117
|
+
if (typeof e3.success != "boolean") return i.errors = [{ instancePath: a3 + "/success", schemaPath: "#/properties/success/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }], false;
|
|
118
|
+
var t8 = r2 === s4;
|
|
119
|
+
} else var t8 = true;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
} else return i.errors = [{ instancePath: a3, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
126
|
+
return i.errors = p7, s4 === 0;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// ../../packages/contracts/src/generated/validators/envelope.js
|
|
130
|
+
var t = i;
|
|
131
|
+
|
|
132
|
+
// ../../packages/contracts/src/response-decoder.ts
|
|
133
|
+
var uuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
134
|
+
var buildSha = /^[0-9a-f]{7,40}$/i;
|
|
135
|
+
var envelopeKeys = /* @__PURE__ */ new Set(["success", "status", "message", "data", "requestId", "error", "details"]);
|
|
136
|
+
var privatePath = (path) => path.split("/").map((part, index) => index === 0 ? "" : index === 1 && envelopeKeys.has(part) ? part : "*").join("/");
|
|
137
|
+
var context = (endpoint, response) => ({
|
|
138
|
+
kind: "contract",
|
|
139
|
+
operation: endpoint?.operation ?? null,
|
|
140
|
+
endpoint: endpoint?.path ?? null,
|
|
141
|
+
status: response?.status ?? null,
|
|
142
|
+
stage: null,
|
|
143
|
+
schemaId: null,
|
|
144
|
+
schemaPath: null,
|
|
145
|
+
instancePath: null,
|
|
146
|
+
keyword: null,
|
|
147
|
+
requestId: null,
|
|
148
|
+
contractRevision: endpoint?.revision ?? null,
|
|
149
|
+
apiBuild: response && buildSha.test(response.headers.get("x-flowmind-commit") ?? "") ? response.headers.get("x-flowmind-commit") : null
|
|
150
|
+
});
|
|
151
|
+
var requireEndpoint = (endpoint) => {
|
|
152
|
+
if (!endpoint) throw new BridgeError(ERROR_CODES.UNDECLARED_API_OPERATION, context(void 0));
|
|
153
|
+
return endpoint;
|
|
154
|
+
};
|
|
155
|
+
var decodeResponse = async (descriptor, response) => {
|
|
156
|
+
const endpoint = requireEndpoint(descriptor);
|
|
157
|
+
let base = context(endpoint, response);
|
|
158
|
+
const fail = (stage, contract2, issue, kind = "contract") => {
|
|
159
|
+
throw new BridgeError(ERROR_CODES.INVALID_API_RESPONSE, {
|
|
160
|
+
...base,
|
|
161
|
+
kind,
|
|
162
|
+
stage,
|
|
163
|
+
schemaId: contract2?.schemaId ?? (stage === "envelope" ? "ResponseEnvelope" : null),
|
|
164
|
+
schemaPath: issue?.schemaPath ?? null,
|
|
165
|
+
instancePath: issue ? privatePath(issue.instancePath) : null,
|
|
166
|
+
keyword: issue?.keyword ?? null
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
const success = response.status >= 200 && response.status < 300;
|
|
170
|
+
const contract = success ? endpoint.responses[response.status] : endpoint.error;
|
|
171
|
+
if (!contract) return fail("status");
|
|
172
|
+
const media = response.headers.get("content-type")?.split(";", 1)[0]?.trim().toLowerCase();
|
|
173
|
+
if (media !== contract.mediaType) return fail("media-type", contract);
|
|
174
|
+
let text;
|
|
175
|
+
try {
|
|
176
|
+
text = await response.text();
|
|
177
|
+
} catch {
|
|
178
|
+
return fail("json", contract, void 0, "transport");
|
|
179
|
+
}
|
|
180
|
+
if (media !== "application/json") {
|
|
181
|
+
if (!contract.validate(text)) return fail("payload", contract, contract.validate.errors?.[0]);
|
|
182
|
+
return text;
|
|
183
|
+
}
|
|
184
|
+
let value;
|
|
185
|
+
try {
|
|
186
|
+
value = JSON.parse(text);
|
|
187
|
+
} catch {
|
|
188
|
+
return fail("json", contract);
|
|
189
|
+
}
|
|
190
|
+
if (!t(value)) return fail("envelope", void 0, t.errors?.[0]);
|
|
191
|
+
const result = value;
|
|
192
|
+
if (!Number.isInteger(result.status) || result.error !== null && !isApiErrorCode(result.error) || (result.success ? result.error !== null : result.data !== null || result.error === null)) return fail("envelope");
|
|
193
|
+
base = { ...base, requestId: uuid.test(result.requestId) ? result.requestId : null };
|
|
194
|
+
if (result.status !== response.status || result.success !== success) return fail("status", contract);
|
|
195
|
+
if (!contract.validate(value)) return fail(success ? "payload" : "envelope", contract, contract.validate.errors?.[0]);
|
|
196
|
+
if (!success) {
|
|
197
|
+
throw new BridgeError(result.error, { ...base, kind: "api", stage: "status", schemaId: contract.schemaId });
|
|
198
|
+
}
|
|
199
|
+
return result.data;
|
|
200
|
+
};
|
|
201
|
+
var requestEndpoint = async (descriptor, origin, args, options = {}) => {
|
|
202
|
+
const endpoint = requireEndpoint(descriptor);
|
|
203
|
+
const params = args.params;
|
|
204
|
+
const query = args.query;
|
|
205
|
+
const path = endpoint.path.replace(/\{([^}]+)\}/g, (_match, name) => {
|
|
206
|
+
const value = params?.[name];
|
|
207
|
+
if (value === void 0) throw new TypeError("Required endpoint path parameter is missing");
|
|
208
|
+
return encodeURIComponent(String(value));
|
|
209
|
+
});
|
|
210
|
+
const url = new URL(path, origin);
|
|
211
|
+
for (const [key, value] of Object.entries(query ?? {})) {
|
|
212
|
+
if (value === void 0) continue;
|
|
213
|
+
for (const item of Array.isArray(value) ? value : [value]) url.searchParams.append(key, String(item));
|
|
214
|
+
}
|
|
215
|
+
const headers = new Headers(options.headers);
|
|
216
|
+
if (args.body !== void 0) headers.set("content-type", "application/json");
|
|
217
|
+
let response;
|
|
218
|
+
try {
|
|
219
|
+
response = await (options.fetch ?? globalThis.fetch)(url, {
|
|
220
|
+
method: endpoint.method,
|
|
221
|
+
headers,
|
|
222
|
+
...args.body !== void 0 ? { body: JSON.stringify(args.body) } : {},
|
|
223
|
+
...options.signal ? { signal: options.signal } : {},
|
|
224
|
+
...options.cache ? { cache: options.cache } : {}
|
|
225
|
+
});
|
|
226
|
+
} catch {
|
|
227
|
+
throw new BridgeError(ERROR_CODES.INVALID_API_RESPONSE, { ...context(endpoint), kind: "transport" });
|
|
228
|
+
}
|
|
229
|
+
return decodeResponse(endpoint, response);
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
// ../../packages/contracts/src/generated/revision.ts
|
|
233
|
+
var contractRevision = "b006d2b0455d50cec08ed42cf3853ac1ddf65fb7ea6ca52fd56538cb28de6d96";
|
|
234
|
+
|
|
235
|
+
// ../../packages/contracts/src/generated/validators/apiError.js
|
|
236
|
+
var m = { additionalProperties: false, properties: { data: { enum: [null], nullable: true, type: "object" }, details: {}, error: { enum: ["BAD_REQUEST", "CONFLICT", "EXPIRED", "FORBIDDEN", "INTERNAL_ERROR", "INVALID_API_RESPONSE", "MAX_ACTIVE_JOBS_REACHED", "NOT_FOUND", "QUOTA_EXCEEDED", "RATE_LIMIT_EXCEEDED", "SERVICE_UNAVAILABLE", "UNDECLARED_API_OPERATION", "UNAUTHENTICATED", "VALIDATION_FAILED"], type: "string" }, message: { type: "string" }, requestId: { minLength: 1, type: "string" }, status: { maximum: 599, minimum: 400, type: "integer" }, success: { enum: [false], type: "boolean" } }, required: ["success", "status", "message", "data", "requestId", "error", "details"], type: "object" };
|
|
237
|
+
function t2(r2, { instancePath: i6 = "", parentData: d6, parentDataProperty: f3, rootData: c3 = r2 } = {}) {
|
|
238
|
+
let p7 = null, s4 = 0;
|
|
239
|
+
if (s4 === 0) if (r2 && typeof r2 == "object" && !Array.isArray(r2)) {
|
|
240
|
+
let u2;
|
|
241
|
+
if (r2.success === void 0 && (u2 = "success") || r2.status === void 0 && (u2 = "status") || r2.message === void 0 && (u2 = "message") || r2.data === void 0 && (u2 = "data") || r2.requestId === void 0 && (u2 = "requestId") || r2.error === void 0 && (u2 = "error") || r2.details === void 0 && (u2 = "details")) return t2.errors = [{ instancePath: i6, schemaPath: "#/required", keyword: "required", params: { missingProperty: u2 }, message: "must have required property '" + u2 + "'" }], false;
|
|
242
|
+
{
|
|
243
|
+
let l6 = s4;
|
|
244
|
+
for (let e3 in r2) if (!(e3 === "data" || e3 === "details" || e3 === "error" || e3 === "message" || e3 === "requestId" || e3 === "status" || e3 === "success")) {
|
|
245
|
+
return t2.errors = [{ instancePath: i6, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: e3 }, message: "must NOT have additional properties" }], false;
|
|
246
|
+
break;
|
|
247
|
+
}
|
|
248
|
+
if (l6 === s4) {
|
|
249
|
+
if (r2.data !== void 0) {
|
|
250
|
+
let e3 = r2.data, o9 = s4;
|
|
251
|
+
if (!(e3 && typeof e3 == "object" && !Array.isArray(e3)) && e3 !== null) return t2.errors = [{ instancePath: i6 + "/data", schemaPath: "#/properties/data/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
252
|
+
if (e3 !== null) return t2.errors = [{ instancePath: i6 + "/data", schemaPath: "#/properties/data/enum", keyword: "enum", params: { allowedValues: m.properties.data.enum }, message: "must be equal to one of the allowed values" }], false;
|
|
253
|
+
var a3 = o9 === s4;
|
|
254
|
+
} else var a3 = true;
|
|
255
|
+
if (a3) {
|
|
256
|
+
if (r2.error !== void 0) {
|
|
257
|
+
let e3 = r2.error, o9 = s4;
|
|
258
|
+
if (typeof e3 != "string") return t2.errors = [{ instancePath: i6 + "/error", schemaPath: "#/properties/error/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
259
|
+
if (!(e3 === "BAD_REQUEST" || e3 === "CONFLICT" || e3 === "EXPIRED" || e3 === "FORBIDDEN" || e3 === "INTERNAL_ERROR" || e3 === "INVALID_API_RESPONSE" || e3 === "MAX_ACTIVE_JOBS_REACHED" || e3 === "NOT_FOUND" || e3 === "QUOTA_EXCEEDED" || e3 === "RATE_LIMIT_EXCEEDED" || e3 === "SERVICE_UNAVAILABLE" || e3 === "UNDECLARED_API_OPERATION" || e3 === "UNAUTHENTICATED" || e3 === "VALIDATION_FAILED")) return t2.errors = [{ instancePath: i6 + "/error", schemaPath: "#/properties/error/enum", keyword: "enum", params: { allowedValues: m.properties.error.enum }, message: "must be equal to one of the allowed values" }], false;
|
|
260
|
+
var a3 = o9 === s4;
|
|
261
|
+
} else var a3 = true;
|
|
262
|
+
if (a3) {
|
|
263
|
+
if (r2.message !== void 0) {
|
|
264
|
+
let e3 = s4;
|
|
265
|
+
if (typeof r2.message != "string") return t2.errors = [{ instancePath: i6 + "/message", schemaPath: "#/properties/message/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
266
|
+
var a3 = e3 === s4;
|
|
267
|
+
} else var a3 = true;
|
|
268
|
+
if (a3) {
|
|
269
|
+
if (r2.requestId !== void 0) {
|
|
270
|
+
let e3 = r2.requestId, o9 = s4;
|
|
271
|
+
if (s4 === o9) if (typeof e3 == "string") {
|
|
272
|
+
if (o(e3) < 1) return t2.errors = [{ instancePath: i6 + "/requestId", schemaPath: "#/properties/requestId/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }], false;
|
|
273
|
+
} else return t2.errors = [{ instancePath: i6 + "/requestId", schemaPath: "#/properties/requestId/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
274
|
+
var a3 = o9 === s4;
|
|
275
|
+
} else var a3 = true;
|
|
276
|
+
if (a3) {
|
|
277
|
+
if (r2.status !== void 0) {
|
|
278
|
+
let e3 = r2.status, o9 = s4;
|
|
279
|
+
if (!(typeof e3 == "number" && !(e3 % 1) && !isNaN(e3) && isFinite(e3))) return t2.errors = [{ instancePath: i6 + "/status", schemaPath: "#/properties/status/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
280
|
+
if (s4 === o9 && typeof e3 == "number" && isFinite(e3)) {
|
|
281
|
+
if (e3 > 599 || isNaN(e3)) return t2.errors = [{ instancePath: i6 + "/status", schemaPath: "#/properties/status/maximum", keyword: "maximum", params: { comparison: "<=", limit: 599 }, message: "must be <= 599" }], false;
|
|
282
|
+
if (e3 < 400 || isNaN(e3)) return t2.errors = [{ instancePath: i6 + "/status", schemaPath: "#/properties/status/minimum", keyword: "minimum", params: { comparison: ">=", limit: 400 }, message: "must be >= 400" }], false;
|
|
283
|
+
}
|
|
284
|
+
var a3 = o9 === s4;
|
|
285
|
+
} else var a3 = true;
|
|
286
|
+
if (a3) if (r2.success !== void 0) {
|
|
287
|
+
let e3 = r2.success, o9 = s4;
|
|
288
|
+
if (typeof e3 != "boolean") return t2.errors = [{ instancePath: i6 + "/success", schemaPath: "#/properties/success/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }], false;
|
|
289
|
+
if (e3 !== false) return t2.errors = [{ instancePath: i6 + "/success", schemaPath: "#/properties/success/enum", keyword: "enum", params: { allowedValues: m.properties.success.enum }, message: "must be equal to one of the allowed values" }], false;
|
|
290
|
+
var a3 = o9 === s4;
|
|
291
|
+
} else var a3 = true;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
} else return t2.errors = [{ instancePath: i6, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
299
|
+
return t2.errors = p7, s4 === 0;
|
|
300
|
+
}
|
|
301
|
+
var h = t2;
|
|
302
|
+
|
|
303
|
+
// ../../packages/contracts/src/generated/validators/shared/OUWE7ZSG.js
|
|
304
|
+
var U = c((r2) => {
|
|
305
|
+
"use strict";
|
|
306
|
+
Object.defineProperty(r2, "__esModule", { value: true });
|
|
307
|
+
r2.formatNames = r2.fastFormats = r2.fullFormats = void 0;
|
|
308
|
+
function n7(a3, d6) {
|
|
309
|
+
return { validate: a3, compare: d6 };
|
|
310
|
+
}
|
|
311
|
+
r2.fullFormats = { date: n7(b3, m5), time: n7(c3(true), $2), "date-time": n7(v3(true), N), "iso-time": n7(c3(), A4), "iso-date-time": n7(v3(), g2), duration: /^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/, uri: R2, "uri-reference": /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i, "uri-template": /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i, url: /^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu, email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, hostname: /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i, ipv4: /^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/, ipv6: /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i, regex: P3, uuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i, "json-pointer": /^(?:\/(?:[^~/]|~0|~1)*)*$/, "json-pointer-uri-fragment": /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i, "relative-json-pointer": /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/, byte: w4, int32: { type: "number", validate: Z }, int64: { type: "number", validate: H2 }, float: { type: "number", validate: D }, double: { type: "number", validate: D }, password: true, binary: true };
|
|
312
|
+
r2.fastFormats = { ...r2.fullFormats, date: n7(/^\d\d\d\d-[0-1]\d-[0-3]\d$/, m5), time: n7(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, $2), "date-time": n7(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, N), "iso-time": n7(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, A4), "iso-date-time": n7(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, g2), uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i, "uri-reference": /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i, email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i };
|
|
313
|
+
r2.formatNames = Object.keys(r2.fullFormats);
|
|
314
|
+
function y3(a3) {
|
|
315
|
+
return a3 % 4 === 0 && (a3 % 100 !== 0 || a3 % 400 === 0);
|
|
316
|
+
}
|
|
317
|
+
var O2 = /^(\d\d\d\d)-(\d\d)-(\d\d)$/, h11 = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
318
|
+
function b3(a3) {
|
|
319
|
+
let d6 = O2.exec(a3);
|
|
320
|
+
if (!d6) return false;
|
|
321
|
+
let t8 = +d6[1], e3 = +d6[2], f3 = +d6[3];
|
|
322
|
+
return e3 >= 1 && e3 <= 12 && f3 >= 1 && f3 <= (e3 === 2 && y3(t8) ? 29 : h11[e3]);
|
|
323
|
+
}
|
|
324
|
+
function m5(a3, d6) {
|
|
325
|
+
if (a3 && d6) return a3 > d6 ? 1 : a3 < d6 ? -1 : 0;
|
|
326
|
+
}
|
|
327
|
+
var s4 = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;
|
|
328
|
+
function c3(a3) {
|
|
329
|
+
return function(t8) {
|
|
330
|
+
let e3 = s4.exec(t8);
|
|
331
|
+
if (!e3) return false;
|
|
332
|
+
let f3 = +e3[1], u2 = +e3[2], i6 = +e3[3], M = e3[4], l6 = e3[5] === "-" ? -1 : 1, _2 = +(e3[6] || 0), p7 = +(e3[7] || 0);
|
|
333
|
+
if (_2 > 23 || p7 > 59 || a3 && !M) return false;
|
|
334
|
+
if (f3 <= 23 && u2 <= 59 && i6 < 60) return true;
|
|
335
|
+
let o9 = u2 - p7 * l6, T2 = f3 - _2 * l6 - (o9 < 0 ? 1 : 0);
|
|
336
|
+
return (T2 === 23 || T2 === -1) && (o9 === 59 || o9 === -1) && i6 < 61;
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
function $2(a3, d6) {
|
|
340
|
+
if (!(a3 && d6)) return;
|
|
341
|
+
let t8 = (/* @__PURE__ */ new Date("2020-01-01T" + a3)).valueOf(), e3 = (/* @__PURE__ */ new Date("2020-01-01T" + d6)).valueOf();
|
|
342
|
+
if (t8 && e3) return t8 - e3;
|
|
343
|
+
}
|
|
344
|
+
function A4(a3, d6) {
|
|
345
|
+
if (!(a3 && d6)) return;
|
|
346
|
+
let t8 = s4.exec(a3), e3 = s4.exec(d6);
|
|
347
|
+
if (t8 && e3) return a3 = t8[1] + t8[2] + t8[3], d6 = e3[1] + e3[2] + e3[3], a3 > d6 ? 1 : a3 < d6 ? -1 : 0;
|
|
348
|
+
}
|
|
349
|
+
var z2 = /t|\s/i;
|
|
350
|
+
function v3(a3) {
|
|
351
|
+
let d6 = c3(a3);
|
|
352
|
+
return function(e3) {
|
|
353
|
+
let f3 = e3.split(z2);
|
|
354
|
+
return f3.length === 2 && b3(f3[0]) && d6(f3[1]);
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
function N(a3, d6) {
|
|
358
|
+
if (!(a3 && d6)) return;
|
|
359
|
+
let t8 = new Date(a3).valueOf(), e3 = new Date(d6).valueOf();
|
|
360
|
+
if (t8 && e3) return t8 - e3;
|
|
361
|
+
}
|
|
362
|
+
function g2(a3, d6) {
|
|
363
|
+
if (!(a3 && d6)) return;
|
|
364
|
+
let [t8, e3] = a3.split(z2), [f3, u2] = d6.split(z2), i6 = m5(t8, f3);
|
|
365
|
+
if (i6 !== void 0) return i6 || $2(e3, u2);
|
|
366
|
+
}
|
|
367
|
+
var E = /\/|:/, F2 = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
|
|
368
|
+
function R2(a3) {
|
|
369
|
+
return E.test(a3) && F2.test(a3);
|
|
370
|
+
}
|
|
371
|
+
var I2 = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;
|
|
372
|
+
function w4(a3) {
|
|
373
|
+
return I2.lastIndex = 0, I2.test(a3);
|
|
374
|
+
}
|
|
375
|
+
var S2 = -(2 ** 31), j3 = 2 ** 31 - 1;
|
|
376
|
+
function Z(a3) {
|
|
377
|
+
return Number.isInteger(a3) && a3 <= j3 && a3 >= S2;
|
|
378
|
+
}
|
|
379
|
+
function H2(a3) {
|
|
380
|
+
return Number.isInteger(a3);
|
|
381
|
+
}
|
|
382
|
+
function D() {
|
|
383
|
+
return true;
|
|
384
|
+
}
|
|
385
|
+
var Y = /[^\\]\\Z/;
|
|
386
|
+
function P3(a3) {
|
|
387
|
+
if (Y.test(a3)) return false;
|
|
388
|
+
try {
|
|
389
|
+
return new RegExp(a3), true;
|
|
390
|
+
} catch {
|
|
391
|
+
return false;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
});
|
|
395
|
+
|
|
396
|
+
// ../../packages/contracts/src/generated/validators/shared/774NGUAG.js
|
|
397
|
+
var t3 = U().fullFormats.date;
|
|
398
|
+
|
|
399
|
+
// ../../packages/contracts/src/generated/validators/shared/VSRNQHIL.js
|
|
400
|
+
var e = U().fullFormats["date-time"];
|
|
401
|
+
|
|
402
|
+
// ../../packages/contracts/src/generated/validators/shared/CA7CC2WJ.js
|
|
403
|
+
var a = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;
|
|
404
|
+
|
|
405
|
+
// ../../packages/contracts/src/generated/validators/shared/LUXQRMIZ.js
|
|
406
|
+
var A = { description: "A project", properties: { archivedAt: { format: "date-time", nullable: true, type: "string" }, category: { type: "string" }, color: { type: "string" }, completedAt: { format: "date-time", nullable: true, type: "string" }, createdAt: { format: "date-time", type: "string" }, description: { nullable: true, type: "string" }, estimatedHours: { nullable: true, type: "integer" }, icon: { type: "string" }, id: { format: "uuid", type: "string" }, lastActiveDay: { format: "date", nullable: true, type: "string" }, lastOutcome: { nullable: true, type: "string" }, launchDescription: { nullable: true, type: "string" }, launchUrl: { nullable: true, type: "string" }, launchedAt: { format: "date-time", nullable: true, type: "string" }, name: { type: "string" }, nextStep: { anyOf: [{ $ref: "urn:flowmind:schema:ProjectNextStep" }, { enum: [null], nullable: true, type: "object" }] }, updatedAt: { format: "date-time", type: "string" } }, required: ["id", "name", "description", "color", "icon", "category", "estimatedHours", "launchedAt", "completedAt", "launchDescription", "launchUrl", "createdAt", "updatedAt", "archivedAt", "nextStep", "lastOutcome", "lastActiveDay"], type: "object" };
|
|
407
|
+
function l(t8, { instancePath: i6 = "", parentData: b3, parentDataProperty: P3, rootData: g2 = t8 } = {}) {
|
|
408
|
+
let p7 = null, e3 = 0;
|
|
409
|
+
if (e3 === 0) if (t8 && typeof t8 == "object" && !Array.isArray(t8)) {
|
|
410
|
+
let m5;
|
|
411
|
+
if (t8.text === void 0 && (m5 = "text") || t8.sourceDay === void 0 && (m5 = "sourceDay")) return l.errors = [{ instancePath: i6, schemaPath: "#/required", keyword: "required", params: { missingProperty: m5 }, message: "must have required property '" + m5 + "'" }], false;
|
|
412
|
+
{
|
|
413
|
+
let o9 = e3;
|
|
414
|
+
for (let r2 in t8) if (!(r2 === "sourceDay" || r2 === "text")) {
|
|
415
|
+
return l.errors = [{ instancePath: i6, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: r2 }, message: "must NOT have additional properties" }], false;
|
|
416
|
+
break;
|
|
417
|
+
}
|
|
418
|
+
if (o9 === e3) {
|
|
419
|
+
if (t8.sourceDay !== void 0) {
|
|
420
|
+
let r2 = t8.sourceDay, a3 = e3;
|
|
421
|
+
if (e3 === a3 && e3 === a3) if (typeof r2 == "string") {
|
|
422
|
+
if (!t3.validate(r2)) return l.errors = [{ instancePath: i6 + "/sourceDay", schemaPath: "#/properties/sourceDay/format", keyword: "format", params: { format: "date" }, message: 'must match format "date"' }], false;
|
|
423
|
+
} else return l.errors = [{ instancePath: i6 + "/sourceDay", schemaPath: "#/properties/sourceDay/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
424
|
+
var s4 = a3 === e3;
|
|
425
|
+
} else var s4 = true;
|
|
426
|
+
if (s4) if (t8.text !== void 0) {
|
|
427
|
+
let r2 = e3;
|
|
428
|
+
if (typeof t8.text != "string") return l.errors = [{ instancePath: i6 + "/text", schemaPath: "#/properties/text/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
429
|
+
var s4 = r2 === e3;
|
|
430
|
+
} else var s4 = true;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
} else return l.errors = [{ instancePath: i6, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
434
|
+
return l.errors = p7, e3 === 0;
|
|
435
|
+
}
|
|
436
|
+
function n(t8, { instancePath: i6 = "", parentData: b3, parentDataProperty: P3, rootData: g2 = t8 } = {}) {
|
|
437
|
+
let p7 = null, e3 = 0;
|
|
438
|
+
if (e3 === 0) if (t8 && typeof t8 == "object" && !Array.isArray(t8)) {
|
|
439
|
+
let o9;
|
|
440
|
+
if (t8.id === void 0 && (o9 = "id") || t8.name === void 0 && (o9 = "name") || t8.description === void 0 && (o9 = "description") || t8.color === void 0 && (o9 = "color") || t8.icon === void 0 && (o9 = "icon") || t8.category === void 0 && (o9 = "category") || t8.estimatedHours === void 0 && (o9 = "estimatedHours") || t8.launchedAt === void 0 && (o9 = "launchedAt") || t8.completedAt === void 0 && (o9 = "completedAt") || t8.launchDescription === void 0 && (o9 = "launchDescription") || t8.launchUrl === void 0 && (o9 = "launchUrl") || t8.createdAt === void 0 && (o9 = "createdAt") || t8.updatedAt === void 0 && (o9 = "updatedAt") || t8.archivedAt === void 0 && (o9 = "archivedAt") || t8.nextStep === void 0 && (o9 = "nextStep") || t8.lastOutcome === void 0 && (o9 = "lastOutcome") || t8.lastActiveDay === void 0 && (o9 = "lastActiveDay")) return n.errors = [{ instancePath: i6, schemaPath: "#/required", keyword: "required", params: { missingProperty: o9 }, message: "must have required property '" + o9 + "'" }], false;
|
|
441
|
+
if (t8.archivedAt !== void 0) {
|
|
442
|
+
let r2 = t8.archivedAt, a3 = e3;
|
|
443
|
+
if (typeof r2 != "string" && r2 !== null) return n.errors = [{ instancePath: i6 + "/archivedAt", schemaPath: "#/properties/archivedAt/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
444
|
+
if (e3 === a3 && e3 === a3 && typeof r2 == "string" && !e.validate(r2)) return n.errors = [{ instancePath: i6 + "/archivedAt", schemaPath: "#/properties/archivedAt/format", keyword: "format", params: { format: "date-time" }, message: 'must match format "date-time"' }], false;
|
|
445
|
+
var s4 = a3 === e3;
|
|
446
|
+
} else var s4 = true;
|
|
447
|
+
if (s4) {
|
|
448
|
+
if (t8.category !== void 0) {
|
|
449
|
+
let r2 = e3;
|
|
450
|
+
if (typeof t8.category != "string") return n.errors = [{ instancePath: i6 + "/category", schemaPath: "#/properties/category/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
451
|
+
var s4 = r2 === e3;
|
|
452
|
+
} else var s4 = true;
|
|
453
|
+
if (s4) {
|
|
454
|
+
if (t8.color !== void 0) {
|
|
455
|
+
let r2 = e3;
|
|
456
|
+
if (typeof t8.color != "string") return n.errors = [{ instancePath: i6 + "/color", schemaPath: "#/properties/color/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
457
|
+
var s4 = r2 === e3;
|
|
458
|
+
} else var s4 = true;
|
|
459
|
+
if (s4) {
|
|
460
|
+
if (t8.completedAt !== void 0) {
|
|
461
|
+
let r2 = t8.completedAt, a3 = e3;
|
|
462
|
+
if (typeof r2 != "string" && r2 !== null) return n.errors = [{ instancePath: i6 + "/completedAt", schemaPath: "#/properties/completedAt/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
463
|
+
if (e3 === a3 && e3 === a3 && typeof r2 == "string" && !e.validate(r2)) return n.errors = [{ instancePath: i6 + "/completedAt", schemaPath: "#/properties/completedAt/format", keyword: "format", params: { format: "date-time" }, message: 'must match format "date-time"' }], false;
|
|
464
|
+
var s4 = a3 === e3;
|
|
465
|
+
} else var s4 = true;
|
|
466
|
+
if (s4) {
|
|
467
|
+
if (t8.createdAt !== void 0) {
|
|
468
|
+
let r2 = t8.createdAt, a3 = e3;
|
|
469
|
+
if (e3 === a3 && e3 === a3) if (typeof r2 == "string") {
|
|
470
|
+
if (!e.validate(r2)) return n.errors = [{ instancePath: i6 + "/createdAt", schemaPath: "#/properties/createdAt/format", keyword: "format", params: { format: "date-time" }, message: 'must match format "date-time"' }], false;
|
|
471
|
+
} else return n.errors = [{ instancePath: i6 + "/createdAt", schemaPath: "#/properties/createdAt/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
472
|
+
var s4 = a3 === e3;
|
|
473
|
+
} else var s4 = true;
|
|
474
|
+
if (s4) {
|
|
475
|
+
if (t8.description !== void 0) {
|
|
476
|
+
let r2 = t8.description, a3 = e3;
|
|
477
|
+
if (typeof r2 != "string" && r2 !== null) return n.errors = [{ instancePath: i6 + "/description", schemaPath: "#/properties/description/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
478
|
+
var s4 = a3 === e3;
|
|
479
|
+
} else var s4 = true;
|
|
480
|
+
if (s4) {
|
|
481
|
+
if (t8.estimatedHours !== void 0) {
|
|
482
|
+
let r2 = t8.estimatedHours, a3 = e3;
|
|
483
|
+
if (!(typeof r2 == "number" && !(r2 % 1) && !isNaN(r2) && isFinite(r2)) && r2 !== null) return n.errors = [{ instancePath: i6 + "/estimatedHours", schemaPath: "#/properties/estimatedHours/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
484
|
+
var s4 = a3 === e3;
|
|
485
|
+
} else var s4 = true;
|
|
486
|
+
if (s4) {
|
|
487
|
+
if (t8.icon !== void 0) {
|
|
488
|
+
let r2 = e3;
|
|
489
|
+
if (typeof t8.icon != "string") return n.errors = [{ instancePath: i6 + "/icon", schemaPath: "#/properties/icon/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
490
|
+
var s4 = r2 === e3;
|
|
491
|
+
} else var s4 = true;
|
|
492
|
+
if (s4) {
|
|
493
|
+
if (t8.id !== void 0) {
|
|
494
|
+
let r2 = t8.id, a3 = e3;
|
|
495
|
+
if (e3 === a3 && e3 === a3) if (typeof r2 == "string") {
|
|
496
|
+
if (!a.test(r2)) return n.errors = [{ instancePath: i6 + "/id", schemaPath: "#/properties/id/format", keyword: "format", params: { format: "uuid" }, message: 'must match format "uuid"' }], false;
|
|
497
|
+
} else return n.errors = [{ instancePath: i6 + "/id", schemaPath: "#/properties/id/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
498
|
+
var s4 = a3 === e3;
|
|
499
|
+
} else var s4 = true;
|
|
500
|
+
if (s4) {
|
|
501
|
+
if (t8.lastActiveDay !== void 0) {
|
|
502
|
+
let r2 = t8.lastActiveDay, a3 = e3;
|
|
503
|
+
if (typeof r2 != "string" && r2 !== null) return n.errors = [{ instancePath: i6 + "/lastActiveDay", schemaPath: "#/properties/lastActiveDay/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
504
|
+
if (e3 === a3 && e3 === a3 && typeof r2 == "string" && !t3.validate(r2)) return n.errors = [{ instancePath: i6 + "/lastActiveDay", schemaPath: "#/properties/lastActiveDay/format", keyword: "format", params: { format: "date" }, message: 'must match format "date"' }], false;
|
|
505
|
+
var s4 = a3 === e3;
|
|
506
|
+
} else var s4 = true;
|
|
507
|
+
if (s4) {
|
|
508
|
+
if (t8.lastOutcome !== void 0) {
|
|
509
|
+
let r2 = t8.lastOutcome, a3 = e3;
|
|
510
|
+
if (typeof r2 != "string" && r2 !== null) return n.errors = [{ instancePath: i6 + "/lastOutcome", schemaPath: "#/properties/lastOutcome/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
511
|
+
var s4 = a3 === e3;
|
|
512
|
+
} else var s4 = true;
|
|
513
|
+
if (s4) {
|
|
514
|
+
if (t8.launchDescription !== void 0) {
|
|
515
|
+
let r2 = t8.launchDescription, a3 = e3;
|
|
516
|
+
if (typeof r2 != "string" && r2 !== null) return n.errors = [{ instancePath: i6 + "/launchDescription", schemaPath: "#/properties/launchDescription/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
517
|
+
var s4 = a3 === e3;
|
|
518
|
+
} else var s4 = true;
|
|
519
|
+
if (s4) {
|
|
520
|
+
if (t8.launchUrl !== void 0) {
|
|
521
|
+
let r2 = t8.launchUrl, a3 = e3;
|
|
522
|
+
if (typeof r2 != "string" && r2 !== null) return n.errors = [{ instancePath: i6 + "/launchUrl", schemaPath: "#/properties/launchUrl/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
523
|
+
var s4 = a3 === e3;
|
|
524
|
+
} else var s4 = true;
|
|
525
|
+
if (s4) {
|
|
526
|
+
if (t8.launchedAt !== void 0) {
|
|
527
|
+
let r2 = t8.launchedAt, a3 = e3;
|
|
528
|
+
if (typeof r2 != "string" && r2 !== null) return n.errors = [{ instancePath: i6 + "/launchedAt", schemaPath: "#/properties/launchedAt/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
529
|
+
if (e3 === a3 && e3 === a3 && typeof r2 == "string" && !e.validate(r2)) return n.errors = [{ instancePath: i6 + "/launchedAt", schemaPath: "#/properties/launchedAt/format", keyword: "format", params: { format: "date-time" }, message: 'must match format "date-time"' }], false;
|
|
530
|
+
var s4 = a3 === e3;
|
|
531
|
+
} else var s4 = true;
|
|
532
|
+
if (s4) {
|
|
533
|
+
if (t8.name !== void 0) {
|
|
534
|
+
let r2 = e3;
|
|
535
|
+
if (typeof t8.name != "string") return n.errors = [{ instancePath: i6 + "/name", schemaPath: "#/properties/name/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
536
|
+
var s4 = r2 === e3;
|
|
537
|
+
} else var s4 = true;
|
|
538
|
+
if (s4) {
|
|
539
|
+
if (t8.nextStep !== void 0) {
|
|
540
|
+
let r2 = t8.nextStep, a3 = e3, h11 = e3, f3 = false, w4 = e3;
|
|
541
|
+
l(r2, { instancePath: i6 + "/nextStep", parentData: t8, parentDataProperty: "nextStep", rootData: g2 }) || (p7 = p7 === null ? l.errors : p7.concat(l.errors), e3 = p7.length);
|
|
542
|
+
var m5 = w4 === e3;
|
|
543
|
+
if (f3 = f3 || m5, !f3) {
|
|
544
|
+
let c3 = e3;
|
|
545
|
+
if (!(r2 && typeof r2 == "object" && !Array.isArray(r2)) && r2 !== null) {
|
|
546
|
+
let d6 = { instancePath: i6 + "/nextStep", schemaPath: "#/properties/nextStep/anyOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
547
|
+
p7 === null ? p7 = [d6] : p7.push(d6), e3++;
|
|
548
|
+
}
|
|
549
|
+
if (r2 !== null) {
|
|
550
|
+
let d6 = { instancePath: i6 + "/nextStep", schemaPath: "#/properties/nextStep/anyOf/1/enum", keyword: "enum", params: { allowedValues: A.properties.nextStep.anyOf[1].enum }, message: "must be equal to one of the allowed values" };
|
|
551
|
+
p7 === null ? p7 = [d6] : p7.push(d6), e3++;
|
|
552
|
+
}
|
|
553
|
+
var m5 = c3 === e3;
|
|
554
|
+
f3 = f3 || m5;
|
|
555
|
+
}
|
|
556
|
+
if (f3) e3 = h11, p7 !== null && (h11 ? p7.length = h11 : p7 = null);
|
|
557
|
+
else {
|
|
558
|
+
let c3 = { instancePath: i6 + "/nextStep", schemaPath: "#/properties/nextStep/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
|
|
559
|
+
return p7 === null ? p7 = [c3] : p7.push(c3), e3++, n.errors = p7, false;
|
|
560
|
+
}
|
|
561
|
+
var s4 = a3 === e3;
|
|
562
|
+
} else var s4 = true;
|
|
563
|
+
if (s4) if (t8.updatedAt !== void 0) {
|
|
564
|
+
let r2 = t8.updatedAt, a3 = e3;
|
|
565
|
+
if (e3 === a3 && e3 === a3) if (typeof r2 == "string") {
|
|
566
|
+
if (!e.validate(r2)) return n.errors = [{ instancePath: i6 + "/updatedAt", schemaPath: "#/properties/updatedAt/format", keyword: "format", params: { format: "date-time" }, message: 'must match format "date-time"' }], false;
|
|
567
|
+
} else return n.errors = [{ instancePath: i6 + "/updatedAt", schemaPath: "#/properties/updatedAt/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
568
|
+
var s4 = a3 === e3;
|
|
569
|
+
} else var s4 = true;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
} else return n.errors = [{ instancePath: i6, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
586
|
+
return n.errors = p7, e3 === 0;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
// ../../packages/contracts/src/generated/validators/getV1Projects200.js
|
|
590
|
+
function o2(r2, { instancePath: s4 = "", parentData: u2, parentDataProperty: d6, rootData: f3 = r2 } = {}) {
|
|
591
|
+
let t8 = null, e3 = 0;
|
|
592
|
+
if (e3 === 0) if (r2 && typeof r2 == "object" && !Array.isArray(r2)) {
|
|
593
|
+
let i6;
|
|
594
|
+
if (r2.projects === void 0 && (i6 = "projects")) return o2.errors = [{ instancePath: s4, schemaPath: "#/required", keyword: "required", params: { missingProperty: i6 }, message: "must have required property '" + i6 + "'" }], false;
|
|
595
|
+
if (r2.projects !== void 0) {
|
|
596
|
+
let a3 = r2.projects;
|
|
597
|
+
if (e3 === e3) if (Array.isArray(a3)) {
|
|
598
|
+
var m5 = true;
|
|
599
|
+
let l6 = a3.length;
|
|
600
|
+
for (let p7 = 0; p7 < l6; p7++) {
|
|
601
|
+
let v3 = e3;
|
|
602
|
+
n(a3[p7], { instancePath: s4 + "/projects/" + p7, parentData: a3, parentDataProperty: p7, rootData: f3 }) || (t8 = t8 === null ? n.errors : t8.concat(n.errors), e3 = t8.length);
|
|
603
|
+
var m5 = v3 === e3;
|
|
604
|
+
if (!m5) break;
|
|
605
|
+
}
|
|
606
|
+
} else return o2.errors = [{ instancePath: s4 + "/projects", schemaPath: "#/properties/projects/type", keyword: "type", params: { type: "array" }, message: "must be array" }], false;
|
|
607
|
+
}
|
|
608
|
+
} else return o2.errors = [{ instancePath: s4, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
609
|
+
return o2.errors = t8, e3 === 0;
|
|
610
|
+
}
|
|
611
|
+
function n2(r2, { instancePath: s4 = "", parentData: u2, parentDataProperty: d6, rootData: f3 = r2 } = {}) {
|
|
612
|
+
let t8 = null, e3 = 0, m5 = e3;
|
|
613
|
+
i(r2, { instancePath: s4, parentData: u2, parentDataProperty: d6, rootData: f3 }) || (t8 = t8 === null ? i.errors : t8.concat(i.errors), e3 = t8.length);
|
|
614
|
+
var i6 = m5 === e3;
|
|
615
|
+
if (i6) {
|
|
616
|
+
let a3 = e3;
|
|
617
|
+
if (e3 === a3) if (r2 && typeof r2 == "object" && !Array.isArray(r2)) {
|
|
618
|
+
let l6;
|
|
619
|
+
if (r2.data === void 0 && (l6 = "data")) return n2.errors = [{ instancePath: s4, schemaPath: "#/allOf/1/required", keyword: "required", params: { missingProperty: l6 }, message: "must have required property '" + l6 + "'" }], false;
|
|
620
|
+
r2.data !== void 0 && (o2(r2.data, { instancePath: s4 + "/data", parentData: r2, parentDataProperty: "data", rootData: f3 }) || (t8 = t8 === null ? o2.errors : t8.concat(o2.errors), e3 = t8.length));
|
|
621
|
+
} else return n2.errors = [{ instancePath: s4, schemaPath: "#/allOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
622
|
+
var i6 = a3 === e3;
|
|
623
|
+
}
|
|
624
|
+
return n2.errors = t8, e3 === 0;
|
|
625
|
+
}
|
|
626
|
+
var A2 = n2;
|
|
627
|
+
|
|
628
|
+
// ../../packages/contracts/src/generated/endpoints/getV1Projects.ts
|
|
629
|
+
var getV1Projects = {
|
|
630
|
+
method: "GET",
|
|
631
|
+
path: "/v1/projects/",
|
|
632
|
+
operation: "GET /v1/projects/",
|
|
633
|
+
revision: contractRevision,
|
|
634
|
+
responses: {
|
|
635
|
+
200: { mediaType: "application/json", schemaId: "urn:flowmind:getV1Projects:200", validate: A2 }
|
|
636
|
+
},
|
|
637
|
+
error: { mediaType: "application/json", schemaId: "ApiErrorEnvelope", validate: h }
|
|
638
|
+
};
|
|
639
|
+
|
|
640
|
+
// ../../packages/contracts/src/generated/validators/getV1AgentCapabilities200.js
|
|
641
|
+
var h2 = { additionalProperties: false, properties: { capabilities: { items: { type: "string" }, type: "array" }, contractVersion: { type: "string" }, requiresIdempotencyKey: { items: { type: "string" }, type: "array" }, scope: { enum: ["read_only", "log_only", "full_personal"], type: "string" } }, required: ["contractVersion", "scope", "capabilities", "requiresIdempotencyKey"], type: "object" };
|
|
642
|
+
function i2(e3, { instancePath: t8 = "", parentData: v3, parentDataProperty: b3, rootData: g2 = e3 } = {}) {
|
|
643
|
+
let o9 = null, r2 = 0;
|
|
644
|
+
if (r2 === 0) if (e3 && typeof e3 == "object" && !Array.isArray(e3)) {
|
|
645
|
+
let n7;
|
|
646
|
+
if (e3.contractVersion === void 0 && (n7 = "contractVersion") || e3.scope === void 0 && (n7 = "scope") || e3.capabilities === void 0 && (n7 = "capabilities") || e3.requiresIdempotencyKey === void 0 && (n7 = "requiresIdempotencyKey")) return i2.errors = [{ instancePath: t8, schemaPath: "#/required", keyword: "required", params: { missingProperty: n7 }, message: "must have required property '" + n7 + "'" }], false;
|
|
647
|
+
{
|
|
648
|
+
let m5 = r2;
|
|
649
|
+
for (let s4 in e3) if (!(s4 === "capabilities" || s4 === "contractVersion" || s4 === "requiresIdempotencyKey" || s4 === "scope")) {
|
|
650
|
+
return i2.errors = [{ instancePath: t8, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: s4 }, message: "must NOT have additional properties" }], false;
|
|
651
|
+
break;
|
|
652
|
+
}
|
|
653
|
+
if (m5 === r2) {
|
|
654
|
+
if (e3.capabilities !== void 0) {
|
|
655
|
+
let s4 = e3.capabilities, p7 = r2;
|
|
656
|
+
if (r2 === p7) if (Array.isArray(s4)) {
|
|
657
|
+
var f3 = true;
|
|
658
|
+
let q2 = s4.length;
|
|
659
|
+
for (let l6 = 0; l6 < q2; l6++) {
|
|
660
|
+
let y3 = r2;
|
|
661
|
+
if (typeof s4[l6] != "string") return i2.errors = [{ instancePath: t8 + "/capabilities/" + l6, schemaPath: "#/properties/capabilities/items/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
662
|
+
var f3 = y3 === r2;
|
|
663
|
+
if (!f3) break;
|
|
664
|
+
}
|
|
665
|
+
} else return i2.errors = [{ instancePath: t8 + "/capabilities", schemaPath: "#/properties/capabilities/type", keyword: "type", params: { type: "array" }, message: "must be array" }], false;
|
|
666
|
+
var a3 = p7 === r2;
|
|
667
|
+
} else var a3 = true;
|
|
668
|
+
if (a3) {
|
|
669
|
+
if (e3.contractVersion !== void 0) {
|
|
670
|
+
let s4 = r2;
|
|
671
|
+
if (typeof e3.contractVersion != "string") return i2.errors = [{ instancePath: t8 + "/contractVersion", schemaPath: "#/properties/contractVersion/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
672
|
+
var a3 = s4 === r2;
|
|
673
|
+
} else var a3 = true;
|
|
674
|
+
if (a3) {
|
|
675
|
+
if (e3.requiresIdempotencyKey !== void 0) {
|
|
676
|
+
let s4 = e3.requiresIdempotencyKey, p7 = r2;
|
|
677
|
+
if (r2 === p7) if (Array.isArray(s4)) {
|
|
678
|
+
var c3 = true;
|
|
679
|
+
let l6 = s4.length;
|
|
680
|
+
for (let y3 = 0; y3 < l6; y3++) {
|
|
681
|
+
let k2 = r2;
|
|
682
|
+
if (typeof s4[y3] != "string") return i2.errors = [{ instancePath: t8 + "/requiresIdempotencyKey/" + y3, schemaPath: "#/properties/requiresIdempotencyKey/items/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
683
|
+
var c3 = k2 === r2;
|
|
684
|
+
if (!c3) break;
|
|
685
|
+
}
|
|
686
|
+
} else return i2.errors = [{ instancePath: t8 + "/requiresIdempotencyKey", schemaPath: "#/properties/requiresIdempotencyKey/type", keyword: "type", params: { type: "array" }, message: "must be array" }], false;
|
|
687
|
+
var a3 = p7 === r2;
|
|
688
|
+
} else var a3 = true;
|
|
689
|
+
if (a3) if (e3.scope !== void 0) {
|
|
690
|
+
let s4 = e3.scope, p7 = r2;
|
|
691
|
+
if (typeof s4 != "string") return i2.errors = [{ instancePath: t8 + "/scope", schemaPath: "#/properties/scope/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
692
|
+
if (!(s4 === "read_only" || s4 === "log_only" || s4 === "full_personal")) return i2.errors = [{ instancePath: t8 + "/scope", schemaPath: "#/properties/scope/enum", keyword: "enum", params: { allowedValues: h2.properties.scope.enum }, message: "must be equal to one of the allowed values" }], false;
|
|
693
|
+
var a3 = p7 === r2;
|
|
694
|
+
} else var a3 = true;
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
} else return i2.errors = [{ instancePath: t8, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
700
|
+
return i2.errors = o9, r2 === 0;
|
|
701
|
+
}
|
|
702
|
+
function u(e3, { instancePath: t8 = "", parentData: v3, parentDataProperty: b3, rootData: g2 = e3 } = {}) {
|
|
703
|
+
let o9 = null, r2 = 0, f3 = r2;
|
|
704
|
+
i(e3, { instancePath: t8, parentData: v3, parentDataProperty: b3, rootData: g2 }) || (o9 = o9 === null ? i.errors : o9.concat(i.errors), r2 = o9.length);
|
|
705
|
+
var a3 = f3 === r2;
|
|
706
|
+
if (a3) {
|
|
707
|
+
let c3 = r2;
|
|
708
|
+
if (r2 === c3) if (e3 && typeof e3 == "object" && !Array.isArray(e3)) {
|
|
709
|
+
let m5;
|
|
710
|
+
if (e3.data === void 0 && (m5 = "data")) return u.errors = [{ instancePath: t8, schemaPath: "#/allOf/1/required", keyword: "required", params: { missingProperty: m5 }, message: "must have required property '" + m5 + "'" }], false;
|
|
711
|
+
e3.data !== void 0 && (i2(e3.data, { instancePath: t8 + "/data", parentData: e3, parentDataProperty: "data", rootData: g2 }) || (o9 = o9 === null ? i2.errors : o9.concat(i2.errors), r2 = o9.length));
|
|
712
|
+
} else return u.errors = [{ instancePath: t8, schemaPath: "#/allOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
713
|
+
var a3 = c3 === r2;
|
|
714
|
+
}
|
|
715
|
+
return u.errors = o9, r2 === 0;
|
|
716
|
+
}
|
|
717
|
+
var j = u;
|
|
718
|
+
|
|
719
|
+
// ../../packages/contracts/src/generated/endpoints/getV1AgentCapabilities.ts
|
|
720
|
+
var getV1AgentCapabilities = {
|
|
721
|
+
method: "GET",
|
|
722
|
+
path: "/v1/agent/capabilities",
|
|
723
|
+
operation: "GET /v1/agent/capabilities",
|
|
724
|
+
revision: contractRevision,
|
|
725
|
+
responses: {
|
|
726
|
+
200: { mediaType: "application/json", schemaId: "urn:flowmind:getV1AgentCapabilities:200", validate: j }
|
|
727
|
+
},
|
|
728
|
+
error: { mediaType: "application/json", schemaId: "ApiErrorEnvelope", validate: h }
|
|
729
|
+
};
|
|
730
|
+
|
|
731
|
+
// ../../packages/contracts/src/generated/validators/getV1AgentProjects200.js
|
|
732
|
+
var h3 = { additionalProperties: false, properties: { estimatedHours: { nullable: true, type: "integer" }, id: { format: "uuid", type: "string" }, name: { type: "string" }, status: { enum: ["active", "completed"], type: "string" }, totalHours: { minimum: 0, type: "number" } }, required: ["id", "name", "status", "estimatedHours", "totalHours"], type: "object" };
|
|
733
|
+
function i3(e3, { instancePath: s4 = "", parentData: c3, parentDataProperty: g2, rootData: l6 = e3 } = {}) {
|
|
734
|
+
let o9 = null, r2 = 0;
|
|
735
|
+
if (r2 === 0) if (e3 && typeof e3 == "object" && !Array.isArray(e3)) {
|
|
736
|
+
let m5;
|
|
737
|
+
if (e3.id === void 0 && (m5 = "id") || e3.name === void 0 && (m5 = "name") || e3.status === void 0 && (m5 = "status") || e3.estimatedHours === void 0 && (m5 = "estimatedHours") || e3.totalHours === void 0 && (m5 = "totalHours")) return i3.errors = [{ instancePath: s4, schemaPath: "#/required", keyword: "required", params: { missingProperty: m5 }, message: "must have required property '" + m5 + "'" }], false;
|
|
738
|
+
{
|
|
739
|
+
let u2 = r2;
|
|
740
|
+
for (let t8 in e3) if (!(t8 === "estimatedHours" || t8 === "id" || t8 === "name" || t8 === "status" || t8 === "totalHours")) {
|
|
741
|
+
return i3.errors = [{ instancePath: s4, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: t8 }, message: "must NOT have additional properties" }], false;
|
|
742
|
+
break;
|
|
743
|
+
}
|
|
744
|
+
if (u2 === r2) {
|
|
745
|
+
if (e3.estimatedHours !== void 0) {
|
|
746
|
+
let t8 = e3.estimatedHours, n7 = r2;
|
|
747
|
+
if (!(typeof t8 == "number" && !(t8 % 1) && !isNaN(t8) && isFinite(t8)) && t8 !== null) return i3.errors = [{ instancePath: s4 + "/estimatedHours", schemaPath: "#/properties/estimatedHours/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
748
|
+
var a3 = n7 === r2;
|
|
749
|
+
} else var a3 = true;
|
|
750
|
+
if (a3) {
|
|
751
|
+
if (e3.id !== void 0) {
|
|
752
|
+
let t8 = e3.id, n7 = r2;
|
|
753
|
+
if (r2 === n7 && r2 === n7) if (typeof t8 == "string") {
|
|
754
|
+
if (!a.test(t8)) return i3.errors = [{ instancePath: s4 + "/id", schemaPath: "#/properties/id/format", keyword: "format", params: { format: "uuid" }, message: 'must match format "uuid"' }], false;
|
|
755
|
+
} else return i3.errors = [{ instancePath: s4 + "/id", schemaPath: "#/properties/id/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
756
|
+
var a3 = n7 === r2;
|
|
757
|
+
} else var a3 = true;
|
|
758
|
+
if (a3) {
|
|
759
|
+
if (e3.name !== void 0) {
|
|
760
|
+
let t8 = r2;
|
|
761
|
+
if (typeof e3.name != "string") return i3.errors = [{ instancePath: s4 + "/name", schemaPath: "#/properties/name/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
762
|
+
var a3 = t8 === r2;
|
|
763
|
+
} else var a3 = true;
|
|
764
|
+
if (a3) {
|
|
765
|
+
if (e3.status !== void 0) {
|
|
766
|
+
let t8 = e3.status, n7 = r2;
|
|
767
|
+
if (typeof t8 != "string") return i3.errors = [{ instancePath: s4 + "/status", schemaPath: "#/properties/status/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
768
|
+
if (!(t8 === "active" || t8 === "completed")) return i3.errors = [{ instancePath: s4 + "/status", schemaPath: "#/properties/status/enum", keyword: "enum", params: { allowedValues: h3.properties.status.enum }, message: "must be equal to one of the allowed values" }], false;
|
|
769
|
+
var a3 = n7 === r2;
|
|
770
|
+
} else var a3 = true;
|
|
771
|
+
if (a3) if (e3.totalHours !== void 0) {
|
|
772
|
+
let t8 = e3.totalHours, n7 = r2;
|
|
773
|
+
if (r2 === n7) if (typeof t8 == "number" && isFinite(t8)) {
|
|
774
|
+
if (t8 < 0 || isNaN(t8)) return i3.errors = [{ instancePath: s4 + "/totalHours", schemaPath: "#/properties/totalHours/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
775
|
+
} else return i3.errors = [{ instancePath: s4 + "/totalHours", schemaPath: "#/properties/totalHours/type", keyword: "type", params: { type: "number" }, message: "must be number" }], false;
|
|
776
|
+
var a3 = n7 === r2;
|
|
777
|
+
} else var a3 = true;
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
} else return i3.errors = [{ instancePath: s4, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
784
|
+
return i3.errors = o9, r2 === 0;
|
|
785
|
+
}
|
|
786
|
+
function p(e3, { instancePath: s4 = "", parentData: c3, parentDataProperty: g2, rootData: l6 = e3 } = {}) {
|
|
787
|
+
let o9 = null, r2 = 0;
|
|
788
|
+
if (r2 === 0) if (e3 && typeof e3 == "object" && !Array.isArray(e3)) {
|
|
789
|
+
let m5;
|
|
790
|
+
if (e3.projects === void 0 && (m5 = "projects")) return p.errors = [{ instancePath: s4, schemaPath: "#/required", keyword: "required", params: { missingProperty: m5 }, message: "must have required property '" + m5 + "'" }], false;
|
|
791
|
+
{
|
|
792
|
+
let u2 = r2;
|
|
793
|
+
for (let t8 in e3) if (t8 !== "projects") {
|
|
794
|
+
return p.errors = [{ instancePath: s4, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: t8 }, message: "must NOT have additional properties" }], false;
|
|
795
|
+
break;
|
|
796
|
+
}
|
|
797
|
+
if (u2 === r2 && e3.projects !== void 0) {
|
|
798
|
+
let t8 = e3.projects;
|
|
799
|
+
if (r2 === r2) if (Array.isArray(t8)) {
|
|
800
|
+
var a3 = true;
|
|
801
|
+
let b3 = t8.length;
|
|
802
|
+
for (let f3 = 0; f3 < b3; f3++) {
|
|
803
|
+
let P3 = r2;
|
|
804
|
+
i3(t8[f3], { instancePath: s4 + "/projects/" + f3, parentData: t8, parentDataProperty: f3, rootData: l6 }) || (o9 = o9 === null ? i3.errors : o9.concat(i3.errors), r2 = o9.length);
|
|
805
|
+
var a3 = P3 === r2;
|
|
806
|
+
if (!a3) break;
|
|
807
|
+
}
|
|
808
|
+
} else return p.errors = [{ instancePath: s4 + "/projects", schemaPath: "#/properties/projects/type", keyword: "type", params: { type: "array" }, message: "must be array" }], false;
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
} else return p.errors = [{ instancePath: s4, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
812
|
+
return p.errors = o9, r2 === 0;
|
|
813
|
+
}
|
|
814
|
+
function d(e3, { instancePath: s4 = "", parentData: c3, parentDataProperty: g2, rootData: l6 = e3 } = {}) {
|
|
815
|
+
let o9 = null, r2 = 0, a3 = r2;
|
|
816
|
+
i(e3, { instancePath: s4, parentData: c3, parentDataProperty: g2, rootData: l6 }) || (o9 = o9 === null ? i.errors : o9.concat(i.errors), r2 = o9.length);
|
|
817
|
+
var m5 = a3 === r2;
|
|
818
|
+
if (m5) {
|
|
819
|
+
let u2 = r2;
|
|
820
|
+
if (r2 === u2) if (e3 && typeof e3 == "object" && !Array.isArray(e3)) {
|
|
821
|
+
let n7;
|
|
822
|
+
if (e3.data === void 0 && (n7 = "data")) return d.errors = [{ instancePath: s4, schemaPath: "#/allOf/1/required", keyword: "required", params: { missingProperty: n7 }, message: "must have required property '" + n7 + "'" }], false;
|
|
823
|
+
e3.data !== void 0 && (p(e3.data, { instancePath: s4 + "/data", parentData: e3, parentDataProperty: "data", rootData: l6 }) || (o9 = o9 === null ? p.errors : o9.concat(p.errors), r2 = o9.length));
|
|
824
|
+
} else return d.errors = [{ instancePath: s4, schemaPath: "#/allOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
825
|
+
var m5 = u2 === r2;
|
|
826
|
+
}
|
|
827
|
+
return d.errors = o9, r2 === 0;
|
|
828
|
+
}
|
|
829
|
+
var O = d;
|
|
830
|
+
|
|
831
|
+
// ../../packages/contracts/src/generated/endpoints/getV1AgentProjects.ts
|
|
832
|
+
var getV1AgentProjects = {
|
|
833
|
+
method: "GET",
|
|
834
|
+
path: "/v1/agent/projects",
|
|
835
|
+
operation: "GET /v1/agent/projects",
|
|
836
|
+
revision: contractRevision,
|
|
837
|
+
responses: {
|
|
838
|
+
200: { mediaType: "application/json", schemaId: "urn:flowmind:getV1AgentProjects:200", validate: O }
|
|
839
|
+
},
|
|
840
|
+
error: { mediaType: "application/json", schemaId: "ApiErrorEnvelope", validate: h }
|
|
841
|
+
};
|
|
842
|
+
|
|
843
|
+
// ../../packages/contracts/src/generated/validators/getV1AgentRoutines200.js
|
|
844
|
+
var v = { additionalProperties: false, properties: { cadence: { enum: ["DAILY", "WEEKLY"], type: "string" }, durationMinutes: { minimum: 1, type: "integer" }, id: { format: "uuid", type: "string" }, name: { type: "string" } }, required: ["id", "name", "cadence", "durationMinutes"], type: "object" };
|
|
845
|
+
function o3(e3, { instancePath: s4 = "", parentData: c3, parentDataProperty: g2, rootData: d6 = e3 } = {}) {
|
|
846
|
+
let i6 = null, r2 = 0;
|
|
847
|
+
if (r2 === 0) if (e3 && typeof e3 == "object" && !Array.isArray(e3)) {
|
|
848
|
+
let n7;
|
|
849
|
+
if (e3.id === void 0 && (n7 = "id") || e3.name === void 0 && (n7 = "name") || e3.cadence === void 0 && (n7 = "cadence") || e3.durationMinutes === void 0 && (n7 = "durationMinutes")) return o3.errors = [{ instancePath: s4, schemaPath: "#/required", keyword: "required", params: { missingProperty: n7 }, message: "must have required property '" + n7 + "'" }], false;
|
|
850
|
+
{
|
|
851
|
+
let p7 = r2;
|
|
852
|
+
for (let t8 in e3) if (!(t8 === "cadence" || t8 === "durationMinutes" || t8 === "id" || t8 === "name")) {
|
|
853
|
+
return o3.errors = [{ instancePath: s4, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: t8 }, message: "must NOT have additional properties" }], false;
|
|
854
|
+
break;
|
|
855
|
+
}
|
|
856
|
+
if (p7 === r2) {
|
|
857
|
+
if (e3.cadence !== void 0) {
|
|
858
|
+
let t8 = e3.cadence, u2 = r2;
|
|
859
|
+
if (typeof t8 != "string") return o3.errors = [{ instancePath: s4 + "/cadence", schemaPath: "#/properties/cadence/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
860
|
+
if (!(t8 === "DAILY" || t8 === "WEEKLY")) return o3.errors = [{ instancePath: s4 + "/cadence", schemaPath: "#/properties/cadence/enum", keyword: "enum", params: { allowedValues: v.properties.cadence.enum }, message: "must be equal to one of the allowed values" }], false;
|
|
861
|
+
var a3 = u2 === r2;
|
|
862
|
+
} else var a3 = true;
|
|
863
|
+
if (a3) {
|
|
864
|
+
if (e3.durationMinutes !== void 0) {
|
|
865
|
+
let t8 = e3.durationMinutes, u2 = r2;
|
|
866
|
+
if (!(typeof t8 == "number" && !(t8 % 1) && !isNaN(t8) && isFinite(t8))) return o3.errors = [{ instancePath: s4 + "/durationMinutes", schemaPath: "#/properties/durationMinutes/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
867
|
+
if (r2 === u2 && typeof t8 == "number" && isFinite(t8) && (t8 < 1 || isNaN(t8))) return o3.errors = [{ instancePath: s4 + "/durationMinutes", schemaPath: "#/properties/durationMinutes/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }], false;
|
|
868
|
+
var a3 = u2 === r2;
|
|
869
|
+
} else var a3 = true;
|
|
870
|
+
if (a3) {
|
|
871
|
+
if (e3.id !== void 0) {
|
|
872
|
+
let t8 = e3.id, u2 = r2;
|
|
873
|
+
if (r2 === u2 && r2 === u2) if (typeof t8 == "string") {
|
|
874
|
+
if (!a.test(t8)) return o3.errors = [{ instancePath: s4 + "/id", schemaPath: "#/properties/id/format", keyword: "format", params: { format: "uuid" }, message: 'must match format "uuid"' }], false;
|
|
875
|
+
} else return o3.errors = [{ instancePath: s4 + "/id", schemaPath: "#/properties/id/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
876
|
+
var a3 = u2 === r2;
|
|
877
|
+
} else var a3 = true;
|
|
878
|
+
if (a3) if (e3.name !== void 0) {
|
|
879
|
+
let t8 = r2;
|
|
880
|
+
if (typeof e3.name != "string") return o3.errors = [{ instancePath: s4 + "/name", schemaPath: "#/properties/name/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
881
|
+
var a3 = t8 === r2;
|
|
882
|
+
} else var a3 = true;
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
} else return o3.errors = [{ instancePath: s4, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
888
|
+
return o3.errors = i6, r2 === 0;
|
|
889
|
+
}
|
|
890
|
+
function m2(e3, { instancePath: s4 = "", parentData: c3, parentDataProperty: g2, rootData: d6 = e3 } = {}) {
|
|
891
|
+
let i6 = null, r2 = 0;
|
|
892
|
+
if (r2 === 0) if (e3 && typeof e3 == "object" && !Array.isArray(e3)) {
|
|
893
|
+
let n7;
|
|
894
|
+
if (e3.routines === void 0 && (n7 = "routines")) return m2.errors = [{ instancePath: s4, schemaPath: "#/required", keyword: "required", params: { missingProperty: n7 }, message: "must have required property '" + n7 + "'" }], false;
|
|
895
|
+
{
|
|
896
|
+
let p7 = r2;
|
|
897
|
+
for (let t8 in e3) if (t8 !== "routines") {
|
|
898
|
+
return m2.errors = [{ instancePath: s4, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: t8 }, message: "must NOT have additional properties" }], false;
|
|
899
|
+
break;
|
|
900
|
+
}
|
|
901
|
+
if (p7 === r2 && e3.routines !== void 0) {
|
|
902
|
+
let t8 = e3.routines;
|
|
903
|
+
if (r2 === r2) if (Array.isArray(t8)) {
|
|
904
|
+
var a3 = true;
|
|
905
|
+
let b3 = t8.length;
|
|
906
|
+
for (let f3 = 0; f3 < b3; f3++) {
|
|
907
|
+
let P3 = r2;
|
|
908
|
+
o3(t8[f3], { instancePath: s4 + "/routines/" + f3, parentData: t8, parentDataProperty: f3, rootData: d6 }) || (i6 = i6 === null ? o3.errors : i6.concat(o3.errors), r2 = i6.length);
|
|
909
|
+
var a3 = P3 === r2;
|
|
910
|
+
if (!a3) break;
|
|
911
|
+
}
|
|
912
|
+
} else return m2.errors = [{ instancePath: s4 + "/routines", schemaPath: "#/properties/routines/type", keyword: "type", params: { type: "array" }, message: "must be array" }], false;
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
} else return m2.errors = [{ instancePath: s4, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
916
|
+
return m2.errors = i6, r2 === 0;
|
|
917
|
+
}
|
|
918
|
+
function l2(e3, { instancePath: s4 = "", parentData: c3, parentDataProperty: g2, rootData: d6 = e3 } = {}) {
|
|
919
|
+
let i6 = null, r2 = 0, a3 = r2;
|
|
920
|
+
i(e3, { instancePath: s4, parentData: c3, parentDataProperty: g2, rootData: d6 }) || (i6 = i6 === null ? i.errors : i6.concat(i.errors), r2 = i6.length);
|
|
921
|
+
var n7 = a3 === r2;
|
|
922
|
+
if (n7) {
|
|
923
|
+
let p7 = r2;
|
|
924
|
+
if (r2 === p7) if (e3 && typeof e3 == "object" && !Array.isArray(e3)) {
|
|
925
|
+
let u2;
|
|
926
|
+
if (e3.data === void 0 && (u2 = "data")) return l2.errors = [{ instancePath: s4, schemaPath: "#/allOf/1/required", keyword: "required", params: { missingProperty: u2 }, message: "must have required property '" + u2 + "'" }], false;
|
|
927
|
+
e3.data !== void 0 && (m2(e3.data, { instancePath: s4 + "/data", parentData: e3, parentDataProperty: "data", rootData: d6 }) || (i6 = i6 === null ? m2.errors : i6.concat(m2.errors), r2 = i6.length));
|
|
928
|
+
} else return l2.errors = [{ instancePath: s4, schemaPath: "#/allOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
929
|
+
var n7 = p7 === r2;
|
|
930
|
+
}
|
|
931
|
+
return l2.errors = i6, r2 === 0;
|
|
932
|
+
}
|
|
933
|
+
var x = l2;
|
|
934
|
+
|
|
935
|
+
// ../../packages/contracts/src/generated/endpoints/getV1AgentRoutines.ts
|
|
936
|
+
var getV1AgentRoutines = {
|
|
937
|
+
method: "GET",
|
|
938
|
+
path: "/v1/agent/routines",
|
|
939
|
+
operation: "GET /v1/agent/routines",
|
|
940
|
+
revision: contractRevision,
|
|
941
|
+
responses: {
|
|
942
|
+
200: { mediaType: "application/json", schemaId: "urn:flowmind:getV1AgentRoutines:200", validate: x }
|
|
943
|
+
},
|
|
944
|
+
error: { mediaType: "application/json", schemaId: "ApiErrorEnvelope", validate: h }
|
|
945
|
+
};
|
|
946
|
+
|
|
947
|
+
// ../../packages/contracts/src/generated/validators/shared/7XYIXL2V.js
|
|
948
|
+
var t4 = Object.prototype.hasOwnProperty;
|
|
949
|
+
|
|
950
|
+
// ../../packages/contracts/src/generated/validators/shared/OJPHCEXC.js
|
|
951
|
+
var o4 = U().fullFormats.uri;
|
|
952
|
+
|
|
953
|
+
// ../../packages/contracts/src/generated/validators/shared/5N2AMVFP.js
|
|
954
|
+
var w = { additionalProperties: false, properties: { artifactUrl: { format: "uri", nullable: true, type: "string" }, createdAt: { format: "date-time", type: "string" }, createdByApiKeyId: { format: "uuid", nullable: true, type: "string" }, createdTimeEntryId: { format: "uuid", nullable: true, type: "string" }, description: { nullable: true, type: "string" }, durationMinutes: { minimum: 1, type: "integer" }, evidence: { items: { $ref: "urn:flowmind:schema:AgentProposalEvidence" }, type: "array" }, expiresAt: { format: "date-time", type: "string" }, id: { format: "uuid", type: "string" }, note: { type: "string" }, projectId: { format: "uuid", nullable: true, type: "string" }, reviewedAt: { format: "date-time", nullable: true, type: "string" }, routineId: { format: "uuid", nullable: true, type: "string" }, source: { $ref: "urn:flowmind:schema:AgentProposalSource" }, startedAt: { format: "date-time", type: "string" }, status: { enum: ["proposed", "cancelled", "approved", "rejected"], type: "string" }, targetKind: { enum: ["project", "routine", "unassigned"], type: "string" }, updatedAt: { format: "date-time", type: "string" }, webReviewUrl: { format: "uri", type: "string" } }, required: ["id", "status", "targetKind", "projectId", "routineId", "startedAt", "durationMinutes", "description", "note", "artifactUrl", "source", "evidence", "createdByApiKeyId", "expiresAt", "reviewedAt", "createdTimeEntryId", "webReviewUrl", "createdAt", "updatedAt"], type: "object" };
|
|
955
|
+
var A3 = { additionalProperties: false, properties: { externalId: { maxLength: 200, minLength: 1, nullable: true, type: "string" }, kind: { enum: ["calendar_event", "commit", "issue", "linear_issue", "pr", "session_log", "other"], type: "string" }, label: { maxLength: 160, minLength: 1, type: "string" }, url: { format: "uri", maxLength: 500, minLength: 1, nullable: true, type: "string" } }, required: ["kind", "label"], type: "object" };
|
|
956
|
+
function p2(t8, { instancePath: a3 = "", parentData: b3, parentDataProperty: k2, rootData: v3 = t8 } = {}) {
|
|
957
|
+
let l6 = null, e3 = 0;
|
|
958
|
+
if (e3 === 0) if (t8 && typeof t8 == "object" && !Array.isArray(t8)) {
|
|
959
|
+
let u2;
|
|
960
|
+
if (t8.kind === void 0 && (u2 = "kind") || t8.label === void 0 && (u2 = "label")) return p2.errors = [{ instancePath: a3, schemaPath: "#/required", keyword: "required", params: { missingProperty: u2 }, message: "must have required property '" + u2 + "'" }], false;
|
|
961
|
+
{
|
|
962
|
+
let m5 = e3;
|
|
963
|
+
for (let i6 in t8) if (!(i6 === "externalId" || i6 === "kind" || i6 === "label" || i6 === "url")) {
|
|
964
|
+
return p2.errors = [{ instancePath: a3, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: i6 }, message: "must NOT have additional properties" }], false;
|
|
965
|
+
break;
|
|
966
|
+
}
|
|
967
|
+
if (m5 === e3) {
|
|
968
|
+
if (t8.externalId !== void 0) {
|
|
969
|
+
let i6 = t8.externalId, r2 = e3;
|
|
970
|
+
if (typeof i6 != "string" && i6 !== null) return p2.errors = [{ instancePath: a3 + "/externalId", schemaPath: "#/properties/externalId/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
971
|
+
if (e3 === r2 && typeof i6 == "string") {
|
|
972
|
+
if (o(i6) > 200) return p2.errors = [{ instancePath: a3 + "/externalId", schemaPath: "#/properties/externalId/maxLength", keyword: "maxLength", params: { limit: 200 }, message: "must NOT have more than 200 characters" }], false;
|
|
973
|
+
if (o(i6) < 1) return p2.errors = [{ instancePath: a3 + "/externalId", schemaPath: "#/properties/externalId/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }], false;
|
|
974
|
+
}
|
|
975
|
+
var s4 = r2 === e3;
|
|
976
|
+
} else var s4 = true;
|
|
977
|
+
if (s4) {
|
|
978
|
+
if (t8.kind !== void 0) {
|
|
979
|
+
let i6 = t8.kind, r2 = e3;
|
|
980
|
+
if (typeof i6 != "string") return p2.errors = [{ instancePath: a3 + "/kind", schemaPath: "#/properties/kind/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
981
|
+
if (!(i6 === "calendar_event" || i6 === "commit" || i6 === "issue" || i6 === "linear_issue" || i6 === "pr" || i6 === "session_log" || i6 === "other")) return p2.errors = [{ instancePath: a3 + "/kind", schemaPath: "#/properties/kind/enum", keyword: "enum", params: { allowedValues: A3.properties.kind.enum }, message: "must be equal to one of the allowed values" }], false;
|
|
982
|
+
var s4 = r2 === e3;
|
|
983
|
+
} else var s4 = true;
|
|
984
|
+
if (s4) {
|
|
985
|
+
if (t8.label !== void 0) {
|
|
986
|
+
let i6 = t8.label, r2 = e3;
|
|
987
|
+
if (e3 === r2) if (typeof i6 == "string") {
|
|
988
|
+
if (o(i6) > 160) return p2.errors = [{ instancePath: a3 + "/label", schemaPath: "#/properties/label/maxLength", keyword: "maxLength", params: { limit: 160 }, message: "must NOT have more than 160 characters" }], false;
|
|
989
|
+
if (o(i6) < 1) return p2.errors = [{ instancePath: a3 + "/label", schemaPath: "#/properties/label/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }], false;
|
|
990
|
+
} else return p2.errors = [{ instancePath: a3 + "/label", schemaPath: "#/properties/label/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
991
|
+
var s4 = r2 === e3;
|
|
992
|
+
} else var s4 = true;
|
|
993
|
+
if (s4) if (t8.url !== void 0) {
|
|
994
|
+
let i6 = t8.url, r2 = e3;
|
|
995
|
+
if (typeof i6 != "string" && i6 !== null) return p2.errors = [{ instancePath: a3 + "/url", schemaPath: "#/properties/url/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
996
|
+
if (e3 === r2 && e3 === r2 && typeof i6 == "string") {
|
|
997
|
+
if (o(i6) > 500) return p2.errors = [{ instancePath: a3 + "/url", schemaPath: "#/properties/url/maxLength", keyword: "maxLength", params: { limit: 500 }, message: "must NOT have more than 500 characters" }], false;
|
|
998
|
+
if (o(i6) < 1) return p2.errors = [{ instancePath: a3 + "/url", schemaPath: "#/properties/url/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }], false;
|
|
999
|
+
if (!o4(i6)) return p2.errors = [{ instancePath: a3 + "/url", schemaPath: "#/properties/url/format", keyword: "format", params: { format: "uri" }, message: 'must match format "uri"' }], false;
|
|
1000
|
+
}
|
|
1001
|
+
var s4 = r2 === e3;
|
|
1002
|
+
} else var s4 = true;
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
} else return p2.errors = [{ instancePath: a3, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
1008
|
+
return p2.errors = l6, e3 === 0;
|
|
1009
|
+
}
|
|
1010
|
+
var I = { additionalProperties: false, properties: { externalId: { maxLength: 200, minLength: 1, nullable: true, type: "string" }, kind: { enum: ["calendar", "claude_code", "cli", "codex", "github", "linear", "manual", "session_log", "other"], type: "string" }, label: { maxLength: 160, minLength: 1, nullable: true, type: "string" } }, required: ["kind"], type: "object" };
|
|
1011
|
+
function d2(t8, { instancePath: a3 = "", parentData: b3, parentDataProperty: k2, rootData: v3 = t8 } = {}) {
|
|
1012
|
+
let l6 = null, e3 = 0;
|
|
1013
|
+
if (e3 === 0) if (t8 && typeof t8 == "object" && !Array.isArray(t8)) {
|
|
1014
|
+
let u2;
|
|
1015
|
+
if (t8.kind === void 0 && (u2 = "kind")) return d2.errors = [{ instancePath: a3, schemaPath: "#/required", keyword: "required", params: { missingProperty: u2 }, message: "must have required property '" + u2 + "'" }], false;
|
|
1016
|
+
{
|
|
1017
|
+
let m5 = e3;
|
|
1018
|
+
for (let i6 in t8) if (!(i6 === "externalId" || i6 === "kind" || i6 === "label")) {
|
|
1019
|
+
return d2.errors = [{ instancePath: a3, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: i6 }, message: "must NOT have additional properties" }], false;
|
|
1020
|
+
break;
|
|
1021
|
+
}
|
|
1022
|
+
if (m5 === e3) {
|
|
1023
|
+
if (t8.externalId !== void 0) {
|
|
1024
|
+
let i6 = t8.externalId, r2 = e3;
|
|
1025
|
+
if (typeof i6 != "string" && i6 !== null) return d2.errors = [{ instancePath: a3 + "/externalId", schemaPath: "#/properties/externalId/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1026
|
+
if (e3 === r2 && typeof i6 == "string") {
|
|
1027
|
+
if (o(i6) > 200) return d2.errors = [{ instancePath: a3 + "/externalId", schemaPath: "#/properties/externalId/maxLength", keyword: "maxLength", params: { limit: 200 }, message: "must NOT have more than 200 characters" }], false;
|
|
1028
|
+
if (o(i6) < 1) return d2.errors = [{ instancePath: a3 + "/externalId", schemaPath: "#/properties/externalId/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }], false;
|
|
1029
|
+
}
|
|
1030
|
+
var s4 = r2 === e3;
|
|
1031
|
+
} else var s4 = true;
|
|
1032
|
+
if (s4) {
|
|
1033
|
+
if (t8.kind !== void 0) {
|
|
1034
|
+
let i6 = t8.kind, r2 = e3;
|
|
1035
|
+
if (typeof i6 != "string") return d2.errors = [{ instancePath: a3 + "/kind", schemaPath: "#/properties/kind/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1036
|
+
if (!(i6 === "calendar" || i6 === "claude_code" || i6 === "cli" || i6 === "codex" || i6 === "github" || i6 === "linear" || i6 === "manual" || i6 === "session_log" || i6 === "other")) return d2.errors = [{ instancePath: a3 + "/kind", schemaPath: "#/properties/kind/enum", keyword: "enum", params: { allowedValues: I.properties.kind.enum }, message: "must be equal to one of the allowed values" }], false;
|
|
1037
|
+
var s4 = r2 === e3;
|
|
1038
|
+
} else var s4 = true;
|
|
1039
|
+
if (s4) if (t8.label !== void 0) {
|
|
1040
|
+
let i6 = t8.label, r2 = e3;
|
|
1041
|
+
if (typeof i6 != "string" && i6 !== null) return d2.errors = [{ instancePath: a3 + "/label", schemaPath: "#/properties/label/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1042
|
+
if (e3 === r2 && typeof i6 == "string") {
|
|
1043
|
+
if (o(i6) > 160) return d2.errors = [{ instancePath: a3 + "/label", schemaPath: "#/properties/label/maxLength", keyword: "maxLength", params: { limit: 160 }, message: "must NOT have more than 160 characters" }], false;
|
|
1044
|
+
if (o(i6) < 1) return d2.errors = [{ instancePath: a3 + "/label", schemaPath: "#/properties/label/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }], false;
|
|
1045
|
+
}
|
|
1046
|
+
var s4 = r2 === e3;
|
|
1047
|
+
} else var s4 = true;
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
} else return d2.errors = [{ instancePath: a3, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
1052
|
+
return d2.errors = l6, e3 === 0;
|
|
1053
|
+
}
|
|
1054
|
+
function o5(t8, { instancePath: a3 = "", parentData: b3, parentDataProperty: k2, rootData: v3 = t8 } = {}) {
|
|
1055
|
+
let l6 = null, e3 = 0;
|
|
1056
|
+
if (e3 === 0) if (t8 && typeof t8 == "object" && !Array.isArray(t8)) {
|
|
1057
|
+
let m5;
|
|
1058
|
+
if (t8.id === void 0 && (m5 = "id") || t8.status === void 0 && (m5 = "status") || t8.targetKind === void 0 && (m5 = "targetKind") || t8.projectId === void 0 && (m5 = "projectId") || t8.routineId === void 0 && (m5 = "routineId") || t8.startedAt === void 0 && (m5 = "startedAt") || t8.durationMinutes === void 0 && (m5 = "durationMinutes") || t8.description === void 0 && (m5 = "description") || t8.note === void 0 && (m5 = "note") || t8.artifactUrl === void 0 && (m5 = "artifactUrl") || t8.source === void 0 && (m5 = "source") || t8.evidence === void 0 && (m5 = "evidence") || t8.createdByApiKeyId === void 0 && (m5 = "createdByApiKeyId") || t8.expiresAt === void 0 && (m5 = "expiresAt") || t8.reviewedAt === void 0 && (m5 = "reviewedAt") || t8.createdTimeEntryId === void 0 && (m5 = "createdTimeEntryId") || t8.webReviewUrl === void 0 && (m5 = "webReviewUrl") || t8.createdAt === void 0 && (m5 = "createdAt") || t8.updatedAt === void 0 && (m5 = "updatedAt")) return o5.errors = [{ instancePath: a3, schemaPath: "#/required", keyword: "required", params: { missingProperty: m5 }, message: "must have required property '" + m5 + "'" }], false;
|
|
1059
|
+
{
|
|
1060
|
+
let i6 = e3;
|
|
1061
|
+
for (let r2 in t8) if (!t4.call(w.properties, r2)) {
|
|
1062
|
+
return o5.errors = [{ instancePath: a3, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: r2 }, message: "must NOT have additional properties" }], false;
|
|
1063
|
+
break;
|
|
1064
|
+
}
|
|
1065
|
+
if (i6 === e3) {
|
|
1066
|
+
if (t8.artifactUrl !== void 0) {
|
|
1067
|
+
let r2 = t8.artifactUrl, n7 = e3;
|
|
1068
|
+
if (typeof r2 != "string" && r2 !== null) return o5.errors = [{ instancePath: a3 + "/artifactUrl", schemaPath: "#/properties/artifactUrl/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1069
|
+
if (e3 === n7 && e3 === n7 && typeof r2 == "string" && !o4(r2)) return o5.errors = [{ instancePath: a3 + "/artifactUrl", schemaPath: "#/properties/artifactUrl/format", keyword: "format", params: { format: "uri" }, message: 'must match format "uri"' }], false;
|
|
1070
|
+
var s4 = n7 === e3;
|
|
1071
|
+
} else var s4 = true;
|
|
1072
|
+
if (s4) {
|
|
1073
|
+
if (t8.createdAt !== void 0) {
|
|
1074
|
+
let r2 = t8.createdAt, n7 = e3;
|
|
1075
|
+
if (e3 === n7 && e3 === n7) if (typeof r2 == "string") {
|
|
1076
|
+
if (!e.validate(r2)) return o5.errors = [{ instancePath: a3 + "/createdAt", schemaPath: "#/properties/createdAt/format", keyword: "format", params: { format: "date-time" }, message: 'must match format "date-time"' }], false;
|
|
1077
|
+
} else return o5.errors = [{ instancePath: a3 + "/createdAt", schemaPath: "#/properties/createdAt/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1078
|
+
var s4 = n7 === e3;
|
|
1079
|
+
} else var s4 = true;
|
|
1080
|
+
if (s4) {
|
|
1081
|
+
if (t8.createdByApiKeyId !== void 0) {
|
|
1082
|
+
let r2 = t8.createdByApiKeyId, n7 = e3;
|
|
1083
|
+
if (typeof r2 != "string" && r2 !== null) return o5.errors = [{ instancePath: a3 + "/createdByApiKeyId", schemaPath: "#/properties/createdByApiKeyId/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1084
|
+
if (e3 === n7 && e3 === n7 && typeof r2 == "string" && !a.test(r2)) return o5.errors = [{ instancePath: a3 + "/createdByApiKeyId", schemaPath: "#/properties/createdByApiKeyId/format", keyword: "format", params: { format: "uuid" }, message: 'must match format "uuid"' }], false;
|
|
1085
|
+
var s4 = n7 === e3;
|
|
1086
|
+
} else var s4 = true;
|
|
1087
|
+
if (s4) {
|
|
1088
|
+
if (t8.createdTimeEntryId !== void 0) {
|
|
1089
|
+
let r2 = t8.createdTimeEntryId, n7 = e3;
|
|
1090
|
+
if (typeof r2 != "string" && r2 !== null) return o5.errors = [{ instancePath: a3 + "/createdTimeEntryId", schemaPath: "#/properties/createdTimeEntryId/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1091
|
+
if (e3 === n7 && e3 === n7 && typeof r2 == "string" && !a.test(r2)) return o5.errors = [{ instancePath: a3 + "/createdTimeEntryId", schemaPath: "#/properties/createdTimeEntryId/format", keyword: "format", params: { format: "uuid" }, message: 'must match format "uuid"' }], false;
|
|
1092
|
+
var s4 = n7 === e3;
|
|
1093
|
+
} else var s4 = true;
|
|
1094
|
+
if (s4) {
|
|
1095
|
+
if (t8.description !== void 0) {
|
|
1096
|
+
let r2 = t8.description, n7 = e3;
|
|
1097
|
+
if (typeof r2 != "string" && r2 !== null) return o5.errors = [{ instancePath: a3 + "/description", schemaPath: "#/properties/description/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1098
|
+
var s4 = n7 === e3;
|
|
1099
|
+
} else var s4 = true;
|
|
1100
|
+
if (s4) {
|
|
1101
|
+
if (t8.durationMinutes !== void 0) {
|
|
1102
|
+
let r2 = t8.durationMinutes, n7 = e3;
|
|
1103
|
+
if (!(typeof r2 == "number" && !(r2 % 1) && !isNaN(r2) && isFinite(r2))) return o5.errors = [{ instancePath: a3 + "/durationMinutes", schemaPath: "#/properties/durationMinutes/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
1104
|
+
if (e3 === n7 && typeof r2 == "number" && isFinite(r2) && (r2 < 1 || isNaN(r2))) return o5.errors = [{ instancePath: a3 + "/durationMinutes", schemaPath: "#/properties/durationMinutes/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }], false;
|
|
1105
|
+
var s4 = n7 === e3;
|
|
1106
|
+
} else var s4 = true;
|
|
1107
|
+
if (s4) {
|
|
1108
|
+
if (t8.evidence !== void 0) {
|
|
1109
|
+
let r2 = t8.evidence, n7 = e3;
|
|
1110
|
+
if (e3 === n7) if (Array.isArray(r2)) {
|
|
1111
|
+
var u2 = true;
|
|
1112
|
+
let x3 = r2.length;
|
|
1113
|
+
for (let g2 = 0; g2 < x3; g2++) {
|
|
1114
|
+
let _2 = e3;
|
|
1115
|
+
p2(r2[g2], { instancePath: a3 + "/evidence/" + g2, parentData: r2, parentDataProperty: g2, rootData: v3 }) || (l6 = l6 === null ? p2.errors : l6.concat(p2.errors), e3 = l6.length);
|
|
1116
|
+
var u2 = _2 === e3;
|
|
1117
|
+
if (!u2) break;
|
|
1118
|
+
}
|
|
1119
|
+
} else return o5.errors = [{ instancePath: a3 + "/evidence", schemaPath: "#/properties/evidence/type", keyword: "type", params: { type: "array" }, message: "must be array" }], false;
|
|
1120
|
+
var s4 = n7 === e3;
|
|
1121
|
+
} else var s4 = true;
|
|
1122
|
+
if (s4) {
|
|
1123
|
+
if (t8.expiresAt !== void 0) {
|
|
1124
|
+
let r2 = t8.expiresAt, n7 = e3;
|
|
1125
|
+
if (e3 === n7 && e3 === n7) if (typeof r2 == "string") {
|
|
1126
|
+
if (!e.validate(r2)) return o5.errors = [{ instancePath: a3 + "/expiresAt", schemaPath: "#/properties/expiresAt/format", keyword: "format", params: { format: "date-time" }, message: 'must match format "date-time"' }], false;
|
|
1127
|
+
} else return o5.errors = [{ instancePath: a3 + "/expiresAt", schemaPath: "#/properties/expiresAt/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1128
|
+
var s4 = n7 === e3;
|
|
1129
|
+
} else var s4 = true;
|
|
1130
|
+
if (s4) {
|
|
1131
|
+
if (t8.id !== void 0) {
|
|
1132
|
+
let r2 = t8.id, n7 = e3;
|
|
1133
|
+
if (e3 === n7 && e3 === n7) if (typeof r2 == "string") {
|
|
1134
|
+
if (!a.test(r2)) return o5.errors = [{ instancePath: a3 + "/id", schemaPath: "#/properties/id/format", keyword: "format", params: { format: "uuid" }, message: 'must match format "uuid"' }], false;
|
|
1135
|
+
} else return o5.errors = [{ instancePath: a3 + "/id", schemaPath: "#/properties/id/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1136
|
+
var s4 = n7 === e3;
|
|
1137
|
+
} else var s4 = true;
|
|
1138
|
+
if (s4) {
|
|
1139
|
+
if (t8.note !== void 0) {
|
|
1140
|
+
let r2 = e3;
|
|
1141
|
+
if (typeof t8.note != "string") return o5.errors = [{ instancePath: a3 + "/note", schemaPath: "#/properties/note/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1142
|
+
var s4 = r2 === e3;
|
|
1143
|
+
} else var s4 = true;
|
|
1144
|
+
if (s4) {
|
|
1145
|
+
if (t8.projectId !== void 0) {
|
|
1146
|
+
let r2 = t8.projectId, n7 = e3;
|
|
1147
|
+
if (typeof r2 != "string" && r2 !== null) return o5.errors = [{ instancePath: a3 + "/projectId", schemaPath: "#/properties/projectId/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1148
|
+
if (e3 === n7 && e3 === n7 && typeof r2 == "string" && !a.test(r2)) return o5.errors = [{ instancePath: a3 + "/projectId", schemaPath: "#/properties/projectId/format", keyword: "format", params: { format: "uuid" }, message: 'must match format "uuid"' }], false;
|
|
1149
|
+
var s4 = n7 === e3;
|
|
1150
|
+
} else var s4 = true;
|
|
1151
|
+
if (s4) {
|
|
1152
|
+
if (t8.reviewedAt !== void 0) {
|
|
1153
|
+
let r2 = t8.reviewedAt, n7 = e3;
|
|
1154
|
+
if (typeof r2 != "string" && r2 !== null) return o5.errors = [{ instancePath: a3 + "/reviewedAt", schemaPath: "#/properties/reviewedAt/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1155
|
+
if (e3 === n7 && e3 === n7 && typeof r2 == "string" && !e.validate(r2)) return o5.errors = [{ instancePath: a3 + "/reviewedAt", schemaPath: "#/properties/reviewedAt/format", keyword: "format", params: { format: "date-time" }, message: 'must match format "date-time"' }], false;
|
|
1156
|
+
var s4 = n7 === e3;
|
|
1157
|
+
} else var s4 = true;
|
|
1158
|
+
if (s4) {
|
|
1159
|
+
if (t8.routineId !== void 0) {
|
|
1160
|
+
let r2 = t8.routineId, n7 = e3;
|
|
1161
|
+
if (typeof r2 != "string" && r2 !== null) return o5.errors = [{ instancePath: a3 + "/routineId", schemaPath: "#/properties/routineId/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1162
|
+
if (e3 === n7 && e3 === n7 && typeof r2 == "string" && !a.test(r2)) return o5.errors = [{ instancePath: a3 + "/routineId", schemaPath: "#/properties/routineId/format", keyword: "format", params: { format: "uuid" }, message: 'must match format "uuid"' }], false;
|
|
1163
|
+
var s4 = n7 === e3;
|
|
1164
|
+
} else var s4 = true;
|
|
1165
|
+
if (s4) {
|
|
1166
|
+
if (t8.source !== void 0) {
|
|
1167
|
+
let r2 = e3;
|
|
1168
|
+
d2(t8.source, { instancePath: a3 + "/source", parentData: t8, parentDataProperty: "source", rootData: v3 }) || (l6 = l6 === null ? d2.errors : l6.concat(d2.errors), e3 = l6.length);
|
|
1169
|
+
var s4 = r2 === e3;
|
|
1170
|
+
} else var s4 = true;
|
|
1171
|
+
if (s4) {
|
|
1172
|
+
if (t8.startedAt !== void 0) {
|
|
1173
|
+
let r2 = t8.startedAt, n7 = e3;
|
|
1174
|
+
if (e3 === n7 && e3 === n7) if (typeof r2 == "string") {
|
|
1175
|
+
if (!e.validate(r2)) return o5.errors = [{ instancePath: a3 + "/startedAt", schemaPath: "#/properties/startedAt/format", keyword: "format", params: { format: "date-time" }, message: 'must match format "date-time"' }], false;
|
|
1176
|
+
} else return o5.errors = [{ instancePath: a3 + "/startedAt", schemaPath: "#/properties/startedAt/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1177
|
+
var s4 = n7 === e3;
|
|
1178
|
+
} else var s4 = true;
|
|
1179
|
+
if (s4) {
|
|
1180
|
+
if (t8.status !== void 0) {
|
|
1181
|
+
let r2 = t8.status, n7 = e3;
|
|
1182
|
+
if (typeof r2 != "string") return o5.errors = [{ instancePath: a3 + "/status", schemaPath: "#/properties/status/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1183
|
+
if (!(r2 === "proposed" || r2 === "cancelled" || r2 === "approved" || r2 === "rejected")) return o5.errors = [{ instancePath: a3 + "/status", schemaPath: "#/properties/status/enum", keyword: "enum", params: { allowedValues: w.properties.status.enum }, message: "must be equal to one of the allowed values" }], false;
|
|
1184
|
+
var s4 = n7 === e3;
|
|
1185
|
+
} else var s4 = true;
|
|
1186
|
+
if (s4) {
|
|
1187
|
+
if (t8.targetKind !== void 0) {
|
|
1188
|
+
let r2 = t8.targetKind, n7 = e3;
|
|
1189
|
+
if (typeof r2 != "string") return o5.errors = [{ instancePath: a3 + "/targetKind", schemaPath: "#/properties/targetKind/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1190
|
+
if (!(r2 === "project" || r2 === "routine" || r2 === "unassigned")) return o5.errors = [{ instancePath: a3 + "/targetKind", schemaPath: "#/properties/targetKind/enum", keyword: "enum", params: { allowedValues: w.properties.targetKind.enum }, message: "must be equal to one of the allowed values" }], false;
|
|
1191
|
+
var s4 = n7 === e3;
|
|
1192
|
+
} else var s4 = true;
|
|
1193
|
+
if (s4) {
|
|
1194
|
+
if (t8.updatedAt !== void 0) {
|
|
1195
|
+
let r2 = t8.updatedAt, n7 = e3;
|
|
1196
|
+
if (e3 === n7 && e3 === n7) if (typeof r2 == "string") {
|
|
1197
|
+
if (!e.validate(r2)) return o5.errors = [{ instancePath: a3 + "/updatedAt", schemaPath: "#/properties/updatedAt/format", keyword: "format", params: { format: "date-time" }, message: 'must match format "date-time"' }], false;
|
|
1198
|
+
} else return o5.errors = [{ instancePath: a3 + "/updatedAt", schemaPath: "#/properties/updatedAt/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1199
|
+
var s4 = n7 === e3;
|
|
1200
|
+
} else var s4 = true;
|
|
1201
|
+
if (s4) if (t8.webReviewUrl !== void 0) {
|
|
1202
|
+
let r2 = t8.webReviewUrl, n7 = e3;
|
|
1203
|
+
if (e3 === n7 && e3 === n7) if (typeof r2 == "string") {
|
|
1204
|
+
if (!o4(r2)) return o5.errors = [{ instancePath: a3 + "/webReviewUrl", schemaPath: "#/properties/webReviewUrl/format", keyword: "format", params: { format: "uri" }, message: 'must match format "uri"' }], false;
|
|
1205
|
+
} else return o5.errors = [{ instancePath: a3 + "/webReviewUrl", schemaPath: "#/properties/webReviewUrl/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1206
|
+
var s4 = n7 === e3;
|
|
1207
|
+
} else var s4 = true;
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
} else return o5.errors = [{ instancePath: a3, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
1228
|
+
return o5.errors = l6, e3 === 0;
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
// ../../packages/contracts/src/generated/validators/shared/DNKITBL4.js
|
|
1232
|
+
function t5(r2, { instancePath: s4 = "", parentData: f3, parentDataProperty: m5, rootData: l6 = r2 } = {}) {
|
|
1233
|
+
let e3 = null, o9 = 0;
|
|
1234
|
+
if (o9 === 0) if (r2 && typeof r2 == "object" && !Array.isArray(r2)) {
|
|
1235
|
+
let a3;
|
|
1236
|
+
if (r2.proposal === void 0 && (a3 = "proposal")) return t5.errors = [{ instancePath: s4, schemaPath: "#/required", keyword: "required", params: { missingProperty: a3 }, message: "must have required property '" + a3 + "'" }], false;
|
|
1237
|
+
{
|
|
1238
|
+
let n7 = o9;
|
|
1239
|
+
for (let i6 in r2) if (i6 !== "proposal") {
|
|
1240
|
+
return t5.errors = [{ instancePath: s4, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: i6 }, message: "must NOT have additional properties" }], false;
|
|
1241
|
+
break;
|
|
1242
|
+
}
|
|
1243
|
+
n7 === o9 && r2.proposal !== void 0 && (o5(r2.proposal, { instancePath: s4 + "/proposal", parentData: r2, parentDataProperty: "proposal", rootData: l6 }) || (e3 = e3 === null ? o5.errors : e3.concat(o5.errors), o9 = e3.length));
|
|
1244
|
+
}
|
|
1245
|
+
} else return t5.errors = [{ instancePath: s4, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
1246
|
+
return t5.errors = e3, o9 === 0;
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
// ../../packages/contracts/src/generated/validators/postV1AgentLogProposals200.js
|
|
1250
|
+
function o6(r2, { instancePath: s4 = "", parentData: m5, parentDataProperty: u2, rootData: n7 = r2 } = {}) {
|
|
1251
|
+
let e3 = null, t8 = 0, d6 = t8;
|
|
1252
|
+
i(r2, { instancePath: s4, parentData: m5, parentDataProperty: u2, rootData: n7 }) || (e3 = e3 === null ? i.errors : e3.concat(i.errors), t8 = e3.length);
|
|
1253
|
+
var p7 = d6 === t8;
|
|
1254
|
+
if (p7) {
|
|
1255
|
+
let f3 = t8;
|
|
1256
|
+
if (t8 === f3) if (r2 && typeof r2 == "object" && !Array.isArray(r2)) {
|
|
1257
|
+
let i6;
|
|
1258
|
+
if (r2.data === void 0 && (i6 = "data")) return o6.errors = [{ instancePath: s4, schemaPath: "#/allOf/1/required", keyword: "required", params: { missingProperty: i6 }, message: "must have required property '" + i6 + "'" }], false;
|
|
1259
|
+
r2.data !== void 0 && (t5(r2.data, { instancePath: s4 + "/data", parentData: r2, parentDataProperty: "data", rootData: n7 }) || (e3 = e3 === null ? t5.errors : e3.concat(t5.errors), t8 = e3.length));
|
|
1260
|
+
} else return o6.errors = [{ instancePath: s4, schemaPath: "#/allOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
1261
|
+
var p7 = f3 === t8;
|
|
1262
|
+
}
|
|
1263
|
+
return o6.errors = e3, t8 === 0;
|
|
1264
|
+
}
|
|
1265
|
+
var h4 = o6;
|
|
1266
|
+
|
|
1267
|
+
// ../../packages/contracts/src/generated/endpoints/postV1AgentLogProposals.ts
|
|
1268
|
+
var postV1AgentLogProposals = {
|
|
1269
|
+
method: "POST",
|
|
1270
|
+
path: "/v1/agent/log-proposals",
|
|
1271
|
+
operation: "POST /v1/agent/log-proposals",
|
|
1272
|
+
revision: contractRevision,
|
|
1273
|
+
responses: {
|
|
1274
|
+
200: { mediaType: "application/json", schemaId: "urn:flowmind:postV1AgentLogProposals:200", validate: h4 }
|
|
1275
|
+
},
|
|
1276
|
+
error: { mediaType: "application/json", schemaId: "ApiErrorEnvelope", validate: h }
|
|
1277
|
+
};
|
|
1278
|
+
|
|
1279
|
+
// ../../packages/contracts/src/generated/validators/getV1AgentLogProposals200.js
|
|
1280
|
+
function t6(r2, { instancePath: o9 = "", parentData: c3, parentDataProperty: v3, rootData: n7 = r2 } = {}) {
|
|
1281
|
+
let s4 = null, e3 = 0;
|
|
1282
|
+
if (e3 === 0) if (r2 && typeof r2 == "object" && !Array.isArray(r2)) {
|
|
1283
|
+
let i6;
|
|
1284
|
+
if (r2.proposals === void 0 && (i6 = "proposals")) return t6.errors = [{ instancePath: o9, schemaPath: "#/required", keyword: "required", params: { missingProperty: i6 }, message: "must have required property '" + i6 + "'" }], false;
|
|
1285
|
+
{
|
|
1286
|
+
let m5 = e3;
|
|
1287
|
+
for (let a3 in r2) if (a3 !== "proposals") {
|
|
1288
|
+
return t6.errors = [{ instancePath: o9, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: a3 }, message: "must NOT have additional properties" }], false;
|
|
1289
|
+
break;
|
|
1290
|
+
}
|
|
1291
|
+
if (m5 === e3 && r2.proposals !== void 0) {
|
|
1292
|
+
let a3 = r2.proposals;
|
|
1293
|
+
if (e3 === e3) if (Array.isArray(a3)) {
|
|
1294
|
+
var f3 = true;
|
|
1295
|
+
let g2 = a3.length;
|
|
1296
|
+
for (let p7 = 0; p7 < g2; p7++) {
|
|
1297
|
+
let h11 = e3;
|
|
1298
|
+
o5(a3[p7], { instancePath: o9 + "/proposals/" + p7, parentData: a3, parentDataProperty: p7, rootData: n7 }) || (s4 = s4 === null ? o5.errors : s4.concat(o5.errors), e3 = s4.length);
|
|
1299
|
+
var f3 = h11 === e3;
|
|
1300
|
+
if (!f3) break;
|
|
1301
|
+
}
|
|
1302
|
+
} else return t6.errors = [{ instancePath: o9 + "/proposals", schemaPath: "#/properties/proposals/type", keyword: "type", params: { type: "array" }, message: "must be array" }], false;
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
} else return t6.errors = [{ instancePath: o9, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
1306
|
+
return t6.errors = s4, e3 === 0;
|
|
1307
|
+
}
|
|
1308
|
+
function l3(r2, { instancePath: o9 = "", parentData: c3, parentDataProperty: v3, rootData: n7 = r2 } = {}) {
|
|
1309
|
+
let s4 = null, e3 = 0, f3 = e3;
|
|
1310
|
+
i(r2, { instancePath: o9, parentData: c3, parentDataProperty: v3, rootData: n7 }) || (s4 = s4 === null ? i.errors : s4.concat(i.errors), e3 = s4.length);
|
|
1311
|
+
var i6 = f3 === e3;
|
|
1312
|
+
if (i6) {
|
|
1313
|
+
let m5 = e3;
|
|
1314
|
+
if (e3 === m5) if (r2 && typeof r2 == "object" && !Array.isArray(r2)) {
|
|
1315
|
+
let y3;
|
|
1316
|
+
if (r2.data === void 0 && (y3 = "data")) return l3.errors = [{ instancePath: o9, schemaPath: "#/allOf/1/required", keyword: "required", params: { missingProperty: y3 }, message: "must have required property '" + y3 + "'" }], false;
|
|
1317
|
+
r2.data !== void 0 && (t6(r2.data, { instancePath: o9 + "/data", parentData: r2, parentDataProperty: "data", rootData: n7 }) || (s4 = s4 === null ? t6.errors : s4.concat(t6.errors), e3 = s4.length));
|
|
1318
|
+
} else return l3.errors = [{ instancePath: o9, schemaPath: "#/allOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
1319
|
+
var i6 = m5 === e3;
|
|
1320
|
+
}
|
|
1321
|
+
return l3.errors = s4, e3 === 0;
|
|
1322
|
+
}
|
|
1323
|
+
var w2 = l3;
|
|
1324
|
+
|
|
1325
|
+
// ../../packages/contracts/src/generated/endpoints/getV1AgentLogProposals.ts
|
|
1326
|
+
var getV1AgentLogProposals = {
|
|
1327
|
+
method: "GET",
|
|
1328
|
+
path: "/v1/agent/log-proposals",
|
|
1329
|
+
operation: "GET /v1/agent/log-proposals",
|
|
1330
|
+
revision: contractRevision,
|
|
1331
|
+
responses: {
|
|
1332
|
+
200: { mediaType: "application/json", schemaId: "urn:flowmind:getV1AgentLogProposals:200", validate: w2 }
|
|
1333
|
+
},
|
|
1334
|
+
error: { mediaType: "application/json", schemaId: "ApiErrorEnvelope", validate: h }
|
|
1335
|
+
};
|
|
1336
|
+
|
|
1337
|
+
// ../../packages/contracts/src/generated/validators/postV1AgentLogProposalsByProposalIdCancel200.js
|
|
1338
|
+
function s(r2, { instancePath: t8 = "", parentData: m5, parentDataProperty: d6, rootData: n7 = r2 } = {}) {
|
|
1339
|
+
let e3 = null, o9 = 0, u2 = o9;
|
|
1340
|
+
i(r2, { instancePath: t8, parentData: m5, parentDataProperty: d6, rootData: n7 }) || (e3 = e3 === null ? i.errors : e3.concat(i.errors), o9 = e3.length);
|
|
1341
|
+
var p7 = u2 === o9;
|
|
1342
|
+
if (p7) {
|
|
1343
|
+
let f3 = o9;
|
|
1344
|
+
if (o9 === f3) if (r2 && typeof r2 == "object" && !Array.isArray(r2)) {
|
|
1345
|
+
let i6;
|
|
1346
|
+
if (r2.data === void 0 && (i6 = "data")) return s.errors = [{ instancePath: t8, schemaPath: "#/allOf/1/required", keyword: "required", params: { missingProperty: i6 }, message: "must have required property '" + i6 + "'" }], false;
|
|
1347
|
+
r2.data !== void 0 && (t5(r2.data, { instancePath: t8 + "/data", parentData: r2, parentDataProperty: "data", rootData: n7 }) || (e3 = e3 === null ? t5.errors : e3.concat(t5.errors), o9 = e3.length));
|
|
1348
|
+
} else return s.errors = [{ instancePath: t8, schemaPath: "#/allOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
1349
|
+
var p7 = f3 === o9;
|
|
1350
|
+
}
|
|
1351
|
+
return s.errors = e3, o9 === 0;
|
|
1352
|
+
}
|
|
1353
|
+
var h5 = s;
|
|
1354
|
+
|
|
1355
|
+
// ../../packages/contracts/src/generated/endpoints/postV1AgentLogProposalsByProposalIdCancel.ts
|
|
1356
|
+
var postV1AgentLogProposalsByProposalIdCancel = {
|
|
1357
|
+
method: "POST",
|
|
1358
|
+
path: "/v1/agent/log-proposals/{proposalId}/cancel",
|
|
1359
|
+
operation: "POST /v1/agent/log-proposals/{proposalId}/cancel",
|
|
1360
|
+
revision: contractRevision,
|
|
1361
|
+
responses: {
|
|
1362
|
+
200: { mediaType: "application/json", schemaId: "urn:flowmind:postV1AgentLogProposalsByProposalIdCancel:200", validate: h5 }
|
|
1363
|
+
},
|
|
1364
|
+
error: { mediaType: "application/json", schemaId: "ApiErrorEnvelope", validate: h }
|
|
1365
|
+
};
|
|
1366
|
+
|
|
1367
|
+
// ../../packages/contracts/src/generated/validators/postV1AiLog200.js
|
|
1368
|
+
var j2 = { additionalProperties: false, description: "AI log draft response payload", properties: { availableProjects: { items: { $ref: "urn:flowmind:schema:AiLogProject" }, type: "array" }, dayBoundaryMinutes: { enum: [0, 60, 120, 180, 240, 300, 360], type: "integer" }, draft: { $ref: "urn:flowmind:schema:AiLogDraft" }, originalText: { type: "string" }, timezone: { type: "string" }, today: { format: "date", type: "string" } }, required: ["availableProjects", "draft", "originalText", "timezone", "dayBoundaryMinutes", "today"], type: "object" };
|
|
1369
|
+
function d3(e3, { instancePath: a3 = "", parentData: g2, parentDataProperty: v3, rootData: f3 = e3 } = {}) {
|
|
1370
|
+
let o9 = null, r2 = 0;
|
|
1371
|
+
if (r2 === 0) if (e3 && typeof e3 == "object" && !Array.isArray(e3)) {
|
|
1372
|
+
let i6;
|
|
1373
|
+
if (e3.id === void 0 && (i6 = "id") || e3.name === void 0 && (i6 = "name")) return d3.errors = [{ instancePath: a3, schemaPath: "#/required", keyword: "required", params: { missingProperty: i6 }, message: "must have required property '" + i6 + "'" }], false;
|
|
1374
|
+
{
|
|
1375
|
+
let u2 = r2;
|
|
1376
|
+
for (let s4 in e3) if (!(s4 === "id" || s4 === "name")) {
|
|
1377
|
+
return d3.errors = [{ instancePath: a3, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: s4 }, message: "must NOT have additional properties" }], false;
|
|
1378
|
+
break;
|
|
1379
|
+
}
|
|
1380
|
+
if (u2 === r2) {
|
|
1381
|
+
if (e3.id !== void 0) {
|
|
1382
|
+
let s4 = e3.id, t8 = r2;
|
|
1383
|
+
if (r2 === t8 && r2 === t8) if (typeof s4 == "string") {
|
|
1384
|
+
if (!a.test(s4)) return d3.errors = [{ instancePath: a3 + "/id", schemaPath: "#/properties/id/format", keyword: "format", params: { format: "uuid" }, message: 'must match format "uuid"' }], false;
|
|
1385
|
+
} else return d3.errors = [{ instancePath: a3 + "/id", schemaPath: "#/properties/id/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1386
|
+
var n7 = t8 === r2;
|
|
1387
|
+
} else var n7 = true;
|
|
1388
|
+
if (n7) if (e3.name !== void 0) {
|
|
1389
|
+
let s4 = r2;
|
|
1390
|
+
if (typeof e3.name != "string") return d3.errors = [{ instancePath: a3 + "/name", schemaPath: "#/properties/name/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1391
|
+
var n7 = s4 === r2;
|
|
1392
|
+
} else var n7 = true;
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
} else return d3.errors = [{ instancePath: a3, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
1396
|
+
return d3.errors = o9, r2 === 0;
|
|
1397
|
+
}
|
|
1398
|
+
var k = { additionalProperties: false, description: "Suggested capture fields. Date is always unset until the user chooses it.", properties: { date: { enum: [null], nullable: true, type: "object" }, durationMinutes: { maximum: 1440, minimum: 1, nullable: true, type: "integer" }, note: { type: "string" }, projectId: { format: "uuid", nullable: true, type: "string" } }, required: ["date", "durationMinutes", "note", "projectId"], type: "object" };
|
|
1399
|
+
function p3(e3, { instancePath: a3 = "", parentData: g2, parentDataProperty: v3, rootData: f3 = e3 } = {}) {
|
|
1400
|
+
let o9 = null, r2 = 0;
|
|
1401
|
+
if (r2 === 0) if (e3 && typeof e3 == "object" && !Array.isArray(e3)) {
|
|
1402
|
+
let i6;
|
|
1403
|
+
if (e3.date === void 0 && (i6 = "date") || e3.durationMinutes === void 0 && (i6 = "durationMinutes") || e3.note === void 0 && (i6 = "note") || e3.projectId === void 0 && (i6 = "projectId")) return p3.errors = [{ instancePath: a3, schemaPath: "#/required", keyword: "required", params: { missingProperty: i6 }, message: "must have required property '" + i6 + "'" }], false;
|
|
1404
|
+
{
|
|
1405
|
+
let u2 = r2;
|
|
1406
|
+
for (let s4 in e3) if (!(s4 === "date" || s4 === "durationMinutes" || s4 === "note" || s4 === "projectId")) {
|
|
1407
|
+
return p3.errors = [{ instancePath: a3, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: s4 }, message: "must NOT have additional properties" }], false;
|
|
1408
|
+
break;
|
|
1409
|
+
}
|
|
1410
|
+
if (u2 === r2) {
|
|
1411
|
+
if (e3.date !== void 0) {
|
|
1412
|
+
let s4 = e3.date, t8 = r2;
|
|
1413
|
+
if (!(s4 && typeof s4 == "object" && !Array.isArray(s4)) && s4 !== null) return p3.errors = [{ instancePath: a3 + "/date", schemaPath: "#/properties/date/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
1414
|
+
if (s4 !== null) return p3.errors = [{ instancePath: a3 + "/date", schemaPath: "#/properties/date/enum", keyword: "enum", params: { allowedValues: k.properties.date.enum }, message: "must be equal to one of the allowed values" }], false;
|
|
1415
|
+
var n7 = t8 === r2;
|
|
1416
|
+
} else var n7 = true;
|
|
1417
|
+
if (n7) {
|
|
1418
|
+
if (e3.durationMinutes !== void 0) {
|
|
1419
|
+
let s4 = e3.durationMinutes, t8 = r2;
|
|
1420
|
+
if (!(typeof s4 == "number" && !(s4 % 1) && !isNaN(s4) && isFinite(s4)) && s4 !== null) return p3.errors = [{ instancePath: a3 + "/durationMinutes", schemaPath: "#/properties/durationMinutes/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
1421
|
+
if (r2 === t8 && typeof s4 == "number" && isFinite(s4)) {
|
|
1422
|
+
if (s4 > 1440 || isNaN(s4)) return p3.errors = [{ instancePath: a3 + "/durationMinutes", schemaPath: "#/properties/durationMinutes/maximum", keyword: "maximum", params: { comparison: "<=", limit: 1440 }, message: "must be <= 1440" }], false;
|
|
1423
|
+
if (s4 < 1 || isNaN(s4)) return p3.errors = [{ instancePath: a3 + "/durationMinutes", schemaPath: "#/properties/durationMinutes/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }], false;
|
|
1424
|
+
}
|
|
1425
|
+
var n7 = t8 === r2;
|
|
1426
|
+
} else var n7 = true;
|
|
1427
|
+
if (n7) {
|
|
1428
|
+
if (e3.note !== void 0) {
|
|
1429
|
+
let s4 = r2;
|
|
1430
|
+
if (typeof e3.note != "string") return p3.errors = [{ instancePath: a3 + "/note", schemaPath: "#/properties/note/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1431
|
+
var n7 = s4 === r2;
|
|
1432
|
+
} else var n7 = true;
|
|
1433
|
+
if (n7) if (e3.projectId !== void 0) {
|
|
1434
|
+
let s4 = e3.projectId, t8 = r2;
|
|
1435
|
+
if (typeof s4 != "string" && s4 !== null) return p3.errors = [{ instancePath: a3 + "/projectId", schemaPath: "#/properties/projectId/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1436
|
+
if (r2 === t8 && r2 === t8 && typeof s4 == "string" && !a.test(s4)) return p3.errors = [{ instancePath: a3 + "/projectId", schemaPath: "#/properties/projectId/format", keyword: "format", params: { format: "uuid" }, message: 'must match format "uuid"' }], false;
|
|
1437
|
+
var n7 = t8 === r2;
|
|
1438
|
+
} else var n7 = true;
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
} else return p3.errors = [{ instancePath: a3, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
1444
|
+
return p3.errors = o9, r2 === 0;
|
|
1445
|
+
}
|
|
1446
|
+
function m3(e3, { instancePath: a3 = "", parentData: g2, parentDataProperty: v3, rootData: f3 = e3 } = {}) {
|
|
1447
|
+
let o9 = null, r2 = 0;
|
|
1448
|
+
if (r2 === 0) if (e3 && typeof e3 == "object" && !Array.isArray(e3)) {
|
|
1449
|
+
let u2;
|
|
1450
|
+
if (e3.availableProjects === void 0 && (u2 = "availableProjects") || e3.draft === void 0 && (u2 = "draft") || e3.originalText === void 0 && (u2 = "originalText") || e3.timezone === void 0 && (u2 = "timezone") || e3.dayBoundaryMinutes === void 0 && (u2 = "dayBoundaryMinutes") || e3.today === void 0 && (u2 = "today")) return m3.errors = [{ instancePath: a3, schemaPath: "#/required", keyword: "required", params: { missingProperty: u2 }, message: "must have required property '" + u2 + "'" }], false;
|
|
1451
|
+
{
|
|
1452
|
+
let s4 = r2;
|
|
1453
|
+
for (let t8 in e3) if (!(t8 === "availableProjects" || t8 === "dayBoundaryMinutes" || t8 === "draft" || t8 === "originalText" || t8 === "timezone" || t8 === "today")) {
|
|
1454
|
+
return m3.errors = [{ instancePath: a3, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: t8 }, message: "must NOT have additional properties" }], false;
|
|
1455
|
+
break;
|
|
1456
|
+
}
|
|
1457
|
+
if (s4 === r2) {
|
|
1458
|
+
if (e3.availableProjects !== void 0) {
|
|
1459
|
+
let t8 = e3.availableProjects, l6 = r2;
|
|
1460
|
+
if (r2 === l6) if (Array.isArray(t8)) {
|
|
1461
|
+
var n7 = true;
|
|
1462
|
+
let w4 = t8.length;
|
|
1463
|
+
for (let y3 = 0; y3 < w4; y3++) {
|
|
1464
|
+
let M = r2;
|
|
1465
|
+
d3(t8[y3], { instancePath: a3 + "/availableProjects/" + y3, parentData: t8, parentDataProperty: y3, rootData: f3 }) || (o9 = o9 === null ? d3.errors : o9.concat(d3.errors), r2 = o9.length);
|
|
1466
|
+
var n7 = M === r2;
|
|
1467
|
+
if (!n7) break;
|
|
1468
|
+
}
|
|
1469
|
+
} else return m3.errors = [{ instancePath: a3 + "/availableProjects", schemaPath: "#/properties/availableProjects/type", keyword: "type", params: { type: "array" }, message: "must be array" }], false;
|
|
1470
|
+
var i6 = l6 === r2;
|
|
1471
|
+
} else var i6 = true;
|
|
1472
|
+
if (i6) {
|
|
1473
|
+
if (e3.dayBoundaryMinutes !== void 0) {
|
|
1474
|
+
let t8 = e3.dayBoundaryMinutes, l6 = r2;
|
|
1475
|
+
if (!(typeof t8 == "number" && !(t8 % 1) && !isNaN(t8) && isFinite(t8))) return m3.errors = [{ instancePath: a3 + "/dayBoundaryMinutes", schemaPath: "#/properties/dayBoundaryMinutes/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
1476
|
+
if (!(t8 === 0 || t8 === 60 || t8 === 120 || t8 === 180 || t8 === 240 || t8 === 300 || t8 === 360)) return m3.errors = [{ instancePath: a3 + "/dayBoundaryMinutes", schemaPath: "#/properties/dayBoundaryMinutes/enum", keyword: "enum", params: { allowedValues: j2.properties.dayBoundaryMinutes.enum }, message: "must be equal to one of the allowed values" }], false;
|
|
1477
|
+
var i6 = l6 === r2;
|
|
1478
|
+
} else var i6 = true;
|
|
1479
|
+
if (i6) {
|
|
1480
|
+
if (e3.draft !== void 0) {
|
|
1481
|
+
let t8 = r2;
|
|
1482
|
+
p3(e3.draft, { instancePath: a3 + "/draft", parentData: e3, parentDataProperty: "draft", rootData: f3 }) || (o9 = o9 === null ? p3.errors : o9.concat(p3.errors), r2 = o9.length);
|
|
1483
|
+
var i6 = t8 === r2;
|
|
1484
|
+
} else var i6 = true;
|
|
1485
|
+
if (i6) {
|
|
1486
|
+
if (e3.originalText !== void 0) {
|
|
1487
|
+
let t8 = r2;
|
|
1488
|
+
if (typeof e3.originalText != "string") return m3.errors = [{ instancePath: a3 + "/originalText", schemaPath: "#/properties/originalText/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1489
|
+
var i6 = t8 === r2;
|
|
1490
|
+
} else var i6 = true;
|
|
1491
|
+
if (i6) {
|
|
1492
|
+
if (e3.timezone !== void 0) {
|
|
1493
|
+
let t8 = r2;
|
|
1494
|
+
if (typeof e3.timezone != "string") return m3.errors = [{ instancePath: a3 + "/timezone", schemaPath: "#/properties/timezone/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1495
|
+
var i6 = t8 === r2;
|
|
1496
|
+
} else var i6 = true;
|
|
1497
|
+
if (i6) if (e3.today !== void 0) {
|
|
1498
|
+
let t8 = e3.today, l6 = r2;
|
|
1499
|
+
if (r2 === l6 && r2 === l6) if (typeof t8 == "string") {
|
|
1500
|
+
if (!t3.validate(t8)) return m3.errors = [{ instancePath: a3 + "/today", schemaPath: "#/properties/today/format", keyword: "format", params: { format: "date" }, message: 'must match format "date"' }], false;
|
|
1501
|
+
} else return m3.errors = [{ instancePath: a3 + "/today", schemaPath: "#/properties/today/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1502
|
+
var i6 = l6 === r2;
|
|
1503
|
+
} else var i6 = true;
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
} else return m3.errors = [{ instancePath: a3, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
1511
|
+
return m3.errors = o9, r2 === 0;
|
|
1512
|
+
}
|
|
1513
|
+
function c2(e3, { instancePath: a3 = "", parentData: g2, parentDataProperty: v3, rootData: f3 = e3 } = {}) {
|
|
1514
|
+
let o9 = null, r2 = 0, n7 = r2;
|
|
1515
|
+
i(e3, { instancePath: a3, parentData: g2, parentDataProperty: v3, rootData: f3 }) || (o9 = o9 === null ? i.errors : o9.concat(i.errors), r2 = o9.length);
|
|
1516
|
+
var i6 = n7 === r2;
|
|
1517
|
+
if (i6) {
|
|
1518
|
+
let u2 = r2;
|
|
1519
|
+
if (r2 === u2) if (e3 && typeof e3 == "object" && !Array.isArray(e3)) {
|
|
1520
|
+
let t8;
|
|
1521
|
+
if (e3.data === void 0 && (t8 = "data")) return c2.errors = [{ instancePath: a3, schemaPath: "#/allOf/1/required", keyword: "required", params: { missingProperty: t8 }, message: "must have required property '" + t8 + "'" }], false;
|
|
1522
|
+
e3.data !== void 0 && (m3(e3.data, { instancePath: a3 + "/data", parentData: e3, parentDataProperty: "data", rootData: f3 }) || (o9 = o9 === null ? m3.errors : o9.concat(m3.errors), r2 = o9.length));
|
|
1523
|
+
} else return c2.errors = [{ instancePath: a3, schemaPath: "#/allOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
1524
|
+
var i6 = u2 === r2;
|
|
1525
|
+
}
|
|
1526
|
+
return c2.errors = o9, r2 === 0;
|
|
1527
|
+
}
|
|
1528
|
+
var S = c2;
|
|
1529
|
+
|
|
1530
|
+
// ../../packages/contracts/src/generated/endpoints/postV1AiLog.ts
|
|
1531
|
+
var postV1AiLog = {
|
|
1532
|
+
method: "POST",
|
|
1533
|
+
path: "/v1/ai/log",
|
|
1534
|
+
operation: "POST /v1/ai/log",
|
|
1535
|
+
revision: contractRevision,
|
|
1536
|
+
responses: {
|
|
1537
|
+
200: { mediaType: "application/json", schemaId: "urn:flowmind:postV1AiLog:200", validate: S }
|
|
1538
|
+
},
|
|
1539
|
+
error: { mediaType: "application/json", schemaId: "ApiErrorEnvelope", validate: h }
|
|
1540
|
+
};
|
|
1541
|
+
|
|
1542
|
+
// ../../packages/contracts/src/generated/validators/shared/CFYLWXXM.js
|
|
1543
|
+
var l4 = { description: "Create time entry response", properties: { artifactUrl: { format: "uri", nullable: true, type: "string" }, captureSource: { enum: ["unrecorded", "manual", "timer", "ai_text", "voice", "cli", "agent"], type: "string" }, createdAt: { format: "date-time", type: "string" }, description: { nullable: true, type: "string" }, durationSeconds: { minimum: 1, type: "integer" }, id: { format: "uuid", type: "string" }, isFlowSession: { type: "boolean" }, localDay: { format: "date", type: "string" }, localWeekStart: { format: "date", type: "string" }, loggedLate: { type: "boolean" }, milestoneHit: { enum: [100, 500, 1e3, null], nullable: true, type: "integer" }, newBadges: { items: { type: "string" }, type: "array" }, note: { nullable: true, type: "string" }, projectId: { format: "uuid", type: "string" }, startedAt: { format: "date-time", type: "string" }, updatedAt: { format: "date-time", type: "string" }, voidedAt: { format: "date-time", nullable: true, type: "string" }, xpAwarded: { minimum: 0, type: "integer" } }, required: ["id", "projectId", "startedAt", "durationSeconds", "description", "note", "artifactUrl", "isFlowSession", "loggedLate", "captureSource", "localDay", "localWeekStart", "voidedAt", "createdAt", "updatedAt", "milestoneHit", "xpAwarded", "newBadges"], type: "object" };
|
|
1544
|
+
function i4(t8, { instancePath: o9 = "", parentData: v3, parentDataProperty: w4, rootData: A4 = t8 } = {}) {
|
|
1545
|
+
let y3 = null, r2 = 0;
|
|
1546
|
+
if (r2 === 0) if (t8 && typeof t8 == "object" && !Array.isArray(t8)) {
|
|
1547
|
+
let n7;
|
|
1548
|
+
if (t8.id === void 0 && (n7 = "id") || t8.projectId === void 0 && (n7 = "projectId") || t8.startedAt === void 0 && (n7 = "startedAt") || t8.durationSeconds === void 0 && (n7 = "durationSeconds") || t8.description === void 0 && (n7 = "description") || t8.note === void 0 && (n7 = "note") || t8.artifactUrl === void 0 && (n7 = "artifactUrl") || t8.isFlowSession === void 0 && (n7 = "isFlowSession") || t8.loggedLate === void 0 && (n7 = "loggedLate") || t8.captureSource === void 0 && (n7 = "captureSource") || t8.localDay === void 0 && (n7 = "localDay") || t8.localWeekStart === void 0 && (n7 = "localWeekStart") || t8.voidedAt === void 0 && (n7 = "voidedAt") || t8.createdAt === void 0 && (n7 = "createdAt") || t8.updatedAt === void 0 && (n7 = "updatedAt") || t8.milestoneHit === void 0 && (n7 = "milestoneHit") || t8.xpAwarded === void 0 && (n7 = "xpAwarded") || t8.newBadges === void 0 && (n7 = "newBadges")) return i4.errors = [{ instancePath: o9, schemaPath: "#/required", keyword: "required", params: { missingProperty: n7 }, message: "must have required property '" + n7 + "'" }], false;
|
|
1549
|
+
if (t8.artifactUrl !== void 0) {
|
|
1550
|
+
let e3 = t8.artifactUrl, a3 = r2;
|
|
1551
|
+
if (typeof e3 != "string" && e3 !== null) return i4.errors = [{ instancePath: o9 + "/artifactUrl", schemaPath: "#/properties/artifactUrl/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1552
|
+
if (r2 === a3 && r2 === a3 && typeof e3 == "string" && !o4(e3)) return i4.errors = [{ instancePath: o9 + "/artifactUrl", schemaPath: "#/properties/artifactUrl/format", keyword: "format", params: { format: "uri" }, message: 'must match format "uri"' }], false;
|
|
1553
|
+
var s4 = a3 === r2;
|
|
1554
|
+
} else var s4 = true;
|
|
1555
|
+
if (s4) {
|
|
1556
|
+
if (t8.captureSource !== void 0) {
|
|
1557
|
+
let e3 = t8.captureSource, a3 = r2;
|
|
1558
|
+
if (typeof e3 != "string") return i4.errors = [{ instancePath: o9 + "/captureSource", schemaPath: "#/properties/captureSource/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1559
|
+
if (!(e3 === "unrecorded" || e3 === "manual" || e3 === "timer" || e3 === "ai_text" || e3 === "voice" || e3 === "cli" || e3 === "agent")) return i4.errors = [{ instancePath: o9 + "/captureSource", schemaPath: "#/properties/captureSource/enum", keyword: "enum", params: { allowedValues: l4.properties.captureSource.enum }, message: "must be equal to one of the allowed values" }], false;
|
|
1560
|
+
var s4 = a3 === r2;
|
|
1561
|
+
} else var s4 = true;
|
|
1562
|
+
if (s4) {
|
|
1563
|
+
if (t8.createdAt !== void 0) {
|
|
1564
|
+
let e3 = t8.createdAt, a3 = r2;
|
|
1565
|
+
if (r2 === a3 && r2 === a3) if (typeof e3 == "string") {
|
|
1566
|
+
if (!e.validate(e3)) return i4.errors = [{ instancePath: o9 + "/createdAt", schemaPath: "#/properties/createdAt/format", keyword: "format", params: { format: "date-time" }, message: 'must match format "date-time"' }], false;
|
|
1567
|
+
} else return i4.errors = [{ instancePath: o9 + "/createdAt", schemaPath: "#/properties/createdAt/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1568
|
+
var s4 = a3 === r2;
|
|
1569
|
+
} else var s4 = true;
|
|
1570
|
+
if (s4) {
|
|
1571
|
+
if (t8.description !== void 0) {
|
|
1572
|
+
let e3 = t8.description, a3 = r2;
|
|
1573
|
+
if (typeof e3 != "string" && e3 !== null) return i4.errors = [{ instancePath: o9 + "/description", schemaPath: "#/properties/description/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1574
|
+
var s4 = a3 === r2;
|
|
1575
|
+
} else var s4 = true;
|
|
1576
|
+
if (s4) {
|
|
1577
|
+
if (t8.durationSeconds !== void 0) {
|
|
1578
|
+
let e3 = t8.durationSeconds, a3 = r2;
|
|
1579
|
+
if (!(typeof e3 == "number" && !(e3 % 1) && !isNaN(e3) && isFinite(e3))) return i4.errors = [{ instancePath: o9 + "/durationSeconds", schemaPath: "#/properties/durationSeconds/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
1580
|
+
if (r2 === a3 && typeof e3 == "number" && isFinite(e3) && (e3 < 1 || isNaN(e3))) return i4.errors = [{ instancePath: o9 + "/durationSeconds", schemaPath: "#/properties/durationSeconds/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }], false;
|
|
1581
|
+
var s4 = a3 === r2;
|
|
1582
|
+
} else var s4 = true;
|
|
1583
|
+
if (s4) {
|
|
1584
|
+
if (t8.id !== void 0) {
|
|
1585
|
+
let e3 = t8.id, a3 = r2;
|
|
1586
|
+
if (r2 === a3 && r2 === a3) if (typeof e3 == "string") {
|
|
1587
|
+
if (!a.test(e3)) return i4.errors = [{ instancePath: o9 + "/id", schemaPath: "#/properties/id/format", keyword: "format", params: { format: "uuid" }, message: 'must match format "uuid"' }], false;
|
|
1588
|
+
} else return i4.errors = [{ instancePath: o9 + "/id", schemaPath: "#/properties/id/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1589
|
+
var s4 = a3 === r2;
|
|
1590
|
+
} else var s4 = true;
|
|
1591
|
+
if (s4) {
|
|
1592
|
+
if (t8.isFlowSession !== void 0) {
|
|
1593
|
+
let e3 = r2;
|
|
1594
|
+
if (typeof t8.isFlowSession != "boolean") return i4.errors = [{ instancePath: o9 + "/isFlowSession", schemaPath: "#/properties/isFlowSession/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }], false;
|
|
1595
|
+
var s4 = e3 === r2;
|
|
1596
|
+
} else var s4 = true;
|
|
1597
|
+
if (s4) {
|
|
1598
|
+
if (t8.localDay !== void 0) {
|
|
1599
|
+
let e3 = t8.localDay, a3 = r2;
|
|
1600
|
+
if (r2 === a3 && r2 === a3) if (typeof e3 == "string") {
|
|
1601
|
+
if (!t3.validate(e3)) return i4.errors = [{ instancePath: o9 + "/localDay", schemaPath: "#/properties/localDay/format", keyword: "format", params: { format: "date" }, message: 'must match format "date"' }], false;
|
|
1602
|
+
} else return i4.errors = [{ instancePath: o9 + "/localDay", schemaPath: "#/properties/localDay/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1603
|
+
var s4 = a3 === r2;
|
|
1604
|
+
} else var s4 = true;
|
|
1605
|
+
if (s4) {
|
|
1606
|
+
if (t8.localWeekStart !== void 0) {
|
|
1607
|
+
let e3 = t8.localWeekStart, a3 = r2;
|
|
1608
|
+
if (r2 === a3 && r2 === a3) if (typeof e3 == "string") {
|
|
1609
|
+
if (!t3.validate(e3)) return i4.errors = [{ instancePath: o9 + "/localWeekStart", schemaPath: "#/properties/localWeekStart/format", keyword: "format", params: { format: "date" }, message: 'must match format "date"' }], false;
|
|
1610
|
+
} else return i4.errors = [{ instancePath: o9 + "/localWeekStart", schemaPath: "#/properties/localWeekStart/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1611
|
+
var s4 = a3 === r2;
|
|
1612
|
+
} else var s4 = true;
|
|
1613
|
+
if (s4) {
|
|
1614
|
+
if (t8.loggedLate !== void 0) {
|
|
1615
|
+
let e3 = r2;
|
|
1616
|
+
if (typeof t8.loggedLate != "boolean") return i4.errors = [{ instancePath: o9 + "/loggedLate", schemaPath: "#/properties/loggedLate/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }], false;
|
|
1617
|
+
var s4 = e3 === r2;
|
|
1618
|
+
} else var s4 = true;
|
|
1619
|
+
if (s4) {
|
|
1620
|
+
if (t8.milestoneHit !== void 0) {
|
|
1621
|
+
let e3 = t8.milestoneHit, a3 = r2;
|
|
1622
|
+
if (!(typeof e3 == "number" && !(e3 % 1) && !isNaN(e3) && isFinite(e3)) && e3 !== null) return i4.errors = [{ instancePath: o9 + "/milestoneHit", schemaPath: "#/properties/milestoneHit/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
1623
|
+
if (!(e3 === 100 || e3 === 500 || e3 === 1e3 || e3 === null)) return i4.errors = [{ instancePath: o9 + "/milestoneHit", schemaPath: "#/properties/milestoneHit/enum", keyword: "enum", params: { allowedValues: l4.properties.milestoneHit.enum }, message: "must be equal to one of the allowed values" }], false;
|
|
1624
|
+
var s4 = a3 === r2;
|
|
1625
|
+
} else var s4 = true;
|
|
1626
|
+
if (s4) {
|
|
1627
|
+
if (t8.newBadges !== void 0) {
|
|
1628
|
+
let e3 = t8.newBadges, a3 = r2;
|
|
1629
|
+
if (r2 === a3) if (Array.isArray(e3)) {
|
|
1630
|
+
var u2 = true;
|
|
1631
|
+
let g2 = e3.length;
|
|
1632
|
+
for (let m5 = 0; m5 < g2; m5++) {
|
|
1633
|
+
let h11 = r2;
|
|
1634
|
+
if (typeof e3[m5] != "string") return i4.errors = [{ instancePath: o9 + "/newBadges/" + m5, schemaPath: "#/properties/newBadges/items/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1635
|
+
var u2 = h11 === r2;
|
|
1636
|
+
if (!u2) break;
|
|
1637
|
+
}
|
|
1638
|
+
} else return i4.errors = [{ instancePath: o9 + "/newBadges", schemaPath: "#/properties/newBadges/type", keyword: "type", params: { type: "array" }, message: "must be array" }], false;
|
|
1639
|
+
var s4 = a3 === r2;
|
|
1640
|
+
} else var s4 = true;
|
|
1641
|
+
if (s4) {
|
|
1642
|
+
if (t8.note !== void 0) {
|
|
1643
|
+
let e3 = t8.note, a3 = r2;
|
|
1644
|
+
if (typeof e3 != "string" && e3 !== null) return i4.errors = [{ instancePath: o9 + "/note", schemaPath: "#/properties/note/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1645
|
+
var s4 = a3 === r2;
|
|
1646
|
+
} else var s4 = true;
|
|
1647
|
+
if (s4) {
|
|
1648
|
+
if (t8.projectId !== void 0) {
|
|
1649
|
+
let e3 = t8.projectId, a3 = r2;
|
|
1650
|
+
if (r2 === a3 && r2 === a3) if (typeof e3 == "string") {
|
|
1651
|
+
if (!a.test(e3)) return i4.errors = [{ instancePath: o9 + "/projectId", schemaPath: "#/properties/projectId/format", keyword: "format", params: { format: "uuid" }, message: 'must match format "uuid"' }], false;
|
|
1652
|
+
} else return i4.errors = [{ instancePath: o9 + "/projectId", schemaPath: "#/properties/projectId/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1653
|
+
var s4 = a3 === r2;
|
|
1654
|
+
} else var s4 = true;
|
|
1655
|
+
if (s4) {
|
|
1656
|
+
if (t8.startedAt !== void 0) {
|
|
1657
|
+
let e3 = t8.startedAt, a3 = r2;
|
|
1658
|
+
if (r2 === a3 && r2 === a3) if (typeof e3 == "string") {
|
|
1659
|
+
if (!e.validate(e3)) return i4.errors = [{ instancePath: o9 + "/startedAt", schemaPath: "#/properties/startedAt/format", keyword: "format", params: { format: "date-time" }, message: 'must match format "date-time"' }], false;
|
|
1660
|
+
} else return i4.errors = [{ instancePath: o9 + "/startedAt", schemaPath: "#/properties/startedAt/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1661
|
+
var s4 = a3 === r2;
|
|
1662
|
+
} else var s4 = true;
|
|
1663
|
+
if (s4) {
|
|
1664
|
+
if (t8.updatedAt !== void 0) {
|
|
1665
|
+
let e3 = t8.updatedAt, a3 = r2;
|
|
1666
|
+
if (r2 === a3 && r2 === a3) if (typeof e3 == "string") {
|
|
1667
|
+
if (!e.validate(e3)) return i4.errors = [{ instancePath: o9 + "/updatedAt", schemaPath: "#/properties/updatedAt/format", keyword: "format", params: { format: "date-time" }, message: 'must match format "date-time"' }], false;
|
|
1668
|
+
} else return i4.errors = [{ instancePath: o9 + "/updatedAt", schemaPath: "#/properties/updatedAt/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1669
|
+
var s4 = a3 === r2;
|
|
1670
|
+
} else var s4 = true;
|
|
1671
|
+
if (s4) {
|
|
1672
|
+
if (t8.voidedAt !== void 0) {
|
|
1673
|
+
let e3 = t8.voidedAt, a3 = r2;
|
|
1674
|
+
if (typeof e3 != "string" && e3 !== null) return i4.errors = [{ instancePath: o9 + "/voidedAt", schemaPath: "#/properties/voidedAt/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1675
|
+
if (r2 === a3 && r2 === a3 && typeof e3 == "string" && !e.validate(e3)) return i4.errors = [{ instancePath: o9 + "/voidedAt", schemaPath: "#/properties/voidedAt/format", keyword: "format", params: { format: "date-time" }, message: 'must match format "date-time"' }], false;
|
|
1676
|
+
var s4 = a3 === r2;
|
|
1677
|
+
} else var s4 = true;
|
|
1678
|
+
if (s4) if (t8.xpAwarded !== void 0) {
|
|
1679
|
+
let e3 = t8.xpAwarded, a3 = r2;
|
|
1680
|
+
if (!(typeof e3 == "number" && !(e3 % 1) && !isNaN(e3) && isFinite(e3))) return i4.errors = [{ instancePath: o9 + "/xpAwarded", schemaPath: "#/properties/xpAwarded/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
1681
|
+
if (r2 === a3 && typeof e3 == "number" && isFinite(e3) && (e3 < 0 || isNaN(e3))) return i4.errors = [{ instancePath: o9 + "/xpAwarded", schemaPath: "#/properties/xpAwarded/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
1682
|
+
var s4 = a3 === r2;
|
|
1683
|
+
} else var s4 = true;
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
}
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1697
|
+
}
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
} else return i4.errors = [{ instancePath: o9, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
1701
|
+
return i4.errors = y3, r2 === 0;
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
// ../../packages/contracts/src/generated/validators/postV1AiLogConfirm200.js
|
|
1705
|
+
function o7(r2, { instancePath: s4 = "", parentData: m5, parentDataProperty: u2, rootData: n7 = r2 } = {}) {
|
|
1706
|
+
let e3 = null, t8 = 0, d6 = t8;
|
|
1707
|
+
i(r2, { instancePath: s4, parentData: m5, parentDataProperty: u2, rootData: n7 }) || (e3 = e3 === null ? i.errors : e3.concat(i.errors), t8 = e3.length);
|
|
1708
|
+
var f3 = d6 === t8;
|
|
1709
|
+
if (f3) {
|
|
1710
|
+
let p7 = t8;
|
|
1711
|
+
if (t8 === p7) if (r2 && typeof r2 == "object" && !Array.isArray(r2)) {
|
|
1712
|
+
let l6;
|
|
1713
|
+
if (r2.data === void 0 && (l6 = "data")) return o7.errors = [{ instancePath: s4, schemaPath: "#/allOf/1/required", keyword: "required", params: { missingProperty: l6 }, message: "must have required property '" + l6 + "'" }], false;
|
|
1714
|
+
r2.data !== void 0 && (i4(r2.data, { instancePath: s4 + "/data", parentData: r2, parentDataProperty: "data", rootData: n7 }) || (e3 = e3 === null ? i4.errors : e3.concat(i4.errors), t8 = e3.length));
|
|
1715
|
+
} else return o7.errors = [{ instancePath: s4, schemaPath: "#/allOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
1716
|
+
var f3 = p7 === t8;
|
|
1717
|
+
}
|
|
1718
|
+
return o7.errors = e3, t8 === 0;
|
|
1719
|
+
}
|
|
1720
|
+
var h6 = o7;
|
|
1721
|
+
|
|
1722
|
+
// ../../packages/contracts/src/generated/endpoints/postV1AiLogConfirm.ts
|
|
1723
|
+
var postV1AiLogConfirm = {
|
|
1724
|
+
method: "POST",
|
|
1725
|
+
path: "/v1/ai/log/confirm",
|
|
1726
|
+
operation: "POST /v1/ai/log/confirm",
|
|
1727
|
+
revision: contractRevision,
|
|
1728
|
+
responses: {
|
|
1729
|
+
200: { mediaType: "application/json", schemaId: "urn:flowmind:postV1AiLogConfirm:200", validate: h6 }
|
|
1730
|
+
},
|
|
1731
|
+
error: { mediaType: "application/json", schemaId: "ApiErrorEnvelope", validate: h }
|
|
1732
|
+
};
|
|
1733
|
+
|
|
1734
|
+
// ../../packages/contracts/src/generated/validators/postV1TimeEntries200.js
|
|
1735
|
+
function s2(r2, { instancePath: o9 = "", parentData: m5, parentDataProperty: u2, rootData: n7 = r2 } = {}) {
|
|
1736
|
+
let e3 = null, t8 = 0, d6 = t8;
|
|
1737
|
+
i(r2, { instancePath: o9, parentData: m5, parentDataProperty: u2, rootData: n7 }) || (e3 = e3 === null ? i.errors : e3.concat(i.errors), t8 = e3.length);
|
|
1738
|
+
var f3 = d6 === t8;
|
|
1739
|
+
if (f3) {
|
|
1740
|
+
let p7 = t8;
|
|
1741
|
+
if (t8 === p7) if (r2 && typeof r2 == "object" && !Array.isArray(r2)) {
|
|
1742
|
+
let l6;
|
|
1743
|
+
if (r2.data === void 0 && (l6 = "data")) return s2.errors = [{ instancePath: o9, schemaPath: "#/allOf/1/required", keyword: "required", params: { missingProperty: l6 }, message: "must have required property '" + l6 + "'" }], false;
|
|
1744
|
+
r2.data !== void 0 && (i4(r2.data, { instancePath: o9 + "/data", parentData: r2, parentDataProperty: "data", rootData: n7 }) || (e3 = e3 === null ? i4.errors : e3.concat(i4.errors), t8 = e3.length));
|
|
1745
|
+
} else return s2.errors = [{ instancePath: o9, schemaPath: "#/allOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
1746
|
+
var f3 = p7 === t8;
|
|
1747
|
+
}
|
|
1748
|
+
return s2.errors = e3, t8 === 0;
|
|
1749
|
+
}
|
|
1750
|
+
var h7 = s2;
|
|
1751
|
+
|
|
1752
|
+
// ../../packages/contracts/src/generated/endpoints/postV1TimeEntries.ts
|
|
1753
|
+
var postV1TimeEntries = {
|
|
1754
|
+
method: "POST",
|
|
1755
|
+
path: "/v1/time-entries/",
|
|
1756
|
+
operation: "POST /v1/time-entries/",
|
|
1757
|
+
revision: contractRevision,
|
|
1758
|
+
responses: {
|
|
1759
|
+
200: { mediaType: "application/json", schemaId: "urn:flowmind:postV1TimeEntries:200", validate: h7 }
|
|
1760
|
+
},
|
|
1761
|
+
error: { mediaType: "application/json", schemaId: "ApiErrorEnvelope", validate: h }
|
|
1762
|
+
};
|
|
1763
|
+
|
|
1764
|
+
// ../../packages/contracts/src/generated/validators/getV1MePublicStats200.js
|
|
1765
|
+
var H = { additionalProperties: false, properties: { deepWorkHours: { minimum: 0, type: "number" }, level: { minimum: 1, type: "integer" }, levelName: { type: "string" }, memberSince: { format: "date-time", type: "string" }, topProjects: { items: { $ref: "urn:flowmind:schema:PublicStatsItem" }, type: "array" }, topRoutines: { items: { $ref: "urn:flowmind:schema:PublicStatsItem" }, type: "array" }, totalEntries: { minimum: 0, type: "integer" }, totalHours: { minimum: 0, type: "number" }, totalXp: { minimum: 0, type: "integer" } }, required: ["totalHours", "deepWorkHours", "totalEntries", "topProjects", "topRoutines", "level", "levelName", "totalXp", "memberSince"], type: "object" };
|
|
1766
|
+
function p4(e3, { instancePath: i6 = "", parentData: g2, parentDataProperty: b3, rootData: c3 = e3 } = {}) {
|
|
1767
|
+
let m5 = null, r2 = 0;
|
|
1768
|
+
if (r2 === 0) if (e3 && typeof e3 == "object" && !Array.isArray(e3)) {
|
|
1769
|
+
let l6;
|
|
1770
|
+
if (e3.name === void 0 && (l6 = "name") || e3.totalHours === void 0 && (l6 = "totalHours") || e3.color === void 0 && (l6 = "color") || e3.icon === void 0 && (l6 = "icon")) return p4.errors = [{ instancePath: i6, schemaPath: "#/required", keyword: "required", params: { missingProperty: l6 }, message: "must have required property '" + l6 + "'" }], false;
|
|
1771
|
+
{
|
|
1772
|
+
let y3 = r2;
|
|
1773
|
+
for (let o9 in e3) if (!(o9 === "color" || o9 === "icon" || o9 === "name" || o9 === "totalHours")) {
|
|
1774
|
+
return p4.errors = [{ instancePath: i6, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: o9 }, message: "must NOT have additional properties" }], false;
|
|
1775
|
+
break;
|
|
1776
|
+
}
|
|
1777
|
+
if (y3 === r2) {
|
|
1778
|
+
if (e3.color !== void 0) {
|
|
1779
|
+
let o9 = r2;
|
|
1780
|
+
if (typeof e3.color != "string") return p4.errors = [{ instancePath: i6 + "/color", schemaPath: "#/properties/color/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1781
|
+
var s4 = o9 === r2;
|
|
1782
|
+
} else var s4 = true;
|
|
1783
|
+
if (s4) {
|
|
1784
|
+
if (e3.icon !== void 0) {
|
|
1785
|
+
let o9 = r2;
|
|
1786
|
+
if (typeof e3.icon != "string") return p4.errors = [{ instancePath: i6 + "/icon", schemaPath: "#/properties/icon/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1787
|
+
var s4 = o9 === r2;
|
|
1788
|
+
} else var s4 = true;
|
|
1789
|
+
if (s4) {
|
|
1790
|
+
if (e3.name !== void 0) {
|
|
1791
|
+
let o9 = r2;
|
|
1792
|
+
if (typeof e3.name != "string") return p4.errors = [{ instancePath: i6 + "/name", schemaPath: "#/properties/name/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1793
|
+
var s4 = o9 === r2;
|
|
1794
|
+
} else var s4 = true;
|
|
1795
|
+
if (s4) if (e3.totalHours !== void 0) {
|
|
1796
|
+
let o9 = e3.totalHours, f3 = r2;
|
|
1797
|
+
if (r2 === f3) if (typeof o9 == "number" && isFinite(o9)) {
|
|
1798
|
+
if (o9 < 0 || isNaN(o9)) return p4.errors = [{ instancePath: i6 + "/totalHours", schemaPath: "#/properties/totalHours/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
1799
|
+
} else return p4.errors = [{ instancePath: i6 + "/totalHours", schemaPath: "#/properties/totalHours/type", keyword: "type", params: { type: "number" }, message: "must be number" }], false;
|
|
1800
|
+
var s4 = f3 === r2;
|
|
1801
|
+
} else var s4 = true;
|
|
1802
|
+
}
|
|
1803
|
+
}
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
} else return p4.errors = [{ instancePath: i6, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
1807
|
+
return p4.errors = m5, r2 === 0;
|
|
1808
|
+
}
|
|
1809
|
+
function n3(e3, { instancePath: i6 = "", parentData: g2, parentDataProperty: b3, rootData: c3 = e3 } = {}) {
|
|
1810
|
+
let m5 = null, r2 = 0;
|
|
1811
|
+
if (r2 === 0) if (e3 && typeof e3 == "object" && !Array.isArray(e3)) {
|
|
1812
|
+
let o9;
|
|
1813
|
+
if (e3.totalHours === void 0 && (o9 = "totalHours") || e3.deepWorkHours === void 0 && (o9 = "deepWorkHours") || e3.totalEntries === void 0 && (o9 = "totalEntries") || e3.topProjects === void 0 && (o9 = "topProjects") || e3.topRoutines === void 0 && (o9 = "topRoutines") || e3.level === void 0 && (o9 = "level") || e3.levelName === void 0 && (o9 = "levelName") || e3.totalXp === void 0 && (o9 = "totalXp") || e3.memberSince === void 0 && (o9 = "memberSince")) return n3.errors = [{ instancePath: i6, schemaPath: "#/required", keyword: "required", params: { missingProperty: o9 }, message: "must have required property '" + o9 + "'" }], false;
|
|
1814
|
+
{
|
|
1815
|
+
let f3 = r2;
|
|
1816
|
+
for (let t8 in e3) if (!t4.call(H.properties, t8)) {
|
|
1817
|
+
return n3.errors = [{ instancePath: i6, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: t8 }, message: "must NOT have additional properties" }], false;
|
|
1818
|
+
break;
|
|
1819
|
+
}
|
|
1820
|
+
if (f3 === r2) {
|
|
1821
|
+
if (e3.deepWorkHours !== void 0) {
|
|
1822
|
+
let t8 = e3.deepWorkHours, a3 = r2;
|
|
1823
|
+
if (r2 === a3) if (typeof t8 == "number" && isFinite(t8)) {
|
|
1824
|
+
if (t8 < 0 || isNaN(t8)) return n3.errors = [{ instancePath: i6 + "/deepWorkHours", schemaPath: "#/properties/deepWorkHours/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
1825
|
+
} else return n3.errors = [{ instancePath: i6 + "/deepWorkHours", schemaPath: "#/properties/deepWorkHours/type", keyword: "type", params: { type: "number" }, message: "must be number" }], false;
|
|
1826
|
+
var s4 = a3 === r2;
|
|
1827
|
+
} else var s4 = true;
|
|
1828
|
+
if (s4) {
|
|
1829
|
+
if (e3.level !== void 0) {
|
|
1830
|
+
let t8 = e3.level, a3 = r2;
|
|
1831
|
+
if (!(typeof t8 == "number" && !(t8 % 1) && !isNaN(t8) && isFinite(t8))) return n3.errors = [{ instancePath: i6 + "/level", schemaPath: "#/properties/level/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
1832
|
+
if (r2 === a3 && typeof t8 == "number" && isFinite(t8) && (t8 < 1 || isNaN(t8))) return n3.errors = [{ instancePath: i6 + "/level", schemaPath: "#/properties/level/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }], false;
|
|
1833
|
+
var s4 = a3 === r2;
|
|
1834
|
+
} else var s4 = true;
|
|
1835
|
+
if (s4) {
|
|
1836
|
+
if (e3.levelName !== void 0) {
|
|
1837
|
+
let t8 = r2;
|
|
1838
|
+
if (typeof e3.levelName != "string") return n3.errors = [{ instancePath: i6 + "/levelName", schemaPath: "#/properties/levelName/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1839
|
+
var s4 = t8 === r2;
|
|
1840
|
+
} else var s4 = true;
|
|
1841
|
+
if (s4) {
|
|
1842
|
+
if (e3.memberSince !== void 0) {
|
|
1843
|
+
let t8 = e3.memberSince, a3 = r2;
|
|
1844
|
+
if (r2 === a3 && r2 === a3) if (typeof t8 == "string") {
|
|
1845
|
+
if (!e.validate(t8)) return n3.errors = [{ instancePath: i6 + "/memberSince", schemaPath: "#/properties/memberSince/format", keyword: "format", params: { format: "date-time" }, message: 'must match format "date-time"' }], false;
|
|
1846
|
+
} else return n3.errors = [{ instancePath: i6 + "/memberSince", schemaPath: "#/properties/memberSince/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
1847
|
+
var s4 = a3 === r2;
|
|
1848
|
+
} else var s4 = true;
|
|
1849
|
+
if (s4) {
|
|
1850
|
+
if (e3.topProjects !== void 0) {
|
|
1851
|
+
let t8 = e3.topProjects, a3 = r2;
|
|
1852
|
+
if (r2 === a3) if (Array.isArray(t8)) {
|
|
1853
|
+
var l6 = true;
|
|
1854
|
+
let h11 = t8.length;
|
|
1855
|
+
for (let u2 = 0; u2 < h11; u2++) {
|
|
1856
|
+
let P3 = r2;
|
|
1857
|
+
p4(t8[u2], { instancePath: i6 + "/topProjects/" + u2, parentData: t8, parentDataProperty: u2, rootData: c3 }) || (m5 = m5 === null ? p4.errors : m5.concat(p4.errors), r2 = m5.length);
|
|
1858
|
+
var l6 = P3 === r2;
|
|
1859
|
+
if (!l6) break;
|
|
1860
|
+
}
|
|
1861
|
+
} else return n3.errors = [{ instancePath: i6 + "/topProjects", schemaPath: "#/properties/topProjects/type", keyword: "type", params: { type: "array" }, message: "must be array" }], false;
|
|
1862
|
+
var s4 = a3 === r2;
|
|
1863
|
+
} else var s4 = true;
|
|
1864
|
+
if (s4) {
|
|
1865
|
+
if (e3.topRoutines !== void 0) {
|
|
1866
|
+
let t8 = e3.topRoutines, a3 = r2;
|
|
1867
|
+
if (r2 === a3) if (Array.isArray(t8)) {
|
|
1868
|
+
var y3 = true;
|
|
1869
|
+
let h11 = t8.length;
|
|
1870
|
+
for (let u2 = 0; u2 < h11; u2++) {
|
|
1871
|
+
let P3 = r2;
|
|
1872
|
+
p4(t8[u2], { instancePath: i6 + "/topRoutines/" + u2, parentData: t8, parentDataProperty: u2, rootData: c3 }) || (m5 = m5 === null ? p4.errors : m5.concat(p4.errors), r2 = m5.length);
|
|
1873
|
+
var y3 = P3 === r2;
|
|
1874
|
+
if (!y3) break;
|
|
1875
|
+
}
|
|
1876
|
+
} else return n3.errors = [{ instancePath: i6 + "/topRoutines", schemaPath: "#/properties/topRoutines/type", keyword: "type", params: { type: "array" }, message: "must be array" }], false;
|
|
1877
|
+
var s4 = a3 === r2;
|
|
1878
|
+
} else var s4 = true;
|
|
1879
|
+
if (s4) {
|
|
1880
|
+
if (e3.totalEntries !== void 0) {
|
|
1881
|
+
let t8 = e3.totalEntries, a3 = r2;
|
|
1882
|
+
if (!(typeof t8 == "number" && !(t8 % 1) && !isNaN(t8) && isFinite(t8))) return n3.errors = [{ instancePath: i6 + "/totalEntries", schemaPath: "#/properties/totalEntries/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
1883
|
+
if (r2 === a3 && typeof t8 == "number" && isFinite(t8) && (t8 < 0 || isNaN(t8))) return n3.errors = [{ instancePath: i6 + "/totalEntries", schemaPath: "#/properties/totalEntries/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
1884
|
+
var s4 = a3 === r2;
|
|
1885
|
+
} else var s4 = true;
|
|
1886
|
+
if (s4) {
|
|
1887
|
+
if (e3.totalHours !== void 0) {
|
|
1888
|
+
let t8 = e3.totalHours, a3 = r2;
|
|
1889
|
+
if (r2 === a3) if (typeof t8 == "number" && isFinite(t8)) {
|
|
1890
|
+
if (t8 < 0 || isNaN(t8)) return n3.errors = [{ instancePath: i6 + "/totalHours", schemaPath: "#/properties/totalHours/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
1891
|
+
} else return n3.errors = [{ instancePath: i6 + "/totalHours", schemaPath: "#/properties/totalHours/type", keyword: "type", params: { type: "number" }, message: "must be number" }], false;
|
|
1892
|
+
var s4 = a3 === r2;
|
|
1893
|
+
} else var s4 = true;
|
|
1894
|
+
if (s4) if (e3.totalXp !== void 0) {
|
|
1895
|
+
let t8 = e3.totalXp, a3 = r2;
|
|
1896
|
+
if (!(typeof t8 == "number" && !(t8 % 1) && !isNaN(t8) && isFinite(t8))) return n3.errors = [{ instancePath: i6 + "/totalXp", schemaPath: "#/properties/totalXp/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
1897
|
+
if (r2 === a3 && typeof t8 == "number" && isFinite(t8) && (t8 < 0 || isNaN(t8))) return n3.errors = [{ instancePath: i6 + "/totalXp", schemaPath: "#/properties/totalXp/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
1898
|
+
var s4 = a3 === r2;
|
|
1899
|
+
} else var s4 = true;
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1908
|
+
}
|
|
1909
|
+
} else return n3.errors = [{ instancePath: i6, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
1910
|
+
return n3.errors = m5, r2 === 0;
|
|
1911
|
+
}
|
|
1912
|
+
function d4(e3, { instancePath: i6 = "", parentData: g2, parentDataProperty: b3, rootData: c3 = e3 } = {}) {
|
|
1913
|
+
let m5 = null, r2 = 0, s4 = r2;
|
|
1914
|
+
i(e3, { instancePath: i6, parentData: g2, parentDataProperty: b3, rootData: c3 }) || (m5 = m5 === null ? i.errors : m5.concat(i.errors), r2 = m5.length);
|
|
1915
|
+
var l6 = s4 === r2;
|
|
1916
|
+
if (l6) {
|
|
1917
|
+
let y3 = r2;
|
|
1918
|
+
if (r2 === y3) if (e3 && typeof e3 == "object" && !Array.isArray(e3)) {
|
|
1919
|
+
let f3;
|
|
1920
|
+
if (e3.data === void 0 && (f3 = "data")) return d4.errors = [{ instancePath: i6, schemaPath: "#/allOf/1/required", keyword: "required", params: { missingProperty: f3 }, message: "must have required property '" + f3 + "'" }], false;
|
|
1921
|
+
e3.data !== void 0 && (n3(e3.data, { instancePath: i6 + "/data", parentData: e3, parentDataProperty: "data", rootData: c3 }) || (m5 = m5 === null ? n3.errors : m5.concat(n3.errors), r2 = m5.length));
|
|
1922
|
+
} else return d4.errors = [{ instancePath: i6, schemaPath: "#/allOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
1923
|
+
var l6 = y3 === r2;
|
|
1924
|
+
}
|
|
1925
|
+
return d4.errors = m5, r2 === 0;
|
|
1926
|
+
}
|
|
1927
|
+
var R = d4;
|
|
1928
|
+
|
|
1929
|
+
// ../../packages/contracts/src/generated/endpoints/getV1MePublicStats.ts
|
|
1930
|
+
var getV1MePublicStats = {
|
|
1931
|
+
method: "GET",
|
|
1932
|
+
path: "/v1/me/public-stats",
|
|
1933
|
+
operation: "GET /v1/me/public-stats",
|
|
1934
|
+
revision: contractRevision,
|
|
1935
|
+
responses: {
|
|
1936
|
+
200: { mediaType: "application/json", schemaId: "urn:flowmind:getV1MePublicStats:200", validate: R }
|
|
1937
|
+
},
|
|
1938
|
+
error: { mediaType: "application/json", schemaId: "ApiErrorEnvelope", validate: h }
|
|
1939
|
+
};
|
|
1940
|
+
|
|
1941
|
+
// ../../packages/contracts/src/generated/validators/getV1MeStreak200.js
|
|
1942
|
+
function t7(r2, { instancePath: s4 = "", parentData: d6, parentDataProperty: h11, rootData: f3 = r2 } = {}) {
|
|
1943
|
+
let m5 = null, i6 = 0;
|
|
1944
|
+
if (i6 === 0) if (r2 && typeof r2 == "object" && !Array.isArray(r2)) {
|
|
1945
|
+
let o9;
|
|
1946
|
+
if (r2.currentStreak === void 0 && (o9 = "currentStreak") || r2.shields === void 0 && (o9 = "shields") || r2.maxShields === void 0 && (o9 = "maxShields") || r2.nextShieldAt === void 0 && (o9 = "nextShieldAt")) return t7.errors = [{ instancePath: s4, schemaPath: "#/required", keyword: "required", params: { missingProperty: o9 }, message: "must have required property '" + o9 + "'" }], false;
|
|
1947
|
+
{
|
|
1948
|
+
let p7 = i6;
|
|
1949
|
+
for (let e3 in r2) if (!(e3 === "currentStreak" || e3 === "maxShields" || e3 === "nextShieldAt" || e3 === "shields")) {
|
|
1950
|
+
return t7.errors = [{ instancePath: s4, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: e3 }, message: "must NOT have additional properties" }], false;
|
|
1951
|
+
break;
|
|
1952
|
+
}
|
|
1953
|
+
if (p7 === i6) {
|
|
1954
|
+
if (r2.currentStreak !== void 0) {
|
|
1955
|
+
let e3 = r2.currentStreak, a3 = i6;
|
|
1956
|
+
if (!(typeof e3 == "number" && !(e3 % 1) && !isNaN(e3) && isFinite(e3))) return t7.errors = [{ instancePath: s4 + "/currentStreak", schemaPath: "#/properties/currentStreak/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
1957
|
+
if (i6 === a3 && typeof e3 == "number" && isFinite(e3) && (e3 < 0 || isNaN(e3))) return t7.errors = [{ instancePath: s4 + "/currentStreak", schemaPath: "#/properties/currentStreak/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
1958
|
+
var n7 = a3 === i6;
|
|
1959
|
+
} else var n7 = true;
|
|
1960
|
+
if (n7) {
|
|
1961
|
+
if (r2.maxShields !== void 0) {
|
|
1962
|
+
let e3 = r2.maxShields, a3 = i6;
|
|
1963
|
+
if (!(typeof e3 == "number" && !(e3 % 1) && !isNaN(e3) && isFinite(e3))) return t7.errors = [{ instancePath: s4 + "/maxShields", schemaPath: "#/properties/maxShields/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
1964
|
+
if (i6 === a3 && typeof e3 == "number" && isFinite(e3) && (e3 < 1 || isNaN(e3))) return t7.errors = [{ instancePath: s4 + "/maxShields", schemaPath: "#/properties/maxShields/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }], false;
|
|
1965
|
+
var n7 = a3 === i6;
|
|
1966
|
+
} else var n7 = true;
|
|
1967
|
+
if (n7) {
|
|
1968
|
+
if (r2.nextShieldAt !== void 0) {
|
|
1969
|
+
let e3 = r2.nextShieldAt, a3 = i6;
|
|
1970
|
+
if (!(typeof e3 == "number" && !(e3 % 1) && !isNaN(e3) && isFinite(e3))) return t7.errors = [{ instancePath: s4 + "/nextShieldAt", schemaPath: "#/properties/nextShieldAt/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
1971
|
+
if (i6 === a3 && typeof e3 == "number" && isFinite(e3) && (e3 < 7 || isNaN(e3))) return t7.errors = [{ instancePath: s4 + "/nextShieldAt", schemaPath: "#/properties/nextShieldAt/minimum", keyword: "minimum", params: { comparison: ">=", limit: 7 }, message: "must be >= 7" }], false;
|
|
1972
|
+
var n7 = a3 === i6;
|
|
1973
|
+
} else var n7 = true;
|
|
1974
|
+
if (n7) if (r2.shields !== void 0) {
|
|
1975
|
+
let e3 = r2.shields, a3 = i6;
|
|
1976
|
+
if (!(typeof e3 == "number" && !(e3 % 1) && !isNaN(e3) && isFinite(e3))) return t7.errors = [{ instancePath: s4 + "/shields", schemaPath: "#/properties/shields/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
1977
|
+
if (i6 === a3 && typeof e3 == "number" && isFinite(e3) && (e3 < 0 || isNaN(e3))) return t7.errors = [{ instancePath: s4 + "/shields", schemaPath: "#/properties/shields/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
1978
|
+
var n7 = a3 === i6;
|
|
1979
|
+
} else var n7 = true;
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
}
|
|
1984
|
+
} else return t7.errors = [{ instancePath: s4, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
1985
|
+
return t7.errors = m5, i6 === 0;
|
|
1986
|
+
}
|
|
1987
|
+
function l5(r2, { instancePath: s4 = "", parentData: d6, parentDataProperty: h11, rootData: f3 = r2 } = {}) {
|
|
1988
|
+
let m5 = null, i6 = 0, n7 = i6;
|
|
1989
|
+
i(r2, { instancePath: s4, parentData: d6, parentDataProperty: h11, rootData: f3 }) || (m5 = m5 === null ? i.errors : m5.concat(i.errors), i6 = m5.length);
|
|
1990
|
+
var o9 = n7 === i6;
|
|
1991
|
+
if (o9) {
|
|
1992
|
+
let p7 = i6;
|
|
1993
|
+
if (i6 === p7) if (r2 && typeof r2 == "object" && !Array.isArray(r2)) {
|
|
1994
|
+
let a3;
|
|
1995
|
+
if (r2.data === void 0 && (a3 = "data")) return l5.errors = [{ instancePath: s4, schemaPath: "#/allOf/1/required", keyword: "required", params: { missingProperty: a3 }, message: "must have required property '" + a3 + "'" }], false;
|
|
1996
|
+
r2.data !== void 0 && (t7(r2.data, { instancePath: s4 + "/data", parentData: r2, parentDataProperty: "data", rootData: f3 }) || (m5 = m5 === null ? t7.errors : m5.concat(t7.errors), i6 = m5.length));
|
|
1997
|
+
} else return l5.errors = [{ instancePath: s4, schemaPath: "#/allOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
1998
|
+
var o9 = p7 === i6;
|
|
1999
|
+
}
|
|
2000
|
+
return l5.errors = m5, i6 === 0;
|
|
2001
|
+
}
|
|
2002
|
+
var b = l5;
|
|
2003
|
+
|
|
2004
|
+
// ../../packages/contracts/src/generated/endpoints/getV1MeStreak.ts
|
|
2005
|
+
var getV1MeStreak = {
|
|
2006
|
+
method: "GET",
|
|
2007
|
+
path: "/v1/me/streak",
|
|
2008
|
+
operation: "GET /v1/me/streak",
|
|
2009
|
+
revision: contractRevision,
|
|
2010
|
+
responses: {
|
|
2011
|
+
200: { mediaType: "application/json", schemaId: "urn:flowmind:getV1MeStreak:200", validate: b }
|
|
2012
|
+
},
|
|
2013
|
+
error: { mediaType: "application/json", schemaId: "ApiErrorEnvelope", validate: h }
|
|
2014
|
+
};
|
|
2015
|
+
|
|
2016
|
+
// ../../packages/contracts/src/generated/validators/getV1XpSummary200.js
|
|
2017
|
+
function n4(r2, { instancePath: t8 = "", parentData: v3, parentDataProperty: y3, rootData: f3 = r2 } = {}) {
|
|
2018
|
+
let m5 = null, s4 = 0;
|
|
2019
|
+
if (s4 === 0) if (r2 && typeof r2 == "object" && !Array.isArray(r2)) {
|
|
2020
|
+
let o9;
|
|
2021
|
+
if (r2.totalXp === void 0 && (o9 = "totalXp") || r2.level === void 0 && (o9 = "level") || r2.levelName === void 0 && (o9 = "levelName") || r2.xpInCurrentLevel === void 0 && (o9 = "xpInCurrentLevel") || r2.xpToNextLevel === void 0 && (o9 = "xpToNextLevel") || r2.progressPercent === void 0 && (o9 = "progressPercent") || r2.nextLevelName === void 0 && (o9 = "nextLevelName")) return n4.errors = [{ instancePath: t8, schemaPath: "#/required", keyword: "required", params: { missingProperty: o9 }, message: "must have required property '" + o9 + "'" }], false;
|
|
2022
|
+
{
|
|
2023
|
+
let l6 = s4;
|
|
2024
|
+
for (let e3 in r2) if (!(e3 === "level" || e3 === "levelName" || e3 === "nextLevelName" || e3 === "progressPercent" || e3 === "totalXp" || e3 === "xpInCurrentLevel" || e3 === "xpToNextLevel")) {
|
|
2025
|
+
return n4.errors = [{ instancePath: t8, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: e3 }, message: "must NOT have additional properties" }], false;
|
|
2026
|
+
break;
|
|
2027
|
+
}
|
|
2028
|
+
if (l6 === s4) {
|
|
2029
|
+
if (r2.level !== void 0) {
|
|
2030
|
+
let e3 = r2.level, a3 = s4;
|
|
2031
|
+
if (!(typeof e3 == "number" && !(e3 % 1) && !isNaN(e3) && isFinite(e3))) return n4.errors = [{ instancePath: t8 + "/level", schemaPath: "#/properties/level/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
2032
|
+
if (s4 === a3 && typeof e3 == "number" && isFinite(e3) && (e3 < 1 || isNaN(e3))) return n4.errors = [{ instancePath: t8 + "/level", schemaPath: "#/properties/level/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }], false;
|
|
2033
|
+
var i6 = a3 === s4;
|
|
2034
|
+
} else var i6 = true;
|
|
2035
|
+
if (i6) {
|
|
2036
|
+
if (r2.levelName !== void 0) {
|
|
2037
|
+
let e3 = s4;
|
|
2038
|
+
if (typeof r2.levelName != "string") return n4.errors = [{ instancePath: t8 + "/levelName", schemaPath: "#/properties/levelName/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
2039
|
+
var i6 = e3 === s4;
|
|
2040
|
+
} else var i6 = true;
|
|
2041
|
+
if (i6) {
|
|
2042
|
+
if (r2.nextLevelName !== void 0) {
|
|
2043
|
+
let e3 = r2.nextLevelName, a3 = s4;
|
|
2044
|
+
if (typeof e3 != "string" && e3 !== null) return n4.errors = [{ instancePath: t8 + "/nextLevelName", schemaPath: "#/properties/nextLevelName/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
2045
|
+
var i6 = a3 === s4;
|
|
2046
|
+
} else var i6 = true;
|
|
2047
|
+
if (i6) {
|
|
2048
|
+
if (r2.progressPercent !== void 0) {
|
|
2049
|
+
let e3 = r2.progressPercent, a3 = s4;
|
|
2050
|
+
if (!(typeof e3 == "number" && !(e3 % 1) && !isNaN(e3) && isFinite(e3))) return n4.errors = [{ instancePath: t8 + "/progressPercent", schemaPath: "#/properties/progressPercent/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
2051
|
+
if (s4 === a3 && typeof e3 == "number" && isFinite(e3)) {
|
|
2052
|
+
if (e3 > 100 || isNaN(e3)) return n4.errors = [{ instancePath: t8 + "/progressPercent", schemaPath: "#/properties/progressPercent/maximum", keyword: "maximum", params: { comparison: "<=", limit: 100 }, message: "must be <= 100" }], false;
|
|
2053
|
+
if (e3 < 0 || isNaN(e3)) return n4.errors = [{ instancePath: t8 + "/progressPercent", schemaPath: "#/properties/progressPercent/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
2054
|
+
}
|
|
2055
|
+
var i6 = a3 === s4;
|
|
2056
|
+
} else var i6 = true;
|
|
2057
|
+
if (i6) {
|
|
2058
|
+
if (r2.totalXp !== void 0) {
|
|
2059
|
+
let e3 = r2.totalXp, a3 = s4;
|
|
2060
|
+
if (!(typeof e3 == "number" && !(e3 % 1) && !isNaN(e3) && isFinite(e3))) return n4.errors = [{ instancePath: t8 + "/totalXp", schemaPath: "#/properties/totalXp/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
2061
|
+
if (s4 === a3 && typeof e3 == "number" && isFinite(e3) && (e3 < 0 || isNaN(e3))) return n4.errors = [{ instancePath: t8 + "/totalXp", schemaPath: "#/properties/totalXp/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
2062
|
+
var i6 = a3 === s4;
|
|
2063
|
+
} else var i6 = true;
|
|
2064
|
+
if (i6) {
|
|
2065
|
+
if (r2.xpInCurrentLevel !== void 0) {
|
|
2066
|
+
let e3 = r2.xpInCurrentLevel, a3 = s4;
|
|
2067
|
+
if (!(typeof e3 == "number" && !(e3 % 1) && !isNaN(e3) && isFinite(e3))) return n4.errors = [{ instancePath: t8 + "/xpInCurrentLevel", schemaPath: "#/properties/xpInCurrentLevel/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
2068
|
+
if (s4 === a3 && typeof e3 == "number" && isFinite(e3) && (e3 < 0 || isNaN(e3))) return n4.errors = [{ instancePath: t8 + "/xpInCurrentLevel", schemaPath: "#/properties/xpInCurrentLevel/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
2069
|
+
var i6 = a3 === s4;
|
|
2070
|
+
} else var i6 = true;
|
|
2071
|
+
if (i6) if (r2.xpToNextLevel !== void 0) {
|
|
2072
|
+
let e3 = r2.xpToNextLevel, a3 = s4;
|
|
2073
|
+
if (!(typeof e3 == "number" && !(e3 % 1) && !isNaN(e3) && isFinite(e3))) return n4.errors = [{ instancePath: t8 + "/xpToNextLevel", schemaPath: "#/properties/xpToNextLevel/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
2074
|
+
if (s4 === a3 && typeof e3 == "number" && isFinite(e3) && (e3 < 0 || isNaN(e3))) return n4.errors = [{ instancePath: t8 + "/xpToNextLevel", schemaPath: "#/properties/xpToNextLevel/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
2075
|
+
var i6 = a3 === s4;
|
|
2076
|
+
} else var i6 = true;
|
|
2077
|
+
}
|
|
2078
|
+
}
|
|
2079
|
+
}
|
|
2080
|
+
}
|
|
2081
|
+
}
|
|
2082
|
+
}
|
|
2083
|
+
}
|
|
2084
|
+
} else return n4.errors = [{ instancePath: t8, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
2085
|
+
return n4.errors = m5, s4 === 0;
|
|
2086
|
+
}
|
|
2087
|
+
function p5(r2, { instancePath: t8 = "", parentData: v3, parentDataProperty: y3, rootData: f3 = r2 } = {}) {
|
|
2088
|
+
let m5 = null, s4 = 0, i6 = s4;
|
|
2089
|
+
i(r2, { instancePath: t8, parentData: v3, parentDataProperty: y3, rootData: f3 }) || (m5 = m5 === null ? i.errors : m5.concat(i.errors), s4 = m5.length);
|
|
2090
|
+
var o9 = i6 === s4;
|
|
2091
|
+
if (o9) {
|
|
2092
|
+
let l6 = s4;
|
|
2093
|
+
if (s4 === l6) if (r2 && typeof r2 == "object" && !Array.isArray(r2)) {
|
|
2094
|
+
let a3;
|
|
2095
|
+
if (r2.data === void 0 && (a3 = "data")) return p5.errors = [{ instancePath: t8, schemaPath: "#/allOf/1/required", keyword: "required", params: { missingProperty: a3 }, message: "must have required property '" + a3 + "'" }], false;
|
|
2096
|
+
r2.data !== void 0 && (n4(r2.data, { instancePath: t8 + "/data", parentData: r2, parentDataProperty: "data", rootData: f3 }) || (m5 = m5 === null ? n4.errors : m5.concat(n4.errors), s4 = m5.length));
|
|
2097
|
+
} else return p5.errors = [{ instancePath: t8, schemaPath: "#/allOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
2098
|
+
var o9 = l6 === s4;
|
|
2099
|
+
}
|
|
2100
|
+
return p5.errors = m5, s4 === 0;
|
|
2101
|
+
}
|
|
2102
|
+
var h8 = p5;
|
|
2103
|
+
|
|
2104
|
+
// ../../packages/contracts/src/generated/endpoints/getV1XpSummary.ts
|
|
2105
|
+
var getV1XpSummary = {
|
|
2106
|
+
method: "GET",
|
|
2107
|
+
path: "/v1/xp/summary",
|
|
2108
|
+
operation: "GET /v1/xp/summary",
|
|
2109
|
+
revision: contractRevision,
|
|
2110
|
+
responses: {
|
|
2111
|
+
200: { mediaType: "application/json", schemaId: "urn:flowmind:getV1XpSummary:200", validate: h8 }
|
|
2112
|
+
},
|
|
2113
|
+
error: { mediaType: "application/json", schemaId: "ApiErrorEnvelope", validate: h }
|
|
2114
|
+
};
|
|
2115
|
+
|
|
2116
|
+
// ../../packages/contracts/src/generated/validators/getV1MeBadges200.js
|
|
2117
|
+
function p6(e3, { instancePath: i6 = "", parentData: h11, parentDataProperty: g2, rootData: f3 = e3 } = {}) {
|
|
2118
|
+
let o9 = null, r2 = 0;
|
|
2119
|
+
if (r2 === 0) if (e3 && typeof e3 == "object" && !Array.isArray(e3)) {
|
|
2120
|
+
let n7;
|
|
2121
|
+
if (e3.id === void 0 && (n7 = "id") || e3.name === void 0 && (n7 = "name") || e3.description === void 0 && (n7 = "description") || e3.icon === void 0 && (n7 = "icon") || e3.threshold === void 0 && (n7 = "threshold") || e3.earnedAt === void 0 && (n7 = "earnedAt")) return p6.errors = [{ instancePath: i6, schemaPath: "#/required", keyword: "required", params: { missingProperty: n7 }, message: "must have required property '" + n7 + "'" }], false;
|
|
2122
|
+
{
|
|
2123
|
+
let l6 = r2;
|
|
2124
|
+
for (let s4 in e3) if (!(s4 === "description" || s4 === "earnedAt" || s4 === "icon" || s4 === "id" || s4 === "name" || s4 === "threshold")) {
|
|
2125
|
+
return p6.errors = [{ instancePath: i6, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: s4 }, message: "must NOT have additional properties" }], false;
|
|
2126
|
+
break;
|
|
2127
|
+
}
|
|
2128
|
+
if (l6 === r2) {
|
|
2129
|
+
if (e3.description !== void 0) {
|
|
2130
|
+
let s4 = r2;
|
|
2131
|
+
if (typeof e3.description != "string") return p6.errors = [{ instancePath: i6 + "/description", schemaPath: "#/properties/description/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
2132
|
+
var a3 = s4 === r2;
|
|
2133
|
+
} else var a3 = true;
|
|
2134
|
+
if (a3) {
|
|
2135
|
+
if (e3.earnedAt !== void 0) {
|
|
2136
|
+
let s4 = e3.earnedAt, t8 = r2;
|
|
2137
|
+
if (r2 === t8 && r2 === t8) if (typeof s4 == "string") {
|
|
2138
|
+
if (!e.validate(s4)) return p6.errors = [{ instancePath: i6 + "/earnedAt", schemaPath: "#/properties/earnedAt/format", keyword: "format", params: { format: "date-time" }, message: 'must match format "date-time"' }], false;
|
|
2139
|
+
} else return p6.errors = [{ instancePath: i6 + "/earnedAt", schemaPath: "#/properties/earnedAt/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
2140
|
+
var a3 = t8 === r2;
|
|
2141
|
+
} else var a3 = true;
|
|
2142
|
+
if (a3) {
|
|
2143
|
+
if (e3.icon !== void 0) {
|
|
2144
|
+
let s4 = r2;
|
|
2145
|
+
if (typeof e3.icon != "string") return p6.errors = [{ instancePath: i6 + "/icon", schemaPath: "#/properties/icon/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
2146
|
+
var a3 = s4 === r2;
|
|
2147
|
+
} else var a3 = true;
|
|
2148
|
+
if (a3) {
|
|
2149
|
+
if (e3.id !== void 0) {
|
|
2150
|
+
let s4 = r2;
|
|
2151
|
+
if (typeof e3.id != "string") return p6.errors = [{ instancePath: i6 + "/id", schemaPath: "#/properties/id/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
2152
|
+
var a3 = s4 === r2;
|
|
2153
|
+
} else var a3 = true;
|
|
2154
|
+
if (a3) {
|
|
2155
|
+
if (e3.name !== void 0) {
|
|
2156
|
+
let s4 = r2;
|
|
2157
|
+
if (typeof e3.name != "string") return p6.errors = [{ instancePath: i6 + "/name", schemaPath: "#/properties/name/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
2158
|
+
var a3 = s4 === r2;
|
|
2159
|
+
} else var a3 = true;
|
|
2160
|
+
if (a3) if (e3.threshold !== void 0) {
|
|
2161
|
+
let s4 = e3.threshold, t8 = r2;
|
|
2162
|
+
if (!(typeof s4 == "number" && !(s4 % 1) && !isNaN(s4) && isFinite(s4))) return p6.errors = [{ instancePath: i6 + "/threshold", schemaPath: "#/properties/threshold/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
2163
|
+
if (r2 === t8 && typeof s4 == "number" && isFinite(s4) && (s4 < 0 || isNaN(s4))) return p6.errors = [{ instancePath: i6 + "/threshold", schemaPath: "#/properties/threshold/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
2164
|
+
var a3 = t8 === r2;
|
|
2165
|
+
} else var a3 = true;
|
|
2166
|
+
}
|
|
2167
|
+
}
|
|
2168
|
+
}
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
}
|
|
2172
|
+
} else return p6.errors = [{ instancePath: i6, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
2173
|
+
return p6.errors = o9, r2 === 0;
|
|
2174
|
+
}
|
|
2175
|
+
function m4(e3, { instancePath: i6 = "", parentData: h11, parentDataProperty: g2, rootData: f3 = e3 } = {}) {
|
|
2176
|
+
let o9 = null, r2 = 0;
|
|
2177
|
+
if (r2 === 0) if (e3 && typeof e3 == "object" && !Array.isArray(e3)) {
|
|
2178
|
+
let l6;
|
|
2179
|
+
if (e3.badges === void 0 && (l6 = "badges") || e3.total === void 0 && (l6 = "total")) return m4.errors = [{ instancePath: i6, schemaPath: "#/required", keyword: "required", params: { missingProperty: l6 }, message: "must have required property '" + l6 + "'" }], false;
|
|
2180
|
+
{
|
|
2181
|
+
let s4 = r2;
|
|
2182
|
+
for (let t8 in e3) if (!(t8 === "badges" || t8 === "total")) {
|
|
2183
|
+
return m4.errors = [{ instancePath: i6, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: t8 }, message: "must NOT have additional properties" }], false;
|
|
2184
|
+
break;
|
|
2185
|
+
}
|
|
2186
|
+
if (s4 === r2) {
|
|
2187
|
+
if (e3.badges !== void 0) {
|
|
2188
|
+
let t8 = e3.badges, d6 = r2;
|
|
2189
|
+
if (r2 === d6) if (Array.isArray(t8)) {
|
|
2190
|
+
var a3 = true;
|
|
2191
|
+
let b3 = t8.length;
|
|
2192
|
+
for (let u2 = 0; u2 < b3; u2++) {
|
|
2193
|
+
let P3 = r2;
|
|
2194
|
+
p6(t8[u2], { instancePath: i6 + "/badges/" + u2, parentData: t8, parentDataProperty: u2, rootData: f3 }) || (o9 = o9 === null ? p6.errors : o9.concat(p6.errors), r2 = o9.length);
|
|
2195
|
+
var a3 = P3 === r2;
|
|
2196
|
+
if (!a3) break;
|
|
2197
|
+
}
|
|
2198
|
+
} else return m4.errors = [{ instancePath: i6 + "/badges", schemaPath: "#/properties/badges/type", keyword: "type", params: { type: "array" }, message: "must be array" }], false;
|
|
2199
|
+
var n7 = d6 === r2;
|
|
2200
|
+
} else var n7 = true;
|
|
2201
|
+
if (n7) if (e3.total !== void 0) {
|
|
2202
|
+
let t8 = e3.total, d6 = r2;
|
|
2203
|
+
if (!(typeof t8 == "number" && !(t8 % 1) && !isNaN(t8) && isFinite(t8))) return m4.errors = [{ instancePath: i6 + "/total", schemaPath: "#/properties/total/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
2204
|
+
if (r2 === d6 && typeof t8 == "number" && isFinite(t8) && (t8 < 0 || isNaN(t8))) return m4.errors = [{ instancePath: i6 + "/total", schemaPath: "#/properties/total/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
2205
|
+
var n7 = d6 === r2;
|
|
2206
|
+
} else var n7 = true;
|
|
2207
|
+
}
|
|
2208
|
+
}
|
|
2209
|
+
} else return m4.errors = [{ instancePath: i6, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
2210
|
+
return m4.errors = o9, r2 === 0;
|
|
2211
|
+
}
|
|
2212
|
+
function y(e3, { instancePath: i6 = "", parentData: h11, parentDataProperty: g2, rootData: f3 = e3 } = {}) {
|
|
2213
|
+
let o9 = null, r2 = 0, a3 = r2;
|
|
2214
|
+
i(e3, { instancePath: i6, parentData: h11, parentDataProperty: g2, rootData: f3 }) || (o9 = o9 === null ? i.errors : o9.concat(i.errors), r2 = o9.length);
|
|
2215
|
+
var n7 = a3 === r2;
|
|
2216
|
+
if (n7) {
|
|
2217
|
+
let l6 = r2;
|
|
2218
|
+
if (r2 === l6) if (e3 && typeof e3 == "object" && !Array.isArray(e3)) {
|
|
2219
|
+
let t8;
|
|
2220
|
+
if (e3.data === void 0 && (t8 = "data")) return y.errors = [{ instancePath: i6, schemaPath: "#/allOf/1/required", keyword: "required", params: { missingProperty: t8 }, message: "must have required property '" + t8 + "'" }], false;
|
|
2221
|
+
e3.data !== void 0 && (m4(e3.data, { instancePath: i6 + "/data", parentData: e3, parentDataProperty: "data", rootData: f3 }) || (o9 = o9 === null ? m4.errors : o9.concat(m4.errors), r2 = o9.length));
|
|
2222
|
+
} else return y.errors = [{ instancePath: i6, schemaPath: "#/allOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
2223
|
+
var n7 = l6 === r2;
|
|
2224
|
+
}
|
|
2225
|
+
return y.errors = o9, r2 === 0;
|
|
2226
|
+
}
|
|
2227
|
+
var x2 = y;
|
|
2228
|
+
|
|
2229
|
+
// ../../packages/contracts/src/generated/endpoints/getV1MeBadges.ts
|
|
2230
|
+
var getV1MeBadges = {
|
|
2231
|
+
method: "GET",
|
|
2232
|
+
path: "/v1/me/badges",
|
|
2233
|
+
operation: "GET /v1/me/badges",
|
|
2234
|
+
revision: contractRevision,
|
|
2235
|
+
responses: {
|
|
2236
|
+
200: { mediaType: "application/json", schemaId: "urn:flowmind:getV1MeBadges:200", validate: x2 }
|
|
2237
|
+
},
|
|
2238
|
+
error: { mediaType: "application/json", schemaId: "ApiErrorEnvelope", validate: h }
|
|
2239
|
+
};
|
|
2240
|
+
|
|
2241
|
+
// ../../packages/contracts/src/generated/validators/getV1HourBank200.js
|
|
2242
|
+
var _ = { additionalProperties: false, description: "Hour bank totals per routine/project", properties: { color: { nullable: true, type: "string" }, icon: { nullable: true, type: "string" }, id: { format: "uuid", type: "string" }, kind: { enum: ["routine", "project"], type: "string" }, name: { type: "string" }, recentDays: { items: { additionalProperties: false, properties: { date: { type: "string" }, seconds: { type: "number" } }, required: ["date", "seconds"], type: "object" }, type: "array" }, totalHours: { type: "number" }, totalSeconds: { type: "number" } }, required: ["id", "kind", "name", "color", "icon", "totalSeconds", "totalHours", "recentDays"], type: "object" };
|
|
2243
|
+
function i5(r2, { instancePath: s4 = "", parentData: k2, parentDataProperty: P3, rootData: g2 = r2 } = {}) {
|
|
2244
|
+
let n7 = null, e3 = 0;
|
|
2245
|
+
if (e3 === 0) if (r2 && typeof r2 == "object" && !Array.isArray(r2)) {
|
|
2246
|
+
let l6;
|
|
2247
|
+
if (r2.id === void 0 && (l6 = "id") || r2.kind === void 0 && (l6 = "kind") || r2.name === void 0 && (l6 = "name") || r2.color === void 0 && (l6 = "color") || r2.icon === void 0 && (l6 = "icon") || r2.totalSeconds === void 0 && (l6 = "totalSeconds") || r2.totalHours === void 0 && (l6 = "totalHours") || r2.recentDays === void 0 && (l6 = "recentDays")) return i5.errors = [{ instancePath: s4, schemaPath: "#/required", keyword: "required", params: { missingProperty: l6 }, message: "must have required property '" + l6 + "'" }], false;
|
|
2248
|
+
{
|
|
2249
|
+
let c3 = e3;
|
|
2250
|
+
for (let t8 in r2) if (!(t8 === "color" || t8 === "icon" || t8 === "id" || t8 === "kind" || t8 === "name" || t8 === "recentDays" || t8 === "totalHours" || t8 === "totalSeconds")) {
|
|
2251
|
+
return i5.errors = [{ instancePath: s4, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: t8 }, message: "must NOT have additional properties" }], false;
|
|
2252
|
+
break;
|
|
2253
|
+
}
|
|
2254
|
+
if (c3 === e3) {
|
|
2255
|
+
if (r2.color !== void 0) {
|
|
2256
|
+
let t8 = r2.color, o9 = e3;
|
|
2257
|
+
if (typeof t8 != "string" && t8 !== null) return i5.errors = [{ instancePath: s4 + "/color", schemaPath: "#/properties/color/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
2258
|
+
var a3 = o9 === e3;
|
|
2259
|
+
} else var a3 = true;
|
|
2260
|
+
if (a3) {
|
|
2261
|
+
if (r2.icon !== void 0) {
|
|
2262
|
+
let t8 = r2.icon, o9 = e3;
|
|
2263
|
+
if (typeof t8 != "string" && t8 !== null) return i5.errors = [{ instancePath: s4 + "/icon", schemaPath: "#/properties/icon/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
2264
|
+
var a3 = o9 === e3;
|
|
2265
|
+
} else var a3 = true;
|
|
2266
|
+
if (a3) {
|
|
2267
|
+
if (r2.id !== void 0) {
|
|
2268
|
+
let t8 = r2.id, o9 = e3;
|
|
2269
|
+
if (e3 === o9 && e3 === o9) if (typeof t8 == "string") {
|
|
2270
|
+
if (!a.test(t8)) return i5.errors = [{ instancePath: s4 + "/id", schemaPath: "#/properties/id/format", keyword: "format", params: { format: "uuid" }, message: 'must match format "uuid"' }], false;
|
|
2271
|
+
} else return i5.errors = [{ instancePath: s4 + "/id", schemaPath: "#/properties/id/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
2272
|
+
var a3 = o9 === e3;
|
|
2273
|
+
} else var a3 = true;
|
|
2274
|
+
if (a3) {
|
|
2275
|
+
if (r2.kind !== void 0) {
|
|
2276
|
+
let t8 = r2.kind, o9 = e3;
|
|
2277
|
+
if (typeof t8 != "string") return i5.errors = [{ instancePath: s4 + "/kind", schemaPath: "#/properties/kind/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
2278
|
+
if (!(t8 === "routine" || t8 === "project")) return i5.errors = [{ instancePath: s4 + "/kind", schemaPath: "#/properties/kind/enum", keyword: "enum", params: { allowedValues: _.properties.kind.enum }, message: "must be equal to one of the allowed values" }], false;
|
|
2279
|
+
var a3 = o9 === e3;
|
|
2280
|
+
} else var a3 = true;
|
|
2281
|
+
if (a3) {
|
|
2282
|
+
if (r2.name !== void 0) {
|
|
2283
|
+
let t8 = e3;
|
|
2284
|
+
if (typeof r2.name != "string") return i5.errors = [{ instancePath: s4 + "/name", schemaPath: "#/properties/name/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
2285
|
+
var a3 = t8 === e3;
|
|
2286
|
+
} else var a3 = true;
|
|
2287
|
+
if (a3) {
|
|
2288
|
+
if (r2.recentDays !== void 0) {
|
|
2289
|
+
let t8 = r2.recentDays, o9 = e3;
|
|
2290
|
+
if (e3 === o9) if (Array.isArray(t8)) {
|
|
2291
|
+
var m5 = true;
|
|
2292
|
+
let j3 = t8.length;
|
|
2293
|
+
for (let u2 = 0; u2 < j3; u2++) {
|
|
2294
|
+
let d6 = t8[u2], D = e3;
|
|
2295
|
+
if (e3 === D) if (d6 && typeof d6 == "object" && !Array.isArray(d6)) {
|
|
2296
|
+
let h11;
|
|
2297
|
+
if (d6.date === void 0 && (h11 = "date") || d6.seconds === void 0 && (h11 = "seconds")) return i5.errors = [{ instancePath: s4 + "/recentDays/" + u2, schemaPath: "#/properties/recentDays/items/required", keyword: "required", params: { missingProperty: h11 }, message: "must have required property '" + h11 + "'" }], false;
|
|
2298
|
+
{
|
|
2299
|
+
let q2 = e3;
|
|
2300
|
+
for (let y3 in d6) if (!(y3 === "date" || y3 === "seconds")) {
|
|
2301
|
+
return i5.errors = [{ instancePath: s4 + "/recentDays/" + u2, schemaPath: "#/properties/recentDays/items/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: y3 }, message: "must NOT have additional properties" }], false;
|
|
2302
|
+
break;
|
|
2303
|
+
}
|
|
2304
|
+
if (q2 === e3) {
|
|
2305
|
+
if (d6.date !== void 0) {
|
|
2306
|
+
let y3 = e3;
|
|
2307
|
+
if (typeof d6.date != "string") return i5.errors = [{ instancePath: s4 + "/recentDays/" + u2 + "/date", schemaPath: "#/properties/recentDays/items/properties/date/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
2308
|
+
var p7 = y3 === e3;
|
|
2309
|
+
} else var p7 = true;
|
|
2310
|
+
if (p7) if (d6.seconds !== void 0) {
|
|
2311
|
+
let y3 = d6.seconds, A4 = e3;
|
|
2312
|
+
if (!(typeof y3 == "number" && isFinite(y3))) return i5.errors = [{ instancePath: s4 + "/recentDays/" + u2 + "/seconds", schemaPath: "#/properties/recentDays/items/properties/seconds/type", keyword: "type", params: { type: "number" }, message: "must be number" }], false;
|
|
2313
|
+
var p7 = A4 === e3;
|
|
2314
|
+
} else var p7 = true;
|
|
2315
|
+
}
|
|
2316
|
+
}
|
|
2317
|
+
} else return i5.errors = [{ instancePath: s4 + "/recentDays/" + u2, schemaPath: "#/properties/recentDays/items/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
2318
|
+
var m5 = D === e3;
|
|
2319
|
+
if (!m5) break;
|
|
2320
|
+
}
|
|
2321
|
+
} else return i5.errors = [{ instancePath: s4 + "/recentDays", schemaPath: "#/properties/recentDays/type", keyword: "type", params: { type: "array" }, message: "must be array" }], false;
|
|
2322
|
+
var a3 = o9 === e3;
|
|
2323
|
+
} else var a3 = true;
|
|
2324
|
+
if (a3) {
|
|
2325
|
+
if (r2.totalHours !== void 0) {
|
|
2326
|
+
let t8 = r2.totalHours, o9 = e3;
|
|
2327
|
+
if (!(typeof t8 == "number" && isFinite(t8))) return i5.errors = [{ instancePath: s4 + "/totalHours", schemaPath: "#/properties/totalHours/type", keyword: "type", params: { type: "number" }, message: "must be number" }], false;
|
|
2328
|
+
var a3 = o9 === e3;
|
|
2329
|
+
} else var a3 = true;
|
|
2330
|
+
if (a3) if (r2.totalSeconds !== void 0) {
|
|
2331
|
+
let t8 = r2.totalSeconds, o9 = e3;
|
|
2332
|
+
if (!(typeof t8 == "number" && isFinite(t8))) return i5.errors = [{ instancePath: s4 + "/totalSeconds", schemaPath: "#/properties/totalSeconds/type", keyword: "type", params: { type: "number" }, message: "must be number" }], false;
|
|
2333
|
+
var a3 = o9 === e3;
|
|
2334
|
+
} else var a3 = true;
|
|
2335
|
+
}
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
}
|
|
2339
|
+
}
|
|
2340
|
+
}
|
|
2341
|
+
}
|
|
2342
|
+
}
|
|
2343
|
+
} else return i5.errors = [{ instancePath: s4, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
2344
|
+
return i5.errors = n7, e3 === 0;
|
|
2345
|
+
}
|
|
2346
|
+
function f(r2, { instancePath: s4 = "", parentData: k2, parentDataProperty: P3, rootData: g2 = r2 } = {}) {
|
|
2347
|
+
let n7 = null, e3 = 0;
|
|
2348
|
+
if (e3 === 0) if (r2 && typeof r2 == "object" && !Array.isArray(r2)) {
|
|
2349
|
+
let m5;
|
|
2350
|
+
if (r2.items === void 0 && (m5 = "items")) return f.errors = [{ instancePath: s4, schemaPath: "#/required", keyword: "required", params: { missingProperty: m5 }, message: "must have required property '" + m5 + "'" }], false;
|
|
2351
|
+
if (r2.items !== void 0) {
|
|
2352
|
+
let p7 = r2.items;
|
|
2353
|
+
if (e3 === e3) if (Array.isArray(p7)) {
|
|
2354
|
+
var a3 = true;
|
|
2355
|
+
let c3 = p7.length;
|
|
2356
|
+
for (let t8 = 0; t8 < c3; t8++) {
|
|
2357
|
+
let o9 = e3;
|
|
2358
|
+
i5(p7[t8], { instancePath: s4 + "/items/" + t8, parentData: p7, parentDataProperty: t8, rootData: g2 }) || (n7 = n7 === null ? i5.errors : n7.concat(i5.errors), e3 = n7.length);
|
|
2359
|
+
var a3 = o9 === e3;
|
|
2360
|
+
if (!a3) break;
|
|
2361
|
+
}
|
|
2362
|
+
} else return f.errors = [{ instancePath: s4 + "/items", schemaPath: "#/properties/items/type", keyword: "type", params: { type: "array" }, message: "must be array" }], false;
|
|
2363
|
+
}
|
|
2364
|
+
} else return f.errors = [{ instancePath: s4, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
2365
|
+
return f.errors = n7, e3 === 0;
|
|
2366
|
+
}
|
|
2367
|
+
function v2(r2, { instancePath: s4 = "", parentData: k2, parentDataProperty: P3, rootData: g2 = r2 } = {}) {
|
|
2368
|
+
let n7 = null, e3 = 0, a3 = e3;
|
|
2369
|
+
i(r2, { instancePath: s4, parentData: k2, parentDataProperty: P3, rootData: g2 }) || (n7 = n7 === null ? i.errors : n7.concat(i.errors), e3 = n7.length);
|
|
2370
|
+
var m5 = a3 === e3;
|
|
2371
|
+
if (m5) {
|
|
2372
|
+
let p7 = e3;
|
|
2373
|
+
if (e3 === p7) if (r2 && typeof r2 == "object" && !Array.isArray(r2)) {
|
|
2374
|
+
let c3;
|
|
2375
|
+
if (r2.data === void 0 && (c3 = "data")) return v2.errors = [{ instancePath: s4, schemaPath: "#/allOf/1/required", keyword: "required", params: { missingProperty: c3 }, message: "must have required property '" + c3 + "'" }], false;
|
|
2376
|
+
r2.data !== void 0 && (f(r2.data, { instancePath: s4 + "/data", parentData: r2, parentDataProperty: "data", rootData: g2 }) || (n7 = n7 === null ? f.errors : n7.concat(f.errors), e3 = n7.length));
|
|
2377
|
+
} else return v2.errors = [{ instancePath: s4, schemaPath: "#/allOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
2378
|
+
var m5 = p7 === e3;
|
|
2379
|
+
}
|
|
2380
|
+
return v2.errors = n7, e3 === 0;
|
|
2381
|
+
}
|
|
2382
|
+
var z = v2;
|
|
2383
|
+
|
|
2384
|
+
// ../../packages/contracts/src/generated/endpoints/getV1HourBank.ts
|
|
2385
|
+
var getV1HourBank = {
|
|
2386
|
+
method: "GET",
|
|
2387
|
+
path: "/v1/hour-bank/",
|
|
2388
|
+
operation: "GET /v1/hour-bank/",
|
|
2389
|
+
revision: contractRevision,
|
|
2390
|
+
responses: {
|
|
2391
|
+
200: { mediaType: "application/json", schemaId: "urn:flowmind:getV1HourBank:200", validate: z }
|
|
2392
|
+
},
|
|
2393
|
+
error: { mediaType: "application/json", schemaId: "ApiErrorEnvelope", validate: h }
|
|
2394
|
+
};
|
|
2395
|
+
|
|
2396
|
+
// src/config.ts
|
|
2397
|
+
import Conf from "conf";
|
|
2398
|
+
var config = new Conf({ projectName: "flowmind-cli" });
|
|
2399
|
+
var API_URL = config.get("apiUrl") ?? "https://api.flowmind.pro";
|
|
2400
|
+
function getApiKey() {
|
|
2401
|
+
return config.get("apiKey");
|
|
2402
|
+
}
|
|
2403
|
+
function requireApiKey() {
|
|
2404
|
+
const key = getApiKey();
|
|
2405
|
+
if (!key) {
|
|
2406
|
+
console.error("Not authenticated. Run: fm auth login");
|
|
2407
|
+
process.exit(1);
|
|
2408
|
+
}
|
|
2409
|
+
return key;
|
|
2410
|
+
}
|
|
2411
|
+
|
|
2412
|
+
// src/api.ts
|
|
2413
|
+
function apiRequest(endpoint, args, options = {}) {
|
|
2414
|
+
const apiKey = options.authOptional ? void 0 : requireApiKey();
|
|
2415
|
+
return requestEndpoint(endpoint, API_URL, args, {
|
|
2416
|
+
headers: {
|
|
2417
|
+
...apiKey ? { Authorization: `Bearer ${apiKey}` } : {},
|
|
2418
|
+
...options.headers
|
|
2419
|
+
}
|
|
2420
|
+
});
|
|
2421
|
+
}
|
|
2422
|
+
|
|
2423
|
+
// src/contracts.ts
|
|
2424
|
+
var projectStatus = (project) => {
|
|
2425
|
+
if (project.archivedAt) return "archived";
|
|
2426
|
+
if (project.completedAt) return "completed";
|
|
2427
|
+
if (project.launchedAt) return "launched";
|
|
2428
|
+
return "active";
|
|
2429
|
+
};
|
|
2430
|
+
var listProjects = async (request = apiRequest) => {
|
|
2431
|
+
const data = await request(getV1Projects, {});
|
|
2432
|
+
return data.projects;
|
|
2433
|
+
};
|
|
2434
|
+
var getAgentCapabilities = (request = apiRequest) => request(getV1AgentCapabilities, {});
|
|
2435
|
+
var listAgentProjects = async (request = apiRequest) => {
|
|
2436
|
+
const data = await request(getV1AgentProjects, {});
|
|
2437
|
+
return data.projects;
|
|
2438
|
+
};
|
|
2439
|
+
var listAgentRoutines = async (request = apiRequest) => {
|
|
2440
|
+
const data = await request(getV1AgentRoutines, {});
|
|
2441
|
+
return data.routines;
|
|
2442
|
+
};
|
|
2443
|
+
var withIdempotencyKey = (idempotencyKey) => ({
|
|
2444
|
+
headers: { "Idempotency-Key": idempotencyKey }
|
|
2445
|
+
});
|
|
2446
|
+
var createAgentLogProposal = async (input2, idempotencyKey, request = apiRequest) => {
|
|
2447
|
+
const data = await request(
|
|
2448
|
+
postV1AgentLogProposals,
|
|
2449
|
+
{ body: input2 },
|
|
2450
|
+
withIdempotencyKey(idempotencyKey)
|
|
2451
|
+
);
|
|
2452
|
+
return data.proposal;
|
|
2453
|
+
};
|
|
2454
|
+
var listAgentLogProposals = async (status, request = apiRequest) => {
|
|
2455
|
+
const data = await request(getV1AgentLogProposals, { query: { status } });
|
|
2456
|
+
return data.proposals;
|
|
2457
|
+
};
|
|
2458
|
+
var cancelAgentLogProposal = async (proposalId, idempotencyKey, request = apiRequest) => {
|
|
2459
|
+
const data = await request(
|
|
2460
|
+
postV1AgentLogProposalsByProposalIdCancel,
|
|
2461
|
+
{ params: { proposalId } },
|
|
2462
|
+
withIdempotencyKey(idempotencyKey)
|
|
2463
|
+
);
|
|
2464
|
+
return data.proposal;
|
|
2465
|
+
};
|
|
2466
|
+
var parseNaturalLog = (message, request = apiRequest) => request(postV1AiLog, { body: { message } });
|
|
2467
|
+
var confirmNaturalLog = async (input2, idempotencyKey, request = apiRequest) => {
|
|
2468
|
+
return request(postV1AiLogConfirm, { body: input2 }, withIdempotencyKey(idempotencyKey));
|
|
2469
|
+
};
|
|
2470
|
+
var durationMinutesFromHours = (hours) => {
|
|
2471
|
+
const minutes = hours * 60;
|
|
2472
|
+
if (!Number.isInteger(minutes)) {
|
|
2473
|
+
throw new Error("Hours must resolve to whole minutes.");
|
|
2474
|
+
}
|
|
2475
|
+
return minutes;
|
|
2476
|
+
};
|
|
2477
|
+
var resolveActiveProjectByName = (projects, projectName) => {
|
|
2478
|
+
const matches = projects.filter((project) => project.name === projectName && project.archivedAt === null);
|
|
2479
|
+
if (matches.length === 0) {
|
|
2480
|
+
throw new Error(`No active project named "${projectName}"`);
|
|
2481
|
+
}
|
|
2482
|
+
if (matches.length > 1) {
|
|
2483
|
+
throw new Error(`Multiple active projects named "${projectName}". Use Flowmind web to disambiguate before logging.`);
|
|
2484
|
+
}
|
|
2485
|
+
return matches[0];
|
|
2486
|
+
};
|
|
2487
|
+
var createStructuredTimeEntry = async (input2, request = apiRequest) => {
|
|
2488
|
+
const durationMinutes = durationMinutesFromHours(input2.hours);
|
|
2489
|
+
const now = input2.now ?? /* @__PURE__ */ new Date();
|
|
2490
|
+
let start = new Date(now.getTime() - durationMinutes * 6e4);
|
|
2491
|
+
if (input2.startedAt !== void 0) {
|
|
2492
|
+
if (!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?(?:Z|[+-]\d{2}:\d{2})$/.test(input2.startedAt)) {
|
|
2493
|
+
throw new Error("started-at must be a valid ISO date-time with a timezone.");
|
|
2494
|
+
}
|
|
2495
|
+
const calendarDay = /* @__PURE__ */ new Date(`${input2.startedAt.slice(0, 10)}T00:00:00.000Z`);
|
|
2496
|
+
if (Number.isNaN(calendarDay.getTime()) || calendarDay.toISOString().slice(0, 10) !== input2.startedAt.slice(0, 10)) {
|
|
2497
|
+
throw new Error("started-at must be a valid ISO date-time.");
|
|
2498
|
+
}
|
|
2499
|
+
start = new Date(input2.startedAt);
|
|
2500
|
+
if (Number.isNaN(start.getTime())) throw new Error("started-at must be a valid ISO date-time.");
|
|
2501
|
+
}
|
|
2502
|
+
if (start.getTime() + durationMinutes * 6e4 > now.getTime()) {
|
|
2503
|
+
throw new Error("Logged work cannot end in the future");
|
|
2504
|
+
}
|
|
2505
|
+
const projects = await listProjects(request);
|
|
2506
|
+
const project = resolveActiveProjectByName(projects, input2.projectName);
|
|
2507
|
+
const created = await request(postV1TimeEntries, { body: {
|
|
2508
|
+
projectId: project.id,
|
|
2509
|
+
startedAt: input2.startedAt === void 0 ? new Date((input2.now ?? /* @__PURE__ */ new Date()).getTime() - durationMinutes * 6e4).toISOString() : start.toISOString(),
|
|
2510
|
+
durationMinutes,
|
|
2511
|
+
...input2.nextStep !== void 0 ? { nextStep: input2.nextStep } : {},
|
|
2512
|
+
...input2.description !== void 0 ? { description: input2.description } : {},
|
|
2513
|
+
...input2.note !== void 0 ? { note: input2.note } : {},
|
|
2514
|
+
...input2.artifactUrl !== void 0 ? { artifactUrl: input2.artifactUrl } : {}
|
|
2515
|
+
} }, {
|
|
2516
|
+
headers: {
|
|
2517
|
+
[IDEMPOTENCY_KEY_HEADER]: crypto.randomUUID()
|
|
2518
|
+
}
|
|
2519
|
+
});
|
|
2520
|
+
return created;
|
|
2521
|
+
};
|
|
2522
|
+
var getStatusSnapshot = async (request = apiRequest) => {
|
|
2523
|
+
const [publicStats, streak, xp] = await Promise.all([
|
|
2524
|
+
request(getV1MePublicStats, {}),
|
|
2525
|
+
request(getV1MeStreak, {}),
|
|
2526
|
+
request(getV1XpSummary, {})
|
|
2527
|
+
]);
|
|
2528
|
+
return { publicStats, streak, xp };
|
|
2529
|
+
};
|
|
2530
|
+
var getDetailedStats = async (request = apiRequest) => {
|
|
2531
|
+
const [status, badges, hourBank] = await Promise.all([
|
|
2532
|
+
getStatusSnapshot(request),
|
|
2533
|
+
request(getV1MeBadges, {}),
|
|
2534
|
+
request(getV1HourBank, {})
|
|
2535
|
+
]);
|
|
2536
|
+
return { ...status, badges, hourBank };
|
|
2537
|
+
};
|
|
2538
|
+
|
|
2539
|
+
// src/commands/agent-stage.ts
|
|
2540
|
+
import { createHash } from "node:crypto";
|
|
2541
|
+
var trimRequired = (value, field) => {
|
|
2542
|
+
const trimmed = value.trim();
|
|
2543
|
+
if (!trimmed) throw new Error(`${field} must not be blank.`);
|
|
2544
|
+
return trimmed;
|
|
2545
|
+
};
|
|
2546
|
+
var resolveStartedAt = (value) => {
|
|
2547
|
+
if (!value) throw new Error("started-at is required.");
|
|
2548
|
+
const date = new Date(value);
|
|
2549
|
+
if (Number.isNaN(date.getTime())) throw new Error("started-at must be a valid ISO date-time.");
|
|
2550
|
+
return date.toISOString();
|
|
2551
|
+
};
|
|
2552
|
+
var resolveArtifactUrl = (value) => {
|
|
2553
|
+
if (!value) return void 0;
|
|
2554
|
+
const trimmed = value.trim();
|
|
2555
|
+
let url;
|
|
2556
|
+
try {
|
|
2557
|
+
url = new URL(trimmed);
|
|
2558
|
+
} catch {
|
|
2559
|
+
throw new Error("artifact-url must be a valid absolute URL.");
|
|
2560
|
+
}
|
|
2561
|
+
if (url.protocol !== "http:" && url.protocol !== "https:" || url.username || url.password) {
|
|
2562
|
+
throw new Error("artifact-url must be an HTTP(S) URL without embedded credentials.");
|
|
2563
|
+
}
|
|
2564
|
+
return url.toString();
|
|
2565
|
+
};
|
|
2566
|
+
var resolveEvidence = (options) => {
|
|
2567
|
+
if (!options.sessionEvidence) {
|
|
2568
|
+
if (options.sessionUrl) throw new Error("session-url requires --session-evidence.");
|
|
2569
|
+
return [];
|
|
2570
|
+
}
|
|
2571
|
+
return [
|
|
2572
|
+
{
|
|
2573
|
+
externalId: options.sessionId ?? null,
|
|
2574
|
+
kind: "session_log",
|
|
2575
|
+
label: trimRequired(options.sessionEvidence, "session-evidence"),
|
|
2576
|
+
url: options.sessionUrl ?? null
|
|
2577
|
+
}
|
|
2578
|
+
];
|
|
2579
|
+
};
|
|
2580
|
+
var deriveIdempotencyKey = (options) => {
|
|
2581
|
+
if (options.idempotencyKey !== void 0) return trimRequired(options.idempotencyKey, "idempotency-key");
|
|
2582
|
+
if (!options.sessionId || !options.startedAt) {
|
|
2583
|
+
throw new Error("Automatic retry identity requires both --session-id and --started-at.");
|
|
2584
|
+
}
|
|
2585
|
+
const projectId = trimRequired(options.project, "project");
|
|
2586
|
+
const digest = createHash("sha256").update(`flowmind-agent-stage-v2
|
|
2587
|
+
${trimRequired(options.sessionId, "session-id")}
|
|
2588
|
+
${projectId}`).digest("hex");
|
|
2589
|
+
return `agent-stage-v2:${digest}`;
|
|
2590
|
+
};
|
|
2591
|
+
var buildAgentStageRequest = (options, now = /* @__PURE__ */ new Date()) => {
|
|
2592
|
+
if (!Number.isSafeInteger(options.minutes) || options.minutes <= 0) {
|
|
2593
|
+
throw new Error("minutes must be a positive whole number.");
|
|
2594
|
+
}
|
|
2595
|
+
const startedAt = resolveStartedAt(options.startedAt);
|
|
2596
|
+
if (Date.parse(startedAt) + options.minutes * 6e4 > now.getTime()) {
|
|
2597
|
+
throw new Error("The staged session must be complete; started-at plus minutes cannot be in the future.");
|
|
2598
|
+
}
|
|
2599
|
+
const evidence = resolveEvidence(options);
|
|
2600
|
+
const sourceKind = options.sourceKind ?? (options.sessionId || evidence.length > 0 ? "session_log" : "cli");
|
|
2601
|
+
const artifactUrl = resolveArtifactUrl(options.artifactUrl);
|
|
2602
|
+
return {
|
|
2603
|
+
idempotencyKey: deriveIdempotencyKey(options),
|
|
2604
|
+
input: {
|
|
2605
|
+
targetKind: "project",
|
|
2606
|
+
projectId: trimRequired(options.project, "project"),
|
|
2607
|
+
startedAt,
|
|
2608
|
+
durationMinutes: options.minutes,
|
|
2609
|
+
description: trimRequired(options.intention, "intention"),
|
|
2610
|
+
note: trimRequired(options.outcome, "outcome"),
|
|
2611
|
+
...artifactUrl ? { artifactUrl } : {},
|
|
2612
|
+
source: {
|
|
2613
|
+
kind: sourceKind,
|
|
2614
|
+
label: options.sourceLabel ?? (sourceKind === "session_log" ? "Agent session" : "Flowmind CLI"),
|
|
2615
|
+
externalId: options.sourceExternalId ?? options.sessionId ?? null
|
|
2616
|
+
},
|
|
2617
|
+
evidence
|
|
2618
|
+
}
|
|
2619
|
+
};
|
|
2620
|
+
};
|
|
2621
|
+
|
|
2622
|
+
// src/commands/agent.ts
|
|
2623
|
+
var SOURCE_KINDS = [
|
|
2624
|
+
"calendar",
|
|
2625
|
+
"claude_code",
|
|
2626
|
+
"cli",
|
|
2627
|
+
"codex",
|
|
2628
|
+
"github",
|
|
2629
|
+
"linear",
|
|
2630
|
+
"manual",
|
|
2631
|
+
"session_log",
|
|
2632
|
+
"other"
|
|
2633
|
+
];
|
|
2634
|
+
var PROPOSAL_STATUSES = ["proposed", "cancelled", "approved", "rejected"];
|
|
2635
|
+
var parsePositiveInteger = (value) => {
|
|
2636
|
+
const parsed = Number(value);
|
|
2637
|
+
if (!Number.isInteger(parsed) || parsed <= 0) {
|
|
2638
|
+
throw new InvalidArgumentError("Value must be a positive integer.");
|
|
2639
|
+
}
|
|
2640
|
+
return parsed;
|
|
2641
|
+
};
|
|
2642
|
+
var parseSourceKind = (value) => {
|
|
2643
|
+
if (SOURCE_KINDS.includes(value)) {
|
|
2644
|
+
return value;
|
|
2645
|
+
}
|
|
2646
|
+
throw new InvalidArgumentError(`Source kind must be one of: ${SOURCE_KINDS.join(", ")}.`);
|
|
2647
|
+
};
|
|
2648
|
+
var parseProposalStatus = (value) => {
|
|
2649
|
+
if (PROPOSAL_STATUSES.includes(value)) {
|
|
2650
|
+
return value;
|
|
2651
|
+
}
|
|
2652
|
+
throw new InvalidArgumentError(`Status must be one of: ${PROPOSAL_STATUSES.join(", ")}.`);
|
|
2653
|
+
};
|
|
2654
|
+
var formatTarget = (proposal) => {
|
|
2655
|
+
if (proposal.targetKind === "project") {
|
|
2656
|
+
return `project:${proposal.projectId}`;
|
|
2657
|
+
}
|
|
2658
|
+
if (proposal.targetKind === "routine") {
|
|
2659
|
+
return `routine:${proposal.routineId}`;
|
|
2660
|
+
}
|
|
2661
|
+
return "unassigned";
|
|
2662
|
+
};
|
|
2663
|
+
var statusColor = (status) => {
|
|
2664
|
+
if (status === "proposed") return chalk.yellow;
|
|
2665
|
+
if (status === "approved") return chalk.green;
|
|
2666
|
+
if (status === "rejected") return chalk.red;
|
|
2667
|
+
return chalk.dim;
|
|
2668
|
+
};
|
|
2669
|
+
var printProposal = (proposal) => {
|
|
2670
|
+
const color = statusColor(proposal.status);
|
|
2671
|
+
console.log(`${proposal.id} ${color(proposal.status)} ${formatTarget(proposal)} ${proposal.durationMinutes}m`);
|
|
2672
|
+
console.log(` Started: ${proposal.startedAt}`);
|
|
2673
|
+
console.log(` Intent: ${proposal.description ?? "\u2014"}`);
|
|
2674
|
+
console.log(` Outcome: ${proposal.note}`);
|
|
2675
|
+
if (proposal.artifactUrl) {
|
|
2676
|
+
console.log(` Artifact: ${proposal.artifactUrl}`);
|
|
2677
|
+
}
|
|
2678
|
+
console.log(` Review: ${proposal.webReviewUrl}`);
|
|
2679
|
+
};
|
|
2680
|
+
var agentCommand = new Command("agent").description("Use Agent Toolkit V2 staged proof workflows");
|
|
2681
|
+
agentCommand.command("capabilities").description("Show Agent Toolkit V2 capabilities for the current credential").action(async () => {
|
|
2682
|
+
try {
|
|
2683
|
+
const capabilities = await getAgentCapabilities();
|
|
2684
|
+
console.log(chalk.bold("\nAgent Toolkit\n"));
|
|
2685
|
+
console.log(`Contract: ${capabilities.contractVersion}`);
|
|
2686
|
+
console.log(`Scope: ${capabilities.scope}`);
|
|
2687
|
+
console.log("Capabilities:");
|
|
2688
|
+
for (const capability of capabilities.capabilities) {
|
|
2689
|
+
console.log(` ${capability}`);
|
|
2690
|
+
}
|
|
2691
|
+
if (capabilities.requiresIdempotencyKey.length > 0) {
|
|
2692
|
+
console.log("Requires Idempotency-Key:");
|
|
2693
|
+
for (const route of capabilities.requiresIdempotencyKey) {
|
|
2694
|
+
console.log(` ${route}`);
|
|
2695
|
+
}
|
|
2696
|
+
}
|
|
2697
|
+
console.log("");
|
|
2698
|
+
} catch (error) {
|
|
2699
|
+
printCommandError("Read agent capabilities", error);
|
|
2700
|
+
}
|
|
2701
|
+
});
|
|
2702
|
+
agentCommand.command("projects").description("List active project context available to agents").action(async () => {
|
|
2703
|
+
try {
|
|
2704
|
+
const projects = await listAgentProjects();
|
|
2705
|
+
if (projects.length === 0) {
|
|
2706
|
+
console.log(chalk.dim("\nNo agent-visible projects found.\n"));
|
|
2707
|
+
return;
|
|
2708
|
+
}
|
|
2709
|
+
console.log(chalk.bold("\nAgent Projects\n"));
|
|
2710
|
+
for (const project of projects) {
|
|
2711
|
+
console.log(`${project.id} ${project.name} ${project.status} ${project.totalHours}h`);
|
|
2712
|
+
}
|
|
2713
|
+
console.log("");
|
|
2714
|
+
} catch (error) {
|
|
2715
|
+
printCommandError("Read agent projects", error);
|
|
2716
|
+
}
|
|
2717
|
+
});
|
|
2718
|
+
agentCommand.command("routines").description("List active routine context available to agents").action(async () => {
|
|
2719
|
+
try {
|
|
2720
|
+
const routines = await listAgentRoutines();
|
|
2721
|
+
if (routines.length === 0) {
|
|
2722
|
+
console.log(chalk.dim("\nNo agent-visible routines found.\n"));
|
|
2723
|
+
return;
|
|
2724
|
+
}
|
|
2725
|
+
console.log(chalk.bold("\nAgent Routines\n"));
|
|
2726
|
+
for (const routine of routines) {
|
|
2727
|
+
console.log(`${routine.id} ${routine.name} ${routine.cadence.toLowerCase()} ${routine.durationMinutes}m`);
|
|
2728
|
+
}
|
|
2729
|
+
console.log("");
|
|
2730
|
+
} catch (error) {
|
|
2731
|
+
printCommandError("Read agent routines", error);
|
|
2732
|
+
}
|
|
2733
|
+
});
|
|
2734
|
+
agentCommand.command("stage").description("Stage a canonical project proof for human review").requiredOption("--project <projectId>", "Project id target").requiredOption("--minutes <minutes>", "Duration in whole minutes", parsePositiveInteger).requiredOption("--intention <text>", "What the session intended to complete").requiredOption("--outcome <text>", "What changed, shipped, or became clear").option("--artifact-url <url>", "Commit, document, design, or published artifact URL").requiredOption("--started-at <isoDateTime>", "Completed session start time as an ISO date-time").option("--source-kind <kind>", `Proposal source kind (${SOURCE_KINDS.join(", ")})`, parseSourceKind).option("--source-label <label>", "Human-readable source label").option("--source-external-id <externalId>", "Stable external source id").option("--session-evidence <label>", "Short session-log evidence label or summary").option("--session-id <externalId>", "Stable session/run/thread id for session-log evidence").option("--session-url <url>", "URL for session-log evidence").option("--idempotency-key <key>", "Explicit retry key; derived from session id when omitted").option("--json", "Print machine-readable proposal output").action(async (options) => {
|
|
2735
|
+
let spinner = null;
|
|
2736
|
+
try {
|
|
2737
|
+
const { idempotencyKey, input: input2 } = buildAgentStageRequest({
|
|
2738
|
+
...options,
|
|
2739
|
+
sourceLabel: options.sourceLabel ?? (options.sourceKind === "claude_code" ? "Claude Code" : void 0)
|
|
2740
|
+
});
|
|
2741
|
+
spinner = options.json ? null : ora("Staging agent proof...").start();
|
|
2742
|
+
const proposal = await createAgentLogProposal(input2, idempotencyKey);
|
|
2743
|
+
spinner?.succeed("Agent proof staged");
|
|
2744
|
+
if (options.json) {
|
|
2745
|
+
console.log(JSON.stringify({ idempotencyKey, proposal }));
|
|
2746
|
+
return;
|
|
2747
|
+
}
|
|
2748
|
+
printProposal(proposal);
|
|
2749
|
+
console.log("");
|
|
2750
|
+
} catch (error) {
|
|
2751
|
+
spinner?.stop();
|
|
2752
|
+
printCommandError("Stage agent proof", error, options.json);
|
|
2753
|
+
}
|
|
2754
|
+
});
|
|
2755
|
+
agentCommand.command("proposals").description("List staged agent proofs visible to the current credential").option("--status <status>", "Filter by proposal status", parseProposalStatus).action(async (options) => {
|
|
2756
|
+
try {
|
|
2757
|
+
const proposals = await listAgentLogProposals(options.status);
|
|
2758
|
+
if (proposals.length === 0) {
|
|
2759
|
+
console.log(chalk.dim("\nNo staged agent proofs found.\n"));
|
|
2760
|
+
return;
|
|
2761
|
+
}
|
|
2762
|
+
console.log(chalk.bold("\nAgent Log Proposals\n"));
|
|
2763
|
+
for (const proposal of proposals) {
|
|
2764
|
+
printProposal(proposal);
|
|
2765
|
+
}
|
|
2766
|
+
console.log("");
|
|
2767
|
+
} catch (error) {
|
|
2768
|
+
printCommandError("Read agent proposals", error);
|
|
2769
|
+
}
|
|
2770
|
+
});
|
|
2771
|
+
agentCommand.command("cancel <proposalId>").description("Cancel a pending staged proof created by this agent key").requiredOption("--idempotency-key <key>", "Stable idempotency key for safe retries").action(async (proposalId, options) => {
|
|
2772
|
+
const spinner = ora("Cancelling staged agent proof...");
|
|
2773
|
+
try {
|
|
2774
|
+
spinner.start();
|
|
2775
|
+
const proposal = await cancelAgentLogProposal(proposalId, options.idempotencyKey);
|
|
2776
|
+
spinner.succeed("Staged agent proof cancelled");
|
|
2777
|
+
printProposal(proposal);
|
|
2778
|
+
console.log("");
|
|
2779
|
+
} catch (error) {
|
|
2780
|
+
spinner.stop();
|
|
2781
|
+
printCommandError("Cancel agent proof", error);
|
|
2782
|
+
}
|
|
2783
|
+
});
|
|
2784
|
+
|
|
2785
|
+
// ../../packages/contracts/src/generated/validators/postV1CliAuthInit200.js
|
|
2786
|
+
function a2(e3, { instancePath: s4 = "", parentData: y3, parentDataProperty: d6, rootData: f3 = e3 } = {}) {
|
|
2787
|
+
let t8 = null, r2 = 0;
|
|
2788
|
+
if (r2 === 0) if (e3 && typeof e3 == "object" && !Array.isArray(e3)) {
|
|
2789
|
+
let i6;
|
|
2790
|
+
if (e3.state === void 0 && (i6 = "state") || e3.authUrl === void 0 && (i6 = "authUrl")) return a2.errors = [{ instancePath: s4, schemaPath: "#/required", keyword: "required", params: { missingProperty: i6 }, message: "must have required property '" + i6 + "'" }], false;
|
|
2791
|
+
{
|
|
2792
|
+
let p7 = r2;
|
|
2793
|
+
for (let o9 in e3) if (!(o9 === "authUrl" || o9 === "state")) {
|
|
2794
|
+
return a2.errors = [{ instancePath: s4, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: o9 }, message: "must NOT have additional properties" }], false;
|
|
2795
|
+
break;
|
|
2796
|
+
}
|
|
2797
|
+
if (p7 === r2) {
|
|
2798
|
+
if (e3.authUrl !== void 0) {
|
|
2799
|
+
let o9 = r2;
|
|
2800
|
+
if (typeof e3.authUrl != "string") return a2.errors = [{ instancePath: s4 + "/authUrl", schemaPath: "#/properties/authUrl/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
2801
|
+
var l6 = o9 === r2;
|
|
2802
|
+
} else var l6 = true;
|
|
2803
|
+
if (l6) if (e3.state !== void 0) {
|
|
2804
|
+
let o9 = r2;
|
|
2805
|
+
if (typeof e3.state != "string") return a2.errors = [{ instancePath: s4 + "/state", schemaPath: "#/properties/state/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
2806
|
+
var l6 = o9 === r2;
|
|
2807
|
+
} else var l6 = true;
|
|
2808
|
+
}
|
|
2809
|
+
}
|
|
2810
|
+
} else return a2.errors = [{ instancePath: s4, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
2811
|
+
return a2.errors = t8, r2 === 0;
|
|
2812
|
+
}
|
|
2813
|
+
function n5(e3, { instancePath: s4 = "", parentData: y3, parentDataProperty: d6, rootData: f3 = e3 } = {}) {
|
|
2814
|
+
let t8 = null, r2 = 0, l6 = r2;
|
|
2815
|
+
i(e3, { instancePath: s4, parentData: y3, parentDataProperty: d6, rootData: f3 }) || (t8 = t8 === null ? i.errors : t8.concat(i.errors), r2 = t8.length);
|
|
2816
|
+
var i6 = l6 === r2;
|
|
2817
|
+
if (i6) {
|
|
2818
|
+
let p7 = r2;
|
|
2819
|
+
if (r2 === p7) if (e3 && typeof e3 == "object" && !Array.isArray(e3)) {
|
|
2820
|
+
let m5;
|
|
2821
|
+
if (e3.data === void 0 && (m5 = "data")) return n5.errors = [{ instancePath: s4, schemaPath: "#/allOf/1/required", keyword: "required", params: { missingProperty: m5 }, message: "must have required property '" + m5 + "'" }], false;
|
|
2822
|
+
e3.data !== void 0 && (a2(e3.data, { instancePath: s4 + "/data", parentData: e3, parentDataProperty: "data", rootData: f3 }) || (t8 = t8 === null ? a2.errors : t8.concat(a2.errors), r2 = t8.length));
|
|
2823
|
+
} else return n5.errors = [{ instancePath: s4, schemaPath: "#/allOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
2824
|
+
var i6 = p7 === r2;
|
|
2825
|
+
}
|
|
2826
|
+
return n5.errors = t8, r2 === 0;
|
|
2827
|
+
}
|
|
2828
|
+
var P = n5;
|
|
2829
|
+
|
|
2830
|
+
// ../../packages/contracts/src/generated/endpoints/postV1CliAuthInit.ts
|
|
2831
|
+
var postV1CliAuthInit = {
|
|
2832
|
+
method: "POST",
|
|
2833
|
+
path: "/v1/cli-auth/init",
|
|
2834
|
+
operation: "POST /v1/cli-auth/init",
|
|
2835
|
+
revision: contractRevision,
|
|
2836
|
+
responses: {
|
|
2837
|
+
200: { mediaType: "application/json", schemaId: "urn:flowmind:postV1CliAuthInit:200", validate: P }
|
|
2838
|
+
},
|
|
2839
|
+
error: { mediaType: "application/json", schemaId: "ApiErrorEnvelope", validate: h }
|
|
2840
|
+
};
|
|
2841
|
+
|
|
2842
|
+
// ../../packages/contracts/src/generated/validators/getV1CliAuthPoll200.js
|
|
2843
|
+
function o8(e3, { instancePath: s4 = "", parentData: d6, parentDataProperty: m5, rootData: y3 = e3 } = {}) {
|
|
2844
|
+
let t8 = null, r2 = 0;
|
|
2845
|
+
if (r2 === 0) if (e3 && typeof e3 == "object" && !Array.isArray(e3)) {
|
|
2846
|
+
let i6;
|
|
2847
|
+
if (e3.authorized === void 0 && (i6 = "authorized") || e3.apiKey === void 0 && (i6 = "apiKey")) return o8.errors = [{ instancePath: s4, schemaPath: "#/required", keyword: "required", params: { missingProperty: i6 }, message: "must have required property '" + i6 + "'" }], false;
|
|
2848
|
+
{
|
|
2849
|
+
let u2 = r2;
|
|
2850
|
+
for (let a3 in e3) if (!(a3 === "apiKey" || a3 === "authorized")) {
|
|
2851
|
+
return o8.errors = [{ instancePath: s4, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: a3 }, message: "must NOT have additional properties" }], false;
|
|
2852
|
+
break;
|
|
2853
|
+
}
|
|
2854
|
+
if (u2 === r2) {
|
|
2855
|
+
if (e3.apiKey !== void 0) {
|
|
2856
|
+
let a3 = e3.apiKey, l6 = r2;
|
|
2857
|
+
if (typeof a3 != "string" && a3 !== null) return o8.errors = [{ instancePath: s4 + "/apiKey", schemaPath: "#/properties/apiKey/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
2858
|
+
var p7 = l6 === r2;
|
|
2859
|
+
} else var p7 = true;
|
|
2860
|
+
if (p7) if (e3.authorized !== void 0) {
|
|
2861
|
+
let a3 = r2;
|
|
2862
|
+
if (typeof e3.authorized != "boolean") return o8.errors = [{ instancePath: s4 + "/authorized", schemaPath: "#/properties/authorized/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }], false;
|
|
2863
|
+
var p7 = a3 === r2;
|
|
2864
|
+
} else var p7 = true;
|
|
2865
|
+
}
|
|
2866
|
+
}
|
|
2867
|
+
} else return o8.errors = [{ instancePath: s4, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
2868
|
+
return o8.errors = t8, r2 === 0;
|
|
2869
|
+
}
|
|
2870
|
+
function n6(e3, { instancePath: s4 = "", parentData: d6, parentDataProperty: m5, rootData: y3 = e3 } = {}) {
|
|
2871
|
+
let t8 = null, r2 = 0, p7 = r2;
|
|
2872
|
+
i(e3, { instancePath: s4, parentData: d6, parentDataProperty: m5, rootData: y3 }) || (t8 = t8 === null ? i.errors : t8.concat(i.errors), r2 = t8.length);
|
|
2873
|
+
var i6 = p7 === r2;
|
|
2874
|
+
if (i6) {
|
|
2875
|
+
let u2 = r2;
|
|
2876
|
+
if (r2 === u2) if (e3 && typeof e3 == "object" && !Array.isArray(e3)) {
|
|
2877
|
+
let l6;
|
|
2878
|
+
if (e3.data === void 0 && (l6 = "data")) return n6.errors = [{ instancePath: s4, schemaPath: "#/allOf/1/required", keyword: "required", params: { missingProperty: l6 }, message: "must have required property '" + l6 + "'" }], false;
|
|
2879
|
+
e3.data !== void 0 && (o8(e3.data, { instancePath: s4 + "/data", parentData: e3, parentDataProperty: "data", rootData: y3 }) || (t8 = t8 === null ? o8.errors : t8.concat(o8.errors), r2 = t8.length));
|
|
2880
|
+
} else return n6.errors = [{ instancePath: s4, schemaPath: "#/allOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
2881
|
+
var i6 = u2 === r2;
|
|
2882
|
+
}
|
|
2883
|
+
return n6.errors = t8, r2 === 0;
|
|
2884
|
+
}
|
|
2885
|
+
var P2 = n6;
|
|
2886
|
+
|
|
2887
|
+
// ../../packages/contracts/src/generated/endpoints/getV1CliAuthPoll.ts
|
|
2888
|
+
var getV1CliAuthPoll = {
|
|
2889
|
+
method: "GET",
|
|
2890
|
+
path: "/v1/cli-auth/poll",
|
|
2891
|
+
operation: "GET /v1/cli-auth/poll",
|
|
2892
|
+
revision: contractRevision,
|
|
2893
|
+
responses: {
|
|
2894
|
+
200: { mediaType: "application/json", schemaId: "urn:flowmind:getV1CliAuthPoll:200", validate: P2 }
|
|
2895
|
+
},
|
|
2896
|
+
error: { mediaType: "application/json", schemaId: "ApiErrorEnvelope", validate: h }
|
|
2897
|
+
};
|
|
2898
|
+
|
|
2899
|
+
// src/commands/auth.ts
|
|
2900
|
+
import { Command as Command2 } from "commander";
|
|
2901
|
+
|
|
2902
|
+
// ../../packages/auth/src/index.ts
|
|
2903
|
+
var FLOWMIND_API_KEY_PREFIX = "fm_";
|
|
2904
|
+
var isFlowmindApiKey = (token) => token.startsWith(FLOWMIND_API_KEY_PREFIX);
|
|
2905
|
+
|
|
2906
|
+
// src/commands/auth.ts
|
|
2907
|
+
import chalk2 from "chalk";
|
|
2908
|
+
import open from "open";
|
|
2909
|
+
import ora2 from "ora";
|
|
2910
|
+
var authCommand = new Command2("auth").description("Authenticate with Flowmind");
|
|
2911
|
+
authCommand.command("login").description("Log in via browser").option("--no-browser", "Print the authorization URL without opening a browser").action(async (options) => {
|
|
2912
|
+
const spinner = ora2("Starting authentication...").start();
|
|
2913
|
+
try {
|
|
2914
|
+
const { state, authUrl } = await apiRequest(postV1CliAuthInit, {}, { authOptional: true });
|
|
2915
|
+
spinner.stop();
|
|
2916
|
+
console.log(chalk2.cyan("Authorize Flowmind in your browser:"));
|
|
2917
|
+
console.log(authUrl);
|
|
2918
|
+
if (options.browser) await open(authUrl);
|
|
2919
|
+
spinner.start("Waiting for authorization...");
|
|
2920
|
+
for (let i6 = 0; i6 < 150; i6 += 1) {
|
|
2921
|
+
await new Promise((resolve) => setTimeout(resolve, 2e3));
|
|
2922
|
+
const result = await apiRequest(getV1CliAuthPoll, { query: { state } }, { authOptional: true });
|
|
2923
|
+
if (!result.authorized && result.apiKey === null) continue;
|
|
2924
|
+
if (!result.authorized || result.apiKey === null || !isFlowmindApiKey(result.apiKey)) {
|
|
2925
|
+
throw new Error("Invalid authorization state; operation=GET /v1/cli-auth/poll; schema=CliAuthPollData; requestId=unavailable");
|
|
2926
|
+
}
|
|
2927
|
+
config.set("apiKey", result.apiKey);
|
|
2928
|
+
spinner.succeed("Authenticated successfully!");
|
|
2929
|
+
console.log(chalk2.dim("You can now use `fm` commands."));
|
|
2930
|
+
return;
|
|
2931
|
+
}
|
|
2932
|
+
throw new Error("Authorization timed out. Try again.");
|
|
2933
|
+
} catch (error) {
|
|
2934
|
+
spinner.stop();
|
|
2935
|
+
const expired = error instanceof BridgeError && error.context.kind === "api" && error.code === "EXPIRED";
|
|
2936
|
+
printCommandError(expired ? "Authenticate (authorization expired)" : "Authenticate", error);
|
|
2937
|
+
}
|
|
2938
|
+
});
|
|
2939
|
+
authCommand.command("logout").description("Log out").action(() => {
|
|
2940
|
+
config.delete("apiKey");
|
|
2941
|
+
console.log(chalk2.green("Logged out."));
|
|
2942
|
+
});
|
|
2943
|
+
authCommand.command("status").description("Show auth status").action(() => {
|
|
2944
|
+
const key = config.get("apiKey");
|
|
2945
|
+
if (key) {
|
|
2946
|
+
console.log(chalk2.green("\u2713 Authenticated"));
|
|
2947
|
+
console.log(chalk2.dim(`Key: ${key.slice(0, 10)}...`));
|
|
2948
|
+
return;
|
|
2949
|
+
}
|
|
2950
|
+
console.log(chalk2.red("\u2717 Not authenticated"));
|
|
2951
|
+
console.log("Run: fm auth login");
|
|
2952
|
+
});
|
|
2953
|
+
|
|
2954
|
+
// src/commands/log.ts
|
|
2955
|
+
import { Command as Command3 } from "commander";
|
|
2956
|
+
import chalk3 from "chalk";
|
|
2957
|
+
import ora3 from "ora";
|
|
2958
|
+
|
|
2959
|
+
// src/commands/log-review.ts
|
|
2960
|
+
import { randomUUID } from "node:crypto";
|
|
2961
|
+
import { stdin as input, stdout as output } from "node:process";
|
|
2962
|
+
import { createInterface } from "node:readline/promises";
|
|
2963
|
+
var collectCaptureConfirmation = async (preview, io) => {
|
|
2964
|
+
io.print(`
|
|
2965
|
+
Original text: ${preview.originalText}`);
|
|
2966
|
+
if (!preview.availableProjects.length) {
|
|
2967
|
+
io.print("No active projects. Create a project in Flowmind, then try again. Nothing was saved.");
|
|
2968
|
+
return null;
|
|
2969
|
+
}
|
|
2970
|
+
preview.availableProjects.forEach((project2, index) => io.print(`${index + 1}. ${project2.name} (${project2.id})`));
|
|
2971
|
+
const suggestedIndex = preview.availableProjects.findIndex((project2) => project2.id === preview.draft.projectId);
|
|
2972
|
+
const projectAnswer = (await io.ask(`Project number${suggestedIndex >= 0 ? ` [${suggestedIndex + 1}]` : ""}: `)).trim();
|
|
2973
|
+
const projectNumber = projectAnswer === "" && suggestedIndex >= 0 ? suggestedIndex + 1 : Number(projectAnswer);
|
|
2974
|
+
const project = Number.isInteger(projectNumber) ? preview.availableProjects[projectNumber - 1] : void 0;
|
|
2975
|
+
if (!project) throw new Error("Choose an active project number. Nothing was saved.");
|
|
2976
|
+
const minutesAnswer = (await io.ask(`Minutes worked${preview.draft.durationMinutes === null ? "" : ` [${preview.draft.durationMinutes}]`}: `)).trim();
|
|
2977
|
+
const durationMinutes = minutesAnswer === "" ? preview.draft.durationMinutes : Number(minutesAnswer);
|
|
2978
|
+
if (durationMinutes === null || !Number.isInteger(durationMinutes) || durationMinutes < 1 || durationMinutes > 1440) {
|
|
2979
|
+
throw new Error("Minutes must be a whole number from 1 to 1440. Nothing was saved.");
|
|
2980
|
+
}
|
|
2981
|
+
io.print(`Only today's work can be logged: ${preview.today} (${preview.timezone}). The date is not inferred from your note.`);
|
|
2982
|
+
const dateAnswer = (await io.ask("Work date (YYYY-MM-DD, or type today): ")).trim();
|
|
2983
|
+
const date = dateAnswer.toLowerCase() === "today" ? preview.today : dateAnswer;
|
|
2984
|
+
if (date !== preview.today) throw new Error("Choose today explicitly. Historical or future work cannot be logged here. Nothing was saved.");
|
|
2985
|
+
io.print(`Suggested outcome: ${preview.draft.note}`);
|
|
2986
|
+
const noteAnswer = await io.ask("Outcome (Enter keeps suggestion): ");
|
|
2987
|
+
const note = noteAnswer === "" ? preview.draft.note : noteAnswer;
|
|
2988
|
+
const payload = { projectId: project.id, durationMinutes, date, note };
|
|
2989
|
+
io.print(`
|
|
2990
|
+
Review: ${project.name} \xB7 ${durationMinutes} minutes \xB7 ${date} (${preview.timezone})
|
|
2991
|
+
Outcome: ${note}`);
|
|
2992
|
+
const confirmed = (await io.ask("Confirm this work was performed on that date and save these exact fields? (y/n): ")).trim().toLowerCase();
|
|
2993
|
+
return confirmed === "y" || confirmed === "yes" ? payload : null;
|
|
2994
|
+
};
|
|
2995
|
+
var saveCaptureConfirmation = async (payload, save = confirmNaturalLog) => {
|
|
2996
|
+
return save(payload, randomUUID());
|
|
2997
|
+
};
|
|
2998
|
+
var reviewNaturalLog = async (preview) => {
|
|
2999
|
+
const rl = createInterface({ input, output });
|
|
3000
|
+
const io = { ask: (prompt) => rl.question(prompt), print: (message) => console.log(message) };
|
|
3001
|
+
try {
|
|
3002
|
+
const payload = await collectCaptureConfirmation(preview, io);
|
|
3003
|
+
if (!payload) {
|
|
3004
|
+
io.print("Canceled. Entry was not created.");
|
|
3005
|
+
return null;
|
|
3006
|
+
}
|
|
3007
|
+
return await saveCaptureConfirmation(payload);
|
|
3008
|
+
} finally {
|
|
3009
|
+
rl.close();
|
|
3010
|
+
}
|
|
3011
|
+
};
|
|
3012
|
+
|
|
3013
|
+
// src/commands/log.ts
|
|
3014
|
+
var FLOW_SESSION_MIN_HOURS = 1.5;
|
|
3015
|
+
function printCreated(result) {
|
|
3016
|
+
console.log(chalk3.green(`
|
|
3017
|
+
\u2713 Logged ${result.hours}h successfully.`));
|
|
3018
|
+
if (result.xpAwarded !== null) {
|
|
3019
|
+
console.log(chalk3.green(` +${result.xpAwarded} XP earned`));
|
|
3020
|
+
}
|
|
3021
|
+
if (result.isFlowSession) {
|
|
3022
|
+
console.log(chalk3.magenta(" Deep-work bonus applied for time beyond 90 minutes."));
|
|
3023
|
+
}
|
|
3024
|
+
}
|
|
3025
|
+
function printCreatedTimeEntry(result) {
|
|
3026
|
+
printCreated({
|
|
3027
|
+
hours: result.durationSeconds / 3600,
|
|
3028
|
+
xpAwarded: result.xpAwarded,
|
|
3029
|
+
isFlowSession: result.isFlowSession
|
|
3030
|
+
});
|
|
3031
|
+
}
|
|
3032
|
+
var logCommand = new Command3("log").description("Log time with natural language or explicit project/hours").helpOption("-H, --help", "display help for command").argument("[text]", 'Natural language input, e.g. "worked 2.5h on API"').option("-p, --project <project>", "Project name").option("-h, --hours <hours>", "Hours worked", (value) => Number.parseFloat(value)).option("--started-at <ISO 8601 date-time>", "Session start with timezone; defaults to save time minus duration").option("-i, --intention <text>", "What the session intended to complete").option("-o, --outcome <text>", "What changed, shipped, or became clear").option("--next <text>", "Private next step saved with this session").option("-a, --artifact-url <url>", "Commit, document, design, or published artifact URL").action(async (text, options) => {
|
|
3033
|
+
const usesStructuredOptions = options.next !== void 0 || options.project !== void 0 || options.hours !== void 0 || options.intention !== void 0 || options.outcome !== void 0 || options.artifactUrl !== void 0 || options.startedAt !== void 0;
|
|
3034
|
+
if (text && usesStructuredOptions) {
|
|
3035
|
+
console.error(chalk3.red("Use either natural language input OR -p/-h options, not both in the same command."));
|
|
3036
|
+
return;
|
|
3037
|
+
}
|
|
3038
|
+
let spinner;
|
|
3039
|
+
try {
|
|
3040
|
+
if (text) {
|
|
3041
|
+
spinner = ora3("Parsing natural language input...").start();
|
|
3042
|
+
const parsed = await parseNaturalLog(text);
|
|
3043
|
+
spinner.succeed("Parsed");
|
|
3044
|
+
const created2 = await reviewNaturalLog(parsed);
|
|
3045
|
+
if (created2) printCreatedTimeEntry(created2);
|
|
3046
|
+
return;
|
|
3047
|
+
}
|
|
3048
|
+
if (!usesStructuredOptions) {
|
|
3049
|
+
console.error(chalk3.red("Provide either a natural language text or -p/-h options."));
|
|
3050
|
+
console.log("Examples:");
|
|
3051
|
+
console.log(' fm log "2.5h on backend API implementation"');
|
|
3052
|
+
console.log(' fm log -p "Flowmind" -h 2.5 -i "Ship API" -o "API shipped"');
|
|
3053
|
+
return;
|
|
3054
|
+
}
|
|
3055
|
+
if (!options.project || options.hours === void 0) {
|
|
3056
|
+
console.error(chalk3.red("Structured logging requires both -p <project> and -h <hours>."));
|
|
3057
|
+
return;
|
|
3058
|
+
}
|
|
3059
|
+
if (!Number.isFinite(options.hours) || options.hours <= 0) {
|
|
3060
|
+
console.error(chalk3.red("Hours must be a positive number."));
|
|
3061
|
+
return;
|
|
3062
|
+
}
|
|
3063
|
+
const isFlowSession = options.hours >= FLOW_SESSION_MIN_HOURS;
|
|
3064
|
+
spinner = ora3("Resolving project and creating time entry...").start();
|
|
3065
|
+
const created = await createStructuredTimeEntry({
|
|
3066
|
+
hours: options.hours,
|
|
3067
|
+
...options.next !== void 0 ? { nextStep: options.next } : {},
|
|
3068
|
+
projectName: options.project,
|
|
3069
|
+
...options.startedAt !== void 0 ? { startedAt: options.startedAt } : {},
|
|
3070
|
+
...options.intention !== void 0 ? { description: options.intention } : {},
|
|
3071
|
+
...options.outcome !== void 0 ? { note: options.outcome } : {},
|
|
3072
|
+
...options.artifactUrl !== void 0 ? { artifactUrl: options.artifactUrl } : {}
|
|
3073
|
+
});
|
|
3074
|
+
spinner.succeed("Time entry created");
|
|
3075
|
+
printCreatedTimeEntry(created);
|
|
3076
|
+
if (isFlowSession && !created.isFlowSession) {
|
|
3077
|
+
console.log(
|
|
3078
|
+
chalk3.yellow(" Note: entry met flow threshold locally but backend did not mark it as flow session.")
|
|
3079
|
+
);
|
|
3080
|
+
}
|
|
3081
|
+
} catch (error) {
|
|
3082
|
+
spinner?.stop();
|
|
3083
|
+
printCommandError("Log work", error);
|
|
3084
|
+
}
|
|
3085
|
+
});
|
|
3086
|
+
|
|
3087
|
+
// src/commands/hooks.ts
|
|
3088
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
3089
|
+
import { readFile, lstat, mkdir, rm, writeFile } from "node:fs/promises";
|
|
3090
|
+
import { homedir } from "node:os";
|
|
3091
|
+
import { dirname, join } from "node:path";
|
|
3092
|
+
import { Command as Command4, InvalidArgumentError as InvalidArgumentError2 } from "commander";
|
|
3093
|
+
var agents = ["codex", "claude"];
|
|
3094
|
+
var installedHashFile = ".flowmind-installed.sha256";
|
|
3095
|
+
function skillPath(agent) {
|
|
3096
|
+
return join(homedir(), agent === "codex" ? ".agents" : ".claude", "skills", "flowmind", "SKILL.md");
|
|
3097
|
+
}
|
|
3098
|
+
function hash(content) {
|
|
3099
|
+
return createHash2("sha256").update(content).digest("hex");
|
|
3100
|
+
}
|
|
3101
|
+
async function statIfPresent(path) {
|
|
3102
|
+
try {
|
|
3103
|
+
return await lstat(path);
|
|
3104
|
+
} catch (error) {
|
|
3105
|
+
if (error.code === "ENOENT") return null;
|
|
3106
|
+
throw error;
|
|
3107
|
+
}
|
|
3108
|
+
}
|
|
3109
|
+
async function inspect(agent) {
|
|
3110
|
+
const path = skillPath(agent);
|
|
3111
|
+
const markerPath = join(dirname(path), installedHashFile);
|
|
3112
|
+
const file = await statIfPresent(path);
|
|
3113
|
+
const marker = await statIfPresent(markerPath);
|
|
3114
|
+
if (file && !file.isFile() || marker && !marker.isFile()) {
|
|
3115
|
+
return { state: "unsupported", path, markerPath };
|
|
3116
|
+
}
|
|
3117
|
+
if (!file) return { state: "absent", path, markerPath };
|
|
3118
|
+
const contentHash = hash(await readFile(path, "utf8"));
|
|
3119
|
+
if (!marker) return { state: "unmanaged", path, markerPath, contentHash };
|
|
3120
|
+
const savedHash = (await readFile(markerPath, "utf8")).trim();
|
|
3121
|
+
if (!/^[a-f0-9]{64}$/.test(savedHash)) {
|
|
3122
|
+
return { state: "unsupported", path, markerPath, contentHash };
|
|
3123
|
+
}
|
|
3124
|
+
return { state: savedHash === contentHash ? "installed" : "modified", path, markerPath, contentHash };
|
|
3125
|
+
}
|
|
3126
|
+
function selectedAgents(value) {
|
|
3127
|
+
if (value === "all" || value === "codex" || value === "claude") return value;
|
|
3128
|
+
throw new InvalidArgumentError2("Agent must be codex, claude, or all.");
|
|
3129
|
+
}
|
|
3130
|
+
function reportError(error) {
|
|
3131
|
+
console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
3132
|
+
process.exitCode = 1;
|
|
3133
|
+
}
|
|
3134
|
+
async function bundledSkill() {
|
|
3135
|
+
return readFile(new URL("./flowmind/SKILL.md", import.meta.url), "utf8");
|
|
3136
|
+
}
|
|
3137
|
+
var hooksCommand = new Command4("hooks").description("Manage the Flowmind agent skill");
|
|
3138
|
+
hooksCommand.command("install").description("Install the Flowmind skill for Codex and/or Claude Code").option("--agent <agent>", "codex, claude, or all", selectedAgents, "all").option("--force", "Replace an existing edited or unmanaged skill", false).option("--dry-run", "Show writes without changing files", false).action(async (options) => {
|
|
3139
|
+
try {
|
|
3140
|
+
const content = await bundledSkill();
|
|
3141
|
+
const nextHash = hash(content);
|
|
3142
|
+
const targets = options.agent === "all" ? agents : [options.agent];
|
|
3143
|
+
const inspections = await Promise.all(targets.map(inspect));
|
|
3144
|
+
for (const target of inspections) {
|
|
3145
|
+
if (target.state === "unsupported") {
|
|
3146
|
+
throw new Error(`Unsupported skill or hash file at ${target.path}; no files written.`);
|
|
3147
|
+
}
|
|
3148
|
+
if ((target.state === "modified" || target.state === "unmanaged" && target.contentHash !== nextHash) && !options.force) {
|
|
3149
|
+
throw new Error(`Refusing to overwrite ${target.path}; use --force to replace it. No files written.`);
|
|
3150
|
+
}
|
|
3151
|
+
}
|
|
3152
|
+
for (const target of inspections) {
|
|
3153
|
+
if (target.contentHash === nextHash && target.state === "installed") {
|
|
3154
|
+
console.log(`Unchanged ${target.path}`);
|
|
3155
|
+
continue;
|
|
3156
|
+
}
|
|
3157
|
+
const writeSkill = target.contentHash !== nextHash;
|
|
3158
|
+
if (options.dryRun) {
|
|
3159
|
+
if (writeSkill) console.log(`Would write ${target.path}`);
|
|
3160
|
+
console.log(`Would write ${target.markerPath}`);
|
|
3161
|
+
continue;
|
|
3162
|
+
}
|
|
3163
|
+
await mkdir(dirname(target.path), { recursive: true });
|
|
3164
|
+
if (writeSkill) {
|
|
3165
|
+
await writeFile(target.path, content, { flag: "w", mode: 420 });
|
|
3166
|
+
console.log(`Wrote ${target.path}`);
|
|
3167
|
+
}
|
|
3168
|
+
await writeFile(target.markerPath, `${nextHash}
|
|
3169
|
+
`, { flag: "w", mode: 420 });
|
|
3170
|
+
console.log(`Wrote ${target.markerPath}`);
|
|
3171
|
+
}
|
|
3172
|
+
} catch (error) {
|
|
3173
|
+
reportError(error);
|
|
3174
|
+
}
|
|
3175
|
+
});
|
|
3176
|
+
hooksCommand.command("status").description("Show installed skills and a read-only legacy Codex copy").action(async () => {
|
|
3177
|
+
try {
|
|
3178
|
+
const currentHash = hash(await bundledSkill());
|
|
3179
|
+
for (const agent of agents) {
|
|
3180
|
+
const target = await inspect(agent);
|
|
3181
|
+
const update = target.state === "installed" && target.contentHash !== currentHash ? " (update available)" : "";
|
|
3182
|
+
console.log(`${agent}: ${target.state}${update} ${target.path}`);
|
|
3183
|
+
}
|
|
3184
|
+
const legacyPath = join(homedir(), ".codex", "skills", "flowmind", "SKILL.md");
|
|
3185
|
+
const legacy = await statIfPresent(legacyPath);
|
|
3186
|
+
console.log(`codex legacy (read-only): ${legacy ? "present" : "absent"} ${legacyPath}`);
|
|
3187
|
+
} catch (error) {
|
|
3188
|
+
reportError(error);
|
|
3189
|
+
}
|
|
3190
|
+
});
|
|
3191
|
+
hooksCommand.command("uninstall").description("Remove only unmodified Flowmind-managed skills").action(async () => {
|
|
3192
|
+
try {
|
|
3193
|
+
for (const agent of agents) {
|
|
3194
|
+
const target = await inspect(agent);
|
|
3195
|
+
if (target.state !== "installed") {
|
|
3196
|
+
console.log(`Left ${target.state} ${target.path}`);
|
|
3197
|
+
continue;
|
|
3198
|
+
}
|
|
3199
|
+
await rm(target.path);
|
|
3200
|
+
console.log(`Removed ${target.path}`);
|
|
3201
|
+
await rm(target.markerPath);
|
|
3202
|
+
console.log(`Removed ${target.markerPath}`);
|
|
3203
|
+
}
|
|
3204
|
+
} catch (error) {
|
|
3205
|
+
reportError(error);
|
|
3206
|
+
}
|
|
3207
|
+
});
|
|
3208
|
+
|
|
3209
|
+
// src/commands/status.ts
|
|
3210
|
+
import { Command as Command5 } from "commander";
|
|
3211
|
+
import chalk4 from "chalk";
|
|
3212
|
+
function renderBox(title, rows) {
|
|
3213
|
+
const contentLines = [
|
|
3214
|
+
title,
|
|
3215
|
+
...rows.map(([label, value]) => `${label}: ${value}`)
|
|
3216
|
+
];
|
|
3217
|
+
const width2 = contentLines.reduce((max, line) => Math.max(max, line.length), 0);
|
|
3218
|
+
const top = `\u250C${"\u2500".repeat(width2 + 2)}\u2510`;
|
|
3219
|
+
const divider = `\u251C${"\u2500".repeat(width2 + 2)}\u2524`;
|
|
3220
|
+
const bottom = `\u2514${"\u2500".repeat(width2 + 2)}\u2518`;
|
|
3221
|
+
const body = [
|
|
3222
|
+
`${chalk4.cyan("\u2502")} ${chalk4.bold(title.padEnd(width2))} ${chalk4.cyan("\u2502")}`,
|
|
3223
|
+
chalk4.cyan(divider),
|
|
3224
|
+
...rows.map(([label, value]) => {
|
|
3225
|
+
const line = `${label}: ${value}`.padEnd(width2);
|
|
3226
|
+
return `${chalk4.cyan("\u2502")} ${line} ${chalk4.cyan("\u2502")}`;
|
|
3227
|
+
})
|
|
3228
|
+
];
|
|
3229
|
+
return [chalk4.cyan(top), ...body, chalk4.cyan(bottom)].join("\n");
|
|
3230
|
+
}
|
|
3231
|
+
var statusCommand = new Command5("status").description("Show your current Flowmind status").action(async () => {
|
|
3232
|
+
try {
|
|
3233
|
+
const { publicStats, streak, xp } = await getStatusSnapshot();
|
|
3234
|
+
const box = renderBox("Flowmind Status", [
|
|
3235
|
+
["Level", `${xp.level} (${xp.levelName})`],
|
|
3236
|
+
["XP", `${xp.totalXp.toLocaleString()} (${xp.xpToNextLevel.toLocaleString()} to next)`],
|
|
3237
|
+
["Streak", `${streak.currentStreak} day${streak.currentStreak === 1 ? "" : "s"}`],
|
|
3238
|
+
["Shields", `${streak.shields}/${streak.maxShields}`],
|
|
3239
|
+
["Total Hours", publicStats.totalHours.toString()],
|
|
3240
|
+
["Deep Work Hours", publicStats.deepWorkHours.toString()]
|
|
3241
|
+
]);
|
|
3242
|
+
console.log(`
|
|
3243
|
+
${box}
|
|
3244
|
+
`);
|
|
3245
|
+
} catch (error) {
|
|
3246
|
+
printCommandError("Read status", error);
|
|
3247
|
+
}
|
|
3248
|
+
});
|
|
3249
|
+
|
|
3250
|
+
// ../../packages/contracts/src/generated/validators/postV1Projects200.js
|
|
3251
|
+
function s3(r2, { instancePath: o9 = "", parentData: m5, parentDataProperty: u2, rootData: n7 = r2 } = {}) {
|
|
3252
|
+
let e3 = null, t8 = 0, d6 = t8;
|
|
3253
|
+
i(r2, { instancePath: o9, parentData: m5, parentDataProperty: u2, rootData: n7 }) || (e3 = e3 === null ? i.errors : e3.concat(i.errors), t8 = e3.length);
|
|
3254
|
+
var f3 = d6 === t8;
|
|
3255
|
+
if (f3) {
|
|
3256
|
+
let p7 = t8;
|
|
3257
|
+
if (t8 === p7) if (r2 && typeof r2 == "object" && !Array.isArray(r2)) {
|
|
3258
|
+
let l6;
|
|
3259
|
+
if (r2.data === void 0 && (l6 = "data")) return s3.errors = [{ instancePath: o9, schemaPath: "#/allOf/1/required", keyword: "required", params: { missingProperty: l6 }, message: "must have required property '" + l6 + "'" }], false;
|
|
3260
|
+
r2.data !== void 0 && (n(r2.data, { instancePath: o9 + "/data", parentData: r2, parentDataProperty: "data", rootData: n7 }) || (e3 = e3 === null ? n.errors : e3.concat(n.errors), t8 = e3.length));
|
|
3261
|
+
} else return s3.errors = [{ instancePath: o9, schemaPath: "#/allOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
3262
|
+
var f3 = p7 === t8;
|
|
3263
|
+
}
|
|
3264
|
+
return s3.errors = e3, t8 === 0;
|
|
3265
|
+
}
|
|
3266
|
+
var h9 = s3;
|
|
3267
|
+
|
|
3268
|
+
// ../../packages/contracts/src/generated/endpoints/postV1Projects.ts
|
|
3269
|
+
var postV1Projects = {
|
|
3270
|
+
method: "POST",
|
|
3271
|
+
path: "/v1/projects/",
|
|
3272
|
+
operation: "POST /v1/projects/",
|
|
3273
|
+
revision: contractRevision,
|
|
3274
|
+
responses: {
|
|
3275
|
+
200: { mediaType: "application/json", schemaId: "urn:flowmind:postV1Projects:200", validate: h9 }
|
|
3276
|
+
},
|
|
3277
|
+
error: { mediaType: "application/json", schemaId: "ApiErrorEnvelope", validate: h }
|
|
3278
|
+
};
|
|
3279
|
+
|
|
3280
|
+
// src/commands/projects.ts
|
|
3281
|
+
import { Command as Command6 } from "commander";
|
|
3282
|
+
import chalk5 from "chalk";
|
|
3283
|
+
var projectsCommand = new Command6("projects").description("List and manage projects");
|
|
3284
|
+
projectsCommand.action(async () => {
|
|
3285
|
+
try {
|
|
3286
|
+
const projects = await listProjects();
|
|
3287
|
+
if (projects.length === 0) {
|
|
3288
|
+
console.log(chalk5.dim("\nNo projects found.\n"));
|
|
3289
|
+
return;
|
|
3290
|
+
}
|
|
3291
|
+
const nameWidth = Math.max("Project".length, ...projects.map((p7) => p7.name.length));
|
|
3292
|
+
const categoryWidth = Math.max("Category".length, ...projects.map((p7) => p7.category.length));
|
|
3293
|
+
console.log(chalk5.bold("\nProjects\n"));
|
|
3294
|
+
console.log(
|
|
3295
|
+
`${"Project".padEnd(nameWidth)} ${"Category".padEnd(categoryWidth)} Status`
|
|
3296
|
+
);
|
|
3297
|
+
console.log(`${"-".repeat(nameWidth)} ${"-".repeat(categoryWidth)} ${"-".repeat("Status".length)}`);
|
|
3298
|
+
for (const project of projects) {
|
|
3299
|
+
const status = projectStatus(project);
|
|
3300
|
+
const statusText = status === "active" ? chalk5.green(status) : chalk5.yellow(status);
|
|
3301
|
+
console.log(
|
|
3302
|
+
`${project.name.padEnd(nameWidth)} ${project.category.padEnd(categoryWidth)} ${statusText}`
|
|
3303
|
+
);
|
|
3304
|
+
}
|
|
3305
|
+
console.log("");
|
|
3306
|
+
} catch (error) {
|
|
3307
|
+
printCommandError("Read projects", error);
|
|
3308
|
+
}
|
|
3309
|
+
});
|
|
3310
|
+
projectsCommand.command("add <name>").description("Add a new project").action(async (name) => {
|
|
3311
|
+
try {
|
|
3312
|
+
const created = await apiRequest(postV1Projects, { body: { name } });
|
|
3313
|
+
console.log(chalk5.green(`\u2713 Project created: ${created.name}`));
|
|
3314
|
+
} catch (error) {
|
|
3315
|
+
printCommandError("Create project", error);
|
|
3316
|
+
}
|
|
3317
|
+
});
|
|
3318
|
+
|
|
3319
|
+
// src/commands/stats.ts
|
|
3320
|
+
import { Command as Command7 } from "commander";
|
|
3321
|
+
import chalk6 from "chalk";
|
|
3322
|
+
function formatBadge(badge) {
|
|
3323
|
+
return `${badge.name} \u2014 ${badge.description}`;
|
|
3324
|
+
}
|
|
3325
|
+
function printTopItems(title, items) {
|
|
3326
|
+
console.log(chalk6.bold(`
|
|
3327
|
+
${title}`));
|
|
3328
|
+
if (items.length === 0) {
|
|
3329
|
+
console.log(" None yet.");
|
|
3330
|
+
return;
|
|
3331
|
+
}
|
|
3332
|
+
for (const item of items) {
|
|
3333
|
+
console.log(` ${item.name}: ${item.totalHours}h`);
|
|
3334
|
+
}
|
|
3335
|
+
}
|
|
3336
|
+
var statsCommand = new Command7("stats").description("Show detailed Flowmind statistics").action(async () => {
|
|
3337
|
+
try {
|
|
3338
|
+
const { publicStats, streak, xp, badges, hourBank } = await getDetailedStats();
|
|
3339
|
+
console.log(chalk6.bold("\nDetailed Stats\n"));
|
|
3340
|
+
console.log(`Level: ${xp.level} (${xp.levelName})`);
|
|
3341
|
+
console.log(`Current XP: ${xp.totalXp.toLocaleString()}`);
|
|
3342
|
+
console.log(`XP to Next Level: ${xp.xpToNextLevel.toLocaleString()}`);
|
|
3343
|
+
console.log(`XP Progress: ${xp.progressPercent}%`);
|
|
3344
|
+
console.log(`Streak: ${streak.currentStreak}`);
|
|
3345
|
+
console.log(`Shields: ${streak.shields}/${streak.maxShields}`);
|
|
3346
|
+
console.log(`Total Hours: ${publicStats.totalHours}`);
|
|
3347
|
+
console.log(`Deep Work Hours: ${publicStats.deepWorkHours}`);
|
|
3348
|
+
console.log(`Total Entries: ${publicStats.totalEntries}`);
|
|
3349
|
+
console.log(`Member Since: ${new Date(publicStats.memberSince).toLocaleDateString()}`);
|
|
3350
|
+
console.log(chalk6.bold("\nXP per level"));
|
|
3351
|
+
console.log(` Current level XP: ${xp.xpInCurrentLevel.toLocaleString()}`);
|
|
3352
|
+
console.log(` Next target: ${(xp.totalXp + xp.xpToNextLevel).toLocaleString()}`);
|
|
3353
|
+
printTopItems("Top projects", publicStats.topProjects);
|
|
3354
|
+
printTopItems("Top routines", publicStats.topRoutines);
|
|
3355
|
+
console.log(chalk6.bold("\nHour bank"));
|
|
3356
|
+
if (hourBank.items.length === 0) {
|
|
3357
|
+
console.log(" No logged hours yet.");
|
|
3358
|
+
} else {
|
|
3359
|
+
for (const item of hourBank.items) {
|
|
3360
|
+
console.log(` ${item.name} (${item.kind}): ${item.totalHours}h`);
|
|
3361
|
+
}
|
|
3362
|
+
}
|
|
3363
|
+
console.log(chalk6.bold("\nBadges earned"));
|
|
3364
|
+
if (badges.badges.length > 0) {
|
|
3365
|
+
for (const badge of badges.badges) {
|
|
3366
|
+
console.log(` \u2022 ${formatBadge(badge)}`);
|
|
3367
|
+
}
|
|
3368
|
+
} else {
|
|
3369
|
+
console.log(" No badges earned yet.");
|
|
3370
|
+
}
|
|
3371
|
+
console.log("");
|
|
3372
|
+
} catch (error) {
|
|
3373
|
+
printCommandError("Read stats", error);
|
|
3374
|
+
}
|
|
3375
|
+
});
|
|
3376
|
+
|
|
3377
|
+
// src/commands/momentum.ts
|
|
3378
|
+
import { stripVTControlCharacters } from "node:util";
|
|
3379
|
+
import { Chalk } from "chalk";
|
|
3380
|
+
import { Command as Command8 } from "commander";
|
|
3381
|
+
|
|
3382
|
+
// ../../packages/contracts/src/generated/validators/shared/44HCAOK3.js
|
|
3383
|
+
var e2 = new RegExp("^\\d{4}-\\d{2}-\\d{2}$", "u");
|
|
3384
|
+
|
|
3385
|
+
// ../../packages/contracts/src/generated/validators/getV1MeMomentum200.js
|
|
3386
|
+
var $ = { additionalProperties: false, properties: { asOfDay: { pattern: "^\\d{4}-\\d{2}-\\d{2}$", type: "string" }, currentWeekOf: { pattern: "^\\d{4}-\\d{2}-\\d{2}$", type: "string" }, daysElapsed: { maximum: 7, minimum: 1, type: "integer" }, hiddenProjectCount: { minimum: 0, type: "integer" }, isCurrentWeek: { type: "boolean" }, projects: { items: { $ref: "urn:flowmind:schema:MomentumProject" }, maxItems: 10, type: "array" }, signals: { items: { $ref: "urn:flowmind:schema:MomentumSignal" }, maxItems: 4, type: "array" }, totals: { items: { $ref: "urn:flowmind:schema:MomentumWeekTotals" }, maxItems: 8, minItems: 8, type: "array" }, weekOf: { pattern: "^\\d{4}-\\d{2}-\\d{2}$", type: "string" }, weeks: { items: { pattern: "^\\d{4}-\\d{2}-\\d{2}$", type: "string" }, maxItems: 8, minItems: 8, type: "array" } }, required: ["weekOf", "currentWeekOf", "isCurrentWeek", "asOfDay", "daysElapsed", "weeks", "totals", "projects", "hiddenProjectCount", "signals"], type: "object" };
|
|
3387
|
+
var L = { additionalProperties: false, properties: { color: { type: "string" }, daysSinceLastOutcome: { minimum: 0, nullable: true, type: "integer" }, icon: { type: "string" }, lastOutcome: { anyOf: [{ $ref: "urn:flowmind:schema:MomentumEvidence" }, { enum: [null], nullable: true, type: "object" }] }, name: { type: "string" }, projectId: { format: "uuid", type: "string" }, status: { enum: ["active", "completed", "archived"], type: "string" }, trend: { enum: ["new", "rising", "steady", "cooling", "quiet"], type: "string" }, weeks: { items: { $ref: "urn:flowmind:schema:MomentumProjectWeek" }, maxItems: 8, minItems: 8, type: "array" }, windowAgentSeconds: { minimum: 0, type: "integer" }, windowOutcomes: { minimum: 0, type: "integer" }, windowPersonalSeconds: { minimum: 0, type: "integer" } }, required: ["projectId", "name", "color", "icon", "status", "trend", "weeks", "windowOutcomes", "windowPersonalSeconds", "windowAgentSeconds", "lastOutcome", "daysSinceLastOutcome"], type: "object" };
|
|
3388
|
+
var T = { additionalProperties: false, properties: { artifactUrl: { nullable: true, type: "string" }, captureSource: { enum: ["unrecorded", "manual", "timer", "ai_text", "voice", "cli", "agent"], type: "string" }, durationMinutes: { minimum: 0, type: "integer" }, localDay: { pattern: "^\\d{4}-\\d{2}-\\d{2}$", type: "string" }, loggedLate: { type: "boolean" }, outcome: { minLength: 1, type: "string" }, projectId: { format: "uuid", type: "string" }, projectName: { type: "string" }, timeEntryId: { format: "uuid", type: "string" } }, required: ["timeEntryId", "projectId", "projectName", "localDay", "outcome", "artifactUrl", "durationMinutes", "captureSource", "loggedLate"], type: "object" };
|
|
3389
|
+
function y2(r2, { instancePath: s4 = "", parentData: I2, parentDataProperty: S2, rootData: k2 = r2 } = {}) {
|
|
3390
|
+
let m5 = null, e3 = 0;
|
|
3391
|
+
if (e3 === 0) if (r2 && typeof r2 == "object" && !Array.isArray(r2)) {
|
|
3392
|
+
let o9;
|
|
3393
|
+
if (r2.timeEntryId === void 0 && (o9 = "timeEntryId") || r2.projectId === void 0 && (o9 = "projectId") || r2.projectName === void 0 && (o9 = "projectName") || r2.localDay === void 0 && (o9 = "localDay") || r2.outcome === void 0 && (o9 = "outcome") || r2.artifactUrl === void 0 && (o9 = "artifactUrl") || r2.durationMinutes === void 0 && (o9 = "durationMinutes") || r2.captureSource === void 0 && (o9 = "captureSource") || r2.loggedLate === void 0 && (o9 = "loggedLate")) return y2.errors = [{ instancePath: s4, schemaPath: "#/required", keyword: "required", params: { missingProperty: o9 }, message: "must have required property '" + o9 + "'" }], false;
|
|
3394
|
+
{
|
|
3395
|
+
let v3 = e3;
|
|
3396
|
+
for (let t8 in r2) if (!t4.call(T.properties, t8)) {
|
|
3397
|
+
return y2.errors = [{ instancePath: s4, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: t8 }, message: "must NOT have additional properties" }], false;
|
|
3398
|
+
break;
|
|
3399
|
+
}
|
|
3400
|
+
if (v3 === e3) {
|
|
3401
|
+
if (r2.artifactUrl !== void 0) {
|
|
3402
|
+
let t8 = r2.artifactUrl, n7 = e3;
|
|
3403
|
+
if (typeof t8 != "string" && t8 !== null) return y2.errors = [{ instancePath: s4 + "/artifactUrl", schemaPath: "#/properties/artifactUrl/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3404
|
+
var i6 = n7 === e3;
|
|
3405
|
+
} else var i6 = true;
|
|
3406
|
+
if (i6) {
|
|
3407
|
+
if (r2.captureSource !== void 0) {
|
|
3408
|
+
let t8 = r2.captureSource, n7 = e3;
|
|
3409
|
+
if (typeof t8 != "string") return y2.errors = [{ instancePath: s4 + "/captureSource", schemaPath: "#/properties/captureSource/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3410
|
+
if (!(t8 === "unrecorded" || t8 === "manual" || t8 === "timer" || t8 === "ai_text" || t8 === "voice" || t8 === "cli" || t8 === "agent")) return y2.errors = [{ instancePath: s4 + "/captureSource", schemaPath: "#/properties/captureSource/enum", keyword: "enum", params: { allowedValues: T.properties.captureSource.enum }, message: "must be equal to one of the allowed values" }], false;
|
|
3411
|
+
var i6 = n7 === e3;
|
|
3412
|
+
} else var i6 = true;
|
|
3413
|
+
if (i6) {
|
|
3414
|
+
if (r2.durationMinutes !== void 0) {
|
|
3415
|
+
let t8 = r2.durationMinutes, n7 = e3;
|
|
3416
|
+
if (!(typeof t8 == "number" && !(t8 % 1) && !isNaN(t8) && isFinite(t8))) return y2.errors = [{ instancePath: s4 + "/durationMinutes", schemaPath: "#/properties/durationMinutes/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
3417
|
+
if (e3 === n7 && typeof t8 == "number" && isFinite(t8) && (t8 < 0 || isNaN(t8))) return y2.errors = [{ instancePath: s4 + "/durationMinutes", schemaPath: "#/properties/durationMinutes/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
3418
|
+
var i6 = n7 === e3;
|
|
3419
|
+
} else var i6 = true;
|
|
3420
|
+
if (i6) {
|
|
3421
|
+
if (r2.localDay !== void 0) {
|
|
3422
|
+
let t8 = r2.localDay, n7 = e3;
|
|
3423
|
+
if (e3 === n7) if (typeof t8 == "string") {
|
|
3424
|
+
if (!e2.test(t8)) return y2.errors = [{ instancePath: s4 + "/localDay", schemaPath: "#/properties/localDay/pattern", keyword: "pattern", params: { pattern: "^\\d{4}-\\d{2}-\\d{2}$" }, message: 'must match pattern "^\\d{4}-\\d{2}-\\d{2}$"' }], false;
|
|
3425
|
+
} else return y2.errors = [{ instancePath: s4 + "/localDay", schemaPath: "#/properties/localDay/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3426
|
+
var i6 = n7 === e3;
|
|
3427
|
+
} else var i6 = true;
|
|
3428
|
+
if (i6) {
|
|
3429
|
+
if (r2.loggedLate !== void 0) {
|
|
3430
|
+
let t8 = e3;
|
|
3431
|
+
if (typeof r2.loggedLate != "boolean") return y2.errors = [{ instancePath: s4 + "/loggedLate", schemaPath: "#/properties/loggedLate/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }], false;
|
|
3432
|
+
var i6 = t8 === e3;
|
|
3433
|
+
} else var i6 = true;
|
|
3434
|
+
if (i6) {
|
|
3435
|
+
if (r2.outcome !== void 0) {
|
|
3436
|
+
let t8 = r2.outcome, n7 = e3;
|
|
3437
|
+
if (e3 === n7) if (typeof t8 == "string") {
|
|
3438
|
+
if (o(t8) < 1) return y2.errors = [{ instancePath: s4 + "/outcome", schemaPath: "#/properties/outcome/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }], false;
|
|
3439
|
+
} else return y2.errors = [{ instancePath: s4 + "/outcome", schemaPath: "#/properties/outcome/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3440
|
+
var i6 = n7 === e3;
|
|
3441
|
+
} else var i6 = true;
|
|
3442
|
+
if (i6) {
|
|
3443
|
+
if (r2.projectId !== void 0) {
|
|
3444
|
+
let t8 = r2.projectId, n7 = e3;
|
|
3445
|
+
if (e3 === n7 && e3 === n7) if (typeof t8 == "string") {
|
|
3446
|
+
if (!a.test(t8)) return y2.errors = [{ instancePath: s4 + "/projectId", schemaPath: "#/properties/projectId/format", keyword: "format", params: { format: "uuid" }, message: 'must match format "uuid"' }], false;
|
|
3447
|
+
} else return y2.errors = [{ instancePath: s4 + "/projectId", schemaPath: "#/properties/projectId/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3448
|
+
var i6 = n7 === e3;
|
|
3449
|
+
} else var i6 = true;
|
|
3450
|
+
if (i6) {
|
|
3451
|
+
if (r2.projectName !== void 0) {
|
|
3452
|
+
let t8 = e3;
|
|
3453
|
+
if (typeof r2.projectName != "string") return y2.errors = [{ instancePath: s4 + "/projectName", schemaPath: "#/properties/projectName/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3454
|
+
var i6 = t8 === e3;
|
|
3455
|
+
} else var i6 = true;
|
|
3456
|
+
if (i6) if (r2.timeEntryId !== void 0) {
|
|
3457
|
+
let t8 = r2.timeEntryId, n7 = e3;
|
|
3458
|
+
if (e3 === n7 && e3 === n7) if (typeof t8 == "string") {
|
|
3459
|
+
if (!a.test(t8)) return y2.errors = [{ instancePath: s4 + "/timeEntryId", schemaPath: "#/properties/timeEntryId/format", keyword: "format", params: { format: "uuid" }, message: 'must match format "uuid"' }], false;
|
|
3460
|
+
} else return y2.errors = [{ instancePath: s4 + "/timeEntryId", schemaPath: "#/properties/timeEntryId/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3461
|
+
var i6 = n7 === e3;
|
|
3462
|
+
} else var i6 = true;
|
|
3463
|
+
}
|
|
3464
|
+
}
|
|
3465
|
+
}
|
|
3466
|
+
}
|
|
3467
|
+
}
|
|
3468
|
+
}
|
|
3469
|
+
}
|
|
3470
|
+
}
|
|
3471
|
+
}
|
|
3472
|
+
} else return y2.errors = [{ instancePath: s4, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
3473
|
+
return y2.errors = m5, e3 === 0;
|
|
3474
|
+
}
|
|
3475
|
+
function b2(r2, { instancePath: s4 = "", parentData: I2, parentDataProperty: S2, rootData: k2 = r2 } = {}) {
|
|
3476
|
+
let m5 = null, e3 = 0;
|
|
3477
|
+
if (e3 === 0) if (r2 && typeof r2 == "object" && !Array.isArray(r2)) {
|
|
3478
|
+
let o9;
|
|
3479
|
+
if (r2.weekOf === void 0 && (o9 = "weekOf") || r2.personalSeconds === void 0 && (o9 = "personalSeconds") || r2.agentSeconds === void 0 && (o9 = "agentSeconds") || r2.outcomes === void 0 && (o9 = "outcomes")) return b2.errors = [{ instancePath: s4, schemaPath: "#/required", keyword: "required", params: { missingProperty: o9 }, message: "must have required property '" + o9 + "'" }], false;
|
|
3480
|
+
{
|
|
3481
|
+
let v3 = e3;
|
|
3482
|
+
for (let t8 in r2) if (!(t8 === "agentSeconds" || t8 === "outcomes" || t8 === "personalSeconds" || t8 === "weekOf")) {
|
|
3483
|
+
return b2.errors = [{ instancePath: s4, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: t8 }, message: "must NOT have additional properties" }], false;
|
|
3484
|
+
break;
|
|
3485
|
+
}
|
|
3486
|
+
if (v3 === e3) {
|
|
3487
|
+
if (r2.agentSeconds !== void 0) {
|
|
3488
|
+
let t8 = r2.agentSeconds, n7 = e3;
|
|
3489
|
+
if (!(typeof t8 == "number" && !(t8 % 1) && !isNaN(t8) && isFinite(t8))) return b2.errors = [{ instancePath: s4 + "/agentSeconds", schemaPath: "#/properties/agentSeconds/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
3490
|
+
if (e3 === n7 && typeof t8 == "number" && isFinite(t8) && (t8 < 0 || isNaN(t8))) return b2.errors = [{ instancePath: s4 + "/agentSeconds", schemaPath: "#/properties/agentSeconds/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
3491
|
+
var i6 = n7 === e3;
|
|
3492
|
+
} else var i6 = true;
|
|
3493
|
+
if (i6) {
|
|
3494
|
+
if (r2.outcomes !== void 0) {
|
|
3495
|
+
let t8 = r2.outcomes, n7 = e3;
|
|
3496
|
+
if (!(typeof t8 == "number" && !(t8 % 1) && !isNaN(t8) && isFinite(t8))) return b2.errors = [{ instancePath: s4 + "/outcomes", schemaPath: "#/properties/outcomes/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
3497
|
+
if (e3 === n7 && typeof t8 == "number" && isFinite(t8) && (t8 < 0 || isNaN(t8))) return b2.errors = [{ instancePath: s4 + "/outcomes", schemaPath: "#/properties/outcomes/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
3498
|
+
var i6 = n7 === e3;
|
|
3499
|
+
} else var i6 = true;
|
|
3500
|
+
if (i6) {
|
|
3501
|
+
if (r2.personalSeconds !== void 0) {
|
|
3502
|
+
let t8 = r2.personalSeconds, n7 = e3;
|
|
3503
|
+
if (!(typeof t8 == "number" && !(t8 % 1) && !isNaN(t8) && isFinite(t8))) return b2.errors = [{ instancePath: s4 + "/personalSeconds", schemaPath: "#/properties/personalSeconds/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
3504
|
+
if (e3 === n7 && typeof t8 == "number" && isFinite(t8) && (t8 < 0 || isNaN(t8))) return b2.errors = [{ instancePath: s4 + "/personalSeconds", schemaPath: "#/properties/personalSeconds/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
3505
|
+
var i6 = n7 === e3;
|
|
3506
|
+
} else var i6 = true;
|
|
3507
|
+
if (i6) if (r2.weekOf !== void 0) {
|
|
3508
|
+
let t8 = r2.weekOf, n7 = e3;
|
|
3509
|
+
if (e3 === n7) if (typeof t8 == "string") {
|
|
3510
|
+
if (!e2.test(t8)) return b2.errors = [{ instancePath: s4 + "/weekOf", schemaPath: "#/properties/weekOf/pattern", keyword: "pattern", params: { pattern: "^\\d{4}-\\d{2}-\\d{2}$" }, message: 'must match pattern "^\\d{4}-\\d{2}-\\d{2}$"' }], false;
|
|
3511
|
+
} else return b2.errors = [{ instancePath: s4 + "/weekOf", schemaPath: "#/properties/weekOf/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3512
|
+
var i6 = n7 === e3;
|
|
3513
|
+
} else var i6 = true;
|
|
3514
|
+
}
|
|
3515
|
+
}
|
|
3516
|
+
}
|
|
3517
|
+
}
|
|
3518
|
+
} else return b2.errors = [{ instancePath: s4, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
3519
|
+
return b2.errors = m5, e3 === 0;
|
|
3520
|
+
}
|
|
3521
|
+
function d5(r2, { instancePath: s4 = "", parentData: I2, parentDataProperty: S2, rootData: k2 = r2 } = {}) {
|
|
3522
|
+
let m5 = null, e3 = 0;
|
|
3523
|
+
if (e3 === 0) if (r2 && typeof r2 == "object" && !Array.isArray(r2)) {
|
|
3524
|
+
let t8;
|
|
3525
|
+
if (r2.projectId === void 0 && (t8 = "projectId") || r2.name === void 0 && (t8 = "name") || r2.color === void 0 && (t8 = "color") || r2.icon === void 0 && (t8 = "icon") || r2.status === void 0 && (t8 = "status") || r2.trend === void 0 && (t8 = "trend") || r2.weeks === void 0 && (t8 = "weeks") || r2.windowOutcomes === void 0 && (t8 = "windowOutcomes") || r2.windowPersonalSeconds === void 0 && (t8 = "windowPersonalSeconds") || r2.windowAgentSeconds === void 0 && (t8 = "windowAgentSeconds") || r2.lastOutcome === void 0 && (t8 = "lastOutcome") || r2.daysSinceLastOutcome === void 0 && (t8 = "daysSinceLastOutcome")) return d5.errors = [{ instancePath: s4, schemaPath: "#/required", keyword: "required", params: { missingProperty: t8 }, message: "must have required property '" + t8 + "'" }], false;
|
|
3526
|
+
{
|
|
3527
|
+
let n7 = e3;
|
|
3528
|
+
for (let a3 in r2) if (!t4.call(L.properties, a3)) {
|
|
3529
|
+
return d5.errors = [{ instancePath: s4, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: a3 }, message: "must NOT have additional properties" }], false;
|
|
3530
|
+
break;
|
|
3531
|
+
}
|
|
3532
|
+
if (n7 === e3) {
|
|
3533
|
+
if (r2.color !== void 0) {
|
|
3534
|
+
let a3 = e3;
|
|
3535
|
+
if (typeof r2.color != "string") return d5.errors = [{ instancePath: s4 + "/color", schemaPath: "#/properties/color/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3536
|
+
var i6 = a3 === e3;
|
|
3537
|
+
} else var i6 = true;
|
|
3538
|
+
if (i6) {
|
|
3539
|
+
if (r2.daysSinceLastOutcome !== void 0) {
|
|
3540
|
+
let a3 = r2.daysSinceLastOutcome, l6 = e3;
|
|
3541
|
+
if (!(typeof a3 == "number" && !(a3 % 1) && !isNaN(a3) && isFinite(a3)) && a3 !== null) return d5.errors = [{ instancePath: s4 + "/daysSinceLastOutcome", schemaPath: "#/properties/daysSinceLastOutcome/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
3542
|
+
if (e3 === l6 && typeof a3 == "number" && isFinite(a3) && (a3 < 0 || isNaN(a3))) return d5.errors = [{ instancePath: s4 + "/daysSinceLastOutcome", schemaPath: "#/properties/daysSinceLastOutcome/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
3543
|
+
var i6 = l6 === e3;
|
|
3544
|
+
} else var i6 = true;
|
|
3545
|
+
if (i6) {
|
|
3546
|
+
if (r2.icon !== void 0) {
|
|
3547
|
+
let a3 = e3;
|
|
3548
|
+
if (typeof r2.icon != "string") return d5.errors = [{ instancePath: s4 + "/icon", schemaPath: "#/properties/icon/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3549
|
+
var i6 = a3 === e3;
|
|
3550
|
+
} else var i6 = true;
|
|
3551
|
+
if (i6) {
|
|
3552
|
+
if (r2.lastOutcome !== void 0) {
|
|
3553
|
+
let a3 = r2.lastOutcome, l6 = e3, p7 = e3, u2 = false, P3 = e3;
|
|
3554
|
+
y2(a3, { instancePath: s4 + "/lastOutcome", parentData: r2, parentDataProperty: "lastOutcome", rootData: k2 }) || (m5 = m5 === null ? y2.errors : m5.concat(y2.errors), e3 = m5.length);
|
|
3555
|
+
var o9 = P3 === e3;
|
|
3556
|
+
if (u2 = u2 || o9, !u2) {
|
|
3557
|
+
let c3 = e3;
|
|
3558
|
+
if (!(a3 && typeof a3 == "object" && !Array.isArray(a3)) && a3 !== null) {
|
|
3559
|
+
let x3 = { instancePath: s4 + "/lastOutcome", schemaPath: "#/properties/lastOutcome/anyOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
3560
|
+
m5 === null ? m5 = [x3] : m5.push(x3), e3++;
|
|
3561
|
+
}
|
|
3562
|
+
if (a3 !== null) {
|
|
3563
|
+
let x3 = { instancePath: s4 + "/lastOutcome", schemaPath: "#/properties/lastOutcome/anyOf/1/enum", keyword: "enum", params: { allowedValues: L.properties.lastOutcome.anyOf[1].enum }, message: "must be equal to one of the allowed values" };
|
|
3564
|
+
m5 === null ? m5 = [x3] : m5.push(x3), e3++;
|
|
3565
|
+
}
|
|
3566
|
+
var o9 = c3 === e3;
|
|
3567
|
+
u2 = u2 || o9;
|
|
3568
|
+
}
|
|
3569
|
+
if (u2) e3 = p7, m5 !== null && (p7 ? m5.length = p7 : m5 = null);
|
|
3570
|
+
else {
|
|
3571
|
+
let c3 = { instancePath: s4 + "/lastOutcome", schemaPath: "#/properties/lastOutcome/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
|
|
3572
|
+
return m5 === null ? m5 = [c3] : m5.push(c3), e3++, d5.errors = m5, false;
|
|
3573
|
+
}
|
|
3574
|
+
var i6 = l6 === e3;
|
|
3575
|
+
} else var i6 = true;
|
|
3576
|
+
if (i6) {
|
|
3577
|
+
if (r2.name !== void 0) {
|
|
3578
|
+
let a3 = e3;
|
|
3579
|
+
if (typeof r2.name != "string") return d5.errors = [{ instancePath: s4 + "/name", schemaPath: "#/properties/name/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3580
|
+
var i6 = a3 === e3;
|
|
3581
|
+
} else var i6 = true;
|
|
3582
|
+
if (i6) {
|
|
3583
|
+
if (r2.projectId !== void 0) {
|
|
3584
|
+
let a3 = r2.projectId, l6 = e3;
|
|
3585
|
+
if (e3 === l6 && e3 === l6) if (typeof a3 == "string") {
|
|
3586
|
+
if (!a.test(a3)) return d5.errors = [{ instancePath: s4 + "/projectId", schemaPath: "#/properties/projectId/format", keyword: "format", params: { format: "uuid" }, message: 'must match format "uuid"' }], false;
|
|
3587
|
+
} else return d5.errors = [{ instancePath: s4 + "/projectId", schemaPath: "#/properties/projectId/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3588
|
+
var i6 = l6 === e3;
|
|
3589
|
+
} else var i6 = true;
|
|
3590
|
+
if (i6) {
|
|
3591
|
+
if (r2.status !== void 0) {
|
|
3592
|
+
let a3 = r2.status, l6 = e3;
|
|
3593
|
+
if (typeof a3 != "string") return d5.errors = [{ instancePath: s4 + "/status", schemaPath: "#/properties/status/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3594
|
+
if (!(a3 === "active" || a3 === "completed" || a3 === "archived")) return d5.errors = [{ instancePath: s4 + "/status", schemaPath: "#/properties/status/enum", keyword: "enum", params: { allowedValues: L.properties.status.enum }, message: "must be equal to one of the allowed values" }], false;
|
|
3595
|
+
var i6 = l6 === e3;
|
|
3596
|
+
} else var i6 = true;
|
|
3597
|
+
if (i6) {
|
|
3598
|
+
if (r2.trend !== void 0) {
|
|
3599
|
+
let a3 = r2.trend, l6 = e3;
|
|
3600
|
+
if (typeof a3 != "string") return d5.errors = [{ instancePath: s4 + "/trend", schemaPath: "#/properties/trend/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3601
|
+
if (!(a3 === "new" || a3 === "rising" || a3 === "steady" || a3 === "cooling" || a3 === "quiet")) return d5.errors = [{ instancePath: s4 + "/trend", schemaPath: "#/properties/trend/enum", keyword: "enum", params: { allowedValues: L.properties.trend.enum }, message: "must be equal to one of the allowed values" }], false;
|
|
3602
|
+
var i6 = l6 === e3;
|
|
3603
|
+
} else var i6 = true;
|
|
3604
|
+
if (i6) {
|
|
3605
|
+
if (r2.weeks !== void 0) {
|
|
3606
|
+
let a3 = r2.weeks, l6 = e3;
|
|
3607
|
+
if (e3 === l6) if (Array.isArray(a3)) {
|
|
3608
|
+
if (a3.length > 8) return d5.errors = [{ instancePath: s4 + "/weeks", schemaPath: "#/properties/weeks/maxItems", keyword: "maxItems", params: { limit: 8 }, message: "must NOT have more than 8 items" }], false;
|
|
3609
|
+
if (a3.length < 8) return d5.errors = [{ instancePath: s4 + "/weeks", schemaPath: "#/properties/weeks/minItems", keyword: "minItems", params: { limit: 8 }, message: "must NOT have fewer than 8 items" }], false;
|
|
3610
|
+
{
|
|
3611
|
+
var v3 = true;
|
|
3612
|
+
let u2 = a3.length;
|
|
3613
|
+
for (let P3 = 0; P3 < u2; P3++) {
|
|
3614
|
+
let O2 = e3;
|
|
3615
|
+
b2(a3[P3], { instancePath: s4 + "/weeks/" + P3, parentData: a3, parentDataProperty: P3, rootData: k2 }) || (m5 = m5 === null ? b2.errors : m5.concat(b2.errors), e3 = m5.length);
|
|
3616
|
+
var v3 = O2 === e3;
|
|
3617
|
+
if (!v3) break;
|
|
3618
|
+
}
|
|
3619
|
+
}
|
|
3620
|
+
} else return d5.errors = [{ instancePath: s4 + "/weeks", schemaPath: "#/properties/weeks/type", keyword: "type", params: { type: "array" }, message: "must be array" }], false;
|
|
3621
|
+
var i6 = l6 === e3;
|
|
3622
|
+
} else var i6 = true;
|
|
3623
|
+
if (i6) {
|
|
3624
|
+
if (r2.windowAgentSeconds !== void 0) {
|
|
3625
|
+
let a3 = r2.windowAgentSeconds, l6 = e3;
|
|
3626
|
+
if (!(typeof a3 == "number" && !(a3 % 1) && !isNaN(a3) && isFinite(a3))) return d5.errors = [{ instancePath: s4 + "/windowAgentSeconds", schemaPath: "#/properties/windowAgentSeconds/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
3627
|
+
if (e3 === l6 && typeof a3 == "number" && isFinite(a3) && (a3 < 0 || isNaN(a3))) return d5.errors = [{ instancePath: s4 + "/windowAgentSeconds", schemaPath: "#/properties/windowAgentSeconds/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
3628
|
+
var i6 = l6 === e3;
|
|
3629
|
+
} else var i6 = true;
|
|
3630
|
+
if (i6) {
|
|
3631
|
+
if (r2.windowOutcomes !== void 0) {
|
|
3632
|
+
let a3 = r2.windowOutcomes, l6 = e3;
|
|
3633
|
+
if (!(typeof a3 == "number" && !(a3 % 1) && !isNaN(a3) && isFinite(a3))) return d5.errors = [{ instancePath: s4 + "/windowOutcomes", schemaPath: "#/properties/windowOutcomes/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
3634
|
+
if (e3 === l6 && typeof a3 == "number" && isFinite(a3) && (a3 < 0 || isNaN(a3))) return d5.errors = [{ instancePath: s4 + "/windowOutcomes", schemaPath: "#/properties/windowOutcomes/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
3635
|
+
var i6 = l6 === e3;
|
|
3636
|
+
} else var i6 = true;
|
|
3637
|
+
if (i6) if (r2.windowPersonalSeconds !== void 0) {
|
|
3638
|
+
let a3 = r2.windowPersonalSeconds, l6 = e3;
|
|
3639
|
+
if (!(typeof a3 == "number" && !(a3 % 1) && !isNaN(a3) && isFinite(a3))) return d5.errors = [{ instancePath: s4 + "/windowPersonalSeconds", schemaPath: "#/properties/windowPersonalSeconds/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
3640
|
+
if (e3 === l6 && typeof a3 == "number" && isFinite(a3) && (a3 < 0 || isNaN(a3))) return d5.errors = [{ instancePath: s4 + "/windowPersonalSeconds", schemaPath: "#/properties/windowPersonalSeconds/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
3641
|
+
var i6 = l6 === e3;
|
|
3642
|
+
} else var i6 = true;
|
|
3643
|
+
}
|
|
3644
|
+
}
|
|
3645
|
+
}
|
|
3646
|
+
}
|
|
3647
|
+
}
|
|
3648
|
+
}
|
|
3649
|
+
}
|
|
3650
|
+
}
|
|
3651
|
+
}
|
|
3652
|
+
}
|
|
3653
|
+
}
|
|
3654
|
+
}
|
|
3655
|
+
} else return d5.errors = [{ instancePath: s4, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
3656
|
+
return d5.errors = m5, e3 === 0;
|
|
3657
|
+
}
|
|
3658
|
+
var F = { additionalProperties: false, properties: { actions: { items: { $ref: "urn:flowmind:schema:MomentumSignalAction" }, maxItems: 2, type: "array" }, detail: { minLength: 1, type: "string" }, evidence: { items: { $ref: "urn:flowmind:schema:MomentumEvidence" }, maxItems: 3, type: "array" }, id: { minLength: 1, type: "string" }, kind: { enum: ["gone_quiet", "spread_thin", "best_week", "rising", "agent_shift"], type: "string" }, projectId: { format: "uuid", nullable: true, type: "string" }, rule: { minLength: 1, type: "string" }, title: { minLength: 1, type: "string" }, tone: { enum: ["attention", "positive", "neutral"], type: "string" } }, required: ["id", "kind", "tone", "title", "detail", "rule", "projectId", "evidence", "actions"], type: "object" };
|
|
3659
|
+
var W = { additionalProperties: false, properties: { kind: { enum: ["start_focus", "draft_commitment"], type: "string" }, label: { minLength: 1, type: "string" }, projectId: { format: "uuid", nullable: true, type: "string" }, text: { maxLength: 500, minLength: 1, nullable: true, type: "string" } }, required: ["kind", "label", "projectId", "text"], type: "object" };
|
|
3660
|
+
function w3(r2, { instancePath: s4 = "", parentData: I2, parentDataProperty: S2, rootData: k2 = r2 } = {}) {
|
|
3661
|
+
let m5 = null, e3 = 0;
|
|
3662
|
+
if (e3 === 0) if (r2 && typeof r2 == "object" && !Array.isArray(r2)) {
|
|
3663
|
+
let o9;
|
|
3664
|
+
if (r2.kind === void 0 && (o9 = "kind") || r2.label === void 0 && (o9 = "label") || r2.projectId === void 0 && (o9 = "projectId") || r2.text === void 0 && (o9 = "text")) return w3.errors = [{ instancePath: s4, schemaPath: "#/required", keyword: "required", params: { missingProperty: o9 }, message: "must have required property '" + o9 + "'" }], false;
|
|
3665
|
+
{
|
|
3666
|
+
let v3 = e3;
|
|
3667
|
+
for (let t8 in r2) if (!(t8 === "kind" || t8 === "label" || t8 === "projectId" || t8 === "text")) {
|
|
3668
|
+
return w3.errors = [{ instancePath: s4, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: t8 }, message: "must NOT have additional properties" }], false;
|
|
3669
|
+
break;
|
|
3670
|
+
}
|
|
3671
|
+
if (v3 === e3) {
|
|
3672
|
+
if (r2.kind !== void 0) {
|
|
3673
|
+
let t8 = r2.kind, n7 = e3;
|
|
3674
|
+
if (typeof t8 != "string") return w3.errors = [{ instancePath: s4 + "/kind", schemaPath: "#/properties/kind/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3675
|
+
if (!(t8 === "start_focus" || t8 === "draft_commitment")) return w3.errors = [{ instancePath: s4 + "/kind", schemaPath: "#/properties/kind/enum", keyword: "enum", params: { allowedValues: W.properties.kind.enum }, message: "must be equal to one of the allowed values" }], false;
|
|
3676
|
+
var i6 = n7 === e3;
|
|
3677
|
+
} else var i6 = true;
|
|
3678
|
+
if (i6) {
|
|
3679
|
+
if (r2.label !== void 0) {
|
|
3680
|
+
let t8 = r2.label, n7 = e3;
|
|
3681
|
+
if (e3 === n7) if (typeof t8 == "string") {
|
|
3682
|
+
if (o(t8) < 1) return w3.errors = [{ instancePath: s4 + "/label", schemaPath: "#/properties/label/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }], false;
|
|
3683
|
+
} else return w3.errors = [{ instancePath: s4 + "/label", schemaPath: "#/properties/label/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3684
|
+
var i6 = n7 === e3;
|
|
3685
|
+
} else var i6 = true;
|
|
3686
|
+
if (i6) {
|
|
3687
|
+
if (r2.projectId !== void 0) {
|
|
3688
|
+
let t8 = r2.projectId, n7 = e3;
|
|
3689
|
+
if (typeof t8 != "string" && t8 !== null) return w3.errors = [{ instancePath: s4 + "/projectId", schemaPath: "#/properties/projectId/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3690
|
+
if (e3 === n7 && e3 === n7 && typeof t8 == "string" && !a.test(t8)) return w3.errors = [{ instancePath: s4 + "/projectId", schemaPath: "#/properties/projectId/format", keyword: "format", params: { format: "uuid" }, message: 'must match format "uuid"' }], false;
|
|
3691
|
+
var i6 = n7 === e3;
|
|
3692
|
+
} else var i6 = true;
|
|
3693
|
+
if (i6) if (r2.text !== void 0) {
|
|
3694
|
+
let t8 = r2.text, n7 = e3;
|
|
3695
|
+
if (typeof t8 != "string" && t8 !== null) return w3.errors = [{ instancePath: s4 + "/text", schemaPath: "#/properties/text/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3696
|
+
if (e3 === n7 && typeof t8 == "string") {
|
|
3697
|
+
if (o(t8) > 500) return w3.errors = [{ instancePath: s4 + "/text", schemaPath: "#/properties/text/maxLength", keyword: "maxLength", params: { limit: 500 }, message: "must NOT have more than 500 characters" }], false;
|
|
3698
|
+
if (o(t8) < 1) return w3.errors = [{ instancePath: s4 + "/text", schemaPath: "#/properties/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }], false;
|
|
3699
|
+
}
|
|
3700
|
+
var i6 = n7 === e3;
|
|
3701
|
+
} else var i6 = true;
|
|
3702
|
+
}
|
|
3703
|
+
}
|
|
3704
|
+
}
|
|
3705
|
+
}
|
|
3706
|
+
} else return w3.errors = [{ instancePath: s4, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
3707
|
+
return w3.errors = m5, e3 === 0;
|
|
3708
|
+
}
|
|
3709
|
+
function g(r2, { instancePath: s4 = "", parentData: I2, parentDataProperty: S2, rootData: k2 = r2 } = {}) {
|
|
3710
|
+
let m5 = null, e3 = 0;
|
|
3711
|
+
if (e3 === 0) if (r2 && typeof r2 == "object" && !Array.isArray(r2)) {
|
|
3712
|
+
let t8;
|
|
3713
|
+
if (r2.id === void 0 && (t8 = "id") || r2.kind === void 0 && (t8 = "kind") || r2.tone === void 0 && (t8 = "tone") || r2.title === void 0 && (t8 = "title") || r2.detail === void 0 && (t8 = "detail") || r2.rule === void 0 && (t8 = "rule") || r2.projectId === void 0 && (t8 = "projectId") || r2.evidence === void 0 && (t8 = "evidence") || r2.actions === void 0 && (t8 = "actions")) return g.errors = [{ instancePath: s4, schemaPath: "#/required", keyword: "required", params: { missingProperty: t8 }, message: "must have required property '" + t8 + "'" }], false;
|
|
3714
|
+
{
|
|
3715
|
+
let n7 = e3;
|
|
3716
|
+
for (let a3 in r2) if (!t4.call(F.properties, a3)) {
|
|
3717
|
+
return g.errors = [{ instancePath: s4, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: a3 }, message: "must NOT have additional properties" }], false;
|
|
3718
|
+
break;
|
|
3719
|
+
}
|
|
3720
|
+
if (n7 === e3) {
|
|
3721
|
+
if (r2.actions !== void 0) {
|
|
3722
|
+
let a3 = r2.actions, l6 = e3;
|
|
3723
|
+
if (e3 === l6) if (Array.isArray(a3)) {
|
|
3724
|
+
if (a3.length > 2) return g.errors = [{ instancePath: s4 + "/actions", schemaPath: "#/properties/actions/maxItems", keyword: "maxItems", params: { limit: 2 }, message: "must NOT have more than 2 items" }], false;
|
|
3725
|
+
{
|
|
3726
|
+
var i6 = true;
|
|
3727
|
+
let p7 = a3.length;
|
|
3728
|
+
for (let u2 = 0; u2 < p7; u2++) {
|
|
3729
|
+
let P3 = e3;
|
|
3730
|
+
w3(a3[u2], { instancePath: s4 + "/actions/" + u2, parentData: a3, parentDataProperty: u2, rootData: k2 }) || (m5 = m5 === null ? w3.errors : m5.concat(w3.errors), e3 = m5.length);
|
|
3731
|
+
var i6 = P3 === e3;
|
|
3732
|
+
if (!i6) break;
|
|
3733
|
+
}
|
|
3734
|
+
}
|
|
3735
|
+
} else return g.errors = [{ instancePath: s4 + "/actions", schemaPath: "#/properties/actions/type", keyword: "type", params: { type: "array" }, message: "must be array" }], false;
|
|
3736
|
+
var o9 = l6 === e3;
|
|
3737
|
+
} else var o9 = true;
|
|
3738
|
+
if (o9) {
|
|
3739
|
+
if (r2.detail !== void 0) {
|
|
3740
|
+
let a3 = r2.detail, l6 = e3;
|
|
3741
|
+
if (e3 === l6) if (typeof a3 == "string") {
|
|
3742
|
+
if (o(a3) < 1) return g.errors = [{ instancePath: s4 + "/detail", schemaPath: "#/properties/detail/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }], false;
|
|
3743
|
+
} else return g.errors = [{ instancePath: s4 + "/detail", schemaPath: "#/properties/detail/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3744
|
+
var o9 = l6 === e3;
|
|
3745
|
+
} else var o9 = true;
|
|
3746
|
+
if (o9) {
|
|
3747
|
+
if (r2.evidence !== void 0) {
|
|
3748
|
+
let a3 = r2.evidence, l6 = e3;
|
|
3749
|
+
if (e3 === l6) if (Array.isArray(a3)) {
|
|
3750
|
+
if (a3.length > 3) return g.errors = [{ instancePath: s4 + "/evidence", schemaPath: "#/properties/evidence/maxItems", keyword: "maxItems", params: { limit: 3 }, message: "must NOT have more than 3 items" }], false;
|
|
3751
|
+
{
|
|
3752
|
+
var v3 = true;
|
|
3753
|
+
let u2 = a3.length;
|
|
3754
|
+
for (let P3 = 0; P3 < u2; P3++) {
|
|
3755
|
+
let O2 = e3;
|
|
3756
|
+
y2(a3[P3], { instancePath: s4 + "/evidence/" + P3, parentData: a3, parentDataProperty: P3, rootData: k2 }) || (m5 = m5 === null ? y2.errors : m5.concat(y2.errors), e3 = m5.length);
|
|
3757
|
+
var v3 = O2 === e3;
|
|
3758
|
+
if (!v3) break;
|
|
3759
|
+
}
|
|
3760
|
+
}
|
|
3761
|
+
} else return g.errors = [{ instancePath: s4 + "/evidence", schemaPath: "#/properties/evidence/type", keyword: "type", params: { type: "array" }, message: "must be array" }], false;
|
|
3762
|
+
var o9 = l6 === e3;
|
|
3763
|
+
} else var o9 = true;
|
|
3764
|
+
if (o9) {
|
|
3765
|
+
if (r2.id !== void 0) {
|
|
3766
|
+
let a3 = r2.id, l6 = e3;
|
|
3767
|
+
if (e3 === l6) if (typeof a3 == "string") {
|
|
3768
|
+
if (o(a3) < 1) return g.errors = [{ instancePath: s4 + "/id", schemaPath: "#/properties/id/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }], false;
|
|
3769
|
+
} else return g.errors = [{ instancePath: s4 + "/id", schemaPath: "#/properties/id/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3770
|
+
var o9 = l6 === e3;
|
|
3771
|
+
} else var o9 = true;
|
|
3772
|
+
if (o9) {
|
|
3773
|
+
if (r2.kind !== void 0) {
|
|
3774
|
+
let a3 = r2.kind, l6 = e3;
|
|
3775
|
+
if (typeof a3 != "string") return g.errors = [{ instancePath: s4 + "/kind", schemaPath: "#/properties/kind/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3776
|
+
if (!(a3 === "gone_quiet" || a3 === "spread_thin" || a3 === "best_week" || a3 === "rising" || a3 === "agent_shift")) return g.errors = [{ instancePath: s4 + "/kind", schemaPath: "#/properties/kind/enum", keyword: "enum", params: { allowedValues: F.properties.kind.enum }, message: "must be equal to one of the allowed values" }], false;
|
|
3777
|
+
var o9 = l6 === e3;
|
|
3778
|
+
} else var o9 = true;
|
|
3779
|
+
if (o9) {
|
|
3780
|
+
if (r2.projectId !== void 0) {
|
|
3781
|
+
let a3 = r2.projectId, l6 = e3;
|
|
3782
|
+
if (typeof a3 != "string" && a3 !== null) return g.errors = [{ instancePath: s4 + "/projectId", schemaPath: "#/properties/projectId/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3783
|
+
if (e3 === l6 && e3 === l6 && typeof a3 == "string" && !a.test(a3)) return g.errors = [{ instancePath: s4 + "/projectId", schemaPath: "#/properties/projectId/format", keyword: "format", params: { format: "uuid" }, message: 'must match format "uuid"' }], false;
|
|
3784
|
+
var o9 = l6 === e3;
|
|
3785
|
+
} else var o9 = true;
|
|
3786
|
+
if (o9) {
|
|
3787
|
+
if (r2.rule !== void 0) {
|
|
3788
|
+
let a3 = r2.rule, l6 = e3;
|
|
3789
|
+
if (e3 === l6) if (typeof a3 == "string") {
|
|
3790
|
+
if (o(a3) < 1) return g.errors = [{ instancePath: s4 + "/rule", schemaPath: "#/properties/rule/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }], false;
|
|
3791
|
+
} else return g.errors = [{ instancePath: s4 + "/rule", schemaPath: "#/properties/rule/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3792
|
+
var o9 = l6 === e3;
|
|
3793
|
+
} else var o9 = true;
|
|
3794
|
+
if (o9) {
|
|
3795
|
+
if (r2.title !== void 0) {
|
|
3796
|
+
let a3 = r2.title, l6 = e3;
|
|
3797
|
+
if (e3 === l6) if (typeof a3 == "string") {
|
|
3798
|
+
if (o(a3) < 1) return g.errors = [{ instancePath: s4 + "/title", schemaPath: "#/properties/title/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" }], false;
|
|
3799
|
+
} else return g.errors = [{ instancePath: s4 + "/title", schemaPath: "#/properties/title/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3800
|
+
var o9 = l6 === e3;
|
|
3801
|
+
} else var o9 = true;
|
|
3802
|
+
if (o9) if (r2.tone !== void 0) {
|
|
3803
|
+
let a3 = r2.tone, l6 = e3;
|
|
3804
|
+
if (typeof a3 != "string") return g.errors = [{ instancePath: s4 + "/tone", schemaPath: "#/properties/tone/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3805
|
+
if (!(a3 === "attention" || a3 === "positive" || a3 === "neutral")) return g.errors = [{ instancePath: s4 + "/tone", schemaPath: "#/properties/tone/enum", keyword: "enum", params: { allowedValues: F.properties.tone.enum }, message: "must be equal to one of the allowed values" }], false;
|
|
3806
|
+
var o9 = l6 === e3;
|
|
3807
|
+
} else var o9 = true;
|
|
3808
|
+
}
|
|
3809
|
+
}
|
|
3810
|
+
}
|
|
3811
|
+
}
|
|
3812
|
+
}
|
|
3813
|
+
}
|
|
3814
|
+
}
|
|
3815
|
+
}
|
|
3816
|
+
}
|
|
3817
|
+
} else return g.errors = [{ instancePath: s4, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
3818
|
+
return g.errors = m5, e3 === 0;
|
|
3819
|
+
}
|
|
3820
|
+
function h10(r2, { instancePath: s4 = "", parentData: I2, parentDataProperty: S2, rootData: k2 = r2 } = {}) {
|
|
3821
|
+
let m5 = null, e3 = 0;
|
|
3822
|
+
if (e3 === 0) if (r2 && typeof r2 == "object" && !Array.isArray(r2)) {
|
|
3823
|
+
let o9;
|
|
3824
|
+
if (r2.weekOf === void 0 && (o9 = "weekOf") || r2.personalSeconds === void 0 && (o9 = "personalSeconds") || r2.agentSeconds === void 0 && (o9 = "agentSeconds") || r2.outcomes === void 0 && (o9 = "outcomes") || r2.personalDays === void 0 && (o9 = "personalDays") || r2.projects === void 0 && (o9 = "projects")) return h10.errors = [{ instancePath: s4, schemaPath: "#/required", keyword: "required", params: { missingProperty: o9 }, message: "must have required property '" + o9 + "'" }], false;
|
|
3825
|
+
{
|
|
3826
|
+
let v3 = e3;
|
|
3827
|
+
for (let t8 in r2) if (!(t8 === "agentSeconds" || t8 === "outcomes" || t8 === "personalDays" || t8 === "personalSeconds" || t8 === "projects" || t8 === "weekOf")) {
|
|
3828
|
+
return h10.errors = [{ instancePath: s4, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: t8 }, message: "must NOT have additional properties" }], false;
|
|
3829
|
+
break;
|
|
3830
|
+
}
|
|
3831
|
+
if (v3 === e3) {
|
|
3832
|
+
if (r2.agentSeconds !== void 0) {
|
|
3833
|
+
let t8 = r2.agentSeconds, n7 = e3;
|
|
3834
|
+
if (!(typeof t8 == "number" && !(t8 % 1) && !isNaN(t8) && isFinite(t8))) return h10.errors = [{ instancePath: s4 + "/agentSeconds", schemaPath: "#/properties/agentSeconds/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
3835
|
+
if (e3 === n7 && typeof t8 == "number" && isFinite(t8) && (t8 < 0 || isNaN(t8))) return h10.errors = [{ instancePath: s4 + "/agentSeconds", schemaPath: "#/properties/agentSeconds/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
3836
|
+
var i6 = n7 === e3;
|
|
3837
|
+
} else var i6 = true;
|
|
3838
|
+
if (i6) {
|
|
3839
|
+
if (r2.outcomes !== void 0) {
|
|
3840
|
+
let t8 = r2.outcomes, n7 = e3;
|
|
3841
|
+
if (!(typeof t8 == "number" && !(t8 % 1) && !isNaN(t8) && isFinite(t8))) return h10.errors = [{ instancePath: s4 + "/outcomes", schemaPath: "#/properties/outcomes/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
3842
|
+
if (e3 === n7 && typeof t8 == "number" && isFinite(t8) && (t8 < 0 || isNaN(t8))) return h10.errors = [{ instancePath: s4 + "/outcomes", schemaPath: "#/properties/outcomes/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
3843
|
+
var i6 = n7 === e3;
|
|
3844
|
+
} else var i6 = true;
|
|
3845
|
+
if (i6) {
|
|
3846
|
+
if (r2.personalDays !== void 0) {
|
|
3847
|
+
let t8 = r2.personalDays, n7 = e3;
|
|
3848
|
+
if (!(typeof t8 == "number" && !(t8 % 1) && !isNaN(t8) && isFinite(t8))) return h10.errors = [{ instancePath: s4 + "/personalDays", schemaPath: "#/properties/personalDays/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
3849
|
+
if (e3 === n7 && typeof t8 == "number" && isFinite(t8)) {
|
|
3850
|
+
if (t8 > 7 || isNaN(t8)) return h10.errors = [{ instancePath: s4 + "/personalDays", schemaPath: "#/properties/personalDays/maximum", keyword: "maximum", params: { comparison: "<=", limit: 7 }, message: "must be <= 7" }], false;
|
|
3851
|
+
if (t8 < 0 || isNaN(t8)) return h10.errors = [{ instancePath: s4 + "/personalDays", schemaPath: "#/properties/personalDays/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
3852
|
+
}
|
|
3853
|
+
var i6 = n7 === e3;
|
|
3854
|
+
} else var i6 = true;
|
|
3855
|
+
if (i6) {
|
|
3856
|
+
if (r2.personalSeconds !== void 0) {
|
|
3857
|
+
let t8 = r2.personalSeconds, n7 = e3;
|
|
3858
|
+
if (!(typeof t8 == "number" && !(t8 % 1) && !isNaN(t8) && isFinite(t8))) return h10.errors = [{ instancePath: s4 + "/personalSeconds", schemaPath: "#/properties/personalSeconds/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
3859
|
+
if (e3 === n7 && typeof t8 == "number" && isFinite(t8) && (t8 < 0 || isNaN(t8))) return h10.errors = [{ instancePath: s4 + "/personalSeconds", schemaPath: "#/properties/personalSeconds/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
3860
|
+
var i6 = n7 === e3;
|
|
3861
|
+
} else var i6 = true;
|
|
3862
|
+
if (i6) {
|
|
3863
|
+
if (r2.projects !== void 0) {
|
|
3864
|
+
let t8 = r2.projects, n7 = e3;
|
|
3865
|
+
if (!(typeof t8 == "number" && !(t8 % 1) && !isNaN(t8) && isFinite(t8))) return h10.errors = [{ instancePath: s4 + "/projects", schemaPath: "#/properties/projects/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
3866
|
+
if (e3 === n7 && typeof t8 == "number" && isFinite(t8) && (t8 < 0 || isNaN(t8))) return h10.errors = [{ instancePath: s4 + "/projects", schemaPath: "#/properties/projects/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
3867
|
+
var i6 = n7 === e3;
|
|
3868
|
+
} else var i6 = true;
|
|
3869
|
+
if (i6) if (r2.weekOf !== void 0) {
|
|
3870
|
+
let t8 = r2.weekOf, n7 = e3;
|
|
3871
|
+
if (e3 === n7) if (typeof t8 == "string") {
|
|
3872
|
+
if (!e2.test(t8)) return h10.errors = [{ instancePath: s4 + "/weekOf", schemaPath: "#/properties/weekOf/pattern", keyword: "pattern", params: { pattern: "^\\d{4}-\\d{2}-\\d{2}$" }, message: 'must match pattern "^\\d{4}-\\d{2}-\\d{2}$"' }], false;
|
|
3873
|
+
} else return h10.errors = [{ instancePath: s4 + "/weekOf", schemaPath: "#/properties/weekOf/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3874
|
+
var i6 = n7 === e3;
|
|
3875
|
+
} else var i6 = true;
|
|
3876
|
+
}
|
|
3877
|
+
}
|
|
3878
|
+
}
|
|
3879
|
+
}
|
|
3880
|
+
}
|
|
3881
|
+
}
|
|
3882
|
+
} else return h10.errors = [{ instancePath: s4, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
3883
|
+
return h10.errors = m5, e3 === 0;
|
|
3884
|
+
}
|
|
3885
|
+
function f2(r2, { instancePath: s4 = "", parentData: I2, parentDataProperty: S2, rootData: k2 = r2 } = {}) {
|
|
3886
|
+
let m5 = null, e3 = 0;
|
|
3887
|
+
if (e3 === 0) if (r2 && typeof r2 == "object" && !Array.isArray(r2)) {
|
|
3888
|
+
let a3;
|
|
3889
|
+
if (r2.weekOf === void 0 && (a3 = "weekOf") || r2.currentWeekOf === void 0 && (a3 = "currentWeekOf") || r2.isCurrentWeek === void 0 && (a3 = "isCurrentWeek") || r2.asOfDay === void 0 && (a3 = "asOfDay") || r2.daysElapsed === void 0 && (a3 = "daysElapsed") || r2.weeks === void 0 && (a3 = "weeks") || r2.totals === void 0 && (a3 = "totals") || r2.projects === void 0 && (a3 = "projects") || r2.hiddenProjectCount === void 0 && (a3 = "hiddenProjectCount") || r2.signals === void 0 && (a3 = "signals")) return f2.errors = [{ instancePath: s4, schemaPath: "#/required", keyword: "required", params: { missingProperty: a3 }, message: "must have required property '" + a3 + "'" }], false;
|
|
3890
|
+
{
|
|
3891
|
+
let l6 = e3;
|
|
3892
|
+
for (let p7 in r2) if (!t4.call($.properties, p7)) {
|
|
3893
|
+
return f2.errors = [{ instancePath: s4, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: p7 }, message: "must NOT have additional properties" }], false;
|
|
3894
|
+
break;
|
|
3895
|
+
}
|
|
3896
|
+
if (l6 === e3) {
|
|
3897
|
+
if (r2.asOfDay !== void 0) {
|
|
3898
|
+
let p7 = r2.asOfDay, u2 = e3;
|
|
3899
|
+
if (e3 === u2) if (typeof p7 == "string") {
|
|
3900
|
+
if (!e2.test(p7)) return f2.errors = [{ instancePath: s4 + "/asOfDay", schemaPath: "#/properties/asOfDay/pattern", keyword: "pattern", params: { pattern: "^\\d{4}-\\d{2}-\\d{2}$" }, message: 'must match pattern "^\\d{4}-\\d{2}-\\d{2}$"' }], false;
|
|
3901
|
+
} else return f2.errors = [{ instancePath: s4 + "/asOfDay", schemaPath: "#/properties/asOfDay/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3902
|
+
var i6 = u2 === e3;
|
|
3903
|
+
} else var i6 = true;
|
|
3904
|
+
if (i6) {
|
|
3905
|
+
if (r2.currentWeekOf !== void 0) {
|
|
3906
|
+
let p7 = r2.currentWeekOf, u2 = e3;
|
|
3907
|
+
if (e3 === u2) if (typeof p7 == "string") {
|
|
3908
|
+
if (!e2.test(p7)) return f2.errors = [{ instancePath: s4 + "/currentWeekOf", schemaPath: "#/properties/currentWeekOf/pattern", keyword: "pattern", params: { pattern: "^\\d{4}-\\d{2}-\\d{2}$" }, message: 'must match pattern "^\\d{4}-\\d{2}-\\d{2}$"' }], false;
|
|
3909
|
+
} else return f2.errors = [{ instancePath: s4 + "/currentWeekOf", schemaPath: "#/properties/currentWeekOf/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3910
|
+
var i6 = u2 === e3;
|
|
3911
|
+
} else var i6 = true;
|
|
3912
|
+
if (i6) {
|
|
3913
|
+
if (r2.daysElapsed !== void 0) {
|
|
3914
|
+
let p7 = r2.daysElapsed, u2 = e3;
|
|
3915
|
+
if (!(typeof p7 == "number" && !(p7 % 1) && !isNaN(p7) && isFinite(p7))) return f2.errors = [{ instancePath: s4 + "/daysElapsed", schemaPath: "#/properties/daysElapsed/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
3916
|
+
if (e3 === u2 && typeof p7 == "number" && isFinite(p7)) {
|
|
3917
|
+
if (p7 > 7 || isNaN(p7)) return f2.errors = [{ instancePath: s4 + "/daysElapsed", schemaPath: "#/properties/daysElapsed/maximum", keyword: "maximum", params: { comparison: "<=", limit: 7 }, message: "must be <= 7" }], false;
|
|
3918
|
+
if (p7 < 1 || isNaN(p7)) return f2.errors = [{ instancePath: s4 + "/daysElapsed", schemaPath: "#/properties/daysElapsed/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }], false;
|
|
3919
|
+
}
|
|
3920
|
+
var i6 = u2 === e3;
|
|
3921
|
+
} else var i6 = true;
|
|
3922
|
+
if (i6) {
|
|
3923
|
+
if (r2.hiddenProjectCount !== void 0) {
|
|
3924
|
+
let p7 = r2.hiddenProjectCount, u2 = e3;
|
|
3925
|
+
if (!(typeof p7 == "number" && !(p7 % 1) && !isNaN(p7) && isFinite(p7))) return f2.errors = [{ instancePath: s4 + "/hiddenProjectCount", schemaPath: "#/properties/hiddenProjectCount/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }], false;
|
|
3926
|
+
if (e3 === u2 && typeof p7 == "number" && isFinite(p7) && (p7 < 0 || isNaN(p7))) return f2.errors = [{ instancePath: s4 + "/hiddenProjectCount", schemaPath: "#/properties/hiddenProjectCount/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }], false;
|
|
3927
|
+
var i6 = u2 === e3;
|
|
3928
|
+
} else var i6 = true;
|
|
3929
|
+
if (i6) {
|
|
3930
|
+
if (r2.isCurrentWeek !== void 0) {
|
|
3931
|
+
let p7 = e3;
|
|
3932
|
+
if (typeof r2.isCurrentWeek != "boolean") return f2.errors = [{ instancePath: s4 + "/isCurrentWeek", schemaPath: "#/properties/isCurrentWeek/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }], false;
|
|
3933
|
+
var i6 = p7 === e3;
|
|
3934
|
+
} else var i6 = true;
|
|
3935
|
+
if (i6) {
|
|
3936
|
+
if (r2.projects !== void 0) {
|
|
3937
|
+
let p7 = r2.projects, u2 = e3;
|
|
3938
|
+
if (e3 === u2) if (Array.isArray(p7)) {
|
|
3939
|
+
if (p7.length > 10) return f2.errors = [{ instancePath: s4 + "/projects", schemaPath: "#/properties/projects/maxItems", keyword: "maxItems", params: { limit: 10 }, message: "must NOT have more than 10 items" }], false;
|
|
3940
|
+
{
|
|
3941
|
+
var o9 = true;
|
|
3942
|
+
let O2 = p7.length;
|
|
3943
|
+
for (let c3 = 0; c3 < O2; c3++) {
|
|
3944
|
+
let D = e3;
|
|
3945
|
+
d5(p7[c3], { instancePath: s4 + "/projects/" + c3, parentData: p7, parentDataProperty: c3, rootData: k2 }) || (m5 = m5 === null ? d5.errors : m5.concat(d5.errors), e3 = m5.length);
|
|
3946
|
+
var o9 = D === e3;
|
|
3947
|
+
if (!o9) break;
|
|
3948
|
+
}
|
|
3949
|
+
}
|
|
3950
|
+
} else return f2.errors = [{ instancePath: s4 + "/projects", schemaPath: "#/properties/projects/type", keyword: "type", params: { type: "array" }, message: "must be array" }], false;
|
|
3951
|
+
var i6 = u2 === e3;
|
|
3952
|
+
} else var i6 = true;
|
|
3953
|
+
if (i6) {
|
|
3954
|
+
if (r2.signals !== void 0) {
|
|
3955
|
+
let p7 = r2.signals, u2 = e3;
|
|
3956
|
+
if (e3 === u2) if (Array.isArray(p7)) {
|
|
3957
|
+
if (p7.length > 4) return f2.errors = [{ instancePath: s4 + "/signals", schemaPath: "#/properties/signals/maxItems", keyword: "maxItems", params: { limit: 4 }, message: "must NOT have more than 4 items" }], false;
|
|
3958
|
+
{
|
|
3959
|
+
var v3 = true;
|
|
3960
|
+
let O2 = p7.length;
|
|
3961
|
+
for (let c3 = 0; c3 < O2; c3++) {
|
|
3962
|
+
let D = e3;
|
|
3963
|
+
g(p7[c3], { instancePath: s4 + "/signals/" + c3, parentData: p7, parentDataProperty: c3, rootData: k2 }) || (m5 = m5 === null ? g.errors : m5.concat(g.errors), e3 = m5.length);
|
|
3964
|
+
var v3 = D === e3;
|
|
3965
|
+
if (!v3) break;
|
|
3966
|
+
}
|
|
3967
|
+
}
|
|
3968
|
+
} else return f2.errors = [{ instancePath: s4 + "/signals", schemaPath: "#/properties/signals/type", keyword: "type", params: { type: "array" }, message: "must be array" }], false;
|
|
3969
|
+
var i6 = u2 === e3;
|
|
3970
|
+
} else var i6 = true;
|
|
3971
|
+
if (i6) {
|
|
3972
|
+
if (r2.totals !== void 0) {
|
|
3973
|
+
let p7 = r2.totals, u2 = e3;
|
|
3974
|
+
if (e3 === u2) if (Array.isArray(p7)) {
|
|
3975
|
+
if (p7.length > 8) return f2.errors = [{ instancePath: s4 + "/totals", schemaPath: "#/properties/totals/maxItems", keyword: "maxItems", params: { limit: 8 }, message: "must NOT have more than 8 items" }], false;
|
|
3976
|
+
if (p7.length < 8) return f2.errors = [{ instancePath: s4 + "/totals", schemaPath: "#/properties/totals/minItems", keyword: "minItems", params: { limit: 8 }, message: "must NOT have fewer than 8 items" }], false;
|
|
3977
|
+
{
|
|
3978
|
+
var t8 = true;
|
|
3979
|
+
let O2 = p7.length;
|
|
3980
|
+
for (let c3 = 0; c3 < O2; c3++) {
|
|
3981
|
+
let D = e3;
|
|
3982
|
+
h10(p7[c3], { instancePath: s4 + "/totals/" + c3, parentData: p7, parentDataProperty: c3, rootData: k2 }) || (m5 = m5 === null ? h10.errors : m5.concat(h10.errors), e3 = m5.length);
|
|
3983
|
+
var t8 = D === e3;
|
|
3984
|
+
if (!t8) break;
|
|
3985
|
+
}
|
|
3986
|
+
}
|
|
3987
|
+
} else return f2.errors = [{ instancePath: s4 + "/totals", schemaPath: "#/properties/totals/type", keyword: "type", params: { type: "array" }, message: "must be array" }], false;
|
|
3988
|
+
var i6 = u2 === e3;
|
|
3989
|
+
} else var i6 = true;
|
|
3990
|
+
if (i6) {
|
|
3991
|
+
if (r2.weekOf !== void 0) {
|
|
3992
|
+
let p7 = r2.weekOf, u2 = e3;
|
|
3993
|
+
if (e3 === u2) if (typeof p7 == "string") {
|
|
3994
|
+
if (!e2.test(p7)) return f2.errors = [{ instancePath: s4 + "/weekOf", schemaPath: "#/properties/weekOf/pattern", keyword: "pattern", params: { pattern: "^\\d{4}-\\d{2}-\\d{2}$" }, message: 'must match pattern "^\\d{4}-\\d{2}-\\d{2}$"' }], false;
|
|
3995
|
+
} else return f2.errors = [{ instancePath: s4 + "/weekOf", schemaPath: "#/properties/weekOf/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
3996
|
+
var i6 = u2 === e3;
|
|
3997
|
+
} else var i6 = true;
|
|
3998
|
+
if (i6) if (r2.weeks !== void 0) {
|
|
3999
|
+
let p7 = r2.weeks, u2 = e3;
|
|
4000
|
+
if (e3 === u2) if (Array.isArray(p7)) {
|
|
4001
|
+
if (p7.length > 8) return f2.errors = [{ instancePath: s4 + "/weeks", schemaPath: "#/properties/weeks/maxItems", keyword: "maxItems", params: { limit: 8 }, message: "must NOT have more than 8 items" }], false;
|
|
4002
|
+
if (p7.length < 8) return f2.errors = [{ instancePath: s4 + "/weeks", schemaPath: "#/properties/weeks/minItems", keyword: "minItems", params: { limit: 8 }, message: "must NOT have fewer than 8 items" }], false;
|
|
4003
|
+
{
|
|
4004
|
+
var n7 = true;
|
|
4005
|
+
let O2 = p7.length;
|
|
4006
|
+
for (let c3 = 0; c3 < O2; c3++) {
|
|
4007
|
+
let D = p7[c3], x3 = e3;
|
|
4008
|
+
if (e3 === x3) if (typeof D == "string") {
|
|
4009
|
+
if (!e2.test(D)) return f2.errors = [{ instancePath: s4 + "/weeks/" + c3, schemaPath: "#/properties/weeks/items/pattern", keyword: "pattern", params: { pattern: "^\\d{4}-\\d{2}-\\d{2}$" }, message: 'must match pattern "^\\d{4}-\\d{2}-\\d{2}$"' }], false;
|
|
4010
|
+
} else return f2.errors = [{ instancePath: s4 + "/weeks/" + c3, schemaPath: "#/properties/weeks/items/type", keyword: "type", params: { type: "string" }, message: "must be string" }], false;
|
|
4011
|
+
var n7 = x3 === e3;
|
|
4012
|
+
if (!n7) break;
|
|
4013
|
+
}
|
|
4014
|
+
}
|
|
4015
|
+
} else return f2.errors = [{ instancePath: s4 + "/weeks", schemaPath: "#/properties/weeks/type", keyword: "type", params: { type: "array" }, message: "must be array" }], false;
|
|
4016
|
+
var i6 = u2 === e3;
|
|
4017
|
+
} else var i6 = true;
|
|
4018
|
+
}
|
|
4019
|
+
}
|
|
4020
|
+
}
|
|
4021
|
+
}
|
|
4022
|
+
}
|
|
4023
|
+
}
|
|
4024
|
+
}
|
|
4025
|
+
}
|
|
4026
|
+
}
|
|
4027
|
+
}
|
|
4028
|
+
} else return f2.errors = [{ instancePath: s4, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
4029
|
+
return f2.errors = m5, e3 === 0;
|
|
4030
|
+
}
|
|
4031
|
+
function q(r2, { instancePath: s4 = "", parentData: I2, parentDataProperty: S2, rootData: k2 = r2 } = {}) {
|
|
4032
|
+
let m5 = null, e3 = 0, i6 = e3;
|
|
4033
|
+
i(r2, { instancePath: s4, parentData: I2, parentDataProperty: S2, rootData: k2 }) || (m5 = m5 === null ? i.errors : m5.concat(i.errors), e3 = m5.length);
|
|
4034
|
+
var o9 = i6 === e3;
|
|
4035
|
+
if (o9) {
|
|
4036
|
+
let v3 = e3;
|
|
4037
|
+
if (e3 === v3) if (r2 && typeof r2 == "object" && !Array.isArray(r2)) {
|
|
4038
|
+
let n7;
|
|
4039
|
+
if (r2.data === void 0 && (n7 = "data")) return q.errors = [{ instancePath: s4, schemaPath: "#/allOf/1/required", keyword: "required", params: { missingProperty: n7 }, message: "must have required property '" + n7 + "'" }], false;
|
|
4040
|
+
r2.data !== void 0 && (f2(r2.data, { instancePath: s4 + "/data", parentData: r2, parentDataProperty: "data", rootData: k2 }) || (m5 = m5 === null ? f2.errors : m5.concat(f2.errors), e3 = m5.length));
|
|
4041
|
+
} else return q.errors = [{ instancePath: s4, schemaPath: "#/allOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" }], false;
|
|
4042
|
+
var o9 = v3 === e3;
|
|
4043
|
+
}
|
|
4044
|
+
return q.errors = m5, e3 === 0;
|
|
4045
|
+
}
|
|
4046
|
+
var Se = q;
|
|
4047
|
+
|
|
4048
|
+
// ../../packages/contracts/src/generated/endpoints/getV1MeMomentum.ts
|
|
4049
|
+
var getV1MeMomentum = {
|
|
4050
|
+
method: "GET",
|
|
4051
|
+
path: "/v1/me/momentum",
|
|
4052
|
+
operation: "GET /v1/me/momentum",
|
|
4053
|
+
revision: contractRevision,
|
|
4054
|
+
responses: {
|
|
4055
|
+
200: { mediaType: "application/json", schemaId: "urn:flowmind:getV1MeMomentum:200", validate: Se }
|
|
4056
|
+
},
|
|
4057
|
+
error: { mediaType: "application/json", schemaId: "ApiErrorEnvelope", validate: h }
|
|
4058
|
+
};
|
|
4059
|
+
|
|
4060
|
+
// src/commands/momentum.ts
|
|
4061
|
+
var WIDTH = 80;
|
|
4062
|
+
var BLOCKS = "\u2581\u2582\u2583\u2584\u2585\u2586\u2587\u2588";
|
|
4063
|
+
var segments = new Intl.Segmenter("en", { granularity: "grapheme" });
|
|
4064
|
+
var weekDate = new Intl.DateTimeFormat("en-US", {
|
|
4065
|
+
month: "short",
|
|
4066
|
+
day: "numeric",
|
|
4067
|
+
year: "numeric",
|
|
4068
|
+
timeZone: "UTC"
|
|
4069
|
+
});
|
|
4070
|
+
var evidenceDate = new Intl.DateTimeFormat("en-US", {
|
|
4071
|
+
weekday: "short",
|
|
4072
|
+
month: "short",
|
|
4073
|
+
day: "numeric",
|
|
4074
|
+
timeZone: "UTC"
|
|
4075
|
+
});
|
|
4076
|
+
function terminalText(value) {
|
|
4077
|
+
return stripVTControlCharacters(value).replace(/[\p{Cc}\p{Cf}\s]+/gu, " ").trim();
|
|
4078
|
+
}
|
|
4079
|
+
function cellWidth(grapheme) {
|
|
4080
|
+
if (/^[\p{Mark}]+$/u.test(grapheme)) return 0;
|
|
4081
|
+
return /[\p{Extended_Pictographic}\p{Regional_Indicator}\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\uFF01-\uFF60\uFFE0-\uFFE6\uFE0F\u20E3]/u.test(
|
|
4082
|
+
grapheme
|
|
4083
|
+
) ? 2 : 1;
|
|
4084
|
+
}
|
|
4085
|
+
function width(value) {
|
|
4086
|
+
return [...segments.segment(value)].reduce((sum, item) => sum + cellWidth(item.segment), 0);
|
|
4087
|
+
}
|
|
4088
|
+
function truncate(value, limit) {
|
|
4089
|
+
const text = terminalText(value);
|
|
4090
|
+
if (width(text) <= limit) return text;
|
|
4091
|
+
let result = "";
|
|
4092
|
+
let used = 0;
|
|
4093
|
+
for (const { segment } of segments.segment(text)) {
|
|
4094
|
+
used += cellWidth(segment);
|
|
4095
|
+
if (used > limit - 1) break;
|
|
4096
|
+
result += segment;
|
|
4097
|
+
}
|
|
4098
|
+
return `${result}\u2026`;
|
|
4099
|
+
}
|
|
4100
|
+
function column(value, size) {
|
|
4101
|
+
const text = truncate(value, size);
|
|
4102
|
+
return text + " ".repeat(size - width(text));
|
|
4103
|
+
}
|
|
4104
|
+
function wrap(value, indent = "") {
|
|
4105
|
+
const lines = [];
|
|
4106
|
+
let line = "";
|
|
4107
|
+
const limit = WIDTH - width(indent);
|
|
4108
|
+
for (const word of terminalText(value).split(" ")) {
|
|
4109
|
+
if (line && width(`${line} ${word}`) > limit) {
|
|
4110
|
+
lines.push(indent + line);
|
|
4111
|
+
line = "";
|
|
4112
|
+
}
|
|
4113
|
+
if (line) line += " ";
|
|
4114
|
+
for (const { segment } of segments.segment(word)) {
|
|
4115
|
+
if (width(line) + cellWidth(segment) > limit) {
|
|
4116
|
+
lines.push(indent + line);
|
|
4117
|
+
line = "";
|
|
4118
|
+
}
|
|
4119
|
+
line += segment;
|
|
4120
|
+
}
|
|
4121
|
+
}
|
|
4122
|
+
if (line) lines.push(indent + line);
|
|
4123
|
+
return lines;
|
|
4124
|
+
}
|
|
4125
|
+
function renderMomentum(data) {
|
|
4126
|
+
const color = new Chalk({
|
|
4127
|
+
level: process.stdout.isTTY && process.env.NO_COLOR === void 0 ? 1 : 0
|
|
4128
|
+
});
|
|
4129
|
+
const selected = data.totals.find((week) => week.weekOf === data.weekOf);
|
|
4130
|
+
if (!selected) throw new Error("Momentum response is missing the selected week totals.");
|
|
4131
|
+
const sparkline = (weeks) => {
|
|
4132
|
+
const peak = Math.max(...weeks.map((week) => week.outcomes), 1);
|
|
4133
|
+
return weeks.map((week) => {
|
|
4134
|
+
const glyph = week.outcomes === 0 ? color.dim("\xB7") : BLOCKS[Math.ceil(week.outcomes / peak * 8) - 1];
|
|
4135
|
+
return week.weekOf === data.weekOf ? color.cyan(`[${glyph}]`) : glyph;
|
|
4136
|
+
}).join("");
|
|
4137
|
+
};
|
|
4138
|
+
const title = `Momentum \xB7 week of ${weekDate.format(/* @__PURE__ */ new Date(`${data.weekOf}T00:00:00Z`))}`;
|
|
4139
|
+
const progress = data.isCurrentWeek ? ` (so far, day ${data.daysElapsed} of 7)` : "";
|
|
4140
|
+
const lines = ["", color.bold(title + progress), ""];
|
|
4141
|
+
const metrics = `${selected.outcomes} outcomes \xB7 ${(selected.personalSeconds / 3600).toFixed(1)}h personal \xB7 ${(selected.agentSeconds / 3600).toFixed(1)}h agent`;
|
|
4142
|
+
lines.push(` ${sparkline(data.totals)} ${metrics}`);
|
|
4143
|
+
lines.push(color.dim(" Oldest \u2192 newest \xB7 [selected week] \xB7 each row scaled to its peak"));
|
|
4144
|
+
lines.push("", color.bold("Projects"));
|
|
4145
|
+
if (data.projects.length === 0) lines.push(color.dim(" No project activity in this window."));
|
|
4146
|
+
else {
|
|
4147
|
+
lines.push(color.dim(` ${column("Project", 22)} ${column("8 weeks", 10)} ${column("Trend", 7)} Window outcomes`));
|
|
4148
|
+
for (const project of data.projects) {
|
|
4149
|
+
lines.push(` ${column(project.name, 22)} ${sparkline(project.weeks)} ${column(project.trend, 7)} ${project.windowOutcomes}`);
|
|
4150
|
+
if (project.trend === "quiet") {
|
|
4151
|
+
const last = project.daysSinceLastOutcome === null ? "No outcome recorded" : `last outcome ${project.daysSinceLastOutcome} days ago`;
|
|
4152
|
+
lines.push(color.dim(` ${last}`));
|
|
4153
|
+
}
|
|
4154
|
+
}
|
|
4155
|
+
}
|
|
4156
|
+
if (data.hiddenProjectCount > 0) lines.push(color.dim(` +${data.hiddenProjectCount} more projects`));
|
|
4157
|
+
lines.push("", color.bold("Signals"));
|
|
4158
|
+
if (data.signals.length === 0) lines.push(color.dim(" No signals for this week."));
|
|
4159
|
+
for (const [index, signal] of data.signals.entries()) {
|
|
4160
|
+
if (index > 0) lines.push("");
|
|
4161
|
+
const tone = signal.tone === "attention" ? color.yellow : signal.tone === "positive" ? color.green : color.cyan;
|
|
4162
|
+
const glyph = signal.tone === "attention" ? "!" : signal.tone === "positive" ? "+" : "~";
|
|
4163
|
+
lines.push(...wrap(`${glyph} ${signal.title}`, " ").map((line) => tone.bold(line)));
|
|
4164
|
+
lines.push(...wrap(signal.detail, " "));
|
|
4165
|
+
lines.push(...wrap(`Rule: ${signal.rule}`, " ").map((line) => color.dim(line)));
|
|
4166
|
+
for (const evidence of signal.evidence.slice(0, 3)) {
|
|
4167
|
+
const day = evidenceDate.format(/* @__PURE__ */ new Date(`${evidence.localDay}T00:00:00Z`));
|
|
4168
|
+
const tags = [evidence.captureSource === "agent" ? "agent" : "", evidence.loggedLate ? "logged later" : ""].filter(Boolean);
|
|
4169
|
+
const tag = tags.length ? ` [${tags.join(", ")}]` : "";
|
|
4170
|
+
const url = evidence.artifactUrl === null ? "" : terminalText(evidence.artifactUrl);
|
|
4171
|
+
const available = WIDTH - 17 - width(tag) - (url ? width(url) + 2 : 0);
|
|
4172
|
+
const outcomeWidth = available >= 8 ? Math.min(28, available) : 28;
|
|
4173
|
+
const prefix = ` ${column(day, 11)} ${truncate(evidence.outcome, outcomeWidth)}${tag}`;
|
|
4174
|
+
if (url && width(`${prefix} ${url}`) <= WIDTH) lines.push(`${prefix} ${color.cyan(url)}`);
|
|
4175
|
+
else {
|
|
4176
|
+
lines.push(prefix);
|
|
4177
|
+
if (url) lines.push(...wrap(url, " ").map((line) => color.cyan(line)));
|
|
4178
|
+
}
|
|
4179
|
+
}
|
|
4180
|
+
for (const action of signal.actions) {
|
|
4181
|
+
if (action.kind === "draft_commitment") {
|
|
4182
|
+
if (action.text === null) throw new Error("Momentum commitment idea is missing its text.");
|
|
4183
|
+
lines.push(...wrap(`Commitment idea: ${action.text}`, " ").map((line) => color.bold(line)));
|
|
4184
|
+
}
|
|
4185
|
+
}
|
|
4186
|
+
}
|
|
4187
|
+
return lines.join("\n") + "\n";
|
|
4188
|
+
}
|
|
4189
|
+
var momentumCommand = new Command8("momentum").description("Show eight weeks of project momentum and evidence-backed signals").option("--week <YYYY-MM-DD>", "Select a week by its Monday (defaults to your current personal week)").option("--json", "Print only the response data as pretty JSON").action(async (options) => {
|
|
4190
|
+
try {
|
|
4191
|
+
if (options.week !== void 0 && !/^\d{4}-\d{2}-\d{2}$/.test(options.week)) {
|
|
4192
|
+
throw new Error("--week must use YYYY-MM-DD. Choose a Monday on or before your current week.");
|
|
4193
|
+
}
|
|
4194
|
+
const data = await apiRequest(getV1MeMomentum, {
|
|
4195
|
+
query: { weekOf: options.week }
|
|
4196
|
+
});
|
|
4197
|
+
console.log(options.json ? JSON.stringify(data, null, 2) : renderMomentum(data));
|
|
4198
|
+
} catch (error) {
|
|
4199
|
+
printCommandError("Read momentum", error, options.json);
|
|
4200
|
+
}
|
|
4201
|
+
});
|
|
4202
|
+
|
|
4203
|
+
// src/index.ts
|
|
4204
|
+
var program = new Command9();
|
|
4205
|
+
program.name("fm").description("Flowmind CLI").version("0.1.0");
|
|
4206
|
+
program.addCommand(agentCommand);
|
|
4207
|
+
program.addCommand(authCommand);
|
|
4208
|
+
program.addCommand(logCommand);
|
|
4209
|
+
program.addCommand(hooksCommand);
|
|
4210
|
+
program.addCommand(statusCommand);
|
|
4211
|
+
program.addCommand(projectsCommand);
|
|
4212
|
+
program.addCommand(statsCommand);
|
|
4213
|
+
program.addCommand(momentumCommand);
|
|
4214
|
+
program.parse(process.argv);
|