@brigadasos/nadeshiko-sdk 1.5.0-dev.fe381ff → 1.5.1-dev.3a9f136

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -39,6 +39,7 @@ var __export = (target, all) => {
39
39
  // generated/dev/index.ts
40
40
  var exports_dev = {};
41
41
  __export(exports_dev, {
42
+ withRetry: () => withRetry,
42
43
  user: () => exports_user_gen,
43
44
  updateUserPreferences: () => updateUserPreferences,
44
45
  updateSeriesMedia: () => updateSeriesMedia,
@@ -63,6 +64,7 @@ __export(exports_dev, {
63
64
  removeSegmentFromCollection: () => removeSegmentFromCollection,
64
65
  removeMediaFromSeries: () => removeMediaFromSeries,
65
66
  purgeAdminQueueFailed: () => purgeAdminQueueFailed,
67
+ paginate: () => paginate,
66
68
  media: () => exports_media_gen,
67
69
  listUserLabs: () => listUserLabs,
68
70
  listUserActivity: () => listUserActivity,
@@ -119,10 +121,12 @@ __export(exports_dev, {
119
121
  collections: () => exports_collections_gen,
120
122
  client: () => client,
121
123
  clearAdminImpersonation: () => clearAdminImpersonation,
124
+ batchUpdateAdminReports: () => batchUpdateAdminReports,
122
125
  autocompleteMedia: () => autocompleteMedia,
123
126
  admin: () => exports_admin_gen,
124
127
  addSegmentToCollection: () => addSegmentToCollection,
125
- addMediaToSeries: () => addMediaToSeries
128
+ addMediaToSeries: () => addMediaToSeries,
129
+ NadeshikoError: () => NadeshikoError
126
130
  });
127
131
  module.exports = __toCommonJS(exports_dev);
128
132
 
@@ -1642,6 +1646,19 @@ var listAdminReports = (options) => (options?.client ?? client).get({
1642
1646
  url: "/v1/admin/reports",
1643
1647
  ...options
1644
1648
  });
1649
+ var batchUpdateAdminReports = (options) => (options.client ?? client).patch({
1650
+ security: [{
1651
+ in: "cookie",
1652
+ name: "nadeshiko.session_token",
1653
+ type: "apiKey"
1654
+ }],
1655
+ url: "/v1/admin/reports/batch",
1656
+ ...options,
1657
+ headers: {
1658
+ "Content-Type": "application/json",
1659
+ ...options.headers
1660
+ }
1661
+ });
1645
1662
  var updateAdminReport = (options) => (options.client ?? client).patch({
1646
1663
  security: [{
1647
1664
  in: "cookie",
@@ -1718,6 +1735,98 @@ var updateAnnouncement = (options) => (options.client ?? client).put({
1718
1735
  ...options.headers
1719
1736
  }
1720
1737
  });
1738
+ // generated/dev/retry.ts
1739
+ var RETRYABLE_STATUS = new Set([408, 429, 500, 502, 503, 504]);
1740
+ function parseRetryAfter(value) {
1741
+ const seconds = Number(value);
1742
+ if (!Number.isNaN(seconds))
1743
+ return seconds * 1000;
1744
+ const date = new Date(value);
1745
+ if (!Number.isNaN(date.getTime()))
1746
+ return Math.max(0, date.getTime() - Date.now());
1747
+ return 1000;
1748
+ }
1749
+ function backoffDelay(attempt, initial, max) {
1750
+ const jitter = Math.random() * 100;
1751
+ return Math.min(initial * 2 ** attempt + jitter, max);
1752
+ }
1753
+ function sleep(ms) {
1754
+ return new Promise((resolve) => setTimeout(resolve, ms));
1755
+ }
1756
+ function withRetry(fetchImpl = globalThis.fetch, options = {}) {
1757
+ const { maxRetries = 2, initialDelayMs = 500, maxDelayMs = 30000, timeout } = options;
1758
+ return async function retryingFetch(input, init) {
1759
+ let attempt = 0;
1760
+ while (true) {
1761
+ let timedInit = init;
1762
+ if (timeout !== undefined && !init?.signal) {
1763
+ const controller = new AbortController;
1764
+ const timeoutId = setTimeout(() => controller.abort(new Error(`Request timed out after ${timeout}ms`)), timeout);
1765
+ timedInit = { ...init, signal: controller.signal };
1766
+ let response2;
1767
+ try {
1768
+ response2 = await fetchImpl(input, timedInit);
1769
+ clearTimeout(timeoutId);
1770
+ } catch (networkError) {
1771
+ clearTimeout(timeoutId);
1772
+ if (attempt >= maxRetries)
1773
+ throw networkError;
1774
+ await sleep(backoffDelay(attempt, initialDelayMs, maxDelayMs));
1775
+ attempt++;
1776
+ continue;
1777
+ }
1778
+ if (!RETRYABLE_STATUS.has(response2.status) || attempt >= maxRetries) {
1779
+ return response2;
1780
+ }
1781
+ const retryAfter2 = response2.headers.get("Retry-After");
1782
+ const waitMs2 = retryAfter2 ? parseRetryAfter(retryAfter2) : backoffDelay(attempt, initialDelayMs, maxDelayMs);
1783
+ await sleep(waitMs2);
1784
+ attempt++;
1785
+ continue;
1786
+ }
1787
+ let response;
1788
+ try {
1789
+ response = await fetchImpl(input, timedInit);
1790
+ } catch (networkError) {
1791
+ if (attempt >= maxRetries)
1792
+ throw networkError;
1793
+ await sleep(backoffDelay(attempt, initialDelayMs, maxDelayMs));
1794
+ attempt++;
1795
+ continue;
1796
+ }
1797
+ if (!RETRYABLE_STATUS.has(response.status) || attempt >= maxRetries) {
1798
+ return response;
1799
+ }
1800
+ const retryAfter = response.headers.get("Retry-After");
1801
+ const waitMs = retryAfter ? parseRetryAfter(retryAfter) : backoffDelay(attempt, initialDelayMs, maxDelayMs);
1802
+ await sleep(waitMs);
1803
+ attempt++;
1804
+ }
1805
+ };
1806
+ }
1807
+
1808
+ // generated/dev/errors.ts
1809
+ class NadeshikoError extends Error {
1810
+ code;
1811
+ title;
1812
+ detail;
1813
+ type;
1814
+ status;
1815
+ traceId;
1816
+ errors;
1817
+ constructor(body) {
1818
+ super(body.detail || body.title || `API error ${body.status}`);
1819
+ this.name = "NadeshikoError";
1820
+ this.code = body.code;
1821
+ this.title = body.title;
1822
+ this.detail = body.detail;
1823
+ this.type = body.type;
1824
+ this.status = body.status;
1825
+ this.traceId = body.instance;
1826
+ this.errors = body.errors;
1827
+ }
1828
+ }
1829
+
1721
1830
  // generated/dev/nadeshiko.gen.ts
1722
1831
  var environments = {
1723
1832
  LOCAL: "http://localhost:5000/api",
@@ -1732,7 +1841,8 @@ var defaultSessionTokenGetter = () => {
1732
1841
  return match ? decodeURIComponent(match[1]) : undefined;
1733
1842
  };
1734
1843
  function createNadeshikoClient(config) {
1735
- const baseUrl = config.baseUrl === undefined ? environments.PRODUCTION : (config.baseUrl in environments) ? environments[config.baseUrl] : config.baseUrl;
1844
+ const rawBaseUrl = config.baseURL ?? config.baseUrl;
1845
+ const baseUrl = rawBaseUrl === undefined ? environments.PRODUCTION : (rawBaseUrl in environments) ? environments[rawBaseUrl] : rawBaseUrl;
1736
1846
  const getApiKey = async () => {
1737
1847
  if (typeof config.apiKey === "function") {
1738
1848
  return await config.apiKey();
@@ -1742,6 +1852,7 @@ function createNadeshikoClient(config) {
1742
1852
  const getSessionToken = config.sessionToken ?? defaultSessionTokenGetter;
1743
1853
  const clientInstance = createClient(createConfig({
1744
1854
  baseUrl,
1855
+ fetch: withRetry(globalThis.fetch, config.retryOptions),
1745
1856
  auth: (auth) => {
1746
1857
  if (auth.in === "cookie") {
1747
1858
  return getSessionToken();
@@ -1749,86 +1860,93 @@ function createNadeshikoClient(config) {
1749
1860
  return getApiKey();
1750
1861
  }
1751
1862
  }));
1863
+ clientInstance.interceptors.error.use((error) => {
1864
+ if (error && typeof error === "object" && "code" in error && typeof error.code === "string") {
1865
+ return new NadeshikoError(error);
1866
+ }
1867
+ return error;
1868
+ });
1752
1869
  return {
1753
1870
  client: clientInstance,
1754
- search: (options) => search({ ...options, client: clientInstance }),
1755
- getSearchStats: (options) => getSearchStats({ ...options, client: clientInstance }),
1756
- searchWords: (options) => searchWords({ ...options, client: clientInstance }),
1757
- listMedia: (options) => listMedia({ ...options, client: clientInstance }),
1758
- getSegmentByUuid: (options) => getSegmentByUuid({ ...options, client: clientInstance }),
1759
- getSegmentContext: (options) => getSegmentContext({ ...options, client: clientInstance }),
1760
- listSeries: (options) => listSeries({ ...options, client: clientInstance }),
1761
- getSeries: (options) => getSeries({ ...options, client: clientInstance }),
1762
- getCharacter: (options) => getCharacter({ ...options, client: clientInstance }),
1763
- getSeiyuu: (options) => getSeiyuu({ ...options, client: clientInstance }),
1764
- getMedia: (options) => getMedia({ ...options, client: clientInstance }),
1765
- listEpisodes: (options) => listEpisodes({ ...options, client: clientInstance }),
1766
- getEpisode: (options) => getEpisode({ ...options, client: clientInstance }),
1767
- getSegment: (options) => getSegment({ ...options, client: clientInstance }),
1768
- createMedia: (options) => createMedia({ ...options, client: clientInstance }),
1769
- autocompleteMedia: (options) => autocompleteMedia({ ...options, client: clientInstance }),
1770
- updateSegmentByUuid: (options) => updateSegmentByUuid({ ...options, client: clientInstance }),
1771
- listSegmentRevisions: (options) => listSegmentRevisions({ ...options, client: clientInstance }),
1772
- createSeries: (options) => createSeries({ ...options, client: clientInstance }),
1773
- updateSeries: (options) => updateSeries({ ...options, client: clientInstance }),
1774
- deleteSeries: (options) => deleteSeries({ ...options, client: clientInstance }),
1775
- addMediaToSeries: (options) => addMediaToSeries({ ...options, client: clientInstance }),
1776
- updateSeriesMedia: (options) => updateSeriesMedia({ ...options, client: clientInstance }),
1777
- removeMediaFromSeries: (options) => removeMediaFromSeries({ ...options, client: clientInstance }),
1778
- updateMedia: (options) => updateMedia({ ...options, client: clientInstance }),
1779
- deleteMedia: (options) => deleteMedia({ ...options, client: clientInstance }),
1780
- createEpisode: (options) => createEpisode({ ...options, client: clientInstance }),
1781
- updateEpisode: (options) => updateEpisode({ ...options, client: clientInstance }),
1782
- deleteEpisode: (options) => deleteEpisode({ ...options, client: clientInstance }),
1783
- listSegments: (options) => listSegments({ ...options, client: clientInstance }),
1784
- createSegment: (options) => createSegment({ ...options, client: clientInstance }),
1785
- createSegmentsBatch: (options) => createSegmentsBatch({ ...options, client: clientInstance }),
1786
- updateSegment: (options) => updateSegment({ ...options, client: clientInstance }),
1787
- deleteSegment: (options) => deleteSegment({ ...options, client: clientInstance }),
1788
- getUserQuota: (options) => getUserQuota({ ...options, client: clientInstance }),
1789
- createUserReport: (options) => createUserReport({ ...options, client: clientInstance }),
1790
- getUserPreferences: (options) => getUserPreferences({ ...options, client: clientInstance }),
1791
- updateUserPreferences: (options) => updateUserPreferences({ ...options, client: clientInstance }),
1792
- listUserActivity: (options) => listUserActivity({ ...options, client: clientInstance }),
1793
- trackUserActivity: (options) => trackUserActivity({ ...options, client: clientInstance }),
1794
- deleteUserActivity: (options) => deleteUserActivity({ ...options, client: clientInstance }),
1795
- getUserActivityHeatmap: (options) => getUserActivityHeatmap({ ...options, client: clientInstance }),
1796
- getUserActivityStats: (options) => getUserActivityStats({ ...options, client: clientInstance }),
1797
- deleteUserActivityByDate: (options) => deleteUserActivityByDate({ ...options, client: clientInstance }),
1798
- deleteUserActivityById: (options) => deleteUserActivityById({ ...options, client: clientInstance }),
1799
- exportUserData: (options) => exportUserData({ ...options, client: clientInstance }),
1800
- listUserLabs: (options) => listUserLabs({ ...options, client: clientInstance }),
1801
- enrollUserLab: (options) => enrollUserLab({ ...options, client: clientInstance }),
1802
- unenrollUserLab: (options) => unenrollUserLab({ ...options, client: clientInstance }),
1803
- listCollections: (options) => listCollections({ ...options, client: clientInstance }),
1804
- createCollection: (options) => createCollection({ ...options, client: clientInstance }),
1805
- getCollection: (options) => getCollection({ ...options, client: clientInstance }),
1806
- updateCollection: (options) => updateCollection({ ...options, client: clientInstance }),
1807
- deleteCollection: (options) => deleteCollection({ ...options, client: clientInstance }),
1808
- addSegmentToCollection: (options) => addSegmentToCollection({ ...options, client: clientInstance }),
1809
- updateCollectionSegment: (options) => updateCollectionSegment({ ...options, client: clientInstance }),
1810
- removeSegmentFromCollection: (options) => removeSegmentFromCollection({ ...options, client: clientInstance }),
1811
- searchCollectionSegments: (options) => searchCollectionSegments({ ...options, client: clientInstance }),
1812
- getCollectionStats: (options) => getCollectionStats({ ...options, client: clientInstance }),
1813
- getAdminDashboard: (options) => getAdminDashboard({ ...options, client: clientInstance }),
1814
- getAdminHealth: (options) => getAdminHealth({ ...options, client: clientInstance }),
1815
- triggerReindex: (options) => triggerReindex({ ...options, client: clientInstance }),
1816
- listAdminQueueStats: (options) => listAdminQueueStats({ ...options, client: clientInstance }),
1817
- getAdminQueue: (options) => getAdminQueue({ ...options, client: clientInstance }),
1818
- listAdminQueueFailed: (options) => listAdminQueueFailed({ ...options, client: clientInstance }),
1819
- retryAdminQueueFailed: (options) => retryAdminQueueFailed({ ...options, client: clientInstance }),
1820
- purgeAdminQueueFailed: (options) => purgeAdminQueueFailed({ ...options, client: clientInstance }),
1821
- impersonateAdminUser: (options) => impersonateAdminUser({ ...options, client: clientInstance }),
1822
- clearAdminImpersonation: (options) => clearAdminImpersonation({ ...options, client: clientInstance }),
1823
- listAdminReports: (options) => listAdminReports({ ...options, client: clientInstance }),
1824
- updateAdminReport: (options) => updateAdminReport({ ...options, client: clientInstance }),
1825
- listAdminMediaAudits: (options) => listAdminMediaAudits({ ...options, client: clientInstance }),
1826
- updateAdminMediaAudit: (options) => updateAdminMediaAudit({ ...options, client: clientInstance }),
1827
- runAdminMediaAudit: (options) => runAdminMediaAudit({ ...options, client: clientInstance }),
1828
- listAdminMediaAuditRuns: (options) => listAdminMediaAuditRuns({ ...options, client: clientInstance }),
1829
- getAdminMediaAuditRun: (options) => getAdminMediaAuditRun({ ...options, client: clientInstance }),
1830
- getAnnouncement: (options) => getAnnouncement({ ...options, client: clientInstance }),
1831
- updateAnnouncement: (options) => updateAnnouncement({ ...options, client: clientInstance })
1871
+ search: (options) => search({ throwOnError: true, ...options, client: clientInstance }),
1872
+ getSearchStats: (options) => getSearchStats({ throwOnError: true, ...options, client: clientInstance }),
1873
+ searchWords: (options) => searchWords({ throwOnError: true, ...options, client: clientInstance }),
1874
+ listMedia: (options) => listMedia({ throwOnError: true, ...options, client: clientInstance }),
1875
+ getSegmentByUuid: (options) => getSegmentByUuid({ throwOnError: true, ...options, client: clientInstance }),
1876
+ getSegmentContext: (options) => getSegmentContext({ throwOnError: true, ...options, client: clientInstance }),
1877
+ listSeries: (options) => listSeries({ throwOnError: true, ...options, client: clientInstance }),
1878
+ getSeries: (options) => getSeries({ throwOnError: true, ...options, client: clientInstance }),
1879
+ getCharacter: (options) => getCharacter({ throwOnError: true, ...options, client: clientInstance }),
1880
+ getSeiyuu: (options) => getSeiyuu({ throwOnError: true, ...options, client: clientInstance }),
1881
+ getMedia: (options) => getMedia({ throwOnError: true, ...options, client: clientInstance }),
1882
+ listEpisodes: (options) => listEpisodes({ throwOnError: true, ...options, client: clientInstance }),
1883
+ getEpisode: (options) => getEpisode({ throwOnError: true, ...options, client: clientInstance }),
1884
+ getSegment: (options) => getSegment({ throwOnError: true, ...options, client: clientInstance }),
1885
+ createMedia: (options) => createMedia({ throwOnError: true, ...options, client: clientInstance }),
1886
+ autocompleteMedia: (options) => autocompleteMedia({ throwOnError: true, ...options, client: clientInstance }),
1887
+ updateSegmentByUuid: (options) => updateSegmentByUuid({ throwOnError: true, ...options, client: clientInstance }),
1888
+ listSegmentRevisions: (options) => listSegmentRevisions({ throwOnError: true, ...options, client: clientInstance }),
1889
+ createSeries: (options) => createSeries({ throwOnError: true, ...options, client: clientInstance }),
1890
+ updateSeries: (options) => updateSeries({ throwOnError: true, ...options, client: clientInstance }),
1891
+ deleteSeries: (options) => deleteSeries({ throwOnError: true, ...options, client: clientInstance }),
1892
+ addMediaToSeries: (options) => addMediaToSeries({ throwOnError: true, ...options, client: clientInstance }),
1893
+ updateSeriesMedia: (options) => updateSeriesMedia({ throwOnError: true, ...options, client: clientInstance }),
1894
+ removeMediaFromSeries: (options) => removeMediaFromSeries({ throwOnError: true, ...options, client: clientInstance }),
1895
+ updateMedia: (options) => updateMedia({ throwOnError: true, ...options, client: clientInstance }),
1896
+ deleteMedia: (options) => deleteMedia({ throwOnError: true, ...options, client: clientInstance }),
1897
+ createEpisode: (options) => createEpisode({ throwOnError: true, ...options, client: clientInstance }),
1898
+ updateEpisode: (options) => updateEpisode({ throwOnError: true, ...options, client: clientInstance }),
1899
+ deleteEpisode: (options) => deleteEpisode({ throwOnError: true, ...options, client: clientInstance }),
1900
+ listSegments: (options) => listSegments({ throwOnError: true, ...options, client: clientInstance }),
1901
+ createSegment: (options) => createSegment({ throwOnError: true, ...options, client: clientInstance }),
1902
+ createSegmentsBatch: (options) => createSegmentsBatch({ throwOnError: true, ...options, client: clientInstance }),
1903
+ updateSegment: (options) => updateSegment({ throwOnError: true, ...options, client: clientInstance }),
1904
+ deleteSegment: (options) => deleteSegment({ throwOnError: true, ...options, client: clientInstance }),
1905
+ getUserQuota: (options) => getUserQuota({ throwOnError: true, ...options, client: clientInstance }),
1906
+ createUserReport: (options) => createUserReport({ throwOnError: true, ...options, client: clientInstance }),
1907
+ getUserPreferences: (options) => getUserPreferences({ throwOnError: true, ...options, client: clientInstance }),
1908
+ updateUserPreferences: (options) => updateUserPreferences({ throwOnError: true, ...options, client: clientInstance }),
1909
+ listUserActivity: (options) => listUserActivity({ throwOnError: true, ...options, client: clientInstance }),
1910
+ trackUserActivity: (options) => trackUserActivity({ throwOnError: true, ...options, client: clientInstance }),
1911
+ deleteUserActivity: (options) => deleteUserActivity({ throwOnError: true, ...options, client: clientInstance }),
1912
+ getUserActivityHeatmap: (options) => getUserActivityHeatmap({ throwOnError: true, ...options, client: clientInstance }),
1913
+ getUserActivityStats: (options) => getUserActivityStats({ throwOnError: true, ...options, client: clientInstance }),
1914
+ deleteUserActivityByDate: (options) => deleteUserActivityByDate({ throwOnError: true, ...options, client: clientInstance }),
1915
+ deleteUserActivityById: (options) => deleteUserActivityById({ throwOnError: true, ...options, client: clientInstance }),
1916
+ exportUserData: (options) => exportUserData({ throwOnError: true, ...options, client: clientInstance }),
1917
+ listUserLabs: (options) => listUserLabs({ throwOnError: true, ...options, client: clientInstance }),
1918
+ enrollUserLab: (options) => enrollUserLab({ throwOnError: true, ...options, client: clientInstance }),
1919
+ unenrollUserLab: (options) => unenrollUserLab({ throwOnError: true, ...options, client: clientInstance }),
1920
+ listCollections: (options) => listCollections({ throwOnError: true, ...options, client: clientInstance }),
1921
+ createCollection: (options) => createCollection({ throwOnError: true, ...options, client: clientInstance }),
1922
+ getCollection: (options) => getCollection({ throwOnError: true, ...options, client: clientInstance }),
1923
+ updateCollection: (options) => updateCollection({ throwOnError: true, ...options, client: clientInstance }),
1924
+ deleteCollection: (options) => deleteCollection({ throwOnError: true, ...options, client: clientInstance }),
1925
+ addSegmentToCollection: (options) => addSegmentToCollection({ throwOnError: true, ...options, client: clientInstance }),
1926
+ updateCollectionSegment: (options) => updateCollectionSegment({ throwOnError: true, ...options, client: clientInstance }),
1927
+ removeSegmentFromCollection: (options) => removeSegmentFromCollection({ throwOnError: true, ...options, client: clientInstance }),
1928
+ searchCollectionSegments: (options) => searchCollectionSegments({ throwOnError: true, ...options, client: clientInstance }),
1929
+ getCollectionStats: (options) => getCollectionStats({ throwOnError: true, ...options, client: clientInstance }),
1930
+ getAdminDashboard: (options) => getAdminDashboard({ throwOnError: true, ...options, client: clientInstance }),
1931
+ getAdminHealth: (options) => getAdminHealth({ throwOnError: true, ...options, client: clientInstance }),
1932
+ triggerReindex: (options) => triggerReindex({ throwOnError: true, ...options, client: clientInstance }),
1933
+ listAdminQueueStats: (options) => listAdminQueueStats({ throwOnError: true, ...options, client: clientInstance }),
1934
+ getAdminQueue: (options) => getAdminQueue({ throwOnError: true, ...options, client: clientInstance }),
1935
+ listAdminQueueFailed: (options) => listAdminQueueFailed({ throwOnError: true, ...options, client: clientInstance }),
1936
+ retryAdminQueueFailed: (options) => retryAdminQueueFailed({ throwOnError: true, ...options, client: clientInstance }),
1937
+ purgeAdminQueueFailed: (options) => purgeAdminQueueFailed({ throwOnError: true, ...options, client: clientInstance }),
1938
+ impersonateAdminUser: (options) => impersonateAdminUser({ throwOnError: true, ...options, client: clientInstance }),
1939
+ clearAdminImpersonation: (options) => clearAdminImpersonation({ throwOnError: true, ...options, client: clientInstance }),
1940
+ listAdminReports: (options) => listAdminReports({ throwOnError: true, ...options, client: clientInstance }),
1941
+ batchUpdateAdminReports: (options) => batchUpdateAdminReports({ throwOnError: true, ...options, client: clientInstance }),
1942
+ updateAdminReport: (options) => updateAdminReport({ throwOnError: true, ...options, client: clientInstance }),
1943
+ listAdminMediaAudits: (options) => listAdminMediaAudits({ throwOnError: true, ...options, client: clientInstance }),
1944
+ updateAdminMediaAudit: (options) => updateAdminMediaAudit({ throwOnError: true, ...options, client: clientInstance }),
1945
+ runAdminMediaAudit: (options) => runAdminMediaAudit({ throwOnError: true, ...options, client: clientInstance }),
1946
+ listAdminMediaAuditRuns: (options) => listAdminMediaAuditRuns({ throwOnError: true, ...options, client: clientInstance }),
1947
+ getAdminMediaAuditRun: (options) => getAdminMediaAuditRun({ throwOnError: true, ...options, client: clientInstance }),
1948
+ getAnnouncement: (options) => getAnnouncement({ throwOnError: true, ...options, client: clientInstance }),
1949
+ updateAnnouncement: (options) => updateAnnouncement({ throwOnError: true, ...options, client: clientInstance })
1832
1950
  };
1833
1951
  }
1834
1952
  // generated/dev/internal/media.gen.ts
@@ -1909,8 +2027,38 @@ __export(exports_admin_gen, {
1909
2027
  getAdminMediaAuditRun: () => getAdminMediaAuditRun,
1910
2028
  getAdminHealth: () => getAdminHealth,
1911
2029
  getAdminDashboard: () => getAdminDashboard,
1912
- clearAdminImpersonation: () => clearAdminImpersonation
1913
- });
2030
+ clearAdminImpersonation: () => clearAdminImpersonation,
2031
+ batchUpdateAdminReports: () => batchUpdateAdminReports
2032
+ });
2033
+ // generated/dev/paginate.ts
2034
+ async function* paginate(fn, options, extract) {
2035
+ let cursor = null;
2036
+ let first = true;
2037
+ while (true) {
2038
+ const callOptions = first ? options : patchCursor(options, cursor);
2039
+ first = false;
2040
+ const result = await fn(callOptions);
2041
+ if ("error" in result && result.error !== undefined) {
2042
+ throw result.error;
2043
+ }
2044
+ const { items, pagination } = extract(result.data);
2045
+ for (const item of items) {
2046
+ yield item;
2047
+ }
2048
+ if (!pagination.hasMore || pagination.cursor === null)
2049
+ break;
2050
+ cursor = pagination.cursor;
2051
+ }
2052
+ }
2053
+ function patchCursor(options, cursor) {
2054
+ if (options.body !== undefined) {
2055
+ return { ...options, body: { ...options.body, cursor } };
2056
+ }
2057
+ if (options.query !== undefined) {
2058
+ return { ...options, query: { ...options.query, cursor } };
2059
+ }
2060
+ return { ...options, body: { cursor } };
2061
+ }
1914
2062
 
1915
- //# debugId=8ABA5B3A395A47F564756E2164756E21
2063
+ //# debugId=76BC49C38AFCB35B64756E2164756E21
1916
2064
  //# sourceMappingURL=index.js.map