@brigadasos/nadeshiko-sdk 1.5.1-dev.e889ab8 → 2.0.0-dev.384ecdc

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../generated/dev/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,cAAc,EAAE,cAAc,EAAE,mBAAmB,EAAE,aAAa,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,eAAe,EAAE,kBAAkB,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAGx7C,OAAO,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGpG,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGtC,cAAc,gBAAgB,CAAC;AAG/B,cAAc,aAAa,CAAC;AAC5B,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../generated/dev/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,cAAc,EAAE,cAAc,EAAE,mBAAmB,EAAE,aAAa,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,eAAe,EAAE,kBAAkB,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAGx7C,OAAO,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGpG,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGtC,cAAc,gBAAgB,CAAC;AAG/B,cAAc,aAAa,CAAC;AAC5B,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAG/C,OAAO,EAAE,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,KAAK,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,MAAM,UAAU,CAAC"}
package/dist/index.js CHANGED
@@ -1618,6 +1618,98 @@ var updateAnnouncement = (options) => (options.client ?? client).put({
1618
1618
  ...options.headers
1619
1619
  }
1620
1620
  });
1621
+ // generated/dev/retry.ts
1622
+ var RETRYABLE_STATUS = new Set([408, 429, 500, 502, 503, 504]);
1623
+ function parseRetryAfter(value) {
1624
+ const seconds = Number(value);
1625
+ if (!Number.isNaN(seconds))
1626
+ return seconds * 1000;
1627
+ const date = new Date(value);
1628
+ if (!Number.isNaN(date.getTime()))
1629
+ return Math.max(0, date.getTime() - Date.now());
1630
+ return 1000;
1631
+ }
1632
+ function backoffDelay(attempt, initial, max) {
1633
+ const jitter = Math.random() * 100;
1634
+ return Math.min(initial * 2 ** attempt + jitter, max);
1635
+ }
1636
+ function sleep(ms) {
1637
+ return new Promise((resolve) => setTimeout(resolve, ms));
1638
+ }
1639
+ function withRetry(fetchImpl = globalThis.fetch, options = {}) {
1640
+ const { maxRetries = 2, initialDelayMs = 500, maxDelayMs = 30000, timeout } = options;
1641
+ return async function retryingFetch(input, init) {
1642
+ let attempt = 0;
1643
+ while (true) {
1644
+ let timedInit = init;
1645
+ if (timeout !== undefined && !init?.signal) {
1646
+ const controller = new AbortController;
1647
+ const timeoutId = setTimeout(() => controller.abort(new Error(`Request timed out after ${timeout}ms`)), timeout);
1648
+ timedInit = { ...init, signal: controller.signal };
1649
+ let response2;
1650
+ try {
1651
+ response2 = await fetchImpl(input, timedInit);
1652
+ clearTimeout(timeoutId);
1653
+ } catch (networkError) {
1654
+ clearTimeout(timeoutId);
1655
+ if (attempt >= maxRetries)
1656
+ throw networkError;
1657
+ await sleep(backoffDelay(attempt, initialDelayMs, maxDelayMs));
1658
+ attempt++;
1659
+ continue;
1660
+ }
1661
+ if (!RETRYABLE_STATUS.has(response2.status) || attempt >= maxRetries) {
1662
+ return response2;
1663
+ }
1664
+ const retryAfter2 = response2.headers.get("Retry-After");
1665
+ const waitMs2 = retryAfter2 ? parseRetryAfter(retryAfter2) : backoffDelay(attempt, initialDelayMs, maxDelayMs);
1666
+ await sleep(waitMs2);
1667
+ attempt++;
1668
+ continue;
1669
+ }
1670
+ let response;
1671
+ try {
1672
+ response = await fetchImpl(input, timedInit);
1673
+ } catch (networkError) {
1674
+ if (attempt >= maxRetries)
1675
+ throw networkError;
1676
+ await sleep(backoffDelay(attempt, initialDelayMs, maxDelayMs));
1677
+ attempt++;
1678
+ continue;
1679
+ }
1680
+ if (!RETRYABLE_STATUS.has(response.status) || attempt >= maxRetries) {
1681
+ return response;
1682
+ }
1683
+ const retryAfter = response.headers.get("Retry-After");
1684
+ const waitMs = retryAfter ? parseRetryAfter(retryAfter) : backoffDelay(attempt, initialDelayMs, maxDelayMs);
1685
+ await sleep(waitMs);
1686
+ attempt++;
1687
+ }
1688
+ };
1689
+ }
1690
+
1691
+ // generated/dev/errors.ts
1692
+ class NadeshikoError extends Error {
1693
+ code;
1694
+ title;
1695
+ detail;
1696
+ type;
1697
+ status;
1698
+ traceId;
1699
+ errors;
1700
+ constructor(body) {
1701
+ super(body.detail || body.title || `API error ${body.status}`);
1702
+ this.name = "NadeshikoError";
1703
+ this.code = body.code;
1704
+ this.title = body.title;
1705
+ this.detail = body.detail;
1706
+ this.type = body.type;
1707
+ this.status = body.status;
1708
+ this.traceId = body.instance;
1709
+ this.errors = body.errors;
1710
+ }
1711
+ }
1712
+
1621
1713
  // generated/dev/nadeshiko.gen.ts
