@milaboratories/pl-model-common 1.25.0 → 1.25.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.
Files changed (286) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +29 -0
  2. package/dist/author_marker.d.ts +9 -6
  3. package/dist/base32_encode.cjs +40 -46
  4. package/dist/base32_encode.cjs.map +1 -1
  5. package/dist/base32_encode.js +40 -45
  6. package/dist/base32_encode.js.map +1 -1
  7. package/dist/base64.cjs +5 -4
  8. package/dist/base64.cjs.map +1 -1
  9. package/dist/base64.d.ts +10 -6
  10. package/dist/base64.js +5 -3
  11. package/dist/base64.js.map +1 -1
  12. package/dist/block_state.d.ts +21 -23
  13. package/dist/bmodel/block_config.cjs +9 -10
  14. package/dist/bmodel/block_config.cjs.map +1 -1
  15. package/dist/bmodel/block_config.d.ts +53 -72
  16. package/dist/bmodel/block_config.js +9 -9
  17. package/dist/bmodel/block_config.js.map +1 -1
  18. package/dist/bmodel/code.cjs +7 -6
  19. package/dist/bmodel/code.cjs.map +1 -1
  20. package/dist/bmodel/code.d.ts +17 -13
  21. package/dist/bmodel/code.js +6 -4
  22. package/dist/bmodel/code.js.map +1 -1
  23. package/dist/bmodel/container.d.ts +46 -44
  24. package/dist/bmodel/index.cjs +3 -0
  25. package/dist/bmodel/index.d.ts +5 -6
  26. package/dist/bmodel/index.js +3 -0
  27. package/dist/bmodel/normalization.cjs +90 -106
  28. package/dist/bmodel/normalization.cjs.map +1 -1
  29. package/dist/bmodel/normalization.d.ts +7 -3
  30. package/dist/bmodel/normalization.js +90 -105
  31. package/dist/bmodel/normalization.js.map +1 -1
  32. package/dist/bmodel/types.d.ts +4 -1
  33. package/dist/branding.d.ts +5 -5
  34. package/dist/common_types.d.ts +19 -15
  35. package/dist/driver_kit.d.ts +25 -17
  36. package/dist/drivers/ChunkedStreamReader.cjs +168 -203
  37. package/dist/drivers/ChunkedStreamReader.cjs.map +1 -1
  38. package/dist/drivers/ChunkedStreamReader.d.ts +104 -100
  39. package/dist/drivers/ChunkedStreamReader.js +168 -202
  40. package/dist/drivers/ChunkedStreamReader.js.map +1 -1
  41. package/dist/drivers/blob.cjs +15 -17
  42. package/dist/drivers/blob.cjs.map +1 -1
  43. package/dist/drivers/blob.d.ts +35 -35
  44. package/dist/drivers/blob.js +14 -15
  45. package/dist/drivers/blob.js.map +1 -1
  46. package/dist/drivers/index.cjs +18 -0
  47. package/dist/drivers/index.d.ts +29 -9
  48. package/dist/drivers/index.js +18 -0
  49. package/dist/drivers/interfaces.d.ts +17 -14
  50. package/dist/drivers/log.cjs +4 -3
  51. package/dist/drivers/log.cjs.map +1 -1
  52. package/dist/drivers/log.d.ts +52 -49
  53. package/dist/drivers/log.js +4 -2
  54. package/dist/drivers/log.js.map +1 -1
  55. package/dist/drivers/ls.cjs +16 -19
  56. package/dist/drivers/ls.cjs.map +1 -1
  57. package/dist/drivers/ls.d.ts +73 -76
  58. package/dist/drivers/ls.js +16 -17
  59. package/dist/drivers/ls.js.map +1 -1
  60. package/dist/drivers/pframe/column_filter.d.ts +19 -15
  61. package/dist/drivers/pframe/data_info.cjs +201 -252
  62. package/dist/drivers/pframe/data_info.cjs.map +1 -1
  63. package/dist/drivers/pframe/data_info.d.ts +84 -109
  64. package/dist/drivers/pframe/data_info.js +201 -250
  65. package/dist/drivers/pframe/data_info.js.map +1 -1
  66. package/dist/drivers/pframe/data_types.cjs +38 -63
  67. package/dist/drivers/pframe/data_types.cjs.map +1 -1
  68. package/dist/drivers/pframe/data_types.d.ts +91 -93
  69. package/dist/drivers/pframe/data_types.js +38 -61
  70. package/dist/drivers/pframe/data_types.js.map +1 -1
  71. package/dist/drivers/pframe/driver.cjs +7 -0
  72. package/dist/drivers/pframe/driver.cjs.map +1 -0
  73. package/dist/drivers/pframe/driver.d.ts +50 -45
  74. package/dist/drivers/pframe/driver.js +6 -0
  75. package/dist/drivers/pframe/driver.js.map +1 -0
  76. package/dist/drivers/pframe/filter_spec.d.ts +127 -123
  77. package/dist/drivers/pframe/find_columns.d.ts +21 -17
  78. package/dist/drivers/pframe/index.cjs +15 -0
  79. package/dist/drivers/pframe/index.d.ts +23 -16
  80. package/dist/drivers/pframe/index.js +15 -0
  81. package/dist/drivers/pframe/linker_columns.cjs +184 -238
  82. package/dist/drivers/pframe/linker_columns.cjs.map +1 -1
  83. package/dist/drivers/pframe/linker_columns.d.ts +45 -38
  84. package/dist/drivers/pframe/linker_columns.js +184 -236
  85. package/dist/drivers/pframe/linker_columns.js.map +1 -1
  86. package/dist/drivers/pframe/pframe.d.ts +26 -21
  87. package/dist/drivers/pframe/query/index.cjs +1 -0
  88. package/dist/drivers/pframe/query/index.d.ts +3 -4
  89. package/dist/drivers/pframe/query/index.js +1 -0
  90. package/dist/drivers/pframe/query/query_common.d.ts +205 -247
  91. package/dist/drivers/pframe/query/query_data.d.ts +25 -23
  92. package/dist/drivers/pframe/query/query_spec.d.ts +30 -29
  93. package/dist/drivers/pframe/query/utils.cjs +164 -183
  94. package/dist/drivers/pframe/query/utils.cjs.map +1 -1
  95. package/dist/drivers/pframe/query/utils.d.ts +13 -12
  96. package/dist/drivers/pframe/query/utils.js +164 -181
  97. package/dist/drivers/pframe/query/utils.js.map +1 -1
  98. package/dist/drivers/pframe/spec/anchored.cjs +178 -216
  99. package/dist/drivers/pframe/spec/anchored.cjs.map +1 -1
  100. package/dist/drivers/pframe/spec/anchored.d.ts +53 -49
  101. package/dist/drivers/pframe/spec/anchored.js +176 -214
  102. package/dist/drivers/pframe/spec/anchored.js.map +1 -1
  103. package/dist/drivers/pframe/spec/filtered_column.cjs +8 -7
  104. package/dist/drivers/pframe/spec/filtered_column.cjs.map +1 -1
  105. package/dist/drivers/pframe/spec/filtered_column.d.ts +20 -17
  106. package/dist/drivers/pframe/spec/filtered_column.js +8 -6
  107. package/dist/drivers/pframe/spec/filtered_column.js.map +1 -1
  108. package/dist/drivers/pframe/spec/ids.cjs +16 -14
  109. package/dist/drivers/pframe/spec/ids.cjs.map +1 -1
  110. package/dist/drivers/pframe/spec/ids.d.ts +13 -8
  111. package/dist/drivers/pframe/spec/ids.js +14 -12
  112. package/dist/drivers/pframe/spec/ids.js.map +1 -1
  113. package/dist/drivers/pframe/spec/index.cjs +6 -0
  114. package/dist/drivers/pframe/spec/index.d.ts +6 -7
  115. package/dist/drivers/pframe/spec/index.js +6 -0
  116. package/dist/drivers/pframe/spec/native_id.cjs +16 -16
  117. package/dist/drivers/pframe/spec/native_id.cjs.map +1 -1
  118. package/dist/drivers/pframe/spec/native_id.d.ts +9 -4
  119. package/dist/drivers/pframe/spec/native_id.js +13 -13
  120. package/dist/drivers/pframe/spec/native_id.js.map +1 -1
  121. package/dist/drivers/pframe/spec/selectors.cjs +72 -112
  122. package/dist/drivers/pframe/spec/selectors.cjs.map +1 -1
  123. package/dist/drivers/pframe/spec/selectors.d.ts +99 -94
  124. package/dist/drivers/pframe/spec/selectors.js +72 -110
  125. package/dist/drivers/pframe/spec/selectors.js.map +1 -1
  126. package/dist/drivers/pframe/spec/spec.cjs +282 -324
  127. package/dist/drivers/pframe/spec/spec.cjs.map +1 -1
  128. package/dist/drivers/pframe/spec/spec.d.ts +263 -272
  129. package/dist/drivers/pframe/spec/spec.js +281 -322
  130. package/dist/drivers/pframe/spec/spec.js.map +1 -1
  131. package/dist/drivers/pframe/table.d.ts +28 -24
  132. package/dist/drivers/pframe/table_calculate.cjs +117 -147
  133. package/dist/drivers/pframe/table_calculate.cjs.map +1 -1
  134. package/dist/drivers/pframe/table_calculate.d.ts +219 -220
  135. package/dist/drivers/pframe/table_calculate.js +117 -145
  136. package/dist/drivers/pframe/table_calculate.js.map +1 -1
  137. package/dist/drivers/pframe/table_common.cjs +13 -14
  138. package/dist/drivers/pframe/table_common.cjs.map +1 -1
  139. package/dist/drivers/pframe/table_common.d.ts +24 -19
  140. package/dist/drivers/pframe/table_common.js +13 -13
  141. package/dist/drivers/pframe/table_common.js.map +1 -1
  142. package/dist/drivers/pframe/unique_values.d.ts +23 -18
  143. package/dist/drivers/upload.d.ts +21 -18
  144. package/dist/drivers/urls.cjs +5 -6
  145. package/dist/drivers/urls.cjs.map +1 -1
  146. package/dist/drivers/urls.d.ts +12 -9
  147. package/dist/drivers/urls.js +5 -5
  148. package/dist/drivers/urls.js.map +1 -1
  149. package/dist/errors.cjs +65 -86
  150. package/dist/errors.cjs.map +1 -1
  151. package/dist/errors.d.ts +36 -33
  152. package/dist/errors.js +65 -85
  153. package/dist/errors.js.map +1 -1
  154. package/dist/flags/block_flags.cjs +6 -5
  155. package/dist/flags/block_flags.cjs.map +1 -1
  156. package/dist/flags/block_flags.d.ts +11 -8
  157. package/dist/flags/block_flags.js +6 -4
  158. package/dist/flags/block_flags.js.map +1 -1
  159. package/dist/flags/flag_utils.cjs +69 -87
  160. package/dist/flags/flag_utils.cjs.map +1 -1
  161. package/dist/flags/flag_utils.d.ts +40 -36
  162. package/dist/flags/flag_utils.js +69 -86
  163. package/dist/flags/flag_utils.js.map +1 -1
  164. package/dist/flags/type_utils.d.ts +12 -11
  165. package/dist/httpAuth.cjs +16 -20
  166. package/dist/httpAuth.cjs.map +1 -1
  167. package/dist/httpAuth.d.ts +10 -7
  168. package/dist/httpAuth.js +16 -19
  169. package/dist/httpAuth.js.map +1 -1
  170. package/dist/index.cjs +176 -178
  171. package/dist/index.d.ts +58 -20
  172. package/dist/index.js +37 -34
  173. package/dist/json.cjs +10 -8
  174. package/dist/json.cjs.map +1 -1
  175. package/dist/json.d.ts +18 -18
  176. package/dist/json.js +8 -6
  177. package/dist/json.js.map +1 -1
  178. package/dist/navigation.cjs +3 -2
  179. package/dist/navigation.cjs.map +1 -1
  180. package/dist/navigation.d.ts +18 -21
  181. package/dist/navigation.js +3 -1
  182. package/dist/navigation.js.map +1 -1
  183. package/dist/plid.cjs +16 -20
  184. package/dist/plid.cjs.map +1 -1
  185. package/dist/plid.d.ts +11 -7
  186. package/dist/plid.js +15 -18
  187. package/dist/plid.js.map +1 -1
  188. package/dist/pool/entry.d.ts +11 -11
  189. package/dist/pool/index.d.ts +3 -4
  190. package/dist/pool/query.cjs +21 -43
  191. package/dist/pool/query.cjs.map +1 -1
  192. package/dist/pool/query.d.ts +25 -20
  193. package/dist/pool/query.js +20 -40
  194. package/dist/pool/query.js.map +1 -1
  195. package/dist/pool/spec.cjs +40 -47
  196. package/dist/pool/spec.cjs.map +1 -1
  197. package/dist/pool/spec.d.ts +33 -31
  198. package/dist/pool/spec.js +40 -45
  199. package/dist/pool/spec.js.map +1 -1
  200. package/dist/ref.cjs +51 -71
  201. package/dist/ref.cjs.map +1 -1
  202. package/dist/ref.d.ts +36 -33
  203. package/dist/ref.js +50 -69
  204. package/dist/ref.js.map +1 -1
  205. package/dist/utag.d.ts +18 -14
  206. package/dist/util.cjs +8 -7
  207. package/dist/util.cjs.map +1 -1
  208. package/dist/util.d.ts +5 -2
  209. package/dist/util.js +8 -6
  210. package/dist/util.js.map +1 -1
  211. package/dist/value_or_error.cjs +7 -3
  212. package/dist/value_or_error.cjs.map +1 -1
  213. package/dist/value_or_error.d.ts +9 -6
  214. package/dist/value_or_error.js +7 -2
  215. package/dist/value_or_error.js.map +1 -1
  216. package/package.json +8 -8
  217. package/dist/author_marker.d.ts.map +0 -1
  218. package/dist/base32_encode.d.ts +0 -8
  219. package/dist/base32_encode.d.ts.map +0 -1
  220. package/dist/base64.d.ts.map +0 -1
  221. package/dist/block_state.d.ts.map +0 -1
  222. package/dist/bmodel/block_config.d.ts.map +0 -1
  223. package/dist/bmodel/code.d.ts.map +0 -1
  224. package/dist/bmodel/container.d.ts.map +0 -1
  225. package/dist/bmodel/index.d.ts.map +0 -1
  226. package/dist/bmodel/normalization.d.ts.map +0 -1
  227. package/dist/bmodel/types.d.ts.map +0 -1
  228. package/dist/branding.d.ts.map +0 -1
  229. package/dist/common_types.d.ts.map +0 -1
  230. package/dist/driver_kit.d.ts.map +0 -1
  231. package/dist/drivers/ChunkedStreamReader.d.ts.map +0 -1
  232. package/dist/drivers/blob.d.ts.map +0 -1
  233. package/dist/drivers/index.d.ts.map +0 -1
  234. package/dist/drivers/interfaces.d.ts.map +0 -1
  235. package/dist/drivers/log.d.ts.map +0 -1
  236. package/dist/drivers/ls.d.ts.map +0 -1
  237. package/dist/drivers/pframe/column_filter.d.ts.map +0 -1
  238. package/dist/drivers/pframe/data_info.d.ts.map +0 -1
  239. package/dist/drivers/pframe/data_types.d.ts.map +0 -1
  240. package/dist/drivers/pframe/driver.d.ts.map +0 -1
  241. package/dist/drivers/pframe/filter_spec.d.ts.map +0 -1
  242. package/dist/drivers/pframe/find_columns.d.ts.map +0 -1
  243. package/dist/drivers/pframe/index.d.ts.map +0 -1
  244. package/dist/drivers/pframe/linker_columns.d.ts.map +0 -1
  245. package/dist/drivers/pframe/pframe.d.ts.map +0 -1
  246. package/dist/drivers/pframe/query/index.d.ts.map +0 -1
  247. package/dist/drivers/pframe/query/query_common.d.ts.map +0 -1
  248. package/dist/drivers/pframe/query/query_data.d.ts.map +0 -1
  249. package/dist/drivers/pframe/query/query_spec.d.ts.map +0 -1
  250. package/dist/drivers/pframe/query/utils.d.ts.map +0 -1
  251. package/dist/drivers/pframe/spec/anchored.d.ts.map +0 -1
  252. package/dist/drivers/pframe/spec/filtered_column.d.ts.map +0 -1
  253. package/dist/drivers/pframe/spec/ids.d.ts.map +0 -1
  254. package/dist/drivers/pframe/spec/index.d.ts.map +0 -1
  255. package/dist/drivers/pframe/spec/native_id.d.ts.map +0 -1
  256. package/dist/drivers/pframe/spec/selectors.d.ts.map +0 -1
  257. package/dist/drivers/pframe/spec/spec.d.ts.map +0 -1
  258. package/dist/drivers/pframe/table.d.ts.map +0 -1
  259. package/dist/drivers/pframe/table_calculate.d.ts.map +0 -1
  260. package/dist/drivers/pframe/table_common.d.ts.map +0 -1
  261. package/dist/drivers/pframe/type_util.d.ts +0 -5
  262. package/dist/drivers/pframe/type_util.d.ts.map +0 -1
  263. package/dist/drivers/pframe/unique_values.d.ts.map +0 -1
  264. package/dist/drivers/upload.d.ts.map +0 -1
  265. package/dist/drivers/urls.d.ts.map +0 -1
  266. package/dist/errors.d.ts.map +0 -1
  267. package/dist/flags/block_flags.d.ts.map +0 -1
  268. package/dist/flags/flag_utils.d.ts.map +0 -1
  269. package/dist/flags/index.d.ts +0 -4
  270. package/dist/flags/index.d.ts.map +0 -1
  271. package/dist/flags/type_utils.d.ts.map +0 -1
  272. package/dist/httpAuth.d.ts.map +0 -1
  273. package/dist/index.cjs.map +0 -1
  274. package/dist/index.d.ts.map +0 -1
  275. package/dist/index.js.map +0 -1
  276. package/dist/json.d.ts.map +0 -1
  277. package/dist/navigation.d.ts.map +0 -1
  278. package/dist/plid.d.ts.map +0 -1
  279. package/dist/pool/entry.d.ts.map +0 -1
  280. package/dist/pool/index.d.ts.map +0 -1
  281. package/dist/pool/query.d.ts.map +0 -1
  282. package/dist/pool/spec.d.ts.map +0 -1
  283. package/dist/ref.d.ts.map +0 -1
  284. package/dist/utag.d.ts.map +0 -1
  285. package/dist/util.d.ts.map +0 -1
  286. package/dist/value_or_error.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"spec.js","sources":["../../src/pool/spec.ts"],"sourcesContent":["import type { Branded } from \"../branding\";\nimport type { JoinEntry, PColumn, PColumnLazy, PColumnSpec } from \"../drivers\";\nimport { assertNever } from \"../util\";\nimport type { ResultPoolEntry } from \"./entry\";\n\n/** Any object exported into the result pool by the block always have spec attached to it */\nexport type PObjectSpec = {\n /** PObject kind discriminator */\n readonly kind: string;\n\n /** Name is common part of PObject identity */\n readonly name: string;\n\n /** Domain is a set of key-value pairs that can be used to identify the object */\n readonly domain?: Record<string, string>;\n\n /** Additional information attached to the object */\n readonly annotations?: Record<string, string>;\n};\n\n/** Stable PObject id */\nexport type PObjectId = Branded<string, \"PColumnId\">;\n\n/**\n * Full PObject representation.\n *\n * @template Data type of the object referencing or describing the \"data\" part of the PObject\n * */\nexport interface PObject<Data> {\n /** Fully rendered PObjects are assigned a stable identifier. */\n readonly id: PObjectId;\n\n /** PObject spec, allowing it to be found among other PObjects */\n readonly spec: PObjectSpec;\n\n /** A handle to data object */\n readonly data: Data;\n}\n\nexport function isPColumnSpec(spec: PObjectSpec): spec is PColumnSpec {\n return spec.kind === \"PColumn\";\n}\n\nexport function isPColumn<T>(obj: PObject<T>): obj is PColumn<T> {\n return isPColumnSpec(obj.spec);\n}\n\nexport function isPColumnSpecResult(\n r: ResultPoolEntry<PObjectSpec>,\n): r is ResultPoolEntry<PColumnSpec> {\n return isPColumnSpec(r.obj);\n}\n\nexport function isPColumnResult<T>(\n r: ResultPoolEntry<PObject<T>>,\n): r is ResultPoolEntry<PColumn<T>> {\n return isPColumnSpec(r.obj.spec);\n}\n\nexport function ensurePColumn<T>(obj: PObject<T>): PColumn<T> {\n if (!isPColumn(obj)) throw new Error(`not a PColumn (kind = ${obj.spec.kind})`);\n return obj;\n}\n\nexport function mapPObjectData<D1, D2>(\n pObj: PColumn<D1> | PColumnLazy<D1>,\n cb: (d: D1) => D2,\n): PColumn<D2>;\nexport function mapPObjectData<D1, D2>(pObj: PColumn<D1>, cb: (d: D1) => D2): PColumn<D2>;\nexport function mapPObjectData<D1, D2>(\n pObj: PColumn<D1> | undefined,\n cb: (d: D1) => D2,\n): PColumn<D2> | undefined;\nexport function mapPObjectData<D1, D2>(pObj: PObject<D1>, cb: (d: D1) => D2): PObject<D2>;\nexport function mapPObjectData<D1, D2>(\n pObj: PObject<D1> | undefined,\n cb: (d: D1) => D2,\n): PObject<D2> | undefined;\nexport function mapPObjectData<D1, D2>(\n pObj: PObject<D1> | undefined,\n cb: (d: D1) => D2,\n): PObject<D2> | undefined {\n return pObj === undefined\n ? undefined\n : {\n ...pObj,\n data: cb(typeof pObj.data === \"function\" ? pObj.data() : pObj.data),\n };\n}\n\nexport function extractAllColumns<D>(entry: JoinEntry<PColumn<D>>): PColumn<D>[] {\n const columns = new Map<PObjectId, PColumn<D>>();\n const addAllColumns = (entry: JoinEntry<PColumn<D>>) => {\n switch (entry.type) {\n case \"column\":\n columns.set(entry.column.id, entry.column);\n return;\n case \"slicedColumn\":\n columns.set(entry.column.id, entry.column);\n return;\n case \"artificialColumn\":\n columns.set(entry.column.id, entry.column);\n return;\n case \"inlineColumn\":\n return;\n case \"full\":\n case \"inner\":\n for (const e of entry.entries) addAllColumns(e);\n return;\n case \"outer\":\n addAllColumns(entry.primary);\n for (const e of entry.secondary) addAllColumns(e);\n return;\n default:\n assertNever(entry);\n }\n };\n addAllColumns(entry);\n return [...columns.values()];\n}\n"],"names":[],"mappings":";;AAuCM,SAAU,aAAa,CAAC,IAAiB,EAAA;AAC7C,IAAA,OAAO,IAAI,CAAC,IAAI,KAAK,SAAS;AAChC;AAEM,SAAU,SAAS,CAAI,GAAe,EAAA;AAC1C,IAAA,OAAO,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC;AAChC;AAEM,SAAU,mBAAmB,CACjC,CAA+B,EAAA;AAE/B,IAAA,OAAO,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC;AAC7B;AAEM,SAAU,eAAe,CAC7B,CAA8B,EAAA;IAE9B,OAAO,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC;AAClC;AAEM,SAAU,aAAa,CAAI,GAAe,EAAA;AAC9C,IAAA,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,CAAA,sBAAA,EAAyB,GAAG,CAAC,IAAI,CAAC,IAAI,CAAA,CAAA,CAAG,CAAC;AAC/E,IAAA,OAAO,GAAG;AACZ;AAgBM,SAAU,cAAc,CAC5B,IAA6B,EAC7B,EAAiB,EAAA;IAEjB,OAAO,IAAI,KAAK;AACd,UAAE;AACF,UAAE;AACE,YAAA,GAAG,IAAI;YACP,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,CAAC,IAAI,KAAK,UAAU,GAAG,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;SACpE;AACP;AAEM,SAAU,iBAAiB,CAAI,KAA4B,EAAA;AAC/D,IAAA,MAAM,OAAO,GAAG,IAAI,GAAG,EAAyB;AAChD,IAAA,MAAM,aAAa,GAAG,CAAC,KAA4B,KAAI;AACrD,QAAA,QAAQ,KAAK,CAAC,IAAI;AAChB,YAAA,KAAK,QAAQ;AACX,gBAAA,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC;gBAC1C;AACF,YAAA,KAAK,cAAc;AACjB,gBAAA,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC;gBAC1C;AACF,YAAA,KAAK,kBAAkB;AACrB,gBAAA,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC;gBAC1C;AACF,YAAA,KAAK,cAAc;gBACjB;AACF,YAAA,KAAK,MAAM;AACX,YAAA,KAAK,OAAO;AACV,gBAAA,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,OAAO;oBAAE,aAAa,CAAC,CAAC,CAAC;gBAC/C;AACF,YAAA,KAAK,OAAO;AACV,gBAAA,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC;AAC5B,gBAAA,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,SAAS;oBAAE,aAAa,CAAC,CAAC,CAAC;gBACjD;AACF,YAAA;gBACE,WAAW,CAAC,KAAK,CAAC;;AAExB,IAAA,CAAC;IACD,aAAa,CAAC,KAAK,CAAC;AACpB,IAAA,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;AAC9B;;;;"}
