@brigadasos/nadeshiko-sdk 1.5.1-dev.e889ab8 → 2.0.0-dev.1607304
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/README.md +144 -89
- package/dist/errors.d.ts +48 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/index.cjs +250 -252
- package/dist/index.cjs.map +8 -5
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +250 -252
- package/dist/index.js.map +8 -5
- package/dist/internal/media.gen.d.ts +1 -1
- package/dist/internal/media.gen.d.ts.map +1 -1
- package/dist/nadeshiko.gen.d.ts +1430 -80
- package/dist/nadeshiko.gen.d.ts.map +1 -1
- package/dist/paginate.d.ts +28 -0
- package/dist/paginate.d.ts.map +1 -0
- package/dist/retry.d.ts +17 -0
- package/dist/retry.d.ts.map +1 -0
- package/dist/sdk.gen.d.ts +26 -180
- package/dist/sdk.gen.d.ts.map +1 -1
- package/dist/types.gen.d.ts +129 -113
- package/dist/types.gen.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -817,11 +817,7 @@ var client = createClient(createConfig({ baseUrl: "https://api.nadeshiko.co" }))
|
|
|
817
817
|
|
|
818
818
|
// generated/dev/sdk.gen.ts
|
|
819
819
|
var search = (options) => (options?.client ?? client).post({
|
|
820
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
821
|
-
in: "cookie",
|
|
822
|
-
name: "nadeshiko.session_token",
|
|
823
|
-
type: "apiKey"
|
|
824
|
-
}],
|
|
820
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
825
821
|
url: "/v1/search",
|
|
826
822
|
...options,
|
|
827
823
|
headers: {
|
|
@@ -830,11 +826,7 @@ var search = (options) => (options?.client ?? client).post({
|
|
|
830
826
|
}
|
|
831
827
|
});
|
|
832
828
|
var getSearchStats = (options) => (options?.client ?? client).post({
|
|
833
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
834
|
-
in: "cookie",
|
|
835
|
-
name: "nadeshiko.session_token",
|
|
836
|
-
type: "apiKey"
|
|
837
|
-
}],
|
|
829
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
838
830
|
url: "/v1/search/stats",
|
|
839
831
|
...options,
|
|
840
832
|
headers: {
|
|
@@ -843,11 +835,7 @@ var getSearchStats = (options) => (options?.client ?? client).post({
|
|
|
843
835
|
}
|
|
844
836
|
});
|
|
845
837
|
var searchWords = (options) => (options.client ?? client).post({
|
|
846
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
847
|
-
in: "cookie",
|
|
848
|
-
name: "nadeshiko.session_token",
|
|
849
|
-
type: "apiKey"
|
|
850
|
-
}],
|
|
838
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
851
839
|
url: "/v1/search/words",
|
|
852
840
|
...options,
|
|
853
841
|
headers: {
|
|
@@ -856,20 +844,12 @@ var searchWords = (options) => (options.client ?? client).post({
|
|
|
856
844
|
}
|
|
857
845
|
});
|
|
858
846
|
var listMedia = (options) => (options?.client ?? client).get({
|
|
859
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
860
|
-
in: "cookie",
|
|
861
|
-
name: "nadeshiko.session_token",
|
|
862
|
-
type: "apiKey"
|
|
863
|
-
}],
|
|
847
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
864
848
|
url: "/v1/media",
|
|
865
849
|
...options
|
|
866
850
|
});
|
|
867
851
|
var createMedia = (options) => (options.client ?? client).post({
|
|
868
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
869
|
-
in: "cookie",
|
|
870
|
-
name: "nadeshiko.session_token",
|
|
871
|
-
type: "apiKey"
|
|
872
|
-
}],
|
|
852
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
873
853
|
url: "/v1/media",
|
|
874
854
|
...options,
|
|
875
855
|
headers: {
|
|
@@ -878,29 +858,17 @@ var createMedia = (options) => (options.client ?? client).post({
|
|
|
878
858
|
}
|
|
879
859
|
});
|
|
880
860
|
var autocompleteMedia = (options) => (options.client ?? client).get({
|
|
881
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
882
|
-
in: "cookie",
|
|
883
|
-
name: "nadeshiko.session_token",
|
|
884
|
-
type: "apiKey"
|
|
885
|
-
}],
|
|
861
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
886
862
|
url: "/v1/media/autocomplete",
|
|
887
863
|
...options
|
|
888
864
|
});
|
|
889
865
|
var getSegmentByUuid = (options) => (options.client ?? client).get({
|
|
890
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
891
|
-
in: "cookie",
|
|
892
|
-
name: "nadeshiko.session_token",
|
|
893
|
-
type: "apiKey"
|
|
894
|
-
}],
|
|
866
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
895
867
|
url: "/v1/media/segments/{uuid}",
|
|
896
868
|
...options
|
|
897
869
|
});
|
|
898
870
|
var updateSegmentByUuid = (options) => (options.client ?? client).patch({
|
|
899
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
900
|
-
in: "cookie",
|
|
901
|
-
name: "nadeshiko.session_token",
|
|
902
|
-
type: "apiKey"
|
|
903
|
-
}],
|
|
871
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
904
872
|
url: "/v1/media/segments/{uuid}",
|
|
905
873
|
...options,
|
|
906
874
|
headers: {
|
|
@@ -909,38 +877,22 @@ var updateSegmentByUuid = (options) => (options.client ?? client).patch({
|
|
|
909
877
|
}
|
|
910
878
|
});
|
|
911
879
|
var getSegmentContext = (options) => (options.client ?? client).get({
|
|
912
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
913
|
-
in: "cookie",
|
|
914
|
-
name: "nadeshiko.session_token",
|
|
915
|
-
type: "apiKey"
|
|
916
|
-
}],
|
|
880
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
917
881
|
url: "/v1/media/segments/{uuid}/context",
|
|
918
882
|
...options
|
|
919
883
|
});
|
|
920
884
|
var listSegmentRevisions = (options) => (options.client ?? client).get({
|
|
921
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
922
|
-
in: "cookie",
|
|
923
|
-
name: "nadeshiko.session_token",
|
|
924
|
-
type: "apiKey"
|
|
925
|
-
}],
|
|
885
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
926
886
|
url: "/v1/media/segments/{uuid}/revisions",
|
|
927
887
|
...options
|
|
928
888
|
});
|
|
929
889
|
var listSeries = (options) => (options?.client ?? client).get({
|
|
930
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
931
|
-
in: "cookie",
|
|
932
|
-
name: "nadeshiko.session_token",
|
|
933
|
-
type: "apiKey"
|
|
934
|
-
}],
|
|
890
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
935
891
|
url: "/v1/media/series",
|
|
936
892
|
...options
|
|
937
893
|
});
|
|
938
894
|
var createSeries = (options) => (options.client ?? client).post({
|
|
939
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
940
|
-
in: "cookie",
|
|
941
|
-
name: "nadeshiko.session_token",
|
|
942
|
-
type: "apiKey"
|
|
943
|
-
}],
|
|
895
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
944
896
|
url: "/v1/media/series",
|
|
945
897
|
...options,
|
|
946
898
|
headers: {
|
|
@@ -949,29 +901,17 @@ var createSeries = (options) => (options.client ?? client).post({
|
|
|
949
901
|
}
|
|
950
902
|
});
|
|
951
903
|
var deleteSeries = (options) => (options.client ?? client).delete({
|
|
952
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
953
|
-
in: "cookie",
|
|
954
|
-
name: "nadeshiko.session_token",
|
|
955
|
-
type: "apiKey"
|
|
956
|
-
}],
|
|
904
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
957
905
|
url: "/v1/media/series/{id}",
|
|
958
906
|
...options
|
|
959
907
|
});
|
|
960
908
|
var getSeries = (options) => (options.client ?? client).get({
|
|
961
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
962
|
-
in: "cookie",
|
|
963
|
-
name: "nadeshiko.session_token",
|
|
964
|
-
type: "apiKey"
|
|
965
|
-
}],
|
|
909
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
966
910
|
url: "/v1/media/series/{id}",
|
|
967
911
|
...options
|
|
968
912
|
});
|
|
969
913
|
var updateSeries = (options) => (options.client ?? client).patch({
|
|
970
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
971
|
-
in: "cookie",
|
|
972
|
-
name: "nadeshiko.session_token",
|
|
973
|
-
type: "apiKey"
|
|
974
|
-
}],
|
|
914
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
975
915
|
url: "/v1/media/series/{id}",
|
|
976
916
|
...options,
|
|
977
917
|
headers: {
|
|
@@ -980,11 +920,7 @@ var updateSeries = (options) => (options.client ?? client).patch({
|
|
|
980
920
|
}
|
|
981
921
|
});
|
|
982
922
|
var addMediaToSeries = (options) => (options.client ?? client).post({
|
|
983
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
984
|
-
in: "cookie",
|
|
985
|
-
name: "nadeshiko.session_token",
|
|
986
|
-
type: "apiKey"
|
|
987
|
-
}],
|
|
923
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
988
924
|
url: "/v1/media/series/{id}/media",
|
|
989
925
|
...options,
|
|
990
926
|
headers: {
|
|
@@ -993,20 +929,12 @@ var addMediaToSeries = (options) => (options.client ?? client).post({
|
|
|
993
929
|
}
|
|
994
930
|
});
|
|
995
931
|
var removeMediaFromSeries = (options) => (options.client ?? client).delete({
|
|
996
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
997
|
-
in: "cookie",
|
|
998
|
-
name: "nadeshiko.session_token",
|
|
999
|
-
type: "apiKey"
|
|
1000
|
-
}],
|
|
932
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1001
933
|
url: "/v1/media/series/{id}/media/{mediaId}",
|
|
1002
934
|
...options
|
|
1003
935
|
});
|
|
1004
936
|
var updateSeriesMedia = (options) => (options.client ?? client).patch({
|
|
1005
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
1006
|
-
in: "cookie",
|
|
1007
|
-
name: "nadeshiko.session_token",
|
|
1008
|
-
type: "apiKey"
|
|
1009
|
-
}],
|
|
937
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1010
938
|
url: "/v1/media/series/{id}/media/{mediaId}",
|
|
1011
939
|
...options,
|
|
1012
940
|
headers: {
|
|
@@ -1015,47 +943,27 @@ var updateSeriesMedia = (options) => (options.client ?? client).patch({
|
|
|
1015
943
|
}
|
|
1016
944
|
});
|
|
1017
945
|
var getCharacter = (options) => (options.client ?? client).get({
|
|
1018
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
1019
|
-
in: "cookie",
|
|
1020
|
-
name: "nadeshiko.session_token",
|
|
1021
|
-
type: "apiKey"
|
|
1022
|
-
}],
|
|
946
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1023
947
|
url: "/v1/media/characters/{id}",
|
|
1024
948
|
...options
|
|
1025
949
|
});
|
|
1026
950
|
var getSeiyuu = (options) => (options.client ?? client).get({
|
|
1027
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
1028
|
-
in: "cookie",
|
|
1029
|
-
name: "nadeshiko.session_token",
|
|
1030
|
-
type: "apiKey"
|
|
1031
|
-
}],
|
|
951
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1032
952
|
url: "/v1/media/seiyuu/{id}",
|
|
1033
953
|
...options
|
|
1034
954
|
});
|
|
1035
955
|
var deleteMedia = (options) => (options.client ?? client).delete({
|
|
1036
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
1037
|
-
in: "cookie",
|
|
1038
|
-
name: "nadeshiko.session_token",
|
|
1039
|
-
type: "apiKey"
|
|
1040
|
-
}],
|
|
956
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1041
957
|
url: "/v1/media/{id}",
|
|
1042
958
|
...options
|
|
1043
959
|
});
|
|
1044
960
|
var getMedia = (options) => (options.client ?? client).get({
|
|
1045
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
1046
|
-
in: "cookie",
|
|
1047
|
-
name: "nadeshiko.session_token",
|
|
1048
|
-
type: "apiKey"
|
|
1049
|
-
}],
|
|
961
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1050
962
|
url: "/v1/media/{id}",
|
|
1051
963
|
...options
|
|
1052
964
|
});
|
|
1053
965
|
var updateMedia = (options) => (options.client ?? client).patch({
|
|
1054
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
1055
|
-
in: "cookie",
|
|
1056
|
-
name: "nadeshiko.session_token",
|
|
1057
|
-
type: "apiKey"
|
|
1058
|
-
}],
|
|
966
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1059
967
|
url: "/v1/media/{id}",
|
|
1060
968
|
...options,
|
|
1061
969
|
headers: {
|
|
@@ -1064,20 +972,12 @@ var updateMedia = (options) => (options.client ?? client).patch({
|
|
|
1064
972
|
}
|
|
1065
973
|
});
|
|
1066
974
|
var listEpisodes = (options) => (options.client ?? client).get({
|
|
1067
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
1068
|
-
in: "cookie",
|
|
1069
|
-
name: "nadeshiko.session_token",
|
|
1070
|
-
type: "apiKey"
|
|
1071
|
-
}],
|
|
975
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1072
976
|
url: "/v1/media/{mediaId}/episodes",
|
|
1073
977
|
...options
|
|
1074
978
|
});
|
|
1075
979
|
var createEpisode = (options) => (options.client ?? client).post({
|
|
1076
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
1077
|
-
in: "cookie",
|
|
1078
|
-
name: "nadeshiko.session_token",
|
|
1079
|
-
type: "apiKey"
|
|
1080
|
-
}],
|
|
980
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1081
981
|
url: "/v1/media/{mediaId}/episodes",
|
|
1082
982
|
...options,
|
|
1083
983
|
headers: {
|
|
@@ -1086,29 +986,17 @@ var createEpisode = (options) => (options.client ?? client).post({
|
|
|
1086
986
|
}
|
|
1087
987
|
});
|
|
1088
988
|
var deleteEpisode = (options) => (options.client ?? client).delete({
|
|
1089
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
1090
|
-
in: "cookie",
|
|
1091
|
-
name: "nadeshiko.session_token",
|
|
1092
|
-
type: "apiKey"
|
|
1093
|
-
}],
|
|
989
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1094
990
|
url: "/v1/media/{mediaId}/episodes/{episodeNumber}",
|
|
1095
991
|
...options
|
|
1096
992
|
});
|
|
1097
993
|
var getEpisode = (options) => (options.client ?? client).get({
|
|
1098
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
1099
|
-
in: "cookie",
|
|
1100
|
-
name: "nadeshiko.session_token",
|
|
1101
|
-
type: "apiKey"
|
|
1102
|
-
}],
|
|
994
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1103
995
|
url: "/v1/media/{mediaId}/episodes/{episodeNumber}",
|
|
1104
996
|
...options
|
|
1105
997
|
});
|
|
1106
998
|
var updateEpisode = (options) => (options.client ?? client).patch({
|
|
1107
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
1108
|
-
in: "cookie",
|
|
1109
|
-
name: "nadeshiko.session_token",
|
|
1110
|
-
type: "apiKey"
|
|
1111
|
-
}],
|
|
999
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1112
1000
|
url: "/v1/media/{mediaId}/episodes/{episodeNumber}",
|
|
1113
1001
|
...options,
|
|
1114
1002
|
headers: {
|
|
@@ -1117,20 +1005,12 @@ var updateEpisode = (options) => (options.client ?? client).patch({
|
|
|
1117
1005
|
}
|
|
1118
1006
|
});
|
|
1119
1007
|
var listSegments = (options) => (options.client ?? client).get({
|
|
1120
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
1121
|
-
in: "cookie",
|
|
1122
|
-
name: "nadeshiko.session_token",
|
|
1123
|
-
type: "apiKey"
|
|
1124
|
-
}],
|
|
1008
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1125
1009
|
url: "/v1/media/{mediaId}/episodes/{episodeNumber}/segments",
|
|
1126
1010
|
...options
|
|
1127
1011
|
});
|
|
1128
1012
|
var createSegment = (options) => (options.client ?? client).post({
|
|
1129
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
1130
|
-
in: "cookie",
|
|
1131
|
-
name: "nadeshiko.session_token",
|
|
1132
|
-
type: "apiKey"
|
|
1133
|
-
}],
|
|
1013
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1134
1014
|
url: "/v1/media/{mediaId}/episodes/{episodeNumber}/segments",
|
|
1135
1015
|
...options,
|
|
1136
1016
|
headers: {
|
|
@@ -1139,11 +1019,7 @@ var createSegment = (options) => (options.client ?? client).post({
|
|
|
1139
1019
|
}
|
|
1140
1020
|
});
|
|
1141
1021
|
var createSegmentsBatch = (options) => (options.client ?? client).post({
|
|
1142
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
1143
|
-
in: "cookie",
|
|
1144
|
-
name: "nadeshiko.session_token",
|
|
1145
|
-
type: "apiKey"
|
|
1146
|
-
}],
|
|
1022
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1147
1023
|
url: "/v1/media/{mediaId}/episodes/{episodeNumber}/segments/batch",
|
|
1148
1024
|
...options,
|
|
1149
1025
|
headers: {
|
|
@@ -1152,29 +1028,17 @@ var createSegmentsBatch = (options) => (options.client ?? client).post({
|
|
|
1152
1028
|
}
|
|
1153
1029
|
});
|
|
1154
1030
|
var deleteSegment = (options) => (options.client ?? client).delete({
|
|
1155
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
1156
|
-
in: "cookie",
|
|
1157
|
-
name: "nadeshiko.session_token",
|
|
1158
|
-
type: "apiKey"
|
|
1159
|
-
}],
|
|
1031
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1160
1032
|
url: "/v1/media/{mediaId}/episodes/{episodeNumber}/segments/{id}",
|
|
1161
1033
|
...options
|
|
1162
1034
|
});
|
|
1163
1035
|
var getSegment = (options) => (options.client ?? client).get({
|
|
1164
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
1165
|
-
in: "cookie",
|
|
1166
|
-
name: "nadeshiko.session_token",
|
|
1167
|
-
type: "apiKey"
|
|
1168
|
-
}],
|
|
1036
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1169
1037
|
url: "/v1/media/{mediaId}/episodes/{episodeNumber}/segments/{id}",
|
|
1170
1038
|
...options
|
|
1171
1039
|
});
|
|
1172
1040
|
var updateSegment = (options) => (options.client ?? client).patch({
|
|
1173
|
-
security: [{ scheme: "bearer", type: "http" },
|
|
1174
|
-
in: "cookie",
|
|
1175
|
-
name: "nadeshiko.session_token",
|
|
1176
|
-
type: "apiKey"
|
|
1177
|
-
}],
|
|
1041
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1178
1042
|
url: "/v1/media/{mediaId}/episodes/{episodeNumber}/segments/{id}",
|
|
1179
1043
|
...options,
|
|
1180
1044
|
headers: {
|
|
@@ -1618,6 +1482,98 @@ var updateAnnouncement = (options) => (options.client ?? client).put({
|
|
|
1618
1482
|
...options.headers
|
|
1619
1483
|
}
|
|
1620
1484
|
});
|
|
1485
|
+
// generated/dev/retry.ts
|
|
1486
|
+
var RETRYABLE_STATUS = new Set([408, 429, 500, 502, 503, 504]);
|
|
1487
|
+
function parseRetryAfter(value) {
|
|
1488
|
+
const seconds = Number(value);
|
|
1489
|
+
if (!Number.isNaN(seconds))
|
|
1490
|
+
return seconds * 1000;
|
|
1491
|
+
const date = new Date(value);
|
|
1492
|
+
if (!Number.isNaN(date.getTime()))
|
|
1493
|
+
return Math.max(0, date.getTime() - Date.now());
|
|
1494
|
+
return 1000;
|
|
1495
|
+
}
|
|
1496
|
+
function backoffDelay(attempt, initial, max) {
|
|
1497
|
+
const jitter = Math.random() * 100;
|
|
1498
|
+
return Math.min(initial * 2 ** attempt + jitter, max);
|
|
1499
|
+
}
|
|
1500
|
+
function sleep(ms) {
|
|
1501
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
1502
|
+
}
|
|
1503
|
+
function withRetry(fetchImpl = globalThis.fetch, options = {}) {
|
|
1504
|
+
const { maxRetries = 2, initialDelayMs = 500, maxDelayMs = 30000, timeout } = options;
|
|
1505
|
+
return async function retryingFetch(input, init) {
|
|
1506
|
+
let attempt = 0;
|
|
1507
|
+
while (true) {
|
|
1508
|
+
let timedInit = init;
|
|
1509
|
+
if (timeout !== undefined && !init?.signal) {
|
|
1510
|
+
const controller = new AbortController;
|
|
1511
|
+
const timeoutId = setTimeout(() => controller.abort(new Error(`Request timed out after ${timeout}ms`)), timeout);
|
|
1512
|
+
timedInit = { ...init, signal: controller.signal };
|
|
1513
|
+
let response2;
|
|
1514
|
+
try {
|
|
1515
|
+
response2 = await fetchImpl(input, timedInit);
|
|
1516
|
+
clearTimeout(timeoutId);
|
|
1517
|
+
} catch (networkError) {
|
|
1518
|
+
clearTimeout(timeoutId);
|
|
1519
|
+
if (attempt >= maxRetries)
|
|
1520
|
+
throw networkError;
|
|
1521
|
+
await sleep(backoffDelay(attempt, initialDelayMs, maxDelayMs));
|
|
1522
|
+
attempt++;
|
|
1523
|
+
continue;
|
|
1524
|
+
}
|
|
1525
|
+
if (!RETRYABLE_STATUS.has(response2.status) || attempt >= maxRetries) {
|
|
1526
|
+
return response2;
|
|
1527
|
+
}
|
|
1528
|
+
const retryAfter2 = response2.headers.get("Retry-After");
|
|
1529
|
+
const waitMs2 = retryAfter2 ? parseRetryAfter(retryAfter2) : backoffDelay(attempt, initialDelayMs, maxDelayMs);
|
|
1530
|
+
await sleep(waitMs2);
|
|
1531
|
+
attempt++;
|
|
1532
|
+
continue;
|
|
1533
|
+
}
|
|
1534
|
+
let response;
|
|
1535
|
+
try {
|
|
1536
|
+
response = await fetchImpl(input, timedInit);
|
|
1537
|
+
} catch (networkError) {
|
|
1538
|
+
if (attempt >= maxRetries)
|
|
1539
|
+
throw networkError;
|
|
1540
|
+
await sleep(backoffDelay(attempt, initialDelayMs, maxDelayMs));
|
|
1541
|
+
attempt++;
|
|
1542
|
+
continue;
|
|
1543
|
+
}
|
|
1544
|
+
if (!RETRYABLE_STATUS.has(response.status) || attempt >= maxRetries) {
|
|
1545
|
+
return response;
|
|
1546
|
+
}
|
|
1547
|
+
const retryAfter = response.headers.get("Retry-After");
|
|
1548
|
+
const waitMs = retryAfter ? parseRetryAfter(retryAfter) : backoffDelay(attempt, initialDelayMs, maxDelayMs);
|
|
1549
|
+
await sleep(waitMs);
|
|
1550
|
+
attempt++;
|
|
1551
|
+
}
|
|
1552
|
+
};
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
// generated/dev/errors.ts
|
|
1556
|
+
class NadeshikoError extends Error {
|
|
1557
|
+
code;
|
|
1558
|
+
title;
|
|
1559
|
+
detail;
|
|
1560
|
+
type;
|
|
1561
|
+
status;
|
|
1562
|
+
traceId;
|
|
1563
|
+
errors;
|
|
1564
|
+
constructor(body) {
|
|
1565
|
+
super(body.detail || body.title || `API error ${body.status}`);
|
|
1566
|
+
this.name = "NadeshikoError";
|
|
1567
|
+
this.code = body.code;
|
|
1568
|
+
this.title = body.title;
|
|
1569
|
+
this.detail = body.detail;
|
|
1570
|
+
this.type = body.type;
|
|
1571
|
+
this.status = body.status;
|
|
1572
|
+
this.traceId = body.instance;
|
|
1573
|
+
this.errors = body.errors;
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1621
1577
|
// generated/dev/nadeshiko.gen.ts
|
|
1622
1578
|
var environments = {
|
|
1623
1579
|
LOCAL: "http://localhost:5000/api",
|
|
@@ -1632,7 +1588,8 @@ var defaultSessionTokenGetter = () => {
|
|
|
1632
1588
|
return match ? decodeURIComponent(match[1]) : undefined;
|
|
1633
1589
|
};
|
|
1634
1590
|
function createNadeshikoClient(config) {
|
|
1635
|
-
const
|
|
1591
|
+
const rawBaseUrl = config.baseURL ?? config.baseUrl;
|
|
1592
|
+
const baseUrl = rawBaseUrl === undefined ? environments.PRODUCTION : (rawBaseUrl in environments) ? environments[rawBaseUrl] : rawBaseUrl;
|
|
1636
1593
|
const getApiKey = async () => {
|
|
1637
1594
|
if (typeof config.apiKey === "function") {
|
|
1638
1595
|
return await config.apiKey();
|
|
@@ -1642,6 +1599,7 @@ function createNadeshikoClient(config) {
|
|
|
1642
1599
|
const getSessionToken = config.sessionToken ?? defaultSessionTokenGetter;
|
|
1643
1600
|
const clientInstance = createClient(createConfig({
|
|
1644
1601
|
baseUrl,
|
|
1602
|
+
fetch: withRetry(globalThis.fetch, config.retryOptions),
|
|
1645
1603
|
auth: (auth) => {
|
|
1646
1604
|
if (auth.in === "cookie") {
|
|
1647
1605
|
return getSessionToken();
|
|
@@ -1649,87 +1607,93 @@ function createNadeshikoClient(config) {
|
|
|
1649
1607
|
return getApiKey();
|
|
1650
1608
|
}
|
|
1651
1609
|
}));
|
|
1610
|
+
clientInstance.interceptors.error.use((error) => {
|
|
1611
|
+
if (error && typeof error === "object" && "code" in error && typeof error.code === "string") {
|
|
1612
|
+
return new NadeshikoError(error);
|
|
1613
|
+
}
|
|
1614
|
+
return error;
|
|
1615
|
+
});
|
|
1652
1616
|
return {
|
|
1653
1617
|
client: clientInstance,
|
|
1654
|
-
search: (options) => search({ ...options, client: clientInstance }),
|
|
1655
|
-
getSearchStats: (options) => getSearchStats({ ...options, client: clientInstance }),
|
|
1656
|
-
searchWords: (options) => searchWords({ ...options, client: clientInstance }),
|
|
1657
|
-
listMedia: (options) => listMedia({ ...options, client: clientInstance }),
|
|
1658
|
-
getSegmentByUuid: (options) => getSegmentByUuid({ ...options, client: clientInstance }),
|
|
1659
|
-
getSegmentContext: (options) => getSegmentContext({ ...options, client: clientInstance }),
|
|
1660
|
-
listSeries: (options) => listSeries({ ...options, client: clientInstance }),
|
|
1661
|
-
getSeries: (options) => getSeries({ ...options, client: clientInstance }),
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
updateMedia: (options) => updateMedia({ ...options, client: clientInstance }),
|
|
1679
|
-
deleteMedia: (options) => deleteMedia({ ...options, client: clientInstance }),
|
|
1680
|
-
createEpisode: (options) => createEpisode({ ...options, client: clientInstance }),
|
|
1681
|
-
updateEpisode: (options) => updateEpisode({ ...options, client: clientInstance }),
|
|
1682
|
-
deleteEpisode: (options) => deleteEpisode({ ...options, client: clientInstance }),
|
|
1683
|
-
listSegments: (options) => listSegments({ ...options, client: clientInstance }),
|
|
1684
|
-
createSegment: (options) => createSegment({ ...options, client: clientInstance }),
|
|
1685
|
-
createSegmentsBatch: (options) => createSegmentsBatch({ ...options, client: clientInstance }),
|
|
1686
|
-
updateSegment: (options) => updateSegment({ ...options, client: clientInstance }),
|
|
1687
|
-
deleteSegment: (options) => deleteSegment({ ...options, client: clientInstance }),
|
|
1688
|
-
getUserQuota: (options) => getUserQuota({ ...options, client: clientInstance }),
|
|
1689
|
-
createUserReport: (options) => createUserReport({ ...options, client: clientInstance }),
|
|
1690
|
-
getUserPreferences: (options) => getUserPreferences({ ...options, client: clientInstance }),
|
|
1691
|
-
updateUserPreferences: (options) => updateUserPreferences({ ...options, client: clientInstance }),
|
|
1692
|
-
listUserActivity: (options) => listUserActivity({ ...options, client: clientInstance }),
|
|
1693
|
-
trackUserActivity: (options) => trackUserActivity({ ...options, client: clientInstance }),
|
|
1694
|
-
deleteUserActivity: (options) => deleteUserActivity({ ...options, client: clientInstance }),
|
|
1695
|
-
getUserActivityHeatmap: (options) => getUserActivityHeatmap({ ...options, client: clientInstance }),
|
|
1696
|
-
getUserActivityStats: (options) => getUserActivityStats({ ...options, client: clientInstance }),
|
|
1697
|
-
deleteUserActivityByDate: (options) => deleteUserActivityByDate({ ...options, client: clientInstance }),
|
|
1698
|
-
deleteUserActivityById: (options) => deleteUserActivityById({ ...options, client: clientInstance }),
|
|
1699
|
-
exportUserData: (options) => exportUserData({ ...options, client: clientInstance }),
|
|
1700
|
-
listUserLabs: (options) => listUserLabs({ ...options, client: clientInstance }),
|
|
1701
|
-
enrollUserLab: (options) => enrollUserLab({ ...options, client: clientInstance }),
|
|
1702
|
-
unenrollUserLab: (options) => unenrollUserLab({ ...options, client: clientInstance }),
|
|
1703
|
-
listCollections: (options) => listCollections({ ...options, client: clientInstance }),
|
|
1704
|
-
createCollection: (options) => createCollection({ ...options, client: clientInstance }),
|
|
1705
|
-
getCollection: (options) => getCollection({ ...options, client: clientInstance }),
|
|
1706
|
-
updateCollection: (options) => updateCollection({ ...options, client: clientInstance }),
|
|
1707
|
-
deleteCollection: (options) => deleteCollection({ ...options, client: clientInstance }),
|
|
1708
|
-
addSegmentToCollection: (options) => addSegmentToCollection({ ...options, client: clientInstance }),
|
|
1709
|
-
updateCollectionSegment: (options) => updateCollectionSegment({ ...options, client: clientInstance }),
|
|
1710
|
-
removeSegmentFromCollection: (options) => removeSegmentFromCollection({ ...options, client: clientInstance }),
|
|
1711
|
-
searchCollectionSegments: (options) => searchCollectionSegments({ ...options, client: clientInstance }),
|
|
1712
|
-
getCollectionStats: (options) => getCollectionStats({ ...options, client: clientInstance }),
|
|
1713
|
-
getAdminDashboard: (options) => getAdminDashboard({ ...options, client: clientInstance }),
|
|
1714
|
-
getAdminHealth: (options) => getAdminHealth({ ...options, client: clientInstance }),
|
|
1715
|
-
triggerReindex: (options) => triggerReindex({ ...options, client: clientInstance }),
|
|
1716
|
-
listAdminQueueStats: (options) => listAdminQueueStats({ ...options, client: clientInstance }),
|
|
1717
|
-
getAdminQueue: (options) => getAdminQueue({ ...options, client: clientInstance }),
|
|
1718
|
-
listAdminQueueFailed: (options) => listAdminQueueFailed({ ...options, client: clientInstance }),
|
|
1719
|
-
retryAdminQueueFailed: (options) => retryAdminQueueFailed({ ...options, client: clientInstance }),
|
|
1720
|
-
purgeAdminQueueFailed: (options) => purgeAdminQueueFailed({ ...options, client: clientInstance }),
|
|
1721
|
-
impersonateAdminUser: (options) => impersonateAdminUser({ ...options, client: clientInstance }),
|
|
1722
|
-
clearAdminImpersonation: (options) => clearAdminImpersonation({ ...options, client: clientInstance }),
|
|
1723
|
-
listAdminReports: (options) => listAdminReports({ ...options, client: clientInstance }),
|
|
1724
|
-
batchUpdateAdminReports: (options) => batchUpdateAdminReports({ ...options, client: clientInstance }),
|
|
1725
|
-
updateAdminReport: (options) => updateAdminReport({ ...options, client: clientInstance }),
|
|
1726
|
-
listAdminMediaAudits: (options) => listAdminMediaAudits({ ...options, client: clientInstance }),
|
|
1727
|
-
updateAdminMediaAudit: (options) => updateAdminMediaAudit({ ...options, client: clientInstance }),
|
|
1728
|
-
runAdminMediaAudit: (options) => runAdminMediaAudit({ ...options, client: clientInstance }),
|
|
1729
|
-
listAdminMediaAuditRuns: (options) => listAdminMediaAuditRuns({ ...options, client: clientInstance }),
|
|
1730
|
-
getAdminMediaAuditRun: (options) => getAdminMediaAuditRun({ ...options, client: clientInstance }),
|
|
1731
|
-
getAnnouncement: (options) => getAnnouncement({ ...options, client: clientInstance }),
|
|
1732
|
-
updateAnnouncement: (options) => updateAnnouncement({ ...options, client: clientInstance })
|
|
1618
|
+
search: (options) => search({ throwOnError: true, ...options, client: clientInstance }),
|
|
1619
|
+
getSearchStats: (options) => getSearchStats({ throwOnError: true, ...options, client: clientInstance }),
|
|
1620
|
+
searchWords: (options) => searchWords({ throwOnError: true, ...options, client: clientInstance }),
|
|
1621
|
+
listMedia: (options) => listMedia({ throwOnError: true, ...options, client: clientInstance }),
|
|
1622
|
+
getSegmentByUuid: (options) => getSegmentByUuid({ throwOnError: true, ...options, client: clientInstance }),
|
|
1623
|
+
getSegmentContext: (options) => getSegmentContext({ throwOnError: true, ...options, client: clientInstance }),
|
|
1624
|
+
listSeries: (options) => listSeries({ throwOnError: true, ...options, client: clientInstance }),
|
|
1625
|
+
getSeries: (options) => getSeries({ throwOnError: true, ...options, client: clientInstance }),
|
|
1626
|
+
getMedia: (options) => getMedia({ throwOnError: true, ...options, client: clientInstance }),
|
|
1627
|
+
listEpisodes: (options) => listEpisodes({ throwOnError: true, ...options, client: clientInstance }),
|
|
1628
|
+
getEpisode: (options) => getEpisode({ throwOnError: true, ...options, client: clientInstance }),
|
|
1629
|
+
getSegment: (options) => getSegment({ throwOnError: true, ...options, client: clientInstance }),
|
|
1630
|
+
createMedia: (options) => createMedia({ throwOnError: true, ...options, client: clientInstance }),
|
|
1631
|
+
autocompleteMedia: (options) => autocompleteMedia({ throwOnError: true, ...options, client: clientInstance }),
|
|
1632
|
+
updateSegmentByUuid: (options) => updateSegmentByUuid({ throwOnError: true, ...options, client: clientInstance }),
|
|
1633
|
+
listSegmentRevisions: (options) => listSegmentRevisions({ throwOnError: true, ...options, client: clientInstance }),
|
|
1634
|
+
createSeries: (options) => createSeries({ throwOnError: true, ...options, client: clientInstance }),
|
|
1635
|
+
updateSeries: (options) => updateSeries({ throwOnError: true, ...options, client: clientInstance }),
|
|
1636
|
+
deleteSeries: (options) => deleteSeries({ throwOnError: true, ...options, client: clientInstance }),
|
|
1637
|
+
addMediaToSeries: (options) => addMediaToSeries({ throwOnError: true, ...options, client: clientInstance }),
|
|
1638
|
+
updateSeriesMedia: (options) => updateSeriesMedia({ throwOnError: true, ...options, client: clientInstance }),
|
|
1639
|
+
removeMediaFromSeries: (options) => removeMediaFromSeries({ throwOnError: true, ...options, client: clientInstance }),
|
|
1640
|
+
getCharacter: (options) => getCharacter({ throwOnError: true, ...options, client: clientInstance }),
|
|
1641
|
+
getSeiyuu: (options) => getSeiyuu({ throwOnError: true, ...options, client: clientInstance }),
|
|
1642
|
+
updateMedia: (options) => updateMedia({ throwOnError: true, ...options, client: clientInstance }),
|
|
1643
|
+
deleteMedia: (options) => deleteMedia({ throwOnError: true, ...options, client: clientInstance }),
|
|
1644
|
+
createEpisode: (options) => createEpisode({ throwOnError: true, ...options, client: clientInstance }),
|
|
1645
|
+
updateEpisode: (options) => updateEpisode({ throwOnError: true, ...options, client: clientInstance }),
|
|
1646
|
+
deleteEpisode: (options) => deleteEpisode({ throwOnError: true, ...options, client: clientInstance }),
|
|
1647
|
+
listSegments: (options) => listSegments({ throwOnError: true, ...options, client: clientInstance }),
|
|
1648
|
+
createSegment: (options) => createSegment({ throwOnError: true, ...options, client: clientInstance }),
|
|
1649
|
+
createSegmentsBatch: (options) => createSegmentsBatch({ throwOnError: true, ...options, client: clientInstance }),
|
|
1650
|
+
updateSegment: (options) => updateSegment({ throwOnError: true, ...options, client: clientInstance }),
|
|
1651
|
+
deleteSegment: (options) => deleteSegment({ throwOnError: true, ...options, client: clientInstance }),
|
|
1652
|
+
getUserQuota: (options) => getUserQuota({ throwOnError: true, ...options, client: clientInstance }),
|
|
1653
|
+
createUserReport: (options) => createUserReport({ throwOnError: true, ...options, client: clientInstance }),
|
|
1654
|
+
getUserPreferences: (options) => getUserPreferences({ throwOnError: true, ...options, client: clientInstance }),
|
|
1655
|
+
updateUserPreferences: (options) => updateUserPreferences({ throwOnError: true, ...options, client: clientInstance }),
|
|
1656
|
+
listUserActivity: (options) => listUserActivity({ throwOnError: true, ...options, client: clientInstance }),
|
|
1657
|
+
trackUserActivity: (options) => trackUserActivity({ throwOnError: true, ...options, client: clientInstance }),
|
|
1658
|
+
deleteUserActivity: (options) => deleteUserActivity({ throwOnError: true, ...options, client: clientInstance }),
|
|
1659
|
+
getUserActivityHeatmap: (options) => getUserActivityHeatmap({ throwOnError: true, ...options, client: clientInstance }),
|
|
1660
|
+
getUserActivityStats: (options) => getUserActivityStats({ throwOnError: true, ...options, client: clientInstance }),
|
|
1661
|
+
deleteUserActivityByDate: (options) => deleteUserActivityByDate({ throwOnError: true, ...options, client: clientInstance }),
|
|
1662
|
+
deleteUserActivityById: (options) => deleteUserActivityById({ throwOnError: true, ...options, client: clientInstance }),
|
|
1663
|
+
exportUserData: (options) => exportUserData({ throwOnError: true, ...options, client: clientInstance }),
|
|
1664
|
+
listUserLabs: (options) => listUserLabs({ throwOnError: true, ...options, client: clientInstance }),
|
|
1665
|
+
enrollUserLab: (options) => enrollUserLab({ throwOnError: true, ...options, client: clientInstance }),
|
|
1666
|
+
unenrollUserLab: (options) => unenrollUserLab({ throwOnError: true, ...options, client: clientInstance }),
|
|
1667
|
+
listCollections: (options) => listCollections({ throwOnError: true, ...options, client: clientInstance }),
|
|
1668
|
+
createCollection: (options) => createCollection({ throwOnError: true, ...options, client: clientInstance }),
|
|
1669
|
+
getCollection: (options) => getCollection({ throwOnError: true, ...options, client: clientInstance }),
|
|
1670
|
+
updateCollection: (options) => updateCollection({ throwOnError: true, ...options, client: clientInstance }),
|
|
1671
|
+
deleteCollection: (options) => deleteCollection({ throwOnError: true, ...options, client: clientInstance }),
|
|
1672
|
+
addSegmentToCollection: (options) => addSegmentToCollection({ throwOnError: true, ...options, client: clientInstance }),
|
|
1673
|
+
updateCollectionSegment: (options) => updateCollectionSegment({ throwOnError: true, ...options, client: clientInstance }),
|
|
1674
|
+
removeSegmentFromCollection: (options) => removeSegmentFromCollection({ throwOnError: true, ...options, client: clientInstance }),
|
|
1675
|
+
searchCollectionSegments: (options) => searchCollectionSegments({ throwOnError: true, ...options, client: clientInstance }),
|
|
1676
|
+
getCollectionStats: (options) => getCollectionStats({ throwOnError: true, ...options, client: clientInstance }),
|
|
1677
|
+
getAdminDashboard: (options) => getAdminDashboard({ throwOnError: true, ...options, client: clientInstance }),
|
|
1678
|
+
getAdminHealth: (options) => getAdminHealth({ throwOnError: true, ...options, client: clientInstance }),
|
|
1679
|
+
triggerReindex: (options) => triggerReindex({ throwOnError: true, ...options, client: clientInstance }),
|
|
1680
|
+
listAdminQueueStats: (options) => listAdminQueueStats({ throwOnError: true, ...options, client: clientInstance }),
|
|
1681
|
+
getAdminQueue: (options) => getAdminQueue({ throwOnError: true, ...options, client: clientInstance }),
|
|
1682
|
+
listAdminQueueFailed: (options) => listAdminQueueFailed({ throwOnError: true, ...options, client: clientInstance }),
|
|
1683
|
+
retryAdminQueueFailed: (options) => retryAdminQueueFailed({ throwOnError: true, ...options, client: clientInstance }),
|
|
1684
|
+
purgeAdminQueueFailed: (options) => purgeAdminQueueFailed({ throwOnError: true, ...options, client: clientInstance }),
|
|
1685
|
+
impersonateAdminUser: (options) => impersonateAdminUser({ throwOnError: true, ...options, client: clientInstance }),
|
|
1686
|
+
clearAdminImpersonation: (options) => clearAdminImpersonation({ throwOnError: true, ...options, client: clientInstance }),
|
|
1687
|
+
listAdminReports: (options) => listAdminReports({ throwOnError: true, ...options, client: clientInstance }),
|
|
1688
|
+
batchUpdateAdminReports: (options) => batchUpdateAdminReports({ throwOnError: true, ...options, client: clientInstance }),
|
|
1689
|
+
updateAdminReport: (options) => updateAdminReport({ throwOnError: true, ...options, client: clientInstance }),
|
|
1690
|
+
listAdminMediaAudits: (options) => listAdminMediaAudits({ throwOnError: true, ...options, client: clientInstance }),
|
|
1691
|
+
updateAdminMediaAudit: (options) => updateAdminMediaAudit({ throwOnError: true, ...options, client: clientInstance }),
|
|
1692
|
+
runAdminMediaAudit: (options) => runAdminMediaAudit({ throwOnError: true, ...options, client: clientInstance }),
|
|
1693
|
+
listAdminMediaAuditRuns: (options) => listAdminMediaAuditRuns({ throwOnError: true, ...options, client: clientInstance }),
|
|
1694
|
+
getAdminMediaAuditRun: (options) => getAdminMediaAuditRun({ throwOnError: true, ...options, client: clientInstance }),
|
|
1695
|
+
getAnnouncement: (options) => getAnnouncement({ throwOnError: true, ...options, client: clientInstance }),
|
|
1696
|
+
updateAnnouncement: (options) => updateAnnouncement({ throwOnError: true, ...options, client: clientInstance })
|
|
1733
1697
|
};
|
|
1734
1698
|
}
|
|
1735
1699
|
// generated/dev/internal/media.gen.ts
|
|
@@ -1744,6 +1708,8 @@ __export(exports_media_gen, {
|
|
|
1744
1708
|
removeMediaFromSeries: () => removeMediaFromSeries,
|
|
1745
1709
|
listSegments: () => listSegments,
|
|
1746
1710
|
listSegmentRevisions: () => listSegmentRevisions,
|
|
1711
|
+
getSeiyuu: () => getSeiyuu,
|
|
1712
|
+
getCharacter: () => getCharacter,
|
|
1747
1713
|
deleteSeries: () => deleteSeries,
|
|
1748
1714
|
deleteSegment: () => deleteSegment,
|
|
1749
1715
|
deleteMedia: () => deleteMedia,
|
|
@@ -1813,7 +1779,37 @@ __export(exports_admin_gen, {
|
|
|
1813
1779
|
clearAdminImpersonation: () => clearAdminImpersonation,
|
|
1814
1780
|
batchUpdateAdminReports: () => batchUpdateAdminReports
|
|
1815
1781
|
});
|
|
1782
|
+
// generated/dev/paginate.ts
|
|
1783
|
+
async function* paginate(fn, options, extract) {
|
|
1784
|
+
let cursor = null;
|
|
1785
|
+
let first = true;
|
|
1786
|
+
while (true) {
|
|
1787
|
+
const callOptions = first ? options : patchCursor(options, cursor);
|
|
1788
|
+
first = false;
|
|
1789
|
+
const result = await fn(callOptions);
|
|
1790
|
+
if ("error" in result && result.error !== undefined) {
|
|
1791
|
+
throw result.error;
|
|
1792
|
+
}
|
|
1793
|
+
const { items, pagination } = extract(result.data);
|
|
1794
|
+
for (const item of items) {
|
|
1795
|
+
yield item;
|
|
1796
|
+
}
|
|
1797
|
+
if (!pagination.hasMore || pagination.cursor === null)
|
|
1798
|
+
break;
|
|
1799
|
+
cursor = pagination.cursor;
|
|
1800
|
+
}
|
|
1801
|
+
}
|
|
1802
|
+
function patchCursor(options, cursor) {
|
|
1803
|
+
if (options.body !== undefined) {
|
|
1804
|
+
return { ...options, body: { ...options.body, cursor } };
|
|
1805
|
+
}
|
|
1806
|
+
if (options.query !== undefined) {
|
|
1807
|
+
return { ...options, query: { ...options.query, cursor } };
|
|
1808
|
+
}
|
|
1809
|
+
return { ...options, body: { cursor } };
|
|
1810
|
+
}
|
|
1816
1811
|
export {
|
|
1812
|
+
withRetry,
|
|
1817
1813
|
exports_user_gen as user,
|
|
1818
1814
|
updateUserPreferences,
|
|
1819
1815
|
updateSeriesMedia,
|
|
@@ -1838,6 +1834,7 @@ export {
|
|
|
1838
1834
|
removeSegmentFromCollection,
|
|
1839
1835
|
removeMediaFromSeries,
|
|
1840
1836
|
purgeAdminQueueFailed,
|
|
1837
|
+
paginate,
|
|
1841
1838
|
exports_media_gen as media,
|
|
1842
1839
|
listUserLabs,
|
|
1843
1840
|
listUserActivity,
|
|
@@ -1898,8 +1895,9 @@ export {
|
|
|
1898
1895
|
autocompleteMedia,
|
|
1899
1896
|
exports_admin_gen as admin,
|
|
1900
1897
|
addSegmentToCollection,
|
|
1901
|
-
addMediaToSeries
|
|
1898
|
+
addMediaToSeries,
|
|
1899
|
+
NadeshikoError
|
|
1902
1900
|
};
|
|
1903
1901
|
|
|
1904
|
-
//# debugId=
|
|
1902
|
+
//# debugId=C04B33B3D5D6E85964756E2164756E21
|
|
1905
1903
|
//# sourceMappingURL=index.js.map
|