@0xsequence/marketplace 2.3.33 → 2.3.35
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/0xsequence-marketplace.cjs.dev.js +289 -137
- package/dist/0xsequence-marketplace.cjs.prod.js +289 -137
- package/dist/0xsequence-marketplace.esm.js +273 -134
- package/dist/declarations/src/marketplace.gen.d.ts +160 -71
- package/package.json +1 -1
- package/src/marketplace.gen.ts +469 -196
|
@@ -13,23 +13,23 @@ function _extends() {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
/* eslint-disable */
|
|
16
|
-
// marketplace-api
|
|
16
|
+
// marketplace-api v0-25.11.10+0a30dcb 3e347e76053c79e670f06121aeba79d137faefc2
|
|
17
17
|
// --
|
|
18
|
-
// Code generated by webrpc-gen@v0.
|
|
18
|
+
// Code generated by webrpc-gen@v0.31.1 with github.com/webrpc/gen-typescript@v0.19.0 generator. DO NOT EDIT.
|
|
19
19
|
//
|
|
20
|
-
// webrpc-gen -schema
|
|
20
|
+
// webrpc-gen -schema=./schema_old/schema.ridl -target=github.com/webrpc/gen-typescript@v0.19.0 -client -out=./clients/marketplace.gen.ts
|
|
21
21
|
|
|
22
22
|
const WebrpcHeader = 'Webrpc';
|
|
23
|
-
const WebrpcHeaderValue = 'webrpc@v0.
|
|
23
|
+
const WebrpcHeaderValue = 'webrpc@v0.31.1;gen-typescript@v0.19.0;marketplace-api@v0-25.11.10+0a30dcb';
|
|
24
24
|
|
|
25
25
|
// WebRPC description and code-gen version
|
|
26
26
|
const WebRPCVersion = 'v1';
|
|
27
27
|
|
|
28
28
|
// Schema version of your RIDL schema
|
|
29
|
-
const WebRPCSchemaVersion = '';
|
|
29
|
+
const WebRPCSchemaVersion = 'v0-25.11.10+0a30dcb';
|
|
30
30
|
|
|
31
31
|
// Schema hash generated from your RIDL schema
|
|
32
|
-
const WebRPCSchemaHash = '
|
|
32
|
+
const WebRPCSchemaHash = '3e347e76053c79e670f06121aeba79d137faefc2';
|
|
33
33
|
function VersionFromHeader(headers) {
|
|
34
34
|
const headerValue = headers.get(WebrpcHeader);
|
|
35
35
|
if (!headerValue) {
|
|
@@ -70,12 +70,6 @@ function parseWebrpcGenVersions(header) {
|
|
|
70
70
|
// Types
|
|
71
71
|
//
|
|
72
72
|
|
|
73
|
-
let MetadataStatus = /*#__PURE__*/function (MetadataStatus) {
|
|
74
|
-
MetadataStatus["NOT_AVAILABLE"] = "NOT_AVAILABLE";
|
|
75
|
-
MetadataStatus["REFRESHING"] = "REFRESHING";
|
|
76
|
-
MetadataStatus["AVAILABLE"] = "AVAILABLE";
|
|
77
|
-
return MetadataStatus;
|
|
78
|
-
}({});
|
|
79
73
|
let SortOrder = /*#__PURE__*/function (SortOrder) {
|
|
80
74
|
SortOrder["ASC"] = "ASC";
|
|
81
75
|
SortOrder["DESC"] = "DESC";
|
|
@@ -288,6 +282,12 @@ let PrimarySaleItemDetailType = /*#__PURE__*/function (PrimarySaleItemDetailType
|
|
|
288
282
|
PrimarySaleItemDetailType["individual"] = "individual";
|
|
289
283
|
return PrimarySaleItemDetailType;
|
|
290
284
|
}({});
|
|
285
|
+
let MetadataStatus = /*#__PURE__*/function (MetadataStatus) {
|
|
286
|
+
MetadataStatus["NOT_AVAILABLE"] = "NOT_AVAILABLE";
|
|
287
|
+
MetadataStatus["REFRESHING"] = "REFRESHING";
|
|
288
|
+
MetadataStatus["AVAILABLE"] = "AVAILABLE";
|
|
289
|
+
return MetadataStatus;
|
|
290
|
+
}({});
|
|
291
291
|
//
|
|
292
292
|
// Client
|
|
293
293
|
//
|
|
@@ -305,7 +305,7 @@ class Admin {
|
|
|
305
305
|
});
|
|
306
306
|
}, error => {
|
|
307
307
|
throw WebrpcRequestFailedError.new({
|
|
308
|
-
cause: `fetch(): ${error.message
|
|
308
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
309
309
|
});
|
|
310
310
|
});
|
|
311
311
|
};
|
|
@@ -318,7 +318,7 @@ class Admin {
|
|
|
318
318
|
});
|
|
319
319
|
}, error => {
|
|
320
320
|
throw WebrpcRequestFailedError.new({
|
|
321
|
-
cause: `fetch(): ${error.message
|
|
321
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
322
322
|
});
|
|
323
323
|
});
|
|
324
324
|
};
|
|
@@ -331,7 +331,7 @@ class Admin {
|
|
|
331
331
|
});
|
|
332
332
|
}, error => {
|
|
333
333
|
throw WebrpcRequestFailedError.new({
|
|
334
|
-
cause: `fetch(): ${error.message
|
|
334
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
335
335
|
});
|
|
336
336
|
});
|
|
337
337
|
};
|
|
@@ -345,7 +345,7 @@ class Admin {
|
|
|
345
345
|
});
|
|
346
346
|
}, error => {
|
|
347
347
|
throw WebrpcRequestFailedError.new({
|
|
348
|
-
cause: `fetch(): ${error.message
|
|
348
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
349
349
|
});
|
|
350
350
|
});
|
|
351
351
|
};
|
|
@@ -358,7 +358,7 @@ class Admin {
|
|
|
358
358
|
});
|
|
359
359
|
}, error => {
|
|
360
360
|
throw WebrpcRequestFailedError.new({
|
|
361
|
-
cause: `fetch(): ${error.message
|
|
361
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
362
362
|
});
|
|
363
363
|
});
|
|
364
364
|
};
|
|
@@ -369,7 +369,7 @@ class Admin {
|
|
|
369
369
|
});
|
|
370
370
|
}, error => {
|
|
371
371
|
throw WebrpcRequestFailedError.new({
|
|
372
|
-
cause: `fetch(): ${error.message
|
|
372
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
373
373
|
});
|
|
374
374
|
});
|
|
375
375
|
};
|
|
@@ -382,7 +382,7 @@ class Admin {
|
|
|
382
382
|
});
|
|
383
383
|
}, error => {
|
|
384
384
|
throw WebrpcRequestFailedError.new({
|
|
385
|
-
cause: `fetch(): ${error.message
|
|
385
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
386
386
|
});
|
|
387
387
|
});
|
|
388
388
|
};
|
|
@@ -393,7 +393,7 @@ class Admin {
|
|
|
393
393
|
});
|
|
394
394
|
}, error => {
|
|
395
395
|
throw WebrpcRequestFailedError.new({
|
|
396
|
-
cause: `fetch(): ${error.message
|
|
396
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
397
397
|
});
|
|
398
398
|
});
|
|
399
399
|
};
|
|
@@ -406,7 +406,7 @@ class Admin {
|
|
|
406
406
|
});
|
|
407
407
|
}, error => {
|
|
408
408
|
throw WebrpcRequestFailedError.new({
|
|
409
|
-
cause: `fetch(): ${error.message
|
|
409
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
410
410
|
});
|
|
411
411
|
});
|
|
412
412
|
};
|
|
@@ -419,7 +419,7 @@ class Admin {
|
|
|
419
419
|
});
|
|
420
420
|
}, error => {
|
|
421
421
|
throw WebrpcRequestFailedError.new({
|
|
422
|
-
cause: `fetch(): ${error.message
|
|
422
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
423
423
|
});
|
|
424
424
|
});
|
|
425
425
|
};
|
|
@@ -432,7 +432,7 @@ class Admin {
|
|
|
432
432
|
});
|
|
433
433
|
}, error => {
|
|
434
434
|
throw WebrpcRequestFailedError.new({
|
|
435
|
-
cause: `fetch(): ${error.message
|
|
435
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
436
436
|
});
|
|
437
437
|
});
|
|
438
438
|
};
|
|
@@ -445,7 +445,7 @@ class Admin {
|
|
|
445
445
|
});
|
|
446
446
|
}, error => {
|
|
447
447
|
throw WebrpcRequestFailedError.new({
|
|
448
|
-
cause: `fetch(): ${error.message
|
|
448
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
449
449
|
});
|
|
450
450
|
});
|
|
451
451
|
};
|
|
@@ -458,7 +458,7 @@ class Admin {
|
|
|
458
458
|
});
|
|
459
459
|
}, error => {
|
|
460
460
|
throw WebrpcRequestFailedError.new({
|
|
461
|
-
cause: `fetch(): ${error.message
|
|
461
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
462
462
|
});
|
|
463
463
|
});
|
|
464
464
|
};
|
|
@@ -469,7 +469,7 @@ class Admin {
|
|
|
469
469
|
});
|
|
470
470
|
}, error => {
|
|
471
471
|
throw WebrpcRequestFailedError.new({
|
|
472
|
-
cause: `fetch(): ${error.message
|
|
472
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
473
473
|
});
|
|
474
474
|
});
|
|
475
475
|
};
|
|
@@ -494,7 +494,7 @@ class Marketplace {
|
|
|
494
494
|
});
|
|
495
495
|
}, error => {
|
|
496
496
|
throw WebrpcRequestFailedError.new({
|
|
497
|
-
cause: `fetch(): ${error.message
|
|
497
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
498
498
|
});
|
|
499
499
|
});
|
|
500
500
|
};
|
|
@@ -507,7 +507,33 @@ class Marketplace {
|
|
|
507
507
|
});
|
|
508
508
|
}, error => {
|
|
509
509
|
throw WebrpcRequestFailedError.new({
|
|
510
|
-
cause: `fetch(): ${error.message
|
|
510
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
511
|
+
});
|
|
512
|
+
});
|
|
513
|
+
};
|
|
514
|
+
this.getCollectionActiveListingsCurrencies = (args, headers, signal) => {
|
|
515
|
+
return this.fetch(this.url('GetCollectionActiveListingsCurrencies'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
516
|
+
return buildResponse(res).then(_data => {
|
|
517
|
+
return {
|
|
518
|
+
currencies: _data.currencies
|
|
519
|
+
};
|
|
520
|
+
});
|
|
521
|
+
}, error => {
|
|
522
|
+
throw WebrpcRequestFailedError.new({
|
|
523
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
524
|
+
});
|
|
525
|
+
});
|
|
526
|
+
};
|
|
527
|
+
this.getCollectionActiveOffersCurrencies = (args, headers, signal) => {
|
|
528
|
+
return this.fetch(this.url('GetCollectionActiveOffersCurrencies'), createHTTPRequest(args, headers, signal)).then(res => {
|
|
529
|
+
return buildResponse(res).then(_data => {
|
|
530
|
+
return {
|
|
531
|
+
currencies: _data.currencies
|
|
532
|
+
};
|
|
533
|
+
});
|
|
534
|
+
}, error => {
|
|
535
|
+
throw WebrpcRequestFailedError.new({
|
|
536
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
511
537
|
});
|
|
512
538
|
});
|
|
513
539
|
};
|
|
@@ -520,7 +546,7 @@ class Marketplace {
|
|
|
520
546
|
});
|
|
521
547
|
}, error => {
|
|
522
548
|
throw WebrpcRequestFailedError.new({
|
|
523
|
-
cause: `fetch(): ${error.message
|
|
549
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
524
550
|
});
|
|
525
551
|
});
|
|
526
552
|
};
|
|
@@ -533,7 +559,7 @@ class Marketplace {
|
|
|
533
559
|
});
|
|
534
560
|
}, error => {
|
|
535
561
|
throw WebrpcRequestFailedError.new({
|
|
536
|
-
cause: `fetch(): ${error.message
|
|
562
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
537
563
|
});
|
|
538
564
|
});
|
|
539
565
|
};
|
|
@@ -546,7 +572,7 @@ class Marketplace {
|
|
|
546
572
|
});
|
|
547
573
|
}, error => {
|
|
548
574
|
throw WebrpcRequestFailedError.new({
|
|
549
|
-
cause: `fetch(): ${error.message
|
|
575
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
550
576
|
});
|
|
551
577
|
});
|
|
552
578
|
};
|
|
@@ -559,7 +585,7 @@ class Marketplace {
|
|
|
559
585
|
});
|
|
560
586
|
}, error => {
|
|
561
587
|
throw WebrpcRequestFailedError.new({
|
|
562
|
-
cause: `fetch(): ${error.message
|
|
588
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
563
589
|
});
|
|
564
590
|
});
|
|
565
591
|
};
|
|
@@ -572,7 +598,7 @@ class Marketplace {
|
|
|
572
598
|
});
|
|
573
599
|
}, error => {
|
|
574
600
|
throw WebrpcRequestFailedError.new({
|
|
575
|
-
cause: `fetch(): ${error.message
|
|
601
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
576
602
|
});
|
|
577
603
|
});
|
|
578
604
|
};
|
|
@@ -586,7 +612,7 @@ class Marketplace {
|
|
|
586
612
|
});
|
|
587
613
|
}, error => {
|
|
588
614
|
throw WebrpcRequestFailedError.new({
|
|
589
|
-
cause: `fetch(): ${error.message
|
|
615
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
590
616
|
});
|
|
591
617
|
});
|
|
592
618
|
};
|
|
@@ -600,7 +626,7 @@ class Marketplace {
|
|
|
600
626
|
});
|
|
601
627
|
}, error => {
|
|
602
628
|
throw WebrpcRequestFailedError.new({
|
|
603
|
-
cause: `fetch(): ${error.message
|
|
629
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
604
630
|
});
|
|
605
631
|
});
|
|
606
632
|
};
|
|
@@ -614,7 +640,7 @@ class Marketplace {
|
|
|
614
640
|
});
|
|
615
641
|
}, error => {
|
|
616
642
|
throw WebrpcRequestFailedError.new({
|
|
617
|
-
cause: `fetch(): ${error.message
|
|
643
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
618
644
|
});
|
|
619
645
|
});
|
|
620
646
|
};
|
|
@@ -627,7 +653,7 @@ class Marketplace {
|
|
|
627
653
|
});
|
|
628
654
|
}, error => {
|
|
629
655
|
throw WebrpcRequestFailedError.new({
|
|
630
|
-
cause: `fetch(): ${error.message
|
|
656
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
631
657
|
});
|
|
632
658
|
});
|
|
633
659
|
};
|
|
@@ -640,7 +666,7 @@ class Marketplace {
|
|
|
640
666
|
});
|
|
641
667
|
}, error => {
|
|
642
668
|
throw WebrpcRequestFailedError.new({
|
|
643
|
-
cause: `fetch(): ${error.message
|
|
669
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
644
670
|
});
|
|
645
671
|
});
|
|
646
672
|
};
|
|
@@ -654,7 +680,7 @@ class Marketplace {
|
|
|
654
680
|
});
|
|
655
681
|
}, error => {
|
|
656
682
|
throw WebrpcRequestFailedError.new({
|
|
657
|
-
cause: `fetch(): ${error.message
|
|
683
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
658
684
|
});
|
|
659
685
|
});
|
|
660
686
|
};
|
|
@@ -668,7 +694,7 @@ class Marketplace {
|
|
|
668
694
|
});
|
|
669
695
|
}, error => {
|
|
670
696
|
throw WebrpcRequestFailedError.new({
|
|
671
|
-
cause: `fetch(): ${error.message
|
|
697
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
672
698
|
});
|
|
673
699
|
});
|
|
674
700
|
};
|
|
@@ -681,7 +707,7 @@ class Marketplace {
|
|
|
681
707
|
});
|
|
682
708
|
}, error => {
|
|
683
709
|
throw WebrpcRequestFailedError.new({
|
|
684
|
-
cause: `fetch(): ${error.message
|
|
710
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
685
711
|
});
|
|
686
712
|
});
|
|
687
713
|
};
|
|
@@ -694,7 +720,7 @@ class Marketplace {
|
|
|
694
720
|
});
|
|
695
721
|
}, error => {
|
|
696
722
|
throw WebrpcRequestFailedError.new({
|
|
697
|
-
cause: `fetch(): ${error.message
|
|
723
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
698
724
|
});
|
|
699
725
|
});
|
|
700
726
|
};
|
|
@@ -707,7 +733,7 @@ class Marketplace {
|
|
|
707
733
|
});
|
|
708
734
|
}, error => {
|
|
709
735
|
throw WebrpcRequestFailedError.new({
|
|
710
|
-
cause: `fetch(): ${error.message
|
|
736
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
711
737
|
});
|
|
712
738
|
});
|
|
713
739
|
};
|
|
@@ -720,7 +746,7 @@ class Marketplace {
|
|
|
720
746
|
});
|
|
721
747
|
}, error => {
|
|
722
748
|
throw WebrpcRequestFailedError.new({
|
|
723
|
-
cause: `fetch(): ${error.message
|
|
749
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
724
750
|
});
|
|
725
751
|
});
|
|
726
752
|
};
|
|
@@ -733,7 +759,7 @@ class Marketplace {
|
|
|
733
759
|
});
|
|
734
760
|
}, error => {
|
|
735
761
|
throw WebrpcRequestFailedError.new({
|
|
736
|
-
cause: `fetch(): ${error.message
|
|
762
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
737
763
|
});
|
|
738
764
|
});
|
|
739
765
|
};
|
|
@@ -746,7 +772,7 @@ class Marketplace {
|
|
|
746
772
|
});
|
|
747
773
|
}, error => {
|
|
748
774
|
throw WebrpcRequestFailedError.new({
|
|
749
|
-
cause: `fetch(): ${error.message
|
|
775
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
750
776
|
});
|
|
751
777
|
});
|
|
752
778
|
};
|
|
@@ -760,7 +786,7 @@ class Marketplace {
|
|
|
760
786
|
});
|
|
761
787
|
}, error => {
|
|
762
788
|
throw WebrpcRequestFailedError.new({
|
|
763
|
-
cause: `fetch(): ${error.message
|
|
789
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
764
790
|
});
|
|
765
791
|
});
|
|
766
792
|
};
|
|
@@ -774,7 +800,7 @@ class Marketplace {
|
|
|
774
800
|
});
|
|
775
801
|
}, error => {
|
|
776
802
|
throw WebrpcRequestFailedError.new({
|
|
777
|
-
cause: `fetch(): ${error.message
|
|
803
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
778
804
|
});
|
|
779
805
|
});
|
|
780
806
|
};
|
|
@@ -787,7 +813,7 @@ class Marketplace {
|
|
|
787
813
|
});
|
|
788
814
|
}, error => {
|
|
789
815
|
throw WebrpcRequestFailedError.new({
|
|
790
|
-
cause: `fetch(): ${error.message
|
|
816
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
791
817
|
});
|
|
792
818
|
});
|
|
793
819
|
};
|
|
@@ -800,7 +826,7 @@ class Marketplace {
|
|
|
800
826
|
});
|
|
801
827
|
}, error => {
|
|
802
828
|
throw WebrpcRequestFailedError.new({
|
|
803
|
-
cause: `fetch(): ${error.message
|
|
829
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
804
830
|
});
|
|
805
831
|
});
|
|
806
832
|
};
|
|
@@ -813,7 +839,7 @@ class Marketplace {
|
|
|
813
839
|
});
|
|
814
840
|
}, error => {
|
|
815
841
|
throw WebrpcRequestFailedError.new({
|
|
816
|
-
cause: `fetch(): ${error.message
|
|
842
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
817
843
|
});
|
|
818
844
|
});
|
|
819
845
|
};
|
|
@@ -826,7 +852,7 @@ class Marketplace {
|
|
|
826
852
|
});
|
|
827
853
|
}, error => {
|
|
828
854
|
throw WebrpcRequestFailedError.new({
|
|
829
|
-
cause: `fetch(): ${error.message
|
|
855
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
830
856
|
});
|
|
831
857
|
});
|
|
832
858
|
};
|
|
@@ -839,7 +865,7 @@ class Marketplace {
|
|
|
839
865
|
});
|
|
840
866
|
}, error => {
|
|
841
867
|
throw WebrpcRequestFailedError.new({
|
|
842
|
-
cause: `fetch(): ${error.message
|
|
868
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
843
869
|
});
|
|
844
870
|
});
|
|
845
871
|
};
|
|
@@ -852,7 +878,7 @@ class Marketplace {
|
|
|
852
878
|
});
|
|
853
879
|
}, error => {
|
|
854
880
|
throw WebrpcRequestFailedError.new({
|
|
855
|
-
cause: `fetch(): ${error.message
|
|
881
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
856
882
|
});
|
|
857
883
|
});
|
|
858
884
|
};
|
|
@@ -866,7 +892,7 @@ class Marketplace {
|
|
|
866
892
|
});
|
|
867
893
|
}, error => {
|
|
868
894
|
throw WebrpcRequestFailedError.new({
|
|
869
|
-
cause: `fetch(): ${error.message
|
|
895
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
870
896
|
});
|
|
871
897
|
});
|
|
872
898
|
};
|
|
@@ -879,7 +905,7 @@ class Marketplace {
|
|
|
879
905
|
});
|
|
880
906
|
}, error => {
|
|
881
907
|
throw WebrpcRequestFailedError.new({
|
|
882
|
-
cause: `fetch(): ${error.message
|
|
908
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
883
909
|
});
|
|
884
910
|
});
|
|
885
911
|
};
|
|
@@ -892,7 +918,7 @@ class Marketplace {
|
|
|
892
918
|
});
|
|
893
919
|
}, error => {
|
|
894
920
|
throw WebrpcRequestFailedError.new({
|
|
895
|
-
cause: `fetch(): ${error.message
|
|
921
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
896
922
|
});
|
|
897
923
|
});
|
|
898
924
|
};
|
|
@@ -905,7 +931,7 @@ class Marketplace {
|
|
|
905
931
|
});
|
|
906
932
|
}, error => {
|
|
907
933
|
throw WebrpcRequestFailedError.new({
|
|
908
|
-
cause: `fetch(): ${error.message
|
|
934
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
909
935
|
});
|
|
910
936
|
});
|
|
911
937
|
};
|
|
@@ -919,7 +945,7 @@ class Marketplace {
|
|
|
919
945
|
});
|
|
920
946
|
}, error => {
|
|
921
947
|
throw WebrpcRequestFailedError.new({
|
|
922
|
-
cause: `fetch(): ${error.message
|
|
948
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
923
949
|
});
|
|
924
950
|
});
|
|
925
951
|
};
|
|
@@ -933,7 +959,7 @@ class Marketplace {
|
|
|
933
959
|
});
|
|
934
960
|
}, error => {
|
|
935
961
|
throw WebrpcRequestFailedError.new({
|
|
936
|
-
cause: `fetch(): ${error.message
|
|
962
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
937
963
|
});
|
|
938
964
|
});
|
|
939
965
|
};
|
|
@@ -947,7 +973,7 @@ class Marketplace {
|
|
|
947
973
|
});
|
|
948
974
|
}, error => {
|
|
949
975
|
throw WebrpcRequestFailedError.new({
|
|
950
|
-
cause: `fetch(): ${error.message
|
|
976
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
951
977
|
});
|
|
952
978
|
});
|
|
953
979
|
};
|
|
@@ -961,7 +987,7 @@ class Marketplace {
|
|
|
961
987
|
});
|
|
962
988
|
}, error => {
|
|
963
989
|
throw WebrpcRequestFailedError.new({
|
|
964
|
-
cause: `fetch(): ${error.message
|
|
990
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
965
991
|
});
|
|
966
992
|
});
|
|
967
993
|
};
|
|
@@ -972,7 +998,7 @@ class Marketplace {
|
|
|
972
998
|
});
|
|
973
999
|
}, error => {
|
|
974
1000
|
throw WebrpcRequestFailedError.new({
|
|
975
|
-
cause: `fetch(): ${error.message
|
|
1001
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
976
1002
|
});
|
|
977
1003
|
});
|
|
978
1004
|
};
|
|
@@ -983,7 +1009,7 @@ class Marketplace {
|
|
|
983
1009
|
});
|
|
984
1010
|
}, error => {
|
|
985
1011
|
throw WebrpcRequestFailedError.new({
|
|
986
|
-
cause: `fetch(): ${error.message
|
|
1012
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
987
1013
|
});
|
|
988
1014
|
});
|
|
989
1015
|
};
|
|
@@ -997,7 +1023,7 @@ class Marketplace {
|
|
|
997
1023
|
});
|
|
998
1024
|
}, error => {
|
|
999
1025
|
throw WebrpcRequestFailedError.new({
|
|
1000
|
-
cause: `fetch(): ${error.message
|
|
1026
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
1001
1027
|
});
|
|
1002
1028
|
});
|
|
1003
1029
|
};
|
|
@@ -1010,7 +1036,7 @@ class Marketplace {
|
|
|
1010
1036
|
});
|
|
1011
1037
|
}, error => {
|
|
1012
1038
|
throw WebrpcRequestFailedError.new({
|
|
1013
|
-
cause: `fetch(): ${error.message
|
|
1039
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
1014
1040
|
});
|
|
1015
1041
|
});
|
|
1016
1042
|
};
|
|
@@ -1023,7 +1049,7 @@ class Marketplace {
|
|
|
1023
1049
|
});
|
|
1024
1050
|
}, error => {
|
|
1025
1051
|
throw WebrpcRequestFailedError.new({
|
|
1026
|
-
cause: `fetch(): ${error.message
|
|
1052
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
1027
1053
|
});
|
|
1028
1054
|
});
|
|
1029
1055
|
};
|
|
@@ -1036,7 +1062,7 @@ class Marketplace {
|
|
|
1036
1062
|
});
|
|
1037
1063
|
}, error => {
|
|
1038
1064
|
throw WebrpcRequestFailedError.new({
|
|
1039
|
-
cause: `fetch(): ${error.message
|
|
1065
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
1040
1066
|
});
|
|
1041
1067
|
});
|
|
1042
1068
|
};
|
|
@@ -1049,7 +1075,7 @@ class Marketplace {
|
|
|
1049
1075
|
});
|
|
1050
1076
|
}, error => {
|
|
1051
1077
|
throw WebrpcRequestFailedError.new({
|
|
1052
|
-
cause: `fetch(): ${error.message
|
|
1078
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
1053
1079
|
});
|
|
1054
1080
|
});
|
|
1055
1081
|
};
|
|
@@ -1063,7 +1089,7 @@ class Marketplace {
|
|
|
1063
1089
|
});
|
|
1064
1090
|
}, error => {
|
|
1065
1091
|
throw WebrpcRequestFailedError.new({
|
|
1066
|
-
cause: `fetch(): ${error.message
|
|
1092
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
1067
1093
|
});
|
|
1068
1094
|
});
|
|
1069
1095
|
};
|
|
@@ -1076,7 +1102,7 @@ class Marketplace {
|
|
|
1076
1102
|
});
|
|
1077
1103
|
}, error => {
|
|
1078
1104
|
throw WebrpcRequestFailedError.new({
|
|
1079
|
-
cause: `fetch(): ${error.message
|
|
1105
|
+
cause: `fetch(): ${error instanceof Error ? error.message : String(error)}`
|
|
1080
1106
|
});
|
|
1081
1107
|
});
|
|
1082
1108
|
};
|
|
@@ -1105,13 +1131,9 @@ const buildResponse = res => {
|
|
|
1105
1131
|
try {
|
|
1106
1132
|
data = JSON.parse(text);
|
|
1107
1133
|
} catch (error) {
|
|
1108
|
-
let message = '';
|
|
1109
|
-
if (error instanceof Error) {
|
|
1110
|
-
message = error.message;
|
|
1111
|
-
}
|
|
1112
1134
|
throw WebrpcBadResponseError.new({
|
|
1113
1135
|
status: res.status,
|
|
1114
|
-
cause: `JSON.parse(): ${message}: response text: ${text}`
|
|
1136
|
+
cause: `JSON.parse(): ${error instanceof Error ? error.message : String(error)}: response text: ${text}`
|
|
1115
1137
|
});
|
|
1116
1138
|
}
|
|
1117
1139
|
if (!res.ok) {
|
|
@@ -1152,67 +1174,67 @@ class WebrpcError extends Error {
|
|
|
1152
1174
|
// Webrpc errors
|
|
1153
1175
|
|
|
1154
1176
|
class WebrpcEndpointError extends WebrpcError {
|
|
1155
|
-
constructor(name = 'WebrpcEndpoint', code = 0, message = `endpoint error`, status =
|
|
1177
|
+
constructor(name = 'WebrpcEndpoint', code = 0, message = `endpoint error`, status = 400, cause) {
|
|
1156
1178
|
super(name, code, message, status, cause);
|
|
1157
1179
|
Object.setPrototypeOf(this, WebrpcEndpointError.prototype);
|
|
1158
1180
|
}
|
|
1159
1181
|
}
|
|
1160
1182
|
class WebrpcRequestFailedError extends WebrpcError {
|
|
1161
|
-
constructor(name = 'WebrpcRequestFailed', code = -1, message = `request failed`, status =
|
|
1183
|
+
constructor(name = 'WebrpcRequestFailed', code = -1, message = `request failed`, status = 400, cause) {
|
|
1162
1184
|
super(name, code, message, status, cause);
|
|
1163
1185
|
Object.setPrototypeOf(this, WebrpcRequestFailedError.prototype);
|
|
1164
1186
|
}
|
|
1165
1187
|
}
|
|
1166
1188
|
class WebrpcBadRouteError extends WebrpcError {
|
|
1167
|
-
constructor(name = 'WebrpcBadRoute', code = -2, message = `bad route`, status =
|
|
1189
|
+
constructor(name = 'WebrpcBadRoute', code = -2, message = `bad route`, status = 404, cause) {
|
|
1168
1190
|
super(name, code, message, status, cause);
|
|
1169
1191
|
Object.setPrototypeOf(this, WebrpcBadRouteError.prototype);
|
|
1170
1192
|
}
|
|
1171
1193
|
}
|
|
1172
1194
|
class WebrpcBadMethodError extends WebrpcError {
|
|
1173
|
-
constructor(name = 'WebrpcBadMethod', code = -3, message = `bad method`, status =
|
|
1195
|
+
constructor(name = 'WebrpcBadMethod', code = -3, message = `bad method`, status = 405, cause) {
|
|
1174
1196
|
super(name, code, message, status, cause);
|
|
1175
1197
|
Object.setPrototypeOf(this, WebrpcBadMethodError.prototype);
|
|
1176
1198
|
}
|
|
1177
1199
|
}
|
|
1178
1200
|
class WebrpcBadRequestError extends WebrpcError {
|
|
1179
|
-
constructor(name = 'WebrpcBadRequest', code = -4, message = `bad request`, status =
|
|
1201
|
+
constructor(name = 'WebrpcBadRequest', code = -4, message = `bad request`, status = 400, cause) {
|
|
1180
1202
|
super(name, code, message, status, cause);
|
|
1181
1203
|
Object.setPrototypeOf(this, WebrpcBadRequestError.prototype);
|
|
1182
1204
|
}
|
|
1183
1205
|
}
|
|
1184
1206
|
class WebrpcBadResponseError extends WebrpcError {
|
|
1185
|
-
constructor(name = 'WebrpcBadResponse', code = -5, message = `bad response`, status =
|
|
1207
|
+
constructor(name = 'WebrpcBadResponse', code = -5, message = `bad response`, status = 500, cause) {
|
|
1186
1208
|
super(name, code, message, status, cause);
|
|
1187
1209
|
Object.setPrototypeOf(this, WebrpcBadResponseError.prototype);
|
|
1188
1210
|
}
|
|
1189
1211
|
}
|
|
1190
1212
|
class WebrpcServerPanicError extends WebrpcError {
|
|
1191
|
-
constructor(name = 'WebrpcServerPanic', code = -6, message = `server panic`, status =
|
|
1213
|
+
constructor(name = 'WebrpcServerPanic', code = -6, message = `server panic`, status = 500, cause) {
|
|
1192
1214
|
super(name, code, message, status, cause);
|
|
1193
1215
|
Object.setPrototypeOf(this, WebrpcServerPanicError.prototype);
|
|
1194
1216
|
}
|
|
1195
1217
|
}
|
|
1196
1218
|
class WebrpcInternalErrorError extends WebrpcError {
|
|
1197
|
-
constructor(name = 'WebrpcInternalError', code = -7, message = `internal error`, status =
|
|
1219
|
+
constructor(name = 'WebrpcInternalError', code = -7, message = `internal error`, status = 500, cause) {
|
|
1198
1220
|
super(name, code, message, status, cause);
|
|
1199
1221
|
Object.setPrototypeOf(this, WebrpcInternalErrorError.prototype);
|
|
1200
1222
|
}
|
|
1201
1223
|
}
|
|
1202
|
-
class
|
|
1203
|
-
constructor(name = '
|
|
1224
|
+
class WebrpcClientAbortedError extends WebrpcError {
|
|
1225
|
+
constructor(name = 'WebrpcClientAborted', code = -8, message = `request aborted by client`, status = 400, cause) {
|
|
1204
1226
|
super(name, code, message, status, cause);
|
|
1205
|
-
Object.setPrototypeOf(this,
|
|
1227
|
+
Object.setPrototypeOf(this, WebrpcClientAbortedError.prototype);
|
|
1206
1228
|
}
|
|
1207
1229
|
}
|
|
1208
1230
|
class WebrpcStreamLostError extends WebrpcError {
|
|
1209
|
-
constructor(name = 'WebrpcStreamLost', code = -9, message = `stream lost`, status =
|
|
1231
|
+
constructor(name = 'WebrpcStreamLost', code = -9, message = `stream lost`, status = 400, cause) {
|
|
1210
1232
|
super(name, code, message, status, cause);
|
|
1211
1233
|
Object.setPrototypeOf(this, WebrpcStreamLostError.prototype);
|
|
1212
1234
|
}
|
|
1213
1235
|
}
|
|
1214
1236
|
class WebrpcStreamFinishedError extends WebrpcError {
|
|
1215
|
-
constructor(name = 'WebrpcStreamFinished', code = -10, message = `stream finished`, status =
|
|
1237
|
+
constructor(name = 'WebrpcStreamFinished', code = -10, message = `stream finished`, status = 200, cause) {
|
|
1216
1238
|
super(name, code, message, status, cause);
|
|
1217
1239
|
Object.setPrototypeOf(this, WebrpcStreamFinishedError.prototype);
|
|
1218
1240
|
}
|
|
@@ -1221,73 +1243,151 @@ class WebrpcStreamFinishedError extends WebrpcError {
|
|
|
1221
1243
|
// Schema errors
|
|
1222
1244
|
|
|
1223
1245
|
class UnauthorizedError extends WebrpcError {
|
|
1224
|
-
constructor(name = 'Unauthorized', code = 1000, message = `Unauthorized access`, status =
|
|
1246
|
+
constructor(name = 'Unauthorized', code = 1000, message = `Unauthorized access`, status = 401, cause) {
|
|
1225
1247
|
super(name, code, message, status, cause);
|
|
1226
1248
|
Object.setPrototypeOf(this, UnauthorizedError.prototype);
|
|
1227
1249
|
}
|
|
1228
1250
|
}
|
|
1229
1251
|
class PermissionDeniedError extends WebrpcError {
|
|
1230
|
-
constructor(name = 'PermissionDenied', code = 1001, message = `Permission denied`, status =
|
|
1252
|
+
constructor(name = 'PermissionDenied', code = 1001, message = `Permission denied`, status = 403, cause) {
|
|
1231
1253
|
super(name, code, message, status, cause);
|
|
1232
1254
|
Object.setPrototypeOf(this, PermissionDeniedError.prototype);
|
|
1233
1255
|
}
|
|
1234
1256
|
}
|
|
1235
1257
|
class SessionExpiredError extends WebrpcError {
|
|
1236
|
-
constructor(name = 'SessionExpired', code = 1002, message = `Session expired`, status =
|
|
1258
|
+
constructor(name = 'SessionExpired', code = 1002, message = `Session expired`, status = 403, cause) {
|
|
1237
1259
|
super(name, code, message, status, cause);
|
|
1238
1260
|
Object.setPrototypeOf(this, SessionExpiredError.prototype);
|
|
1239
1261
|
}
|
|
1240
1262
|
}
|
|
1241
1263
|
class MethodNotFoundError extends WebrpcError {
|
|
1242
|
-
constructor(name = 'MethodNotFound', code = 1003, message = `Method not found`, status =
|
|
1264
|
+
constructor(name = 'MethodNotFound', code = 1003, message = `Method not found`, status = 404, cause) {
|
|
1243
1265
|
super(name, code, message, status, cause);
|
|
1244
1266
|
Object.setPrototypeOf(this, MethodNotFoundError.prototype);
|
|
1245
1267
|
}
|
|
1246
1268
|
}
|
|
1247
|
-
class
|
|
1248
|
-
constructor(name = '
|
|
1269
|
+
class RequestConflictError extends WebrpcError {
|
|
1270
|
+
constructor(name = 'RequestConflict', code = 1004, message = `Conflict with target resource`, status = 409, cause) {
|
|
1249
1271
|
super(name, code, message, status, cause);
|
|
1250
|
-
Object.setPrototypeOf(this,
|
|
1272
|
+
Object.setPrototypeOf(this, RequestConflictError.prototype);
|
|
1251
1273
|
}
|
|
1252
1274
|
}
|
|
1253
|
-
class
|
|
1254
|
-
constructor(name = '
|
|
1275
|
+
class AbortedError extends WebrpcError {
|
|
1276
|
+
constructor(name = 'Aborted', code = 1005, message = `Request aborted`, status = 400, cause) {
|
|
1255
1277
|
super(name, code, message, status, cause);
|
|
1256
|
-
Object.setPrototypeOf(this,
|
|
1278
|
+
Object.setPrototypeOf(this, AbortedError.prototype);
|
|
1257
1279
|
}
|
|
1258
1280
|
}
|
|
1259
|
-
class
|
|
1260
|
-
constructor(name = '
|
|
1281
|
+
class GeoblockedError extends WebrpcError {
|
|
1282
|
+
constructor(name = 'Geoblocked', code = 1006, message = `Geoblocked region`, status = 451, cause) {
|
|
1261
1283
|
super(name, code, message, status, cause);
|
|
1262
|
-
Object.setPrototypeOf(this,
|
|
1284
|
+
Object.setPrototypeOf(this, GeoblockedError.prototype);
|
|
1263
1285
|
}
|
|
1264
1286
|
}
|
|
1265
|
-
class
|
|
1266
|
-
constructor(name = '
|
|
1287
|
+
class RateLimitedError extends WebrpcError {
|
|
1288
|
+
constructor(name = 'RateLimited', code = 1007, message = `Rate-limited. Please slow down.`, status = 429, cause) {
|
|
1267
1289
|
super(name, code, message, status, cause);
|
|
1268
|
-
Object.setPrototypeOf(this,
|
|
1290
|
+
Object.setPrototypeOf(this, RateLimitedError.prototype);
|
|
1269
1291
|
}
|
|
1270
1292
|
}
|
|
1271
1293
|
class ProjectNotFoundError extends WebrpcError {
|
|
1272
|
-
constructor(name = 'ProjectNotFound', code =
|
|
1294
|
+
constructor(name = 'ProjectNotFound', code = 1008, message = `Project not found`, status = 401, cause) {
|
|
1273
1295
|
super(name, code, message, status, cause);
|
|
1274
1296
|
Object.setPrototypeOf(this, ProjectNotFoundError.prototype);
|
|
1275
1297
|
}
|
|
1276
1298
|
}
|
|
1277
|
-
class
|
|
1278
|
-
constructor(name = '
|
|
1299
|
+
class SecretKeyCorsDisallowedError extends WebrpcError {
|
|
1300
|
+
constructor(name = 'SecretKeyCorsDisallowed', code = 1009, message = `CORS disallowed. Admin API Secret Key can't be used from a web app.`, status = 403, cause) {
|
|
1301
|
+
super(name, code, message, status, cause);
|
|
1302
|
+
Object.setPrototypeOf(this, SecretKeyCorsDisallowedError.prototype);
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
class AccessKeyNotFoundError extends WebrpcError {
|
|
1306
|
+
constructor(name = 'AccessKeyNotFound', code = 1101, message = `Access key not found`, status = 401, cause) {
|
|
1307
|
+
super(name, code, message, status, cause);
|
|
1308
|
+
Object.setPrototypeOf(this, AccessKeyNotFoundError.prototype);
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
class AccessKeyMismatchError extends WebrpcError {
|
|
1312
|
+
constructor(name = 'AccessKeyMismatch', code = 1102, message = `Access key mismatch`, status = 403, cause) {
|
|
1313
|
+
super(name, code, message, status, cause);
|
|
1314
|
+
Object.setPrototypeOf(this, AccessKeyMismatchError.prototype);
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
class InvalidOriginError extends WebrpcError {
|
|
1318
|
+
constructor(name = 'InvalidOrigin', code = 1103, message = `Invalid origin for Access Key`, status = 403, cause) {
|
|
1319
|
+
super(name, code, message, status, cause);
|
|
1320
|
+
Object.setPrototypeOf(this, InvalidOriginError.prototype);
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
class InvalidServiceError extends WebrpcError {
|
|
1324
|
+
constructor(name = 'InvalidService', code = 1104, message = `Service not enabled for Access key`, status = 403, cause) {
|
|
1325
|
+
super(name, code, message, status, cause);
|
|
1326
|
+
Object.setPrototypeOf(this, InvalidServiceError.prototype);
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
class UnauthorizedUserError extends WebrpcError {
|
|
1330
|
+
constructor(name = 'UnauthorizedUser', code = 1105, message = `Unauthorized user`, status = 403, cause) {
|
|
1331
|
+
super(name, code, message, status, cause);
|
|
1332
|
+
Object.setPrototypeOf(this, UnauthorizedUserError.prototype);
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
class InvalidChainError extends WebrpcError {
|
|
1336
|
+
constructor(name = 'InvalidChain', code = 1106, message = `Network not enabled for Access key`, status = 403, cause) {
|
|
1337
|
+
super(name, code, message, status, cause);
|
|
1338
|
+
Object.setPrototypeOf(this, InvalidChainError.prototype);
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
class QuotaExceededError extends WebrpcError {
|
|
1342
|
+
constructor(name = 'QuotaExceeded', code = 1200, message = `Quota request exceeded`, status = 429, cause) {
|
|
1343
|
+
super(name, code, message, status, cause);
|
|
1344
|
+
Object.setPrototypeOf(this, QuotaExceededError.prototype);
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
class QuotaRateLimitError extends WebrpcError {
|
|
1348
|
+
constructor(name = 'QuotaRateLimit', code = 1201, message = `Quota rate limit exceeded`, status = 429, cause) {
|
|
1349
|
+
super(name, code, message, status, cause);
|
|
1350
|
+
Object.setPrototypeOf(this, QuotaRateLimitError.prototype);
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
class NoDefaultKeyError extends WebrpcError {
|
|
1354
|
+
constructor(name = 'NoDefaultKey', code = 1300, message = `No default access key found`, status = 403, cause) {
|
|
1279
1355
|
super(name, code, message, status, cause);
|
|
1280
|
-
Object.setPrototypeOf(this,
|
|
1356
|
+
Object.setPrototypeOf(this, NoDefaultKeyError.prototype);
|
|
1281
1357
|
}
|
|
1282
1358
|
}
|
|
1283
|
-
class
|
|
1284
|
-
constructor(name = '
|
|
1359
|
+
class MaxAccessKeysError extends WebrpcError {
|
|
1360
|
+
constructor(name = 'MaxAccessKeys', code = 1301, message = `Access keys limit reached`, status = 403, cause) {
|
|
1285
1361
|
super(name, code, message, status, cause);
|
|
1286
|
-
Object.setPrototypeOf(this,
|
|
1362
|
+
Object.setPrototypeOf(this, MaxAccessKeysError.prototype);
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
class AtLeastOneKeyError extends WebrpcError {
|
|
1366
|
+
constructor(name = 'AtLeastOneKey', code = 1302, message = `You need at least one Access Key`, status = 403, cause) {
|
|
1367
|
+
super(name, code, message, status, cause);
|
|
1368
|
+
Object.setPrototypeOf(this, AtLeastOneKeyError.prototype);
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
class TimeoutError extends WebrpcError {
|
|
1372
|
+
constructor(name = 'Timeout', code = 1900, message = `Request timed out`, status = 408, cause) {
|
|
1373
|
+
super(name, code, message, status, cause);
|
|
1374
|
+
Object.setPrototypeOf(this, TimeoutError.prototype);
|
|
1375
|
+
}
|
|
1376
|
+
}
|
|
1377
|
+
class NotFoundError extends WebrpcError {
|
|
1378
|
+
constructor(name = 'NotFound', code = 2000, message = `Resource not found`, status = 400, cause) {
|
|
1379
|
+
super(name, code, message, status, cause);
|
|
1380
|
+
Object.setPrototypeOf(this, NotFoundError.prototype);
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
class InvalidArgumentError extends WebrpcError {
|
|
1384
|
+
constructor(name = 'InvalidArgument', code = 2001, message = `Invalid argument`, status = 400, cause) {
|
|
1385
|
+
super(name, code, message, status, cause);
|
|
1386
|
+
Object.setPrototypeOf(this, InvalidArgumentError.prototype);
|
|
1287
1387
|
}
|
|
1288
1388
|
}
|
|
1289
1389
|
class NotImplementedError extends WebrpcError {
|
|
1290
|
-
constructor(name = 'NotImplemented', code = 9999, message = `Not Implemented`, status =
|
|
1390
|
+
constructor(name = 'NotImplemented', code = 9999, message = `Not Implemented`, status = 500, cause) {
|
|
1291
1391
|
super(name, code, message, status, cause);
|
|
1292
1392
|
Object.setPrototypeOf(this, NotImplementedError.prototype);
|
|
1293
1393
|
}
|
|
@@ -1301,20 +1401,33 @@ let errors = /*#__PURE__*/function (errors) {
|
|
|
1301
1401
|
errors["WebrpcBadResponse"] = "WebrpcBadResponse";
|
|
1302
1402
|
errors["WebrpcServerPanic"] = "WebrpcServerPanic";
|
|
1303
1403
|
errors["WebrpcInternalError"] = "WebrpcInternalError";
|
|
1304
|
-
errors["
|
|
1404
|
+
errors["WebrpcClientAborted"] = "WebrpcClientAborted";
|
|
1305
1405
|
errors["WebrpcStreamLost"] = "WebrpcStreamLost";
|
|
1306
1406
|
errors["WebrpcStreamFinished"] = "WebrpcStreamFinished";
|
|
1307
1407
|
errors["Unauthorized"] = "Unauthorized";
|
|
1308
1408
|
errors["PermissionDenied"] = "PermissionDenied";
|
|
1309
1409
|
errors["SessionExpired"] = "SessionExpired";
|
|
1310
1410
|
errors["MethodNotFound"] = "MethodNotFound";
|
|
1411
|
+
errors["RequestConflict"] = "RequestConflict";
|
|
1412
|
+
errors["Aborted"] = "Aborted";
|
|
1413
|
+
errors["Geoblocked"] = "Geoblocked";
|
|
1414
|
+
errors["RateLimited"] = "RateLimited";
|
|
1415
|
+
errors["ProjectNotFound"] = "ProjectNotFound";
|
|
1416
|
+
errors["SecretKeyCorsDisallowed"] = "SecretKeyCorsDisallowed";
|
|
1417
|
+
errors["AccessKeyNotFound"] = "AccessKeyNotFound";
|
|
1418
|
+
errors["AccessKeyMismatch"] = "AccessKeyMismatch";
|
|
1419
|
+
errors["InvalidOrigin"] = "InvalidOrigin";
|
|
1420
|
+
errors["InvalidService"] = "InvalidService";
|
|
1421
|
+
errors["UnauthorizedUser"] = "UnauthorizedUser";
|
|
1422
|
+
errors["InvalidChain"] = "InvalidChain";
|
|
1423
|
+
errors["QuotaExceeded"] = "QuotaExceeded";
|
|
1424
|
+
errors["QuotaRateLimit"] = "QuotaRateLimit";
|
|
1425
|
+
errors["NoDefaultKey"] = "NoDefaultKey";
|
|
1426
|
+
errors["MaxAccessKeys"] = "MaxAccessKeys";
|
|
1427
|
+
errors["AtLeastOneKey"] = "AtLeastOneKey";
|
|
1311
1428
|
errors["Timeout"] = "Timeout";
|
|
1312
|
-
errors["InvalidArgument"] = "InvalidArgument";
|
|
1313
1429
|
errors["NotFound"] = "NotFound";
|
|
1314
|
-
errors["
|
|
1315
|
-
errors["ProjectNotFound"] = "ProjectNotFound";
|
|
1316
|
-
errors["InvalidTier"] = "InvalidTier";
|
|
1317
|
-
errors["ProjectLimitReached"] = "ProjectLimitReached";
|
|
1430
|
+
errors["InvalidArgument"] = "InvalidArgument";
|
|
1318
1431
|
errors["NotImplemented"] = "NotImplemented";
|
|
1319
1432
|
return errors;
|
|
1320
1433
|
}({});
|
|
@@ -1327,20 +1440,33 @@ let WebrpcErrorCodes = /*#__PURE__*/function (WebrpcErrorCodes) {
|
|
|
1327
1440
|
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcBadResponse"] = -5] = "WebrpcBadResponse";
|
|
1328
1441
|
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcServerPanic"] = -6] = "WebrpcServerPanic";
|
|
1329
1442
|
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcInternalError"] = -7] = "WebrpcInternalError";
|
|
1330
|
-
WebrpcErrorCodes[WebrpcErrorCodes["
|
|
1443
|
+
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcClientAborted"] = -8] = "WebrpcClientAborted";
|
|
1331
1444
|
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcStreamLost"] = -9] = "WebrpcStreamLost";
|
|
1332
1445
|
WebrpcErrorCodes[WebrpcErrorCodes["WebrpcStreamFinished"] = -10] = "WebrpcStreamFinished";
|
|
1333
1446
|
WebrpcErrorCodes[WebrpcErrorCodes["Unauthorized"] = 1000] = "Unauthorized";
|
|
1334
1447
|
WebrpcErrorCodes[WebrpcErrorCodes["PermissionDenied"] = 1001] = "PermissionDenied";
|
|
1335
1448
|
WebrpcErrorCodes[WebrpcErrorCodes["SessionExpired"] = 1002] = "SessionExpired";
|
|
1336
1449
|
WebrpcErrorCodes[WebrpcErrorCodes["MethodNotFound"] = 1003] = "MethodNotFound";
|
|
1337
|
-
WebrpcErrorCodes[WebrpcErrorCodes["
|
|
1450
|
+
WebrpcErrorCodes[WebrpcErrorCodes["RequestConflict"] = 1004] = "RequestConflict";
|
|
1451
|
+
WebrpcErrorCodes[WebrpcErrorCodes["Aborted"] = 1005] = "Aborted";
|
|
1452
|
+
WebrpcErrorCodes[WebrpcErrorCodes["Geoblocked"] = 1006] = "Geoblocked";
|
|
1453
|
+
WebrpcErrorCodes[WebrpcErrorCodes["RateLimited"] = 1007] = "RateLimited";
|
|
1454
|
+
WebrpcErrorCodes[WebrpcErrorCodes["ProjectNotFound"] = 1008] = "ProjectNotFound";
|
|
1455
|
+
WebrpcErrorCodes[WebrpcErrorCodes["SecretKeyCorsDisallowed"] = 1009] = "SecretKeyCorsDisallowed";
|
|
1456
|
+
WebrpcErrorCodes[WebrpcErrorCodes["AccessKeyNotFound"] = 1101] = "AccessKeyNotFound";
|
|
1457
|
+
WebrpcErrorCodes[WebrpcErrorCodes["AccessKeyMismatch"] = 1102] = "AccessKeyMismatch";
|
|
1458
|
+
WebrpcErrorCodes[WebrpcErrorCodes["InvalidOrigin"] = 1103] = "InvalidOrigin";
|
|
1459
|
+
WebrpcErrorCodes[WebrpcErrorCodes["InvalidService"] = 1104] = "InvalidService";
|
|
1460
|
+
WebrpcErrorCodes[WebrpcErrorCodes["UnauthorizedUser"] = 1105] = "UnauthorizedUser";
|
|
1461
|
+
WebrpcErrorCodes[WebrpcErrorCodes["InvalidChain"] = 1106] = "InvalidChain";
|
|
1462
|
+
WebrpcErrorCodes[WebrpcErrorCodes["QuotaExceeded"] = 1200] = "QuotaExceeded";
|
|
1463
|
+
WebrpcErrorCodes[WebrpcErrorCodes["QuotaRateLimit"] = 1201] = "QuotaRateLimit";
|
|
1464
|
+
WebrpcErrorCodes[WebrpcErrorCodes["NoDefaultKey"] = 1300] = "NoDefaultKey";
|
|
1465
|
+
WebrpcErrorCodes[WebrpcErrorCodes["MaxAccessKeys"] = 1301] = "MaxAccessKeys";
|
|
1466
|
+
WebrpcErrorCodes[WebrpcErrorCodes["AtLeastOneKey"] = 1302] = "AtLeastOneKey";
|
|
1467
|
+
WebrpcErrorCodes[WebrpcErrorCodes["Timeout"] = 1900] = "Timeout";
|
|
1468
|
+
WebrpcErrorCodes[WebrpcErrorCodes["NotFound"] = 2000] = "NotFound";
|
|
1338
1469
|
WebrpcErrorCodes[WebrpcErrorCodes["InvalidArgument"] = 2001] = "InvalidArgument";
|
|
1339
|
-
WebrpcErrorCodes[WebrpcErrorCodes["NotFound"] = 3000] = "NotFound";
|
|
1340
|
-
WebrpcErrorCodes[WebrpcErrorCodes["UserNotFound"] = 3001] = "UserNotFound";
|
|
1341
|
-
WebrpcErrorCodes[WebrpcErrorCodes["ProjectNotFound"] = 3002] = "ProjectNotFound";
|
|
1342
|
-
WebrpcErrorCodes[WebrpcErrorCodes["InvalidTier"] = 3003] = "InvalidTier";
|
|
1343
|
-
WebrpcErrorCodes[WebrpcErrorCodes["ProjectLimitReached"] = 3005] = "ProjectLimitReached";
|
|
1344
1470
|
WebrpcErrorCodes[WebrpcErrorCodes["NotImplemented"] = 9999] = "NotImplemented";
|
|
1345
1471
|
return WebrpcErrorCodes;
|
|
1346
1472
|
}({});
|
|
@@ -1353,20 +1479,33 @@ const webrpcErrorByCode = {
|
|
|
1353
1479
|
[-5]: WebrpcBadResponseError,
|
|
1354
1480
|
[-6]: WebrpcServerPanicError,
|
|
1355
1481
|
[-7]: WebrpcInternalErrorError,
|
|
1356
|
-
[-8]:
|
|
1482
|
+
[-8]: WebrpcClientAbortedError,
|
|
1357
1483
|
[-9]: WebrpcStreamLostError,
|
|
1358
1484
|
[-10]: WebrpcStreamFinishedError,
|
|
1359
1485
|
[1000]: UnauthorizedError,
|
|
1360
1486
|
[1001]: PermissionDeniedError,
|
|
1361
1487
|
[1002]: SessionExpiredError,
|
|
1362
1488
|
[1003]: MethodNotFoundError,
|
|
1363
|
-
[
|
|
1489
|
+
[1004]: RequestConflictError,
|
|
1490
|
+
[1005]: AbortedError,
|
|
1491
|
+
[1006]: GeoblockedError,
|
|
1492
|
+
[1007]: RateLimitedError,
|
|
1493
|
+
[1008]: ProjectNotFoundError,
|
|
1494
|
+
[1009]: SecretKeyCorsDisallowedError,
|
|
1495
|
+
[1101]: AccessKeyNotFoundError,
|
|
1496
|
+
[1102]: AccessKeyMismatchError,
|
|
1497
|
+
[1103]: InvalidOriginError,
|
|
1498
|
+
[1104]: InvalidServiceError,
|
|
1499
|
+
[1105]: UnauthorizedUserError,
|
|
1500
|
+
[1106]: InvalidChainError,
|
|
1501
|
+
[1200]: QuotaExceededError,
|
|
1502
|
+
[1201]: QuotaRateLimitError,
|
|
1503
|
+
[1300]: NoDefaultKeyError,
|
|
1504
|
+
[1301]: MaxAccessKeysError,
|
|
1505
|
+
[1302]: AtLeastOneKeyError,
|
|
1506
|
+
[1900]: TimeoutError,
|
|
1507
|
+
[2000]: NotFoundError,
|
|
1364
1508
|
[2001]: InvalidArgumentError,
|
|
1365
|
-
[3000]: NotFoundError,
|
|
1366
|
-
[3001]: UserNotFoundError,
|
|
1367
|
-
[3002]: ProjectNotFoundError,
|
|
1368
|
-
[3003]: InvalidTierError,
|
|
1369
|
-
[3005]: ProjectLimitReachedError,
|
|
1370
1509
|
[9999]: NotImplementedError
|
|
1371
1510
|
};
|
|
1372
1511
|
|
|
@@ -1396,8 +1535,12 @@ class MarketplaceIndexer extends Marketplace {
|
|
|
1396
1535
|
}
|
|
1397
1536
|
}
|
|
1398
1537
|
|
|
1538
|
+
exports.AbortedError = AbortedError;
|
|
1539
|
+
exports.AccessKeyMismatchError = AccessKeyMismatchError;
|
|
1540
|
+
exports.AccessKeyNotFoundError = AccessKeyNotFoundError;
|
|
1399
1541
|
exports.ActivityAction = ActivityAction;
|
|
1400
1542
|
exports.Admin = Admin;
|
|
1543
|
+
exports.AtLeastOneKeyError = AtLeastOneKeyError;
|
|
1401
1544
|
exports.CollectibleSource = CollectibleSource;
|
|
1402
1545
|
exports.CollectibleStatus = CollectibleStatus;
|
|
1403
1546
|
exports.CollectionPriority = CollectionPriority;
|
|
@@ -1405,14 +1548,19 @@ exports.CollectionStatus = CollectionStatus;
|
|
|
1405
1548
|
exports.ContractType = ContractType;
|
|
1406
1549
|
exports.CurrencyStatus = CurrencyStatus;
|
|
1407
1550
|
exports.ExecuteType = ExecuteType;
|
|
1551
|
+
exports.GeoblockedError = GeoblockedError;
|
|
1408
1552
|
exports.InvalidArgumentError = InvalidArgumentError;
|
|
1409
|
-
exports.
|
|
1553
|
+
exports.InvalidChainError = InvalidChainError;
|
|
1554
|
+
exports.InvalidOriginError = InvalidOriginError;
|
|
1555
|
+
exports.InvalidServiceError = InvalidServiceError;
|
|
1410
1556
|
exports.ItemsContractStatus = ItemsContractStatus;
|
|
1411
1557
|
exports.Marketplace = Marketplace;
|
|
1412
1558
|
exports.MarketplaceIndexer = MarketplaceIndexer;
|
|
1413
1559
|
exports.MarketplaceKind = MarketplaceKind;
|
|
1560
|
+
exports.MaxAccessKeysError = MaxAccessKeysError;
|
|
1414
1561
|
exports.MetadataStatus = MetadataStatus;
|
|
1415
1562
|
exports.MethodNotFoundError = MethodNotFoundError;
|
|
1563
|
+
exports.NoDefaultKeyError = NoDefaultKeyError;
|
|
1416
1564
|
exports.NotFoundError = NotFoundError;
|
|
1417
1565
|
exports.NotImplementedError = NotImplementedError;
|
|
1418
1566
|
exports.OfferType = OfferType;
|
|
@@ -1423,10 +1571,14 @@ exports.PermissionDeniedError = PermissionDeniedError;
|
|
|
1423
1571
|
exports.PrimarySaleContractStatus = PrimarySaleContractStatus;
|
|
1424
1572
|
exports.PrimarySaleItemDetailType = PrimarySaleItemDetailType;
|
|
1425
1573
|
exports.PrimarySaleVersion = PrimarySaleVersion;
|
|
1426
|
-
exports.ProjectLimitReachedError = ProjectLimitReachedError;
|
|
1427
1574
|
exports.ProjectNotFoundError = ProjectNotFoundError;
|
|
1428
1575
|
exports.ProjectStatus = ProjectStatus;
|
|
1429
1576
|
exports.PropertyType = PropertyType;
|
|
1577
|
+
exports.QuotaExceededError = QuotaExceededError;
|
|
1578
|
+
exports.QuotaRateLimitError = QuotaRateLimitError;
|
|
1579
|
+
exports.RateLimitedError = RateLimitedError;
|
|
1580
|
+
exports.RequestConflictError = RequestConflictError;
|
|
1581
|
+
exports.SecretKeyCorsDisallowedError = SecretKeyCorsDisallowedError;
|
|
1430
1582
|
exports.SessionExpiredError = SessionExpiredError;
|
|
1431
1583
|
exports.SortOrder = SortOrder;
|
|
1432
1584
|
exports.SourceKind = SourceKind;
|
|
@@ -1437,7 +1589,7 @@ exports.TransactionNFTCheckoutProvider = TransactionNFTCheckoutProvider;
|
|
|
1437
1589
|
exports.TransactionOnRampProvider = TransactionOnRampProvider;
|
|
1438
1590
|
exports.TransactionSwapProvider = TransactionSwapProvider;
|
|
1439
1591
|
exports.UnauthorizedError = UnauthorizedError;
|
|
1440
|
-
exports.
|
|
1592
|
+
exports.UnauthorizedUserError = UnauthorizedUserError;
|
|
1441
1593
|
exports.VersionFromHeader = VersionFromHeader;
|
|
1442
1594
|
exports.WalletKind = WalletKind;
|
|
1443
1595
|
exports.WebRPCSchemaHash = WebRPCSchemaHash;
|
|
@@ -1447,7 +1599,7 @@ exports.WebrpcBadMethodError = WebrpcBadMethodError;
|
|
|
1447
1599
|
exports.WebrpcBadRequestError = WebrpcBadRequestError;
|
|
1448
1600
|
exports.WebrpcBadResponseError = WebrpcBadResponseError;
|
|
1449
1601
|
exports.WebrpcBadRouteError = WebrpcBadRouteError;
|
|
1450
|
-
exports.
|
|
1602
|
+
exports.WebrpcClientAbortedError = WebrpcClientAbortedError;
|
|
1451
1603
|
exports.WebrpcEndpointError = WebrpcEndpointError;
|
|
1452
1604
|
exports.WebrpcError = WebrpcError;
|
|
1453
1605
|
exports.WebrpcErrorCodes = WebrpcErrorCodes;
|