xoonya 1.26.0 → 2.0.0

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/server.js CHANGED
@@ -127,6 +127,31 @@ async function routeRequest(req, res) {
127
127
  return;
128
128
  }
129
129
 
130
+ if (req.method === 'GET' && url.pathname === '/v1/proof-center/governance') {
131
+ sendJson(res, 200, proofSdk.buildGovernanceCenter());
132
+ return;
133
+ }
134
+
135
+ if (req.method === 'GET' && url.pathname === '/v1/proof-center/governance/summary') {
136
+ sendJson(res, 200, proofSdk.summarizeGovernanceCenter());
137
+ return;
138
+ }
139
+
140
+ if (req.method === 'GET' && url.pathname === '/v1/proof-center/bridge') {
141
+ sendJson(res, 200, proofSdk.buildBridgeCenter());
142
+ return;
143
+ }
144
+
145
+ if (req.method === 'GET' && url.pathname === '/v1/proof-center/bridge/summary') {
146
+ sendJson(res, 200, proofSdk.summarizeBridgeCenter());
147
+ return;
148
+ }
149
+
150
+ if (req.method === 'GET' && url.pathname === '/v1/proof-center/bridge/profile-support') {
151
+ sendJson(res, 200, proofSdk.buildBridgeProfileSupport());
152
+ return;
153
+ }
154
+
130
155
  if (req.method === 'GET' && url.pathname === '/v1/proof-center/default-loop') {
131
156
  const loop = proofSdk.getDefaultProofLoop(url.searchParams.get('ref'));
132
157
  if (!loop) {
@@ -660,6 +685,281 @@ async function routeRequest(req, res) {
660
685
  return;
661
686
  }
662
687
 
688
+ if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/interpretation-validate') {
689
+ try {
690
+ const body = await readJsonBody(req);
691
+ const result = proofSdk.validateGovernanceInterpretation(body);
692
+ sendJson(res, 200, result);
693
+ } catch (error) {
694
+ sendJson(res, 400, { ok: false, reason: error.message });
695
+ }
696
+ return;
697
+ }
698
+
699
+ if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/coordination') {
700
+ try {
701
+ const body = await readJsonBody(req);
702
+ const result = proofSdk.emitGovernanceCoordination(body);
703
+ sendJson(res, 200, result);
704
+ } catch (error) {
705
+ sendJson(res, 400, { ok: false, reason: error.message });
706
+ }
707
+ return;
708
+ }
709
+
710
+ if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/dashboard') {
711
+ try {
712
+ const body = await readJsonBody(req);
713
+ const result = proofSdk.summarizeGovernanceDashboard(body);
714
+ sendJson(res, 200, result);
715
+ } catch (error) {
716
+ sendJson(res, 400, { ok: false, reason: error.message });
717
+ }
718
+ return;
719
+ }
720
+
721
+ if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/operator-view') {
722
+ try {
723
+ const body = await readJsonBody(req);
724
+ const result = proofSdk.summarizeGovernanceOperatorView(body);
725
+ sendJson(res, 200, result);
726
+ } catch (error) {
727
+ sendJson(res, 400, { ok: false, reason: error.message });
728
+ }
729
+ return;
730
+ }
731
+
732
+ if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/admin-view') {
733
+ try {
734
+ const body = await readJsonBody(req);
735
+ const result = proofSdk.summarizeGovernanceAdminView(body);
736
+ sendJson(res, 200, result);
737
+ } catch (error) {
738
+ sendJson(res, 400, { ok: false, reason: error.message });
739
+ }
740
+ return;
741
+ }
742
+
743
+ if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/dashboard-pack') {
744
+ try {
745
+ const body = await readJsonBody(req);
746
+ const result = proofSdk.buildGovernanceDashboardPack(body);
747
+ sendJson(res, 200, result);
748
+ } catch (error) {
749
+ sendJson(res, 400, { ok: false, reason: error.message });
750
+ }
751
+ return;
752
+ }
753
+
754
+ if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/workflow-pack') {
755
+ try {
756
+ const body = await readJsonBody(req);
757
+ const result = proofSdk.buildGovernanceWorkflowPack(body);
758
+ sendJson(res, 200, result);
759
+ } catch (error) {
760
+ sendJson(res, 400, { ok: false, reason: error.message });
761
+ }
762
+ return;
763
+ }
764
+
765
+ if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/signoff-pack') {
766
+ try {
767
+ const body = await readJsonBody(req);
768
+ const result = proofSdk.buildGovernanceSignoffPack(body);
769
+ sendJson(res, 200, result);
770
+ } catch (error) {
771
+ sendJson(res, 400, { ok: false, reason: error.message });
772
+ }
773
+ return;
774
+ }
775
+
776
+ if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/disputes/summary') {
777
+ try {
778
+ const body = await readJsonBody(req);
779
+ const result = proofSdk.summarizeGovernanceDisputes(body);
780
+ sendJson(res, 200, result);
781
+ } catch (error) {
782
+ sendJson(res, 400, { ok: false, reason: error.message });
783
+ }
784
+ return;
785
+ }
786
+
787
+ if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/disputes/case-review') {
788
+ try {
789
+ const body = await readJsonBody(req);
790
+ const result = proofSdk.reviewGovernanceCase(body);
791
+ sendJson(res, 200, result);
792
+ } catch (error) {
793
+ sendJson(res, 400, { ok: false, reason: error.message });
794
+ }
795
+ return;
796
+ }
797
+
798
+ if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/disputes/action') {
799
+ try {
800
+ const body = await readJsonBody(req);
801
+ const result = proofSdk.summarizeGovernanceDisputeAction(body);
802
+ sendJson(res, 200, result);
803
+ } catch (error) {
804
+ sendJson(res, 400, { ok: false, reason: error.message });
805
+ }
806
+ return;
807
+ }
808
+
809
+ if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/disputes/case-bundle') {
810
+ try {
811
+ const body = await readJsonBody(req);
812
+ const result = proofSdk.buildGovernanceCaseBundle(body);
813
+ sendJson(res, 200, result);
814
+ } catch (error) {
815
+ sendJson(res, 400, { ok: false, reason: error.message });
816
+ }
817
+ return;
818
+ }
819
+
820
+ if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/disputes/resolution-pack') {
821
+ try {
822
+ const body = await readJsonBody(req);
823
+ const result = proofSdk.buildGovernanceResolutionPack(body);
824
+ sendJson(res, 200, result);
825
+ } catch (error) {
826
+ sendJson(res, 400, { ok: false, reason: error.message });
827
+ }
828
+ return;
829
+ }
830
+
831
+ if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/console-pack') {
832
+ try {
833
+ const body = await readJsonBody(req);
834
+ const result = proofSdk.buildGovernanceConsolePack(body);
835
+ sendJson(res, 200, result);
836
+ } catch (error) {
837
+ sendJson(res, 400, { ok: false, reason: error.message });
838
+ }
839
+ return;
840
+ }
841
+
842
+ if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/handoff-bundle') {
843
+ try {
844
+ const body = await readJsonBody(req);
845
+ const result = proofSdk.buildGovernanceHandoffBundle(body);
846
+ sendJson(res, 200, result);
847
+ } catch (error) {
848
+ sendJson(res, 400, { ok: false, reason: error.message });
849
+ }
850
+ return;
851
+ }
852
+
853
+ if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/review-link') {
854
+ try {
855
+ const body = await readJsonBody(req);
856
+ const result = proofSdk.summarizeGovernanceReviewLink(body);
857
+ sendJson(res, 200, result);
858
+ } catch (error) {
859
+ sendJson(res, 400, { ok: false, reason: error.message });
860
+ }
861
+ return;
862
+ }
863
+
864
+ if (req.method === 'POST' && url.pathname === '/v1/proof-center/bridge/receipt-wrap') {
865
+ try {
866
+ const body = await readJsonBody(req);
867
+ const result = proofSdk.buildBridgeReceiptWrap(body);
868
+ sendJson(res, 200, result);
869
+ } catch (error) {
870
+ sendJson(res, 400, { ok: false, reason: error.message });
871
+ }
872
+ return;
873
+ }
874
+
875
+ if (req.method === 'POST' && url.pathname === '/v1/proof-center/bridge/validator-verify') {
876
+ try {
877
+ const body = await readJsonBody(req);
878
+ const result = proofSdk.summarizeBridgeValidatorVerify(body);
879
+ sendJson(res, 200, result);
880
+ } catch (error) {
881
+ sendJson(res, 400, { valid: false, reason: error.message });
882
+ }
883
+ return;
884
+ }
885
+
886
+ if (req.method === 'POST' && url.pathname === '/v1/proof-center/bridge/receipt-ledger-handoff') {
887
+ try {
888
+ const body = await readJsonBody(req);
889
+ const result = proofSdk.buildReceiptLedgerBridgeHandoff(body);
890
+ sendJson(res, 200, result);
891
+ } catch (error) {
892
+ sendJson(res, 400, { ok: false, reason: error.message });
893
+ }
894
+ return;
895
+ }
896
+
897
+ if (req.method === 'POST' && url.pathname === '/v1/proof-center/bridge/economic-handoff') {
898
+ try {
899
+ const body = await readJsonBody(req);
900
+ const result = proofSdk.buildEconomicConsequenceBridgeHandoff(body);
901
+ sendJson(res, 200, result);
902
+ } catch (error) {
903
+ sendJson(res, 400, { ok: false, reason: error.message });
904
+ }
905
+ return;
906
+ }
907
+
908
+ if (req.method === 'POST' && url.pathname === '/v1/proof-center/bridge/economic-conformance-pack') {
909
+ try {
910
+ const body = await readJsonBody(req);
911
+ const result = proofSdk.buildEconomicConsequenceConformancePack(body);
912
+ sendJson(res, 200, result);
913
+ } catch (error) {
914
+ sendJson(res, 400, { ok: false, reason: error.message });
915
+ }
916
+ return;
917
+ }
918
+
919
+ if (req.method === 'POST' && url.pathname === '/v1/proof-center/bridge/operator-review-pack') {
920
+ try {
921
+ const body = await readJsonBody(req);
922
+ const result = proofSdk.buildBridgeOperatorReviewPack(body);
923
+ sendJson(res, 200, result);
924
+ } catch (error) {
925
+ sendJson(res, 400, { ok: false, reason: error.message });
926
+ }
927
+ return;
928
+ }
929
+
930
+ if (req.method === 'POST' && url.pathname === '/v1/proof-center/bridge/compatibility-pack') {
931
+ try {
932
+ const body = await readJsonBody(req);
933
+ const result = proofSdk.buildBridgeCompatibilityPack(body);
934
+ sendJson(res, 200, result);
935
+ } catch (error) {
936
+ sendJson(res, 400, { ok: false, reason: error.message });
937
+ }
938
+ return;
939
+ }
940
+
941
+ if (req.method === 'POST' && url.pathname === '/v1/proof-center/bridge/workflow-pack') {
942
+ try {
943
+ const body = await readJsonBody(req);
944
+ const result = proofSdk.buildBridgeWorkflowPack(body);
945
+ sendJson(res, 200, result);
946
+ } catch (error) {
947
+ sendJson(res, 400, { ok: false, reason: error.message });
948
+ }
949
+ return;
950
+ }
951
+
952
+ if (req.method === 'POST' && url.pathname === '/v1/proof-center/bridge/admin-pack') {
953
+ try {
954
+ const body = await readJsonBody(req);
955
+ const result = proofSdk.buildBridgeAdminPack(body);
956
+ sendJson(res, 200, result);
957
+ } catch (error) {
958
+ sendJson(res, 400, { ok: false, reason: error.message });
959
+ }
960
+ return;
961
+ }
962
+
663
963
  if (req.method === 'GET' && url.pathname === '/v1/integrations') {
664
964
  const response = buildIntegrationListResponse({
665
965
  ok: true,