1
+ {"version":3,"file":"spec.js","names":[],"sources":["../../src/pool/spec.ts"],"sourcesContent":["import type { Branded } from \"../branding\";\nimport type { JoinEntry, PColumn, PColumnLazy, PColumnSpec } from \"../drivers\";\nimport { assertNever } from \"../util\";\nimport type { ResultPoolEntry } from \"./entry\";\n\n/** Any object exported into the result pool by the block always have spec attached to it */\nexport type PObjectSpec = {\n /** PObject kind discriminator */\n readonly kind: string;\n\n /** Name is common part of PObject identity */\n readonly name: string;\n\n /** Domain is a set of key-value pairs that can be used to identify the object */\n readonly domain?: Record<string, string>;\n\n /** Additional information attached to the object */\n readonly annotations?: Record<string, string>;\n};\n\n/** Stable PObject id */\nexport type PObjectId = Branded<string, \"PColumnId\">;\n\n/**\n * Full PObject representation.\n *\n * @template Data type of the object referencing or describing the \"data\" part of the PObject\n * */\nexport interface PObject<Data> {\n /** Fully rendered PObjects are assigned a stable identifier. */\n readonly id: PObjectId;\n\n /** PObject spec, allowing it to be found among other PObjects */\n readonly spec: PObjectSpec;\n\n /** A handle to data object */\n readonly data: Data;\n}\n\nexport function isPColumnSpec(spec: PObjectSpec): spec is PColumnSpec {\n return spec.kind === \"PColumn\";\n}\n\nexport function isPColumn<T>(obj: PObject<T>): obj is PColumn<T> {\n return isPColumnSpec(obj.spec);\n}\n\nexport function isPColumnSpecResult(\n r: ResultPoolEntry<PObjectSpec>,\n): r is ResultPoolEntry<PColumnSpec> {\n return isPColumnSpec(r.obj);\n}\n\nexport function isPColumnResult<T>(\n r: ResultPoolEntry<PObject<T>>,\n): r is ResultPoolEntry<PColumn<T>> {\n return isPColumnSpec(r.obj.spec);\n}\n\nexport function ensurePColumn<T>(obj: PObject<T>): PColumn<T> {\n if (!isPColumn(obj)) throw new Error(`not a PColumn (kind = ${obj.spec.kind})`);\n return obj;\n}\n\nexport function mapPObjectData<D1, D2>(\n pObj: PColumn<D1> | PColumnLazy<D1>,\n cb: (d: D1) => D2,\n): PColumn<D2>;\nexport function mapPObjectData<D1, D2>(pObj: PColumn<D1>, cb: (d: D1) => D2): PColumn<D2>;\nexport function mapPObjectData<D1, D2>(\n pObj: PColumn<D1> | undefined,\n cb: (d: D1) => D2,\n): PColumn<D2> | undefined;\nexport function mapPObjectData<D1, D2>(pObj: PObject<D1>, cb: (d: D1) => D2): PObject<D2>;\nexport function mapPObjectData<D1, D2>(\n pObj: PObject<D1> | undefined,\n cb: (d: D1) => D2,\n): PObject<D2> | undefined;\nexport function mapPObjectData<D1, D2>(\n pObj: PObject<D1> | undefined,\n cb: (d: D1) => D2,\n): PObject<D2> | undefined {\n return pObj === undefined\n ? undefined\n : {\n ...pObj,\n data: cb(typeof pObj.data === \"function\" ? pObj.data() : pObj.data),\n };\n}\n\nexport function extractAllColumns<D>(entry: JoinEntry<PColumn<D>>): PColumn<D>[] {\n const columns = new Map<PObjectId, PColumn<D>>();\n const addAllColumns = (entry: JoinEntry<PColumn<D>>) => {\n switch (entry.type) {\n case \"column\":\n columns.set(entry.column.id, entry.column);\n return;\n case \"slicedColumn\":\n columns.set(entry.column.id, entry.column);\n return;\n case \"artificialColumn\":\n columns.set(entry.column.id, entry.column);\n return;\n case \"inlineColumn\":\n return;\n case \"full\":\n case \"inner\":\n for (const e of entry.entries) addAllColumns(e);\n return;\n case \"outer\":\n addAllColumns(entry.primary);\n for (const e of entry.secondary) addAllColumns(e);\n return;\n default:\n assertNever(entry);\n }\n };\n addAllColumns(entry);\n return [...columns.values()];\n}\n"],"mappings":";;;AAuCA,SAAgB,cAAc,MAAwC;AACpE,QAAO,KAAK,SAAS;;AAGvB,SAAgB,UAAa,KAAoC;AAC/D,QAAO,cAAc,IAAI,KAAK;;AAGhC,SAAgB,oBACd,GACmC;AACnC,QAAO,cAAc,EAAE,IAAI;;AAG7B,SAAgB,gBACd,GACkC;AAClC,QAAO,cAAc,EAAE,IAAI,KAAK;;AAGlC,SAAgB,cAAiB,KAA6B;AAC5D,KAAI,CAAC,UAAU,IAAI,CAAE,OAAM,IAAI,MAAM,yBAAyB,IAAI,KAAK,KAAK,GAAG;AAC/E,QAAO;;AAiBT,SAAgB,eACd,MACA,IACyB;AACzB,QAAO,SAAS,SACZ,SACA;EACE,GAAG;EACH,MAAM,GAAG,OAAO,KAAK,SAAS,aAAa,KAAK,MAAM,GAAG,KAAK,KAAK;EACpE;;AAGP,SAAgB,kBAAqB,OAA4C;CAC/E,MAAM,0BAAU,IAAI,KAA4B;CAChD,MAAM,iBAAiB,UAAiC;AACtD,UAAQ,MAAM,MAAd;GACE,KAAK;AACH,YAAQ,IAAI,MAAM,OAAO,IAAI,MAAM,OAAO;AAC1C;GACF,KAAK;AACH,YAAQ,IAAI,MAAM,OAAO,IAAI,MAAM,OAAO;AAC1C;GACF,KAAK;AACH,YAAQ,IAAI,MAAM,OAAO,IAAI,MAAM,OAAO;AAC1C;GACF,KAAK,eACH;GACF,KAAK;GACL,KAAK;AACH,SAAK,MAAM,KAAK,MAAM,QAAS,eAAc,EAAE;AAC/C;GACF,KAAK;AACH,kBAAc,MAAM,QAAQ;AAC5B,SAAK,MAAM,KAAK,MAAM,UAAW,eAAc,EAAE;AACjD;GACF,QACE,aAAY,MAAM;;;AAGxB,eAAc,MAAM;AACpB,QAAO,CAAC,GAAG,QAAQ,QAAQ,CAAC"}
package/dist/ref.cjs CHANGED
@@ -1,90 +1,70 @@
1
- 'use strict';
1
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
2
+ let zod = require("zod");
2
3
 
