@brigadasos/nadeshiko-sdk 1.0.0 → 1.3.0

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 (54) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +19 -128
  3. package/dist/generated/client.gen.d.ts.map +1 -1
  4. package/dist/generated/index.d.ts +5 -2
  5. package/dist/generated/index.d.ts.map +1 -1
  6. package/dist/generated/nadeshiko.gen.d.ts +27 -0
  7. package/dist/generated/nadeshiko.gen.d.ts.map +1 -0
  8. package/dist/generated/sdk.gen.d.ts +161 -1
  9. package/dist/generated/sdk.gen.d.ts.map +1 -1
  10. package/dist/generated/types.gen.d.ts +1467 -192
  11. package/dist/generated/types.gen.d.ts.map +1 -1
  12. package/dist/index.cjs +993 -0
  13. package/dist/index.cjs.map +20 -0
  14. package/dist/index.d.ts +0 -2
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +961 -6
  17. package/dist/index.js.map +20 -1
  18. package/package.json +14 -17
  19. package/dist/generated/client/client.gen.js +0 -236
  20. package/dist/generated/client/client.gen.js.map +0 -1
  21. package/dist/generated/client/index.js +0 -7
  22. package/dist/generated/client/index.js.map +0 -1
  23. package/dist/generated/client/types.gen.js +0 -3
  24. package/dist/generated/client/types.gen.js.map +0 -1
  25. package/dist/generated/client/utils.gen.js +0 -234
  26. package/dist/generated/client/utils.gen.js.map +0 -1
  27. package/dist/generated/client.gen.js +0 -4
  28. package/dist/generated/client.gen.js.map +0 -1
  29. package/dist/generated/core/auth.gen.js +0 -15
  30. package/dist/generated/core/auth.gen.js.map +0 -1
  31. package/dist/generated/core/bodySerializer.gen.js +0 -58
  32. package/dist/generated/core/bodySerializer.gen.js.map +0 -1
  33. package/dist/generated/core/params.gen.js +0 -101
  34. package/dist/generated/core/params.gen.js.map +0 -1
  35. package/dist/generated/core/pathSerializer.gen.js +0 -115
  36. package/dist/generated/core/pathSerializer.gen.js.map +0 -1
  37. package/dist/generated/core/queryKeySerializer.gen.js +0 -100
  38. package/dist/generated/core/queryKeySerializer.gen.js.map +0 -1
  39. package/dist/generated/core/serverSentEvents.gen.js +0 -138
  40. package/dist/generated/core/serverSentEvents.gen.js.map +0 -1
  41. package/dist/generated/core/types.gen.js +0 -3
  42. package/dist/generated/core/types.gen.js.map +0 -1
  43. package/dist/generated/core/utils.gen.js +0 -88
  44. package/dist/generated/core/utils.gen.js.map +0 -1
  45. package/dist/generated/index.js +0 -3
  46. package/dist/generated/index.js.map +0 -1
  47. package/dist/generated/sdk.gen.js +0 -132
  48. package/dist/generated/sdk.gen.js.map +0 -1
  49. package/dist/generated/types.gen.js +0 -3
  50. package/dist/generated/types.gen.js.map +0 -1
  51. package/dist/nadeshiko.d.ts +0 -70
  52. package/dist/nadeshiko.d.ts.map +0 -1
  53. package/dist/nadeshiko.js +0 -84
  54. package/dist/nadeshiko.js.map +0 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) BrigadaSOS
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,142 +1,33 @@
1
- # Nadeshiko SDK (TypeScript)
1
+ # Nadeshiko SDK
2
2
 
