@fubar-it-co/tmdb-client 0.0.6 → 0.0.7
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/CHANGELOG.md +138 -63
- package/dist/client/@tanstack/react-query.gen.d.ts +35859 -0
- package/dist/client/@tanstack/react-query.gen.d.ts.map +1 -0
- package/dist/client/@tanstack/react-query.gen.js +4003 -0
- package/dist/client/@tanstack/react-query.gen.js.map +1 -0
- package/dist/client/client/client.gen.d.ts +3 -0
- package/dist/client/client/client.gen.d.ts.map +1 -0
- package/dist/client/client/client.gen.js +236 -0
- package/dist/client/client/client.gen.js.map +1 -0
- package/dist/client/client/index.d.ts +9 -0
- package/dist/client/client/index.d.ts.map +1 -0
- package/dist/client/client/index.js +8 -0
- package/dist/client/client/index.js.map +1 -0
- package/dist/client/client/types.gen.d.ts +118 -0
- package/dist/client/client/types.gen.d.ts.map +1 -0
- package/dist/client/client/types.gen.js +4 -0
- package/dist/client/client/types.gen.js.map +1 -0
- package/dist/client/client/utils.gen.d.ts +34 -0
- package/dist/client/client/utils.gen.d.ts.map +1 -0
- package/dist/client/client/utils.gen.js +230 -0
- package/dist/client/client/utils.gen.js.map +1 -0
- package/{src/client/client.gen.ts → dist/client/client.gen.d.ts} +3 -9
- package/dist/client/client.gen.d.ts.map +1 -0
- package/dist/client/client.gen.js +6 -0
- package/dist/client/client.gen.js.map +1 -0
- package/dist/client/core/auth.gen.d.ts +19 -0
- package/dist/client/core/auth.gen.d.ts.map +1 -0
- package/dist/client/core/auth.gen.js +16 -0
- package/dist/client/core/auth.gen.js.map +1 -0
- package/dist/client/core/bodySerializer.gen.d.ts +26 -0
- package/dist/client/core/bodySerializer.gen.d.ts.map +1 -0
- package/dist/client/core/bodySerializer.gen.js +59 -0
- package/dist/client/core/bodySerializer.gen.js.map +1 -0
- package/dist/client/core/params.gen.d.ts +44 -0
- package/dist/client/core/params.gen.d.ts.map +1 -0
- package/dist/client/core/params.gen.js +102 -0
- package/dist/client/core/params.gen.js.map +1 -0
- package/dist/client/core/pathSerializer.gen.d.ts +34 -0
- package/dist/client/core/pathSerializer.gen.d.ts.map +1 -0
- package/dist/client/core/pathSerializer.gen.js +108 -0
- package/dist/client/core/pathSerializer.gen.js.map +1 -0
- package/dist/client/core/queryKeySerializer.gen.d.ts +19 -0
- package/dist/client/core/queryKeySerializer.gen.d.ts.map +1 -0
- package/dist/client/core/queryKeySerializer.gen.js +94 -0
- package/dist/client/core/queryKeySerializer.gen.js.map +1 -0
- package/dist/client/core/serverSentEvents.gen.d.ts +72 -0
- package/dist/client/core/serverSentEvents.gen.d.ts.map +1 -0
- package/dist/client/core/serverSentEvents.gen.js +135 -0
- package/dist/client/core/serverSentEvents.gen.js.map +1 -0
- package/dist/client/core/types.gen.d.ts +79 -0
- package/dist/client/core/types.gen.d.ts.map +1 -0
- package/dist/client/core/types.gen.js +4 -0
- package/dist/client/core/types.gen.js.map +1 -0
- package/dist/client/core/utils.gen.d.ts +20 -0
- package/dist/client/core/utils.gen.d.ts.map +1 -0
- package/dist/client/core/utils.gen.js +89 -0
- package/dist/client/core/utils.gen.js.map +1 -0
- package/{src/client/index.ts → dist/client/index.d.ts} +2 -4
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +5 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/sdk.gen.d.ts +882 -0
- package/dist/client/sdk.gen.d.ts.map +1 -0
- package/dist/client/sdk.gen.js +1514 -0
- package/dist/client/sdk.gen.js.map +1 -0
- package/{src/client/types.gen.ts → dist/client/types.gen.d.ts} +8 -462
- package/dist/client/types.gen.d.ts.map +1 -0
- package/dist/client/types.gen.js +4 -0
- package/dist/client/types.gen.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/{src/index.ts → dist/index.js} +2 -5
- package/dist/index.js.map +1 -0
- package/{src/tmdb-config.ts → dist/tmdb-config.d.ts} +3 -25
- package/dist/tmdb-config.d.ts.map +1 -0
- package/dist/tmdb-config.js +31 -0
- package/dist/tmdb-config.js.map +1 -0
- package/{src/types/errors.ts → dist/types/errors.d.ts} +7 -6
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +2 -0
- package/dist/types/errors.js.map +1 -0
- package/package.json +9 -3
- package/.eslintignore +0 -1
- package/eslint.config.js +0 -15
- package/openapi-ts.config.ts +0 -43
- package/publish-local.sh +0 -86
- package/publish.sh +0 -114
- package/scripts/add-ts-nocheck.js +0 -85
- package/src/client/@tanstack/react-query.gen.ts +0 -4398
- package/src/client/client/client.gen.ts +0 -289
- package/src/client/client/index.ts +0 -26
- package/src/client/client/types.gen.ts +0 -214
- package/src/client/client/utils.gen.ts +0 -317
- package/src/client/core/auth.gen.ts +0 -42
- package/src/client/core/bodySerializer.gen.ts +0 -85
- package/src/client/core/params.gen.ts +0 -170
- package/src/client/core/pathSerializer.gen.ts +0 -172
- package/src/client/core/queryKeySerializer.gen.ts +0 -118
- package/src/client/core/serverSentEvents.gen.ts +0 -244
- package/src/client/core/types.gen.ts +0 -105
- package/src/client/core/utils.gen.ts +0 -141
- package/src/client/sdk.gen.ts +0 -1682
- package/src/vite-env.d.ts +0 -9
- package/tsconfig.build.json +0 -12
- package/tsconfig.json +0 -17
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
|
|
4
|
-
import type { BodySerializer, QuerySerializer } from './bodySerializer.gen';
|
|
5
|
-
import {
|
|
6
|
-
type ArraySeparatorStyle,
|
|
7
|
-
serializeArrayParam,
|
|
8
|
-
serializeObjectParam,
|
|
9
|
-
serializePrimitiveParam,
|
|
10
|
-
} from './pathSerializer.gen';
|
|
11
|
-
|
|
12
|
-
export interface PathSerializer {
|
|
13
|
-
path: Record<string, unknown>;
|
|
14
|
-
url: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const PATH_PARAM_RE = /\{[^{}]+\}/g;
|
|
18
|
-
|
|
19
|
-
export const defaultPathSerializer = ({ path, url: _url }: PathSerializer) => {
|
|
20
|
-
let url = _url;
|
|
21
|
-
const matches = _url.match(PATH_PARAM_RE);
|
|
22
|
-
if (matches) {
|
|
23
|
-
for (const match of matches) {
|
|
24
|
-
let explode = false;
|
|
25
|
-
let name = match.substring(1, match.length - 1);
|
|
26
|
-
let style: ArraySeparatorStyle = 'simple';
|
|
27
|
-
|
|
28
|
-
if (name.endsWith('*')) {
|
|
29
|
-
explode = true;
|
|
30
|
-
name = name.substring(0, name.length - 1);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (name.startsWith('.')) {
|
|
34
|
-
name = name.substring(1);
|
|
35
|
-
style = 'label';
|
|
36
|
-
} else if (name.startsWith(';')) {
|
|
37
|
-
name = name.substring(1);
|
|
38
|
-
style = 'matrix';
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const value = path[name];
|
|
42
|
-
|
|
43
|
-
if (value === undefined || value === null) {
|
|
44
|
-
continue;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (Array.isArray(value)) {
|
|
48
|
-
url = url.replace(match, serializeArrayParam({ explode, name, style, value }));
|
|
49
|
-
continue;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
if (typeof value === 'object') {
|
|
53
|
-
url = url.replace(
|
|
54
|
-
match,
|
|
55
|
-
serializeObjectParam({
|
|
56
|
-
explode,
|
|
57
|
-
name,
|
|
58
|
-
style,
|
|
59
|
-
value: value as Record<string, unknown>,
|
|
60
|
-
valueOnly: true,
|
|
61
|
-
}),
|
|
62
|
-
);
|
|
63
|
-
continue;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (style === 'matrix') {
|
|
67
|
-
url = url.replace(
|
|
68
|
-
match,
|
|
69
|
-
`;${serializePrimitiveParam({
|
|
70
|
-
name,
|
|
71
|
-
value: value as string,
|
|
72
|
-
})}`,
|
|
73
|
-
);
|
|
74
|
-
continue;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const replaceValue = encodeURIComponent(
|
|
78
|
-
style === 'label' ? `.${value as string}` : (value as string),
|
|
79
|
-
);
|
|
80
|
-
url = url.replace(match, replaceValue);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return url;
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
export const getUrl = ({
|
|
87
|
-
baseUrl,
|
|
88
|
-
path,
|
|
89
|
-
query,
|
|
90
|
-
querySerializer,
|
|
91
|
-
url: _url,
|
|
92
|
-
}: {
|
|
93
|
-
baseUrl?: string;
|
|
94
|
-
path?: Record<string, unknown>;
|
|
95
|
-
query?: Record<string, unknown>;
|
|
96
|
-
querySerializer: QuerySerializer;
|
|
97
|
-
url: string;
|
|
98
|
-
}) => {
|
|
99
|
-
const pathUrl = _url.startsWith('/') ? _url : `/${_url}`;
|
|
100
|
-
let url = (baseUrl ?? '') + pathUrl;
|
|
101
|
-
if (path) {
|
|
102
|
-
url = defaultPathSerializer({ path, url });
|
|
103
|
-
}
|
|
104
|
-
let search = query ? querySerializer(query) : '';
|
|
105
|
-
if (search.startsWith('?')) {
|
|
106
|
-
search = search.substring(1);
|
|
107
|
-
}
|
|
108
|
-
if (search) {
|
|
109
|
-
url += `?${search}`;
|
|
110
|
-
}
|
|
111
|
-
return url;
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
export function getValidRequestBody(options: {
|
|
115
|
-
body?: unknown;
|
|
116
|
-
bodySerializer?: BodySerializer | null;
|
|
117
|
-
serializedBody?: unknown;
|
|
118
|
-
}) {
|
|
119
|
-
const hasBody = options.body !== undefined;
|
|
120
|
-
const isSerializedBody = hasBody && options.bodySerializer;
|
|
121
|
-
|
|
122
|
-
if (isSerializedBody) {
|
|
123
|
-
if ('serializedBody' in options) {
|
|
124
|
-
const hasSerializedBody =
|
|
125
|
-
options.serializedBody !== undefined && options.serializedBody !== '';
|
|
126
|
-
|
|
127
|
-
return hasSerializedBody ? options.serializedBody : null;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
// not all clients implement a serializedBody property (i.e. client-axios)
|
|
131
|
-
return options.body !== '' ? options.body : null;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// plain/text body
|
|
135
|
-
if (hasBody) {
|
|
136
|
-
return options.body;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// no body was provided
|
|
140
|
-
return undefined;
|
|
141
|
-
}
|