3
- var zod = require('zod');
4
-
5
- const PlRef = zod.z
6
- .object({
7
- __isRef: zod.z
8
- .literal(true)
9
- .describe("Crucial marker for the block dependency tree reconstruction"),
10
- blockId: zod.z.string().describe("Upstream block id"),
11
- name: zod.z.string().describe("Name of the output provided to the upstream block's output context"),
12
- requireEnrichments: zod.z
13
- .literal(true)
14
- .optional()
15
- .describe("True if current block that stores this reference in its args, may need enrichments " +
16
- "for the references value originating from the blocks in between current and referenced block"),
17
- })
18
- .describe("Universal reference type, allowing to set block connections. It is crucial that " +
19
- "{@link __isRef} is present and equal to true, internal logic relies on this marker " +
20
- "to build block dependency trees.")
21
- .readonly();
4
+ //#region src/ref.ts
5
+ const PlRef = zod.z.object({
6
+ __isRef: zod.z.literal(true).describe("Crucial marker for the block dependency tree reconstruction"),
7
+ blockId: zod.z.string().describe("Upstream block id"),
8
+ name: zod.z.string().describe("Name of the output provided to the upstream block's output context"),
9
+ requireEnrichments: zod.z.literal(true).optional().describe("True if current block that stores this reference in its args, may need enrichments for the references value originating from the blocks in between current and referenced block")
10
+ }).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").readonly();
22
11
  /**
23
- * Type guard to check if a value is a PlRef.
24
- *
25
- * @param value - The value to check.
26
- * @returns True if the value is a PlRef, false otherwise.
27
- */
12
+ * Type guard to check if a value is a PlRef.
13
+ *
14
+ * @param value - The value to check.
15
+ * @returns True if the value is a PlRef, false otherwise.
16
+ */
28
17
  function isPlRef(value) {
29
- return (typeof value === "object" &&
30
- value !== null &&
31
- "__isRef" in value &&
32
- value.__isRef === true &&
33
- "blockId" in value &&
34
- "name" in value);
18
+ return typeof value === "object" && value !== null && "__isRef" in value && value.__isRef === true && "blockId" in value && "name" in value;
35
19
  }
