@topolo/sdk 0.2.8 → 0.2.9
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/index.cjs +347 -71
- package/dist/index.d.cts +310 -66
- package/dist/index.d.ts +310 -66
- package/dist/index.js +346 -71
- package/package.json +1 -1
- package/src/applications.generated.ts +114 -59
- package/src/index.ts +17 -0
- package/src/modules/p2p.test.ts +218 -0
- package/src/modules/p2p.ts +451 -0
- package/src/services.generated.ts +15 -12
- package/src/services.test.ts +2 -1
package/dist/index.js
CHANGED
|
@@ -58,39 +58,41 @@ var TopoloHttpError = class extends TopoloSdkError {
|
|
|
58
58
|
|
|
59
59
|
// src/services.generated.ts
|
|
60
60
|
var SERVICES = {
|
|
61
|
-
agent: "https://
|
|
61
|
+
agent: "https://agent-api.topolo.app",
|
|
62
62
|
auth: "https://auth.topolo.app",
|
|
63
63
|
books: "https://books.topolo.app",
|
|
64
64
|
bugfix: "https://bugfix.topolo.app",
|
|
65
|
-
bytes: "https://
|
|
65
|
+
bytes: "https://bytes-api.topolo.app",
|
|
66
66
|
calendar: "https://calendar.topolo.app",
|
|
67
|
-
capacity: "https://
|
|
67
|
+
capacity: "https://capacity.topolo.app",
|
|
68
68
|
chat: "https://chat.topolo.app",
|
|
69
|
-
commerce: "https://
|
|
69
|
+
commerce: "https://commerce-api.topolo.app",
|
|
70
70
|
compose: "https://compose.topolo.app",
|
|
71
71
|
crm: "https://crm-api.topolo.app",
|
|
72
72
|
customer_success: "https://customer-success.topolo.app",
|
|
73
|
-
feed: "https://
|
|
73
|
+
feed: "https://feed-api.topolo.app",
|
|
74
74
|
flow: "https://flow.topolo.app",
|
|
75
|
-
forecast: "https://forecast-
|
|
75
|
+
forecast: "https://forecast-api.topolo.app",
|
|
76
76
|
forms: "https://forms.topolo.app",
|
|
77
77
|
insights: "https://insights.topolo.app",
|
|
78
78
|
inventory: "https://inventory.topolo.app",
|
|
79
|
-
learn: "https://
|
|
79
|
+
learn: "https://learn-api.topolo.app",
|
|
80
80
|
mail: "https://mail.topolo.app",
|
|
81
|
-
mdm: "https://
|
|
81
|
+
mdm: "https://mdm-api.topolo.app",
|
|
82
82
|
messaging: "https://messages.topolo.app",
|
|
83
|
-
nexus: "https://
|
|
83
|
+
nexus: "https://nexus-api.topolo.app",
|
|
84
84
|
notify: "https://notify.topolo.app",
|
|
85
85
|
one: "https://one.topolo.app",
|
|
86
|
-
|
|
86
|
+
"one.ai": "https://ai.one.topolo.app",
|
|
87
|
+
p2p: "https://p2p.topolo.app",
|
|
88
|
+
pay: "https://pay.topolo.app",
|
|
87
89
|
people: "https://people.topolo.app",
|
|
88
90
|
"quro.api": "https://api.ol0.me",
|
|
89
91
|
"quro.redirect": "https://ol0.me",
|
|
90
92
|
roadmapper: "https://roadmapper-api.topolo.app",
|
|
91
93
|
sign: "https://sign.topolo.app",
|
|
92
|
-
social_studio: "https://
|
|
93
|
-
socialize: "https://socialize-
|
|
94
|
+
social_studio: "https://studio-api.topolo.app",
|
|
95
|
+
socialize: "https://socialize-api.topolo.app",
|
|
94
96
|
support: "https://support.topolo.app",
|
|
95
97
|
survey: "https://survey.topolo.app",
|
|
96
98
|
voice: "https://voice.topolo.app",
|
|
@@ -106,6 +108,7 @@ var PLATFORM_SERVICE_IDS = {
|
|
|
106
108
|
insights: "srv_topolo_insights",
|
|
107
109
|
inventory: "srv_topolo_inventory",
|
|
108
110
|
notify: "svc_topolo_notify",
|
|
111
|
+
p2p: "srv_topolo_p2p",
|
|
109
112
|
people: "srv_topolo_people",
|
|
110
113
|
sign: "srv_topolo_sign",
|
|
111
114
|
survey: "srv_topolo_survey",
|
|
@@ -126,7 +129,9 @@ var APPLICATIONS = {
|
|
|
126
129
|
"name": "topoloadmin",
|
|
127
130
|
"kind": "pages",
|
|
128
131
|
"apiUrl": null,
|
|
129
|
-
"domains": [
|
|
132
|
+
"domains": [
|
|
133
|
+
"admin.topolo.app"
|
|
134
|
+
],
|
|
130
135
|
"routes": [],
|
|
131
136
|
"serviceId": null
|
|
132
137
|
}
|
|
@@ -146,15 +151,19 @@ var APPLICATIONS = {
|
|
|
146
151
|
"name": "topolo-agent",
|
|
147
152
|
"kind": "pages",
|
|
148
153
|
"apiUrl": null,
|
|
149
|
-
"domains": [
|
|
154
|
+
"domains": [
|
|
155
|
+
"agent.topolo.app"
|
|
156
|
+
],
|
|
150
157
|
"routes": [],
|
|
151
158
|
"serviceId": null
|
|
152
159
|
},
|
|
153
160
|
{
|
|
154
161
|
"name": "topolo-agent-worker",
|
|
155
162
|
"kind": "worker",
|
|
156
|
-
"apiUrl": "https://
|
|
157
|
-
"domains": [
|
|
163
|
+
"apiUrl": "https://agent-api.topolo.app",
|
|
164
|
+
"domains": [
|
|
165
|
+
"agent-api.topolo.app"
|
|
166
|
+
],
|
|
158
167
|
"routes": [],
|
|
159
168
|
"serviceId": "agent"
|
|
160
169
|
}
|
|
@@ -246,15 +255,19 @@ var APPLICATIONS = {
|
|
|
246
255
|
"name": "bytes",
|
|
247
256
|
"kind": "pages",
|
|
248
257
|
"apiUrl": null,
|
|
249
|
-
"domains": [
|
|
258
|
+
"domains": [
|
|
259
|
+
"bytes.topolo.app"
|
|
260
|
+
],
|
|
250
261
|
"routes": [],
|
|
251
262
|
"serviceId": null
|
|
252
263
|
},
|
|
253
264
|
{
|
|
254
265
|
"name": "r2-media-manager-worker",
|
|
255
266
|
"kind": "worker",
|
|
256
|
-
"apiUrl": "https://
|
|
257
|
-
"domains": [
|
|
267
|
+
"apiUrl": "https://bytes-api.topolo.app",
|
|
268
|
+
"domains": [
|
|
269
|
+
"bytes-api.topolo.app"
|
|
270
|
+
],
|
|
258
271
|
"routes": [],
|
|
259
272
|
"serviceId": "bytes"
|
|
260
273
|
}
|
|
@@ -297,10 +310,9 @@ var APPLICATIONS = {
|
|
|
297
310
|
{
|
|
298
311
|
"name": "topolo-capacity",
|
|
299
312
|
"kind": "worker",
|
|
300
|
-
"apiUrl": "https://
|
|
313
|
+
"apiUrl": "https://capacity.topolo.app",
|
|
301
314
|
"domains": [
|
|
302
|
-
"capacity.topolo.app"
|
|
303
|
-
"topolo-capacity.topolo.workers.dev"
|
|
315
|
+
"capacity.topolo.app"
|
|
304
316
|
],
|
|
305
317
|
"routes": [],
|
|
306
318
|
"serviceId": "capacity"
|
|
@@ -362,9 +374,9 @@ var APPLICATIONS = {
|
|
|
362
374
|
{
|
|
363
375
|
"name": "topolo-commerce-api",
|
|
364
376
|
"kind": "worker",
|
|
365
|
-
"apiUrl": "https://
|
|
377
|
+
"apiUrl": "https://commerce-api.topolo.app",
|
|
366
378
|
"domains": [
|
|
367
|
-
"
|
|
379
|
+
"commerce-api.topolo.app"
|
|
368
380
|
],
|
|
369
381
|
"routes": [],
|
|
370
382
|
"serviceId": "commerce"
|
|
@@ -374,8 +386,7 @@ var APPLICATIONS = {
|
|
|
374
386
|
"kind": "pages",
|
|
375
387
|
"apiUrl": null,
|
|
376
388
|
"domains": [
|
|
377
|
-
"guest.topolo.app"
|
|
378
|
-
"topolo-commerce-guest-web.pages.dev"
|
|
389
|
+
"guest.topolo.app"
|
|
379
390
|
],
|
|
380
391
|
"routes": [],
|
|
381
392
|
"serviceId": null
|
|
@@ -385,8 +396,7 @@ var APPLICATIONS = {
|
|
|
385
396
|
"kind": "pages",
|
|
386
397
|
"apiUrl": null,
|
|
387
398
|
"domains": [
|
|
388
|
-
"commerce.topolo.app"
|
|
389
|
-
"topolo-commerce-ops-web.pages.dev"
|
|
399
|
+
"commerce.topolo.app"
|
|
390
400
|
],
|
|
391
401
|
"routes": [],
|
|
392
402
|
"serviceId": null
|
|
@@ -396,8 +406,7 @@ var APPLICATIONS = {
|
|
|
396
406
|
"kind": "pages",
|
|
397
407
|
"apiUrl": null,
|
|
398
408
|
"domains": [
|
|
399
|
-
"station-commerce.topolo.app"
|
|
400
|
-
"topolo-commerce-station-web.pages.dev"
|
|
409
|
+
"station-commerce.topolo.app"
|
|
401
410
|
],
|
|
402
411
|
"routes": [],
|
|
403
412
|
"serviceId": null
|
|
@@ -442,7 +451,9 @@ var APPLICATIONS = {
|
|
|
442
451
|
"name": "topolo-crm-frontend",
|
|
443
452
|
"kind": "pages",
|
|
444
453
|
"apiUrl": null,
|
|
445
|
-
"domains": [
|
|
454
|
+
"domains": [
|
|
455
|
+
"crm.topolo.app"
|
|
456
|
+
],
|
|
446
457
|
"routes": [],
|
|
447
458
|
"serviceId": null
|
|
448
459
|
},
|
|
@@ -450,7 +461,9 @@ var APPLICATIONS = {
|
|
|
450
461
|
"name": "topolo-crm-worker",
|
|
451
462
|
"kind": "worker",
|
|
452
463
|
"apiUrl": "https://crm-api.topolo.app",
|
|
453
|
-
"domains": [
|
|
464
|
+
"domains": [
|
|
465
|
+
"crm-api.topolo.app"
|
|
466
|
+
],
|
|
454
467
|
"routes": [],
|
|
455
468
|
"serviceId": "crm"
|
|
456
469
|
}
|
|
@@ -524,8 +537,8 @@ var APPLICATIONS = {
|
|
|
524
537
|
"id": "feed",
|
|
525
538
|
"appDir": "TopoloFeed",
|
|
526
539
|
"name": "TopoloFeed",
|
|
527
|
-
"packageName":
|
|
528
|
-
"productionUrl": "https://
|
|
540
|
+
"packageName": "topolo-feed",
|
|
541
|
+
"productionUrl": "https://feed-api.topolo.app",
|
|
529
542
|
"services": [
|
|
530
543
|
"feed"
|
|
531
544
|
],
|
|
@@ -533,24 +546,24 @@ var APPLICATIONS = {
|
|
|
533
546
|
{
|
|
534
547
|
"name": "topolo-feed-analytics-api",
|
|
535
548
|
"kind": "worker",
|
|
536
|
-
"apiUrl": "https://
|
|
549
|
+
"apiUrl": "https://feed-analytics-api.topolo.app",
|
|
537
550
|
"domains": [
|
|
538
|
-
"
|
|
551
|
+
"feed-analytics-api.topolo.app"
|
|
539
552
|
],
|
|
540
553
|
"routes": [
|
|
541
|
-
"
|
|
554
|
+
"feed-analytics-api.topolo.app"
|
|
542
555
|
],
|
|
543
556
|
"serviceId": null
|
|
544
557
|
},
|
|
545
558
|
{
|
|
546
559
|
"name": "topolo-feed-api",
|
|
547
560
|
"kind": "worker",
|
|
548
|
-
"apiUrl": "https://
|
|
561
|
+
"apiUrl": "https://feed-api.topolo.app",
|
|
549
562
|
"domains": [
|
|
550
|
-
"
|
|
563
|
+
"feed-api.topolo.app"
|
|
551
564
|
],
|
|
552
565
|
"routes": [
|
|
553
|
-
"
|
|
566
|
+
"feed-api.topolo.app"
|
|
554
567
|
],
|
|
555
568
|
"serviceId": "feed"
|
|
556
569
|
}
|
|
@@ -594,15 +607,19 @@ var APPLICATIONS = {
|
|
|
594
607
|
"name": "forecast",
|
|
595
608
|
"kind": "pages",
|
|
596
609
|
"apiUrl": null,
|
|
597
|
-
"domains": [
|
|
610
|
+
"domains": [
|
|
611
|
+
"forecast.topolo.app"
|
|
612
|
+
],
|
|
598
613
|
"routes": [],
|
|
599
614
|
"serviceId": null
|
|
600
615
|
},
|
|
601
616
|
{
|
|
602
617
|
"name": "forecast-worker-production",
|
|
603
618
|
"kind": "worker",
|
|
604
|
-
"apiUrl": "https://forecast-
|
|
605
|
-
"domains": [
|
|
619
|
+
"apiUrl": "https://forecast-api.topolo.app",
|
|
620
|
+
"domains": [
|
|
621
|
+
"forecast-api.topolo.app"
|
|
622
|
+
],
|
|
606
623
|
"routes": [],
|
|
607
624
|
"serviceId": "forecast"
|
|
608
625
|
}
|
|
@@ -703,9 +720,9 @@ var APPLICATIONS = {
|
|
|
703
720
|
{
|
|
704
721
|
"name": "topololearn-api",
|
|
705
722
|
"kind": "worker",
|
|
706
|
-
"apiUrl": "https://
|
|
723
|
+
"apiUrl": "https://learn-api.topolo.app",
|
|
707
724
|
"domains": [
|
|
708
|
-
"
|
|
725
|
+
"learn-api.topolo.app"
|
|
709
726
|
],
|
|
710
727
|
"routes": [],
|
|
711
728
|
"serviceId": "learn"
|
|
@@ -758,12 +775,12 @@ var APPLICATIONS = {
|
|
|
758
775
|
{
|
|
759
776
|
"name": "topolo-mdm-api",
|
|
760
777
|
"kind": "worker",
|
|
761
|
-
"apiUrl": "https://
|
|
778
|
+
"apiUrl": "https://mdm-api.topolo.app",
|
|
762
779
|
"domains": [
|
|
763
|
-
"
|
|
780
|
+
"mdm-api.topolo.app"
|
|
764
781
|
],
|
|
765
782
|
"routes": [
|
|
766
|
-
"
|
|
783
|
+
"mdm-api.topolo.app"
|
|
767
784
|
],
|
|
768
785
|
"serviceId": "mdm"
|
|
769
786
|
},
|
|
@@ -772,8 +789,7 @@ var APPLICATIONS = {
|
|
|
772
789
|
"kind": "pages",
|
|
773
790
|
"apiUrl": null,
|
|
774
791
|
"domains": [
|
|
775
|
-
"mdm.topolo.app"
|
|
776
|
-
"topolo-mdm-console.pages.dev"
|
|
792
|
+
"mdm.topolo.app"
|
|
777
793
|
],
|
|
778
794
|
"routes": [
|
|
779
795
|
"mdm.topolo.app"
|
|
@@ -827,8 +843,7 @@ var APPLICATIONS = {
|
|
|
827
843
|
"kind": "pages",
|
|
828
844
|
"apiUrl": null,
|
|
829
845
|
"domains": [
|
|
830
|
-
"nexus.topolo.app"
|
|
831
|
-
"topolo-nexus-dashboard.pages.dev"
|
|
846
|
+
"nexus.topolo.app"
|
|
832
847
|
],
|
|
833
848
|
"routes": [],
|
|
834
849
|
"serviceId": null
|
|
@@ -836,9 +851,9 @@ var APPLICATIONS = {
|
|
|
836
851
|
{
|
|
837
852
|
"name": "topolo-nexus-gateway",
|
|
838
853
|
"kind": "worker",
|
|
839
|
-
"apiUrl": "https://
|
|
854
|
+
"apiUrl": "https://nexus-api.topolo.app",
|
|
840
855
|
"domains": [
|
|
841
|
-
"
|
|
856
|
+
"nexus-api.topolo.app"
|
|
842
857
|
],
|
|
843
858
|
"routes": [],
|
|
844
859
|
"serviceId": "nexus"
|
|
@@ -876,25 +891,26 @@ var APPLICATIONS = {
|
|
|
876
891
|
"packageName": "topolo-oneclick-sso",
|
|
877
892
|
"productionUrl": "https://one.topolo.app",
|
|
878
893
|
"services": [
|
|
879
|
-
"one"
|
|
894
|
+
"one",
|
|
895
|
+
"one.ai"
|
|
880
896
|
],
|
|
881
897
|
"deployTargets": [
|
|
882
898
|
{
|
|
883
899
|
"name": "ai-chat-rag",
|
|
884
900
|
"kind": "worker",
|
|
885
|
-
"apiUrl":
|
|
901
|
+
"apiUrl": "https://ai.one.topolo.app",
|
|
886
902
|
"domains": [
|
|
887
|
-
"ai
|
|
903
|
+
"ai.one.topolo.app"
|
|
888
904
|
],
|
|
889
905
|
"routes": [],
|
|
890
|
-
"serviceId":
|
|
906
|
+
"serviceId": "one.ai"
|
|
891
907
|
},
|
|
892
908
|
{
|
|
893
909
|
"name": "topoloone",
|
|
894
910
|
"kind": "pages",
|
|
895
911
|
"apiUrl": null,
|
|
896
912
|
"domains": [
|
|
897
|
-
"
|
|
913
|
+
"one.topolo.app"
|
|
898
914
|
],
|
|
899
915
|
"routes": [],
|
|
900
916
|
"serviceId": null
|
|
@@ -915,7 +931,9 @@ var APPLICATIONS = {
|
|
|
915
931
|
"name": "topoloone-worker",
|
|
916
932
|
"kind": "worker",
|
|
917
933
|
"apiUrl": "https://one.topolo.app",
|
|
918
|
-
"domains": [
|
|
934
|
+
"domains": [
|
|
935
|
+
"one.topolo.app"
|
|
936
|
+
],
|
|
919
937
|
"routes": [
|
|
920
938
|
"one.topolo.app/*"
|
|
921
939
|
],
|
|
@@ -923,6 +941,30 @@ var APPLICATIONS = {
|
|
|
923
941
|
}
|
|
924
942
|
]
|
|
925
943
|
},
|
|
944
|
+
"p2p": {
|
|
945
|
+
"id": "p2p",
|
|
946
|
+
"appDir": "TopoloP2P",
|
|
947
|
+
"name": "topolo-p2p",
|
|
948
|
+
"packageName": "topolo-p2p",
|
|
949
|
+
"productionUrl": "https://p2p.topolo.app",
|
|
950
|
+
"services": [
|
|
951
|
+
"p2p"
|
|
952
|
+
],
|
|
953
|
+
"deployTargets": [
|
|
954
|
+
{
|
|
955
|
+
"name": "topolo-p2p",
|
|
956
|
+
"kind": "worker",
|
|
957
|
+
"apiUrl": "https://p2p.topolo.app",
|
|
958
|
+
"domains": [
|
|
959
|
+
"p2p.topolo.app"
|
|
960
|
+
],
|
|
961
|
+
"routes": [
|
|
962
|
+
"p2p.topolo.app"
|
|
963
|
+
],
|
|
964
|
+
"serviceId": "p2p"
|
|
965
|
+
}
|
|
966
|
+
]
|
|
967
|
+
},
|
|
926
968
|
"pay": {
|
|
927
969
|
"id": "pay",
|
|
928
970
|
"appDir": "TopoloPay",
|
|
@@ -936,8 +978,10 @@ var APPLICATIONS = {
|
|
|
936
978
|
{
|
|
937
979
|
"name": "topolo-pay",
|
|
938
980
|
"kind": "worker",
|
|
939
|
-
"apiUrl": "https://
|
|
940
|
-
"domains": [
|
|
981
|
+
"apiUrl": "https://pay.topolo.app",
|
|
982
|
+
"domains": [
|
|
983
|
+
"pay.topolo.app"
|
|
984
|
+
],
|
|
941
985
|
"routes": [],
|
|
942
986
|
"serviceId": "pay"
|
|
943
987
|
}
|
|
@@ -982,7 +1026,9 @@ var APPLICATIONS = {
|
|
|
982
1026
|
"name": "quro-api",
|
|
983
1027
|
"kind": "worker",
|
|
984
1028
|
"apiUrl": "https://api.ol0.me",
|
|
985
|
-
"domains": [
|
|
1029
|
+
"domains": [
|
|
1030
|
+
"api.ol0.me"
|
|
1031
|
+
],
|
|
986
1032
|
"routes": [],
|
|
987
1033
|
"serviceId": "quro.api"
|
|
988
1034
|
},
|
|
@@ -990,7 +1036,9 @@ var APPLICATIONS = {
|
|
|
990
1036
|
"name": "quro-redirect-system",
|
|
991
1037
|
"kind": "worker",
|
|
992
1038
|
"apiUrl": "https://ol0.me",
|
|
993
|
-
"domains": [
|
|
1039
|
+
"domains": [
|
|
1040
|
+
"ol0.me"
|
|
1041
|
+
],
|
|
994
1042
|
"routes": [
|
|
995
1043
|
"ol0.me/*"
|
|
996
1044
|
],
|
|
@@ -1000,7 +1048,9 @@ var APPLICATIONS = {
|
|
|
1000
1048
|
"name": "quro-ui",
|
|
1001
1049
|
"kind": "pages",
|
|
1002
1050
|
"apiUrl": null,
|
|
1003
|
-
"domains": [
|
|
1051
|
+
"domains": [
|
|
1052
|
+
"quro.topolo.app"
|
|
1053
|
+
],
|
|
1004
1054
|
"routes": [],
|
|
1005
1055
|
"serviceId": null
|
|
1006
1056
|
}
|
|
@@ -1076,15 +1126,19 @@ var APPLICATIONS = {
|
|
|
1076
1126
|
"name": "topolo-social-studio",
|
|
1077
1127
|
"kind": "pages",
|
|
1078
1128
|
"apiUrl": null,
|
|
1079
|
-
"domains": [
|
|
1129
|
+
"domains": [
|
|
1130
|
+
"studio.topolo.app"
|
|
1131
|
+
],
|
|
1080
1132
|
"routes": [],
|
|
1081
1133
|
"serviceId": null
|
|
1082
1134
|
},
|
|
1083
1135
|
{
|
|
1084
1136
|
"name": "topolo-social-studio-api",
|
|
1085
1137
|
"kind": "worker",
|
|
1086
|
-
"apiUrl": "https://
|
|
1087
|
-
"domains": [
|
|
1138
|
+
"apiUrl": "https://studio-api.topolo.app",
|
|
1139
|
+
"domains": [
|
|
1140
|
+
"studio-api.topolo.app"
|
|
1141
|
+
],
|
|
1088
1142
|
"routes": [],
|
|
1089
1143
|
"serviceId": "social_studio"
|
|
1090
1144
|
},
|
|
@@ -1112,15 +1166,19 @@ var APPLICATIONS = {
|
|
|
1112
1166
|
"name": "socialize",
|
|
1113
1167
|
"kind": "pages",
|
|
1114
1168
|
"apiUrl": null,
|
|
1115
|
-
"domains": [
|
|
1169
|
+
"domains": [
|
|
1170
|
+
"socialize.topolo.app"
|
|
1171
|
+
],
|
|
1116
1172
|
"routes": [],
|
|
1117
1173
|
"serviceId": null
|
|
1118
1174
|
},
|
|
1119
1175
|
{
|
|
1120
1176
|
"name": "socialize-prod-api",
|
|
1121
1177
|
"kind": "worker",
|
|
1122
|
-
"apiUrl": "https://socialize-
|
|
1123
|
-
"domains": [
|
|
1178
|
+
"apiUrl": "https://socialize-api.topolo.app",
|
|
1179
|
+
"domains": [
|
|
1180
|
+
"socialize-api.topolo.app"
|
|
1181
|
+
],
|
|
1124
1182
|
"routes": [],
|
|
1125
1183
|
"serviceId": "socialize"
|
|
1126
1184
|
},
|
|
@@ -1895,6 +1953,222 @@ var IdentityModule = class {
|
|
|
1895
1953
|
}
|
|
1896
1954
|
};
|
|
1897
1955
|
|
|
1956
|
+
// src/modules/p2p.ts
|
|
1957
|
+
var P2PModule = class {
|
|
1958
|
+
constructor(client) {
|
|
1959
|
+
this.client = client;
|
|
1960
|
+
}
|
|
1961
|
+
client;
|
|
1962
|
+
// Directory ----------------------------------------------------------------
|
|
1963
|
+
async listDirectory(options = {}) {
|
|
1964
|
+
const res = await this.client.request({
|
|
1965
|
+
service: "p2p",
|
|
1966
|
+
path: "/api/directory/capabilities",
|
|
1967
|
+
query: { limit: options.limit }
|
|
1968
|
+
});
|
|
1969
|
+
return res.data.capabilities;
|
|
1970
|
+
}
|
|
1971
|
+
async getCapability(capabilityId) {
|
|
1972
|
+
if (!capabilityId) throw new Error("capabilityId is required");
|
|
1973
|
+
try {
|
|
1974
|
+
const res = await this.client.request({
|
|
1975
|
+
service: "p2p",
|
|
1976
|
+
path: `/api/directory/capabilities/${encodeURIComponent(capabilityId)}`
|
|
1977
|
+
});
|
|
1978
|
+
return res.data.capability;
|
|
1979
|
+
} catch (err) {
|
|
1980
|
+
if (isNotFound(err)) return null;
|
|
1981
|
+
throw err;
|
|
1982
|
+
}
|
|
1983
|
+
}
|
|
1984
|
+
async publishCapability(input) {
|
|
1985
|
+
const res = await this.client.request({
|
|
1986
|
+
service: "p2p",
|
|
1987
|
+
method: "POST",
|
|
1988
|
+
path: "/api/p2p/internal/capabilities/sync",
|
|
1989
|
+
body: {
|
|
1990
|
+
capability_id: input.capability_id,
|
|
1991
|
+
publisher_org_id: input.publisher_org_id,
|
|
1992
|
+
app_id: input.app_id,
|
|
1993
|
+
service_id: input.service_id,
|
|
1994
|
+
name: input.name,
|
|
1995
|
+
description: input.description,
|
|
1996
|
+
category: input.category,
|
|
1997
|
+
pricing_model: input.pricing_model,
|
|
1998
|
+
pricing_amount_minor: input.pricing_amount_minor ?? null,
|
|
1999
|
+
currency: input.currency ?? null,
|
|
2000
|
+
requires_human_approval: input.requires_human_approval ?? false,
|
|
2001
|
+
supported_contexts: input.supported_contexts,
|
|
2002
|
+
trust_level: input.trust_level ?? "standard",
|
|
2003
|
+
public_directory_visible: input.public_directory_visible,
|
|
2004
|
+
source_revision: input.source_revision,
|
|
2005
|
+
input_schema: input.input_schema ?? {},
|
|
2006
|
+
output_schema: input.output_schema ?? {},
|
|
2007
|
+
acting_for_org_id: input.acting_for_org_id ?? input.publisher_org_id
|
|
2008
|
+
},
|
|
2009
|
+
confirm: true
|
|
2010
|
+
});
|
|
2011
|
+
return res.data.capability;
|
|
2012
|
+
}
|
|
2013
|
+
// Actions ------------------------------------------------------------------
|
|
2014
|
+
async listActions(options = {}) {
|
|
2015
|
+
const res = await this.client.request({
|
|
2016
|
+
service: "p2p",
|
|
2017
|
+
path: "/api/actions",
|
|
2018
|
+
query: { state: options.state, limit: options.limit }
|
|
2019
|
+
});
|
|
2020
|
+
return res.data.actions;
|
|
2021
|
+
}
|
|
2022
|
+
async getAction(requestId) {
|
|
2023
|
+
if (!requestId) throw new Error("requestId is required");
|
|
2024
|
+
try {
|
|
2025
|
+
const res = await this.client.request({
|
|
2026
|
+
service: "p2p",
|
|
2027
|
+
path: `/api/actions/${encodeURIComponent(requestId)}`
|
|
2028
|
+
});
|
|
2029
|
+
return res.data;
|
|
2030
|
+
} catch (err) {
|
|
2031
|
+
if (isNotFound(err)) return null;
|
|
2032
|
+
throw err;
|
|
2033
|
+
}
|
|
2034
|
+
}
|
|
2035
|
+
async requestAction(input) {
|
|
2036
|
+
if (!input.capability_id) throw new Error("capability_id is required");
|
|
2037
|
+
if (!input.idempotency_key) throw new Error("idempotency_key is required");
|
|
2038
|
+
const res = await this.client.request({
|
|
2039
|
+
service: "p2p",
|
|
2040
|
+
method: "POST",
|
|
2041
|
+
path: "/api/actions/request",
|
|
2042
|
+
body: {
|
|
2043
|
+
capability_id: input.capability_id,
|
|
2044
|
+
idempotency_key: input.idempotency_key,
|
|
2045
|
+
inputs: input.inputs ?? {}
|
|
2046
|
+
},
|
|
2047
|
+
confirm: true
|
|
2048
|
+
});
|
|
2049
|
+
return res.data;
|
|
2050
|
+
}
|
|
2051
|
+
async respondAction(requestId, response, extras = {}) {
|
|
2052
|
+
if (!requestId) throw new Error("requestId is required");
|
|
2053
|
+
const res = await this.client.request({
|
|
2054
|
+
service: "p2p",
|
|
2055
|
+
method: "POST",
|
|
2056
|
+
path: `/api/actions/${encodeURIComponent(requestId)}/respond`,
|
|
2057
|
+
body: { response, ...extras },
|
|
2058
|
+
confirm: true
|
|
2059
|
+
});
|
|
2060
|
+
return res.data.request;
|
|
2061
|
+
}
|
|
2062
|
+
async completeAction(requestId, result = {}) {
|
|
2063
|
+
if (!requestId) throw new Error("requestId is required");
|
|
2064
|
+
const res = await this.client.request({
|
|
2065
|
+
service: "p2p",
|
|
2066
|
+
method: "POST",
|
|
2067
|
+
path: `/api/actions/${encodeURIComponent(requestId)}/complete`,
|
|
2068
|
+
body: { result },
|
|
2069
|
+
confirm: true
|
|
2070
|
+
});
|
|
2071
|
+
return res.data.request;
|
|
2072
|
+
}
|
|
2073
|
+
async disputeAction(requestId, reason) {
|
|
2074
|
+
if (!requestId) throw new Error("requestId is required");
|
|
2075
|
+
const res = await this.client.request({
|
|
2076
|
+
service: "p2p",
|
|
2077
|
+
method: "POST",
|
|
2078
|
+
path: `/api/actions/${encodeURIComponent(requestId)}/dispute`,
|
|
2079
|
+
body: { reason },
|
|
2080
|
+
confirm: true
|
|
2081
|
+
});
|
|
2082
|
+
return res.data.request;
|
|
2083
|
+
}
|
|
2084
|
+
// Policy + connections + ledger + settlement -----------------------------
|
|
2085
|
+
async getPolicy() {
|
|
2086
|
+
const res = await this.client.request({
|
|
2087
|
+
service: "p2p",
|
|
2088
|
+
path: "/api/policies"
|
|
2089
|
+
});
|
|
2090
|
+
return res.data.policy;
|
|
2091
|
+
}
|
|
2092
|
+
async updatePolicy(policy) {
|
|
2093
|
+
const res = await this.client.request({
|
|
2094
|
+
service: "p2p",
|
|
2095
|
+
method: "PUT",
|
|
2096
|
+
path: "/api/policies",
|
|
2097
|
+
body: policy,
|
|
2098
|
+
confirm: true
|
|
2099
|
+
});
|
|
2100
|
+
return res.data.policy;
|
|
2101
|
+
}
|
|
2102
|
+
async listConnections() {
|
|
2103
|
+
const res = await this.client.request({
|
|
2104
|
+
service: "p2p",
|
|
2105
|
+
path: "/api/connections"
|
|
2106
|
+
});
|
|
2107
|
+
return res.data.connections;
|
|
2108
|
+
}
|
|
2109
|
+
async createConnection(counterpartyOrgId, options = {}) {
|
|
2110
|
+
if (!counterpartyOrgId) throw new Error("counterpartyOrgId is required");
|
|
2111
|
+
const res = await this.client.request({
|
|
2112
|
+
service: "p2p",
|
|
2113
|
+
method: "POST",
|
|
2114
|
+
path: "/api/connections",
|
|
2115
|
+
body: { counterparty_org_id: counterpartyOrgId, status: options.status ?? "active" },
|
|
2116
|
+
confirm: true
|
|
2117
|
+
});
|
|
2118
|
+
return res.data.connection;
|
|
2119
|
+
}
|
|
2120
|
+
async revokeConnection(connectionId) {
|
|
2121
|
+
if (!connectionId) throw new Error("connectionId is required");
|
|
2122
|
+
await this.client.request({
|
|
2123
|
+
service: "p2p",
|
|
2124
|
+
method: "DELETE",
|
|
2125
|
+
path: `/api/connections/${encodeURIComponent(connectionId)}`,
|
|
2126
|
+
confirm: true
|
|
2127
|
+
});
|
|
2128
|
+
}
|
|
2129
|
+
async listLedger() {
|
|
2130
|
+
const res = await this.client.request({
|
|
2131
|
+
service: "p2p",
|
|
2132
|
+
path: "/api/ledger"
|
|
2133
|
+
});
|
|
2134
|
+
return res.data.ledger_entries;
|
|
2135
|
+
}
|
|
2136
|
+
async previewSettlements(filters = {}) {
|
|
2137
|
+
const res = await this.client.request({
|
|
2138
|
+
service: "p2p",
|
|
2139
|
+
method: "POST",
|
|
2140
|
+
path: "/api/settlements/preview",
|
|
2141
|
+
body: filters,
|
|
2142
|
+
confirm: true
|
|
2143
|
+
});
|
|
2144
|
+
return res.data.groups;
|
|
2145
|
+
}
|
|
2146
|
+
async createSettlement(filters = {}) {
|
|
2147
|
+
const res = await this.client.request({
|
|
2148
|
+
service: "p2p",
|
|
2149
|
+
method: "POST",
|
|
2150
|
+
path: "/api/settlements/create",
|
|
2151
|
+
body: { trigger: "manual", ...filters },
|
|
2152
|
+
confirm: true
|
|
2153
|
+
});
|
|
2154
|
+
return res.data;
|
|
2155
|
+
}
|
|
2156
|
+
async releaseHold(holdId, resolution, options = {}) {
|
|
2157
|
+
if (!holdId) throw new Error("holdId is required");
|
|
2158
|
+
const res = await this.client.request({
|
|
2159
|
+
service: "p2p",
|
|
2160
|
+
method: "POST",
|
|
2161
|
+
path: `/api/holds/${encodeURIComponent(holdId)}/release`,
|
|
2162
|
+
body: { resolution, reason: options.reason ?? null },
|
|
2163
|
+
confirm: true
|
|
2164
|
+
});
|
|
2165
|
+
return res.data;
|
|
2166
|
+
}
|
|
2167
|
+
};
|
|
2168
|
+
function isNotFound(err) {
|
|
2169
|
+
return Boolean(err && typeof err === "object" && "status" in err && err.status === 404);
|
|
2170
|
+
}
|
|
2171
|
+
|
|
1898
2172
|
// src/oauth.ts
|
|
1899
2173
|
var DEVICE_GRANT = "urn:ietf:params:oauth:grant-type:device_code";
|
|
1900
2174
|
var TopoloOAuth = class {
|
|
@@ -2146,6 +2420,7 @@ export {
|
|
|
2146
2420
|
CrmModule,
|
|
2147
2421
|
DEFAULT_SERVICE_URLS,
|
|
2148
2422
|
IdentityModule,
|
|
2423
|
+
P2PModule,
|
|
2149
2424
|
PLATFORM_SERVICE_IDS,
|
|
2150
2425
|
TOPOLO_WIDGET_ENDPOINT,
|
|
2151
2426
|
TOPOLO_WIDGET_REFRESH_INTERVAL_MS,
|