@ibgib/core-gib 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (330) hide show
  1. package/.vscode/core-gib-snippets.code-snippets +189 -0
  2. package/.vscode/launch.json +24 -0
  3. package/.vscode/settings.json +56 -0
  4. package/.vscode/tasks.json +37 -0
  5. package/CHANGELOG.md +11 -0
  6. package/README.md +215 -0
  7. package/dist/common/aws-constants.d.mts +7 -0
  8. package/dist/common/aws-constants.d.mts.map +1 -0
  9. package/dist/common/aws-constants.mjs +7 -0
  10. package/dist/common/aws-constants.mjs.map +1 -0
  11. package/dist/common/bin/bin-types.d.mts +17 -0
  12. package/dist/common/bin/bin-types.d.mts.map +1 -0
  13. package/dist/common/bin/bin-types.mjs +3 -0
  14. package/dist/common/bin/bin-types.mjs.map +1 -0
  15. package/dist/common/cache/cache-types.d.mts +57 -0
  16. package/dist/common/cache/cache-types.d.mts.map +1 -0
  17. package/dist/common/cache/cache-types.mjs +2 -0
  18. package/dist/common/cache/cache-types.mjs.map +1 -0
  19. package/dist/common/comment/comment-constants.d.mts +11 -0
  20. package/dist/common/comment/comment-constants.d.mts.map +1 -0
  21. package/dist/common/comment/comment-constants.mjs +11 -0
  22. package/dist/common/comment/comment-constants.mjs.map +1 -0
  23. package/dist/common/comment/comment-helper.d.mts +59 -0
  24. package/dist/common/comment/comment-helper.d.mts.map +1 -0
  25. package/dist/common/comment/comment-helper.mjs +173 -0
  26. package/dist/common/comment/comment-helper.mjs.map +1 -0
  27. package/dist/common/comment/comment-types.d.mts +16 -0
  28. package/dist/common/comment/comment-types.d.mts.map +1 -0
  29. package/dist/common/comment/comment-types.mjs +2 -0
  30. package/dist/common/comment/comment-types.mjs.map +1 -0
  31. package/dist/common/display/display-helper.d.mts +19 -0
  32. package/dist/common/display/display-helper.d.mts.map +1 -0
  33. package/dist/common/display/display-helper.mjs +68 -0
  34. package/dist/common/display/display-helper.mjs.map +1 -0
  35. package/dist/common/display/display-types.d.mts +97 -0
  36. package/dist/common/display/display-types.d.mts.map +1 -0
  37. package/dist/common/display/display-types.mjs +37 -0
  38. package/dist/common/display/display-types.mjs.map +1 -0
  39. package/dist/common/encrypt/encrypt-constants.d.mts +27 -0
  40. package/dist/common/encrypt/encrypt-constants.d.mts.map +1 -0
  41. package/dist/common/encrypt/encrypt-constants.mjs +27 -0
  42. package/dist/common/encrypt/encrypt-constants.mjs.map +1 -0
  43. package/dist/common/encrypt/encrypt-types.d.mts +116 -0
  44. package/dist/common/encrypt/encrypt-types.d.mts.map +1 -0
  45. package/dist/common/encrypt/encrypt-types.mjs +9 -0
  46. package/dist/common/encrypt/encrypt-types.mjs.map +1 -0
  47. package/dist/common/error/error-constants.d.mts +9 -0
  48. package/dist/common/error/error-constants.d.mts.map +1 -0
  49. package/dist/common/error/error-constants.mjs +9 -0
  50. package/dist/common/error/error-constants.mjs.map +1 -0
  51. package/dist/common/error/error-helper.d.mts +43 -0
  52. package/dist/common/error/error-helper.d.mts.map +1 -0
  53. package/dist/common/error/error-helper.mjs +167 -0
  54. package/dist/common/error/error-helper.mjs.map +1 -0
  55. package/dist/common/error/error-types.d.mts +58 -0
  56. package/dist/common/error/error-types.d.mts.map +1 -0
  57. package/dist/common/error/error-types.mjs +2 -0
  58. package/dist/common/error/error-types.mjs.map +1 -0
  59. package/dist/common/form/form-helper.d.mts +97 -0
  60. package/dist/common/form/form-helper.d.mts.map +1 -0
  61. package/dist/common/form/form-helper.mjs +185 -0
  62. package/dist/common/form/form-helper.mjs.map +1 -0
  63. package/dist/common/form/form-items.d.mts +229 -0
  64. package/dist/common/form/form-items.d.mts.map +1 -0
  65. package/dist/common/form/form-items.mjs +63 -0
  66. package/dist/common/form/form-items.mjs.map +1 -0
  67. package/dist/common/import-export/import-export-types.d.mts +18 -0
  68. package/dist/common/import-export/import-export-types.d.mts.map +1 -0
  69. package/dist/common/import-export/import-export-types.mjs +2 -0
  70. package/dist/common/import-export/import-export-types.mjs.map +1 -0
  71. package/dist/common/legacy/legacy-types.d.mts +2 -0
  72. package/dist/common/legacy/legacy-types.d.mts.map +1 -0
  73. package/dist/common/legacy/legacy-types.mjs +2 -0
  74. package/dist/common/legacy/legacy-types.mjs.map +1 -0
  75. package/dist/common/link/link-constants.d.mts +2 -0
  76. package/dist/common/link/link-constants.d.mts.map +1 -0
  77. package/dist/common/link/link-constants.mjs +2 -0
  78. package/dist/common/link/link-constants.mjs.map +1 -0
  79. package/dist/common/link/link-helper.d.mts +37 -0
  80. package/dist/common/link/link-helper.d.mts.map +1 -0
  81. package/dist/common/link/link-helper.mjs +143 -0
  82. package/dist/common/link/link-helper.mjs.map +1 -0
  83. package/dist/common/link/link-types.d.mts +14 -0
  84. package/dist/common/link/link-types.d.mts.map +1 -0
  85. package/dist/common/link/link-types.mjs +2 -0
  86. package/dist/common/link/link-types.mjs.map +1 -0
  87. package/dist/common/other/graph-helper.d.mts +166 -0
  88. package/dist/common/other/graph-helper.d.mts.map +1 -0
  89. package/dist/common/other/graph-helper.mjs +710 -0
  90. package/dist/common/other/graph-helper.mjs.map +1 -0
  91. package/dist/common/other/ibgib-helper.d.mts +245 -0
  92. package/dist/common/other/ibgib-helper.d.mts.map +1 -0
  93. package/dist/common/other/ibgib-helper.mjs +641 -0
  94. package/dist/common/other/ibgib-helper.mjs.map +1 -0
  95. package/dist/common/other/other-constants.d.mts +53 -0
  96. package/dist/common/other/other-constants.d.mts.map +1 -0
  97. package/dist/common/other/other-constants.mjs +67 -0
  98. package/dist/common/other/other-constants.mjs.map +1 -0
  99. package/dist/common/other/other-types.d.mts +166 -0
  100. package/dist/common/other/other-types.d.mts.map +1 -0
  101. package/dist/common/other/other-types.mjs +30 -0
  102. package/dist/common/other/other-types.mjs.map +1 -0
  103. package/dist/common/other/svg-constants.d.mts +2 -0
  104. package/dist/common/other/svg-constants.d.mts.map +1 -0
  105. package/dist/common/other/svg-constants.mjs +2 -0
  106. package/dist/common/other/svg-constants.mjs.map +1 -0
  107. package/dist/common/other/svg-helper.d.mts +54 -0
  108. package/dist/common/other/svg-helper.d.mts.map +1 -0
  109. package/dist/common/other/svg-helper.mjs +170 -0
  110. package/dist/common/other/svg-helper.mjs.map +1 -0
  111. package/dist/common/pic/pic-constants.d.mts +13 -0
  112. package/dist/common/pic/pic-constants.d.mts.map +1 -0
  113. package/dist/common/pic/pic-constants.mjs +13 -0
  114. package/dist/common/pic/pic-constants.mjs.map +1 -0
  115. package/dist/common/pic/pic-helper.d.mts +70 -0
  116. package/dist/common/pic/pic-helper.d.mts.map +1 -0
  117. package/dist/common/pic/pic-helper.mjs +235 -0
  118. package/dist/common/pic/pic-helper.mjs.map +1 -0
  119. package/dist/common/pic/pic-types.d.mts +23 -0
  120. package/dist/common/pic/pic-types.d.mts.map +1 -0
  121. package/dist/common/pic/pic-types.mjs +2 -0
  122. package/dist/common/pic/pic-types.mjs.map +1 -0
  123. package/dist/common/root/root-constants.d.mts +40 -0
  124. package/dist/common/root/root-constants.d.mts.map +1 -0
  125. package/dist/common/root/root-constants.mjs +40 -0
  126. package/dist/common/root/root-constants.mjs.map +1 -0
  127. package/dist/common/root/root-types.d.mts +9 -0
  128. package/dist/common/root/root-types.d.mts.map +1 -0
  129. package/dist/common/root/root-types.mjs +2 -0
  130. package/dist/common/root/root-types.mjs.map +1 -0
  131. package/dist/common/tag/tag-constants.d.mts +21 -0
  132. package/dist/common/tag/tag-constants.d.mts.map +1 -0
  133. package/dist/common/tag/tag-constants.mjs +28 -0
  134. package/dist/common/tag/tag-constants.mjs.map +1 -0
  135. package/dist/common/tag/tag-types.d.mts +14 -0
  136. package/dist/common/tag/tag-types.d.mts.map +1 -0
  137. package/dist/common/tag/tag-types.mjs +2 -0
  138. package/dist/common/tag/tag-types.mjs.map +1 -0
  139. package/dist/core-constants.d.mts +89 -0
  140. package/dist/core-constants.d.mts.map +1 -0
  141. package/dist/core-constants.mjs +484 -0
  142. package/dist/core-constants.mjs.map +1 -0
  143. package/dist/core-helper.d.mts +6 -0
  144. package/dist/core-helper.d.mts.map +1 -0
  145. package/dist/core-helper.mjs +28 -0
  146. package/dist/core-helper.mjs.map +1 -0
  147. package/dist/core-types.d.mts +520 -0
  148. package/dist/core-types.d.mts.map +1 -0
  149. package/dist/core-types.mjs +2 -0
  150. package/dist/core-types.mjs.map +1 -0
  151. package/dist/index.d.mts +2 -0
  152. package/dist/index.d.mts.map +1 -0
  153. package/dist/index.mjs +3 -0
  154. package/dist/index.mjs.map +1 -0
  155. package/dist/witness/app/app-base-v1.d.mts +130 -0
  156. package/dist/witness/app/app-base-v1.d.mts.map +1 -0
  157. package/dist/witness/app/app-base-v1.mjs +462 -0
  158. package/dist/witness/app/app-base-v1.mjs.map +1 -0
  159. package/dist/witness/app/app-constants.d.mts +10 -0
  160. package/dist/witness/app/app-constants.d.mts.map +1 -0
  161. package/dist/witness/app/app-constants.mjs +13 -0
  162. package/dist/witness/app/app-constants.mjs.map +1 -0
  163. package/dist/witness/app/app-helper.d.mts +85 -0
  164. package/dist/witness/app/app-helper.d.mts.map +1 -0
  165. package/dist/witness/app/app-helper.mjs +258 -0
  166. package/dist/witness/app/app-helper.mjs.map +1 -0
  167. package/dist/witness/app/app-types.d.mts +211 -0
  168. package/dist/witness/app/app-types.d.mts.map +1 -0
  169. package/dist/witness/app/app-types.mjs +49 -0
  170. package/dist/witness/app/app-types.mjs.map +1 -0
  171. package/dist/witness/app/chat-app/chat-app-types.d.mts +18 -0
  172. package/dist/witness/app/chat-app/chat-app-types.d.mts.map +1 -0
  173. package/dist/witness/app/chat-app/chat-app-types.mjs +25 -0
  174. package/dist/witness/app/chat-app/chat-app-types.mjs.map +1 -0
  175. package/dist/witness/app/flash-app/flash-app-types.d.mts +16 -0
  176. package/dist/witness/app/flash-app/flash-app-types.d.mts.map +1 -0
  177. package/dist/witness/app/flash-app/flash-app-types.mjs +23 -0
  178. package/dist/witness/app/flash-app/flash-app-types.mjs.map +1 -0
  179. package/dist/witness/app/raw-app/raw-app-types.d.mts +18 -0
  180. package/dist/witness/app/raw-app/raw-app-types.d.mts.map +1 -0
  181. package/dist/witness/app/raw-app/raw-app-types.mjs +25 -0
  182. package/dist/witness/app/raw-app/raw-app-types.mjs.map +1 -0
  183. package/dist/witness/app/todo-app/todo-app-types.d.ts +33 -0
  184. package/dist/witness/app/todo-app/todo-app-types.d.ts.map +1 -0
  185. package/dist/witness/app/todo-app/todo-app-types.js +31 -0
  186. package/dist/witness/app/todo-app/todo-app-types.js.map +1 -0
  187. package/dist/witness/robbot/robbot-base-v1.d.ts +432 -0
  188. package/dist/witness/robbot/robbot-base-v1.d.ts.map +1 -0
  189. package/dist/witness/robbot/robbot-base-v1.js +1407 -0
  190. package/dist/witness/robbot/robbot-base-v1.js.map +1 -0
  191. package/dist/witness/robbot/robbot-constants.d.mts +24 -0
  192. package/dist/witness/robbot/robbot-constants.d.mts.map +1 -0
  193. package/dist/witness/robbot/robbot-constants.mjs +24 -0
  194. package/dist/witness/robbot/robbot-constants.mjs.map +1 -0
  195. package/dist/witness/robbot/robbot-helper.d.mts +152 -0
  196. package/dist/witness/robbot/robbot-helper.d.mts.map +1 -0
  197. package/dist/witness/robbot/robbot-helper.mjs +609 -0
  198. package/dist/witness/robbot/robbot-helper.mjs.map +1 -0
  199. package/dist/witness/robbot/robbot-types.d.mts +539 -0
  200. package/dist/witness/robbot/robbot-types.d.mts.map +1 -0
  201. package/dist/witness/robbot/robbot-types.mjs +294 -0
  202. package/dist/witness/robbot/robbot-types.mjs.map +1 -0
  203. package/dist/witness/space/bootstrap/bootstrap-constants.d.mts +14 -0
  204. package/dist/witness/space/bootstrap/bootstrap-constants.d.mts.map +1 -0
  205. package/dist/witness/space/bootstrap/bootstrap-constants.mjs +15 -0
  206. package/dist/witness/space/bootstrap/bootstrap-constants.mjs.map +1 -0
  207. package/dist/witness/space/inner-space-v1.d.ts +63 -0
  208. package/dist/witness/space/inner-space-v1.d.ts.map +1 -0
  209. package/dist/witness/space/inner-space-v1.js +356 -0
  210. package/dist/witness/space/inner-space-v1.js.map +1 -0
  211. package/dist/witness/space/outer-space/outer-space-constants.d.mts +2 -0
  212. package/dist/witness/space/outer-space/outer-space-constants.d.mts.map +1 -0
  213. package/dist/witness/space/outer-space/outer-space-constants.mjs +2 -0
  214. package/dist/witness/space/outer-space/outer-space-constants.mjs.map +1 -0
  215. package/dist/witness/space/outer-space/outer-space-helper.d.mts +28 -0
  216. package/dist/witness/space/outer-space/outer-space-helper.d.mts.map +1 -0
  217. package/dist/witness/space/outer-space/outer-space-helper.mjs +87 -0
  218. package/dist/witness/space/outer-space/outer-space-helper.mjs.map +1 -0
  219. package/dist/witness/space/outer-space/outer-space-types.d.mts +548 -0
  220. package/dist/witness/space/outer-space/outer-space-types.d.mts.map +1 -0
  221. package/dist/witness/space/outer-space/outer-space-types.mjs +118 -0
  222. package/dist/witness/space/outer-space/outer-space-types.mjs.map +1 -0
  223. package/dist/witness/space/space-base-v1.d.mts +147 -0
  224. package/dist/witness/space/space-base-v1.d.mts.map +1 -0
  225. package/dist/witness/space/space-base-v1.mjs +350 -0
  226. package/dist/witness/space/space-base-v1.mjs.map +1 -0
  227. package/dist/witness/space/space-constants.d.mts +181 -0
  228. package/dist/witness/space/space-constants.d.mts.map +1 -0
  229. package/dist/witness/space/space-constants.mjs +192 -0
  230. package/dist/witness/space/space-constants.mjs.map +1 -0
  231. package/dist/witness/space/space-helper.d.mts +666 -0
  232. package/dist/witness/space/space-helper.d.mts.map +1 -0
  233. package/dist/witness/space/space-helper.mjs +2830 -0
  234. package/dist/witness/space/space-helper.mjs.map +1 -0
  235. package/dist/witness/space/space-types.d.mts +422 -0
  236. package/dist/witness/space/space-types.d.mts.map +1 -0
  237. package/dist/witness/space/space-types.mjs +52 -0
  238. package/dist/witness/space/space-types.mjs.map +1 -0
  239. package/dist/witness/witness-base-v1.d.ts +144 -0
  240. package/dist/witness/witness-base-v1.d.ts.map +1 -0
  241. package/dist/witness/witness-base-v1.js +300 -0
  242. package/dist/witness/witness-base-v1.js.map +1 -0
  243. package/dist/witness/witness-constants.d.mts +3 -0
  244. package/dist/witness/witness-constants.d.mts.map +1 -0
  245. package/dist/witness/witness-constants.mjs +3 -0
  246. package/dist/witness/witness-constants.mjs.map +1 -0
  247. package/dist/witness/witness-form-builder.d.mts +45 -0
  248. package/dist/witness/witness-form-builder.d.mts.map +1 -0
  249. package/dist/witness/witness-form-builder.mjs +95 -0
  250. package/dist/witness/witness-form-builder.mjs.map +1 -0
  251. package/dist/witness/witness-helper.d.mts +89 -0
  252. package/dist/witness/witness-helper.d.mts.map +1 -0
  253. package/dist/witness/witness-helper.mjs +229 -0
  254. package/dist/witness/witness-helper.mjs.map +1 -0
  255. package/dist/witness/witness-types.d.mts +211 -0
  256. package/dist/witness/witness-types.d.mts.map +1 -0
  257. package/dist/witness/witness-types.mjs +2 -0
  258. package/dist/witness/witness-types.mjs.map +1 -0
  259. package/jasmine-browser.json +18 -0
  260. package/jasmine.json +6 -0
  261. package/package.json +67 -0
  262. package/src/assumptions.spec.mts +45 -0
  263. package/src/common/aws-constants.mts +5 -0
  264. package/src/common/bin/bin-types.mts +17 -0
  265. package/src/common/cache/cache-types.mts +53 -0
  266. package/src/common/comment/comment-constants.mts +10 -0
  267. package/src/common/comment/comment-helper.mts +211 -0
  268. package/src/common/comment/comment-types.mts +19 -0
  269. package/src/common/display/display-helper.mts +88 -0
  270. package/src/common/display/display-types.mts +108 -0
  271. package/src/common/encrypt/encrypt-constants.mts +28 -0
  272. package/src/common/encrypt/encrypt-types.mts +130 -0
  273. package/src/common/error/error-constants.mts +8 -0
  274. package/src/common/error/error-helper.mts +155 -0
  275. package/src/common/error/error-types.mts +62 -0
  276. package/src/common/form/form-helper.mts +253 -0
  277. package/src/common/form/form-items.mts +236 -0
  278. package/src/common/import-export/import-export-types.mts +18 -0
  279. package/src/common/legacy/about-legacy.md +0 -0
  280. package/src/common/legacy/legacy-types.mts +0 -0
  281. package/src/common/link/link-constants.mts +1 -0
  282. package/src/common/link/link-helper.mts +155 -0
  283. package/src/common/link/link-types.mts +16 -0
  284. package/src/common/other/graph-helper.mts +853 -0
  285. package/src/common/other/ibgib-helper.mts +671 -0
  286. package/src/common/other/other-constants.mts +76 -0
  287. package/src/common/other/other-types.mts +186 -0
  288. package/src/common/other/svg-constants.mts +1 -0
  289. package/src/common/other/svg-helper.mts +238 -0
  290. package/src/common/pic/pic-constants.mts +13 -0
  291. package/src/common/pic/pic-helper.mts +295 -0
  292. package/src/common/pic/pic-types.mts +29 -0
  293. package/src/common/root/root-constants.mts +41 -0
  294. package/src/common/root/root-types.mts +8 -0
  295. package/src/common/tag/tag-constants.mts +34 -0
  296. package/src/common/tag/tag-types.mts +19 -0
  297. package/src/core-constants.mts +506 -0
  298. package/src/core-helper.mts +33 -0
  299. package/src/core-types.mts +519 -0
  300. package/src/helper.spec.mts +64 -0
  301. package/src/index.mts +1 -0
  302. package/src/witness/app/app-base-v1.mts +584 -0
  303. package/src/witness/app/app-constants.mts +16 -0
  304. package/src/witness/app/app-helper.mts +322 -0
  305. package/src/witness/app/app-types.mts +252 -0
  306. package/src/witness/app/chat-app/chat-app-types.mts +40 -0
  307. package/src/witness/app/flash-app/flash-app-types.mts +38 -0
  308. package/src/witness/app/raw-app/raw-app-types.mts +40 -0
  309. package/src/witness/app/todo-app/todo-app-types.ts +59 -0
  310. package/src/witness/robbot/robbot-base-v1.ts +1531 -0
  311. package/src/witness/robbot/robbot-constants.mts +25 -0
  312. package/src/witness/robbot/robbot-helper.mts +676 -0
  313. package/src/witness/robbot/robbot-helper.spec.mts +135 -0
  314. package/src/witness/robbot/robbot-types.mts +797 -0
  315. package/src/witness/space/bootstrap/bootstrap-constants.mts +15 -0
  316. package/src/witness/space/inner-space-v1.ts +372 -0
  317. package/src/witness/space/outer-space/outer-space-constants.mts +1 -0
  318. package/src/witness/space/outer-space/outer-space-helper.mts +91 -0
  319. package/src/witness/space/outer-space/outer-space-types.mts +627 -0
  320. package/src/witness/space/space-base-v1.mts +414 -0
  321. package/src/witness/space/space-constants.mts +208 -0
  322. package/src/witness/space/space-helper.mts +3242 -0
  323. package/src/witness/space/space-types.mts +476 -0
  324. package/src/witness/witness-base-v1.ts +325 -0
  325. package/src/witness/witness-constants.mts +2 -0
  326. package/src/witness/witness-form-builder.mts +128 -0
  327. package/src/witness/witness-helper.mts +256 -0
  328. package/src/witness/witness-types.mts +249 -0
  329. package/tsconfig.json +15 -0
  330. package/tsconfig.test.json +10 -0