36
20
  /**
37
- * Creates a PlRef with the given blockId and name.
38
- *
39
- * @param blockId - The blockId of the reference.
40
- * @param name - The name of the reference.
41
- * @param requireEnrichments - Whether the reference requires enrichments.
42
- */
21
+ * Creates a PlRef with the given blockId and name.
22
+ *
23
+ * @param blockId - The blockId of the reference.
24
+ * @param name - The name of the reference.
25
+ * @param requireEnrichments - Whether the reference requires enrichments.
26
+ */
43
27
  function createPlRef(blockId, name, requireEnrichments = false) {
44
- if (requireEnrichments)
45
- return {
46
- __isRef: true,
47
- blockId,
48
- name,
49
- requireEnrichments: true,
50
- };
51
- else
52
- return {
53
- __isRef: true,
54
- blockId,
55
- name,
56
- };
28
+ if (requireEnrichments) return {
29
+ __isRef: true,
30
+ blockId,
31
+ name,
32
+ requireEnrichments: true
33
+ };
34
+ else return {
35
+ __isRef: true,
36
+ blockId,
37
+ name
38
+ };
57
39
  }
58
40
  /**
59
- * Creates a new PlRef based on an existing one, explicitly setting (default) or removing the
60
- * requireEnrichments property.
61
- *
62
- * @param ref - The original PlRef object.
63
- * @param requireEnrichments - If true, the `requireEnrichments: true` property is added
64
- * to the returned PlRef. If false, the `requireEnrichments` property is removed. Defaults to true.
65
- * @returns A new PlRef object with the `requireEnrichments` property set or removed accordingly.
66
- */
41
+ * Creates a new PlRef based on an existing one, explicitly setting (default) or removing the
42
+ * requireEnrichments property.
43
+ *
44
+ * @param ref - The original PlRef object.
45
+ * @param requireEnrichments - If true, the `requireEnrichments: true` property is added
46
+ * to the returned PlRef. If false, the `requireEnrichments` property is removed. Defaults to true.
47
+ * @returns A new PlRef object with the `requireEnrichments` property set or removed accordingly.
48
+ */
67
49
  function withEnrichments(ref, requireEnrichments = true) {
68
- if (requireEnrichments)
69
- return {
70
- ...ref,
71
- requireEnrichments: true,
72
- };
73
- else {
74
- const { requireEnrichments: _, ...rest } = ref;
75
- return rest;
76
- }
50
+ if (requireEnrichments) return {
51
+ ...ref,
52
+ requireEnrichments: true
53
+ };
54
+ else {
55
+ const { requireEnrichments: _, ...rest } = ref;
56
+ return rest;
57
+ }
77
58
  }
78
59
  /** Compare two PlRefs and returns true if they are qual */
79
60
  function plRefsEqual(ref1, ref2, ignoreEnrichments = false) {
80
- return (ref1.blockId === ref2.blockId &&
81
- ref1.name === ref2.name &&
82
- (ignoreEnrichments || ref1.requireEnrichments === ref2.requireEnrichments));
61
+ return ref1.blockId === ref2.blockId && ref1.name === ref2.name && (ignoreEnrichments || ref1.requireEnrichments === ref2.requireEnrichments);
83
62
  }
84
63
 
64
+ //#endregion
85
65
  exports.PlRef = PlRef;
86
66
  exports.createPlRef = createPlRef;
87
67
  exports.isPlRef = isPlRef;
88
68
  exports.plRefsEqual = plRefsEqual;
89
69
  exports.withEnrichments = withEnrichments;
