@brigadasos/nadeshiko-sdk 2.0.7 → 2.1.0-internal

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.
Files changed (44) hide show
  1. package/README.md +101 -103
  2. package/dist/client/client.gen.d.ts.map +1 -1
  3. package/dist/client/index.d.ts.map +1 -1
  4. package/dist/client/types.gen.d.ts.map +1 -1
  5. package/dist/client/utils.gen.d.ts.map +1 -1
  6. package/dist/client.gen.d.ts.map +1 -1
  7. package/dist/core/auth.gen.d.ts.map +1 -1
  8. package/dist/core/bodySerializer.gen.d.ts.map +1 -1
  9. package/dist/core/params.gen.d.ts.map +1 -1
  10. package/dist/core/pathSerializer.gen.d.ts.map +1 -1
  11. package/dist/core/queryKeySerializer.gen.d.ts.map +1 -1
  12. package/dist/core/serverSentEvents.gen.d.ts.map +1 -1
  13. package/dist/core/types.gen.d.ts.map +1 -1
  14. package/dist/core/utils.gen.d.ts.map +1 -1
  15. package/dist/errors.d.ts +1 -1
  16. package/dist/errors.d.ts.map +1 -1
  17. package/dist/index.cjs +1204 -105
  18. package/dist/index.cjs.map +8 -8
  19. package/dist/index.d.ts +4 -4
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +1215 -101
  22. package/dist/index.js.map +8 -8
  23. package/dist/internal/admin.gen.d.ts +2 -0
  24. package/dist/internal/admin.gen.d.ts.map +1 -0
  25. package/dist/internal/collections.gen.d.ts +2 -0
  26. package/dist/internal/collections.gen.d.ts.map +1 -0
  27. package/dist/internal/media.gen.d.ts +2 -0
  28. package/dist/internal/media.gen.d.ts.map +1 -0
  29. package/dist/internal/stats.gen.d.ts +2 -0
  30. package/dist/internal/stats.gen.d.ts.map +1 -0
  31. package/dist/internal/user.gen.d.ts +2 -0
  32. package/dist/internal/user.gen.d.ts.map +1 -0
  33. package/dist/internal.gen.d.ts +6 -0
  34. package/dist/internal.gen.d.ts.map +1 -0
  35. package/dist/nadeshiko.gen.d.ts +775 -77
  36. package/dist/nadeshiko.gen.d.ts.map +1 -1
  37. package/dist/paginate.d.ts +15 -0
  38. package/dist/paginate.d.ts.map +1 -1
  39. package/dist/retry.d.ts.map +1 -1
  40. package/dist/sdk.gen.d.ts +84 -242
  41. package/dist/sdk.gen.d.ts.map +1 -1
  42. package/dist/types.gen.d.ts +1497 -2817
  43. package/dist/types.gen.d.ts.map +1 -1
  44. package/package.json +4 -3
package/dist/index.cjs CHANGED
@@ -36,36 +36,93 @@ var __export = (target, all) => {
36
36
  });
37
37
  };
38
38
 
