@airalogy/aimd-recorder 1.24.1 → 1.24.2

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.
@@ -4,7 +4,7 @@ import { aN as Kt, aR as In, ao as Zn, au as Oa, aX as ei, b8 as ta, B as nn, _
4
4
  import { g as jt, a as Ua, c as Ja, b as Ri, r as Mi, P as zi, d as Vi, $ as Di, e as qi, h as Ii, f as Li, i as Pi, j as Bi, k as sn, l as Oi, m as on, N as Ni, n as Ki, o as ji, p as Hi, u as Ui, q as Wi, s as Gi, t as Qi, v as Yi, _ as Ji } from "./AimdEditor.vue_vue_type_style_index_0_lang-JAD--qFs.js";
5
5
  import { l as Xi, s as Zi, n as dn, t as er, o as tr, r as oa, y as ar, x as nr, d as ir, b as cn, A as rr, e as lr, a as sr, w as or, z as dr, v as cr, m as ur, u as fr, j as mr } from "./useFieldRendering-Co4DOOvL.js";
6
6
  import { renderToVue as vr, parseAndExtract as Lt } from "@airalogy/aimd-renderer";
7
- import { m as _a, a as ka, g as Ma } from "./validation-oyqyD7Jp.js";
7
+ import { m as _a, a as ka, g as Ma } from "./validation-BTYW9JCj.js";
8
8
  import { u as gr } from "./useCodeBlockRendering-D2viVPtA.js";
9
9
  import { isScaleQuizAnswerComplete as hr, gradeScaleQuizLocally as pr } from "@airalogy/aimd-core";
10
10
  const yr = {
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { AimdProtocolRecorder as e } from "./components.js";
2
2
  import { AimdAssignerGraph as i, AimdCollectorField as o, AimdDnaSequenceField as n, AimdEntityRefField as l, AimdMarkdownField as d, AimdQuizRecorder as m, AimdRecorder as c, AimdRecorderEditor as u } from "./components.js";
3
3
  import { D as A, c as g, r as S } from "./AimdEditor.vue_vue_type_style_index_0_lang-JAD--qFs.js";
4
- import { g as V, m as R, v as T, a as F } from "./validation-oyqyD7Jp.js";
4
+ import { g as V, m as R, v as T, a as F } from "./validation-BTYW9JCj.js";
5
5
  import { A as z, a_ as I, a as C, b as E, c as h, d as f, e as M, f as q, g as L, a$ as x, h as b, i as k, j as P, k as _, aq as v, l as N, m as W, n as w, o as Q, p as B, q as K, r as G, s as U, t as O, u as H, v as $, w as j, x as Y, y as J, z as X, B as Z, C as ee, D as ae, E as se, F as re, G as te, H as ie, I as oe, J as ne, K as le, L as de, M as me, N as ce, O as ue, P as pe, Q as Ae, R as ge, S as Se, T as De, U as Ve, V as Re, W as Te, X as Fe, Y as ye, Z as ze, _ as Ie, $ as Ce, a0 as Ee, a1 as he, a2 as fe, a3 as Me, a4 as qe, a5 as Le, a6 as xe, a7 as be, a8 as ke, b0 as Pe, a9 as _e, aa as ve, ab as Ne, ac as We, ad as we, ae as Qe, af as Be, ag as Ke } from "./useVarHelpers-Du2obGza.js";
6
6
  import { a as Ue, b as Oe, c as He, d as $e, e as je, g as Ye, f as Je, h as Xe, i as Ze, j as ea, k as aa, l as sa, m as ra, n as ta, o as ia, p as oa, q as na, r as la, s as da, t as ma, u as ca, v as ua, w as pa, x as Aa, y as ga, z as Sa } from "./useFieldRendering-Co4DOOvL.js";
7
7
  import { c as Va, u as Ra } from "./useCodeBlockRendering-D2viVPtA.js";
package/dist/record.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ah as i, A as s, ai as t, aj as n, ak as r, al as m, am as o, an as l, ao as d, a as A, b as c, ap as p, d as D, f as S, g as u, h as E, i as g, j as F, k as I, aq as T, l as _, m as y, o as R, r as z, ar as M, as as N, at as V, au as C, av as q, aw as L, ax as x, ay as f, az as k, aA as K, aB as P, aC as b, aD as Y, s as h, v as B, w as O, x as v, y as w, aE as G, C as Q, D as U, I as X, aF as W, aG as j, aH as Z, aI as H, aJ as J, aK as $, aL as aa, aM as ea, aN as ia, aO as sa, L as ta, M as na, aP as ra, aQ as ma, aR as oa, aS as la, aT as da, Q as Aa, R as ca, T as pa, aU as Da, U as Sa, V as ua, W as Ea, X as ga, Y as Fa, Z as Ia, $ as Ta, a0 as _a, a1 as ya, a2 as Ra, a3 as za, aV as Ma, a6 as Na, a7 as Va, a8 as Ca, aW as qa, a9 as La, aa as xa, ab as fa, ac as ka, aX as Ka, aY as Pa, aZ as ba } from "./useVarHelpers-Du2obGza.js";
2
- import { g as ha, m as Ba, v as Oa, a as va } from "./validation-oyqyD7Jp.js";
2
+ import { g as ha, m as Ba, v as Oa, a as va } from "./validation-BTYW9JCj.js";
3
3
  export {
4
4
  i as AIMD_AIRALOGY_FILE_ID_RE,
5
5
  s as AIMD_DNA_SEQUENCE_FORMAT,
@@ -5141,7 +5141,7 @@ const Bo = /* @__PURE__ */ Hn(Wo), Zo = [
5141
5141
  ], ia = new Ao({
5142
5142
  allErrors: !0,
5143
5143
  allowUnionTypes: !0,
5144
- coerceTypes: !0,
5144
+ coerceTypes: "array",
5145
5145
  strict: !1
5146
5146
  });
5147
5147
  Bo(ia);
@@ -5194,7 +5194,7 @@ function Ce(e) {
5194
5194
  if (typeof s == "number" && Number.isFinite(s)) return s;
5195
5195
  } catch {
5196
5196
  }
5197
- return typeof e.airalogy_file_id == "string" ? e.airalogy_file_id : (e.type === "file" || e.type === "image") && typeof e.id == "string" ? e.id : _e(e, "value") && (_e(e, "displayedValue") || _e(e, "formattedValue") || _e(e, "type")) ? Ce(e.value) : !_e(e, "value") && typeof e.formattedValue == "string" ? e.formattedValue : Object.fromEntries(
5197
+ return typeof e.airalogy_file_id == "string" ? e.airalogy_file_id : typeof e.airalogyId == "string" ? e.airalogyId : (e.type === "file" || e.type === "image") && typeof e.id == "string" ? e.id : _e(e, "value") && (_e(e, "displayedValue") || _e(e, "formattedValue") || _e(e, "type")) ? Ce(e.value) : !_e(e, "value") && typeof e.formattedValue == "string" ? e.formattedValue : Object.fromEntries(
5198
5198
  Object.entries(e).map(([s, i]) => [s, Ce(i)])
5199
5199
  );
5200
5200
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@airalogy/aimd-recorder",
3
3
  "type": "module",
4
- "version": "1.24.1",
4
+ "version": "1.24.2",
5
5
  "description": "AIMD (Airalogy Markdown) recorder Vue components and UI",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
@@ -67,8 +67,8 @@
67
67
  "react": "^19.2.4",
68
68
  "react-dom": "^19.2.4",
69
69
  "seqviz": "^3.10.18",
70
- "@airalogy/aimd-core": "^2.14.0",
71
70
  "@airalogy/aimd-editor": "^1.11.0",
71
+ "@airalogy/aimd-core": "^2.14.0",
72
72
  "@airalogy/aimd-renderer": "^2.11.1"
73
73
  },
74
74
  "devDependencies": {
@@ -249,6 +249,37 @@ describe("AimdRecorder validation", () => {
249
249
  expect(result.valid).toBe(true)
250
250
  })
251
251
 
252
+ it("normalizes host upload lists into scalar file ids for Pydantic schemas", () => {
253
+ const record = createEmptyProtocolRecordData()
254
+ record.var.attachment = [{
255
+ id: "temporary-upload-id",
256
+ airalogyId: "airalogy.id.file.report.pdf",
257
+ status: "finished",
258
+ }]
259
+
260
+ const result = validateAimdRecord({
261
+ ...EMPTY_FIELDS,
262
+ var: ["attachment"],
263
+ var_definitions: [{ id: "attachment", type: "FileIdPDF" }],
264
+ }, record, {
265
+ schema: {
266
+ research_variable: {
267
+ type: "object",
268
+ required: ["attachment"],
269
+ properties: {
270
+ attachment: {
271
+ type: "string",
272
+ pattern: "^airalogy\\.id\\.file\\.",
273
+ },
274
+ },
275
+ },
276
+ },
277
+ messages,
278
+ })
279
+
280
+ expect(result.valid).toBe(true)
281
+ })
282
+
252
283
  it("can validate and clear one exact table cell without collapsing to the table key", () => {
253
284
  const record = createEmptyProtocolRecordData()
254
285
  record.var.samples = [{ concentration: "", sample_id: "" }]
@@ -42,7 +42,7 @@ const SCHEMA_SECTION_ALIASES: Array<{ section: SchemaSection; keys: string[] }>
42
42
  const schemaAjv = new Ajv2020({
43
43
  allErrors: true,
44
44
  allowUnionTypes: true,
45
- coerceTypes: true,
45
+ coerceTypes: "array",
46
46
  strict: false,
47
47
  })
48
48
  addFormats(schemaAjv)
@@ -129,6 +129,7 @@ function normalizeValidationValue(value: unknown): unknown {
129
129
  }
130
130
 
131
131
  if (typeof value.airalogy_file_id === "string") return value.airalogy_file_id
132
+ if (typeof value.airalogyId === "string") return value.airalogyId
132
133
  if ((value.type === "file" || value.type === "image") && typeof value.id === "string") return value.id
133
134
  if (hasOwn(value, "value") && (hasOwn(value, "displayedValue") || hasOwn(value, "formattedValue") || hasOwn(value, "type"))) {
134
135
  return normalizeValidationValue(value.value)