90
- //# sourceMappingURL=ref.cjs.map
70
+ //# sourceMappingURL=ref.cjs.map
package/dist/ref.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ref.cjs","sources":["../src/ref.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const PlRef = z\n .object({\n __isRef: z\n .literal(true)\n .describe(\"Crucial marker for the block dependency tree reconstruction\"),\n blockId: z.string().describe(\"Upstream block id\"),\n name: z.string().describe(\"Name of the output provided to the upstream block's output context\"),\n requireEnrichments: z\n .literal(true)\n .optional()\n .describe(\n \"True if current block that stores this reference in its args, may need enrichments \" +\n \"for the references value originating from the blocks in between current and referenced block\",\n ),\n })\n .describe(\n \"Universal reference type, allowing to set block connections. It is crucial that \" +\n \"{@link __isRef} is present and equal to true, internal logic relies on this marker \" +\n \"to build block dependency trees.\",\n )\n .readonly();\nexport type PlRef = z.infer<typeof PlRef>;\n/** @deprecated use {@link PlRef} */\nexport type Ref = PlRef;\n\n/**\n * Type guard to check if a value is a PlRef.\n *\n * @param value - The value to check.\n * @returns True if the value is a PlRef, false otherwise.\n */\nexport function isPlRef(value: unknown): value is PlRef {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"__isRef\" in value &&\n (value as { __isRef: unknown }).__isRef === true &&\n \"blockId\" in value &&\n \"name\" in value\n );\n}\n\n/** Standard way how to communicate possible connections given specific\n * requirements for incoming data. */\nexport type Option = {\n /** Fully rendered reference to be assigned for the intended field in block's\n * args */\n readonly ref: PlRef;\n\n /** Label to be present for the user in i.e. drop-down list */\n readonly label: string;\n};\n\n/**\n * Creates a PlRef with the given blockId and name.\n *\n * @param blockId - The blockId of the reference.\n * @param name - The name of the reference.\n * @param requireEnrichments - Whether the reference requires enrichments.\n */\nexport function createPlRef(blockId: string, name: string, requireEnrichments: boolean = false) {\n if (requireEnrichments)\n return {\n __isRef: true,\n blockId,\n name,\n requireEnrichments: true,\n };\n else\n return {\n __isRef: true,\n blockId,\n name,\n };\n}\n\n/**\n * Creates a new PlRef based on an existing one, explicitly setting (default) or removing the\n * requireEnrichments property.\n *\n * @param ref - The original PlRef object.\n * @param requireEnrichments - If true, the `requireEnrichments: true` property is added\n * to the returned PlRef. If false, the `requireEnrichments` property is removed. Defaults to true.\n * @returns A new PlRef object with the `requireEnrichments` property set or removed accordingly.\n */\nexport function withEnrichments(ref: PlRef, requireEnrichments: boolean = true): PlRef {\n if (requireEnrichments)\n return {\n ...ref,\n requireEnrichments: true,\n };\n else {\n const { requireEnrichments: _, ...rest } = ref;\n return rest;\n }\n}\n\n/** Compare two PlRefs and returns true if they are qual */\nexport function plRefsEqual(ref1: PlRef, ref2: PlRef, ignoreEnrichments: boolean = false) {\n return (\n ref1.blockId === ref2.blockId &&\n ref1.name === ref2.name &&\n (ignoreEnrichments || ref1.requireEnrichments === ref2.requireEnrichments)\n );\n}\n"],"names":["z"],"mappings":";;;;AAEO,MAAM,KAAK,GAAGA;AAClB,KAAA,MAAM,CAAC;AACN,IAAA,OAAO,EAAEA;SACN,OAAO,CAAC,IAAI;SACZ,QAAQ,CAAC,6DAA6D,CAAC;IAC1E,OAAO,EAAEA,KAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IACjD,IAAI,EAAEA,KAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oEAAoE,CAAC;AAC/F,IAAA,kBAAkB,EAAEA;SACjB,OAAO,CAAC,IAAI;AACZ,SAAA,QAAQ;AACR,SAAA,QAAQ,CACP,qFAAqF;AACnF,QAAA,8FAA8F,CACjG;CACJ;AACA,KAAA,QAAQ,CACP,kFAAkF;IAChF,qFAAqF;AACrF,IAAA,kCAAkC;AAErC,KAAA,QAAQ;AAKX;;;;;AAKG;AACG,SAAU,OAAO,CAAC,KAAc,EAAA;AACpC,IAAA,QACE,OAAO,KAAK,KAAK,QAAQ;AACzB,QAAA,KAAK,KAAK,IAAI;AACd,QAAA,SAAS,IAAI,KAAK;QACjB,KAA8B,CAAC,OAAO,KAAK,IAAI;AAChD,QAAA,SAAS,IAAI,KAAK;QAClB,MAAM,IAAI,KAAK;AAEnB;AAaA;;;;;;AAMG;AACG,SAAU,WAAW,CAAC,OAAe,EAAE,IAAY,EAAE,qBAA8B,KAAK,EAAA;AAC5F,IAAA,IAAI,kBAAkB;QACpB,OAAO;AACL,YAAA,OAAO,EAAE,IAAI;YACb,OAAO;YACP,IAAI;AACJ,YAAA,kBAAkB,EAAE,IAAI;SACzB;;QAED,OAAO;AACL,YAAA,OAAO,EAAE,IAAI;YACb,OAAO;YACP,IAAI;SACL;AACL;AAEA;;;;;;;;AAQG;SACa,eAAe,CAAC,GAAU,EAAE,qBAA8B,IAAI,EAAA;AAC5E,IAAA,IAAI,kBAAkB;QACpB,OAAO;AACL,YAAA,GAAG,GAAG;AACN,YAAA,kBAAkB,EAAE,IAAI;SACzB;SACE;QACH,MAAM,EAAE,kBAAkB,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,GAAG;AAC9C,QAAA,OAAO,IAAI;IACb;AACF;AAEA;AACM,SAAU,WAAW,CAAC,IAAW,EAAE,IAAW,EAAE,oBAA6B,KAAK,EAAA;AACtF,IAAA,QACE,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,OAAO;AAC7B,QAAA,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI;SACtB,iBAAiB,IAAI,IAAI,CAAC,kBAAkB,KAAK,IAAI,CAAC,kBAAkB,CAAC;AAE9E;;;;;;;;"}
1
+ {"version":3,"file":"ref.cjs","names":["z"],"sources":["../src/ref.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const PlRef = z\n .object({\n __isRef: z\n .literal(true)\n .describe(\"Crucial marker for the block dependency tree reconstruction\"),\n blockId: z.string().describe(\"Upstream block id\"),\n name: z.string().describe(\"Name of the output provided to the upstream block's output context\"),\n requireEnrichments: z\n .literal(true)\n .optional()\n .describe(\n \"True if current block that stores this reference in its args, may need enrichments \" +\n \"for the references value originating from the blocks in between current and referenced block\",\n ),\n })\n .describe(\n \"Universal reference type, allowing to set block connections. It is crucial that \" +\n \"{@link __isRef} is present and equal to true, internal logic relies on this marker \" +\n \"to build block dependency trees.\",\n )\n .readonly();\nexport type PlRef = z.infer<typeof PlRef>;\n/** @deprecated use {@link PlRef} */\nexport type Ref = PlRef;\n\n/**\n * Type guard to check if a value is a PlRef.\n *\n * @param value - The value to check.\n * @returns True if the value is a PlRef, false otherwise.\n */\nexport function isPlRef(value: unknown): value is PlRef {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"__isRef\" in value &&\n (value as { __isRef: unknown }).__isRef === true &&\n \"blockId\" in value &&\n \"name\" in value\n );\n}\n\n/** Standard way how to communicate possible connections given specific\n * requirements for incoming data. */\nexport type Option = {\n /** Fully rendered reference to be assigned for the intended field in block's\n * args */\n readonly ref: PlRef;\n\n /** Label to be present for the user in i.e. drop-down list */\n readonly label: string;\n};\n\n/**\n * Creates a PlRef with the given blockId and name.\n *\n * @param blockId - The blockId of the reference.\n * @param name - The name of the reference.\n * @param requireEnrichments - Whether the reference requires enrichments.\n */\nexport function createPlRef(blockId: string, name: string, requireEnrichments: boolean = false) {\n if (requireEnrichments)\n return {\n __isRef: true,\n blockId,\n name,\n requireEnrichments: true,\n };\n else\n return {\n __isRef: true,\n blockId,\n name,\n };\n}\n\n/**\n * Creates a new PlRef based on an existing one, explicitly setting (default) or removing the\n * requireEnrichments property.\n *\n * @param ref - The original PlRef object.\n * @param requireEnrichments - If true, the `requireEnrichments: true` property is added\n * to the returned PlRef. If false, the `requireEnrichments` property is removed. Defaults to true.\n * @returns A new PlRef object with the `requireEnrichments` property set or removed accordingly.\n */\nexport function withEnrichments(ref: PlRef, requireEnrichments: boolean = true): PlRef {\n if (requireEnrichments)\n return {\n ...ref,\n requireEnrichments: true,\n };\n else {\n const { requireEnrichments: _, ...rest } = ref;\n return rest;\n }\n}\n\n/** Compare two PlRefs and returns true if they are qual */\nexport function plRefsEqual(ref1: PlRef, ref2: PlRef, ignoreEnrichments: boolean = false) {\n return (\n ref1.blockId === ref2.blockId &&\n ref1.name === ref2.name &&\n (ignoreEnrichments || ref1.requireEnrichments === ref2.requireEnrichments)\n );\n}\n"],"mappings":";;;;AAEA,MAAa,QAAQA,MAClB,OAAO;CACN,SAASA,MACN,QAAQ,KAAK,CACb,SAAS,8DAA8D;CAC1E,SAASA,MAAE,QAAQ,CAAC,SAAS,oBAAoB;CACjD,MAAMA,MAAE,QAAQ,CAAC,SAAS,qEAAqE;CAC/F,oBAAoBA,MACjB,QAAQ,KAAK,CACb,UAAU,CACV,SACC,kLAED;CACJ,CAAC,CACD,SACC,sMAGD,CACA,UAAU;;;;;;;AAWb,SAAgB,QAAQ,OAAgC;AACtD,QACE,OAAO,UAAU,YACjB,UAAU,QACV,aAAa,SACZ,MAA+B,YAAY,QAC5C,aAAa,SACb,UAAU;;;;;;;;;AAsBd,SAAgB,YAAY,SAAiB,MAAc,qBAA8B,OAAO;AAC9F,KAAI,mBACF,QAAO;EACL,SAAS;EACT;EACA;EACA,oBAAoB;EACrB;KAED,QAAO;EACL,SAAS;EACT;EACA;EACD;;;;;;;;;;;AAYL,SAAgB,gBAAgB,KAAY,qBAA8B,MAAa;AACrF,KAAI,mBACF,QAAO;EACL,GAAG;EACH,oBAAoB;EACrB;MACE;EACH,MAAM,EAAE,oBAAoB,GAAG,GAAG,SAAS;AAC3C,SAAO;;;;AAKX,SAAgB,YAAY,MAAa,MAAa,oBAA6B,OAAO;AACxF,QACE,KAAK,YAAY,KAAK,WACtB,KAAK,SAAS,KAAK,SAClB,qBAAqB,KAAK,uBAAuB,KAAK"}
package/dist/ref.d.ts CHANGED
@@ -1,38 +1,39 @@
1
1
  import { z } from "zod";
2
- export declare const PlRef: z.ZodReadonly<z.ZodObject<{
3
- __isRef: z.ZodLiteral<true>;
4
- blockId: z.ZodString;
5
- name: z.ZodString;
6
- requireEnrichments: z.ZodOptional<z.ZodLiteral<true>>;
2
+
3
+ //#region src/ref.d.ts
4
+ declare const PlRef: z.ZodReadonly<z.ZodObject<{
5
+ __isRef: z.ZodLiteral<true>;
6
+ blockId: z.ZodString;
7
+ name: z.ZodString;
8
+ requireEnrichments: z.ZodOptional<z.ZodLiteral<true>>;
7
9
  }, "strip", z.ZodTypeAny, {
8
- __isRef: true;
9
- blockId: string;
10
- name: string;
11
- requireEnrichments?: true | undefined;
10
+ __isRef: true;
11
+ blockId: string;
12
+ name: string;
13
+ requireEnrichments?: true | undefined;
12
14
  }, {
13
- __isRef: true;
14
- blockId: string;
15
- name: string;
16
- requireEnrichments?: true | undefined;
15
+ __isRef: true;
16
+ blockId: string;
17
+ name: string;
18
+ requireEnrichments?: true | undefined;
17
19
  }>>;
18
- export type PlRef = z.infer<typeof PlRef>;
20
+ type PlRef = z.infer<typeof PlRef>;
19
21
  /** @deprecated use {@link PlRef} */
20
- export type Ref = PlRef;
22
+ type Ref = PlRef;
21
23
  /**
22
24
  * Type guard to check if a value is a PlRef.
23
25
  *
24
26
  * @param value - The value to check.
25
27
  * @returns True if the value is a PlRef, false otherwise.
26
28
  */
27
- export declare function isPlRef(value: unknown): value is PlRef;
29
+ declare function isPlRef(value: unknown): value is PlRef;
28
30
  /** Standard way how to communicate possible connections given specific
29
31
  * requirements for incoming data. */
30
- export type Option = {
31
- /** Fully rendered reference to be assigned for the intended field in block's
32
- * args */
33
- readonly ref: PlRef;
34
- /** Label to be present for the user in i.e. drop-down list */
35
- readonly label: string;
32
+ type Option = {
33
+ /** Fully rendered reference to be assigned for the intended field in block's
34
+ * args */
35
+ readonly ref: PlRef; /** Label to be present for the user in i.e. drop-down list */
36
+ readonly label: string;
36
37
  };
37
38
  /**
38
39
  * Creates a PlRef with the given blockId and name.
@@ -41,16 +42,16 @@ export type Option = {
41
42
  * @param name - The name of the reference.
42
43
  * @param requireEnrichments - Whether the reference requires enrichments.
43
44
  */
44
- export declare function createPlRef(blockId: string, name: string, requireEnrichments?: boolean): {
45
- __isRef: boolean;
46
- blockId: string;
47
- name: string;
48
- requireEnrichments: boolean;
45
+ declare function createPlRef(blockId: string, name: string, requireEnrichments?: boolean): {
46
+ __isRef: boolean;
47
+ blockId: string;
48
+ name: string;
49
+ requireEnrichments: boolean;
49
50
  } | {
50
- __isRef: boolean;
51
- blockId: string;
52
- name: string;
53
- requireEnrichments?: undefined;
51
+ __isRef: boolean;
52
+ blockId: string;
53
+ name: string;
54
+ requireEnrichments?: undefined;
54
55
  };
55
56
  /**
56
57
  * Creates a new PlRef based on an existing one, explicitly setting (default) or removing the
@@ -61,7 +62,9 @@ export declare function createPlRef(blockId: string, name: string, requireEnrich
61
62
  * to the returned PlRef. If false, the `requireEnrichments` property is removed. Defaults to true.
62
63
  * @returns A new PlRef object with the `requireEnrichments` property set or removed accordingly.
63
64
  */
64
- export declare function withEnrichments(ref: PlRef, requireEnrichments?: boolean): PlRef;
65
+ declare function withEnrichments(ref: PlRef, requireEnrichments?: boolean): PlRef;
65
66
  /** Compare two PlRefs and returns true if they are qual */
66
- export declare function plRefsEqual(ref1: PlRef, ref2: PlRef, ignoreEnrichments?: boolean): boolean;
67
+ declare function plRefsEqual(ref1: PlRef, ref2: PlRef, ignoreEnrichments?: boolean): boolean;
68
+ //#endregion
69
+ export { Option, PlRef, Ref, createPlRef, isPlRef, plRefsEqual, withEnrichments };
67
70
  //# sourceMappingURL=ref.d.ts.map
package/dist/ref.js CHANGED
@@ -1,84 +1,65 @@
1
- import { z } from 'zod';
1
+ import { z } from "zod";
2
2
 
3
- const PlRef = z
4
- .object({
5
- __isRef: z
6
- .literal(true)
7
- .describe("Crucial marker for the block dependency tree reconstruction"),
8
- blockId: z.string().describe("Upstream block id"),
9
- name: z.string().describe("Name of the output provided to the upstream block's output context"),
10
- requireEnrichments: z
11
- .literal(true)
12
- .optional()
13
- .describe("True if current block that stores this reference in its args, may need enrichments " +
14
- "for the references value originating from the blocks in between current and referenced block"),
15
- })
16
- .describe("Universal reference type, allowing to set block connections. It is crucial that " +
17
- "{@link __isRef} is present and equal to true, internal logic relies on this marker " +
18
- "to build block dependency trees.")
19
- .readonly();
3
+ //#region src/ref.ts
4
+ const PlRef = z.object({
5
+ __isRef: z.literal(true).describe("Crucial marker for the block dependency tree reconstruction"),
6
+ blockId: z.string().describe("Upstream block id"),
7
+ name: z.string().describe("Name of the output provided to the upstream block's output context"),
8
+ requireEnrichments: z.literal(true).optional().describe("True if current block that stores this reference in its args, may need enrichments for the references value originating from the blocks in between current and referenced block")
9
+ }).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").readonly();
20
10
  /**
21
- * Type guard to check if a value is a PlRef.
22
- *
23
- * @param value - The value to check.
24
- * @returns True if the value is a PlRef, false otherwise.
25
- */
11
+ * Type guard to check if a value is a PlRef.
12
+ *
13
+ * @param value - The value to check.
14
+ * @returns True if the value is a PlRef, false otherwise.
15
+ */
26
16
  function isPlRef(value) {
27
- return (typeof value === "object" &&
28
- value !== null &&
29
- "__isRef" in value &&
30
- value.__isRef === true &&
31
- "blockId" in value &&
32
- "name" in value);
17
+ return typeof value === "object" && value !== null && "__isRef" in value && value.__isRef === true && "blockId" in value && "name" in value;
33
18
  }
34
19
  /**
35
- * Creates a PlRef with the given blockId and name.
36
- *
37
- * @param blockId - The blockId of the reference.
38
- * @param name - The name of the reference.
39
- * @param requireEnrichments - Whether the reference requires enrichments.
40
- */
20
+ * Creates a PlRef with the given blockId and name.
21
+ *
22
+ * @param blockId - The blockId of the reference.
23
+ * @param name - The name of the reference.
24
+ * @param requireEnrichments - Whether the reference requires enrichments.
25
+ */
41
26
  function createPlRef(blockId, name, requireEnrichments = false) {
42
- if (requireEnrichments)
43
- return {
44
- __isRef: true,
45
- blockId,
46
- name,
47
- requireEnrichments: true,
48
- };
49
- else
50
- return {
51
- __isRef: true,
52
- blockId,
53
- name,
54
- };
27
+ if (requireEnrichments) return {
28
+ __isRef: true,
29
+ blockId,
30
+ name,
31
+ requireEnrichments: true
32
+ };
33
+ else return {
34
+ __isRef: true,
35
+ blockId,
36
+ name
37
+ };
55
38
  }
56
39
  /**
57
- * Creates a new PlRef based on an existing one, explicitly setting (default) or removing the
58
- * requireEnrichments property.
59
- *
60
- * @param ref - The original PlRef object.
61
- * @param requireEnrichments - If true, the `requireEnrichments: true` property is added
62
- * to the returned PlRef. If false, the `requireEnrichments` property is removed. Defaults to true.
63
- * @returns A new PlRef object with the `requireEnrichments` property set or removed accordingly.
64
- */
40
+ * Creates a new PlRef based on an existing one, explicitly setting (default) or removing the
41
+ * requireEnrichments property.
42
+ *
43
+ * @param ref - The original PlRef object.
44
+ * @param requireEnrichments - If true, the `requireEnrichments: true` property is added
45
+ * to the returned PlRef. If false, the `requireEnrichments` property is removed. Defaults to true.
46
+ * @returns A new PlRef object with the `requireEnrichments` property set or removed accordingly.
47
+ */
65
48
  function withEnrichments(ref, requireEnrichments = true) {
66
- if (requireEnrichments)
67
- return {
68
- ...ref,
69
- requireEnrichments: true,
70
- };
71
- else {
72
- const { requireEnrichments: _, ...rest } = ref;
73
- return rest;
74
- }
49
+ if (requireEnrichments) return {
50
+ ...ref,
51
+ requireEnrichments: true
52
+ };
53
+ else {
54
+ const { requireEnrichments: _, ...rest } = ref;
55
+ return rest;
56
+ }
75
57
  }
76
58
  /** Compare two PlRefs and returns true if they are qual */
77
59
  function plRefsEqual(ref1, ref2, ignoreEnrichments = false) {
78
- return (ref1.blockId === ref2.blockId &&
79
- ref1.name === ref2.name &&
80
- (ignoreEnrichments || ref1.requireEnrichments === ref2.requireEnrichments));
60
+ return ref1.blockId === ref2.blockId && ref1.name === ref2.name && (ignoreEnrichments || ref1.requireEnrichments === ref2.requireEnrichments);
81
61
  }
82
62
 
63
+ //#endregion
83
64
  export { PlRef, createPlRef, isPlRef, plRefsEqual, withEnrichments };
84
- //# sourceMappingURL=ref.js.map
65
+ //# sourceMappingURL=ref.js.map
package/dist/ref.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ref.js","sources":["../src/ref.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const PlRef = z\n .object({\n __isRef: z\n .literal(true)\n .describe(\"Crucial marker for the block dependency tree reconstruction\"),\n blockId: z.string().describe(\"Upstream block id\"),\n name: z.string().describe(\"Name of the output provided to the upstream block's output context\"),\n requireEnrichments: z\n .literal(true)\n .optional()\n .describe(\n \"True if current block that stores this reference in its args, may need enrichments \" +\n \"for the references value originating from the blocks in between current and referenced block\",\n ),\n })\n .describe(\n \"Universal reference type, allowing to set block connections. It is crucial that \" +\n \"{@link __isRef} is present and equal to true, internal logic relies on this marker \" +\n \"to build block dependency trees.\",\n )\n .readonly();\nexport type PlRef = z.infer<typeof PlRef>;\n/** @deprecated use {@link PlRef} */\nexport type Ref = PlRef;\n\n/**\n * Type guard to check if a value is a PlRef.\n *\n * @param value - The value to check.\n * @returns True if the value is a PlRef, false otherwise.\n */\nexport function isPlRef(value: unknown): value is PlRef {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"__isRef\" in value &&\n (value as { __isRef: unknown }).__isRef === true &&\n \"blockId\" in value &&\n \"name\" in value\n );\n}\n\n/** Standard way how to communicate possible connections given specific\n * requirements for incoming data. */\nexport type Option = {\n /** Fully rendered reference to be assigned for the intended field in block's\n * args */\n readonly ref: PlRef;\n\n /** Label to be present for the user in i.e. drop-down list */\n readonly label: string;\n};\n\n/**\n * Creates a PlRef with the given blockId and name.\n *\n * @param blockId - The blockId of the reference.\n * @param name - The name of the reference.\n * @param requireEnrichments - Whether the reference requires enrichments.\n */\nexport function createPlRef(blockId: string, name: string, requireEnrichments: boolean = false) {\n if (requireEnrichments)\n return {\n __isRef: true,\n blockId,\n name,\n requireEnrichments: true,\n };\n else\n return {\n __isRef: true,\n blockId,\n name,\n };\n}\n\n/**\n * Creates a new PlRef based on an existing one, explicitly setting (default) or removing the\n * requireEnrichments property.\n *\n * @param ref - The original PlRef object.\n * @param requireEnrichments - If true, the `requireEnrichments: true` property is added\n * to the returned PlRef. If false, the `requireEnrichments` property is removed. Defaults to true.\n * @returns A new PlRef object with the `requireEnrichments` property set or removed accordingly.\n */\nexport function withEnrichments(ref: PlRef, requireEnrichments: boolean = true): PlRef {\n if (requireEnrichments)\n return {\n ...ref,\n requireEnrichments: true,\n };\n else {\n const { requireEnrichments: _, ...rest } = ref;\n return rest;\n }\n}\n\n/** Compare two PlRefs and returns true if they are qual */\nexport function plRefsEqual(ref1: PlRef, ref2: PlRef, ignoreEnrichments: boolean = false) {\n return (\n ref1.blockId === ref2.blockId &&\n ref1.name === ref2.name &&\n (ignoreEnrichments || ref1.requireEnrichments === ref2.requireEnrichments)\n );\n}\n"],"names":[],"mappings":";;AAEO,MAAM,KAAK,GAAG;AAClB,KAAA,MAAM,CAAC;AACN,IAAA,OAAO,EAAE;SACN,OAAO,CAAC,IAAI;SACZ,QAAQ,CAAC,6DAA6D,CAAC;IAC1E,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IACjD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oEAAoE,CAAC;AAC/F,IAAA,kBAAkB,EAAE;SACjB,OAAO,CAAC,IAAI;AACZ,SAAA,QAAQ;AACR,SAAA,QAAQ,CACP,qFAAqF;AACnF,QAAA,8FAA8F,CACjG;CACJ;AACA,KAAA,QAAQ,CACP,kFAAkF;IAChF,qFAAqF;AACrF,IAAA,kCAAkC;AAErC,KAAA,QAAQ;AAKX;;;;;AAKG;AACG,SAAU,OAAO,CAAC,KAAc,EAAA;AACpC,IAAA,QACE,OAAO,KAAK,KAAK,QAAQ;AACzB,QAAA,KAAK,KAAK,IAAI;AACd,QAAA,SAAS,IAAI,KAAK;QACjB,KAA8B,CAAC,OAAO,KAAK,IAAI;AAChD,QAAA,SAAS,IAAI,KAAK;QAClB,MAAM,IAAI,KAAK;AAEnB;AAaA;;;;;;AAMG;AACG,SAAU,WAAW,CAAC,OAAe,EAAE,IAAY,EAAE,qBAA8B,KAAK,EAAA;AAC5F,IAAA,IAAI,kBAAkB;QACpB,OAAO;AACL,YAAA,OAAO,EAAE,IAAI;YACb,OAAO;YACP,IAAI;AACJ,YAAA,kBAAkB,EAAE,IAAI;SACzB;;QAED,OAAO;AACL,YAAA,OAAO,EAAE,IAAI;YACb,OAAO;YACP,IAAI;SACL;AACL;AAEA;;;;;;;;AAQG;SACa,eAAe,CAAC,GAAU,EAAE,qBAA8B,IAAI,EAAA;AAC5E,IAAA,IAAI,kBAAkB;QACpB,OAAO;AACL,YAAA,GAAG,GAAG;AACN,YAAA,kBAAkB,EAAE,IAAI;SACzB;SACE;QACH,MAAM,EAAE,kBAAkB,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,GAAG;AAC9C,QAAA,OAAO,IAAI;IACb;AACF;AAEA;AACM,SAAU,WAAW,CAAC,IAAW,EAAE,IAAW,EAAE,oBAA6B,KAAK,EAAA;AACtF,IAAA,QACE,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,OAAO;AAC7B,QAAA,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI;SACtB,iBAAiB,IAAI,IAAI,CAAC,kBAAkB,KAAK,IAAI,CAAC,kBAAkB,CAAC;AAE9E;;;;"}
1
+ {"version":3,"file":"ref.js","names":[],"sources":["../src/ref.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const PlRef = z\n .object({\n __isRef: z\n .literal(true)\n .describe(\"Crucial marker for the block dependency tree reconstruction\"),\n blockId: z.string().describe(\"Upstream block id\"),\n name: z.string().describe(\"Name of the output provided to the upstream block's output context\"),\n requireEnrichments: z\n .literal(true)\n .optional()\n .describe(\n \"True if current block that stores this reference in its args, may need enrichments \" +\n \"for the references value originating from the blocks in between current and referenced block\",\n ),\n })\n .describe(\n \"Universal reference type, allowing to set block connections. It is crucial that \" +\n \"{@link __isRef} is present and equal to true, internal logic relies on this marker \" +\n \"to build block dependency trees.\",\n )\n .readonly();\nexport type PlRef = z.infer<typeof PlRef>;\n/** @deprecated use {@link PlRef} */\nexport type Ref = PlRef;\n\n/**\n * Type guard to check if a value is a PlRef.\n *\n * @param value - The value to check.\n * @returns True if the value is a PlRef, false otherwise.\n */\nexport function isPlRef(value: unknown): value is PlRef {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"__isRef\" in value &&\n (value as { __isRef: unknown }).__isRef === true &&\n \"blockId\" in value &&\n \"name\" in value\n );\n}\n\n/** Standard way how to communicate possible connections given specific\n * requirements for incoming data. */\nexport type Option = {\n /** Fully rendered reference to be assigned for the intended field in block's\n * args */\n readonly ref: PlRef;\n\n /** Label to be present for the user in i.e. drop-down list */\n readonly label: string;\n};\n\n/**\n * Creates a PlRef with the given blockId and name.\n *\n * @param blockId - The blockId of the reference.\n * @param name - The name of the reference.\n * @param requireEnrichments - Whether the reference requires enrichments.\n */\nexport function createPlRef(blockId: string, name: string, requireEnrichments: boolean = false) {\n if (requireEnrichments)\n return {\n __isRef: true,\n blockId,\n name,\n requireEnrichments: true,\n };\n else\n return {\n __isRef: true,\n blockId,\n name,\n };\n}\n\n/**\n * Creates a new PlRef based on an existing one, explicitly setting (default) or removing the\n * requireEnrichments property.\n *\n * @param ref - The original PlRef object.\n * @param requireEnrichments - If true, the `requireEnrichments: true` property is added\n * to the returned PlRef. If false, the `requireEnrichments` property is removed. Defaults to true.\n * @returns A new PlRef object with the `requireEnrichments` property set or removed accordingly.\n */\nexport function withEnrichments(ref: PlRef, requireEnrichments: boolean = true): PlRef {\n if (requireEnrichments)\n return {\n ...ref,\n requireEnrichments: true,\n };\n else {\n const { requireEnrichments: _, ...rest } = ref;\n return rest;\n }\n}\n\n/** Compare two PlRefs and returns true if they are qual */\nexport function plRefsEqual(ref1: PlRef, ref2: PlRef, ignoreEnrichments: boolean = false) {\n return (\n ref1.blockId === ref2.blockId &&\n ref1.name === ref2.name &&\n (ignoreEnrichments || ref1.requireEnrichments === ref2.requireEnrichments)\n );\n}\n"],"mappings":";;;AAEA,MAAa,QAAQ,EAClB,OAAO;CACN,SAAS,EACN,QAAQ,KAAK,CACb,SAAS,8DAA8D;CAC1E,SAAS,EAAE,QAAQ,CAAC,SAAS,oBAAoB;CACjD,MAAM,EAAE,QAAQ,CAAC,SAAS,qEAAqE;CAC/F,oBAAoB,EACjB,QAAQ,KAAK,CACb,UAAU,CACV,SACC,kLAED;CACJ,CAAC,CACD,SACC,sMAGD,CACA,UAAU;;;;;;;AAWb,SAAgB,QAAQ,OAAgC;AACtD,QACE,OAAO,UAAU,YACjB,UAAU,QACV,aAAa,SACZ,MAA+B,YAAY,QAC5C,aAAa,SACb,UAAU;;;;;;;;;AAsBd,SAAgB,YAAY,SAAiB,MAAc,qBAA8B,OAAO;AAC9F,KAAI,mBACF,QAAO;EACL,SAAS;EACT;EACA;EACA,oBAAoB;EACrB;KAED,QAAO;EACL,SAAS;EACT;EACA;EACD;;;;;;;;;;;AAYL,SAAgB,gBAAgB,KAAY,qBAA8B,MAAa;AACrF,KAAI,mBACF,QAAO;EACL,GAAG;EACH,oBAAoB;EACrB;MACE;EACH,MAAM,EAAE,oBAAoB,GAAG,GAAG,SAAS;AAC3C,SAAO;;;;AAKX,SAAgB,YAAY,MAAa,MAAa,oBAA6B,OAAO;AACxF,QACE,KAAK,YAAY,KAAK,WACtB,KAAK,SAAS,KAAK,SAClB,qBAAqB,KAAK,uBAAuB,KAAK"}
package/dist/utag.d.ts CHANGED
@@ -1,18 +1,22 @@
1
- import type { AuthorMarker } from "./author_marker";
1
+ import { AuthorMarker } from "./author_marker.js";
2
+
3
+ //#region src/utag.d.ts
2
4
  /** Value returned for changing states supporting reactive listening for changes */
3
- export interface ValueWithUTag<V> {
4
- /** Value snapshot. */
5
- readonly value: V;
6
- /**
7
- * Unique tag for the value snapshot.
8
- *
9
- * It can be used to synchronously detect if changes happened after current
10
- * snapshot was retrieved, or asynchronously await next value snapshot,
11
- * generated on underlying data changes.
12
- * */
13
- readonly uTag: string;
5
+ interface ValueWithUTag<V> {
6
+ /** Value snapshot. */
7
+ readonly value: V;
8
+ /**
9
+ * Unique tag for the value snapshot.
10
+ *
11
+ * It can be used to synchronously detect if changes happened after current
12
+ * snapshot was retrieved, or asynchronously await next value snapshot,
13
+ * generated on underlying data changes.
14
+ * */
15
+ readonly uTag: string;
14
16
  }
15
- export interface ValueWithUTagAndAuthor<V> extends ValueWithUTag<V> {
16
- readonly author?: AuthorMarker;
17
+ interface ValueWithUTagAndAuthor<V> extends ValueWithUTag<V> {
18
+ readonly author?: AuthorMarker;
17
19
  }
20
+ //#endregion
21
+ export { ValueWithUTag, ValueWithUTagAndAuthor };
18
22
  //# sourceMappingURL=utag.d.ts.map
package/dist/util.cjs CHANGED
@@ -1,16 +1,17 @@
1
- 'use strict';
2
1
 
2
+ //#region src/util.ts
3
3
  function assertNever(x) {
4
- throw new Error("Unexpected object: " + x); // This is ok, because this is a possible runtime error
4
+ throw new Error("Unexpected object: " + x);
5
5
  }
6
6
  /**
7
- * Return unique entries of the array by the provided id
8
- * For each id, the last entry is kept
9
- */
7
+ * Return unique entries of the array by the provided id
8
+ * For each id, the last entry is kept
9
+ */
10
10
  function uniqueBy(array, makeId) {
11
- return [...new Map(array.map((e) => [makeId(e), e])).values()];
11
+ return [...new Map(array.map((e) => [makeId(e), e])).values()];
12
12
  }
13
13
 
14
+ //#endregion
14
15
  exports.assertNever = assertNever;
15
16
  exports.uniqueBy = uniqueBy;
16
- //# sourceMappingURL=util.cjs.map
17
+ //# sourceMappingURL=util.cjs.map
package/dist/util.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"util.cjs","sources":["../src/util.ts"],"sourcesContent":["export function assertNever(x: never): never {\n throw new Error(\"Unexpected object: \" + x); // This is ok, because this is a possible runtime error\n}\n\n/**\n * Return unique entries of the array by the provided id\n * For each id, the last entry is kept\n */\nexport function uniqueBy<T>(array: T[], makeId: (entry: T) => string): T[] {\n return [...new Map(array.map((e) => [makeId(e), e])).values()];\n}\n"],"names":[],"mappings":";;AAAM,SAAU,WAAW,CAAC,CAAQ,EAAA;IAClC,MAAM,IAAI,KAAK,CAAC,qBAAqB,GAAG,CAAC,CAAC,CAAC;AAC7C;AAEA;;;AAGG;AACG,SAAU,QAAQ,CAAI,KAAU,EAAE,MAA4B,EAAA;AAClE,IAAA,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;AAChE;;;;;"}
1
+ {"version":3,"file":"util.cjs","names":[],"sources":["../src/util.ts"],"sourcesContent":["export function assertNever(x: never): never {\n throw new Error(\"Unexpected object: \" + x); // This is ok, because this is a possible runtime error\n}\n\n/**\n * Return unique entries of the array by the provided id\n * For each id, the last entry is kept\n */\nexport function uniqueBy<T>(array: T[], makeId: (entry: T) => string): T[] {\n return [...new Map(array.map((e) => [makeId(e), e])).values()];\n}\n"],"mappings":";;AAAA,SAAgB,YAAY,GAAiB;AAC3C,OAAM,IAAI,MAAM,wBAAwB,EAAE;;;;;;AAO5C,SAAgB,SAAY,OAAY,QAAmC;AACzE,QAAO,CAAC,GAAG,IAAI,IAAI,MAAM,KAAK,MAAM,CAAC,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC"}
package/dist/util.d.ts CHANGED
@@ -1,7 +1,10 @@
1
- export declare function assertNever(x: never): never;
1
+ //#region src/util.d.ts
2
+ declare function assertNever(x: never): never;
2
3
  /**
3
4
  * Return unique entries of the array by the provided id
4
5
  * For each id, the last entry is kept
5
6
  */
6
- export declare function uniqueBy<T>(array: T[], makeId: (entry: T) => string): T[];
7
+ declare function uniqueBy<T>(array: T[], makeId: (entry: T) => string): T[];
8
+ //#endregion
9
+ export { assertNever, uniqueBy };
7
10
  //# sourceMappingURL=util.d.ts.map
package/dist/util.js CHANGED
@@ -1,13 +1,15 @@
1
+ //#region src/util.ts
1
2
  function assertNever(x) {
2
- throw new Error("Unexpected object: " + x); // This is ok, because this is a possible runtime error
3
+ throw new Error("Unexpected object: " + x);
3
4
  }
4
5
  /**
5
- * Return unique entries of the array by the provided id
6
- * For each id, the last entry is kept
7
- */
6
+ * Return unique entries of the array by the provided id
7
+ * For each id, the last entry is kept
8
+ */
8
9
  function uniqueBy(array, makeId) {
9
- return [...new Map(array.map((e) => [makeId(e), e])).values()];
10
+ return [...new Map(array.map((e) => [makeId(e), e])).values()];
10
11
  }
11
12
 
13
+ //#endregion
12
14
  export { assertNever, uniqueBy };
13
- //# sourceMappingURL=util.js.map
15
+ //# sourceMappingURL=util.js.map
package/dist/util.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sources":["../src/util.ts"],"sourcesContent":["export function assertNever(x: never): never {\n throw new Error(\"Unexpected object: \" + x); // This is ok, because this is a possible runtime error\n}\n\n/**\n * Return unique entries of the array by the provided id\n * For each id, the last entry is kept\n */\nexport function uniqueBy<T>(array: T[], makeId: (entry: T) => string): T[] {\n return [...new Map(array.map((e) => [makeId(e), e])).values()];\n}\n"],"names":[],"mappings":"AAAM,SAAU,WAAW,CAAC,CAAQ,EAAA;IAClC,MAAM,IAAI,KAAK,CAAC,qBAAqB,GAAG,CAAC,CAAC,CAAC;AAC7C;AAEA;;;AAGG;AACG,SAAU,QAAQ,CAAI,KAAU,EAAE,MAA4B,EAAA;AAClE,IAAA,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;AAChE;;;;"}
1
+ {"version":3,"file":"util.js","names":[],"sources":["../src/util.ts"],"sourcesContent":["export function assertNever(x: never): never {\n throw new Error(\"Unexpected object: \" + x); // This is ok, because this is a possible runtime error\n}\n\n/**\n * Return unique entries of the array by the provided id\n * For each id, the last entry is kept\n */\nexport function uniqueBy<T>(array: T[], makeId: (entry: T) => string): T[] {\n return [...new Map(array.map((e) => [makeId(e), e])).values()];\n}\n"],"mappings":";AAAA,SAAgB,YAAY,GAAiB;AAC3C,OAAM,IAAI,MAAM,wBAAwB,EAAE;;;;;;AAO5C,SAAgB,SAAY,OAAY,QAAmC;AACzE,QAAO,CAAC,GAAG,IAAI,IAAI,MAAM,KAAK,MAAM,CAAC,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC"}
@@ -1,8 +1,12 @@
1
- 'use strict';
2
1
 
2
+ //#region src/value_or_error.ts
3
3
  function mapValueInVOE(voe, cb) {
4
- return voe.ok ? { ok: true, value: cb(voe.value) } : voe;
4
+ return voe.ok ? {
5
+ ok: true,
6
+ value: cb(voe.value)
7
+ } : voe;
5
8
  }
6
9
 
10
+ //#endregion
7
11
  exports.mapValueInVOE = mapValueInVOE;
8
- //# sourceMappingURL=value_or_error.cjs.map
12
+ //# sourceMappingURL=value_or_error.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"value_or_error.cjs","sources":["../src/value_or_error.ts"],"sourcesContent":["export type ValueOrError<V, E> =\n | {\n ok: true;\n value: V;\n }\n | {\n ok: false;\n error: E;\n };\n\nexport function mapValueInVOE<V1, V2, E>(\n voe: ValueOrError<V1, E>,\n cb: (value: V1) => V2,\n): ValueOrError<V2, E> {\n return voe.ok ? { ok: true, value: cb(voe.value) } : voe;\n}\n"],"names":[],"mappings":";;AAUM,SAAU,aAAa,CAC3B,GAAwB,EACxB,EAAqB,EAAA;IAErB,OAAO,GAAG,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,GAAG,GAAG;AAC1D;;;;"}
1
+ {"version":3,"file":"value_or_error.cjs","names":[],"sources":["../src/value_or_error.ts"],"sourcesContent":["export type ValueOrError<V, E> =\n | {\n ok: true;\n value: V;\n }\n | {\n ok: false;\n error: E;\n };\n\nexport function mapValueInVOE<V1, V2, E>(\n voe: ValueOrError<V1, E>,\n cb: (value: V1) => V2,\n): ValueOrError<V2, E> {\n return voe.ok ? { ok: true, value: cb(voe.value) } : voe;\n}\n"],"mappings":";;AAUA,SAAgB,cACd,KACA,IACqB;AACrB,QAAO,IAAI,KAAK;EAAE,IAAI;EAAM,OAAO,GAAG,IAAI,MAAM;EAAE,GAAG"}