@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,627 @@
1
+ /**
2
+ * @module outer-space
3
+ * Outer spaces are spaces connecting local inner spaces.
4
+ * ATOW there is just sync spaces, but definitely just the beginning.
5
+ *
6
+ * ## on future implementations, CRDT-like behavior
7
+ *
8
+ * I just realized that when merging, I can actually create a meta transform
9
+ * ibgib to maintain the order of transforms.
10
+ */
11
+
12
+ import { ReplaySubject, Subscription } from 'rxjs';
13
+
14
+ import { IbGibRel8ns_V1, IbGib_V1 } from '@ibgib/ts-gib/dist/V1/index.mjs';
15
+ import { IbGibAddr, IbGib, Gib, Ib, } from '@ibgib/ts-gib';
16
+ import * as h from '@ibgib/helper-gib';
17
+
18
+
19
+ import {
20
+ IbGibSpaceData, IbGibSpaceRel8ns,
21
+ IbGibSpaceOptionsData, IbGibSpaceOptionsRel8ns, IbGibSpaceOptionsIbGib,
22
+ IbGibSpaceOptionsCmdModifier,
23
+ IbGibSpaceResultData, IbGibSpaceResultRel8ns, IbGibSpaceResultIbGib,
24
+ } from '../space-types.mjs';
25
+ import { IbGibSpaceAny } from '../space-base-v1.mjs';
26
+ import { CIPHERTEXT_REL8N_NAME } from '../../../common/encrypt/encrypt-constants.mjs';
27
+ import { CONSENSUS_REL8N_NAME } from '../../../common/other/other-constants.mjs';
28
+
29
+ /**
30
+ * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
31
+ *
32
+ * ## driving use case
33
+ *
34
+ * I'm adding this for tracking status for longer-running inter-spatial
35
+ * communications. Specifically, I'm working on the first aws dynamo db
36
+ * sync space.
37
+ *
38
+ * ## notes
39
+ *
40
+ * * I think http status codes do a pretty good job of protocol information
41
+ * exchange.
42
+ * * The only non-standard status code I'm doing ATOW is 0 meaning "undefined".
43
+ * * I'm adding (whitelisting) codes as I use them.
44
+ * * Note that sections of code check for validation of membership here and
45
+ * will error if not present.
46
+ */
47
+ export type StatusCode =
48
+ 'undefined' |
49
+ 'preparing' |
50
+ 'started' |
51
+ 'inserted' | 'updated' |
52
+ 'merged_dna' | 'merged_state' |
53
+ 'already_synced' |
54
+ 'completed';
55
+ export const StatusCode = {
56
+ /**
57
+ * Using this as the code for the parent primitive.
58
+ */
59
+ undefined: 'undefined' as StatusCode,
60
+ /**
61
+ * gt
62
+ */
63
+ preparing: 'preparing' as StatusCode,
64
+ /**
65
+ * Communication between spaces has just started, but no evaluation as to
66
+ * intrinsic ibgibs shared has been made.
67
+ *
68
+ * Using this for the start of the sync process, meaning the ball has begun
69
+ * rolling, a metadata ibgib to track the operation has been created (but
70
+ * not necessarily yet stored), but no intrinsic (non-meta) data has been
71
+ * exchanged.
72
+ */
73
+ started: 'started' as StatusCode,
74
+ /**
75
+ * New insertion of ibgib(s) into the outerspace.
76
+ *
77
+ * The outerspace did not have the timeline or ibgib(s) at all, so this is
78
+ * the first time.
79
+ */
80
+ inserted: 'inserted' as StatusCode,
81
+ /**
82
+ * Updated outerspace with local ibgib(s).
83
+ *
84
+ * The outerspace had the same timeline as the local space, just not as
85
+ * recent.
86
+ */
87
+ updated: 'updated' as StatusCode,
88
+ /**
89
+ * When syncing, this means that we've created new ibgib to merge into an
90
+ * existing timeline in the sync space BY APPLYING ALL UN-APPLIED LOCAL
91
+ * TRANSFORMS to the latest ibgib in the store.
92
+ *
93
+ * Note that in this case, we've created new ibgib to fulfill the operation
94
+ * (besides the derivative metadata ibgibs created in the communication).
95
+ */
96
+ merged_dna: 'merged_dna' as StatusCode,
97
+ /**
98
+ * When syncing, this means that we've created new ibgib to merge into an
99
+ * existing timeline in the sync space BY MANUALLY SYNCHRONIZING ALL
100
+ * DATA AND REL8NS with the latest ibgib in the store.
101
+ *
102
+ * Note that in this case, we've created new ibgib to fulfill the operation
103
+ * (besides the derivative metadata ibgibs created in the communication).
104
+ */
105
+ merged_state: 'merged_state' as StatusCode,
106
+ /**
107
+ * The operation has completed, but there were no intrinsic changes.
108
+ *
109
+ * For example, if we were to sync an ibGib but it's already up-to-date in a
110
+ * space, then we have generated metadata ibgibs. But *intrinsically* we have
111
+ * not altered any timeline ibgibs or added any stone ibgibs.
112
+ */
113
+ already_synced: 'already_synced' as StatusCode,
114
+ /**
115
+ * Inter-spatial communication complete.
116
+ *
117
+ * * There should be no more status updates after this.
118
+ * * syncStatus$ observable should be completed just after this.
119
+ * * subscribers should unsubscribe if not already done.
120
+ * * I think this happens at the publishing end also, but always good
121
+ * to take care of your own cleanup if possible.
122
+ *
123
+ */
124
+ completed: 'completed' as StatusCode,
125
+ }
126
+
127
+ export type OuterSpaceType = "sync";
128
+ export const OuterSpaceType = {
129
+ sync: 'sync' as OuterSpaceType,
130
+ }
131
+ export const VALID_OUTER_SPACE_TYPES = Object.values(OuterSpaceType).concat();
132
+
133
+ export type SyncSpaceSubtype = 'aws-dynamodb';
134
+ export const SyncSpaceSubtype = {
135
+ aws_dynamodb: 'aws-dynamodb' as SyncSpaceSubtype,
136
+ }
137
+
138
+ export type OuterSpaceSubtype = 'tbd' | SyncSpaceSubtype;
139
+ export const OuterSpaceSubtype = {
140
+ tbd: 'tbd' as OuterSpaceSubtype,
141
+ ...SyncSpaceSubtype,
142
+ }
143
+ export const VALID_OUTER_SPACE_SUBTYPES = Object.values(OuterSpaceSubtype).concat();
144
+
145
+ export interface OuterSpaceData extends IbGibSpaceData {
146
+ type: OuterSpaceType;
147
+ subtype: OuterSpaceSubtype;
148
+ }
149
+
150
+ export interface OuterSpaceRel8ns extends IbGibSpaceRel8ns {
151
+ [CIPHERTEXT_REL8N_NAME]?: IbGibAddr[];
152
+ /**
153
+ * ATOW this will only be CONSENSUS_ADDR_SYNC_NAIVE_PUT_MERGE
154
+ */
155
+ [CONSENSUS_REL8N_NAME]?: IbGibAddr[];
156
+ }
157
+
158
+ export interface OuterSpaceIbGib
159
+ extends IbGib_V1<OuterSpaceData, OuterSpaceRel8ns> {
160
+ }
161
+
162
+ export interface SyncSpaceData extends OuterSpaceData {
163
+ type: 'sync';
164
+ subtype: SyncSpaceSubtype;
165
+ }
166
+ export interface SyncSpaceRel8ns extends OuterSpaceRel8ns {
167
+ }
168
+
169
+ export interface ParticipantInfo {
170
+ id: string;
171
+ gib: Gib;
172
+ s_d: 'src' | 'dest';
173
+ }
174
+
175
+ /**
176
+ * Options shape specific to OuterSpaces.
177
+ * Marker interface only atm.
178
+ */
179
+ export interface OuterSpaceOptionsData extends IbGibSpaceOptionsData {
180
+ /**
181
+ * Operation id across multiple spaces.
182
+ *
183
+ * ## notes
184
+ *
185
+ * If src/local space is communicating with more than one
186
+ * other space, then this can be used to coordinate among
187
+ * all of them. If there are only two spaces, then the
188
+ * gib of the individual status ibgib is just as uniquely
189
+ * identifying.
190
+ */
191
+ multiSpaceOpId?: string;
192
+ /**
193
+ * Modifying flags for cmd routing for the associated cmd ibGib.
194
+ */
195
+ cmdModifiers?: (OuterSpaceOptionsCmdModifier | string)[];
196
+ /**
197
+ * This id is used when communicating between two spaces. During that
198
+ * communication, multiple ibgibs will be passed back and forth, and this
199
+ * `sagaId` will be common among those messages.
200
+ *
201
+ * There is also an id that is common to operations that
202
+ * refer to multiple spaces. {@see multiSpaceOpId}
203
+ */
204
+ sagaId?: string;
205
+ /**
206
+ * Info of the participating spaces (as endpoints) in the communication.
207
+ */
208
+ participants?: ParticipantInfo[];
209
+ }
210
+
211
+ export interface OuterSpaceOptionsRel8ns extends IbGibSpaceOptionsRel8ns {
212
+ }
213
+ export interface OuterSpaceOptionsIbGib<
214
+ TIbGib extends IbGib = IbGib_V1,
215
+ TOptsData extends OuterSpaceOptionsData = OuterSpaceOptionsData,
216
+ // TOptsRel8ns extends IbGibSpaceOptionsRel8ns = IbGibSpaceOptionsRel8ns
217
+ TOptsRel8ns extends OuterSpaceOptionsRel8ns = OuterSpaceOptionsRel8ns,
218
+ > extends IbGibSpaceOptionsIbGib<TIbGib, TOptsData, TOptsRel8ns> {
219
+ }
220
+
221
+ export interface OuterSpaceResultData extends IbGibSpaceResultData {
222
+ /**
223
+ * If the space operation involves a saga, this is the id.
224
+ */
225
+ sagaId?: string;
226
+ }
227
+ export interface OuterSpaceResultRel8ns extends IbGibSpaceResultRel8ns {
228
+ }
229
+ export interface OuterSpaceResultIbGib<
230
+ TIbGib extends IbGib,
231
+ TResultData extends OuterSpaceResultData,
232
+ TResultRel8ns extends OuterSpaceResultRel8ns
233
+ > extends IbGibSpaceResultIbGib<TIbGib, TResultData, TResultRel8ns> {
234
+ }
235
+
236
+ /**
237
+ * Marker atm.
238
+ *
239
+ * {@see IbGibSpaceOptionsCmdModifier}
240
+ */
241
+ export type OuterSpaceOptionsCmdModifier = IbGibSpaceOptionsCmdModifier;
242
+ /**
243
+ * Marker atm.
244
+ *
245
+ * {@see IbGibSpaceOptionsCmdModifier}
246
+ */
247
+ export const OuterSpaceOptionsCmdModifier = {
248
+ ...IbGibSpaceOptionsCmdModifier,
249
+ }
250
+
251
+ /**
252
+ * Extends basic ibgib space options cmd modifiers to include sync specific ones.
253
+ *
254
+ * {@see IbGibSpaceOptionsCmdModifier}
255
+ * {@see OuterSpaceOptionsCmdModifier}
256
+ */
257
+ export type SyncSpaceOptionsCmdModifier = OuterSpaceOptionsCmdModifier | 'sync';
258
+ /**
259
+ * Flags to affect the command's interpretation.
260
+ *
261
+ * {@see IbGibSpaceOptionsCmdModifier}
262
+ * {@see OuterSpaceOptionsCmdModifier}
263
+ */
264
+ export const SyncSpaceOptionsCmdModifier = {
265
+ ...OuterSpaceOptionsCmdModifier, // "inherited"
266
+ /**
267
+ * special type of 'put' operation that will start a sync process.
268
+ */
269
+ sync: 'sync' as SyncSpaceOptionsCmdModifier,
270
+ }
271
+
272
+ export interface SyncSpaceOptionsData extends OuterSpaceOptionsData {
273
+ /**
274
+ * Extends inherited
275
+ */
276
+ cmdModifiers?: (SyncSpaceOptionsCmdModifier | string)[];
277
+ /**
278
+ * Each Sync has a status ibGib that tracks the progress of the
279
+ * overall sync operation (saga).
280
+ *
281
+ *
282
+ * If this is specified, then it means the sync cmd is associated with
283
+ * an existing/ongoing operation.
284
+ */
285
+ tjpGib?: Gib;
286
+ // txId?: string;
287
+ ibGibAddrs_All_Tjps?: IbGibAddr[];
288
+ ibGibAddrs_All_NonTjps?: IbGibAddr[];
289
+ }
290
+ export interface SyncSpaceOptionsRel8ns extends OuterSpaceOptionsRel8ns {
291
+ }
292
+ export interface SyncSpaceOptionsIbGib<
293
+ TIbGib extends IbGib = IbGib_V1,
294
+ TOptsData extends SyncSpaceOptionsData = SyncSpaceOptionsData,
295
+ TOptsRel8ns extends SyncSpaceOptionsRel8ns = SyncSpaceOptionsRel8ns,
296
+ > extends OuterSpaceOptionsIbGib<TIbGib, TOptsData, TOptsRel8ns> {
297
+ /**
298
+ * Produces status ibgibs or error strings.
299
+ */
300
+ syncSagaInfo: SyncSagaInfo;
301
+ }
302
+
303
+ export interface SyncSpaceResultData extends OuterSpaceResultData {
304
+ statusTjpAddr?: IbGibAddr;
305
+ }
306
+ export interface SyncSpaceResultRel8ns extends OuterSpaceResultRel8ns {
307
+ }
308
+ export interface SyncSpaceResultIbGib<
309
+ TIbGib extends IbGib = IbGib_V1,
310
+ TResultData extends SyncSpaceResultData = SyncSpaceResultData,
311
+ TResultRel8ns extends SyncSpaceResultRel8ns = SyncSpaceResultRel8ns
312
+ > extends OuterSpaceResultIbGib<TIbGib, TResultData, TResultRel8ns> {
313
+ /**
314
+ * Produces status ibgibs or error strings.
315
+ */
316
+ syncSagaInfo: SyncSagaInfo;
317
+ }
318
+
319
+ export interface SyncStatusData {
320
+ /**
321
+ * Status code for this status update.
322
+ *
323
+ * Note that this is also in the ib, which will be in each of the
324
+ * statuses' `past` rel8n. This way, callers can easily tell which
325
+ * kinds of actions were required.
326
+ */
327
+ statusCode: StatusCode;
328
+
329
+ syncGib: string;
330
+ // srcSpaceId: string;
331
+ // srcSpaceGib: string;
332
+ participants: ParticipantInfo[];
333
+
334
+ /**
335
+ * Explicit re-declaration from base data, just to remind us...I guess...
336
+ *
337
+ * This indicates if this status ibgib is the tjp for the status line.
338
+ */
339
+ isTjp?: boolean;
340
+
341
+ /**
342
+ * When putting, this is the list of ibGibs to send.
343
+ *
344
+ * ## notes
345
+ *
346
+ * Maybe the receiver needs all of these, maybe it doesn't.
347
+ */
348
+ toTx?: IbGibAddr[];
349
+ /**
350
+ * When putting, this is the list of ibGibs we don't need/want (or refuse)
351
+ * to send.
352
+ *
353
+ * IGNORED ATOW
354
+ *
355
+ * ## notes
356
+ *
357
+ * Not really sure about this atow, since the aws-dynamo space is not a true
358
+ * communication between two separate nodes. Just figure someone will have a
359
+ * reason for it in the future.
360
+ */
361
+ notToTx?: IbGibAddr[];
362
+ /**
363
+ * When communicating, the receiver is asking the sender for
364
+ * these ibGibs.
365
+ *
366
+ * ## notes
367
+ *
368
+ * ATOW this indicates only that the receiver does not have
369
+ * these addresses.
370
+ */
371
+ toRx?: IbGibAddr[];
372
+ /**
373
+ * A receiving space can set this to indicate to the transmitter that it
374
+ * does not need/want these, possibly because they already have them or just
375
+ * are not interested in them.
376
+ *
377
+ * ## notes
378
+ *
379
+ * ATOW this will only be because the receiver already has these addresses.
380
+ */
381
+ notToRx?: IbGibAddr[];
382
+
383
+ /**
384
+ * Flag to indicate that THIS STEP in communication (part of a saga) had no
385
+ * errors.
386
+ */
387
+ success?: boolean;
388
+
389
+ /**
390
+ * If this is true, then the tx/rx inter-space saga is marked
391
+ * as complete and this status ibgib should be the last one.
392
+ */
393
+ complete?: boolean;
394
+ /**
395
+ * List of warnings for THIS STEP in the inter-spatial communication.
396
+ *
397
+ * Should NOT be an accumulating list of warnings, i.e., if a warning
398
+ * happens early on in a tx/rx, then it stays on that ibGib.
399
+ */
400
+ warnings?: string[];
401
+ /**
402
+ * List of errors for THIS STEP in the inter-spatial communication.
403
+ *
404
+ * Should NOT be an accumulating list of errors, i.e., if an error happens
405
+ * early on in a tx/rx, then it stays on that ibGib.
406
+ *
407
+ * ## notes
408
+ *
409
+ * atow my error workflow is pretty minimal. So I think if any error happens
410
+ * the entire saga gets nixed...
411
+ *
412
+ * But it should be that this type of behavior should be determined by
413
+ * on-chain ibgibs that correspond to consensus behavior contracts (with a
414
+ * default behavior ultimately existing hard-coded in source).
415
+ */
416
+ errors?: string[];
417
+
418
+ /**
419
+ * List of ibgib addrs that were newly created specifically for this
420
+ * space operation.
421
+ *
422
+ * ATOW, this means that there was a merged timeline event and
423
+ * the receiving space dynamically applied dna to its existing
424
+ * timeline.
425
+ *
426
+ * ## notes
427
+ *
428
+ * * This should not include status metadata ibgibs, as this is
429
+ * already captured in the `past` rel8n.
430
+ */
431
+ didCreate?: IbGibAddr[];
432
+ /**
433
+ * List of ibgib addrs that were merged in the rx space instead of stored
434
+ * directly.
435
+ *
436
+ * Tx space may choose to somehow mark these as orphaned or whatever seems
437
+ * best per use case. (i.e. I haven't coded that yet even in this naive
438
+ * first implementation)
439
+ */
440
+ didMergeMap?: { [oldAddr: string]: IbGibAddr };
441
+ /**
442
+ * List of ibgibs that were actively transmitted to the receiving
443
+ * space.
444
+ *
445
+ * ## notes
446
+ *
447
+ * * It could be that the receiving space received the ibgib,
448
+ * but that it already had it. It may have been unsure if it
449
+ * had it based on the algorithms in play.
450
+ * * An empty array upon completion of a communication saga
451
+ * indicates that the receiving space already had all of the
452
+ * ibgibs attempted to be sent, i.e., it was already up-to-date.
453
+ *
454
+ */
455
+ didRx?: IbGibAddr[];
456
+ /**
457
+ * List of ibgibs that were actively transmitted from the receiving
458
+ * space to the sending space.
459
+ *
460
+ * ## notes
461
+ *
462
+ * * During a sync operation, any ibgibs that start in the sync space
463
+ * and are "sent" to the local space during the sync operation that
464
+ * did not originate from the local space will be here.
465
+ */
466
+ didTx?: IbGibAddr[];
467
+ }
468
+
469
+ export interface SyncStatusRel8ns extends IbGibRel8ns_V1 {
470
+ created?: IbGibAddr[];
471
+ final?: IbGibAddr[];
472
+ }
473
+
474
+ /**
475
+ * IbGib that tracks/logs the entire syncing process.
476
+ *
477
+ * Since this is created with a tjp, it includes the tjp.gib in
478
+ * each status frame ibgib.gib. This tjp.gib acts as the "saga id"
479
+ * or "status stream id".
480
+ *
481
+ * ## stages
482
+ *
483
+ * ### starting - (code 102)
484
+ *
485
+ * Gets the ball rolling with creating the first status ibgib.
486
+ *
487
+ * ###
488
+ *
489
+ */
490
+ export interface SyncStatusIbGib extends IbGib_V1<SyncStatusData, SyncStatusRel8ns> {
491
+ statusIbGibGraph: IbGib_V1[],
492
+ /**
493
+ * Ibgibs that were created as side effects from a merge.
494
+ *
495
+ * ## notes
496
+ *
497
+ * This happens when you apply one or more local transforms to
498
+ * a timeline in the store that has already been changed by some
499
+ * other space (other than local that is).
500
+ */
501
+ createdIbGibs?: IbGib_V1[];
502
+ /**
503
+ * Ibgibs that are only found in the store and not locally.
504
+ *
505
+ * ## notes
506
+ *
507
+ * This happens when ibgibs were created in some other space.
508
+ */
509
+ storeOnlyIbGibs?: IbGib_V1[];
510
+ /**
511
+ * This is a map of the local space "oldAddr" to the ultimately
512
+ * most recent ibgib address in the outer/sync space.
513
+ *
514
+ * ## notes
515
+ *
516
+ * You will need to also download the createdIbGibs and/or storeOnlyIbGibs
517
+ * which will contain the dependency graph between these two endpoints in
518
+ * each map entry here from old addr -> new addr.
519
+ *
520
+ * It is assumed that the local address already has all of the rest of the
521
+ * dependencies for `oldAddr`.
522
+ */
523
+ ibGibsMergeMap?: { [oldAddr: string]: IbGib_V1 };
524
+ }
525
+
526
+ /**
527
+ * A saga atow refers only to the saga across a single space.
528
+ */
529
+ export interface SagaInfo<
530
+ TIbGib extends IbGib_V1,
531
+ TSpaceOptionsData extends OuterSpaceOptionsData,
532
+ TSpaceOptionsRel8ns extends OuterSpaceOptionsRel8ns,
533
+ TSpaceOptionsIbGib extends OuterSpaceOptionsIbGib<TIbGib, TSpaceOptionsData, TSpaceOptionsRel8ns>,
534
+ TSpaceResultData extends OuterSpaceResultData,
535
+ TSpaceResultRel8ns extends OuterSpaceResultRel8ns,
536
+ TSpaceResultIbGib extends OuterSpaceResultIbGib<TIbGib, TSpaceResultData, TSpaceResultRel8ns>,
537
+ TStatusIbGib extends TIbGib,
538
+ > {
539
+ /**
540
+ * UUID generated at the beginning of a multi-space operation that is common
541
+ * across all spaces.
542
+ *
543
+ * This is in contrast with a `sagaId`, which only pertains to a saga within
544
+ * a single space.
545
+ */
546
+ multiSpaceOpId: string;
547
+ /**
548
+ * UUID generated at the beginning of a sync saga for a single space.
549
+ *
550
+ * This is in contrast with the `syncId`, which pertains to a sync operation
551
+ * across all spaces.
552
+ */
553
+ sagaId: string;
554
+ /**
555
+ * Reference to the space with which we're communicating.
556
+ */
557
+ outerSpace: IbGibSpaceAny;
558
+ spaceId: string;
559
+ participants: ParticipantInfo[];
560
+
561
+ complete?: boolean;
562
+
563
+ /**
564
+ * Only publishes values after subscribed.
565
+ */
566
+ syncStatus$: ReplaySubject<TStatusIbGib>;
567
+ syncStatusSubscriptions: Subscription[];
568
+
569
+ /**
570
+ * For each communication saga, there will be one or more calls to each
571
+ * space's `witness` function. This will produce arg & result ibgibs. This
572
+ * is the observable stream/subject of those witness calls.
573
+ */
574
+ witnessFnArgsAndResults$: ReplaySubject<TSpaceOptionsIbGib | TSpaceResultIbGib>;
575
+
576
+ syncIbGibs_All: IbGib_V1[];
577
+ syncAddrs_All: IbGibAddr[];
578
+ syncAddrs_All_AreTjps: IbGibAddr[];
579
+ syncAddrs_All_WithTjps: IbGibAddr[];
580
+ syncAddrs_All_WithoutTjps: IbGibAddr[];
581
+ syncAddrs_Skipped: IbGibAddr[];
582
+ syncAddrs_ToDo: IbGibAddr[];
583
+ syncAddrs_InProgress: IbGibAddr[];
584
+ syncAddrs_Failed: IbGibAddr[];
585
+ }
586
+
587
+ /**
588
+ * Information about a sync operation over its entirety.
589
+ *
590
+ * ## notes
591
+ *
592
+ * This will be attached to each space arg/result ibgib, but this info object
593
+ * WILL NOT be part of the internal `data` of either arg or result ibGib.
594
+ */
595
+ export interface SyncSagaInfo
596
+ extends SagaInfo<
597
+ IbGib_V1,
598
+ SyncSpaceOptionsData,
599
+ SyncSpaceOptionsRel8ns,
600
+ SyncSpaceOptionsIbGib,
601
+ SyncSpaceResultData,
602
+ SyncSpaceResultRel8ns,
603
+ SyncSpaceResultIbGib,
604
+ SyncStatusIbGib> {
605
+ }
606
+
607
+ // export interface SyncCycleInfo {
608
+ // arg: SyncSpaceOptionsIbGib;
609
+ // result?: SyncSpaceResultIbGib;
610
+ // }
611
+
612
+ /**
613
+ * AWS-specific outerspace type
614
+ */
615
+ export type AWSRegion = 'us-east-1' | string;
616
+
617
+ export interface StatusIbInfo {
618
+ /**
619
+ * Code for the given status.
620
+ *
621
+ */
622
+ statusCode: StatusCode,
623
+ spaceType: OuterSpaceType,
624
+ spaceSubtype: OuterSpaceSubtype,
625
+ sagaId: string,
626
+ delimiter?: string,
627
+ }