3
- TypeScript SDK for the [Nadeshiko API](https://nadeshiko.co) - Search Japanese sentences across anime, J-Drama, and audiobooks.
3
+ TypeScript SDK for the [Nadeshiko API](https://nadeshiko.co).
4
4
 
5
- ## Quick Start
5
+ ## Install
6
6
 
7
- ```typescript
8
- import Nadeshiko from 'nadeshiko-sdk-ts';
9
-
10
- // Configure your client once at app startup
11
- Nadeshiko.configure({
12
- apiKey: 'your-api-key-here',
13
- baseUrl: 'PRODUCTION', // or 'LOCAL', 'DEVELOPMENT', or custom URL
14
- });
15
-
16
- // Use the namespaced methods (names match OpenAPI operationIds)
17
- const result = await Nadeshiko.search({
18
- body: {
19
- query: '彼女',
20
- limit: 10,
21
- },
22
- });
23
-
24
- if (result.error) {
25
- console.error(result.error.code, result.error.detail);
26
- } else {
27
- console.log(result.data.sentences);
28
- }
7
+ ```bash
8
+ bun add @brigadasos/nadeshiko-sdk
29
9
  ```
30
10
 
31
- ## API Methods
32
-
33
- All methods are namespaced under `Nadeshiko` and match the OpenAPI operationIds exactly:
34
-
35
- You can check the full specification from the [OpenAPI spec page](https://nadeshiko.co/api/v1/docs).
11
+ ## Use the public SDK
36
12
 
13
+ The client sends your API key as `Authorization: Bearer <apiKey>`.
37
14
 
38
- ## Error Handling
39
-
40
- All methods return `{ data?, error? }`. Choose your style:
41
-
42
- **Option 1: Check for errors**
43
15
  ```typescript
44
- const result = await Nadeshiko.search({ body: { query: '彼女' } });
45
-
46
- if (result.error) {
47
- // Error type is fully generated from OpenAPI spec
48
- console.error(result.error.code); // e.g., 'RATE_LIMIT_EXCEEDED'
49
- console.error(result.error.title); // e.g., 'Rate Limit Exceeded'
50
- console.error(result.error.detail); // Detailed message
51
- console.error(result.error.status); // HTTP status code
52
- } else {
53
- console.log(result.data.sentences);
54
- }
55
- ```
56
-
57
- **Option 2: Let it throw**
58
- ```typescript
59
- try {
60
- const result = await Nadeshiko.search({
61
- body: { query: '彼女' },
62
- throwOnError: true,
63
- });
64
- console.log(result.data.sentences);
65
- } catch (error) {
66
- console.error(error);
67
- }
68
- ```
16
+ import { createClient, search } from '@brigadasos/nadeshiko-sdk';
69
17
 
70
- In general, all SDK methods return typed errors generated from the OpenAPI spec:
71
-
72
- ```typescript
73
- type Error = {
74
- code: string; // e.g., 'RATE_LIMIT_EXCEEDED', 'AUTH_CREDENTIALS_INVALID'
75
- title: string; // Short summary
76
- detail: string; // Detailed explanation
77
- status: number; // HTTP status code
78
- type?: string; // URI to error documentation
79
- instance?: string; // Trace ID
80
- errors?: Record<string, string>; // Validation errors
81
- };
82
- ```
83
-
84
- Handle each error independently based on the error code returned by the API.
85
-
86
- ```typescript
87
- import Nadeshiko from 'nadeshiko-sdk-ts';
18
+ const client = createClient({
19
+ apiKey: process.env.NADESHIKO_API_KEY!,
20
+ baseUrl: 'PRODUCTION',
21
+ });
88
22
 
89
- const result = await Nadeshiko.search({ body: { query: '彼女' } });
23
+ const result = await search({
24
+ client,
25
+ body: { query: '彼女' },
26
+ });
90
27
 
91
28
  if (result.error) {
92
- // All error fields are typed
93
- switch (result.error.code) {
94
- case 'RATE_LIMIT_EXCEEDED':
95
- console.log('Wait before retrying');
96
- break;
97
- case 'AUTH_CREDENTIALS_INVALID':
98
- console.log('Check your API key');
99
- break;
100
- case 'VALIDATION_FAILED':
101
- console.log('Field errors:', result.error.errors);
102
- break;
103
- default:
104
- console.log(result.error.detail);
105
- }
29
+ console.error(result.error.code, result.error.detail);
30
+ } else {
31
+ console.log(result.data);
106
32
  }
107
33
  ```
108
-
109
- You can check the full list of errors codes for each endpoint from the [OpenAPI spec page](https://nadeshiko.co/api/v1/docs).
110
-
111
- ## TypeScript Support
112
-
113
- All types are auto-generated from the OpenAPI spec.
114
-
115
- ```typescript
116
- import type {
117
- SearchRequest,
118
- SearchResponse,
119
- Sentence,
120
- MediaInfoData,
121
- } from 'nadeshiko-sdk-ts';
122
-
123
- const request: SearchRequest = {
124
- query: '彼女',
125
- limit: 10,
126
- };
127
-
128
- const sentence: Sentence = {
129
- basic_info: { /* ... */ },
130
- segment_info: { /* ... */ },
131
- media_info: { /* ... */ },
132
- };
133
- ```
134
-
135
- ## Examples
136
-
137
- See `examples/example.ts` for more usage examples.
138
-
139
- ## References
140
-
141
- - [Nadeshiko Website](https://nadeshiko.co)
142
- - [API Documentation](https://nadeshiko.co/settings/api)
@@ -1 +1 @@
1
- {"version":3,"file":"client.gen.d.ts","sourceRoot":"","sources":["../../src/generated/client.gen.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,MAAM,EAA8B,MAAM,UAAU,CAAC;AACvF,OAAO,KAAK,EAAE,aAAa,IAAI,cAAc,EAAE,MAAM,aAAa,CAAC;AAEnE;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,aAAa,GAAG,cAAc,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,aAAa,GAAG,CAAC,CAAC,KAAK,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;AAEzJ,eAAO,MAAM,MAAM,2BAAuF,CAAC"}
1
+ {"version":3,"file":"client.gen.d.ts","sourceRoot":"","sources":["../../src/generated/client.gen.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,MAAM,EAA8B,MAAM,UAAU,CAAC;AACvF,OAAO,KAAK,EAAE,aAAa,IAAI,cAAc,EAAE,MAAM,aAAa,CAAC;AAEnE;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,aAAa,GAAG,cAAc,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,aAAa,GAAG,CAAC,CAAC,KAAK,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;AAEzJ,eAAO,MAAM,MAAM,2BAAmF,CAAC"}
@@ -1,3 +1,6 @@
1
- export { fetchMediaInfo, fetchSentenceContext, type Options, search, searchHealthCheck, searchMultiple } from './sdk.gen';
2
- export type { BasicInfo, CategoryStatistic, ClientOptions, Error, FetchMediaInfoData, FetchMediaInfoError, FetchMediaInfoErrors, FetchMediaInfoResponse, FetchMediaInfoResponse2, FetchMediaInfoResponses, FetchSentenceContextData, FetchSentenceContextError, FetchSentenceContextErrors, FetchSentenceContextRequest, FetchSentenceContextResponse, FetchSentenceContextResponse2, FetchSentenceContextResponses, MediaInfoData, MediaInfoPath, MediaInfoStats, SearchData, SearchError, SearchErrors, SearchHealthCheckData, SearchHealthCheckError, SearchHealthCheckErrors, SearchHealthCheckResponse, SearchHealthCheckResponse2, SearchHealthCheckResponses, SearchMultipleData, SearchMultipleError, SearchMultipleErrors, SearchMultipleRequest, SearchMultipleResponse, SearchMultipleResponse2, SearchMultipleResponses, SearchRequest, SearchResponse, SearchResponse2, SearchResponses, SegmentInfo, Sentence, Statistic, WordMatch, WordMatchMedia } from './types.gen';
1
+ export { searchHealthCheck, search, searchMultiple, fetchSentenceContext, fetchMediaInfo, mediaIndex, mediaShow, episodeIndex, episodeShow, segmentShow, segmentShowByUuid, characterShow, seiyuuShow, listIndex, listShow, type Options } from './sdk.gen';
2
+ export type { SearchHealthCheckData, SearchHealthCheckErrors, SearchHealthCheckError, SearchHealthCheckResponses, SearchHealthCheckResponse, SearchData, SearchErrors, SearchError, SearchResponses, SearchResponse, SearchMultipleData, SearchMultipleErrors, SearchMultipleError, SearchMultipleResponses, SearchMultipleResponse, FetchSentenceContextData, FetchSentenceContextErrors, FetchSentenceContextError, FetchSentenceContextResponses, FetchSentenceContextResponse, FetchMediaInfoData, FetchMediaInfoErrors, FetchMediaInfoError, FetchMediaInfoResponses, FetchMediaInfoResponse, MediaIndexData, MediaIndexErrors, MediaIndexError, MediaIndexResponses, MediaIndexResponse, MediaShowData, MediaShowErrors, MediaShowError, MediaShowResponses, MediaShowResponse, EpisodeIndexData, EpisodeIndexErrors, EpisodeIndexError, EpisodeIndexResponses, EpisodeIndexResponse, EpisodeShowData, EpisodeShowErrors, EpisodeShowError, EpisodeShowResponses, EpisodeShowResponse, SegmentShowData, SegmentShowErrors, SegmentShowError, SegmentShowResponses, SegmentShowResponse, SegmentShowByUuidData, SegmentShowByUuidErrors, SegmentShowByUuidError, SegmentShowByUuidResponses, SegmentShowByUuidResponse, CharacterShowData, CharacterShowErrors, CharacterShowError, CharacterShowResponses, CharacterShowResponse, SeiyuuShowData, SeiyuuShowErrors, SeiyuuShowError, SeiyuuShowResponses, SeiyuuShowResponse, ListIndexData, ListIndexErrors, ListIndexError, ListIndexResponses, ListIndexResponse, ListShowData, ListShowErrors, ListShowError, ListShowResponses, ListShowResponse } from './types.gen';
3
+ export { createClient, createNadeshikoClient, type NadeshikoClient, type NadeshikoConfig } from './nadeshiko.gen';
4
+ export { client } from './client.gen';
5
+ export type { Client, Config } from './client';
3
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/generated/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,KAAK,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC1H,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,aAAa,EAAE,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,6BAA6B,EAAE,6BAA6B,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,qBAAqB,EAAE,s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B,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGlH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { type Client } from './client';
2
+ import { searchHealthCheck, search, searchMultiple, fetchSentenceContext, fetchMediaInfo, mediaIndex, mediaShow, episodeIndex, episodeShow, segmentShow, segmentShowByUuid, characterShow, seiyuuShow, listIndex, listShow } from './sdk.gen';
3
+ export interface NadeshikoConfig {
4
+ apiKey: string;
5
+ baseUrl?: 'LOCAL' | 'DEVELOPMENT' | 'PRODUCTION' | string;
6
+ }
7
+ export type NadeshikoClient = {
8
+ client: Client;
9
+ searchHealthCheck: typeof searchHealthCheck;
10
+ search: typeof search;
11
+ searchMultiple: typeof searchMultiple;
12
+ fetchSentenceContext: typeof fetchSentenceContext;
13
+ fetchMediaInfo: typeof fetchMediaInfo;
14
+ mediaIndex: typeof mediaIndex;
15
+ mediaShow: typeof mediaShow;
16
+ episodeIndex: typeof episodeIndex;
17
+ episodeShow: typeof episodeShow;
18
+ segmentShow: typeof segmentShow;
19
+ segmentShowByUuid: typeof segmentShowByUuid;
20
+ characterShow: typeof characterShow;
21
+ seiyuuShow: typeof seiyuuShow;
22
+ listIndex: typeof listIndex;
23
+ listShow: typeof listShow;
24
+ };
25
+ export declare function createNadeshikoClient(config: NadeshikoConfig): NadeshikoClient;
26
+ export declare const createClient: typeof createNadeshikoClient;
27
+ //# sourceMappingURL=nadeshiko.gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nadeshiko.gen.d.ts","sourceRoot":"","sources":["../../src/generated/nadeshiko.gen.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiD,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC;AAEtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,cAAc,EAAE,oBAAoB,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE9O,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,GAAG,aAAa,GAAG,YAAY,GAAG,MAAM,CAAC;CAC3D;AAQD,MAAM,MAAM,eAAe,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,OAAO,iBAAiB,CAAC;IAC5C,MAAM,EAAE,OAAO,MAAM,CAAC;IACtB,cAAc,EAAE,OAAO,cAAc,CAAC;IACtC,oBAAoB,EAAE,OAAO,oBAAoB,CAAC;IAClD,cAAc,EAAE,OAAO,cAAc,CAAC;IACtC,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,SAAS,EAAE,OAAO,SAAS,CAAC;IAC5B,YAAY,EAAE,OAAO,YAAY,CAAC;IAClC,WAAW,EAAE,OAAO,WAAW,CAAC;IAChC,WAAW,EAAE,OAAO,WAAW,CAAC;IAChC,iBAAiB,EAAE,OAAO,iBAAiB,CAAC;IAC5C,aAAa,EAAE,OAAO,aAAa,CAAC;IACpC,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,SAAS,EAAE,OAAO,SAAS,CAAC;IAC5B,QAAQ,EAAE,OAAO,QAAQ,CAAC;CAC3B,CAAC;AAEJ,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,eAAe,GAAG,eAAe,CA8B9E;AAGD,eAAO,MAAM,YAAY,8BAAwB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { Client, Options as Options2, TDataShape } from './client';
2
- import type { FetchMediaInfoData, FetchMediaInfoErrors, FetchMediaInfoResponses, FetchSentenceContextData, FetchSentenceContextErrors, FetchSentenceContextResponses, SearchData, SearchErrors, SearchHealthCheckData, SearchHealthCheckErrors, SearchHealthCheckResponses, SearchMultipleData, SearchMultipleErrors, SearchMultipleResponses, SearchResponses } from './types.gen';
2
+ import type { CharacterShowData, CharacterShowErrors, CharacterShowResponses, EpisodeIndexData, EpisodeIndexErrors, EpisodeIndexResponses, EpisodeShowData, EpisodeShowErrors, EpisodeShowResponses, FetchMediaInfoData, FetchMediaInfoErrors, FetchMediaInfoResponses, FetchSentenceContextData, FetchSentenceContextErrors, FetchSentenceContextResponses, GetFailedJobsData, GetFailedJobsErrors, GetFailedJobsResponses, GetQueueDetailsData, GetQueueDetailsErrors, GetQueueDetailsResponses, GetQueueStatsData, GetQueueStatsErrors, GetQueueStatsResponses, ListIndexData, ListIndexErrors, ListIndexResponses, ListShowData, ListShowErrors, ListShowResponses, MediaIndexData, MediaIndexErrors, MediaIndexResponses, MediaShowData, MediaShowErrors, MediaShowResponses, PurgeFailedJobsData, PurgeFailedJobsErrors, PurgeFailedJobsResponses, ReindexElasticsearchData, ReindexElasticsearchErrors, ReindexElasticsearchResponses, RetryQueueJobsData, RetryQueueJobsErrors, RetryQueueJobsResponses, SearchData, SearchErrors, SearchHealthCheckData, SearchHealthCheckErrors, SearchHealthCheckResponses, SearchMultipleData, SearchMultipleErrors, SearchMultipleResponses, SearchResponses, SegmentShowByUuidData, SegmentShowByUuidErrors, SegmentShowByUuidResponses, SegmentShowData, SegmentShowErrors, SegmentShowResponses, SeiyuuShowData, SeiyuuShowErrors, SeiyuuShowResponses } from './types.gen';
3
3
  export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
4
4
  /**
5
5
  * You can provide a client instance returned by `createClient()` instead of
@@ -94,4 +94,164 @@ export declare const fetchSentenceContext: <ThrowOnError extends boolean = false
94
94
  *
95
95
  */
96
96
  export declare const fetchMediaInfo: <ThrowOnError extends boolean = false>(options?: Options<FetchMediaInfoData, ThrowOnError>) => import("./client").RequestResult<FetchMediaInfoResponses, FetchMediaInfoErrors, ThrowOnError, "fields">;
97
+ /**
98
+ * List all media
99
+ *
100
+ * Returns a paginated list of media with full metadata, including cover/banner images, episode counts, and genres.
101
+ *
102
+ */
103
+ export declare const mediaIndex: <ThrowOnError extends boolean = false>(options?: Options<MediaIndexData, ThrowOnError>) => import("./client").RequestResult<MediaIndexResponses, MediaIndexErrors, ThrowOnError, "fields">;
104
+ /**
105
+ * Get single media
106
+ *
107
+ * Retrieves a single media entry by its ID.
108
+ *
109
+ */
110
+ export declare const mediaShow: <ThrowOnError extends boolean = false>(options: Options<MediaShowData, ThrowOnError>) => import("./client").RequestResult<MediaShowResponses, MediaShowErrors, ThrowOnError, "fields">;
111
+ /**
112
+ * List episodes for a media
113
+ *
114
+ * Get a paginated list of episodes for a specific media
115
+ *
116
+ */
117
+ export declare const episodeIndex: <ThrowOnError extends boolean = false>(options: Options<EpisodeIndexData, ThrowOnError>) => import("./client").RequestResult<EpisodeIndexResponses, EpisodeIndexErrors, ThrowOnError, "fields">;
118
+ /**
119
+ * Get single episode
120
+ *
121
+ * Get a specific episode by media ID and episode number
122
+ *
123
+ */
124
+ export declare const episodeShow: <ThrowOnError extends boolean = false>(options: Options<EpisodeShowData, ThrowOnError>) => import("./client").RequestResult<EpisodeShowResponses, EpisodeShowErrors, ThrowOnError, "fields">;
125
+ /**
126
+ * Get single segment
127
+ *
128
+ * Get a specific segment by ID
129
+ *
130
+ */
131
+ export declare const segmentShow: <ThrowOnError extends boolean = false>(options: Options<SegmentShowData, ThrowOnError>) => import("./client").RequestResult<SegmentShowResponses, SegmentShowErrors, ThrowOnError, "fields">;
132
+ /**
133
+ * Get segment by UUID
134
+ *
135
+ * Get a specific segment by its UUID
136
+ *
137
+ */
138
+ export declare const segmentShowByUuid: <ThrowOnError extends boolean = false>(options: Options<SegmentShowByUuidData, ThrowOnError>) => import("./client").RequestResult<SegmentShowByUuidResponses, SegmentShowByUuidErrors, ThrowOnError, "fields">;
139
+ /**
140
+ * Get character details
141
+ *
142
+ * Returns a character with their seiyuu and all media appearances.
143
+ *
144
+ */
145
+ export declare const characterShow: <ThrowOnError extends boolean = false>(options: Options<CharacterShowData, ThrowOnError>) => import("./client").RequestResult<CharacterShowResponses, CharacterShowErrors, ThrowOnError, "fields">;
146
+ /**
147
+ * Get seiyuu details
148
+ *
149
+ * Returns a voice actor with all characters they voiced and media appearances.
150
+ *
151
+ */
152
+ export declare const seiyuuShow: <ThrowOnError extends boolean = false>(options: Options<SeiyuuShowData, ThrowOnError>) => import("./client").RequestResult<SeiyuuShowResponses, SeiyuuShowErrors, ThrowOnError, "fields">;
153
+ /**
154
+ * List all lists
155
+ *
156
+ * Returns all lists matching the query filters. Can filter by media ID to find lists containing a specific media. Public lists are visible to all users.
157
+ *
158
+ */
159
+ export declare const listIndex: <ThrowOnError extends boolean = false>(options?: Options<ListIndexData, ThrowOnError>) => import("./client").RequestResult<ListIndexResponses, ListIndexErrors, ThrowOnError, "fields">;
160
+ /**
161
+ * Get list details
162
+ *
163
+ * Returns a list with all media in order (sorted by position).
164
+ *
165
+ */
166
+ export declare const listShow: <ThrowOnError extends boolean = false>(options: Options<ListShowData, ThrowOnError>) => import("./client").RequestResult<ListShowResponses, ListShowErrors, ThrowOnError, "fields">;
167
+ /**
168
+ * Reindex database into Elasticsearch
169
+ *
170
+ * Reindexes segments from the PostgreSQL database into Elasticsearch.
171
+ * Allows filtering by specific media IDs or episodes.
172
+ *
173
+ * **Requirements:**
174
+ * - Required Scopes: `ADD_MEDIA` (admin-level permission for reindexing)
175
+ *
176
+ * **Behavior:**
177
+ * - If no filters provided, reindexes all segments
178
+ * - If `mediaIds` provided, reindexes all segments from those media
179
+ * - If `episodes` provided, reindexes only the specified episodes
180
+ *
181
+ */
182
+ export declare const reindexElasticsearch: <ThrowOnError extends boolean = false>(options?: Options<ReindexElasticsearchData, ThrowOnError>) => import("./client").RequestResult<ReindexElasticsearchResponses, ReindexElasticsearchErrors, ThrowOnError, "fields">;
183
+ /**
184
+ * Get queue statistics
185
+ *
186
+ * Get statistics for all ES sync queues including pending and failed job counts.
187
+ *
188
+ * **Requirements:**
189
+ * - Required Scopes: `ADD_MEDIA` (admin-level permission)
190
+ *
191
+ * **Use cases:**
192
+ * - Monitor queue health
193
+ * - Detect stuck jobs
194
+ * - Check backlog size
195
+ *
196
+ */
197
+ export declare const getQueueStats: <ThrowOnError extends boolean = false>(options?: Options<GetQueueStatsData, ThrowOnError>) => import("./client").RequestResult<GetQueueStatsResponses, GetQueueStatsErrors, ThrowOnError, "fields">;
198
+ /**
199
+ * Get detailed queue information
200
+ *
201
+ * Get detailed information about a specific queue including completed, expired, and cancelled jobs.
202
+ *
203
+ * **Requirements:**
204
+ * - Required Scopes: `ADD_MEDIA` (admin-level permission)
205
+ *
206
+ * **Queue names:**
207
+ * - `es-sync-create` - Jobs to create new segments
208
+ * - `es-sync-update` - Jobs to update existing segments
209
+ * - `es-sync-delete` - Jobs to delete segments
210
+ *
211
+ */
212
+ export declare const getQueueDetails: <ThrowOnError extends boolean = false>(options: Options<GetQueueDetailsData, ThrowOnError>) => import("./client").RequestResult<GetQueueDetailsResponses, GetQueueDetailsErrors, ThrowOnError, "fields">;
213
+ /**
214
+ * Get failed jobs from a queue
215
+ *
216
+ * Get jobs that have exceeded their retry limit and permanently failed.
217
+ *
218
+ * **Requirements:**
219
+ * - Required Scopes: `ADD_MEDIA` (admin-level permission)
220
+ *
221
+ * **Use cases:**
222
+ * - Identify segments that failed to sync to Elasticsearch
223
+ * - Debug persistent sync issues
224
+ * - Decide whether to retry or purge failed jobs
225
+ *
226
+ */
227
+ export declare const getFailedJobs: <ThrowOnError extends boolean = false>(options: Options<GetFailedJobsData, ThrowOnError>) => import("./client").RequestResult<GetFailedJobsResponses, GetFailedJobsErrors, ThrowOnError, "fields">;
228
+ /**
229
+ * Retry failed jobs from a queue
230
+ *
231
+ * Retry all failed jobs from a specific queue.
232
+ *
233
+ * **Requirements:**
234
+ * - Required Scopes: `ADD_MEDIA` (admin-level permission)
235
+ *
236
+ * **Use cases:**
237
+ * - Retry jobs that failed due to temporary Elasticsearch issues
238
+ * - Recover from network blips
239
+ *
240
+ */
241
+ export declare const retryQueueJobs: <ThrowOnError extends boolean = false>(options: Options<RetryQueueJobsData, ThrowOnError>) => import("./client").RequestResult<RetryQueueJobsResponses, RetryQueueJobsErrors, ThrowOnError, "fields">;
242
+ /**
243
+ * Delete failed jobs from a queue
244
+ *
245
+ * Permanently delete all failed jobs from a queue.
246
+ *
247
+ * **Requirements:**
248
+ * - Required Scopes: `ADD_MEDIA` (admin-level permission)
249
+ *
250
+ * **Use cases:**
251
+ * - Clean up old failed jobs after investigating
252
+ * - Reset a queue after fixing the underlying issue
253
+ * - Note: This does NOT re-sync the segments - use the reindex endpoint for that
254
+ *
255
+ */
256
+ export declare const purgeFailedJobs: <ThrowOnError extends boolean = false>(options: Options<PurgeFailedJobsData, ThrowOnError>) => import("./client").RequestResult<PurgeFailedJobsResponses, PurgeFailedJobsErrors, ThrowOnError, "fields">;
97
257
  //# sourceMappingURL=sdk.gen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.gen.d.ts","sourceRoot":"","sources":["../../src/generated/sdk.gen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,O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