@brigadasos/nadeshiko-sdk 1.0.0 → 1.4.0-dev.2819d72
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/LICENSE +21 -0
- package/README.md +22 -125
- package/dist/client/client.gen.d.ts.map +1 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/types.gen.d.ts.map +1 -0
- package/dist/client/utils.gen.d.ts.map +1 -0
- package/dist/client.gen.d.ts.map +1 -0
- package/dist/core/auth.gen.d.ts.map +1 -0
- package/dist/core/bodySerializer.gen.d.ts.map +1 -0
- package/dist/core/params.gen.d.ts.map +1 -0
- package/dist/core/pathSerializer.gen.d.ts.map +1 -0
- package/dist/core/queryKeySerializer.gen.d.ts.map +1 -0
- package/dist/core/serverSentEvents.gen.d.ts.map +1 -0
- package/dist/core/types.gen.d.ts.map +1 -0
- package/dist/core/utils.gen.d.ts.map +1 -0
- package/dist/index.cjs +1482 -0
- package/dist/index.cjs.map +20 -0
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1461 -6
- package/dist/index.js.map +20 -1
- package/dist/internal/lists.gen.d.ts +2 -0
- package/dist/internal/lists.gen.d.ts.map +1 -0
- package/dist/internal/media.gen.d.ts +2 -0
- package/dist/internal/media.gen.d.ts.map +1 -0
- package/dist/internal/search.gen.d.ts +2 -0
- package/dist/internal/search.gen.d.ts.map +1 -0
- package/dist/internal.gen.d.ts +4 -0
- package/dist/internal.gen.d.ts.map +1 -0
- package/dist/nadeshiko.gen.d.ts +74 -0
- package/dist/nadeshiko.gen.d.ts.map +1 -0
- package/dist/sdk.gen.d.ts +641 -0
- package/dist/sdk.gen.d.ts.map +1 -0
- package/dist/types.gen.d.ts +4793 -0
- package/dist/types.gen.d.ts.map +1 -0
- package/package.json +13 -20
- package/dist/generated/client/client.gen.d.ts.map +0 -1
- package/dist/generated/client/client.gen.js +0 -236
- package/dist/generated/client/client.gen.js.map +0 -1
- package/dist/generated/client/index.d.ts.map +0 -1
- package/dist/generated/client/index.js +0 -7
- package/dist/generated/client/index.js.map +0 -1
- package/dist/generated/client/types.gen.d.ts.map +0 -1
- package/dist/generated/client/types.gen.js +0 -3
- package/dist/generated/client/types.gen.js.map +0 -1
- package/dist/generated/client/utils.gen.d.ts.map +0 -1
- package/dist/generated/client/utils.gen.js +0 -234
- package/dist/generated/client/utils.gen.js.map +0 -1
- package/dist/generated/client.gen.d.ts.map +0 -1
- package/dist/generated/client.gen.js +0 -4
- package/dist/generated/client.gen.js.map +0 -1
- package/dist/generated/core/auth.gen.d.ts.map +0 -1
- package/dist/generated/core/auth.gen.js +0 -15
- package/dist/generated/core/auth.gen.js.map +0 -1
- package/dist/generated/core/bodySerializer.gen.d.ts.map +0 -1
- package/dist/generated/core/bodySerializer.gen.js +0 -58
- package/dist/generated/core/bodySerializer.gen.js.map +0 -1
- package/dist/generated/core/params.gen.d.ts.map +0 -1
- package/dist/generated/core/params.gen.js +0 -101
- package/dist/generated/core/params.gen.js.map +0 -1
- package/dist/generated/core/pathSerializer.gen.d.ts.map +0 -1
- package/dist/generated/core/pathSerializer.gen.js +0 -115
- package/dist/generated/core/pathSerializer.gen.js.map +0 -1
- package/dist/generated/core/queryKeySerializer.gen.d.ts.map +0 -1
- package/dist/generated/core/queryKeySerializer.gen.js +0 -100
- package/dist/generated/core/queryKeySerializer.gen.js.map +0 -1
- package/dist/generated/core/serverSentEvents.gen.d.ts.map +0 -1
- package/dist/generated/core/serverSentEvents.gen.js +0 -138
- package/dist/generated/core/serverSentEvents.gen.js.map +0 -1
- package/dist/generated/core/types.gen.d.ts.map +0 -1
- package/dist/generated/core/types.gen.js +0 -3
- package/dist/generated/core/types.gen.js.map +0 -1
- package/dist/generated/core/utils.gen.d.ts.map +0 -1
- package/dist/generated/core/utils.gen.js +0 -88
- package/dist/generated/core/utils.gen.js.map +0 -1
- package/dist/generated/index.d.ts +0 -3
- package/dist/generated/index.d.ts.map +0 -1
- package/dist/generated/index.js +0 -3
- package/dist/generated/index.js.map +0 -1
- package/dist/generated/sdk.gen.d.ts +0 -97
- package/dist/generated/sdk.gen.d.ts.map +0 -1
- package/dist/generated/sdk.gen.js +0 -132
- package/dist/generated/sdk.gen.js.map +0 -1
- package/dist/generated/types.gen.d.ts +0 -726
- package/dist/generated/types.gen.d.ts.map +0 -1
- package/dist/generated/types.gen.js +0 -3
- package/dist/generated/types.gen.js.map +0 -1
- package/dist/nadeshiko.d.ts +0 -70
- package/dist/nadeshiko.d.ts.map +0 -1
- package/dist/nadeshiko.js +0 -84
- package/dist/nadeshiko.js.map +0 -1
- /package/dist/{generated/client → client}/client.gen.d.ts +0 -0
- /package/dist/{generated/client → client}/index.d.ts +0 -0
- /package/dist/{generated/client → client}/types.gen.d.ts +0 -0
- /package/dist/{generated/client → client}/utils.gen.d.ts +0 -0
- /package/dist/{generated/client.gen.d.ts → client.gen.d.ts} +0 -0
- /package/dist/{generated/core → core}/auth.gen.d.ts +0 -0
- /package/dist/{generated/core → core}/bodySerializer.gen.d.ts +0 -0
- /package/dist/{generated/core → core}/params.gen.d.ts +0 -0
- /package/dist/{generated/core → core}/pathSerializer.gen.d.ts +0 -0
- /package/dist/{generated/core → core}/queryKeySerializer.gen.d.ts +0 -0
- /package/dist/{generated/core → core}/serverSentEvents.gen.d.ts +0 -0
- /package/dist/{generated/core → core}/types.gen.d.ts +0 -0
- /package/dist/{generated/core → core}/utils.gen.d.ts +0 -0
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
-
/**
|
|
3
|
-
* Replacer that converts non-JSON values (bigint, Date, etc.) to safe substitutes.
|
|
4
|
-
*/
|
|
5
|
-
export const queryKeyJsonReplacer = (_key, value) => {
|
|
6
|
-
if (value === undefined ||
|
|
7
|
-
typeof value === 'function' ||
|
|
8
|
-
typeof value === 'symbol') {
|
|
9
|
-
return undefined;
|
|
10
|
-
}
|
|
11
|
-
if (typeof value === 'bigint') {
|
|
12
|
-
return value.toString();
|
|
13
|
-
}
|
|
14
|
-
if (value instanceof Date) {
|
|
15
|
-
return value.toISOString();
|
|
16
|
-
}
|
|
17
|
-
return value;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Safely stringifies a value and parses it back into a JsonValue.
|
|
21
|
-
*/
|
|
22
|
-
export const stringifyToJsonValue = (input) => {
|
|
23
|
-
try {
|
|
24
|
-
const json = JSON.stringify(input, queryKeyJsonReplacer);
|
|
25
|
-
if (json === undefined) {
|
|
26
|
-
return undefined;
|
|
27
|
-
}
|
|
28
|
-
return JSON.parse(json);
|
|
29
|
-
}
|
|
30
|
-
catch {
|
|
31
|
-
return undefined;
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Detects plain objects (including objects with a null prototype).
|
|
36
|
-
*/
|
|
37
|
-
const isPlainObject = (value) => {
|
|
38
|
-
if (value === null || typeof value !== 'object') {
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
const prototype = Object.getPrototypeOf(value);
|
|
42
|
-
return prototype === Object.prototype || prototype === null;
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Turns URLSearchParams into a sorted JSON object for deterministic keys.
|
|
46
|
-
*/
|
|
47
|
-
const serializeSearchParams = (params) => {
|
|
48
|
-
const entries = Array.from(params.entries()).sort(([a], [b]) => a.localeCompare(b));
|
|
49
|
-
const result = {};
|
|
50
|
-
for (const [key, value] of entries) {
|
|
51
|
-
const existing = result[key];
|
|
52
|
-
if (existing === undefined) {
|
|
53
|
-
result[key] = value;
|
|
54
|
-
continue;
|
|
55
|
-
}
|
|
56
|
-
if (Array.isArray(existing)) {
|
|
57
|
-
existing.push(value);
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
result[key] = [existing, value];
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return result;
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* Normalizes any accepted value into a JSON-friendly shape for query keys.
|
|
67
|
-
*/
|
|
68
|
-
export const serializeQueryKeyValue = (value) => {
|
|
69
|
-
if (value === null) {
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
if (typeof value === 'string' ||
|
|
73
|
-
typeof value === 'number' ||
|
|
74
|
-
typeof value === 'boolean') {
|
|
75
|
-
return value;
|
|
76
|
-
}
|
|
77
|
-
if (value === undefined ||
|
|
78
|
-
typeof value === 'function' ||
|
|
79
|
-
typeof value === 'symbol') {
|
|
80
|
-
return undefined;
|
|
81
|
-
}
|
|
82
|
-
if (typeof value === 'bigint') {
|
|
83
|
-
return value.toString();
|
|
84
|
-
}
|
|
85
|
-
if (value instanceof Date) {
|
|
86
|
-
return value.toISOString();
|
|
87
|
-
}
|
|
88
|
-
if (Array.isArray(value)) {
|
|
89
|
-
return stringifyToJsonValue(value);
|
|
90
|
-
}
|
|
91
|
-
if (typeof URLSearchParams !== 'undefined' &&
|
|
92
|
-
value instanceof URLSearchParams) {
|
|
93
|
-
return serializeSearchParams(value);
|
|
94
|
-
}
|
|
95
|
-
if (isPlainObject(value)) {
|
|
96
|
-
return stringifyToJsonValue(value);
|
|
97
|
-
}
|
|
98
|
-
return undefined;
|
|
99
|
-
};
|
|
100
|
-
//# sourceMappingURL=queryKeySerializer.gen.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"queryKeySerializer.gen.js","sourceRoot":"","sources":["../../../src/generated/core/queryKeySerializer.gen.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAarD;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,IAAY,EAAE,KAAc,EAAE,EAAE;IACnE,IACE,KAAK,KAAK,SAAS;QACnB,OAAO,KAAK,KAAK,UAAU;QAC3B,OAAO,KAAK,KAAK,QAAQ,EACzB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QA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,CAAC;IACrC,CAAC;IAED,IACE,OAAO,eAAe,KAAK,WAAW;QACtC,KAAK,YAAY,eAAe,EAChC,CAAC;QACD,OAAO,qBAAqB,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,oBAAoB,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"serverSentEvents.gen.d.ts","sourceRoot":"","sources":["../../../src/generated/core/serverSentEvents.gen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,MAAM,uBAAuB,CAAC,KAAK,GAAG,OAAO,IAAI,IAAI,CACzD,WAAW,EACX,QAAQ,CACT,GACC,IAAI,CAAC,MAAM,EAAE,QAAQ,GAAG,qBAAqB,GAAG,mBAAmB,CAAC,GAAG;IACrE;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACjE;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;IACjD,cAAc,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACrC;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;;;;;;OAQG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEJ,MAAM,WAAW,WAAW,CAAC,KAAK,GAAG,OAAO;IAC1C,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,sBAAsB,CAChC,KAAK,GAAG,OAAO,EACf,OAAO,GAAG,IAAI,EACd,KAAK,GAAG,OAAO,IACb;IACF,MAAM,EAAE,cAAc,CACpB,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,MAAM,KAAK,CAAC,GAAG,KAAK,EAClE,OAAO,EACP,KAAK,CACN,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,KAAK,GAAG,OAAO,EAAE,yKAY9C,uBAAuB,KAAG,sBAAsB,CAAC,KAAK,CAqKxD,CAAC"}
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
-
export const createSseClient = ({ onRequest, onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url, ...options }) => {
|
|
3
|
-
let lastEventId;
|
|
4
|
-
const sleep = sseSleepFn ??
|
|
5
|
-
((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
6
|
-
const createStream = async function* () {
|
|
7
|
-
let retryDelay = sseDefaultRetryDelay ?? 3000;
|
|
8
|
-
let attempt = 0;
|
|
9
|
-
const signal = options.signal ?? new AbortController().signal;
|
|
10
|
-
while (true) {
|
|
11
|
-
if (signal.aborted)
|
|
12
|
-
break;
|
|
13
|
-
attempt++;
|
|
14
|
-
const headers = options.headers instanceof Headers
|
|
15
|
-
? options.headers
|
|
16
|
-
: new Headers(options.headers);
|
|
17
|
-
if (lastEventId !== undefined) {
|
|
18
|
-
headers.set('Last-Event-ID', lastEventId);
|
|
19
|
-
}
|
|
20
|
-
try {
|
|
21
|
-
const requestInit = {
|
|
22
|
-
redirect: 'follow',
|
|
23
|
-
...options,
|
|
24
|
-
body: options.serializedBody,
|
|
25
|
-
headers,
|
|
26
|
-
signal,
|
|
27
|
-
};
|
|
28
|
-
let request = new Request(url, requestInit);
|
|
29
|
-
if (onRequest) {
|
|
30
|
-
request = await onRequest(url, requestInit);
|
|
31
|
-
}
|
|
32
|
-
// fetch must be assigned here, otherwise it would throw the error:
|
|
33
|
-
// TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
|
|
34
|
-
const _fetch = options.fetch ?? globalThis.fetch;
|
|
35
|
-
const response = await _fetch(request);
|
|
36
|
-
if (!response.ok)
|
|
37
|
-
throw new Error(`SSE failed: ${response.status} ${response.statusText}`);
|
|
38
|
-
if (!response.body)
|
|
39
|
-
throw new Error('No body in SSE response');
|
|
40
|
-
const reader = response.body
|
|
41
|
-
.pipeThrough(new TextDecoderStream())
|
|
42
|
-
.getReader();
|
|
43
|
-
let buffer = '';
|
|
44
|
-
const abortHandler = () => {
|
|
45
|
-
try {
|
|
46
|
-
reader.cancel();
|
|
47
|
-
}
|
|
48
|
-
catch {
|
|
49
|
-
// noop
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
signal.addEventListener('abort', abortHandler);
|
|
53
|
-
try {
|
|
54
|
-
while (true) {
|
|
55
|
-
const { done, value } = await reader.read();
|
|
56
|
-
if (done)
|
|
57
|
-
break;
|
|
58
|
-
buffer += value;
|
|
59
|
-
// Normalize line endings: CRLF -> LF, then CR -> LF
|
|
60
|
-
buffer = buffer.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
|
|
61
|
-
const chunks = buffer.split('\n\n');
|
|
62
|
-
buffer = chunks.pop() ?? '';
|
|
63
|
-
for (const chunk of chunks) {
|
|
64
|
-
const lines = chunk.split('\n');
|
|
65
|
-
const dataLines = [];
|
|
66
|
-
let eventName;
|
|
67
|
-
for (const line of lines) {
|
|
68
|
-
if (line.startsWith('data:')) {
|
|
69
|
-
dataLines.push(line.replace(/^data:\s*/, ''));
|
|
70
|
-
}
|
|
71
|
-
else if (line.startsWith('event:')) {
|
|
72
|
-
eventName = line.replace(/^event:\s*/, '');
|
|
73
|
-
}
|
|
74
|
-
else if (line.startsWith('id:')) {
|
|
75
|
-
lastEventId = line.replace(/^id:\s*/, '');
|
|
76
|
-
}
|
|
77
|
-
else if (line.startsWith('retry:')) {
|
|
78
|
-
const parsed = Number.parseInt(line.replace(/^retry:\s*/, ''), 10);
|
|
79
|
-
if (!Number.isNaN(parsed)) {
|
|
80
|
-
retryDelay = parsed;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
let data;
|
|
85
|
-
let parsedJson = false;
|
|
86
|
-
if (dataLines.length) {
|
|
87
|
-
const rawData = dataLines.join('\n');
|
|
88
|
-
try {
|
|
89
|
-
data = JSON.parse(rawData);
|
|
90
|
-
parsedJson = true;
|
|
91
|
-
}
|
|
92
|
-
catch {
|
|
93
|
-
data = rawData;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
if (parsedJson) {
|
|
97
|
-
if (responseValidator) {
|
|
98
|
-
await responseValidator(data);
|
|
99
|
-
}
|
|
100
|
-
if (responseTransformer) {
|
|
101
|
-
data = await responseTransformer(data);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
onSseEvent?.({
|
|
105
|
-
data,
|
|
106
|
-
event: eventName,
|
|
107
|
-
id: lastEventId,
|
|
108
|
-
retry: retryDelay,
|
|
109
|
-
});
|
|
110
|
-
if (dataLines.length) {
|
|
111
|
-
yield data;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
finally {
|
|
117
|
-
signal.removeEventListener('abort', abortHandler);
|
|
118
|
-
reader.releaseLock();
|
|
119
|
-
}
|
|
120
|
-
break; // exit loop on normal completion
|
|
121
|
-
}
|
|
122
|
-
catch (error) {
|
|
123
|
-
// connection failed or aborted; retry after delay
|
|
124
|
-
onSseError?.(error);
|
|
125
|
-
if (sseMaxRetryAttempts !== undefined &&
|
|
126
|
-
attempt >= sseMaxRetryAttempts) {
|
|
127
|
-
break; // stop after firing error
|
|
128
|
-
}
|
|
129
|
-
// exponential backoff: double retry each attempt, cap at 30s
|
|
130
|
-
const backoff = Math.min(retryDelay * 2 ** (attempt - 1), sseMaxRetryDelay ?? 30000);
|
|
131
|
-
await sleep(backoff);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
const stream = createStream();
|
|
136
|
-
return { stream };
|
|
137
|
-
};
|
|
138
|
-
//# sourceMappingURL=serverSentEvents.gen.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"serverSentEvents.gen.js","sourceRoot":"","sources":["../../../src/generated/core/serverSentEvents.gen.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAwFrD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAkB,EAC/C,SAAS,EACT,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,UAAU,EACV,GAAG,EACH,GAAG,OAAO,EACc,EAAiC,EAAE;IAC3D,IAAI,WAA+B,CAAC;IAEpC,MAAM,KAAK,GACT,UAAU;QACV,CAAC,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAEtE,MAAM,YAAY,GAAG,KAAK,SAAS,CAAC;QAClC,IAAI,UAAU,GAAW,oBAAoB,IAAI,IAAI,CAAC;QACtD,IAAI,OAAO,GAAG,CA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AE,eAAe,GAAG,sBAAsB,CAAC;IAC3D;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACvD;;;OAGG;IACH,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1D;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACzD;AAED,KAAK,8BAA8B,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GACxD,IAAI,GACJ,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,GAAG,SAAS,CAAC,GAC7B,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,GACrB,KAAK,GACL,IAAI,GACN,KAAK,CAAC;AAEZ,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;KACxD,CAAC,IAAI,MAAM,CAAC,IAAI,8BAA8B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GAC9D,KAAK,GACL,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACb,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.gen.js","sourceRoot":"","sources":["../../../src/generated/core/types.gen.ts"],"names":[],"mappings":"AAAA,qDAAqD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.gen.d.ts","sourceRoot":"","sources":["../../../src/generated/core/utils.gen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAQ5E,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,GAAG,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,aAAa,QAAgB,CAAC;AAE3C,eAAO,MAAM,qBAAqB,GAAI,qBAAqB,cAAc,WAoExE,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,uDAMpB;IACD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,eAAe,EAAE,eAAe,CAAC;IACjC,GAAG,EAAE,MAAM,CAAC;CACb,WAcA,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE;IAC3C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,cAAc,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,WAuBA"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
-
import { serializeArrayParam, serializeObjectParam, serializePrimitiveParam, } from './pathSerializer.gen';
|
|
3
|
-
export const PATH_PARAM_RE = /\{[^{}]+\}/g;
|
|
4
|
-
export const defaultPathSerializer = ({ path, url: _url }) => {
|
|
5
|
-
let url = _url;
|
|
6
|
-
const matches = _url.match(PATH_PARAM_RE);
|
|
7
|
-
if (matches) {
|
|
8
|
-
for (const match of matches) {
|
|
9
|
-
let explode = false;
|
|
10
|
-
let name = match.substring(1, match.length - 1);
|
|
11
|
-
let style = 'simple';
|
|
12
|
-
if (name.endsWith('*')) {
|
|
13
|
-
explode = true;
|
|
14
|
-
name = name.substring(0, name.length - 1);
|
|
15
|
-
}
|
|
16
|
-
if (name.startsWith('.')) {
|
|
17
|
-
name = name.substring(1);
|
|
18
|
-
style = 'label';
|
|
19
|
-
}
|
|
20
|
-
else if (name.startsWith(';')) {
|
|
21
|
-
name = name.substring(1);
|
|
22
|
-
style = 'matrix';
|
|
23
|
-
}
|
|
24
|
-
const value = path[name];
|
|
25
|
-
if (value === undefined || value === null) {
|
|
26
|
-
continue;
|
|
27
|
-
}
|
|
28
|
-
if (Array.isArray(value)) {
|
|
29
|
-
url = url.replace(match, serializeArrayParam({ explode, name, style, value }));
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
if (typeof value === 'object') {
|
|
33
|
-
url = url.replace(match, serializeObjectParam({
|
|
34
|
-
explode,
|
|
35
|
-
name,
|
|
36
|
-
style,
|
|
37
|
-
value: value,
|
|
38
|
-
valueOnly: true,
|
|
39
|
-
}));
|
|
40
|
-
continue;
|
|
41
|
-
}
|
|
42
|
-
if (style === 'matrix') {
|
|
43
|
-
url = url.replace(match, `;${serializePrimitiveParam({
|
|
44
|
-
name,
|
|
45
|
-
value: value,
|
|
46
|
-
})}`);
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
const replaceValue = encodeURIComponent(style === 'label' ? `.${value}` : value);
|
|
50
|
-
url = url.replace(match, replaceValue);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return url;
|
|
54
|
-
};
|
|
55
|
-
export const getUrl = ({ baseUrl, path, query, querySerializer, url: _url, }) => {
|
|
56
|
-
const pathUrl = _url.startsWith('/') ? _url : `/${_url}`;
|
|
57
|
-
let url = (baseUrl ?? '') + pathUrl;
|
|
58
|
-
if (path) {
|
|
59
|
-
url = defaultPathSerializer({ path, url });
|
|
60
|
-
}
|
|
61
|
-
let search = query ? querySerializer(query) : '';
|
|
62
|
-
if (search.startsWith('?')) {
|
|
63
|
-
search = search.substring(1);
|
|
64
|
-
}
|
|
65
|
-
if (search) {
|
|
66
|
-
url += `?${search}`;
|
|
67
|
-
}
|
|
68
|
-
return url;
|
|
69
|
-
};
|
|
70
|
-
export function getValidRequestBody(options) {
|
|
71
|
-
const hasBody = options.body !== undefined;
|
|
72
|
-
const isSerializedBody = hasBody && options.bodySerializer;
|
|
73
|
-
if (isSerializedBody) {
|
|
74
|
-
if ('serializedBody' in options) {
|
|
75
|
-
const hasSerializedBody = options.serializedBody !== undefined && options.serializedBody !== '';
|
|
76
|
-
return hasSerializedBody ? options.serializedBody : null;
|
|
77
|
-
}
|
|
78
|
-
// not all clients implement a serializedBody property (i.e. client-axios)
|
|
79
|
-
return options.body !== '' ? options.body : null;
|
|
80
|
-
}
|
|
81
|
-
// plain/text body
|
|
82
|
-
if (hasBody) {
|
|
83
|
-
return options.body;
|
|
84
|
-
}
|
|
85
|
-
// no body was provided
|
|
86
|
-
return undefined;
|
|
87
|
-
}
|
|
88
|
-
//# sourceMappingURL=utils.gen.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.gen.js","sourceRoot":"","sources":["../../../src/generated/core/utils.gen.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAGrD,OAAO,EAEL,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAO9B,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAC;AAE3C,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAkB,EAAE,EAAE;IAC3E,IAAI,GAAG,GAAG,IAAI,CAAC;IACf,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IAC1C,IAAI,OAAO,EAAE,CAAC;QACZ,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,IAAI,OAAO,GAAG,KAAK,CAAC;YACpB,IAAI,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YAChD,IAAI,KAAK,GAAwB,QAAQ,CAAC;YAE1C,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBACvB,OAAO,GAAG,IAAI,CAAC;gBACf,IAAI,GA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C,cAAc,CAAC;IAE3D,IAAI,gBAAgB,EAAE,CAAC;QACrB,IAAI,gBAAgB,IAAI,OAAO,EAAE,CAAC;YAChC,MAAM,iBAAiB,GACrB,OAAO,CAAC,cAAc,KAAK,SAAS,IAAI,OAAO,CAAC,cAAc,KAAK,EAAE,CAAC;YAExE,OAAO,iBAAiB,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC;QAC3D,CAAC;QAED,0EAA0E;QAC1E,OAAO,OAAO,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IACnD,CAAC;IAED,kBAAkB;IAClB,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,OAAO,CAAC,IAAI,CAAC;IACtB,CAAC;IAED,uBAAuB;IACvB,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -1,3 +0,0 @@
|
|
|
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';
|
|
3
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,sBAAsB,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/generated/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/generated/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAErD,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAgB,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1,97 +0,0 @@
|
|
|
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';
|
|
3
|
-
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
|
|
4
|
-
/**
|
|
5
|
-
* You can provide a client instance returned by `createClient()` instead of
|
|
6
|
-
* individual options. This might be also useful if you want to implement a
|
|
7
|
-
* custom client.
|
|
8
|
-
*/
|
|
9
|
-
client?: Client;
|
|
10
|
-
/**
|
|
11
|
-
* You can pass arbitrary values through the `meta` object. This can be
|
|
12
|
-
* used to access values that aren't defined as part of the SDK function.
|
|
13
|
-
*/
|
|
14
|
-
meta?: Record<string, unknown>;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Health check for search
|
|
18
|
-
*
|
|
19
|
-
* Tests the search service connectivity and functionality by performing a simple search query.
|
|
20
|
-
*
|
|
21
|
-
* **Requirements:**
|
|
22
|
-
* - Required Scopes: `READ_MEDIA`
|
|
23
|
-
*
|
|
24
|
-
*/
|
|
25
|
-
export declare const searchHealthCheck: <ThrowOnError extends boolean = false>(options?: Options<SearchHealthCheckData, ThrowOnError>) => import("./client").RequestResult<SearchHealthCheckResponses, SearchHealthCheckErrors, ThrowOnError, "fields">;
|
|
26
|
-
/**
|
|
27
|
-
* Search by query
|
|
28
|
-
*
|
|
29
|
-
* The primary search endpoint for finding Japanese sentences and their translations across indexed media (anime, J-Drama, audiobooks).
|
|
30
|
-
*
|
|
31
|
-
* This endpoint uses Elasticsearch with advanced Japanese text analysis supporting multiple input types (romaji, kanji, kana) and providing intelligent field-based boosting.
|
|
32
|
-
*
|
|
33
|
-
* **Query Features**
|
|
34
|
-
* - **Multi-language Support:** Search using Japanese (kanji/kana), Romaji, or English/Spanish
|
|
35
|
-
* - **Boolean Operators:** `AND`, `OR`, `NOT` supported (e.g., `(cat OR dog) AND bird`)
|
|
36
|
-
* - **Phrase Matching:** Use quotes for exact phrases (e.g., `"good morning"`), or pass `exact_match: true` to the request body
|
|
37
|
-
* - **Wildcards:** `te*t` format (leading wildcards not supported)
|
|
38
|
-
* - **Smart Field Selection:** Automatically chooses optimal search fields based on input type
|
|
39
|
-
*
|
|
40
|
-
* **Input Type Handling**
|
|
41
|
-
* | Input Type | Search Strategy |
|
|
42
|
-
* |------------|-----------------|
|
|
43
|
-
* | **Romaji** (`go`, `taberu`) | Boosts EN/ES translations, reading form (pronunciation), and base form |
|
|
44
|
-
* | **Kanji** (`食べる`, `彼女`) | Searches content and base form (dictionary form). Ignores matches by reading (homophones). |
|
|
45
|
-
* | **Kana** (`たべる`, `かのじょ`) | Standard search across content, base form, and reading form |
|
|
46
|
-
* | **English/Spanish** | Direct translation search |
|
|
47
|
-
*
|
|
48
|
-
* **Requirements**
|
|
49
|
-
* - API Key with `READ_MEDIA` permission
|
|
50
|
-
*
|
|
51
|
-
*/
|
|
52
|
-
export declare const search: <ThrowOnError extends boolean = false>(options?: Options<SearchData, ThrowOnError>) => import("./client").RequestResult<SearchResponses, SearchErrors, ThrowOnError, "fields">;
|
|
53
|
-
/**
|
|
54
|
-
* Search by multiple queries
|
|
55
|
-
*
|
|
56
|
-
* Searches for multiple words simultaneously and aggregates results by media.
|
|
57
|
-
*
|
|
58
|
-
* Unlike the main search endpoint, this returns a summary of matches per media rather than individual sentence segments.
|
|
59
|
-
*
|
|
60
|
-
* **Use Cases**
|
|
61
|
-
* - Vocabulary discovery across media library
|
|
62
|
-
* - Finding anime/dramas that use specific words
|
|
63
|
-
* - Comparing word usage across different titles
|
|
64
|
-
*
|
|
65
|
-
* **Requirements:**
|
|
66
|
-
* - Required Scopes: `READ_MEDIA`
|
|
67
|
-
*
|
|
68
|
-
*/
|
|
69
|
-
export declare const searchMultiple: <ThrowOnError extends boolean = false>(options: Options<SearchMultipleData, ThrowOnError>) => import("./client").RequestResult<SearchMultipleResponses, SearchMultipleErrors, ThrowOnError, "fields">;
|
|
70
|
-
/**
|
|
71
|
-
* Fetch context for a sentence
|
|
72
|
-
*
|
|
73
|
-
* Retrieves sentences surrounding a specific segment position within an episode.
|
|
74
|
-
* Returns segments both before and after the target position, providing context for understanding how a sentence is used in dialogue.
|
|
75
|
-
*
|
|
76
|
-
* **Requirements:**
|
|
77
|
-
* - Required scopes: `READ_MEDIA`
|
|
78
|
-
*
|
|
79
|
-
*/
|
|
80
|
-
export declare const fetchSentenceContext: <ThrowOnError extends boolean = false>(options: Options<FetchSentenceContextData, ThrowOnError>) => import("./client").RequestResult<FetchSentenceContextResponses, FetchSentenceContextErrors, ThrowOnError, "fields">;
|
|
81
|
-
/**
|
|
82
|
-
* Fetch media info
|
|
83
|
-
*
|
|
84
|
-
* Lists available media with metadata and supports filtering by type and search query.
|
|
85
|
-
*
|
|
86
|
-
* Returns paginated results with comprehensive media information including cover/banner images, episode counts, and genres.
|
|
87
|
-
*
|
|
88
|
-
* **Use Cases**
|
|
89
|
-
* - Browsing the media library
|
|
90
|
-
* - Getting media metadata for display
|
|
91
|
-
*
|
|
92
|
-
* **Requirements:**
|
|
93
|
-
* - Required Scopes: `READ_MEDIA`
|
|
94
|
-
*
|
|
95
|
-
*/
|
|
96
|
-
export declare const fetchMediaInfo: <ThrowOnError extends boolean = false>(options?: Options<FetchMediaInfoData, ThrowOnError>) => import("./client").RequestResult<FetchMediaInfoResponses, FetchMediaInfoErrors, ThrowOnError, "fields">;
|
|
97
|
-
//# sourceMappingURL=sdk.gen.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.gen.d.ts","sourceRoot":"","sources":["../../src/generated/sdk.gen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,IAAI,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAExE,OAAO,KAAK,EAA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,CAAC,kBAAkB,EAAE,YAAY,CAAC,4GAQtH,CAAC"}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
-
import { client } from './client.gen';
|
|
3
|
-
/**
|
|
4
|
-
* Health check for search
|
|
5
|
-
*
|
|
6
|
-
* Tests the search service connectivity and functionality by performing a simple search query.
|
|
7
|
-
*
|
|
8
|
-
* **Requirements:**
|
|
9
|
-
* - Required Scopes: `READ_MEDIA`
|
|
10
|
-
*
|
|
11
|
-
*/
|
|
12
|
-
export const searchHealthCheck = (options) => (options?.client ?? client).get({
|
|
13
|
-
security: [{ name: 'X-API-Key', type: 'apiKey' }],
|
|
14
|
-
url: '/v1/search/health',
|
|
15
|
-
...options
|
|
16
|
-
});
|
|
17
|
-
/**
|
|
18
|
-
* Search by query
|
|
19
|
-
*
|
|
20
|
-
* The primary search endpoint for finding Japanese sentences and their translations across indexed media (anime, J-Drama, audiobooks).
|
|
21
|
-
*
|
|
22
|
-
* This endpoint uses Elasticsearch with advanced Japanese text analysis supporting multiple input types (romaji, kanji, kana) and providing intelligent field-based boosting.
|
|
23
|
-
*
|
|
24
|
-
* **Query Features**
|
|
25
|
-
* - **Multi-language Support:** Search using Japanese (kanji/kana), Romaji, or English/Spanish
|
|
26
|
-
* - **Boolean Operators:** `AND`, `OR`, `NOT` supported (e.g., `(cat OR dog) AND bird`)
|
|
27
|
-
* - **Phrase Matching:** Use quotes for exact phrases (e.g., `"good morning"`), or pass `exact_match: true` to the request body
|
|
28
|
-
* - **Wildcards:** `te*t` format (leading wildcards not supported)
|
|
29
|
-
* - **Smart Field Selection:** Automatically chooses optimal search fields based on input type
|
|
30
|
-
*
|
|
31
|
-
* **Input Type Handling**
|
|
32
|
-
* | Input Type | Search Strategy |
|
|
33
|
-
* |------------|-----------------|
|
|
34
|
-
* | **Romaji** (`go`, `taberu`) | Boosts EN/ES translations, reading form (pronunciation), and base form |
|
|
35
|
-
* | **Kanji** (`食べる`, `彼女`) | Searches content and base form (dictionary form). Ignores matches by reading (homophones). |
|
|
36
|
-
* | **Kana** (`たべる`, `かのじょ`) | Standard search across content, base form, and reading form |
|
|
37
|
-
* | **English/Spanish** | Direct translation search |
|
|
38
|
-
*
|
|
39
|
-
* **Requirements**
|
|
40
|
-
* - API Key with `READ_MEDIA` permission
|
|
41
|
-
*
|
|
42
|
-
*/
|
|
43
|
-
export const search = (options) => (options?.client ?? client).post({
|
|
44
|
-
security: [{ name: 'X-API-Key', type: 'apiKey' }, {
|
|
45
|
-
in: 'cookie',
|
|
46
|
-
name: 'access_token',
|
|
47
|
-
type: 'apiKey'
|
|
48
|
-
}],
|
|
49
|
-
url: '/v1/search/media/sentence',
|
|
50
|
-
...options,
|
|
51
|
-
headers: {
|
|
52
|
-
'Content-Type': 'application/json',
|
|
53
|
-
...options?.headers
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
/**
|
|
57
|
-
* Search by multiple queries
|
|
58
|
-
*
|
|
59
|
-
* Searches for multiple words simultaneously and aggregates results by media.
|
|
60
|
-
*
|
|
61
|
-
* Unlike the main search endpoint, this returns a summary of matches per media rather than individual sentence segments.
|
|
62
|
-
*
|
|
63
|
-
* **Use Cases**
|
|
64
|
-
* - Vocabulary discovery across media library
|
|
65
|
-
* - Finding anime/dramas that use specific words
|
|
66
|
-
* - Comparing word usage across different titles
|
|
67
|
-
*
|
|
68
|
-
* **Requirements:**
|
|
69
|
-
* - Required Scopes: `READ_MEDIA`
|
|
70
|
-
*
|
|
71
|
-
*/
|
|
72
|
-
export const searchMultiple = (options) => (options.client ?? client).post({
|
|
73
|
-
security: [{ name: 'X-API-Key', type: 'apiKey' }, {
|
|
74
|
-
in: 'cookie',
|
|
75
|
-
name: 'access_token',
|
|
76
|
-
type: 'apiKey'
|
|
77
|
-
}],
|
|
78
|
-
url: '/v1/search/media/match/words',
|
|
79
|
-
...options,
|
|
80
|
-
headers: {
|
|
81
|
-
'Content-Type': 'application/json',
|
|
82
|
-
...options.headers
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
/**
|
|
86
|
-
* Fetch context for a sentence
|
|
87
|
-
*
|
|
88
|
-
* Retrieves sentences surrounding a specific segment position within an episode.
|
|
89
|
-
* Returns segments both before and after the target position, providing context for understanding how a sentence is used in dialogue.
|
|
90
|
-
*
|
|
91
|
-
* **Requirements:**
|
|
92
|
-
* - Required scopes: `READ_MEDIA`
|
|
93
|
-
*
|
|
94
|
-
*/
|
|
95
|
-
export const fetchSentenceContext = (options) => (options.client ?? client).post({
|
|
96
|
-
security: [{ name: 'X-API-Key', type: 'apiKey' }, {
|
|
97
|
-
in: 'cookie',
|
|
98
|
-
name: 'access_token',
|
|
99
|
-
type: 'apiKey'
|
|
100
|
-
}],
|
|
101
|
-
url: '/v1/search/media/context',
|
|
102
|
-
...options,
|
|
103
|
-
headers: {
|
|
104
|
-
'Content-Type': 'application/json',
|
|
105
|
-
...options.headers
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
/**
|
|
109
|
-
* Fetch media info
|
|
110
|
-
*
|
|
111
|
-
* Lists available media with metadata and supports filtering by type and search query.
|
|
112
|
-
*
|
|
113
|
-
* Returns paginated results with comprehensive media information including cover/banner images, episode counts, and genres.
|
|
114
|
-
*
|
|
115
|
-
* **Use Cases**
|
|
116
|
-
* - Browsing the media library
|
|
117
|
-
* - Getting media metadata for display
|
|
118
|
-
*
|
|
119
|
-
* **Requirements:**
|
|
120
|
-
* - Required Scopes: `READ_MEDIA`
|
|
121
|
-
*
|
|
122
|
-
*/
|
|
123
|
-
export const fetchMediaInfo = (options) => (options?.client ?? client).get({
|
|
124
|
-
security: [{ name: 'X-API-Key', type: 'apiKey' }, {
|
|
125
|
-
in: 'cookie',
|
|
126
|
-
name: 'access_token',
|
|
127
|
-
type: 'apiKey'
|
|
128
|
-
}],
|
|
129
|
-
url: '/v1/search/media/info',
|
|
130
|
-
...options
|
|
131
|
-
});
|
|
132
|
-
//# sourceMappingURL=sdk.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