1622
1714
  var environments = {
1623
1715
  LOCAL: "http://localhost:5000/api",
@@ -1632,7 +1724,8 @@ var defaultSessionTokenGetter = () => {
1632
1724
  return match ? decodeURIComponent(match[1]) : undefined;
1633
1725
  };
1634
1726
  function createNadeshikoClient(config) {
1635
- const baseUrl = config.baseUrl === undefined ? environments.PRODUCTION : (config.baseUrl in environments) ? environments[config.baseUrl] : config.baseUrl;
1727
+ const rawBaseUrl = config.baseURL ?? config.baseUrl;
1728
+ const baseUrl = rawBaseUrl === undefined ? environments.PRODUCTION : (rawBaseUrl in environments) ? environments[rawBaseUrl] : rawBaseUrl;
1636
1729
  const getApiKey = async () => {
1637
1730
  if (typeof config.apiKey === "function") {
1638
1731
  return await config.apiKey();
@@ -1642,6 +1735,7 @@ function createNadeshikoClient(config) {
1642
1735
  const getSessionToken = config.sessionToken ?? defaultSessionTokenGetter;
1643
1736
  const clientInstance = createClient(createConfig({
1644
1737
  baseUrl,
1738
+ fetch: withRetry(globalThis.fetch, config.retryOptions),
1645
1739
  auth: (auth) => {
1646
1740
  if (auth.in === "cookie") {
1647
1741
  return getSessionToken();
@@ -1649,87 +1743,93 @@ function createNadeshikoClient(config) {
1649
1743
  return getApiKey();
1650
1744
  }
1651
1745
  }));
1746
+ clientInstance.interceptors.error.use((error) => {
1747
+ if (error && typeof error === "object" && "code" in error && typeof error.code === "string") {
1748
+ return new NadeshikoError(error);
1749
+ }
1750
+ return error;
1751
+ });
1652
1752
  return {
1653
1753
  client: clientInstance,
1654
- search: (options) => search({ ...options, client: clientInstance }),
1655
- getSearchStats: (options) => getSearchStats({ ...options, client: clientInstance }),
1656
- searchWords: (options) => searchWords({ ...options, client: clientInstance }),
1657
- listMedia: (options) => listMedia({ ...options, client: clientInstance }),
1658
- getSegmentByUuid: (options) => getSegmentByUuid({ ...options, client: clientInstance }),
1659
- getSegmentContext: (options) => getSegmentContext({ ...options, client: clientInstance }),
1660
- listSeries: (options) => listSeries({ ...options, client: clientInstance }),
1661
- getSeries: (options) => getSeries({ ...options, client: clientInstance }),
1662
- getCharacter: (options) => getCharacter({ ...options, client: clientInstance }),
1663
- getSeiyuu: (options) => getSeiyuu({ ...options, client: clientInstance }),
1664
- getMedia: (options) => getMedia({ ...options, client: clientInstance }),
1665
- listEpisodes: (options) => listEpisodes({ ...options, client: clientInstance }),
1666
- getEpisode: (options) => getEpisode({ ...options, client: clientInstance }),
1667
- getSegment: (options) => getSegment({ ...options, client: clientInstance }),
1668
- createMedia: (options) => createMedia({ ...options, client: clientInstance }),
1669
- autocompleteMedia: (options) => autocompleteMedia({ ...options, client: clientInstance }),
1670
- updateSegmentByUuid: (options) => updateSegmentByUuid({ ...options, client: clientInstance }),
1671
- listSegmentRevisions: (options) => listSegmentRevisions({ ...options, client: clientInstance }),
1672
- createSeries: (options) => createSeries({ ...options, client: clientInstance }),
1673
- updateSeries: (options) => updateSeries({ ...options, client: clientInstance }),
1674
- deleteSeries: (options) => deleteSeries({ ...options, client: clientInstance }),
1675
- addMediaToSeries: (options) => addMediaToSeries({ ...options, client: clientInstance }),
1676
- updateSeriesMedia: (options) => updateSeriesMedia({ ...options, client: clientInstance }),
1677
- removeMediaFromSeries: (options) => removeMediaFromSeries({ ...options, client: clientInstance }),
1678
- updateMedia: (options) => updateMedia({ ...options, client: clientInstance }),
1679
- deleteMedia: (options) => deleteMedia({ ...options, client: clientInstance }),
1680
- createEpisode: (options) => createEpisode({ ...options, client: clientInstance }),
1681
- updateEpisode: (options) => updateEpisode({ ...options, client: clientInstance }),
1682
- deleteEpisode: (options) => deleteEpisode({ ...options, client: clientInstance }),
1683
- listSegments: (options) => listSegments({ ...options, client: clientInstance }),
1684
- createSegment: (options) => createSegment({ ...options, client: clientInstance }),
1685
- createSegmentsBatch: (options) => createSegmentsBatch({ ...options, client: clientInstance }),
1686
- updateSegment: (options) => updateSegment({ ...options, client: clientInstance }),
1687
- deleteSegment: (options) => deleteSegment({ ...options, client: clientInstance }),
1688
- getUserQuota: (options) => getUserQuota({ ...options, client: clientInstance }),
1689
- createUserReport: (options) => createUserReport({ ...options, client: clientInstance }),
1690
- getUserPreferences: (options) => getUserPreferences({ ...options, client: clientInstance }),
1691
- updateUserPreferences: (options) => updateUserPreferences({ ...options, client: clientInstance }),
1692
- listUserActivity: (options) => listUserActivity({ ...options, client: clientInstance }),
1693
- trackUserActivity: (options) => trackUserActivity({ ...options, client: clientInstance }),
1694
- deleteUserActivity: (options) => deleteUserActivity({ ...options, client: clientInstance }),
1695
- getUserActivityHeatmap: (options) => getUserActivityHeatmap({ ...options, client: clientInstance }),
1696
- getUserActivityStats: (options) => getUserActivityStats({ ...options, client: clientInstance }),
1697
- deleteUserActivityByDate: (options) => deleteUserActivityByDate({ ...options, client: clientInstance }),
1698
- deleteUserActivityById: (options) => deleteUserActivityById({ ...options, client: clientInstance }),
1699
- exportUserData: (options) => exportUserData({ ...options, client: clientInstance }),
1700
- listUserLabs: (options) => listUserLabs({ ...options, client: clientInstance }),
1701
- enrollUserLab: (options) => enrollUserLab({ ...options, client: clientInstance }),
1702
- unenrollUserLab: (options) => unenrollUserLab({ ...options, client: clientInstance }),
1703
- listCollections: (options) => listCollections({ ...options, client: clientInstance }),
1704
- createCollection: (options) => createCollection({ ...options, client: clientInstance }),
1705
- getCollection: (options) => getCollection({ ...options, client: clientInstance }),
1706
- updateCollection: (options) => updateCollection({ ...options, client: clientInstance }),
1707
- deleteCollection: (options) => deleteCollection({ ...options, client: clientInstance }),
1708
- addSegmentToCollection: (options) => addSegmentToCollection({ ...options, client: clientInstance }),
1709
- updateCollectionSegment: (options) => updateCollectionSegment({ ...options, client: clientInstance }),
1710
- removeSegmentFromCollection: (options) => removeSegmentFromCollection({ ...options, client: clientInstance }),
1711
- searchCollectionSegments: (options) => searchCollectionSegments({ ...options, client: clientInstance }),
1712
- getCollectionStats: (options) => getCollectionStats({ ...options, client: clientInstance }),
1713
- getAdminDashboard: (options) => getAdminDashboard({ ...options, client: clientInstance }),
1714
- getAdminHealth: (options) => getAdminHealth({ ...options, client: clientInstance }),
1715
- triggerReindex: (options) => triggerReindex({ ...options, client: clientInstance }),
1716
- listAdminQueueStats: (options) => listAdminQueueStats({ ...options, client: clientInstance }),
1717
- getAdminQueue: (options) => getAdminQueue({ ...options, client: clientInstance }),
1718
- listAdminQueueFailed: (options) => listAdminQueueFailed({ ...options, client: clientInstance }),
1719
- retryAdminQueueFailed: (options) => retryAdminQueueFailed({ ...options, client: clientInstance }),
1720
- purgeAdminQueueFailed: (options) => purgeAdminQueueFailed({ ...options, client: clientInstance }),
1721
- impersonateAdminUser: (options) => impersonateAdminUser({ ...options, client: clientInstance }),
1722
- clearAdminImpersonation: (options) => clearAdminImpersonation({ ...options, client: clientInstance }),
1723
- listAdminReports: (options) => listAdminReports({ ...options, client: clientInstance }),
1724
- batchUpdateAdminReports: (options) => batchUpdateAdminReports({ ...options, client: clientInstance }),
1725
- updateAdminReport: (options) => updateAdminReport({ ...options, client: clientInstance }),
1726
- listAdminMediaAudits: (options) => listAdminMediaAudits({ ...options, client: clientInstance }),
1727
- updateAdminMediaAudit: (options) => updateAdminMediaAudit({ ...options, client: clientInstance }),
1728
- runAdminMediaAudit: (options) => runAdminMediaAudit({ ...options, client: clientInstance }),
1729
- listAdminMediaAuditRuns: (options) => listAdminMediaAuditRuns({ ...options, client: clientInstance }),
1730
- getAdminMediaAuditRun: (options) => getAdminMediaAuditRun({ ...options, client: clientInstance }),
1731
- getAnnouncement: (options) => getAnnouncement({ ...options, client: clientInstance }),
1732
- updateAnnouncement: (options) => updateAnnouncement({ ...options, client: clientInstance })
1754
+ search: (options) => search({ throwOnError: true, ...options, client: clientInstance }),
1755
+ getSearchStats: (options) => getSearchStats({ throwOnError: true, ...options, client: clientInstance }),
1756
+ searchWords: (options) => searchWords({ throwOnError: true, ...options, client: clientInstance }),
1757
+ listMedia: (options) => listMedia({ throwOnError: true, ...options, client: clientInstance }),
1758
+ getSegmentByUuid: (options) => getSegmentByUuid({ throwOnError: true, ...options, client: clientInstance }),
1759
+ getSegmentContext: (options) => getSegmentContext({ throwOnError: true, ...options, client: clientInstance }),
1760
+ listSeries: (options) => listSeries({ throwOnError: true, ...options, client: clientInstance }),
1761
+ getSeries: (options) => getSeries({ throwOnError: true, ...options, client: clientInstance }),
1762
+ getCharacter: (options) => getCharacter({ throwOnError: true, ...options, client: clientInstance }),
1763
+ getSeiyuu: (options) => getSeiyuu({ throwOnError: true, ...options, client: clientInstance }),
1764
+ getMedia: (options) => getMedia({ throwOnError: true, ...options, client: clientInstance }),
1765
+ listEpisodes: (options) => listEpisodes({ throwOnError: true, ...options, client: clientInstance }),
1766
+ getEpisode: (options) => getEpisode({ throwOnError: true, ...options, client: clientInstance }),
1767
+ getSegment: (options) => getSegment({ throwOnError: true, ...options, client: clientInstance }),
1768
+ createMedia: (options) => createMedia({ throwOnError: true, ...options, client: clientInstance }),
1769
+ autocompleteMedia: (options) => autocompleteMedia({ throwOnError: true, ...options, client: clientInstance }),
1770
+ updateSegmentByUuid: (options) => updateSegmentByUuid({ throwOnError: true, ...options, client: clientInstance }),
1771
+ listSegmentRevisions: (options) => listSegmentRevisions({ throwOnError: true, ...options, client: clientInstance }),
1772
+ createSeries: (options) => createSeries({ throwOnError: true, ...options, client: clientInstance }),
1773
+ updateSeries: (options) => updateSeries({ throwOnError: true, ...options, client: clientInstance }),
1774
+ deleteSeries: (options) => deleteSeries({ throwOnError: true, ...options, client: clientInstance }),
1775
+ addMediaToSeries: (options) => addMediaToSeries({ throwOnError: true, ...options, client: clientInstance }),
1776
+ updateSeriesMedia: (options) => updateSeriesMedia({ throwOnError: true, ...options, client: clientInstance }),
1777
+ removeMediaFromSeries: (options) => removeMediaFromSeries({ throwOnError: true, ...options, client: clientInstance }),
1778
+ updateMedia: (options) => updateMedia({ throwOnError: true, ...options, client: clientInstance }),
1779
+ deleteMedia: (options) => deleteMedia({ throwOnError: true, ...options, client: clientInstance }),
1780
+ createEpisode: (options) => createEpisode({ throwOnError: true, ...options, client: clientInstance }),
1781
+ updateEpisode: (options) => updateEpisode({ throwOnError: true, ...options, client: clientInstance }),
1782
+ deleteEpisode: (options) => deleteEpisode({ throwOnError: true, ...options, client: clientInstance }),
1783
+ listSegments: (options) => listSegments({ throwOnError: true, ...options, client: clientInstance }),
1784
+ createSegment: (options) => createSegment({ throwOnError: true, ...options, client: clientInstance }),
1785
+ createSegmentsBatch: (options) => createSegmentsBatch({ throwOnError: true, ...options, client: clientInstance }),
1786
+ updateSegment: (options) => updateSegment({ throwOnError: true, ...options, client: clientInstance }),
1787
+ deleteSegment: (options) => deleteSegment({ throwOnError: true, ...options, client: clientInstance }),
1788
+ getUserQuota: (options) => getUserQuota({ throwOnError: true, ...options, client: clientInstance }),
1789
+ createUserReport: (options) => createUserReport({ throwOnError: true, ...options, client: clientInstance }),
1790
+ getUserPreferences: (options) => getUserPreferences({ throwOnError: true, ...options, client: clientInstance }),
1791
+ updateUserPreferences: (options) => updateUserPreferences({ throwOnError: true, ...options, client: clientInstance }),
1792
+ listUserActivity: (options) => listUserActivity({ throwOnError: true, ...options, client: clientInstance }),
1793
+ trackUserActivity: (options) => trackUserActivity({ throwOnError: true, ...options, client: clientInstance }),
1794
+ deleteUserActivity: (options) => deleteUserActivity({ throwOnError: true, ...options, client: clientInstance }),
1795
+ getUserActivityHeatmap: (options) => getUserActivityHeatmap({ throwOnError: true, ...options, client: clientInstance }),
1796
+ getUserActivityStats: (options) => getUserActivityStats({ throwOnError: true, ...options, client: clientInstance }),
1797
+ deleteUserActivityByDate: (options) => deleteUserActivityByDate({ throwOnError: true, ...options, client: clientInstance }),
1798
+ deleteUserActivityById: (options) => deleteUserActivityById({ throwOnError: true, ...options, client: clientInstance }),
1799
+ exportUserData: (options) => exportUserData({ throwOnError: true, ...options, client: clientInstance }),
1800
+ listUserLabs: (options) => listUserLabs({ throwOnError: true, ...options, client: clientInstance }),
1801
+ enrollUserLab: (options) => enrollUserLab({ throwOnError: true, ...options, client: clientInstance }),
1802
+ unenrollUserLab: (options) => unenrollUserLab({ throwOnError: true, ...options, client: clientInstance }),
1803
+ listCollections: (options) => listCollections({ throwOnError: true, ...options, client: clientInstance }),
1804
+ createCollection: (options) => createCollection({ throwOnError: true, ...options, client: clientInstance }),
1805
+ getCollection: (options) => getCollection({ throwOnError: true, ...options, client: clientInstance }),
1806
+ updateCollection: (options) => updateCollection({ throwOnError: true, ...options, client: clientInstance }),
1807
+ deleteCollection: (options) => deleteCollection({ throwOnError: true, ...options, client: clientInstance }),
1808
+ addSegmentToCollection: (options) => addSegmentToCollection({ throwOnError: true, ...options, client: clientInstance }),
1809
+ updateCollectionSegment: (options) => updateCollectionSegment({ throwOnError: true, ...options, client: clientInstance }),
1810
+ removeSegmentFromCollection: (options) => removeSegmentFromCollection({ throwOnError: true, ...options, client: clientInstance }),
1811
+ searchCollectionSegments: (options) => searchCollectionSegments({ throwOnError: true, ...options, client: clientInstance }),
1812
+ getCollectionStats: (options) => getCollectionStats({ throwOnError: true, ...options, client: clientInstance }),
1813
+ getAdminDashboard: (options) => getAdminDashboard({ throwOnError: true, ...options, client: clientInstance }),
1814
+ getAdminHealth: (options) => getAdminHealth({ throwOnError: true, ...options, client: clientInstance }),
1815
+ triggerReindex: (options) => triggerReindex({ throwOnError: true, ...options, client: clientInstance }),
1816
+ listAdminQueueStats: (options) => listAdminQueueStats({ throwOnError: true, ...options, client: clientInstance }),
1817
+ getAdminQueue: (options) => getAdminQueue({ throwOnError: true, ...options, client: clientInstance }),
1818
+ listAdminQueueFailed: (options) => listAdminQueueFailed({ throwOnError: true, ...options, client: clientInstance }),
1819
+ retryAdminQueueFailed: (options) => retryAdminQueueFailed({ throwOnError: true, ...options, client: clientInstance }),
1820
+ purgeAdminQueueFailed: (options) => purgeAdminQueueFailed({ throwOnError: true, ...options, client: clientInstance }),
1821
+ impersonateAdminUser: (options) => impersonateAdminUser({ throwOnError: true, ...options, client: clientInstance }),
1822
+ clearAdminImpersonation: (options) => clearAdminImpersonation({ throwOnError: true, ...options, client: clientInstance }),
1823
+ listAdminReports: (options) => listAdminReports({ throwOnError: true, ...options, client: clientInstance }),
1824
+ batchUpdateAdminReports: (options) => batchUpdateAdminReports({ throwOnError: true, ...options, client: clientInstance }),
1825
+ updateAdminReport: (options) => updateAdminReport({ throwOnError: true, ...options, client: clientInstance }),
1826
+ listAdminMediaAudits: (options) => listAdminMediaAudits({ throwOnError: true, ...options, client: clientInstance }),
1827
+ updateAdminMediaAudit: (options) => updateAdminMediaAudit({ throwOnError: true, ...options, client: clientInstance }),
1828
+ runAdminMediaAudit: (options) => runAdminMediaAudit({ throwOnError: true, ...options, client: clientInstance }),
1829
+ listAdminMediaAuditRuns: (options) => listAdminMediaAuditRuns({ throwOnError: true, ...options, client: clientInstance }),
1830
+ getAdminMediaAuditRun: (options) => getAdminMediaAuditRun({ throwOnError: true, ...options, client: clientInstance }),
1831
+ getAnnouncement: (options) => getAnnouncement({ throwOnError: true, ...options, client: clientInstance }),
1832
+ updateAnnouncement: (options) => updateAnnouncement({ throwOnError: true, ...options, client: clientInstance })
1733
1833
  };
1734
1834
  }
1735
1835
  // generated/dev/internal/media.gen.ts
@@ -1813,7 +1913,37 @@ __export(exports_admin_gen, {
1813
1913
  clearAdminImpersonation: () => clearAdminImpersonation,
1814
1914
  batchUpdateAdminReports: () => batchUpdateAdminReports
1815
1915
  });
1916
+ // generated/dev/paginate.ts
1917
+ async function* paginate(fn, options, extract) {
1918
+ let cursor = null;
1919
+ let first = true;
1920
+ while (true) {
1921
+ const callOptions = first ? options : patchCursor(options, cursor);
1922
+ first = false;
1923
+ const result = await fn(callOptions);
1924
+ if ("error" in result && result.error !== undefined) {
1925
+ throw result.error;
1926
+ }
1927
+ const { items, pagination } = extract(result.data);
1928
+ for (const item of items) {
1929
+ yield item;
1930
+ }
1931
+ if (!pagination.hasMore || pagination.cursor === null)
1932
+ break;
1933
+ cursor = pagination.cursor;
1934
+ }
1935
+ }
1936
+ function patchCursor(options, cursor) {
1937
+ if (options.body !== undefined) {
1938
+ return { ...options, body: { ...options.body, cursor } };
1939
+ }
1940
+ if (options.query !== undefined) {
1941
+ return { ...options, query: { ...options.query, cursor } };
1942
+ }
1943
+ return { ...options, body: { cursor } };
1944
+ }
1816
1945
  export {
1946
+ withRetry,
1817
1947
  exports_user_gen as user,
1818
1948
  updateUserPreferences,
1819
1949
  updateSeriesMedia,
@@ -1838,6 +1968,7 @@ export {
1838
1968
  removeSegmentFromCollection,
1839
1969
  removeMediaFromSeries,
1840
1970
  purgeAdminQueueFailed,
1971
+ paginate,
1841
1972
  exports_media_gen as media,
1842
1973
  listUserLabs,
1843
1974
  listUserActivity,
@@ -1898,8 +2029,9 @@ export {
1898
2029
  autocompleteMedia,
1899
2030
  exports_admin_gen as admin,
1900
2031
  addSegmentToCollection,
1901
- addMediaToSeries
2032
+ addMediaToSeries,
2033
+ NadeshikoError
1902
2034
  };
1903
2035
 
1904
- //# debugId=C36235197D26B5D064756E2164756E21
2036
+ //# debugId=3F5D995F00569FD264756E2164756E21
1905
2037
  //# sourceMappingURL=index.js.map