@@ -0,0 +1,116 @@
1
+ import { IbGibRel8ns_V1, IbGib_V1 } from '@ibgib/ts-gib/dist/V1/index.mjs';
2
+ import { IbGibAddr } from '@ibgib/ts-gib';
3
+ import { HashAlgorithm } from '@ibgib/helper-gib';
4
+ import { SaltStrategy } from '@ibgib/encrypt-gib';
5
+ import { ENCRYPTION_REL8N_NAME } from './encrypt-constants.mjs';
6
+ export type SecretType = "password";
7
+ export declare const SecretType: {
8
+ password: "password";
9
+ };
10
+ export declare const VALID_SECRET_TYPES: "password"[];
11
+ export interface SecretInfo {
12
+ name: string;
13
+ description?: string;
14
+ expirationUTC: string;
15
+ type: SecretType;
16
+ }
17
+ export interface SecretInfo_Password extends SecretInfo {
18
+ type: 'password';
19
+ /**
20
+ * We won't save the entire hash, just the hash.slice(16),
21
+ * because we are not checking to give authority, we are
22
+ * just checking to see if the user entered the same
23
+ * password for their own check.
24
+ *
25
+ * ## warnings
26
+ * NOTHING giving actual authorization should look at this.
27
+ */
28
+ hash16816_SHA256: string;
29
+ /**
30
+ * Public hint to help you remember your secret (or help the bad person
31
+ * attack your secret).
32
+ */
33
+ hint?: string;
34
+ }
35
+ export type SecretData_V1 = SecretInfo;
36
+ export interface SecretRel8ns_V1 extends IbGibRel8ns_V1 {
37
+ }
38
+ export interface SecretIbGib_V1 extends IbGib_V1<SecretData_V1, SecretRel8ns_V1> {
39
+ }
40
+ export interface EncryptionInfo {
41
+ name: string;
42
+ description?: string;
43
+ method: EncryptionMethod;
44
+ }
45
+ export type EncryptionMethod = 'encrypt-gib (weak)';
46
+ export declare const EncryptionMethod: {
47
+ encrypt_gib_weak: "encrypt-gib (weak)";
48
+ };
49
+ export interface EncryptionInfo {
50
+ method: EncryptionMethod;
51
+ }
52
+ export interface EncryptionInfo_EncryptGib extends EncryptionInfo {
53
+ method: 'encrypt-gib (weak)';
54
+ /**
55
+ * This is the algorithm that encrypt-gib will use in its
56
+ * internal hashing round function to encrypt the data.
57
+ */
58
+ hashAlgorithm: HashAlgorithm;
59
+ /**
60
+ * This is an initial number of recursions to perform to "get farther away"
61
+ * from the password. It is a one-time cost at the beginning of the
62
+ * entire encryption process, so it does not cost more with more data.
63
+ */
64
+ initialRecursions: number;
65
+ /**
66
+ * This is the number of internal hashes per round function, which is per
67
+ * hex character of data. So the more recursions here, the longer it is
68
+ * going to take to encrypt/decrypt.
69
+ */
70
+ recursionsPerHash?: number;
71
+ /**
72
+ * Salt used throughout hashing in encryption/decryption. The longer and
73
+ * more random, the better for security. But there is also a resource cost.
74
+ */
75
+ salt: string;
76
+ /**
77
+ * Stronger are the perHash options.
78
+ *
79
+ * 'prependPerHash' | 'appendPerHash' | 'initialPrepend' | 'initialAppend';
80
+ */
81
+ saltStrategy?: SaltStrategy;
82
+ /**
83
+ * The encrypted data is a delimited list of indices.
84
+ *
85
+ * @default "," (comma-delimited)
86
+ */
87
+ encryptedDataDelimiter?: string;
88
+ }
89
+ export type EncryptionData_V1 = EncryptionInfo_EncryptGib;
90
+ export interface EncryptionRel8ns_V1 extends IbGibRel8ns_V1 {
91
+ }
92
+ /**
93
+ * IbGib that represents encryption settings
94
+ */
95
+ export interface EncryptionIbGib extends IbGib_V1<EncryptionData_V1, EncryptionRel8ns_V1> {
96
+ }
97
+ /**
98
+ * Data for the actual encrypted ciphertext.
99
+ */
100
+ export interface CiphertextData<TMetadata = any> {
101
+ ciphertext?: string;
102
+ metadata?: TMetadata;
103
+ }
104
+ /**
105
+ * Rel8ns for the actual encrypted ciphertext
106
+ */
107
+ export interface CiphertextRel8ns extends IbGibRel8ns_V1 {
108
+ [ENCRYPTION_REL8N_NAME]?: IbGibAddr[];
109
+ }
110
+ /**
111
+ * Ibgib for the actual encrypted content, as opposed to the
112
+ * encryption secret (password) or encryption method/algorithm.
113
+ */
114
+ export interface CiphertextIbGib_V1<TMetadata = any> extends IbGib_V1<CiphertextData<TMetadata>, CiphertextRel8ns> {
115
+ }
116
+ //# sourceMappingURL=encrypt-types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encrypt-types.d.mts","sourceRoot":"","sources":["../../../src/common/encrypt/encrypt-types.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAG,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC;AACpC,eAAO,MAAM,UAAU;;CAEtB,CAAA;AACD,eAAO,MAAM,kBAAkB,cAAqC,CAAC;AAErE,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,UAAU,CAAC;CACpB;AAED,MAAM,WAAW,mBAAoB,SAAQ,UAAU;IACnD,IAAI,EAAE,UAAU,CAAC;IACjB;;;;;;;;OAQG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AACD,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC;AAEvC,MAAM,WAAW,eAAgB,SAAQ,cAAc;CACtD;AAED,MAAM,WAAW,cAAe,SAAQ,QAAQ,CAAC,aAAa,EAAE,eAAe,CAAC;CAC/E;AAED,MA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 -0,0 +1,9 @@
1
+ import { ENCRYPTION_REL8N_NAME } from './encrypt-constants.mjs';
2
+ export const SecretType = {
3
+ password: 'password',
4
+ };
5
+ export const VALID_SECRET_TYPES = Object.values(SecretType).concat();
6
+ export const EncryptionMethod = {
7
+ encrypt_gib_weak: 'encrypt-gib (weak)',
8
+ };
9
+ //# sourceMappingURL=encrypt-types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encrypt-types.mjs","sourceRoot":"","sources":["../../../src/common/encrypt/encrypt-types.mts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAIhE,MAAM,CAAC,MAAM,UAAU,GAAG;IACtB,QAAQ,EAAE,UAAwB;CACrC,CAAA;AACD,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,EAAE,CAAC;AA0CrE,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,gBAAgB,EAAE,oBAAwC;CAC7D,CAAA"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Used in ErrorIbGib_V1.ib
3
+ */
4
+ export declare const DEFAULT_ERROR_MSG_IB_SUBSTRING_LENGTH = 20;
5
+ /**
6
+ * regexp for an error ibgib's (ErrorIbGib_V1) ib property.
7
+ */
8
+ export declare const ERROR_IB_REGEXP: RegExp;
9
+ //# sourceMappingURL=error-constants.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-constants.d.mts","sourceRoot":"","sources":["../../../src/common/error/error-constants.mts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,qCAAqC,KAAK,CAAC;AACxD;;GAEG;AACH,eAAO,MAAM,eAAe,QAA6C,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Used in ErrorIbGib_V1.ib
3
+ */
4
+ export const DEFAULT_ERROR_MSG_IB_SUBSTRING_LENGTH = 20;
5
+ /**
6
+ * regexp for an error ibgib's (ErrorIbGib_V1) ib property.
7
+ */
8
+ export const ERROR_IB_REGEXP = /^error (\w+) ([a-fA-F\d]{32}|undefined)$/;
9
+ //# sourceMappingURL=error-constants.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-constants.mjs","sourceRoot":"","sources":["../../../src/common/error/error-constants.mts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,EAAE,CAAC;AACxD;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,0CAA0C,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { Ib } from '@ibgib/ts-gib';
2
+ import { IbGib_V1 } from '@ibgib/ts-gib/dist/V1/index.mjs';
3
+ import { ErrorData_V1, ErrorIbGib_V1 } from './error-types.mjs';
4
+ /**
5
+ * Generates an ib based on a raw error msg.
6
+ *
7
+ * ## future
8
+ *
9
+ * If this is changed in the future, then without versioning of some sort, this
10
+ * will change the error constant ibgibs that rely on this functions
11
+ * deterministic qualities.
12
+ *
13
+ * @returns the error's `ib`
14
+ */
15
+ export declare function getErrorIb({ rawMsg, }: {
16
+ rawMsg: string;
17
+ }): Ib;
18
+ /**
19
+ * Parses a raw error/exception message.
20
+ *
21
+ * If it has sections that I personally use (usually), then it will break that
22
+ * out. otherwise, it will just have the `rawMsg` as the msg body and raw msg.
23
+ *
24
+ * @see {@link ErrorData_V1}
25
+ */
26
+ export declare function parseRawErrorMsg({ rawMsg, }: {
27
+ rawMsg: string;
28
+ }): ErrorData_V1;
29
+ /**
30
+ * Builds a "constant" error ibgib based on the given `rawMsg`.
31
+ *
32
+ * @returns constant error ibgib built from given `rawMsg`
33
+ *
34
+ * @see {@link ErrorData_V1}
35
+ * @see {@link ErrorIbGib_V1}
36
+ */
37
+ export declare function errorIbGib({ rawMsg }: {
38
+ rawMsg: string;
39
+ }): Promise<ErrorIbGib_V1>;
40
+ export declare function isError({ ibGib }: {
41
+ ibGib: IbGib_V1;
42
+ }): boolean;
43
+ //# sourceMappingURL=error-helper.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-helper.d.mts","sourceRoot":"","sources":["../../../src/common/error/error-helper.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAG3D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAkB,MAAM,mBAAmB,CAAC;AAQhF;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,EACvB,MAAM,GACT,EAAE;IACC,MAAM,EAAE,MAAM,CAAC;CAClB,GAAG,EAAE,CAwBL;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,EAC7B,MAAM,GACT,EAAE;IACC,MAAM,EAAE,MAAM,CAAC;CAClB,GAAG,YAAY,CA4Cf;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,aAAa,CAAC,CAiBjF;AAED,wBAAgB,OAAO,CAAC,EACpB,KAAK,EACR,EAAE;IACC,KAAK,EAAE,QAAQ,CAAA;CAClB,GAAG,OAAO,CAYV"}
@@ -0,0 +1,167 @@
1
+ import { GLOBAL_LOG_A_LOT } from '../../core-constants.mjs';
2
+ import { constantIbGib } from '../other/ibgib-helper.mjs';
3
+ import { DEFAULT_ERROR_MSG_IB_SUBSTRING_LENGTH, ERROR_IB_REGEXP } from './error-constants.mjs';
4
+ import { ERROR_MSG_LOCATION_ONLY_REGEXP, ERROR_MSG_WITH_ID_CAPTURE_GROUPS_REGEXP } from '@ibgib/helper-gib';
5
+ const logalot = GLOBAL_LOG_A_LOT || false;
6
+ /**
7
+ * Generates an ib based on a raw error msg.
8
+ *
9
+ * ## future
10
+ *
11
+ * If this is changed in the future, then without versioning of some sort, this
12
+ * will change the error constant ibgibs that rely on this functions
13
+ * deterministic qualities.
14
+ *
15
+ * @returns the error's `ib`
16
+ */
17
+ export function getErrorIb({ rawMsg, }) {
18
+ const lc = `[${getErrorIb.name}]`;
19
+ try {
20
+ if (logalot) {
21
+ console.log(`${lc} starting...`);
22
+ }
23
+ const parsed = parseRawErrorMsg({ rawMsg });
24
+ const saferText = parsed.body.replace(/\s/g, '_').replace(/\W/g, '');
25
+ let msgSlice;
26
+ if (saferText.length > DEFAULT_ERROR_MSG_IB_SUBSTRING_LENGTH) {
27
+ msgSlice =
28
+ saferText.substring(0, DEFAULT_ERROR_MSG_IB_SUBSTRING_LENGTH);
29
+ }
30
+ else if (saferText.length > 0) {
31
+ msgSlice = saferText;
32
+ }
33
+ else {
34
+ // msg only has characters/nonalphanumerics ?
35
+ throw new Error(`(UNEXPECTED) error msg should have characters/alphanumerics... (E: a3b9cd11a44cc7892a748819c2885422)`);
36
+ }
37
+ return `error ${msgSlice} ${parsed.uuid ?? 'undefined'}`;
38
+ }
39
+ catch (error) {
40
+ console.error(`${lc} ${error.message}`);
41
+ throw error;
42
+ }
43
+ finally {
44
+ if (logalot) {
45
+ console.log(`${lc} complete.`);
46
+ }
47
+ }
48
+ }
49
+ /**
50
+ * Parses a raw error/exception message.
51
+ *
52
+ * If it has sections that I personally use (usually), then it will break that
53
+ * out. otherwise, it will just have the `rawMsg` as the msg body and raw msg.
54
+ *
55
+ * @see {@link ErrorData_V1}
56
+ */
57
+ export function parseRawErrorMsg({ rawMsg, }) {
58
+ const lc = `[${parseRawErrorMsg.name}]`;
59
+ try {
60
+ if (logalot) {
61
+ console.log(`${lc} starting...`);
62
+ }
63
+ if (!rawMsg) {
64
+ throw new Error(`(UNEXPECTED) rawMsg required (E: e5bd3b433a1781ebe885534cd2495622)`);
65
+ }
66
+ let data;
67
+ let regexResult = rawMsg.match(ERROR_MSG_WITH_ID_CAPTURE_GROUPS_REGEXP);
68
+ if (regexResult) {
69
+ // has id section
70
+ const [_, location, unexpectedAtStart, body, idSection, unexpectedAtEnd] = regexResult;
71
+ if (!body) {
72
+ throw new Error(`invalid error msg body (E: a675e6855cca96519d33d44ea5400922)`);
73
+ }
74
+ data = {
75
+ success: false,
76
+ raw: rawMsg,
77
+ body: body?.trim(),
78
+ uuid: idSection.slice(4, 36),
79
+ };
80
+ if (location) {
81
+ data.location = location;
82
+ }
83
+ if (unexpectedAtStart || unexpectedAtEnd) {
84
+ data.unexpected = true;
85
+ }
86
+ }
87
+ else {
88
+ // no id or unexpected regex (maybe changed?)
89
+ data = {
90
+ success: false,
91
+ raw: rawMsg,
92
+ body: rawMsg,
93
+ };
94
+ let regexResultLocation = rawMsg.match(ERROR_MSG_LOCATION_ONLY_REGEXP);
95
+ if (regexResultLocation) {
96
+ const [_, location] = regexResultLocation;
97
+ data.location = location;
98
+ }
99
+ if (rawMsg.toLowerCase().includes(`(unexpected)`)) {
100
+ data.unexpected = true;
101
+ }
102
+ }
103
+ return data;
104
+ }
105
+ catch (error) {
106
+ console.error(`${lc} ${error.message}`);
107
+ throw error;
108
+ }
109
+ finally {
110
+ if (logalot) {
111
+ console.log(`${lc} complete.`);
112
+ }
113
+ }
114
+ }
115
+ /**
116
+ * Builds a "constant" error ibgib based on the given `rawMsg`.
117
+ *
118
+ * @returns constant error ibgib built from given `rawMsg`
119
+ *
120
+ * @see {@link ErrorData_V1}
121
+ * @see {@link ErrorIbGib_V1}
122
+ */
123
+ export function errorIbGib({ rawMsg }) {
124
+ const lc = `[${errorIbGib.name}]`;
125
+ try {
126
+ if (logalot) {
127
+ console.log(`${lc} starting...`);
128
+ }
129
+ return constantIbGib({
130
+ parentPrimitiveIb: 'error',
131
+ ib: getErrorIb({ rawMsg }),
132
+ data: parseRawErrorMsg({ rawMsg }),
133
+ ibRegExpPattern: ERROR_IB_REGEXP.source,
134
+ });
135
+ }
136
+ catch (error) {
137
+ console.error(`${lc} ${error.message}`);
138
+ throw error;
139
+ }
140
+ finally {
141
+ if (logalot) {
142
+ console.log(`${lc} complete.`);
143
+ }
144
+ }
145
+ }
146
+ export function isError({ ibGib }) {
147
+ const lc = `[${isError.name}]`;
148
+ try {
149
+ if (logalot) {
150
+ console.log(`${lc} starting...`);
151
+ }
152
+ if (!ibGib) {
153
+ throw new Error(`ibGib required (E: 1d756fbbd96f1734b97ba013537ed522)`);
154
+ }
155
+ return ibGib.ib.startsWith('error ');
156
+ }
157
+ catch (error) {
158
+ console.error(`${lc} ${error.message}`);
159
+ throw error;
160
+ }
161
+ finally {
162
+ if (logalot) {
163
+ console.log(`${lc} complete.`);
164
+ }
165
+ }
166
+ }
167
+ //# sourceMappingURL=error-helper.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-helper.mjs","sourceRoot":"","sources":["../../../src/common/error/error-helper.mts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,qCAAqC,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC/F,OAAO,EAAE,8BAA8B,EAAE,uCAAuC,EAAE,MAAM,mBAAmB,CAAC;AAG5G,MAAM,OAAO,GAAG,gBAAgB,IAAI,KAAK,CAAC;AAE1C;;;;;;;;;;GAUG;AACH,MAAM,UAAU,UAAU,CAAC,EACvB,MAAM,GAGT;IACG,MAAM,EAAE,GAAG,IAAI,UAAU,CAAC,IAAI,GAAG,CAAC;IAClC,IAAI;QACA,IAAI,OAAO,EAAE;YAAE,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;SAAE;QAClD,MAAM,MAAM,GAAG,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QAC5C,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACrE,IAAI,QAAgB,CAAC;QACrB,IAAI,SAAS,CAAC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 @@
1
+ import { IbGibRel8ns_V1, IbGib_V1 } from '@ibgib/ts-gib/dist/V1/index.mjs';
2
+ /**
3
+ * I format my errors nowadays usually using an id and a possible (unexpected) flag.
4
+ * Sometimes I put the unexpected flag at the beginning, sometimes at the end.
5
+ */
6
+ export interface ErrorData_V1 {
7
+ /**
8
+ * raw error message
9
+ */
10
+ raw: string;
11
+ /**
12
+ * I usually have lc's (log contexts) all over my code, if that isn't obvious or
13
+ * if you're not looking at the code. Anyway, I prepend error/info/warning msgs
14
+ * with the location like this:
15
+ *
16
+ * ```
17
+ * [MyClass][Foo] some error (E: hash123)
18
+ * ```
19
+ *
20
+ * So the bits in the brackets are the location. In this case, it's
21
+ * `[MyClass][Foo]` meaning in the function `Foo` on the class `MyClass`.
22
+ */
23
+ location?: string;
24
+ /**
25
+ * error message sans any metadata
26
+ */
27
+ body: string;
28
+ /**
29
+ * if the error is thrown more of an assertion, and it's an edge case just
30
+ * weird error, then I often add `"(UNEXPECTED)"` to the msg. This flag
31
+ * indicates that.
32
+ */
33
+ unexpected?: boolean;
34
+ /**
35
+ * I often include error ids.
36
+ */
37
+ uuid?: string;
38
+ /**
39
+ * All errors should have `errorIbGib.data.success` = false
40
+ */
41
+ success: false;
42
+ }
43
+ export interface ErrorRel8ns_V1 extends IbGibRel8ns_V1 {
44
+ }
45
+ /**
46
+ * Encapsulates data on errors that are thrown in this code base.
47
+ *
48
+ * ## driving intent
49
+ *
50
+ * I'm creating this for error constant ibgibs when I want to wrap an error
51
+ * message in an ibgib for whatever reason.
52
+ *
53
+ * Specifically I'm working on the random robbot and want the ability to return an error
54
+ * or add an error to a context ibgib.
55
+ */
56
+ export interface ErrorIbGib_V1 extends IbGib_V1<ErrorData_V1, ErrorRel8ns_V1> {
57
+ }
58
+ //# sourceMappingURL=error-types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-types.d.mts","sourceRoot":"","sources":["../../../src/common/error/error-types.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAE3E;;;GAGG;AACH,MAAM,WAAW,YAAY;IACzB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC;CAClB;AAED,MAAM,WAAW,cAAe,SAAQ,cAAc;CAErD;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,aAAc,SAAQ,QAAQ,CAAC,YAAY,EAAE,cAAc,CAAC;CAE5E"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=error-types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-types.mjs","sourceRoot":"","sources":["../../../src/common/error/error-types.mts"],"names":[],"mappings":""}
@@ -0,0 +1,97 @@
1
+ import { DynamicForm, FormItemInfo } from './form-items.mjs';
2
+ /**
3
+ * Fluent-style builder helper class.
4
+ *
5
+ * I'm making this to share common fields' settings among witness classes.
6
+ *
7
+ * Descend from this class for sharing other commonalities.
8
+ */
9
+ export declare class DynamicFormBuilder {
10
+ protected lc: string;
11
+ protected items: FormItemInfo[];
12
+ protected what: string;
13
+ /**
14
+ * pool of uuids pre-calculated to be passed in to the builder. if this is
15
+ * falsy, then it will use a Math.random() based approach.
16
+ */
17
+ protected idPool: string[];
18
+ /**
19
+ * hacky wrapper for this.idPool.pop()
20
+ */
21
+ protected getNewId(): string;
22
+ /**
23
+ * Start fluent calls with this.
24
+ */
25
+ forA({ what, }: {
26
+ /**
27
+ * Common name for the reified concrete type of the witness.
28
+ *
29
+ * Used in things like placeholders, descriptions, etc.
30
+ *
31
+ * @example "robbot" or "space"
32
+ */
33
+ what: string;
34
+ }): DynamicFormBuilder;
35
+ protected addItem(item: FormItemInfo): void;
36
+ /**
37
+ * Empty function simply for more natural looking fluent syntax.
38
+ *
39
+ * You can override this for custom form builders that descend from this
40
+ * class.
41
+ *
42
+ * @returns this
43
+ */
44
+ with<T extends DynamicFormBuilder>({ idPool, }: {
45
+ /**
46
+ * pre-built pool of uuids to draw from. this builder
47
+ * will mutate this array.
48
+ */
49
+ idPool?: string[];
50
+ }): T;
51
+ /**
52
+ * I'm not a great fluent builder writer for TypeScript,
53
+ * and this function acts as a caster for which members of
54
+ * which concrete classes to expose for the proceeding builder lines.
55
+ *
56
+ *
57
+ * Basically, you use this to typecast the builder, possibly redundantly since
58
+ * I don't have any ordering implemented atow.
59
+ *
60
+ * @returns typecasted fluent builder
61
+ */
62
+ and<T extends DynamicFormBuilder>(): T;
63
+ name<T extends DynamicFormBuilder>({ of: value, required, }: {
64
+ of: string;
65
+ required?: boolean;
66
+ }): T;
67
+ description({ of: value, required, defaultValue, }: {
68
+ of: string;
69
+ required?: boolean;
70
+ defaultValue?: string;
71
+ }): DynamicFormBuilder;
72
+ classname({ of, required, }: {
73
+ of: string;
74
+ required?: boolean;
75
+ }): DynamicFormBuilder;
76
+ uuid({ of, label, required, }: {
77
+ of: string;
78
+ label?: string;
79
+ required?: boolean;
80
+ }): DynamicFormBuilder;
81
+ version({ of, required, }: {
82
+ of: string | undefined;
83
+ required?: boolean;
84
+ }): DynamicFormBuilder;
85
+ /**
86
+ * To pass in a completely customized item info.
87
+ *
88
+ * @returns `this` for fluent builder
89
+ */
90
+ customItem(item: FormItemInfo): DynamicFormBuilder;
91
+ outputItems(): FormItemInfo[];
92
+ outputForm({ formName, label, }: {
93
+ formName: string;
94
+ label?: string;
95
+ }): DynamicForm;
96
+ }
97
+ //# sourceMappingURL=form-helper.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-helper.d.mts","sourceRoot":"","sources":["../../../src/common/form/form-helper.mts"],"names":[],"mappings":"AAI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