@ibgib/core-gib 0.1.51 → 0.1.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/other/other-helper.web.mjs.map +1 -1
- package/dist/keystone/keystone-helpers.d.mts.map +1 -1
- package/dist/keystone/keystone-helpers.mjs +15 -0
- package/dist/keystone/keystone-helpers.mjs.map +1 -1
- package/dist/respec-gib.node.mjs +3 -212
- package/dist/respec-gib.node.mjs.map +1 -1
- package/dist/sync/sync-conflict-adv-multitimelines.respec.mjs +2 -2
- package/dist/sync/sync-conflict-adv-multitimelines.respec.mjs.map +1 -1
- package/dist/sync/sync-conflict-text-merge.respec.mjs +2 -2
- package/dist/sync/sync-conflict-text-merge.respec.mjs.map +1 -1
- package/dist/sync/sync-innerspace-dest-ahead-withid.respec.d.mts +0 -5
- package/dist/sync/sync-innerspace-dest-ahead-withid.respec.d.mts.map +1 -1
- package/dist/sync/sync-innerspace-dest-ahead-withid.respec.mjs +309 -295
- package/dist/sync/sync-innerspace-dest-ahead-withid.respec.mjs.map +1 -1
- package/dist/sync/sync-innerspace.respec.mjs +1 -0
- package/dist/sync/sync-innerspace.respec.mjs.map +1 -1
- package/dist/sync/sync-peer/sync-peer-http-receiver/sync-http-node-adapter.d.mts +1 -1
- package/dist/sync/sync-peer/sync-peer-http-receiver/sync-http-node-adapter.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-http-receiver/sync-http-node-adapter.mjs +2 -2
- package/dist/sync/sync-peer/sync-peer-http-receiver/sync-http-node-adapter.mjs.map +1 -1
- package/dist/sync/sync-peer/sync-peer-http-receiver/sync-peer-http-receiver-v1.d.mts +2 -2
- package/dist/sync/sync-peer/sync-peer-http-receiver/sync-peer-http-receiver-v1.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-http-receiver/sync-peer-http-receiver-v1.mjs +14 -3
- package/dist/sync/sync-peer/sync-peer-http-receiver/sync-peer-http-receiver-v1.mjs.map +1 -1
- package/dist/sync/sync-peer/sync-peer-http.respec.d.mts +0 -6
- package/dist/sync/sync-peer/sync-peer-http.respec.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-http.respec.mjs +339 -332
- package/dist/sync/sync-peer/sync-peer-http.respec.mjs.map +1 -1
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.mjs +40 -2
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.mjs.map +1 -1
- package/dist/sync/sync-peer/sync-peer-types.d.mts +5 -0
- package/dist/sync/sync-peer/sync-peer-types.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-v1.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-v1.mjs +19 -4
- package/dist/sync/sync-peer/sync-peer-v1.mjs.map +1 -1
- package/dist/sync/sync-saga-context/sync-saga-context-helpers.d.mts +5 -2
- package/dist/sync/sync-saga-context/sync-saga-context-helpers.d.mts.map +1 -1
- package/dist/sync/sync-saga-context/sync-saga-context-helpers.mjs +44 -11
- package/dist/sync/sync-saga-context/sync-saga-context-helpers.mjs.map +1 -1
- package/dist/sync/sync-saga-coordinator.d.mts +1 -1
- package/dist/sync/sync-saga-coordinator.d.mts.map +1 -1
- package/dist/sync/sync-saga-coordinator.mjs +5 -1
- package/dist/sync/sync-saga-coordinator.mjs.map +1 -1
- package/dist/witness/space/metaspace/metaspace-base.d.mts.map +1 -1
- package/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace-helper.d.mts.map +1 -1
- package/package.json +6 -8
- package/src/common/other/other-helper.web.mts +2 -2
- package/src/keystone/keystone-helpers.mts +15 -0
- package/src/respec-gib.node.mts +3 -200
- package/src/sync/sync-conflict-adv-multitimelines.respec.mts +2 -2
- package/src/sync/sync-conflict-text-merge.respec.mts +2 -2
- package/src/sync/sync-innerspace-dest-ahead-withid.respec.mts +366 -366
- package/src/sync/sync-innerspace.respec.mts +1 -0
- package/src/sync/sync-peer/sync-peer-http-receiver/sync-http-node-adapter.mts +2 -2
- package/src/sync/sync-peer/sync-peer-http-receiver/sync-peer-http-receiver-v1.mts +16 -4
- package/src/sync/sync-peer/sync-peer-http.respec.mts +396 -364
- package/src/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.mts +44 -2
- package/src/sync/sync-peer/sync-peer-types.mts +5 -0
- package/src/sync/sync-peer/sync-peer-v1.mts +15 -4
- package/src/sync/sync-saga-context/sync-saga-context-helpers.mts +47 -16
- package/src/sync/sync-saga-coordinator.mts +7 -2
- package/tsconfig.test.json +1 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/017DF612D9A86192706EE567B059C489EC8DA0B2B558166EFE61F75D8BF1ECEE/test ib.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/0EF68E1CA839A24CAEDB224A8AF92F258BD1F364A97E708705150595B3F67985/test ib.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/12EF728E4F98DDB89990D4CDAF3AC852729E804CE37E2041AF18CBA239328085/test ib.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/152DD42FA80FA6ABD0B4DAAAE9CE1AFCF94E649B210A08955DB8B86E09AF08BE/test ib.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/16A46B37492E2688088C69F237E5CDC4F4E8C1015CF8E66D044DC2FE115F6211/test ib.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/1F7942767491C1D740FFC87E046C2470697FE8D154806B51876C53E607B7F007/test ib.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/35754C7AD2967D57C34396084F1214343C48F9C1AAF1C11CDFB57B5CB95536F5/test ib.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/38CFD2C2DFD185FC1E5BEE8C55C8A4FFBD83B03F533B4F92537000C505939E39/test ib.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/43635745EEAE9EBD3426CC4AD88D2362DE15B2F8E4D1C694B3AE8687E8C6489D/test ib.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/5C4BCD98E1B3494CCFAC355D2C61025DCD43A1D3041E637ABDA83F0E1E7FA0BE/test ib.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/5FC1BCCA0F1EB6E656233401E330A7928BF58C09EF6B6B56EC69FCFAC0B3A47A/test ib.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/60B8ED34520992236C9E1859FAE4BA9DF206CC6BD75DA574E815EAF7B577C1BD/test ib.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/68B53978461355B04CA96CEE33E448CBC39CDEFEA8E907879C1D2E6A542672C4/test ib.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/6B62E238B88A3B5050DFF02AB91402C6702A822389315B4150308B774F5A0D01/test ib.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/6F7EC702F1109A564CFE009F634B27E5F82D6A309CF51B11F49846ABEEAD04B1/test ib.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/7AE69551608DB82E23DBA98CA7D059DF3F5C9E37174E581F7C154935F4362AA7/test ib.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/8C851E9DD394053BB50716EA6CDD07A48FA76AF5BB55513F898A18B2A4C64D1F/test ib.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/984DAD369079FEF2F83082F1CD944A432690F1CB0A5ECA9F009D50B385C4061A/test ib.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/C466B016831B11EEEC611208EDB50FD7BACD7E37D0037C0D1D78BD5B3D892794/test ib.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/C5D0AA2C7A2C01C52EFDF70242AA6CAAE06BCA80301A425D4E508E9ACD33DF44/test ib.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/CDDFD5D61010F7B15CFD78C49865C0134E8E037779DD80C6B4DED7DEB0D4CBB7/test ib.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/DDFAB26C3991470523BD7543D946A24A9CFEC9D5BEC197B7BD963E1507057A93/test ib.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/E174442450BBA2A570B0166CDF04844C3A5D1F7199DC59E0FA49F1BBACA47F5F/test ib.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/E6CE9621CF266A675DB7E3EBABD5D636E46E8006F116A0F7F0769B87DDDBFBB0/test ib.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 -1 1766860935000^7978FD0F9DD4EB6208A2D2113011F95E5C7EE80072BA3B7E4AC737CC771D621B.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 0 1766860935000^013C09075DF303BB5822FEEFE57F26B9F0DEE6DD382B116816FCDC2B7CAF0696.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 1 1766860935000^4EEBAD21A82BAC51A7B952DA32DACB37A653695D5D512A348CF15DB9B7DED5AC.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 10 1766860938000^84544F34B1297ED8F5FD4B437FCD4F1044FD0D40A0B270F8C7E79D89AA058DD6.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 11 1766860938000^023B07336455CD39B03DC52AF523DA19B588FD32ED7A4BB5BBE9ABE59ED75195.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 12 1766860939000^49685AA6F0064868886EBA984B072F6C63F92FC3315C29DDDF750D5B56E87D6B.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 13 1766860939000^A2475B1C99AC9F8B9A4D8B2BD8CB39A76FAA2E13AB2F7CEADA4AB02B42FF8BE4.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 14 1766860939000^2D0C93D837FFF096346E10F276BD1F08ECE4A2EC94BE9BC58759EBABAB1F2E42.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 15 1766860939000^4FA9AFA0EA50B833B342716C7745B9A39A7C0F9A09B4666CA67080A49EAB611B.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 16 1766860939000^A65760BEED125117DE7DF2F481A0F7CD250FFB579138ECC1A19C8401DAFCEB51.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 17 1766860940000^226FA64E1B4591C150F595D8408530502417C7FFEE3915589382F9C3B585053C.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 18 1766860940000^1ABF20687FB34275E0EE737538E7E5D4F15CDCB128C4F332043CB76AC78B0F05.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 19 1766860940000^89A44A1912B20AE873402C287CE09C4D41073F0A5B703CB22FD5272BB907FC19.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 2 1766860936000^A8D1C5244B85155B130EFCA9CF25185A9B7060F549603B993F2CA98FB269B178.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 20 1766860940000^72905A7F6A0A859003049827534B579BE090F0B6A221D14584745DAE6A999943.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 21 1766860948000^71168CE7419FFDB6E945655E1B3597A726111666C305EDA9A76D97FD7215E929.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 22 1766860967000^A5E8805E1AC44CF2A07606613DE14704BC1943268EFF48BF181E7216D8F07AA3.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 3 1766860936000^66806071E91EAC9E8F90A81700DD37FB56B7DFDE7B32FE47E142BAC58907173C.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 4 1766860937000^1A097ACE63079C7D91AC964F783834D172C41CD3FAD0D27A5B95DC6E1E5B7D6A.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 5 1766860937000^746153300B51309B664E4035E092CAE07F487A2B44D5DB79B770C7D9968D45CA.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 6 1766860937000^3F1EFF11C729D6175922400928667D3391E3D7B4B29CECD67987F3259A5003C5.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 7 1766860938000^D2867FC7F2A08C6678BAA320EE449F89E56D81EDC3BFFA79F9DA64BF98701014.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 8 1766860938000^AA9E5246E533F704E42BED13B878B830B91143AE71C8603FFCF187CF39904915.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/meta_stone F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6 9 1766860938000^E4B12653516EB8690ED18ECFF3EA7AB5EA3FF70881D730F5859F193F5872DF15.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/F50B84DBC36E937524F482A095F81F7FA3ABC63CCBB65DB2719F5DE80E59D6C6/test ib.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/04E79CE54F49DCEA75652ADF674DC9B21BA641944AD97ED7ED1369CF3A880E8D/mut8.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/0647EB78DB2C48AF3AE9D3EF7989A3DDA1A797D04BE18DB1210B3504BC39BA4E/mut8.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/08B4A7A62BC7DE27C180A3F70FA7C6C8F9728A98E79B200D9B2EE2D11E62CD97/mut8.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/0B2FEF92D3630CDFDD14C453DDDA288478022CEB778E0BB4ACC9C9511C770A39/mut8.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/3757E01592FABCA5D139026F156318A7F86AC097CC10ABA243D4E665EB3550C5/mut8.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/3A66623B180568E2AE3E95BD6C48684E765B6B8C2147A4DD13426B6808AC2567/mut8.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/3EADB84024E06764489225E537F285BF7F7F85C3ACC013F0FCB28B79E227DE2D/mut8.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/471A5F0BA13425E3412A376452549E5158CD5516C4E005872A50A10D7390CF12/mut8.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/6E6EA2A701C3AC1B5BCD766F39C59BA7BC5139AAF0EB5E9DE8814F77C4A192A7/mut8.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/7EF033B1C3C39C05359C89C301DEE7365F6F7A816776F6A0E540CE1A212CD612/mut8.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/834AECEDC108F37DADA5BD3583FA9C1E612AFA3FFFB1153CA0CD2F51239AD93F/mut8.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/8CA9BDE2ED96C7C8039D5AF78AEF620A985E32352238DEACACC7E2329006B9B9/mut8.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/90C61CC1159B21E9FE686C06D5C76FF6F5236F8C7D39CC183B8C81CE36471D9C/fork.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/A89842F2240358AEC12AE59014A14875AB6FC5C8EF2A5C50D8BD92EB5F54F4B6/mut8.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/B10FBD60588500D94D6CDA19E5E24DF7F4C3EDF66368E5875F13C4BFF9A8FD03/mut8.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/B5A0CAF33ACC64A57647ADD18B4F0CAD820F427819BB4615567131994D0399AB/mut8.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/C0223AA1B3B147E3AFC4233C60025BE4C975652EBF77C24D8B8FABC413594137/mut8.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/D07097470D6970574C539E1E16AEFCE0A3A67987C7554C9EEFA7204D6D1D81D4/mut8.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/D92466D1FCE56DB0828A2509590DDA0040FF250FD4FCE7F3E45B5D84887C83F0/mut8.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/E035FDD6BDD26B164AF5AD675D0567BC0FFB6E10E14BAFA6617EDB536EE162B9/mut8.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/E8B2955902784AFC4B4A251C771EC770D94234440C8B02C63B12628C29447069/mut8.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/EF9D3619C817B27EC4402BC215D08CC95A83E5042F4FC35AE2E737AC33B05629/mut8.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/F0D5006EF21791D68460DB0111983602EC450BBFFB3E47134D357A1BCD9FBD15/mut8.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/F15D698186AADD2BA9F3028F4F84630505D06220AB6482381FB35755AFC77E5F/mut8.json +0 -1
- package/ibgib/registerNewI_troot/4215392c-space_baseDir/tmp/4215392c-space/dna/F1913D9CF3C4F2CDE56C39EA86F8EB9A65D8FA22750DACD2B496EF27D88DE260/mut8.json +0 -1
- package/test_output.log +0 -0
|
@@ -1,333 +1,340 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
});
|
|
1
|
+
// /**
|
|
2
|
+
// * @module sync-peer-http.respec
|
|
3
|
+
// *
|
|
4
|
+
// * Verifies SyncSagaCoordinator using a mock HTTP/SSE "thin layer".
|
|
5
|
+
// * This utilizes SyncPeerHttpSender_V1 and SyncPeerHttpReceiver_V1 for network synchronization simulations.
|
|
6
|
+
// */
|
|
7
|
+
export {};
|
|
8
|
+
// import * as cp from 'child_process';
|
|
9
|
+
// import * as fs from 'fs';
|
|
10
|
+
// import * as path from 'path';
|
|
11
|
+
// import {
|
|
12
|
+
// respecfully, lastOfAll, iReckon, ifWe, ifWeMight
|
|
13
|
+
// } from '@ibgib/helper-gib/dist/respec-gib/respec-gib.mjs';
|
|
14
|
+
// const maam = `[${import.meta.url}]`, sir = maam;
|
|
15
|
+
// import { clone, delay, extractErrorMsg, pretty } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs';
|
|
16
|
+
// import { getIbGibAddr } from '@ibgib/ts-gib/dist/helper.mjs';
|
|
17
|
+
// import { GLOBAL_LOG_A_LOT } from '../../core-constants.mjs';
|
|
18
|
+
// import { SyncSagaCoordinator } from '../sync-saga-coordinator.mjs';
|
|
19
|
+
// import { getFromSpace, putInSpace, registerNewIbGib } from '../../witness/space/space-helper.mjs';
|
|
20
|
+
// import { Metaspace_Innerspace } from '../../witness/space/metaspace/metaspace-innerspace/metaspace-innerspace.mjs';
|
|
21
|
+
// import { InnerSpace_V1 } from '../../witness/space/inner-space/inner-space-v1.mjs';
|
|
22
|
+
// import { createTimelineRootTestHelper, getTestKeystoneServiceHelper } from '../../test-helpers.mjs';
|
|
23
|
+
// import { mut8Timeline, } from '../../timeline/timeline-api.mjs';
|
|
24
|
+
// import { DEFAULT_INNER_SPACE_DATA_V1 } from '../../witness/space/inner-space/inner-space-types.mjs';
|
|
25
|
+
// import { toDto } from '../../common/other/ibgib-helper.mjs';
|
|
26
|
+
// import { getSyncSagaFrameDependencyGraph } from '../sync-helpers.mjs';
|
|
27
|
+
// import { IbGib_V1 } from '@ibgib/ts-gib/dist/V1/types.mjs';
|
|
28
|
+
// import { SyncIbGib_V1 } from '../sync-types.mjs';
|
|
29
|
+
// import { SyncStage } from '../sync-constants.mjs';
|
|
30
|
+
// import { getDependencyGraph } from '../../common/other/graph-helper.mjs';
|
|
31
|
+
// import { SyncPeerHttpSender_V1 } from './sync-peer-http-sender/sync-peer-http-sender-v1.mjs';
|
|
32
|
+
// import { SyncPeerHttpReceiver_V1 } from './sync-peer-http-receiver/sync-peer-http-receiver-v1.mjs';
|
|
33
|
+
// import { SyncPeerHttpSenderData_V1 } from './sync-peer-http-sender/sync-peer-http-sender-types.mjs';
|
|
34
|
+
// import { SyncPeerHttpReceiverData_V1 } from './sync-peer-http-receiver/sync-peer-http-receiver-types.mjs';
|
|
35
|
+
// import { SyncSagaContextIbGib_V1 } from '../sync-saga-context/sync-saga-context-types.mjs';
|
|
36
|
+
// import { SyncHttpNodeAdapter_V1 } from './sync-peer-http-receiver/sync-http-node-adapter.mjs';
|
|
37
|
+
// const logalot = GLOBAL_LOG_A_LOT;
|
|
38
|
+
// const lc = `[sync-peer-http.respec]`;
|
|
39
|
+
// await respecfully(sir, `Sync HTTP Peers`, async () => {
|
|
40
|
+
// let metaspace: Metaspace_Innerspace;
|
|
41
|
+
// let sourceSpace: InnerSpace_V1;
|
|
42
|
+
// let destSpace: InnerSpace_V1;
|
|
43
|
+
// // We focus this test initially for development
|
|
44
|
+
// await ifWe(sir, `Basic Push Sync over Mocked HTTP/SSE`, async () => {
|
|
45
|
+
// // 1. Setup Spaces
|
|
46
|
+
// metaspace = new Metaspace_Innerspace(undefined);
|
|
47
|
+
// await metaspace.initialize({
|
|
48
|
+
// getFnAlert: () => async ({ title, msg }) => { console.log(`[Alert] ${title}: ${msg}`); },
|
|
49
|
+
// getFnPrompt: () => async ({ title, msg }) => { console.log(`[Prompt] ${title}: ${msg}`); return ''; },
|
|
50
|
+
// getFnPromptPassword: () => async (title, msg) => { console.log(`[PromptPwd] ${title}: ${msg}`); return null; },
|
|
51
|
+
// });
|
|
52
|
+
// while (!metaspace.initialized) { await delay(10); }
|
|
53
|
+
// const defaultLocalUserSpace = await metaspace.getLocalUserSpace({ lock: false });
|
|
54
|
+
// if (!defaultLocalUserSpace) { throw new Error(`(UNEXPECTED) defaultLocalUserSpace falsy?`); }
|
|
55
|
+
// await defaultLocalUserSpace.initialized;
|
|
56
|
+
// sourceSpace = new InnerSpace_V1({
|
|
57
|
+
// ...DEFAULT_INNER_SPACE_DATA_V1,
|
|
58
|
+
// name: 'source',
|
|
59
|
+
// uuid: 'source_uuid',
|
|
60
|
+
// description: 'source test space',
|
|
61
|
+
// });
|
|
62
|
+
// await sourceSpace.initialized;
|
|
63
|
+
// destSpace = new InnerSpace_V1({
|
|
64
|
+
// ...DEFAULT_INNER_SPACE_DATA_V1,
|
|
65
|
+
// name: 'dest',
|
|
66
|
+
// uuid: 'dest_uuid',
|
|
67
|
+
// description: 'dest test space',
|
|
68
|
+
// });
|
|
69
|
+
// await destSpace.initialized;
|
|
70
|
+
// // 2. Seed Source Data
|
|
71
|
+
// if (logalot) { console.log(`${lc} Creating data in Source...`); }
|
|
72
|
+
// const root = await createTimelineRootTestHelper({
|
|
73
|
+
// ib: 'timeline_root',
|
|
74
|
+
// data: { type: 'root', },
|
|
75
|
+
// space: sourceSpace,
|
|
76
|
+
// });
|
|
77
|
+
// const child = await mut8Timeline({
|
|
78
|
+
// timeline: root,
|
|
79
|
+
// mut8Opts: {
|
|
80
|
+
// dataToAddOrPatch: { type: 'child', },
|
|
81
|
+
// },
|
|
82
|
+
// metaspace,
|
|
83
|
+
// space: sourceSpace,
|
|
84
|
+
// });
|
|
85
|
+
// const childAddr = getIbGibAddr({ ibGib: child });
|
|
86
|
+
// // 3. Setup Coordinators & Peer
|
|
87
|
+
// if (logalot) { console.log(`${lc} Setting up Coordinators...`); }
|
|
88
|
+
// const mockKeystone = await getTestKeystoneServiceHelper();
|
|
89
|
+
// const senderCoordinator = new SyncSagaCoordinator(mockKeystone);
|
|
90
|
+
// const receiverCoordinator = new SyncSagaCoordinator(mockKeystone);
|
|
91
|
+
// // --- Mocking the HTTP "Network" ---
|
|
92
|
+
// // Instead of real fetch and EventSource, we wire the Sender's outgoing HTTP
|
|
93
|
+
// // calls directly to the Receiver's incoming endpoints.
|
|
94
|
+
// const receiverPeerData: SyncPeerHttpReceiverData_V1 = { classname: SyncPeerHttpReceiver_V1.name };
|
|
95
|
+
// const receiverPeer = new SyncPeerHttpReceiver_V1(receiverPeerData);
|
|
96
|
+
// await receiverPeer.initialized;
|
|
97
|
+
// await receiverPeer.initializeOpts({
|
|
98
|
+
// localCoordinator: receiverCoordinator,
|
|
99
|
+
// localMetaspace: metaspace,
|
|
100
|
+
// localSpace: destSpace,
|
|
101
|
+
// keystoneSvc: mockKeystone
|
|
102
|
+
// });
|
|
103
|
+
// // We'll subclass/monkey-patch the Sender peer to use mock fetching
|
|
104
|
+
// class MockSyncPeerHttpSender extends SyncPeerHttpSender_V1 {
|
|
105
|
+
// override async sendContextRequest(context: SyncSagaContextIbGib_V1): Promise<SyncSagaContextIbGib_V1 | undefined> {
|
|
106
|
+
// // Mock POST /sync/frame
|
|
107
|
+
// // Real sender would serialize and POST. Here we just hand it to receiver:
|
|
108
|
+
// const responsePromise = new Promise<SyncSagaContextIbGib_V1 | undefined>(async (resolve, reject) => {
|
|
109
|
+
// try {
|
|
110
|
+
// const rel8ns = context.rel8ns;
|
|
111
|
+
// if (!rel8ns || (rel8ns.sagaFrame || []).length !== 1) { throw new Error(`(UNEXPECTED) context.rel8ns.sagaFrame missing?`); }
|
|
112
|
+
// const sagaAddr = rel8ns.sagaFrame![0];
|
|
113
|
+
// const getSagaRes = await getFromSpace({ addr: sagaAddr, space: sourceSpace });
|
|
114
|
+
// const sagaFrame = getSagaRes.ibGibs![0] as SyncIbGib_V1;
|
|
115
|
+
// const { msgStones, identities } = await getSyncSagaFrameDependencyGraph({
|
|
116
|
+
// sagaIbGib: sagaFrame,
|
|
117
|
+
// localSpace: sourceSpace,
|
|
118
|
+
// });
|
|
119
|
+
// const msg = msgStones[0];
|
|
120
|
+
// // Identity transportation logic (Bill Architecture)
|
|
121
|
+
// const identityIbGibs: IbGib_V1[] = [];
|
|
122
|
+
// const { signedSessionKeystone } = context;
|
|
123
|
+
// if (signedSessionKeystone) {
|
|
124
|
+
// if (msg.data!.stage === SyncStage.init) {
|
|
125
|
+
// // transmit full keystone graph on the first handshake
|
|
126
|
+
// const keystoneGraph = await getDependencyGraph({
|
|
127
|
+
// ibGib: signedSessionKeystone,
|
|
128
|
+
// space: sourceSpace,
|
|
129
|
+
// });
|
|
130
|
+
// identityIbGibs.push(...Object.values(keystoneGraph));
|
|
131
|
+
// } else {
|
|
132
|
+
// // transmit only the latest evolution for subsequent turns
|
|
133
|
+
// identityIbGibs.push(signedSessionKeystone);
|
|
134
|
+
// }
|
|
135
|
+
// }
|
|
136
|
+
// const payloadIbGibsControl = [...identities, ...identityIbGibs, msg, sagaFrame, context].filter(x => !!x).map(x => toDto({ ibGib: x }));
|
|
137
|
+
// // The Server Adapter calls receiverPeer.handleIncomingSyncRequest
|
|
138
|
+
// const responseContext = await receiverPeer.handleIncomingSyncRequest({
|
|
139
|
+
// context,
|
|
140
|
+
// payloadIbGibsControl
|
|
141
|
+
// });
|
|
142
|
+
// if (!responseContext) {
|
|
143
|
+
// resolve(undefined);
|
|
144
|
+
// return;
|
|
145
|
+
// }
|
|
146
|
+
// // **Mock the Server Adapter returning data**
|
|
147
|
+
// // Real server would stream the newly evolved Control Context ibgibs to SSE,
|
|
148
|
+
// // followed by the response domain payload ibgibs.
|
|
149
|
+
// // We must MANUALLY persist the control ibgibs to the sender space FIRST,
|
|
150
|
+
// // to simulate the client downloading and validating them from the SSE connection.
|
|
151
|
+
// await delay(100);
|
|
152
|
+
// const responseSagaAddr = responseContext.rel8ns!.sagaFrame![0];
|
|
153
|
+
// const getResponseSagaRes = await getFromSpace({ addr: responseSagaAddr, space: destSpace });
|
|
154
|
+
// const responseSagaFrame = getResponseSagaRes.ibGibs![0] as SyncIbGib_V1;
|
|
155
|
+
// const depGraphResponse = await getSyncSagaFrameDependencyGraph({
|
|
156
|
+
// sagaIbGib: responseSagaFrame,
|
|
157
|
+
// localSpace: destSpace,
|
|
158
|
+
// });
|
|
159
|
+
// const responseIdentityIbGibs: IbGib_V1[] = [];
|
|
160
|
+
// if (responseContext.signedSessionKeystone) {
|
|
161
|
+
// responseIdentityIbGibs.push(responseContext.signedSessionKeystone);
|
|
162
|
+
// }
|
|
163
|
+
// const responsePayloadIbGibsControl = [
|
|
164
|
+
// ...depGraphResponse.identities,
|
|
165
|
+
// ...responseIdentityIbGibs,
|
|
166
|
+
// depGraphResponse.msgStones[0],
|
|
167
|
+
// responseSagaFrame,
|
|
168
|
+
// context
|
|
169
|
+
// ].filter(x => !!x).map(x => toDto({ ibGib: x }));
|
|
170
|
+
// for (const ibGib of responsePayloadIbGibsControl) {
|
|
171
|
+
// await putInSpace({ space: sourceSpace, ibGibs: [ibGib] });
|
|
172
|
+
// await registerNewIbGib({ ibGib, space: sourceSpace, fnBroadcast: undefined });
|
|
173
|
+
// }
|
|
174
|
+
// await delay(5); // Simulate end of SSE task event
|
|
175
|
+
// // Resolve with the responseContext
|
|
176
|
+
// resolve(responseContext);
|
|
177
|
+
// // THEN simulate streaming the domain payload ibgibs to the local subject
|
|
178
|
+
// if (responseContext.payloadIbGibsDomain) {
|
|
179
|
+
// new Promise<void>(async (resDom) => {
|
|
180
|
+
// for (const domainIbGib of responseContext.payloadIbGibsDomain!) {
|
|
181
|
+
// await delay(1); // emulate network gap between SSE events
|
|
182
|
+
// await this.payloadIbGibsDomainReceived$.next(domainIbGib);
|
|
183
|
+
// }
|
|
184
|
+
// resDom();
|
|
185
|
+
// });
|
|
186
|
+
// }
|
|
187
|
+
// } catch (e) {
|
|
188
|
+
// reject(e);
|
|
189
|
+
// }
|
|
190
|
+
// });
|
|
191
|
+
// return responsePromise;
|
|
192
|
+
// }
|
|
193
|
+
// }
|
|
194
|
+
// const senderPeerData: SyncPeerHttpSenderData_V1 = {
|
|
195
|
+
// classname: SyncPeerHttpSender_V1.name,
|
|
196
|
+
// syncRoute: 'http://mock/sync/frame',
|
|
197
|
+
// syncEventsRoute: 'http://mock/sync/events'
|
|
198
|
+
// };
|
|
199
|
+
// // Use the already created senderCoordinator
|
|
200
|
+
// const testKeystoneSvc = mockKeystone;
|
|
201
|
+
// const senderPeer = new MockSyncPeerHttpSender(senderPeerData);
|
|
202
|
+
// await senderPeer.initialized;
|
|
203
|
+
// // We configure localSpace and a senderTempSpace for the mock:
|
|
204
|
+
// const senderTempSpace = new InnerSpace_V1({
|
|
205
|
+
// ...DEFAULT_INNER_SPACE_DATA_V1, name: 'sender_temp', uuid: 'sender_temp_uuid'
|
|
206
|
+
// });
|
|
207
|
+
// await senderTempSpace.initialized;
|
|
208
|
+
// await senderPeer.initializeOpts({
|
|
209
|
+
// localSpace: sourceSpace,
|
|
210
|
+
// localTempSpace: senderTempSpace,
|
|
211
|
+
// keystoneSvc: testKeystoneSvc
|
|
212
|
+
// });
|
|
213
|
+
// // 4. Run Sync
|
|
214
|
+
// if (logalot) { console.log(`${lc} Running Sync...`); }
|
|
215
|
+
// try {
|
|
216
|
+
// const resSync = await senderCoordinator.sync({
|
|
217
|
+
// peer: senderPeer,
|
|
218
|
+
// localSpace: sourceSpace,
|
|
219
|
+
// metaspace: metaspace,
|
|
220
|
+
// domainIbGibs: [child], // Sync the child
|
|
221
|
+
// useSessionIdentity: false, // Testing logic only
|
|
222
|
+
// });
|
|
223
|
+
// await resSync.done;
|
|
224
|
+
// iReckon(sir, true).asTo('Mocked request ran').isGonnaBeTrue();
|
|
225
|
+
// // We now expect the entire saga to complete because handleIncomingSyncRequest works
|
|
226
|
+
// let childInDest = await getFromSpace({ addr: childAddr, space: destSpace });
|
|
227
|
+
// iReckon(sir, childInDest.success).asTo('Child is correctly pushed to destination space').isGonnaBeTrue();
|
|
228
|
+
// } catch (error: any) {
|
|
229
|
+
// console.error(`${lc}[senderCoordinator.sync] FULL ERROR:`, error.stack || error.message || error);
|
|
230
|
+
// // Will fail initially because handleIncomingSyncRequest is not implemented
|
|
231
|
+
// iReckon(sir, false).asTo(`Unexpected error: ${extractErrorMsg(error)}`).isGonnaBeTrue();
|
|
232
|
+
// }
|
|
233
|
+
// });
|
|
234
|
+
// await respecfully(sir, `Real Sync via Local HTTP/2 Node Adapter with Self-Signed Certs`, async () => {
|
|
235
|
+
// // 1. Generate Self-Signed Certs via OpenSSL or PowerShell
|
|
236
|
+
// const tmpDir = path.join(process.cwd(), 'tmp-certs');
|
|
237
|
+
// const keyPath = path.join(tmpDir, 'server.key');
|
|
238
|
+
// const certPath = path.join(tmpDir, 'server.cert');
|
|
239
|
+
// const pfxPath = path.join(tmpDir, 'server.pfx');
|
|
240
|
+
// let hasTlsGenerator = false;
|
|
241
|
+
// let isWin = process.platform === 'win32';
|
|
242
|
+
// if (isWin) {
|
|
243
|
+
// hasTlsGenerator = true;
|
|
244
|
+
// } else {
|
|
245
|
+
// try {
|
|
246
|
+
// cp.execSync('openssl version', { stdio: 'ignore' });
|
|
247
|
+
// hasTlsGenerator = true;
|
|
248
|
+
// } catch (e) {
|
|
249
|
+
// console.warn(`${lc} OpenSSL not found in PATH. Skipping HTTP/2 Native test.`);
|
|
250
|
+
// }
|
|
251
|
+
// }
|
|
252
|
+
// if (hasTlsGenerator) {
|
|
253
|
+
// if (!fs.existsSync(tmpDir)) { fs.mkdirSync(tmpDir, { recursive: true }); }
|
|
254
|
+
// let keyInfo: Buffer | undefined;
|
|
255
|
+
// let certInfo: Buffer | undefined;
|
|
256
|
+
// let pfxInfo: Buffer | undefined;
|
|
257
|
+
// if (isWin) {
|
|
258
|
+
// if (!fs.existsSync(pfxPath)) {
|
|
259
|
+
// if (logalot) { console.log(`${lc} Generating self-signed cert via PowerShell...`); }
|
|
260
|
+
// const psScript = `
|
|
261
|
+
// $cert = New-SelfSignedCertificate -CertStoreLocation "Cert:\\CurrentUser\\My" -Subject "localhost" -KeyExportPolicy Exportable -NotAfter (Get-Date).AddDays(1)
|
|
262
|
+
// $pwd = ConvertTo-SecureString -String "testpass" -Force -AsPlainText
|
|
263
|
+
// Export-PfxCertificate -Cert $cert -FilePath "${pfxPath.replace(/\\/g, '\\\\')}" -Password $pwd
|
|
264
|
+
// Remove-Item -Path $cert.PSPath
|
|
265
|
+
// `;
|
|
266
|
+
// cp.execSync(`powershell -Command "${psScript.replace(/\n/g, '; ')}"`, { stdio: 'ignore' });
|
|
267
|
+
// }
|
|
268
|
+
// pfxInfo = fs.readFileSync(pfxPath);
|
|
269
|
+
// } else {
|
|
270
|
+
// if (!fs.existsSync(keyPath) || !fs.existsSync(certPath)) {
|
|
271
|
+
// if (logalot) { console.log(`${lc} Generating self-signed cert...`); }
|
|
272
|
+
// cp.execSync(`openssl req -x509 -newkey rsa:2048 -nodes -keyout ${keyPath} -out ${certPath} -days 1 -subj "/CN=localhost"`, { stdio: 'ignore' });
|
|
273
|
+
// }
|
|
274
|
+
// keyInfo = fs.readFileSync(keyPath);
|
|
275
|
+
// certInfo = fs.readFileSync(certPath);
|
|
276
|
+
// }
|
|
277
|
+
// // Bypass self-signed cert rejection in Node fetch
|
|
278
|
+
// process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
|
|
279
|
+
// // 2. Setup Spaces
|
|
280
|
+
// metaspace = new Metaspace_Innerspace(undefined);
|
|
281
|
+
// await metaspace.initialize({
|
|
282
|
+
// getFnAlert: () => async () => { },
|
|
283
|
+
// getFnPrompt: () => async () => '',
|
|
284
|
+
// getFnPromptPassword: () => async () => null,
|
|
285
|
+
// });
|
|
286
|
+
// while (!metaspace.initialized) { await delay(10); }
|
|
287
|
+
// const defaultLocalUserSpace = await metaspace.getLocalUserSpace({ lock: false });
|
|
288
|
+
// await defaultLocalUserSpace?.initialized;
|
|
289
|
+
// sourceSpace = new InnerSpace_V1({ ...DEFAULT_INNER_SPACE_DATA_V1, name: 'source_h2', uuid: 'source_h2_uuid' });
|
|
290
|
+
// await sourceSpace.initialized;
|
|
291
|
+
// destSpace = new InnerSpace_V1({ ...DEFAULT_INNER_SPACE_DATA_V1, name: 'dest_h2', uuid: 'dest_h2_uuid' });
|
|
292
|
+
// await destSpace.initialized;
|
|
293
|
+
// // 3. Setup Node Adapter & Receiver
|
|
294
|
+
// const mockKeystone = await getTestKeystoneServiceHelper();
|
|
295
|
+
// const receiverCoordinator = new SyncSagaCoordinator(mockKeystone);
|
|
296
|
+
// const receiverPeer = new SyncPeerHttpReceiver_V1({ classname: SyncPeerHttpReceiver_V1.name });
|
|
297
|
+
// await receiverPeer.initialized;
|
|
298
|
+
// await receiverPeer.initializeOpts({
|
|
299
|
+
// localCoordinator: receiverCoordinator,
|
|
300
|
+
// localMetaspace: metaspace,
|
|
301
|
+
// localSpace: destSpace,
|
|
302
|
+
// keystoneSvc: mockKeystone
|
|
303
|
+
// });
|
|
304
|
+
// const port = 8443;
|
|
305
|
+
// const adapter = new SyncHttpNodeAdapter_V1({
|
|
306
|
+
// receiverPeer,
|
|
307
|
+
// port,
|
|
308
|
+
// key: keyInfo,
|
|
309
|
+
// cert: certInfo,
|
|
310
|
+
// pfx: pfxInfo,
|
|
311
|
+
// passphrase: 'testpass',
|
|
312
|
+
// basePath: '/sync'
|
|
313
|
+
// });
|
|
314
|
+
// await adapter.start();
|
|
315
|
+
// // 4. Test the Adapter Connection
|
|
316
|
+
// if (logalot) { console.log(`${lc} Pinging the HTTP/2 Adapter via POST...`); }
|
|
317
|
+
// // Create a dummy context structure just to appease the parser and prove connection success
|
|
318
|
+
// const testContext: any = { classname: 'SyncSagaContextIbGib_V1', rel8ns: {}, data: {} };
|
|
319
|
+
// const payloadBody = JSON.stringify({ context: testContext, payloadIbGibsControl: [] });
|
|
320
|
+
// try {
|
|
321
|
+
// const res = await fetch(`https://localhost:${port}/sync/frame`, {
|
|
322
|
+
// method: 'POST',
|
|
323
|
+
// headers: { 'Content-Type': 'application/json', 'x-client-id': 'test-123' },
|
|
324
|
+
// body: payloadBody
|
|
325
|
+
// });
|
|
326
|
+
// await ifWe(sir, 'check http2 adapter', async () => {
|
|
327
|
+
// iReckon(sir, res.ok).asTo('Successfully reached HTTP/2 Adapter via POST').isGonnaBeTrue();
|
|
328
|
+
// });
|
|
329
|
+
// // The receiver peer inside the adapter will throw a normal logged warning about invalid saga formats from our dummy context,
|
|
330
|
+
// // but the HTTP transport should respond 200 OK, verifying the http2 server is cleanly bound!
|
|
331
|
+
// } catch (err) {
|
|
332
|
+
// console.error(`${lc} HTTP/2 test failed:`, err);
|
|
333
|
+
// iReckon(sir, false).asTo('HTTP/2 Adapter POST should not throw').isGonnaBeTrue();
|
|
334
|
+
// } finally {
|
|
335
|
+
// await adapter.stop();
|
|
336
|
+
// }
|
|
337
|
+
// }
|
|
338
|
+
// });
|
|
339
|
+
// });
|
|
333
340
|
//# sourceMappingURL=sync-peer-http.respec.mjs.map
|