39
- // generated/public/index.ts
40
- var exports_public = {};
41
- __export(exports_public, {
39
+ // generated/internal/index.ts
40
+ var exports_internal = {};
41
+ __export(exports_internal, {
42
42
  withRetry: () => withRetry,
43
+ user: () => exports_user_gen,
44
+ updateUserPreferences: () => updateUserPreferences,
45
+ updateSegment: () => updateSegment,
46
+ updateMedia: () => updateMedia,
47
+ updateEpisode: () => updateEpisode,
48
+ updateCollectionSegment: () => updateCollectionSegment,
49
+ updateCollection: () => updateCollection,
50
+ updateAnnouncement: () => updateAnnouncement,
51
+ updateAdminReport: () => updateAdminReport,
52
+ updateAdminMediaAudit: () => updateAdminMediaAudit,
53
+ unenrollUserLab: () => unenrollUserLab,
54
+ triggerCoveredWordsUpdate: () => triggerCoveredWordsUpdate,
55
+ trackUserActivity: () => trackUserActivity,
56
+ stats: () => exports_stats_gen,
43
57
  searchWords: () => searchWords,
58
+ searchMedia: () => searchMedia,
59
+ searchCollectionSegments: () => searchCollectionSegments,
44
60
  search: () => search,
61
+ runAdminMediaAudit: () => runAdminMediaAudit,
62
+ removeSegmentFromCollection: () => removeSegmentFromCollection,
63
+ removeExcludedMedia: () => removeExcludedMedia,
45
64
  paginate: () => paginate,
46
- listSeries: () => listSeries,
65
+ media: () => exports_media_gen,
66
+ listUserLabs: () => listUserLabs,
67
+ listUserActivity: () => listUserActivity,
68
+ listSegments: () => listSegments,
69
+ listSegmentRevisions: () => listSegmentRevisions,
47
70
  listMedia: () => listMedia,
71
+ listExcludedMedia: () => listExcludedMedia,
48
72
  listEpisodes: () => listEpisodes,
73
+ listCollections: () => listCollections,
74
+ listAdminReports: () => listAdminReports,
75
+ listAdminMediaAudits: () => listAdminMediaAudits,
76
+ listAdminMediaAuditRuns: () => listAdminMediaAuditRuns,
77
+ getUserPreferences: () => getUserPreferences,
78
+ getUserActivityStats: () => getUserActivityStats,
79
+ getUserActivityHeatmap: () => getUserActivityHeatmap,
49
80
  getStatsOverview: () => getStatsOverview,
50
- getSeries: () => getSeries,
51
81
  getSegmentContext: () => getSegmentContext,
52
- getSegmentByUuid: () => getSegmentByUuid,
53
82
  getSegment: () => getSegment,
54
83
  getSearchStats: () => getSearchStats,
55
84
  getMedia: () => getMedia,
85
+ getMe: () => getMe,
56
86
  getEpisode: () => getEpisode,
57
87
  getCoveredWords: () => getCoveredWords,
88
+ getCollectionStats: () => getCollectionStats,
89
+ getCollection: () => getCollection,
90
+ getAnnouncement: () => getAnnouncement,
91
+ getAdminMediaAuditRun: () => getAdminMediaAuditRun,
92
+ flatPaginate: () => flatPaginate,
93
+ exportUserData: () => exportUserData,
94
+ enrollUserLab: () => enrollUserLab,
95
+ deleteUserActivityById: () => deleteUserActivityById,
96
+ deleteUserActivityByDate: () => deleteUserActivityByDate,
97
+ deleteUserActivity: () => deleteUserActivity,
98
+ deleteMedia: () => deleteMedia,
99
+ deleteEpisode: () => deleteEpisode,
100
+ deleteCollection: () => deleteCollection,
101
+ deleteAdminReport: () => deleteAdminReport,
102
+ createUserReport: () => createUserReport,
103
+ createSegmentsBatch: () => createSegmentsBatch,
104
+ createSegment: () => createSegment,
58
105
  createNadeshikoClient: () => createNadeshikoClient,
106
+ createMedia: () => createMedia,
107
+ createEpisode: () => createEpisode,
108
+ createCollection: () => createCollection,
109
+ collections: () => exports_collections_gen,
59
110
  client: () => client,
111
+ bulkUpdateAdminReports: () => bulkUpdateAdminReports,
112
+ bulkDeleteAdminReports: () => bulkDeleteAdminReports,
113
+ batchUpdateAdminReports: () => batchUpdateAdminReports,
114
+ admin: () => exports_admin_gen,
115
+ addSegmentToCollection: () => addSegmentToCollection,
116
+ addExcludedMedia: () => addExcludedMedia,
60
117
  NadeshikoError: () => NadeshikoError
61
118
  });
62
- module.exports = __toCommonJS(exports_public);
119
+ module.exports = __toCommonJS(exports_internal);
63
120
 
64
- // generated/public/core/bodySerializer.gen.ts
121
+ // generated/internal/core/bodySerializer.gen.ts
65
122
  var jsonBodySerializer = {
66
123
  bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value)
67
124
  };
68
- // generated/public/core/params.gen.ts
125
+ // generated/internal/core/params.gen.ts
69
126
  var extraPrefixesMap = {
70
127
  $body_: "body",
71
128
  $headers_: "headers",
@@ -73,7 +130,7 @@ var extraPrefixesMap = {
73
130
  $query_: "query"
74
131
  };
75
132
  var extraPrefixes = Object.entries(extraPrefixesMap);
76
- // generated/public/core/serverSentEvents.gen.ts
133
+ // generated/internal/core/serverSentEvents.gen.ts
77
134
  var createSseClient = ({
78
135
  onRequest,
79
136
  onSseError,
@@ -209,7 +266,7 @@ var createSseClient = ({
209
266
  return { stream };
210
267
  };
211
268
 
212
- // generated/public/core/pathSerializer.gen.ts
269
+ // generated/internal/core/pathSerializer.gen.ts
213
270
  var separatorArrayExplode = (style) => {
214
271
  switch (style) {
215
272
  case "label":
@@ -333,7 +390,7 @@ var serializeObjectParam = ({
333
390
  return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
334
391
  };
335
392
 
336
- // generated/public/core/utils.gen.ts
393
+ // generated/internal/core/utils.gen.ts
337
394
  var PATH_PARAM_RE = /\{[^{}]+\}/g;
338
395
  var defaultPathSerializer = ({ path, url: _url }) => {
339
396
  let url = _url;
@@ -422,7 +479,7 @@ function getValidRequestBody(options) {
422
479
  return;
423
480
  }
424
481
 
425
- // generated/public/core/auth.gen.ts
482
+ // generated/internal/core/auth.gen.ts
426
483
  var getAuthToken = async (auth, callback) => {
427
484
  const token = typeof callback === "function" ? await callback(auth) : callback;
428
485
  if (!token) {
@@ -437,7 +494,7 @@ var getAuthToken = async (auth, callback) => {
437
494
  return token;
438
495
  };
439
496
 
440
- // generated/public/client/utils.gen.ts
497
+ // generated/internal/client/utils.gen.ts
441
498
  var createQuerySerializer = ({
442
499
  parameters = {},
443
500
  ...args
@@ -654,7 +711,7 @@ var createConfig = (override = {}) => ({
654
711
  ...override
655
712
  });
656
713
 
657
- // generated/public/client/client.gen.ts
714
+ // generated/internal/client/client.gen.ts
658
715
  var createClient = (config = {}) => {
659
716
  let _config = mergeConfigs(createConfig(), config);
660
717
  const getConfig = () => ({ ..._config });
@@ -860,26 +917,26 @@ var createClient = (config = {}) => {
860
917
  trace: makeMethodFn("TRACE")
861
918
  };
862
919
  };
863
- // generated/public/client.gen.ts
920
+ // generated/internal/client.gen.ts
864
921
  var client = createClient(createConfig({ baseUrl: "https://api.nadeshiko.co" }));
865
922
 
866
- // generated/public/sdk.gen.ts
867
- var search = (options) => (options?.client ?? client).post({
923
+ // generated/internal/sdk.gen.ts
924
+ var search = (options) => (options.client ?? client).post({
868
925
  security: [{ scheme: "bearer", type: "http" }],
869
926
  url: "/v1/search",
870
927
  ...options,
871
928
  headers: {
872
929
  "Content-Type": "application/json",
873
- ...options?.headers
930
+ ...options.headers
874
931
  }
875
932
  });
876
- var getSearchStats = (options) => (options?.client ?? client).post({
933
+ var getSearchStats = (options) => (options.client ?? client).post({
877
934
  security: [{ scheme: "bearer", type: "http" }],
878
935
  url: "/v1/search/stats",
879
936
  ...options,
880
937
  headers: {
881
938
  "Content-Type": "application/json",
882
- ...options?.headers
939
+ ...options.headers
883
940
  }
884
941
  });
885
942
  var searchWords = (options) => (options.client ?? client).post({
@@ -891,6 +948,15 @@ var searchWords = (options) => (options.client ?? client).post({
891
948
  ...options.headers
892
949
  }
893
950
  });
951
+ var searchMedia = (options) => (options.client ?? client).post({
952
+ security: [{ scheme: "bearer", type: "http" }],
953
+ url: "/v1/search/media",
954
+ ...options,
955
+ headers: {
956
+ "Content-Type": "application/json",
957
+ ...options.headers
958
+ }
959
+ });
894
960
  var getStatsOverview = (options) => (options?.client ?? client).get({
895
961
  security: [{ scheme: "bearer", type: "http" }],
896
962
  url: "/v1/stats/overview",
@@ -901,52 +967,498 @@ var getCoveredWords = (options) => (options.client ?? client).get({
901
967
  url: "/v1/stats/covered-words",
902
968
  ...options
903
969
  });
970
+ var triggerCoveredWordsUpdate = (options) => (options?.client ?? client).post({
971
+ security: [{
972
+ in: "cookie",
973
+ name: "nadeshiko.session_token",
974
+ type: "apiKey"
975
+ }],
976
+ url: "/v1/stats/covered-words/update",
977
+ ...options,
978
+ headers: {
979
+ "Content-Type": "application/json",
980
+ ...options?.headers
981
+ }
982
+ });
904
983
  var listMedia = (options) => (options?.client ?? client).get({
905
984
  security: [{ scheme: "bearer", type: "http" }],
906
985
  url: "/v1/media",
907
986
  ...options
908
987
  });
909
- var getSegmentByUuid = (options) => (options.client ?? client).get({
988
+ var createMedia = (options) => (options.client ?? client).post({
989
+ security: [{ scheme: "bearer", type: "http" }],
990
+ url: "/v1/media",
991
+ ...options,
992
+ headers: {
993
+ "Content-Type": "application/json",
994
+ ...options.headers
995
+ }
996
+ });
997
+ var getSegment = (options) => (options.client ?? client).get({
910
998
  security: [{ scheme: "bearer", type: "http" }],
911
- url: "/v1/media/segments/{uuid}",
999
+ url: "/v1/media/segments/{segmentPublicId}",
912
1000
  ...options
913
1001
  });
1002
+ var updateSegment = (options) => (options.client ?? client).patch({
1003
+ security: [{ scheme: "bearer", type: "http" }],
1004
+ url: "/v1/media/segments/{segmentPublicId}",
1005
+ ...options,
1006
+ headers: {
1007
+ "Content-Type": "application/json",
1008
+ ...options.headers
1009
+ }
1010
+ });
914
1011
  var getSegmentContext = (options) => (options.client ?? client).get({
915
1012
  security: [{ scheme: "bearer", type: "http" }],
916
- url: "/v1/media/segments/{uuid}/context",
1013
+ url: "/v1/media/segments/{segmentPublicId}/context",
917
1014
  ...options
918
1015
  });
919
- var listSeries = (options) => (options?.client ?? client).get({
1016
+ var listSegmentRevisions = (options) => (options.client ?? client).get({
920
1017
  security: [{ scheme: "bearer", type: "http" }],
921
- url: "/v1/media/series",
1018
+ url: "/v1/media/segments/{segmentPublicId}/revisions",
922
1019
  ...options
923
1020
  });
924
- var getSeries = (options) => (options.client ?? client).get({
1021
+ var deleteMedia = (options) => (options.client ?? client).delete({
925
1022
  security: [{ scheme: "bearer", type: "http" }],
926
- url: "/v1/media/series/{id}",
1023
+ url: "/v1/media/{mediaPublicId}",
927
1024
  ...options
928
1025
  });
929
1026
  var getMedia = (options) => (options.client ?? client).get({
930
1027
  security: [{ scheme: "bearer", type: "http" }],
931
- url: "/v1/media/{id}",
1028
+ url: "/v1/media/{mediaPublicId}",
932
1029
  ...options
933
1030
  });
1031
+ var updateMedia = (options) => (options.client ?? client).patch({
1032
+ security: [{ scheme: "bearer", type: "http" }],
1033
+ url: "/v1/media/{mediaPublicId}",
1034
+ ...options,
1035
+ headers: {
1036
+ "Content-Type": "application/json",
1037
+ ...options.headers
1038
+ }
1039
+ });
934
1040
  var listEpisodes = (options) => (options.client ?? client).get({
935
1041
  security: [{ scheme: "bearer", type: "http" }],
936
- url: "/v1/media/{mediaId}/episodes",
1042
+ url: "/v1/media/{mediaPublicId}/episodes",
1043
+ ...options
1044
+ });
1045
+ var createEpisode = (options) => (options.client ?? client).post({
1046
+ security: [{ scheme: "bearer", type: "http" }],
1047
+ url: "/v1/media/{mediaPublicId}/episodes",
1048
+ ...options,
1049
+ headers: {
1050
+ "Content-Type": "application/json",
1051
+ ...options.headers
1052
+ }
1053
+ });
1054
+ var deleteEpisode = (options) => (options.client ?? client).delete({
1055
+ security: [{ scheme: "bearer", type: "http" }],
1056
+ url: "/v1/media/{mediaPublicId}/episodes/{episodeNumber}",
937
1057
  ...options
938
1058
  });
939
1059
  var getEpisode = (options) => (options.client ?? client).get({
940
1060
  security: [{ scheme: "bearer", type: "http" }],
941
- url: "/v1/media/{mediaId}/episodes/{episodeNumber}",
1061
+ url: "/v1/media/{mediaPublicId}/episodes/{episodeNumber}",
942
1062
  ...options
943
1063
  });
944
- var getSegment = (options) => (options.client ?? client).get({
1064
+ var updateEpisode = (options) => (options.client ?? client).patch({
1065
+ security: [{ scheme: "bearer", type: "http" }],
1066
+ url: "/v1/media/{mediaPublicId}/episodes/{episodeNumber}",
1067
+ ...options,
1068
+ headers: {
1069
+ "Content-Type": "application/json",
1070
+ ...options.headers
1071
+ }
1072
+ });
1073
+ var listSegments = (options) => (options.client ?? client).get({
1074
+ security: [{ scheme: "bearer", type: "http" }],
1075
+ url: "/v1/media/{mediaPublicId}/episodes/{episodeNumber}/segments",
1076
+ ...options
1077
+ });
1078
+ var createSegment = (options) => (options.client ?? client).post({
1079
+ security: [{ scheme: "bearer", type: "http" }],
1080
+ url: "/v1/media/{mediaPublicId}/episodes/{episodeNumber}/segments",
1081
+ ...options,
1082
+ headers: {
1083
+ "Content-Type": "application/json",
1084
+ ...options.headers
1085
+ }
1086
+ });
1087
+ var createSegmentsBatch = (options) => (options.client ?? client).post({
1088
+ security: [{ scheme: "bearer", type: "http" }],
1089
+ url: "/v1/media/{mediaPublicId}/episodes/{episodeNumber}/segments/batch",
1090
+ ...options,
1091
+ headers: {
1092
+ "Content-Type": "application/json",
1093
+ ...options.headers
1094
+ }
1095
+ });
1096
+ var getMe = (options) => (options?.client ?? client).get({
1097
+ security: [{ scheme: "bearer", type: "http" }],
1098
+ url: "/v1/user/me",
1099
+ ...options
1100
+ });
1101
+ var listExcludedMedia = (options) => (options?.client ?? client).get({
1102
+ security: [{ scheme: "bearer", type: "http" }],
1103
+ url: "/v1/user/excluded-media",
1104
+ ...options
1105
+ });
1106
+ var addExcludedMedia = (options) => (options.client ?? client).post({
1107
+ security: [{ scheme: "bearer", type: "http" }],
1108
+ url: "/v1/user/excluded-media",
1109
+ ...options,
1110
+ headers: {
1111
+ "Content-Type": "application/json",
1112
+ ...options.headers
1113
+ }
1114
+ });
1115
+ var removeExcludedMedia = (options) => (options.client ?? client).delete({
1116
+ security: [{ scheme: "bearer", type: "http" }],
1117
+ url: "/v1/user/excluded-media/{mediaPublicId}",
1118
+ ...options
1119
+ });
1120
+ var createUserReport = (options) => (options.client ?? client).post({
1121
+ security: [{
1122
+ in: "cookie",
1123
+ name: "nadeshiko.session_token",
1124
+ type: "apiKey"
1125
+ }],
1126
+ url: "/v1/user/reports",
1127
+ ...options,
1128
+ headers: {
1129
+ "Content-Type": "application/json",
1130
+ ...options.headers
1131
+ }
1132
+ });
1133
+ var getUserPreferences = (options) => (options?.client ?? client).get({
1134
+ security: [{
1135
+ in: "cookie",
1136
+ name: "nadeshiko.session_token",
1137
+ type: "apiKey"
1138
+ }],
1139
+ url: "/v1/user/preferences",
1140
+ ...options
1141
+ });
1142
+ var updateUserPreferences = (options) => (options.client ?? client).patch({
1143
+ security: [{
1144
+ in: "cookie",
1145
+ name: "nadeshiko.session_token",
1146
+ type: "apiKey"
1147
+ }],
1148
+ url: "/v1/user/preferences",
1149
+ ...options,
1150
+ headers: {
1151
+ "Content-Type": "application/json",
1152
+ ...options.headers
1153
+ }
1154
+ });
1155
+ var deleteUserActivity = (options) => (options?.client ?? client).delete({
1156
+ security: [{
1157
+ in: "cookie",
1158
+ name: "nadeshiko.session_token",
1159
+ type: "apiKey"
1160
+ }],
1161
+ url: "/v1/user/activity",
1162
+ ...options
1163
+ });
1164
+ var listUserActivity = (options) => (options?.client ?? client).get({
1165
+ security: [{ scheme: "bearer", type: "http" }],
1166
+ url: "/v1/user/activity",
1167
+ ...options
1168
+ });
1169
+ var trackUserActivity = (options) => (options.client ?? client).post({
1170
+ security: [{
1171
+ in: "cookie",
1172
+ name: "nadeshiko.session_token",
1173
+ type: "apiKey"
1174
+ }],
1175
+ url: "/v1/user/activity",
1176
+ ...options,
1177
+ headers: {
1178
+ "Content-Type": "application/json",
1179
+ ...options.headers
1180
+ }
1181
+ });
1182
+ var getUserActivityHeatmap = (options) => (options?.client ?? client).get({
1183
+ security: [{ scheme: "bearer", type: "http" }],
1184
+ url: "/v1/user/activity/heatmap",
1185
+ ...options
1186
+ });
1187
+ var getUserActivityStats = (options) => (options?.client ?? client).get({
1188
+ security: [{ scheme: "bearer", type: "http" }],
1189
+ url: "/v1/user/activity/stats",
1190
+ ...options
1191
+ });
1192
+ var deleteUserActivityByDate = (options) => (options.client ?? client).delete({
1193
+ security: [{
1194
+ in: "cookie",
1195
+ name: "nadeshiko.session_token",
1196
+ type: "apiKey"
1197
+ }],
1198
+ url: "/v1/user/activity/date/{date}",
1199
+ ...options
1200
+ });
1201
+ var deleteUserActivityById = (options) => (options.client ?? client).delete({
1202
+ security: [{
1203
+ in: "cookie",
1204
+ name: "nadeshiko.session_token",
1205
+ type: "apiKey"
1206
+ }],
1207
+ url: "/v1/user/activity/{activityId}",
1208
+ ...options
1209
+ });
1210
+ var exportUserData = (options) => (options?.client ?? client).get({
1211
+ security: [{
1212
+ in: "cookie",
1213
+ name: "nadeshiko.session_token",
1214
+ type: "apiKey"
1215
+ }],
1216
+ url: "/v1/user/export",
1217
+ ...options
1218
+ });
1219
+ var listUserLabs = (options) => (options?.client ?? client).get({
1220
+ security: [{
1221
+ in: "cookie",
1222
+ name: "nadeshiko.session_token",
1223
+ type: "apiKey"
1224
+ }],
1225
+ url: "/v1/user/labs",
1226
+ ...options
1227
+ });
1228
+ var unenrollUserLab = (options) => (options.client ?? client).delete({
1229
+ security: [{
1230
+ in: "cookie",
1231
+ name: "nadeshiko.session_token",
1232
+ type: "apiKey"
1233
+ }],
1234
+ url: "/v1/user/labs/{key}",
1235
+ ...options
1236
+ });
1237
+ var enrollUserLab = (options) => (options.client ?? client).post({
1238
+ security: [{
1239
+ in: "cookie",
1240
+ name: "nadeshiko.session_token",
1241
+ type: "apiKey"
1242
+ }],
1243
+ url: "/v1/user/labs/{key}",
1244
+ ...options
1245
+ });
1246
+ var listCollections = (options) => (options?.client ?? client).get({
1247
+ security: [{ scheme: "bearer", type: "http" }],
1248
+ url: "/v1/collections",
1249
+ ...options
1250
+ });
1251
+ var createCollection = (options) => (options.client ?? client).post({
1252
+ security: [{ scheme: "bearer", type: "http" }],
1253
+ url: "/v1/collections",
1254
+ ...options,
1255
+ headers: {
1256
+ "Content-Type": "application/json",
1257
+ ...options.headers
1258
+ }
1259
+ });
1260
+ var deleteCollection = (options) => (options.client ?? client).delete({
1261
+ security: [{ scheme: "bearer", type: "http" }],
1262
+ url: "/v1/collections/{collectionPublicId}",
1263
+ ...options
1264
+ });
1265
+ var getCollection = (options) => (options.client ?? client).get({
1266
+ security: [{ scheme: "bearer", type: "http" }],
1267
+ url: "/v1/collections/{collectionPublicId}",
1268
+ ...options
1269
+ });
1270
+ var updateCollection = (options) => (options.client ?? client).patch({
1271
+ security: [{
1272
+ in: "cookie",
1273
+ name: "nadeshiko.session_token",
1274
+ type: "apiKey"
1275
+ }],
1276
+ url: "/v1/collections/{collectionPublicId}",
1277
+ ...options,
1278
+ headers: {
1279
+ "Content-Type": "application/json",
1280
+ ...options.headers
1281
+ }
1282
+ });
1283
+ var addSegmentToCollection = (options) => (options.client ?? client).post({
1284
+ security: [{ scheme: "bearer", type: "http" }],
1285
+ url: "/v1/collections/{collectionPublicId}/segments",
1286
+ ...options,
1287
+ headers: {
1288
+ "Content-Type": "application/json",
1289
+ ...options.headers
1290
+ }
1291
+ });
1292
+ var searchCollectionSegments = (options) => (options.client ?? client).post({
1293
+ security: [{ scheme: "bearer", type: "http" }],
1294
+ url: "/v1/collections/{collectionPublicId}/search",
1295
+ ...options,
1296
+ headers: {
1297
+ "Content-Type": "application/json",
1298
+ ...options.headers
1299
+ }
1300
+ });
1301
+ var removeSegmentFromCollection = (options) => (options.client ?? client).delete({
945
1302
  security: [{ scheme: "bearer", type: "http" }],
946
- url: "/v1/media/{mediaId}/episodes/{episodeNumber}/segments/{id}",
1303
+ url: "/v1/collections/{collectionPublicId}/segments/{segmentPublicId}",
947
1304
  ...options
948
1305
  });
949
- // generated/public/retry.ts
1306
+ var updateCollectionSegment = (options) => (options.client ?? client).patch({
1307
+ security: [{
1308
+ in: "cookie",
1309
+ name: "nadeshiko.session_token",
1310
+ type: "apiKey"
1311
+ }],
1312
+ url: "/v1/collections/{collectionPublicId}/segments/{segmentPublicId}",
1313
+ ...options,
1314
+ headers: {
1315
+ "Content-Type": "application/json",
1316
+ ...options.headers
1317
+ }
1318
+ });
1319
+ var getCollectionStats = (options) => (options.client ?? client).get({
1320
+ security: [{
1321
+ in: "cookie",
1322
+ name: "nadeshiko.session_token",
1323
+ type: "apiKey"
1324
+ }],
1325
+ url: "/v1/collections/{collectionPublicId}/stats",
1326
+ ...options
1327
+ });
1328
+ var listAdminReports = (options) => (options?.client ?? client).get({
1329
+ security: [{
1330
+ in: "cookie",
1331
+ name: "nadeshiko.session_token",
1332
+ type: "apiKey"
1333
+ }],
1334
+ url: "/v1/admin/reports",
1335
+ ...options
1336
+ });
1337
+ var batchUpdateAdminReports = (options) => (options.client ?? client).patch({
1338
+ security: [{
1339
+ in: "cookie",
1340
+ name: "nadeshiko.session_token",
1341
+ type: "apiKey"
1342
+ }],
1343
+ url: "/v1/admin/reports/batch",
1344
+ ...options,
1345
+ headers: {
1346
+ "Content-Type": "application/json",
1347
+ ...options.headers
1348
+ }
1349
+ });
1350
+ var bulkDeleteAdminReports = (options) => (options.client ?? client).delete({
1351
+ security: [{
1352
+ in: "cookie",
1353
+ name: "nadeshiko.session_token",
1354
+ type: "apiKey"
1355
+ }],
1356
+ url: "/v1/admin/reports/bulk",
1357
+ ...options,
1358
+ headers: {
1359
+ "Content-Type": "application/json",
1360
+ ...options.headers
1361
+ }
1362
+ });
1363
+ var bulkUpdateAdminReports = (options) => (options.client ?? client).patch({
1364
+ security: [{
1365
+ in: "cookie",
1366
+ name: "nadeshiko.session_token",
1367
+ type: "apiKey"
1368
+ }],
1369
+ url: "/v1/admin/reports/bulk",
1370
+ ...options,
1371
+ headers: {
1372
+ "Content-Type": "application/json",
1373
+ ...options.headers
1374
+ }
1375
+ });
1376
+ var deleteAdminReport = (options) => (options.client ?? client).delete({
1377
+ security: [{
1378
+ in: "cookie",
1379
+ name: "nadeshiko.session_token",
1380
+ type: "apiKey"
1381
+ }],
1382
+ url: "/v1/admin/reports/{reportId}",
1383
+ ...options
1384
+ });
1385
+ var updateAdminReport = (options) => (options.client ?? client).patch({
1386
+ security: [{
1387
+ in: "cookie",
1388
+ name: "nadeshiko.session_token",
1389
+ type: "apiKey"
1390
+ }],
1391
+ url: "/v1/admin/reports/{reportId}",
1392
+ ...options,
1393
+ headers: {
1394
+ "Content-Type": "application/json",
1395
+ ...options.headers
1396
+ }
1397
+ });
1398
+ var listAdminMediaAudits = (options) => (options?.client ?? client).get({
1399
+ security: [{
1400
+ in: "cookie",
1401
+ name: "nadeshiko.session_token",
1402
+ type: "apiKey"
1403
+ }],
1404
+ url: "/v1/admin/media/audits",
1405
+ ...options
1406
+ });
1407
+ var updateAdminMediaAudit = (options) => (options.client ?? client).patch({
1408
+ security: [{
1409
+ in: "cookie",
1410
+ name: "nadeshiko.session_token",
1411
+ type: "apiKey"
1412
+ }],
1413
+ url: "/v1/admin/media/audits/{name}",
1414
+ ...options,
1415
+ headers: {
1416
+ "Content-Type": "application/json",
1417
+ ...options.headers
1418
+ }
1419
+ });
1420
+ var runAdminMediaAudit = (options) => (options.client ?? client).post({
1421
+ security: [{
1422
+ in: "cookie",
1423
+ name: "nadeshiko.session_token",
1424
+ type: "apiKey"
1425
+ }],
1426
+ url: "/v1/admin/media/audits/{name}/run",
1427
+ ...options
1428
+ });
1429
+ var listAdminMediaAuditRuns = (options) => (options?.client ?? client).get({
1430
+ security: [{
1431
+ in: "cookie",
1432
+ name: "nadeshiko.session_token",
1433
+ type: "apiKey"
1434
+ }],
1435
+ url: "/v1/admin/media/audits/runs",
1436
+ ...options
1437
+ });
1438
+ var getAdminMediaAuditRun = (options) => (options.client ?? client).get({
1439
+ security: [{
1440
+ in: "cookie",
1441
+ name: "nadeshiko.session_token",
1442
+ type: "apiKey"
1443
+ }],
1444
+ url: "/v1/admin/media/audits/runs/{auditRunId}",
1445
+ ...options
1446
+ });
1447
+ var getAnnouncement = (options) => (options?.client ?? client).get({ url: "/v1/admin/announcement", ...options });
1448
+ var updateAnnouncement = (options) => (options.client ?? client).put({
1449
+ security: [{
1450
+ in: "cookie",
1451
+ name: "nadeshiko.session_token",
1452
+ type: "apiKey"
1453
+ }],
1454
+ url: "/v1/admin/announcement",
1455
+ ...options,
1456
+ headers: {
1457
+ "Content-Type": "application/json",
1458
+ ...options.headers
1459
+ }
1460
+ });
1461
+ // generated/internal/retry.ts
950
1462
  var RETRYABLE_STATUS = new Set([408, 429, 500, 502, 503, 504]);
951
1463
  function parseRetryAfter(value) {
952
1464
  const seconds = Number(value);
@@ -969,42 +1481,27 @@ function withRetry(fetchImpl = globalThis.fetch, options = {}) {
969
1481
  return async function retryingFetch(input, init) {
970
1482
  let attempt = 0;
971
1483
  while (true) {
972
- let timedInit = init;
1484
+ let fetchInit = init;
1485
+ let timeoutId;
973
1486
  if (timeout !== undefined && !init?.signal) {
974
1487
  const controller = new AbortController;
975
- const timeoutId = setTimeout(() => controller.abort(new Error(`Request timed out after ${timeout}ms`)), timeout);
976
- timedInit = { ...init, signal: controller.signal };
977
- let response2;
978
- try {
979
- response2 = await fetchImpl(input, timedInit);
980
- clearTimeout(timeoutId);
981
- } catch (networkError) {
982
- clearTimeout(timeoutId);
983
- if (attempt >= maxRetries)
984
- throw networkError;
985
- await sleep(backoffDelay(attempt, initialDelayMs, maxDelayMs));
986
- attempt++;
987
- continue;
988
- }
989
- if (!RETRYABLE_STATUS.has(response2.status) || attempt >= maxRetries) {
990
- return response2;
991
- }
992
- const retryAfter2 = response2.headers.get("Retry-After");
993
- const waitMs2 = retryAfter2 ? parseRetryAfter(retryAfter2) : backoffDelay(attempt, initialDelayMs, maxDelayMs);
994
- await sleep(waitMs2);
995
- attempt++;
996
- continue;
1488
+ timeoutId = setTimeout(() => controller.abort(new Error(`Request timed out after ${timeout}ms`)), timeout);
1489
+ fetchInit = { ...init, signal: controller.signal };
997
1490
  }
998
1491
  let response;
999
1492
  try {
1000
- response = await fetchImpl(input, timedInit);
1493
+ response = await fetchImpl(input, fetchInit);
1001
1494
  } catch (networkError) {
1495
+ if (timeoutId !== undefined)
1496
+ clearTimeout(timeoutId);
1002
1497
  if (attempt >= maxRetries)
1003
1498
  throw networkError;
1004
1499
  await sleep(backoffDelay(attempt, initialDelayMs, maxDelayMs));
1005
1500
  attempt++;
1006
1501
  continue;
1007
1502
  }
1503
+ if (timeoutId !== undefined)
1504
+ clearTimeout(timeoutId);
1008
1505
  if (!RETRYABLE_STATUS.has(response.status) || attempt >= maxRetries) {
1009
1506
  return response;
1010
1507
  }
@@ -1016,7 +1513,7 @@ function withRetry(fetchImpl = globalThis.fetch, options = {}) {
1016
1513
  };
1017
1514
  }
1018
1515
 
1019
- // generated/public/errors.ts
1516
+ // generated/internal/errors.ts
1020
1517
  class NadeshikoError extends Error {
1021
1518
  code;
1022
1519
  title;
@@ -1038,13 +1535,68 @@ class NadeshikoError extends Error {
1038
1535
  }
1039
1536
  }
1040
1537
 
1041
- // generated/public/nadeshiko.gen.ts
1538
+ // generated/internal/paginate.ts
1539
+ async function* paginate(fn, options, extract) {
1540
+ let cursor = null;
1541
+ let first = true;
1542
+ while (true) {
1543
+ const callOptions = first ? options : patchCursor(options, cursor);
1544
+ first = false;
1545
+ const result = await fn(callOptions);
1546
+ if ("error" in result && result.error !== undefined) {
1547
+ throw result.error;
1548
+ }
1549
+ const { items, pagination } = extract(result.data);
1550
+ for (const item of items) {
1551
+ yield item;
1552
+ }
1553
+ if (!pagination.hasMore || pagination.cursor === null)
1554
+ break;
1555
+ cursor = pagination.cursor;
1556
+ }
1557
+ }
1558
+ function patchCursor(options, cursor) {
1559
+ if (options.body !== undefined) {
1560
+ return { ...options, body: { ...options.body, cursor } };
1561
+ }
1562
+ if (options.query !== undefined) {
1563
+ return { ...options, query: { ...options.query, cursor } };
1564
+ }
1565
+ return { ...options, body: { cursor } };
1566
+ }
1567
+ async function* flatPaginate(params, fn, extract) {
1568
+ let cursor = null;
1569
+ let first = true;
1570
+ while (true) {
1571
+ const flat = first ? params : { ...params, cursor };
1572
+ first = false;
1573
+ const result = await fn(flat);
1574
+ if ("error" in result && result.error !== undefined) {
1575
+ throw result.error;
1576
+ }
1577
+ const { items, pagination } = extract(result.data);
1578
+ for (const item of items) {
1579
+ yield item;
1580
+ }
1581
+ if (!pagination.hasMore || pagination.cursor === null)
1582
+ break;
1583
+ cursor = pagination.cursor;
1584
+ }
1585
+ }
1586
+
1587
+ // generated/internal/nadeshiko.gen.ts
1042
1588
  var environments = {
1043
1589
  LOCAL: "http://localhost:5000/api",
1044
1590
  DEVELOPMENT: "https://api-dev.nadeshiko.co",
1045
1591
  PRODUCTION: "https://api.nadeshiko.co",
1046
1592
  PROXY: ""
1047
1593
  };
1594
+ var defaultSessionTokenGetter = () => {
1595
+ if (typeof document === "undefined")
1596
+ return;
1597
+ const match = document.cookie.match(/(?:^|;\s*)nadeshiko\.session_token=([^;]*)/);
1598
+ return match ? decodeURIComponent(match[1]) : undefined;
1599
+ };
1048
1600
  function createNadeshikoClient(config) {
1049
1601
  const rawBaseUrl = config.baseURL ?? config.baseUrl;
1050
1602
  const baseUrl = rawBaseUrl === undefined ? environments.PRODUCTION : (rawBaseUrl in environments) ? environments[rawBaseUrl] : rawBaseUrl;
@@ -1054,64 +1606,611 @@ function createNadeshikoClient(config) {
1054
1606
  }
1055
1607
  return config.apiKey;
1056
1608
  };
1609
+ const getSessionToken = config.sessionToken ?? defaultSessionTokenGetter;
1057
1610
  const clientInstance = createClient(createConfig({
1058
1611
  baseUrl,
1612
+ headers: { "User-Agent": "nadeshiko-sdk-ts/2.1.0", ...config.headers },
1059
1613
  fetch: withRetry(globalThis.fetch, config.retryOptions),
1060
- auth: () => getApiKey()
1614
+ auth: (auth) => {
1615
+ if (auth.in === "cookie") {
1616
+ return getSessionToken();
1617
+ }
1618
+ return getApiKey();
1619
+ }
1061
1620
  }));
1062
1621
  clientInstance.interceptors.error.use((error) => {
1063
1622
  if (error && typeof error === "object" && "code" in error && typeof error.code === "string") {
1064
1623
  return new NadeshikoError(error);
1065
1624
  }
1625
+ if (error && typeof error === "object" && "status" in error && typeof error.status === "number") {
1626
+ return new NadeshikoError({
1627
+ code: "UNKNOWN_ERROR",
1628
+ title: "Unexpected error",
1629
+ detail: error.message ?? error.statusText ?? `HTTP ${error.status}`,
1630
+ status: error.status
1631
+ });
1632
+ }
1066
1633
  return error;
1067
1634
  });
1068
- return {
1069
- client: clientInstance,
1070
- search: (options) => search({ throwOnError: true, ...options, client: clientInstance }),
1071
- getSearchStats: (options) => getSearchStats({ throwOnError: true, ...options, client: clientInstance }),
1072
- searchWords: (options) => searchWords({ throwOnError: true, ...options, client: clientInstance }),
1073
- getStatsOverview: (options) => getStatsOverview({ throwOnError: true, ...options, client: clientInstance }),
1074
- getCoveredWords: (options) => getCoveredWords({ throwOnError: true, ...options, client: clientInstance }),
1075
- listMedia: (options) => listMedia({ throwOnError: true, ...options, client: clientInstance }),
1076
- getSegmentByUuid: (options) => getSegmentByUuid({ throwOnError: true, ...options, client: clientInstance }),
1077
- getSegmentContext: (options) => getSegmentContext({ throwOnError: true, ...options, client: clientInstance }),
1078
- listSeries: (options) => listSeries({ throwOnError: true, ...options, client: clientInstance }),
1079
- getSeries: (options) => getSeries({ throwOnError: true, ...options, client: clientInstance }),
1080
- getMedia: (options) => getMedia({ throwOnError: true, ...options, client: clientInstance }),
1081
- listEpisodes: (options) => listEpisodes({ throwOnError: true, ...options, client: clientInstance }),
1082
- getEpisode: (options) => getEpisode({ throwOnError: true, ...options, client: clientInstance }),
1083
- getSegment: (options) => getSegment({ throwOnError: true, ...options, client: clientInstance })
1635
+ const _search = (params) => {
1636
+ const { throwOnError: tOE, ...body } = params ?? {};
1637
+ const p = search({ ...Object.keys(body).length > 0 ? { body } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1638
+ return tOE === false ? p : p.then((r) => r.data);
1084
1639
  };
1085
- }
1086
- // generated/public/paginate.ts
1087
- async function* paginate(fn, options, extract) {
1088
- let cursor = null;
1089
- let first = true;
1090
- while (true) {
1091
- const callOptions = first ? options : patchCursor(options, cursor);
1092
- first = false;
1093
- const result = await fn(callOptions);
1094
- if ("error" in result && result.error !== undefined) {
1095
- throw result.error;
1640
+ _search.paginate = (params) => flatPaginate(params ?? {}, (flat) => {
1641
+ return search({ body: flat, client: clientInstance });
1642
+ }, (data) => ({ items: data.segments, pagination: data.pagination }));
1643
+ const _getSearchStats = (params) => {
1644
+ const { throwOnError: tOE, ...body } = params ?? {};
1645
+ const p = getSearchStats({ ...Object.keys(body).length > 0 ? { body } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1646
+ return tOE === false ? p : p.then((r) => r.data);
1647
+ };
1648
+ const _searchWords = (params) => {
1649
+ const { throwOnError: tOE, ...body } = params ?? {};
1650
+ const p = searchWords({ ...Object.keys(body).length > 0 ? { body } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1651
+ return tOE === false ? p : p.then((r) => r.data);
1652
+ };
1653
+ const _searchMedia = (params) => {
1654
+ const { throwOnError: tOE, ...body } = params ?? {};
1655
+ const p = searchMedia({ ...Object.keys(body).length > 0 ? { body } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1656
+ return tOE === false ? p : p.then((r) => r.data);
1657
+ };
1658
+ const _getStatsOverview = (params) => {
1659
+ const tOE = params?.throwOnError;
1660
+ const p = getStatsOverview({ client: clientInstance, throwOnError: tOE === false ? false : true });
1661
+ return tOE === false ? p : p.then((r) => r.data);
1662
+ };
1663
+ const _listMedia = (params) => {
1664
+ const { throwOnError: tOE, ...query } = params ?? {};
1665
+ const p = listMedia({ ...Object.keys(query).length > 0 ? { query } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1666
+ return tOE === false ? p : p.then((r) => r.data);
1667
+ };
1668
+ _listMedia.paginate = (params) => flatPaginate(params ?? {}, (flat) => {
1669
+ return listMedia({ query: flat, client: clientInstance });
1670
+ }, (data) => ({ items: data.media, pagination: data.pagination }));
1671
+ const _getSegment = (paramsOrId) => {
1672
+ if (typeof paramsOrId === "string") {
1673
+ return getSegment({ throwOnError: true, path: { segmentPublicId: paramsOrId }, client: clientInstance }).then((r) => r.data);
1096
1674
  }
1097
- const { items, pagination } = extract(result.data);
1098
- for (const item of items) {
1099
- yield item;
1675
+ const params = paramsOrId;
1676
+ const { throwOnError: tOE, segmentPublicId } = params ?? {};
1677
+ const p = getSegment({ path: { segmentPublicId }, client: clientInstance, throwOnError: tOE === false ? false : true });
1678
+ return tOE === false ? p : p.then((r) => r.data);
1679
+ };
1680
+ const _getSegmentContext = (paramsOrId) => {
1681
+ if (typeof paramsOrId === "string") {
1682
+ return getSegmentContext({ throwOnError: true, path: { segmentPublicId: paramsOrId }, client: clientInstance }).then((r) => r.data);
1100
1683
  }
1101
- if (!pagination.hasMore || pagination.cursor === null)
1102
- break;
1103
- cursor = pagination.cursor;
1104
- }
1105
- }
1106
- function patchCursor(options, cursor) {
1107
- if (options.body !== undefined) {
1108
- return { ...options, body: { ...options.body, cursor } };
1109
- }
1110
- if (options.query !== undefined) {
1111
- return { ...options, query: { ...options.query, cursor } };
1112
- }
1113
- return { ...options, body: { cursor } };
1684
+ const params = paramsOrId;
1685
+ const { throwOnError: tOE, segmentPublicId, ...query } = params ?? {};
1686
+ const p = getSegmentContext({ path: { segmentPublicId }, ...Object.keys(query).length > 0 ? { query } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1687
+ return tOE === false ? p : p.then((r) => r.data);
1688
+ };
1689
+ const _getMedia = (paramsOrId) => {
1690
+ if (typeof paramsOrId === "string") {
1691
+ return getMedia({ throwOnError: true, path: { mediaPublicId: paramsOrId }, client: clientInstance }).then((r) => r.data);
1692
+ }
1693
+ const params = paramsOrId;
1694
+ const { throwOnError: tOE, mediaPublicId } = params ?? {};
1695
+ const p = getMedia({ path: { mediaPublicId }, client: clientInstance, throwOnError: tOE === false ? false : true });
1696
+ return tOE === false ? p : p.then((r) => r.data);
1697
+ };
1698
+ const _listEpisodes = (paramsOrId) => {
1699
+ if (typeof paramsOrId === "string") {
1700
+ return listEpisodes({ throwOnError: true, path: { mediaPublicId: paramsOrId }, client: clientInstance }).then((r) => r.data);
1701
+ }
1702
+ const params = paramsOrId;
1703
+ const { throwOnError: tOE, mediaPublicId, ...query } = params ?? {};
1704
+ const p = listEpisodes({ path: { mediaPublicId }, ...Object.keys(query).length > 0 ? { query } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1705
+ return tOE === false ? p : p.then((r) => r.data);
1706
+ };
1707
+ _listEpisodes.paginate = (params) => flatPaginate(params ?? {}, (flat) => {
1708
+ const { mediaPublicId, ...q } = flat;
1709
+ return listEpisodes({ path: { mediaPublicId }, query: q, client: clientInstance });
1710
+ }, (data) => ({ items: data.episodes, pagination: data.pagination }));
1711
+ const _getEpisode = (params) => {
1712
+ const { throwOnError: tOE, mediaPublicId, episodeNumber } = params ?? {};
1713
+ const p = getEpisode({ path: { mediaPublicId, episodeNumber }, client: clientInstance, throwOnError: tOE === false ? false : true });
1714
+ return tOE === false ? p : p.then((r) => r.data);
1715
+ };
1716
+ const _getMe = (params) => {
1717
+ const tOE = params?.throwOnError;
1718
+ const p = getMe({ client: clientInstance, throwOnError: tOE === false ? false : true });
1719
+ return tOE === false ? p : p.then((r) => r.data);
1720
+ };
1721
+ const _listExcludedMedia = (params) => {
1722
+ const tOE = params?.throwOnError;
1723
+ const p = listExcludedMedia({ client: clientInstance, throwOnError: tOE === false ? false : true });
1724
+ return tOE === false ? p : p.then((r) => r.data);
1725
+ };
1726
+ const _addExcludedMedia = (params) => {
1727
+ const { throwOnError: tOE, ...body } = params ?? {};
1728
+ const p = addExcludedMedia({ ...Object.keys(body).length > 0 ? { body } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1729
+ return tOE === false ? p : p.then((r) => r.data);
1730
+ };
1731
+ const _removeExcludedMedia = (paramsOrId) => {
1732
+ if (typeof paramsOrId === "string") {
1733
+ return removeExcludedMedia({ throwOnError: true, path: { mediaPublicId: paramsOrId }, client: clientInstance }).then((r) => r.data);
1734
+ }
1735
+ const params = paramsOrId;
1736
+ const { throwOnError: tOE, mediaPublicId } = params ?? {};
1737
+ const p = removeExcludedMedia({ path: { mediaPublicId }, client: clientInstance, throwOnError: tOE === false ? false : true });
1738
+ return tOE === false ? p : p.then((r) => r.data);
1739
+ };
1740
+ const _listUserActivity = (params) => {
1741
+ const { throwOnError: tOE, ...query } = params ?? {};
1742
+ const p = listUserActivity({ ...Object.keys(query).length > 0 ? { query } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1743
+ return tOE === false ? p : p.then((r) => r.data);
1744
+ };
1745
+ _listUserActivity.paginate = (params) => flatPaginate(params ?? {}, (flat) => {
1746
+ return listUserActivity({ query: flat, client: clientInstance });
1747
+ }, (data) => ({ items: data.activities, pagination: data.pagination }));
1748
+ const _getUserActivityHeatmap = (params) => {
1749
+ const { throwOnError: tOE, ...query } = params ?? {};
1750
+ const p = getUserActivityHeatmap({ ...Object.keys(query).length > 0 ? { query } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1751
+ return tOE === false ? p : p.then((r) => r.data);
1752
+ };
1753
+ const _getUserActivityStats = (params) => {
1754
+ const { throwOnError: tOE, ...query } = params ?? {};
1755
+ const p = getUserActivityStats({ ...Object.keys(query).length > 0 ? { query } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1756
+ return tOE === false ? p : p.then((r) => r.data);
1757
+ };
1758
+ const _listCollections = (params) => {
1759
+ const { throwOnError: tOE, ...query } = params ?? {};
1760
+ const p = listCollections({ ...Object.keys(query).length > 0 ? { query } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1761
+ return tOE === false ? p : p.then((r) => r.data);
1762
+ };
1763
+ _listCollections.paginate = (params) => flatPaginate(params ?? {}, (flat) => {
1764
+ return listCollections({ query: flat, client: clientInstance });
1765
+ }, (data) => ({ items: data.collections, pagination: data.pagination }));
1766
+ const _createCollection = (params) => {
1767
+ const { throwOnError: tOE, ...body } = params ?? {};
1768
+ const p = createCollection({ ...Object.keys(body).length > 0 ? { body } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1769
+ return tOE === false ? p : p.then((r) => r.data);
1770
+ };
1771
+ const _getCollection = (paramsOrId) => {
1772
+ if (typeof paramsOrId === "string") {
1773
+ return getCollection({ throwOnError: true, path: { collectionPublicId: paramsOrId }, client: clientInstance }).then((r) => r.data);
1774
+ }
1775
+ const params = paramsOrId;
1776
+ const { throwOnError: tOE, collectionPublicId } = params ?? {};
1777
+ const p = getCollection({ path: { collectionPublicId }, client: clientInstance, throwOnError: tOE === false ? false : true });
1778
+ return tOE === false ? p : p.then((r) => r.data);
1779
+ };
1780
+ const _deleteCollection = (paramsOrId) => {
1781
+ if (typeof paramsOrId === "string") {
1782
+ return deleteCollection({ throwOnError: true, path: { collectionPublicId: paramsOrId }, client: clientInstance }).then((r) => r.data);
1783
+ }
1784
+ const params = paramsOrId;
1785
+ const { throwOnError: tOE, collectionPublicId } = params ?? {};
1786
+ const p = deleteCollection({ path: { collectionPublicId }, client: clientInstance, throwOnError: tOE === false ? false : true });
1787
+ return tOE === false ? p : p.then((r) => r.data);
1788
+ };
1789
+ const _addSegmentToCollection = (params) => {
1790
+ const { throwOnError: tOE, collectionPublicId, ...body } = params ?? {};
1791
+ const p = addSegmentToCollection({ path: { collectionPublicId }, ...Object.keys(body).length > 0 ? { body } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1792
+ return tOE === false ? p : p.then((r) => r.data);
1793
+ };
1794
+ const _searchCollectionSegments = (paramsOrId) => {
1795
+ if (typeof paramsOrId === "string") {
1796
+ return searchCollectionSegments({ throwOnError: true, path: { collectionPublicId: paramsOrId }, client: clientInstance }).then((r) => r.data);
1797
+ }
1798
+ const params = paramsOrId;
1799
+ const { throwOnError: tOE, collectionPublicId, ...body } = params ?? {};
1800
+ const p = searchCollectionSegments({ path: { collectionPublicId }, ...Object.keys(body).length > 0 ? { body } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1801
+ return tOE === false ? p : p.then((r) => r.data);
1802
+ };
1803
+ _searchCollectionSegments.paginate = (params) => flatPaginate(params ?? {}, (flat) => {
1804
+ const { collectionPublicId, ...body } = flat;
1805
+ return searchCollectionSegments({ path: { collectionPublicId }, body, client: clientInstance });
1806
+ }, (data) => ({ items: data.segments, pagination: data.pagination }));
1807
+ const _removeSegmentFromCollection = (params) => {
1808
+ const { throwOnError: tOE, collectionPublicId, segmentPublicId } = params ?? {};
1809
+ const p = removeSegmentFromCollection({ path: { collectionPublicId, segmentPublicId }, client: clientInstance, throwOnError: tOE === false ? false : true });
1810
+ return tOE === false ? p : p.then((r) => r.data);
1811
+ };
1812
+ const _getCoveredWords = (params) => {
1813
+ const { throwOnError: tOE, ...query } = params ?? {};
1814
+ const p = getCoveredWords({ ...Object.keys(query).length > 0 ? { query } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1815
+ return tOE === false ? p : p.then((r) => r.data);
1816
+ };
1817
+ _getCoveredWords.paginate = (params) => flatPaginate(params ?? {}, (flat) => {
1818
+ return getCoveredWords({ query: flat, client: clientInstance });
1819
+ }, (data) => ({ items: data.words, pagination: data.pagination }));
1820
+ const _triggerCoveredWordsUpdate = (params) => {
1821
+ const { throwOnError: tOE, ...body } = params ?? {};
1822
+ const p = triggerCoveredWordsUpdate({ ...Object.keys(body).length > 0 ? { body } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1823
+ return tOE === false ? p : p.then((r) => r.data);
1824
+ };
1825
+ const _createMedia = (params) => {
1826
+ const { throwOnError: tOE, ...body } = params ?? {};
1827
+ const p = createMedia({ ...Object.keys(body).length > 0 ? { body } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1828
+ return tOE === false ? p : p.then((r) => r.data);
1829
+ };
1830
+ const _updateSegment = (paramsOrId) => {
1831
+ if (typeof paramsOrId === "string") {
1832
+ return updateSegment({ throwOnError: true, path: { segmentPublicId: paramsOrId }, client: clientInstance }).then((r) => r.data);
1833
+ }
1834
+ const params = paramsOrId;
1835
+ const { throwOnError: tOE, segmentPublicId, ...body } = params ?? {};
1836
+ const p = updateSegment({ path: { segmentPublicId }, ...Object.keys(body).length > 0 ? { body } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1837
+ return tOE === false ? p : p.then((r) => r.data);
1838
+ };
1839
+ const _listSegmentRevisions = (paramsOrId) => {
1840
+ if (typeof paramsOrId === "string") {
1841
+ return listSegmentRevisions({ throwOnError: true, path: { segmentPublicId: paramsOrId }, client: clientInstance }).then((r) => r.data);
1842
+ }
1843
+ const params = paramsOrId;
1844
+ const { throwOnError: tOE, segmentPublicId } = params ?? {};
1845
+ const p = listSegmentRevisions({ path: { segmentPublicId }, client: clientInstance, throwOnError: tOE === false ? false : true });
1846
+ return tOE === false ? p : p.then((r) => r.data);
1847
+ };
1848
+ const _updateMedia = (paramsOrId) => {
1849
+ if (typeof paramsOrId === "string") {
1850
+ return updateMedia({ throwOnError: true, path: { mediaPublicId: paramsOrId }, client: clientInstance }).then((r) => r.data);
1851
+ }
1852
+ const params = paramsOrId;
1853
+ const { throwOnError: tOE, mediaPublicId, ...body } = params ?? {};
1854
+ const p = updateMedia({ path: { mediaPublicId }, ...Object.keys(body).length > 0 ? { body } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1855
+ return tOE === false ? p : p.then((r) => r.data);
1856
+ };
1857
+ const _deleteMedia = (paramsOrId) => {
1858
+ if (typeof paramsOrId === "string") {
1859
+ return deleteMedia({ throwOnError: true, path: { mediaPublicId: paramsOrId }, client: clientInstance }).then((r) => r.data);
1860
+ }
1861
+ const params = paramsOrId;
1862
+ const { throwOnError: tOE, mediaPublicId } = params ?? {};
1863
+ const p = deleteMedia({ path: { mediaPublicId }, client: clientInstance, throwOnError: tOE === false ? false : true });
1864
+ return tOE === false ? p : p.then((r) => r.data);
1865
+ };
1866
+ const _createEpisode = (params) => {
1867
+ const { throwOnError: tOE, mediaPublicId, ...body } = params ?? {};
1868
+ const p = createEpisode({ path: { mediaPublicId }, ...Object.keys(body).length > 0 ? { body } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1869
+ return tOE === false ? p : p.then((r) => r.data);
1870
+ };
1871
+ const _updateEpisode = (params) => {
1872
+ const { throwOnError: tOE, mediaPublicId, episodeNumber, ...body } = params ?? {};
1873
+ const p = updateEpisode({ path: { mediaPublicId, episodeNumber }, ...Object.keys(body).length > 0 ? { body } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1874
+ return tOE === false ? p : p.then((r) => r.data);
1875
+ };
1876
+ const _deleteEpisode = (params) => {
1877
+ const { throwOnError: tOE, mediaPublicId, episodeNumber } = params ?? {};
1878
+ const p = deleteEpisode({ path: { mediaPublicId, episodeNumber }, client: clientInstance, throwOnError: tOE === false ? false : true });
1879
+ return tOE === false ? p : p.then((r) => r.data);
1880
+ };
1881
+ const _listSegments = (params) => {
1882
+ const { throwOnError: tOE, mediaPublicId, episodeNumber, ...query } = params ?? {};
1883
+ const p = listSegments({ path: { mediaPublicId, episodeNumber }, ...Object.keys(query).length > 0 ? { query } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1884
+ return tOE === false ? p : p.then((r) => r.data);
1885
+ };
1886
+ _listSegments.paginate = (params) => flatPaginate(params ?? {}, (flat) => {
1887
+ const { mediaPublicId, episodeNumber, ...q } = flat;
1888
+ return listSegments({ path: { mediaPublicId, episodeNumber }, query: q, client: clientInstance });
1889
+ }, (data) => ({ items: data.segments, pagination: data.pagination }));
1890
+ const _createSegment = (params) => {
1891
+ const { throwOnError: tOE, mediaPublicId, episodeNumber, ...body } = params ?? {};
1892
+ const p = createSegment({ path: { mediaPublicId, episodeNumber }, ...Object.keys(body).length > 0 ? { body } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1893
+ return tOE === false ? p : p.then((r) => r.data);
1894
+ };
1895
+ const _createSegmentsBatch = (params) => {
1896
+ const { throwOnError: tOE, mediaPublicId, episodeNumber, ...body } = params ?? {};
1897
+ const p = createSegmentsBatch({ path: { mediaPublicId, episodeNumber }, ...Object.keys(body).length > 0 ? { body } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1898
+ return tOE === false ? p : p.then((r) => r.data);
1899
+ };
1900
+ const _createUserReport = (params) => {
1901
+ const { throwOnError: tOE, ...body } = params ?? {};
1902
+ const p = createUserReport({ ...Object.keys(body).length > 0 ? { body } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1903
+ return tOE === false ? p : p.then((r) => r.data);
1904
+ };
1905
+ const _getUserPreferences = (params) => {
1906
+ const tOE = params?.throwOnError;
1907
+ const p = getUserPreferences({ client: clientInstance, throwOnError: tOE === false ? false : true });
1908
+ return tOE === false ? p : p.then((r) => r.data);
1909
+ };
1910
+ const _updateUserPreferences = (params) => {
1911
+ const { throwOnError: tOE, ...body } = params ?? {};
1912
+ const p = updateUserPreferences({ ...Object.keys(body).length > 0 ? { body } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1913
+ return tOE === false ? p : p.then((r) => r.data);
1914
+ };
1915
+ const _trackUserActivity = (params) => {
1916
+ const { throwOnError: tOE, ...body } = params ?? {};
1917
+ const p = trackUserActivity({ ...Object.keys(body).length > 0 ? { body } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1918
+ return tOE === false ? p : p.then((r) => r.data);
1919
+ };
1920
+ const _deleteUserActivity = (params) => {
1921
+ const { throwOnError: tOE, ...query } = params ?? {};
1922
+ const p = deleteUserActivity({ ...Object.keys(query).length > 0 ? { query } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1923
+ return tOE === false ? p : p.then((r) => r.data);
1924
+ };
1925
+ const _deleteUserActivityByDate = (paramsOrId) => {
1926
+ if (typeof paramsOrId === "string") {
1927
+ return deleteUserActivityByDate({ throwOnError: true, path: { date: paramsOrId }, client: clientInstance }).then((r) => r.data);
1928
+ }
1929
+ const params = paramsOrId;
1930
+ const { throwOnError: tOE, date } = params ?? {};
1931
+ const p = deleteUserActivityByDate({ path: { date }, client: clientInstance, throwOnError: tOE === false ? false : true });
1932
+ return tOE === false ? p : p.then((r) => r.data);
1933
+ };
1934
+ const _deleteUserActivityById = (paramsOrId) => {
1935
+ if (typeof paramsOrId === "number") {
1936
+ return deleteUserActivityById({ throwOnError: true, path: { activityId: paramsOrId }, client: clientInstance }).then((r) => r.data);
1937
+ }
1938
+ const params = paramsOrId;
1939
+ const { throwOnError: tOE, activityId } = params ?? {};
1940
+ const p = deleteUserActivityById({ path: { activityId }, client: clientInstance, throwOnError: tOE === false ? false : true });
1941
+ return tOE === false ? p : p.then((r) => r.data);
1942
+ };
1943
+ const _exportUserData = (params) => {
1944
+ const tOE = params?.throwOnError;
1945
+ const p = exportUserData({ client: clientInstance, throwOnError: tOE === false ? false : true });
1946
+ return tOE === false ? p : p.then((r) => r.data);
1947
+ };
1948
+ const _listUserLabs = (params) => {
1949
+ const tOE = params?.throwOnError;
1950
+ const p = listUserLabs({ client: clientInstance, throwOnError: tOE === false ? false : true });
1951
+ return tOE === false ? p : p.then((r) => r.data);
1952
+ };
1953
+ const _enrollUserLab = (paramsOrId) => {
1954
+ if (typeof paramsOrId === "string") {
1955
+ return enrollUserLab({ throwOnError: true, path: { key: paramsOrId }, client: clientInstance }).then((r) => r.data);
1956
+ }
1957
+ const params = paramsOrId;
1958
+ const { throwOnError: tOE, key } = params ?? {};
1959
+ const p = enrollUserLab({ path: { key }, client: clientInstance, throwOnError: tOE === false ? false : true });
1960
+ return tOE === false ? p : p.then((r) => r.data);
1961
+ };
1962
+ const _unenrollUserLab = (paramsOrId) => {
1963
+ if (typeof paramsOrId === "string") {
1964
+ return unenrollUserLab({ throwOnError: true, path: { key: paramsOrId }, client: clientInstance }).then((r) => r.data);
1965
+ }
1966
+ const params = paramsOrId;
1967
+ const { throwOnError: tOE, key } = params ?? {};
1968
+ const p = unenrollUserLab({ path: { key }, client: clientInstance, throwOnError: tOE === false ? false : true });
1969
+ return tOE === false ? p : p.then((r) => r.data);
1970
+ };
1971
+ const _updateCollection = (paramsOrId) => {
1972
+ if (typeof paramsOrId === "string") {
1973
+ return updateCollection({ throwOnError: true, path: { collectionPublicId: paramsOrId }, client: clientInstance }).then((r) => r.data);
1974
+ }
1975
+ const params = paramsOrId;
1976
+ const { throwOnError: tOE, collectionPublicId, ...body } = params ?? {};
1977
+ const p = updateCollection({ path: { collectionPublicId }, ...Object.keys(body).length > 0 ? { body } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1978
+ return tOE === false ? p : p.then((r) => r.data);
1979
+ };
1980
+ const _updateCollectionSegment = (params) => {
1981
+ const { throwOnError: tOE, collectionPublicId, segmentPublicId, ...body } = params ?? {};
1982
+ const p = updateCollectionSegment({ path: { collectionPublicId, segmentPublicId }, ...Object.keys(body).length > 0 ? { body } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1983
+ return tOE === false ? p : p.then((r) => r.data);
1984
+ };
1985
+ const _getCollectionStats = (paramsOrId) => {
1986
+ if (typeof paramsOrId === "string") {
1987
+ return getCollectionStats({ throwOnError: true, path: { collectionPublicId: paramsOrId }, client: clientInstance }).then((r) => r.data);
1988
+ }
1989
+ const params = paramsOrId;
1990
+ const { throwOnError: tOE, collectionPublicId } = params ?? {};
1991
+ const p = getCollectionStats({ path: { collectionPublicId }, client: clientInstance, throwOnError: tOE === false ? false : true });
1992
+ return tOE === false ? p : p.then((r) => r.data);
1993
+ };
1994
+ const _listAdminReports = (params) => {
1995
+ const { throwOnError: tOE, ...query } = params ?? {};
1996
+ const p = listAdminReports({ ...Object.keys(query).length > 0 ? { query } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
1997
+ return tOE === false ? p : p.then((r) => r.data);
1998
+ };
1999
+ _listAdminReports.paginate = (params) => flatPaginate(params ?? {}, (flat) => {
2000
+ return listAdminReports({ query: flat, client: clientInstance });
2001
+ }, (data) => ({ items: data.groups, pagination: data.pagination }));
2002
+ const _batchUpdateAdminReports = (params) => {
2003
+ const { throwOnError: tOE, ...body } = params ?? {};
2004
+ const p = batchUpdateAdminReports({ ...Object.keys(body).length > 0 ? { body } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
2005
+ return tOE === false ? p : p.then((r) => r.data);
2006
+ };
2007
+ const _bulkUpdateAdminReports = (params) => {
2008
+ const { throwOnError: tOE, ...body } = params ?? {};
2009
+ const p = bulkUpdateAdminReports({ ...Object.keys(body).length > 0 ? { body } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
2010
+ return tOE === false ? p : p.then((r) => r.data);
2011
+ };
2012
+ const _bulkDeleteAdminReports = (params) => {
2013
+ const { throwOnError: tOE, ...body } = params ?? {};
2014
+ const p = bulkDeleteAdminReports({ ...Object.keys(body).length > 0 ? { body } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
2015
+ return tOE === false ? p : p.then((r) => r.data);
2016
+ };
2017
+ const _updateAdminReport = (paramsOrId) => {
2018
+ if (typeof paramsOrId === "number") {
2019
+ return updateAdminReport({ throwOnError: true, path: { reportId: paramsOrId }, client: clientInstance }).then((r) => r.data);
2020
+ }
2021
+ const params = paramsOrId;
2022
+ const { throwOnError: tOE, reportId, ...body } = params ?? {};
2023
+ const p = updateAdminReport({ path: { reportId }, ...Object.keys(body).length > 0 ? { body } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
2024
+ return tOE === false ? p : p.then((r) => r.data);
2025
+ };
2026
+ const _deleteAdminReport = (paramsOrId) => {
2027
+ if (typeof paramsOrId === "number") {
2028
+ return deleteAdminReport({ throwOnError: true, path: { reportId: paramsOrId }, client: clientInstance }).then((r) => r.data);
2029
+ }
2030
+ const params = paramsOrId;
2031
+ const { throwOnError: tOE, reportId } = params ?? {};
2032
+ const p = deleteAdminReport({ path: { reportId }, client: clientInstance, throwOnError: tOE === false ? false : true });
2033
+ return tOE === false ? p : p.then((r) => r.data);
2034
+ };
2035
+ const _listAdminMediaAudits = (params) => {
2036
+ const tOE = params?.throwOnError;
2037
+ const p = listAdminMediaAudits({ client: clientInstance, throwOnError: tOE === false ? false : true });
2038
+ return tOE === false ? p : p.then((r) => r.data);
2039
+ };
2040
+ const _updateAdminMediaAudit = (paramsOrId) => {
2041
+ if (typeof paramsOrId === "string") {
2042
+ return updateAdminMediaAudit({ throwOnError: true, path: { name: paramsOrId }, client: clientInstance }).then((r) => r.data);
2043
+ }
2044
+ const params = paramsOrId;
2045
+ const { throwOnError: tOE, name, ...body } = params ?? {};
2046
+ const p = updateAdminMediaAudit({ path: { name }, ...Object.keys(body).length > 0 ? { body } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
2047
+ return tOE === false ? p : p.then((r) => r.data);
2048
+ };
2049
+ const _runAdminMediaAudit = (paramsOrId) => {
2050
+ if (typeof paramsOrId === "string") {
2051
+ return runAdminMediaAudit({ throwOnError: true, path: { name: paramsOrId }, client: clientInstance }).then((r) => r.data);
2052
+ }
2053
+ const params = paramsOrId;
2054
+ const { throwOnError: tOE, name, ...query } = params ?? {};
2055
+ const p = runAdminMediaAudit({ path: { name }, ...Object.keys(query).length > 0 ? { query } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
2056
+ return tOE === false ? p : p.then((r) => r.data);
2057
+ };
2058
+ const _listAdminMediaAuditRuns = (params) => {
2059
+ const { throwOnError: tOE, ...query } = params ?? {};
2060
+ const p = listAdminMediaAuditRuns({ ...Object.keys(query).length > 0 ? { query } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
2061
+ return tOE === false ? p : p.then((r) => r.data);
2062
+ };
2063
+ _listAdminMediaAuditRuns.paginate = (params) => flatPaginate(params ?? {}, (flat) => {
2064
+ return listAdminMediaAuditRuns({ query: flat, client: clientInstance });
2065
+ }, (data) => ({ items: data.runs, pagination: data.pagination }));
2066
+ const _getAdminMediaAuditRun = (paramsOrId) => {
2067
+ if (typeof paramsOrId === "number") {
2068
+ return getAdminMediaAuditRun({ throwOnError: true, path: { auditRunId: paramsOrId }, client: clientInstance }).then((r) => r.data);
2069
+ }
2070
+ const params = paramsOrId;
2071
+ const { throwOnError: tOE, auditRunId } = params ?? {};
2072
+ const p = getAdminMediaAuditRun({ path: { auditRunId }, client: clientInstance, throwOnError: tOE === false ? false : true });
2073
+ return tOE === false ? p : p.then((r) => r.data);
2074
+ };
2075
+ const _getAnnouncement = (params) => {
2076
+ const tOE = params?.throwOnError;
2077
+ const p = getAnnouncement({ client: clientInstance, throwOnError: tOE === false ? false : true });
2078
+ return tOE === false ? p : p.then((r) => r.data);
2079
+ };
2080
+ const _updateAnnouncement = (params) => {
2081
+ const { throwOnError: tOE, ...body } = params ?? {};
2082
+ const p = updateAnnouncement({ ...Object.keys(body).length > 0 ? { body } : {}, client: clientInstance, throwOnError: tOE === false ? false : true });
2083
+ return tOE === false ? p : p.then((r) => r.data);
2084
+ };
2085
+ return {
2086
+ client: clientInstance,
2087
+ search: _search,
2088
+ getSearchStats: _getSearchStats,
2089
+ searchWords: _searchWords,
2090
+ searchMedia: _searchMedia,
2091
+ getStatsOverview: _getStatsOverview,
2092
+ listMedia: _listMedia,
2093
+ getSegment: _getSegment,
2094
+ getSegmentContext: _getSegmentContext,
2095
+ getMedia: _getMedia,
2096
+ listEpisodes: _listEpisodes,
2097
+ getEpisode: _getEpisode,
2098
+ getMe: _getMe,
2099
+ listExcludedMedia: _listExcludedMedia,
2100
+ addExcludedMedia: _addExcludedMedia,
2101
+ removeExcludedMedia: _removeExcludedMedia,
2102
+ listUserActivity: _listUserActivity,
2103
+ getUserActivityHeatmap: _getUserActivityHeatmap,
2104
+ getUserActivityStats: _getUserActivityStats,
2105
+ listCollections: _listCollections,
2106
+ createCollection: _createCollection,
2107
+ getCollection: _getCollection,
2108
+ deleteCollection: _deleteCollection,
2109
+ addSegmentToCollection: _addSegmentToCollection,
2110
+ searchCollectionSegments: _searchCollectionSegments,
2111
+ removeSegmentFromCollection: _removeSegmentFromCollection,
2112
+ getCoveredWords: _getCoveredWords,
2113
+ triggerCoveredWordsUpdate: _triggerCoveredWordsUpdate,
2114
+ createMedia: _createMedia,
2115
+ updateSegment: _updateSegment,
2116
+ listSegmentRevisions: _listSegmentRevisions,
2117
+ updateMedia: _updateMedia,
2118
+ deleteMedia: _deleteMedia,
2119
+ createEpisode: _createEpisode,
2120
+ updateEpisode: _updateEpisode,
2121
+ deleteEpisode: _deleteEpisode,
2122
+ listSegments: _listSegments,
2123
+ createSegment: _createSegment,
2124
+ createSegmentsBatch: _createSegmentsBatch,
2125
+ createUserReport: _createUserReport,
2126
+ getUserPreferences: _getUserPreferences,
2127
+ updateUserPreferences: _updateUserPreferences,
2128
+ trackUserActivity: _trackUserActivity,
2129
+ deleteUserActivity: _deleteUserActivity,
2130
+ deleteUserActivityByDate: _deleteUserActivityByDate,
2131
+ deleteUserActivityById: _deleteUserActivityById,
2132
+ exportUserData: _exportUserData,
2133
+ listUserLabs: _listUserLabs,
2134
+ enrollUserLab: _enrollUserLab,
2135
+ unenrollUserLab: _unenrollUserLab,
2136
+ updateCollection: _updateCollection,
2137
+ updateCollectionSegment: _updateCollectionSegment,
2138
+ getCollectionStats: _getCollectionStats,
2139
+ listAdminReports: _listAdminReports,
2140
+ batchUpdateAdminReports: _batchUpdateAdminReports,
2141
+ bulkUpdateAdminReports: _bulkUpdateAdminReports,
2142
+ bulkDeleteAdminReports: _bulkDeleteAdminReports,
2143
+ updateAdminReport: _updateAdminReport,
2144
+ deleteAdminReport: _deleteAdminReport,
2145
+ listAdminMediaAudits: _listAdminMediaAudits,
2146
+ updateAdminMediaAudit: _updateAdminMediaAudit,
2147
+ runAdminMediaAudit: _runAdminMediaAudit,
2148
+ listAdminMediaAuditRuns: _listAdminMediaAuditRuns,
2149
+ getAdminMediaAuditRun: _getAdminMediaAuditRun,
2150
+ getAnnouncement: _getAnnouncement,
2151
+ updateAnnouncement: _updateAnnouncement
2152
+ };
1114
2153
  }
2154
+ // generated/internal/internal/stats.gen.ts
2155
+ var exports_stats_gen = {};
2156
+ __export(exports_stats_gen, {
2157
+ triggerCoveredWordsUpdate: () => triggerCoveredWordsUpdate,
2158
+ getCoveredWords: () => getCoveredWords
2159
+ });
2160
+ // generated/internal/internal/media.gen.ts
2161
+ var exports_media_gen = {};
2162
+ __export(exports_media_gen, {
2163
+ updateSegment: () => updateSegment,
2164
+ updateMedia: () => updateMedia,
2165
+ updateEpisode: () => updateEpisode,
2166
+ listSegments: () => listSegments,
2167
+ listSegmentRevisions: () => listSegmentRevisions,
2168
+ deleteMedia: () => deleteMedia,
2169
+ deleteEpisode: () => deleteEpisode,
2170
+ createSegmentsBatch: () => createSegmentsBatch,
2171
+ createSegment: () => createSegment,
2172
+ createMedia: () => createMedia,
2173
+ createEpisode: () => createEpisode
2174
+ });
2175
+ // generated/internal/internal/user.gen.ts
2176
+ var exports_user_gen = {};
2177
+ __export(exports_user_gen, {
2178
+ updateUserPreferences: () => updateUserPreferences,
2179
+ unenrollUserLab: () => unenrollUserLab,
2180
+ trackUserActivity: () => trackUserActivity,
2181
+ listUserLabs: () => listUserLabs,
2182
+ getUserPreferences: () => getUserPreferences,
2183
+ exportUserData: () => exportUserData,
2184
+ enrollUserLab: () => enrollUserLab,
2185
+ deleteUserActivityById: () => deleteUserActivityById,
2186
+ deleteUserActivityByDate: () => deleteUserActivityByDate,
2187
+ deleteUserActivity: () => deleteUserActivity,
2188
+ createUserReport: () => createUserReport
2189
+ });
2190
+ // generated/internal/internal/collections.gen.ts
2191
+ var exports_collections_gen = {};
2192
+ __export(exports_collections_gen, {
2193
+ updateCollectionSegment: () => updateCollectionSegment,
2194
+ updateCollection: () => updateCollection,
2195
+ getCollectionStats: () => getCollectionStats
2196
+ });
2197
+ // generated/internal/internal/admin.gen.ts
2198
+ var exports_admin_gen = {};
2199
+ __export(exports_admin_gen, {
2200
+ updateAnnouncement: () => updateAnnouncement,
2201
+ updateAdminReport: () => updateAdminReport,
2202
+ updateAdminMediaAudit: () => updateAdminMediaAudit,
2203
+ runAdminMediaAudit: () => runAdminMediaAudit,
2204
+ listAdminReports: () => listAdminReports,
2205
+ listAdminMediaAudits: () => listAdminMediaAudits,
2206
+ listAdminMediaAuditRuns: () => listAdminMediaAuditRuns,
2207
+ getAnnouncement: () => getAnnouncement,
2208
+ getAdminMediaAuditRun: () => getAdminMediaAuditRun,
2209
+ deleteAdminReport: () => deleteAdminReport,
2210
+ bulkUpdateAdminReports: () => bulkUpdateAdminReports,
2211
+ bulkDeleteAdminReports: () => bulkDeleteAdminReports,
2212
+ batchUpdateAdminReports: () => batchUpdateAdminReports
2213
+ });
1115
2214
 
1116
- //# debugId=A5A174656833D84C64756E2164756E21
2215
+ //# debugId=BE8DCA78AE43E62F64756E2164756E21
1117
2216
  //# sourceMappingURL=index.js.map